瀏覽代碼

1.接口配置文件规范化处理;2.设备台账建筑楼层筛选和统计接口替换;

zhangyu 4 年之前
父節點
當前提交
1b5c0709bf

+ 16 - 0
src/api/dict/index.js

@@ -0,0 +1,16 @@
+import fetch from "@/api/scan/fetch";
+import { baseUrl } from "@/api/scan/config";
+import http from "@/api/scan/httpUtil";
+import storage from "@/framework/utils/storage";
+
+//头部信息查询(查询所有设备类型-所有部件类型-所有系统类型-所有专业类型)
+export function queryPhysicsAllType(param, success) {
+  let url = `${baseUrl}/datacenter/dict/category`;
+  http.postJson(url, param, success);
+}
+
+//查询项目下类型的信息点
+export function getDataDictionary(param, success) {
+  let url = `${baseUrl}/datacenter/dict/query`;
+  http.postJson(url, param, success);
+}

+ 10 - 0
src/api/object/build.js

@@ -0,0 +1,10 @@
+import fetch from "@/api/scan/fetch";
+import { baseUrl } from "@/api/scan/config";
+import http from "@/api/scan/httpUtil";
+import storage from "@/framework/utils/storage";
+
+//查询建筑信息
+export function buildingQuery(param, success) {
+  let url = `${baseUrl}/datacenter/object/building/query`;
+  http.postJson(url, param, success);
+}

+ 16 - 0
src/api/object/equip.js

@@ -0,0 +1,16 @@
+import fetch from "@/api/scan/fetch";
+import { baseUrl } from "@/api/scan/config";
+import http from "@/api/scan/httpUtil";
+import storage from "@/framework/utils/storage";
+
+//设备清单 - 查询设备信息
+export function queryEquip(param, success) {
+  let url = `${baseUrl}/datacenter/object/equip/query`;
+  http.postJson(url, param, success);
+}
+
+//设备清单 - 统计项目下所有设备数量
+export function countEquip(param, success) {
+  let url = `${baseUrl}/datacenter/object/equip/count`;
+  http.postJson(url, param, success);
+}

+ 10 - 0
src/api/object/floor.js

@@ -0,0 +1,10 @@
+import fetch from "@/api/scan/fetch";
+import { baseUrl } from "@/api/scan/config";
+import http from "@/api/scan/httpUtil";
+import storage from "@/framework/utils/storage";
+
+//查询楼层信息
+export function floorQuery(param, success) {
+  let url = `${baseUrl}/datacenter/object/floor/query`;
+  http.postJson(url, param, success);
+}

+ 1 - 1
src/api/scan/request.js

