浏览代码

动参p1查询8中分类下的标识,接口替换数据中心实例查询

haojianlong 5 年之前
父节点
当前提交
e625eff3f7

+ 6 - 6
config/dev.env.js

@@ -4,11 +4,11 @@ const prodEnv = require('./prod.env')
 
 module.exports = merge(prodEnv, {
     NODE_ENV: '"development"',
-    // BASE_URL: '"http://192.168.20.236"', //测试iframe地址
-    // SSO_SERVER: '"http://192.168.20.235:8081"', //测试环境
+    BASE_URL: '"http://192.168.20.236"', //测试iframe地址
+    SSO_SERVER: '"http://192.168.20.235:8081"', //测试环境
     // // SSO_SERVER: '"http://192.168.20.236:8086"', //(新)测试环境
-    // MQTT_SERVICE: '"ws://192.168.20.225:61614/stomp/"' //MQ测试环境地址
-    SSO_SERVER: '"http://sso.sagacloud.cn"',  //正式环境
-    BASE_URL: '"http://mbi.sagacloud.cn"', //线上iframe地址
-    MQTT_SERVICE: '"ws://adm.sagacloud.cn/stomp/"' //MQ正式环境地址
+    MQTT_SERVICE: '"ws://192.168.20.225:61614/stomp/"' //MQ测试环境地址
+    // SSO_SERVER: '"http://sso.sagacloud.cn"',  //正式环境
+    // BASE_URL: '"http://mbi.sagacloud.cn"', //线上iframe地址
+    // MQTT_SERVICE: '"ws://adm.sagacloud.cn/stomp/"' //MQ正式环境地址
 })

+ 30 - 3
src/components/point/dynamicdata/buildRules.vue

@@ -102,7 +102,8 @@ import {
   dynamicExecute,
   dynamicQuery,
   dynamicQueryPoint,
-  dynamicPointTypeList
+  dynamicPointTypeList,
+  buildingQuery, //数据中心建筑查询
 } from "@/api/scan/request";
 export default {
   computed: {
@@ -198,8 +199,34 @@ export default {
       this.loading = true;
       // 查询对应关系(P1)
       dynamicQuery(param, res => {
-        this.loading = false;
-        this.tableData = res.Content;
+        let dyData = res.Content;
+        let tempArr = dyData.map(t => {
+          if (t.Related == 'True') {
+            t.BuildID = t.TypeCode + t.ProjectId + t.ObjectID;
+            return t.BuildID;
+          }
+          return undefined;
+        }).filter(item => item);
+        if (tempArr.length) {
+          buildingQuery({
+            PageSize: this.page.pageSize,
+            Filters: `BuildID in ${JSON.stringify(tempArr)}`
+          }, response => {
+            let Data = response.Content;
+            dyData.forEach(item => {
+              Data.forEach(t => {
+                if (t.BuildID == item.BuildID) {
+                  item.ObjectLocalName = t.BuildLocalName;
+                }
+              })
+            })
+            this.loading = false;
+            this.tableData = dyData;
+          })
+        } else {
+            this.loading = false;
+            this.tableData = dyData;
+        }
         this.page.total = res.PageSize < 50 ? res.PageSize : res.Total;
       });
     },

+ 40 - 3
src/components/point/dynamicdata/equipRules.vue

@@ -102,7 +102,8 @@ import {
   dynamicExecute,
   dynamicQuery,
   dynamicQueryPoint,
-  dynamicPointTypeList
+  dynamicPointTypeList,
+  queryEquip, //数据中心设备查询
 } from "@/api/scan/request";
 export default {
   computed: {
@@ -198,8 +199,44 @@ export default {
       this.loading = true;
       // 查询对应关系(P1)
       dynamicQuery(param, res => {
-        this.loading = false;
-        this.tableData = res.Content;
+        let dyData = res.Content;
+        let tempArr = dyData.map(t => {
+          if (t.Related == 'True') {
+            t.EquipID = t.TypeCode + t.ProjectId + t.ObjectID;
+            return t.EquipID;
+          }
+          return undefined;
+        }).filter(item => item);
+        if (tempArr.length) {
+          queryEquip({
+            PageSize: this.page.pageSize,
+            Filters: `EquipID in ${JSON.stringify(tempArr)}`,
+            Cascade: [{ Name: "zoneSpaceInBase" }, { Name: 'building' }, { Name: 'floor' }]
+          }, response => {
+            let Data = response.Content;
+            dyData.forEach(item => {
+              Data.forEach(t => {
+                if (t.EquipID == item.EquipID) {
+                  item.ObjectLocalName = t.FloorLocalName;
+                  item.FloorLocalName = t.Floor ? t.Floor.FloorLocalName : '';
+                  item.BuildLocalName = t.Building ? t.Building.BuildLocalName : '';
+                  item.RoomLocalName = '';
+                  if (t.ZoneSpaceBaseIn) {
+                    t.ZoneSpaceBaseIn.forEach(it => {
+                      item.RoomLocalName += it.RoomLocalName + ',';
+                    })
+                    item.RoomLocalName = item.RoomLocalName.substring(0, item.RoomLocalName.length - 1);
+                  }
+                }
+              })
+            })
+            this.loading = false;
+            this.tableData = dyData;
+          })
+        } else {
+            this.loading = false;
+            this.tableData = dyData;
+        }
         this.page.total = res.PageSize < 50 ? res.PageSize : res.Total;
       });
     },

+ 33 - 3
src/components/point/dynamicdata/floorRules.vue

@@ -110,7 +110,8 @@ import {
   dynamicExecute,
   dynamicQuery,
   dynamicQueryPoint,
-  dynamicPointTypeList
+  dynamicPointTypeList,
+  floorQuery, //数据中心查询楼层
 } from "@/api/scan/request";
 export default {
   computed: {
@@ -206,8 +207,37 @@ export default {
       this.loading = true;
       // 查询对应关系(P1)
       dynamicQuery(param, res => {
-        this.loading = false;
-        this.tableData = res.Content;
+        let dyData = res.Content;
+        let tempArr = dyData.map(t => {
+          if (t.Related == 'True') {
+            t.FloorID = t.TypeCode + t.ProjectId + t.ObjectID;
+            return t.FloorID;
+          }
+          return undefined;
+        }).filter(item => item);
+        if (tempArr.length) {
+          floorQuery({
+            PageSize: this.page.pageSize,
+            Cascade: [{ Name: 'building' }],
+            Filters: `FloorID in ${JSON.stringify(tempArr)}`
+          }, response => {
+            let Data = response.Content;
+            dyData.forEach(item => {
+              Data.forEach(t => {
+                if (t.FloorID == item.FloorID) {
+                  item.ObjectLocalName = t.FloorLocalName;
+                  item.ObjectSequenceID = t.FloorSequenceID;
+                  item.BuildLocalName = t.Building ? t.Building.BuildLocalName : '';
+                }
+              })
+            })
+            this.loading = false;
+            this.tableData = dyData;
+          })
+        } else {
+          this.loading = false;
+          this.tableData = dyData;
+        }
         this.page.total = res.PageSize < 50 ? res.PageSize : res.Total;
       });
     },

+ 30 - 3
src/components/point/dynamicdata/partsRules.vue

@@ -101,7 +101,8 @@ import {
   dynamicExecute,
   dynamicQuery,
   dynamicQueryPoint,
-  dynamicPointTypeList
+  dynamicPointTypeList,
+  partsQuery, //数据中心部件查询
 } from "@/api/scan/request";
 export default {
   computed: {
@@ -197,8 +198,34 @@ export default {
       this.loading = true;
       // 查询对应关系(P1)
       dynamicQuery(param, res => {
-        this.loading = false;
-        this.tableData = res.Content;
+        let dyData = res.Content;
+        let tempArr = dyData.map(t => {
+          if (t.Related == 'True') {
+            t.EquipID = t.TypeCode + t.ProjectId + t.ObjectID;
+            return t.EquipID;
+          }
+          return undefined;
+        }).filter(item => item);
+        if (tempArr.length) {
+          partsQuery({
+            PageSize: this.page.pageSize,
+            Filters: `EquipID in ${JSON.stringify(tempArr)}`
+          }, response => {
+            let Data = response.Content;
+            dyData.forEach(item => {
+              Data.forEach(t => {
+                if (t.EquipID == item.EquipID) {
+                  item.ObjectLocalName = t.EquipLocalName;
+                }
+              })
+            })
+            this.loading = false;
+            this.tableData = dyData;
+          })
+        } else {
+          this.loading = false;
+          this.tableData = dyData;
+        }
         this.page.total = res.PageSize < 50 ? res.PageSize : res.Total;
       });
     },

+ 30 - 3
src/components/point/dynamicdata/projectRules.vue

@@ -104,7 +104,8 @@ import {
   dynamicPointTypeList,
   dynamicPendingobjs,
   dynamicCreateRelation,
-  dynamicDeleteRelation
+  dynamicDeleteRelation,
+  projectQuery, //数据中心查询项目信息
 } from "@/api/scan/request";
 export default {
   computed: {
@@ -203,8 +204,34 @@ export default {
       this.loading = true;
       // 查询对应关系(P1)
       dynamicQuery(param, res => {
-        this.loading = false;
-        this.tableData = res.Content;
+        let dyData = res.Content;
+        let tempArr = dyData.map(t => {
+          if (t.Related == 'True') {
+            t.ProjID = t.TypeCode + t.ProjectId;
+            return t.ProjID;
+          }
+          return undefined;
+        }).filter(item => item);
+        if (tempArr.length) {
+          projectQuery({
+            PageSize: this.page.pageSize,
+            Filters: `ProjID in ${JSON.stringify(tempArr)}`
+          }, response => {
+            let Data = response.Content;
+            dyData.forEach(item => {
+              Data.forEach(t => {
+                if (t.ProjID == item.ProjID) {
+                  item.ObjectLocalName = t.ProjLocalName;
+                }
+              })
+            })
+            this.loading = false;
+            this.tableData = dyData;
+          })
+        } else {
+          this.loading = false;
+          this.tableData = dyData;
+        }
         this.page.total = res.PageSize < 50 ? res.PageSize : res.Total;
       });
     },

+ 33 - 3
src/components/point/dynamicdata/spaceRules.vue

@@ -101,7 +101,8 @@ import {
   dynamicExecute,
   dynamicQuery,
   dynamicQueryPoint,
-  dynamicPointTypeList
+  dynamicPointTypeList,
+  queryAllZone, //数据中心所有空间实例
 } from "@/api/scan/request";
 export default {
   computed: {
@@ -197,8 +198,37 @@ export default {
       this.loading = true;
       // 查询对应关系(P1)
       dynamicQuery(param, res => {
-        this.loading = false;
-        this.tableData = res.Content;
+        let dyData = res.Content;
+        let tempArr = dyData.map(t => {
+          if (t.Related == 'True') {
+            t.RoomID = t.TypeCode + t.ProjectId + t.ObjectID;
+            return t.RoomID;
+          }
+          return undefined;
+        }).filter(item => item);
+        if (tempArr.length) {
+          queryAllZone({
+            PageSize: this.page.pageSize,
+            Filters: `RoomID in ${JSON.stringify(tempArr)}`,
+            Cascade: [{ Name: 'building' }, { Name: 'floor' }],
+          }, response => {
+            let Data = response.Content;
+            dyData.forEach(item => {
+              Data.forEach(t => {
+                if (t.RoomID == item.RoomID) {
+                  item.ObjectLocalName = t.RoomLocalName;
+                  item.BuildLocalName = t.Building ? t.Building.BuildLocalName : '';
+                  item.FloorLocalName = t.Floor ? t.Floor.FloorLocalName : '';
+                }
+              })
+            })
+            this.loading = false;
+            this.tableData = dyData;
+          })
+        } else {
+          this.loading = false;
+          this.tableData = dyData;
+        }
         this.page.total = res.PageSize < 50 ? res.PageSize : res.Total;
       });
     },

+ 30 - 3
src/components/point/dynamicdata/systemRules.vue

@@ -99,7 +99,8 @@ import {
   dynamicExecute,
   dynamicQuery,
   dynamicQueryPoint,
-  dynamicPointTypeList
+  dynamicPointTypeList,
+  queryLinkSys, //数据中心系统查询
 } from "@/api/scan/request";
 export default {
   computed: {
@@ -195,8 +196,34 @@ export default {
       this.loading = true;
       // 查询对应关系(P1)
       dynamicQuery(param, res => {
-        this.loading = false;
-        this.tableData = res.Content;
+        let dyData = res.Content;
+        let tempArr = dyData.map(t => {
+          if (t.Related == 'True') {
+            t.SysID = t.TypeCode + t.ProjectId + t.ObjectID;
+            return t.SysID;
+          }
+          return undefined;
+        }).filter(item => item);
+        if (tempArr.length) {
+          queryLinkSys({
+            PageSize: this.page.pageSize,
+            Filters: `SysID in ${JSON.stringify(tempArr)}`
+          }, response => {
+            let Data = response.Content;
+            dyData.forEach(item => {
+              Data.forEach(t => {
+                if (t.SysID == item.SysID) {
+                  item.ObjectLocalName = t.SysLocalName;
+                }
+              })
+            })
+            this.loading = false;
+            this.tableData = dyData;
+          })
+        } else {
+          this.loading = false;
+          this.tableData = dyData;
+        }
         this.page.total = res.PageSize < 50 ? res.PageSize : res.Total;
       });
     },

+ 38 - 3
src/components/point/dynamicdata/tenantRules.vue

@@ -101,7 +101,8 @@ import {
   dynamicExecute,
   dynamicQuery,
   dynamicQueryPoint,
-  dynamicPointTypeList
+  dynamicPointTypeList,
+  queryTenant, //数据中心查询租户
 } from "@/api/scan/request";
 export default {
   computed: {
@@ -197,8 +198,42 @@ export default {
       this.loading = true;
       // 查询对应关系(P1)
       dynamicQuery(param, res => {
-        this.loading = false;
-        this.tableData = res.Content;
+        let dyData = res.Content;
+        let tempArr = dyData.map(t => {
+          if (t.Related == 'True') {
+            t.TenantID = t.TypeCode + t.ProjectId + t.ObjectID;
+            return t.TenantID;
+          }
+          return undefined;
+        }).filter(item => item);
+        if (tempArr.length) {
+          queryTenant({
+            PageSize: this.page.pageSize,
+            Cascade: [{ Name: 'zoneTenantList' }],
+            Filters: `TenantID in ${JSON.stringify(tempArr)}`
+          }, response => {
+            let Data = response.Content;
+            dyData.forEach(item => {
+              Data.forEach(t => {
+                if (t.TenantID == item.TenantID) {
+                  item.ObjectLocalName = t.TenantLocalName;
+                  item.RoomLocalName = '';
+                  if (t.ZoneTenantList) {
+                    t.ZoneTenantList.forEach(it => {
+                      item.RoomLocalName += it.RoomLocalName + ',';
+                    });
+                    item.RoomLocalName = item.RoomLocalName.substring(0, item.RoomLocalName.length - 1);
+                  }
+                }
+              })
+            })
+            this.loading = false;
+            this.tableData = dyData;
+          })
+        } else {
+          this.loading = false;
+          this.tableData = dyData;
+        }
         this.page.total = res.PageSize < 50 ? res.PageSize : res.Total;
       });
     },