@@ -1413,7 +1413,7 @@ export function countGeneralSys(param, success) {
 //头部信息查询(查询所有设备类型-所有部件类型-所有系统类型-所有专业类型)
 export function queryPhysicsAllType(param, success) {
   let url = `${baseUrl}/datacenter/class-def/category?type=${param}`;
-  http.postJson(url, {}, success)
+  http.postJson(url, {type:param }, success)
 }
 
 //查询所有设备族信息

+ 10 - 16
src/components/ledger/lib/cascader.vue

@@ -11,7 +11,8 @@
 </template>
 <script>
 import { mapGetters } from 'vuex';
-import { getEquipBelongs, queryEquip } from "@/api/scan/request";
+import { queryEquip } from "@/api/object/equip";
+import { queryPhysicsAllType } from "@/api/dict";
 export default {
   name: "getCode",
   props: {
@@ -72,23 +73,15 @@ export default {
     //获取当前项目下的设备类型(只拿到编码-需要过滤)
     getData() {
       let param2 = {
-        Distinct: true,
-        PageNumber: 1,
-        PageSize: 500,
-        Projection: [
-          "Category"
+        distinct: true,
+        pageNumber: 1,
+        pageSize: 1000,
+        projection: [
+          "classCode"
         ]
       }
       let param1 = {
-        data: {
-          Distinct: true,
-          Orders: "EquipName asc",
-          PageNumber: 1,
-          PageSize: 500,
-          Projection: [
-            "EquipCode", "EquipName"
-          ]
-        }
+        type: "equipment"
       }
       let promise2 = new Promise((resolve, reject) => {
         queryEquip(param2, res => {
@@ -96,12 +89,13 @@ export default {
         })
       })
       let promise1 = new Promise((resolve, reject) => {
-        getEquipBelongs(param1, res => {
+        queryPhysicsAllType(param1, res => {
           resolve(res)
         })
       })
       Promise.all([promise1, promise2]).then((res) => {
         let allData = res[0], data = res[1]
+        debugger
         this.options = this.formatOptions(allData.Content)
         if (!this.all) {
           this.content = data.Content.map(t => {

+ 4 - 3
src/components/ledger/lib/floorCascader.vue

@@ -5,9 +5,10 @@
     </div>
 </template>
 <script>
-    import tools from "@/utils/scan/tools"
-    import { floorQuery, buildingQuery } from '@/api/scan/request'
-    import { mapGetters, mapActions } from "vuex"
+    import tools from "@/utils/scan/tools";
+    import { buildingQuery } from '@/api/object/build';
+    import { floorQuery } from '@/api/object/floor';
+    import { mapGetters, mapActions } from "vuex";
 
     export default {
         props: {

+ 23 - 22
src/components/ledger/lib/linkassets.vue

@@ -87,21 +87,22 @@ export default {
     //获取建筑楼层数据
     getBuildFloorData() {
       let data, buildParams = {
-        PageNumber: 1,
-        PageSize: 1000,
-        Projection: [
-          "BuildID",
-          "BuildLocalName"
+        pageNumber: 1,
+        pageSize: 1000,
+        orders: "localName asc",
+        projection: [
+            "id",
+            "localName"
         ]
       }, floorParams = {
-        Orders: "FloorSequenceID desc",
-        PageNumber: 1,
-        PageSize: 1000,
-        Projection: [
-          "BuildID",
-          "FloorID",
-          "FloorLocalName",
-          "FloorSequenceID"
+        orders: "floorSequenceId desc",
+        pageNumber: 1,
+        pageSize: 1000,
+        projection: [
+            "buildingId",
+            "id",
+            "localName",
+            "floorSequenceId"
         ]
       }
       let promise1 = new Promise((resolve, reject) => {
@@ -118,8 +119,8 @@ export default {
         let builData = values[0].Content, floorData = values[1].Content
         data = builData.map(build => {
           return {
-            value: build.BuildID,
-            label: build.BuildLocalName
+            value: build.id,
+            label: build.localName
           }
         })
         data.unshift({
@@ -131,12 +132,12 @@ export default {
         })
         data.forEach(build => {
           floorData.forEach(floor => {
-            if (build.value == floor.BuildID && floor.FloorID && floor.FloorLocalName) {
+            if (build.value == floor.buildingId && floor.id && floor.localName) {
               if (build.children) {
                 build.children.push({
-                  value: floor.FloorID,
-                  label: floor.FloorLocalName,
-                  FloorSequenceID: floor.FloorSequenceID
+                  value: floor.id,
+                  label: floor.localName,
+                  FloorSequenceID: floor.floorSequenceId
                 })
               } else {
                 build.children = []
@@ -147,9 +148,9 @@ export default {
                   value: 'noKnow',
                   label: "不在楼层内"
                 }, {
-                  value: floor.FloorID,
-                  label: floor.FloorLocalName,
-                  FloorSequenceID: floor.FloorSequenceID
+                  value: floor.id,
+                  label: floor.localName,
+                  FloorSequenceID: floor.floorSequenceId
                 })
               }
             }

+ 23 - 21
src/utils/handsontable/buildFloorData.js

@@ -1,23 +1,25 @@
-import { floorQuery, buildingQuery } from '@/api/scan/request'
+import { buildingQuery } from '@/api/object/build';
+import { floorQuery } from '@/api/object/floor';
 
 const buildFloor = {
   getData: function (buildFloorData) {
     let data, buildParams = {
-        PageNumber: 1,
-        PageSize: 500,
-        Projection: [
-            "BuildID",
-            "BuildLocalName"
+        pageNumber: 1,
+        pageSize: 1000,
+        orders: "localName asc",
+        projection: [
+            "id",
+            "localName"
         ]
     }, floorParams = {
-        Orders: "FloorSequenceID desc",
-        PageNumber: 1,
-        PageSize: 500,
-        Projection: [
-            "BuildID",
-            "FloorID",
-            "FloorLocalName",
-            "FloorSequenceID"
+        orders: "floorSequenceId desc",
+        pageNumber: 1,
+        pageSize: 1000,
+        projection: [
+            "buildingId",
+            "id",
+            "localName",
+            "floorSequenceId"
         ]
     }
 
@@ -36,8 +38,8 @@ const buildFloor = {
       let builData = values[0].Content, floorData = values[1].Content
       data = builData.map(build => {
           return {
-              value: build.BuildID,
-              label: build.BuildLocalName
+              value: build.id,
+              label: build.localName
           }
       })
       data.unshift({
@@ -46,11 +48,11 @@ const buildFloor = {
       })
       data.forEach(build => {
         floorData.forEach(floor => {
-          if (build.value == floor.BuildID && floor.FloorID && floor.FloorLocalName) {
+          if (build.value == floor.buildingId && floor.id && floor.localName) {
             if (build.children) {
               build.children.push({
-                value: floor.FloorID,
-                label: floor.FloorLocalName
+                value: floor.id,
+                label: floor.localName
               })
             } else {
               build.children = []
@@ -58,8 +60,8 @@ const buildFloor = {
                 value: "",
                 label: "未明确楼层"
               },{
-                value: floor.FloorID,
-                label: floor.FloorLocalName 
+                value: floor.id,
+                label: floor.localName 
               })
             }
           }

+ 2 - 6
src/views/ledger/facility/index.vue

@@ -22,12 +22,8 @@ import myCascader from "@/components/ledger/lib/cascader";
 import hansonTable from "@/components/ledger/handsontables/device";
 import tableTransfers from "@/components/ledger/tableTransfers";
 import linkassetsDialog from "@/components/ledger/lib/linkassets";
-import {
-  getSpaceName,
-  getGraphyId,
-  getEquipmentFamily,
-  countEquip
-} from "@/api/scan/request"
+import { getSpaceName, getGraphyId, getEquipmentFamily } from "@/api/scan/request";
+import { countEquip } from "@/api/object/equip";
 import {
   mapGetters,
   mapActions