Jelajahi Sumber

动参3定制接口联调;ai问题修改

haojianlong 5 tahun lalu
induk
melakukan
f6d1a42c5c

+ 18 - 0
src/api/scan/request.js

@@ -1462,6 +1462,24 @@ export function dynamicRelatedObj(param, success) {
   http.postJson(url, param, success)
 }
 
+//动态数据关联-带关联实例(设备)
+export function dynamicEquipQuery(param, success) {
+  let url = `${baseUrl}/equip-component/equip-query/zone-query`;
+  http.postJson(url, param, success)
+}
+
+//动态数据关联-带关联实例(部件)
+export function dynamicPartQuery(param, success) {
+  let url = `${baseUrl}/equip-component/equip-query/zone-component-query`;
+  http.postJson(url, param, success)
+}
+
+//动态数据关联-带关联实例(租户)
+export function dynamicTenantQuery(param, success) {
+  let url = `${baseUrl}/equip-component/tenant/zone-query`;
+  http.postJson(url, param, success)
+}
+
 //查询部件
 export function partsQuery(param, success) {
   let url = `${baseUrl}/datacenter/object/component/query`;

+ 4 - 1
src/components/point/dynamicdata/locationCascader.vue

@@ -33,8 +33,10 @@ export default {
                 const nodes = res.Content.map(t => {
                   t.value = t.FloorID;
                   t.label = t.FloorLocalName;
+                  t.leaf = that.isSpace;
                   return t;
                 })
+                nodes.unshift({ value: 'unknowFloor', label: '未明确楼层', leaf: true })
                 resolve(nodes);
               })
             }
@@ -66,6 +68,7 @@ export default {
               const nodes = res.Content.map(t => {
                 t.value = t.RoomID;
                 t.label = t.RoomLocalName;
+                t.leaf = true;
                 return t;
               })
               resolve(nodes);
@@ -122,7 +125,7 @@ export default {
           item.label = item.BuildLocalName;
           return item;
         });
-        this.LocationList.unshift({ value: 'unknowBuild', label: '未明确建筑' })
+        this.LocationList.unshift({ value: 'unknowBuild', label: '未明确建筑', leaf: true })
       })
     },
     delNullItems(arr) {

+ 8 - 1
src/views/point/dynamicdata/addRelation/buildRela/index.vue

@@ -525,7 +525,14 @@ export default {
           let param = []
           n.map(item => {
             param.push({
-              Objs: [item],
+              Objs: [{
+                ObjectID: item.ObjectID,
+                TypeCode: 'Bd',
+                ProjectId: item.ProjectID.substring(2),
+                ObjectLocalCode: item.ObjectLocalCode,
+                ObjectLocalName: item.ObjectLocalName,
+                SubTypeCode: 'null'
+              }],
               Top: 3,
               Proximity: 0.5
             })

+ 27 - 5
src/views/point/dynamicdata/addRelation/equipRela/index.vue

@@ -162,7 +162,8 @@ import {
   dynamicPointTypeList,
   dynamicQueryAI,
   queryEquip, //数据中心设备查询
-  dynamicRelatedObj
+  dynamicRelatedObj,
+  dynamicEquipQuery
 } from "@/api/scan/request";
 export default {
   components: {
@@ -405,10 +406,24 @@ export default {
         pa.Filters += `;Category in ${JSON.stringify(this.form.SubTypeName)}`;
       }
       if (this.form.locationVal.length > 0) {
-        pa.Filters += `;BuildingId='${this.form.locationVal[0]}'`;
+        if (this.form.locationVal[0] == 'unknowBuild') {
+          pa.Filters += `;BuildingId isNull`;
+        } else {
+          pa.Filters += `;BuildingId='${this.form.locationVal[0]}'`;
+        }
       }
       if (this.form.locationVal.length > 1) {
-        pa.Filters += `;FloorId='${this.form.locationVal[1]}'`;
+        if (this.form.locationVal[1] == 'unknowFloor') {
+          pa.Filters += `;FloorId isNull`;
+        } else {
+          pa.Filters += `;FloorId='${this.form.locationVal[1]}'`;
+        }
+      }
+      if (this.form.locationVal.length > 2) {
+        pa.ZoneType = this.form.locationVal[2];
+      }
+      if (this.form.locationVal.length > 3) {
+        pa.ZoneId = this.form.locationVal[3];
       }
       let pa2 = {
         Filters: `TypeName='${this.typeName}'`
@@ -424,7 +439,7 @@ export default {
         if (tempArr.length) {
           pa.Filters += `;not EquipID in ${JSON.stringify(tempArr)}`
         }
-        queryEquip(pa, res => {
+        dynamicEquipQuery(pa, res => {
           this.rPage.total = res.Total;
           let tempArr = res.Content.map(t => {
             t.ObjectID = t.EquipID.substr(12);
@@ -550,7 +565,14 @@ export default {
           let param = []
           n.map(item => {
             param.push({
-              Objs: [item],
+              Objs: [{
+                ObjectID: item.ObjectID,
+                TypeCode: 'Eq',
+                ProjectId: item.ProjectId.substring(2),
+                ObjectLocalCode: item.ObjectLocalCode,
+                ObjectLocalName: item.ObjectLocalName,
+                SubTypeCode: item.Category
+              }],
               Top: 3,
               Proximity: 0.5
             })

+ 8 - 1
src/views/point/dynamicdata/addRelation/floorRela/index.vue

@@ -540,7 +540,14 @@ export default {
           let param = []
           n.map(item => {
             param.push({
-              Objs: [item],
+              Objs: [{
+                ObjectID: item.ObjectID,
+                TypeCode: 'Fl',
+                ProjectId: item.ProjectID.substring(2),
+                ObjectLocalCode: item.ObjectLocalCode,
+                ObjectLocalName: item.ObjectLocalName,
+                SubTypeCode: 'null'
+              }],
               Top: 3,
               Proximity: 0.5
             })

+ 39 - 15
src/views/point/dynamicdata/addRelation/partsRela/index.vue

@@ -164,6 +164,7 @@ import {
   dynamicQueryAI,
   dynamicRelatedObj,
   partsQuery, //数据中心部件查询
+  dynamicPartQuery
 } from "@/api/scan/request";
 export default {
   components: {
@@ -395,7 +396,8 @@ export default {
       let pa = {
         PageNumber: this.rPage.pageNumber,
         PageSize: this.rPage.pageSize,
-        Filters: 'not EquipID isNull'
+        Filters: 'not EquipID isNull',
+        Cascade: [{ Name: "zoneSpaceInBase" }, { Name: 'building' }, { Name: 'floor' }, { Name: 'equipCategory' }, { Name: 'belongedEquipment' }]
       };
       //处理查询条件
       if (this.form.ObjectLocalName && this.form.ObjectLocalName.length) {
@@ -405,10 +407,24 @@ export default {
         pa.Filters += `;Category in ${JSON.stringify(this.form.SubTypeName)}`;
       }
       if (this.form.locationVal.length > 0) {
-        pa.Filters += `;BuildingId='${this.form.locationVal[0]}'`;
+        if (this.form.locationVal[0] == 'unknowBuild') {
+          pa.Filters += `;BuildingId isNull`;
+        } else {
+          pa.Filters += `;BuildingId='${this.form.locationVal[0]}'`;
+        }
       }
       if (this.form.locationVal.length > 1) {
-        pa.Filters += `;FloorId='${this.form.locationVal[1]}'`;
+        if (this.form.locationVal[1] == 'unknowFloor') {
+          pa.Filters += `;FloorId isNull`;
+        } else {
+          pa.Filters += `;FloorId='${this.form.locationVal[1]}'`;
+        }
+      }
+      if (this.form.locationVal.length > 2) {
+        pa.ZoneType = this.form.locationVal[2];
+      }
+      if (this.form.locationVal.length > 3) {
+        pa.ZoneId = this.form.locationVal[3];
       }
       let pa2 = {
         Filters: `TypeName='${this.typeName}'`
@@ -424,22 +440,23 @@ export default {
         if (tempArr.length) {
           pa.Filters += `;not EquipID in ${JSON.stringify(tempArr)}`
         }
-        partsQuery(pa, res => {
+        dynamicPartQuery(pa, res => {
           this.rPage.total = res.Total;
           let tempArr = res.Content.map(t => {
             t.ObjectID = t.EquipID.substr(12);
             t.ObjectLocalName = t.EquipLocalName;
             t.ObjectLocalCode = t.EquipLocalID;
-            // t.SubTypeName = t.EquipCategory ? t.EquipCategory.EquipName : '';
-            // t.BuildLocalName = t.Building ? t.Building.BuildLocalName : '';
-            // t.FloorLocalName = t.Floor ? t.Floor.FloorLocalName : '';
-            // t.RoomLocalName = '';
-            // if (t.ZoneSpaceBaseIn) {
-            //   t.ZoneSpaceBaseIn.forEach(item => {
-            //     t.RoomLocalName += item.RoomLocalName + ',';
-            //   })
-            //   t.RoomLocalName = t.RoomLocalName.substring(0, t.RoomLocalName.length - 1);
-            // }
+            t.SubTypeName = t.EquipCategory ? t.EquipCategory.EquipName : '';
+            t.CascadeEquipLocalName = t.BelongedEquipment ? t.BelongedEquipment.EquipLocalName : '';
+            t.BuildLocalName = t.Building ? t.Building.BuildLocalName : '';
+            t.FloorLocalName = t.Floor ? t.Floor.FloorLocalName : '';
+            t.RoomLocalName = '';
+            if (t.ZoneSpaceInBase) {
+              t.ZoneSpaceInBase.forEach(item => {
+                t.RoomLocalName += item.RoomLocalName + ',';
+              })
+              t.RoomLocalName = t.RoomLocalName.substring(0, t.RoomLocalName.length - 1);
+            }
             return t;
           });
           if (this.rPage.pageNumber == 1) {
@@ -550,7 +567,14 @@ export default {
           let param = []
           n.map(item => {
             param.push({
-              Objs: [item],
+              Objs: [{
+                ObjectID: item.ObjectID,
+                TypeCode: 'Ec',
+                ProjectId: item.ProjectId.substring(2),
+                ObjectLocalCode: item.ObjectLocalCode,
+                ObjectLocalName: item.ObjectLocalName,
+                SubTypeCode: item.Category
+              }],
               Top: 3,
               Proximity: 0.5
             })

+ 2 - 2
src/views/point/dynamicdata/addRelation/projectRela/index.vue

@@ -9,8 +9,8 @@
         </div> -->
       </el-col>
       <el-col :span="12" class="text-right">
-        <el-switch @change="changeType" v-model="isSwitch"></el-switch>
-        <span style="padding:0 5px;">AI辅助</span>
+        <!-- <el-switch @change="changeType" v-model="isSwitch"></el-switch>
+        <span style="padding:0 5px;">AI辅助</span> -->
         <el-button size="medium" @click="showHistory" class="ani-his-plus">
           本次对应记录 {{num}}
           <span v-if="showPlus" :class="{'plusOne':true,'startAni':showPlus}">+1</span>

+ 8 - 1
src/views/point/dynamicdata/addRelation/spaceRela/index.vue

@@ -544,7 +544,14 @@ export default {
           let param = []
           n.map(item => {
             param.push({
-              Objs: [item],
+              Objs: [{
+                ObjectID: item.ObjectID,
+                TypeCode: 'Sp',
+                ProjectId: item.ProjectId.substring(2),
+                ObjectLocalCode: item.ObjectLocalCode,
+                ObjectLocalName: item.ObjectLocalName,
+                SubTypeCode: item.ObjectType
+              }],
               Top: 3,
               Proximity: 0.5
             })

+ 29 - 12
src/views/point/dynamicdata/addRelation/tenantRela/index.vue

@@ -163,7 +163,8 @@ import {
   dynamicPointTypeList,
   dynamicQueryAI,
   queryTenant, //数据中心查询租户
-  dynamicRelatedObj
+  dynamicRelatedObj,
+  dynamicTenantQuery
 } from "@/api/scan/request";
 export default {
   components: {
@@ -396,24 +397,33 @@ export default {
         PageNumber: this.rPage.pageNumber,
         PageSize: this.rPage.pageSize,
         Cascade: [{ Name: 'zoneTenantList' }],
-        Filters: 'not TenantID isNull'
+        Filters: 'not TenantID isNull',
+        Cascade: [{ Name: "zoneTenantList" }]
       };
       //处理查询条件
       if (this.form.ObjectLocalName && this.form.ObjectLocalName.length) {
         pa.Filters += `;TenantLocalName contain "${this.form.ObjectLocalName}"`;
       }
       // if (this.form.locationVal.length > 0) {
-      //   param.BuildLocalName = this.form.locationVal[0];
+      //   if (this.form.locationVal[0] == 'unknowBuild') {
+      //     pa.Filters += `;BuildingId isNull`;
+      //   } else {
+      //     pa.Filters += `;BuildingId='${this.form.locationVal[0]}'`;
+      //   }
       // }
       // if (this.form.locationVal.length > 1) {
-      //   param.FloorLocalName = this.form.locationVal[1];
-      // }
-      // if (this.form.locationVal.length > 2) {
-      //   param.SpaceType = this.form.locationVal[2];
-      // }
-      // if (this.form.locationVal.length > 3) {
-      //   param.RoomLocalName = this.form.locationVal[3];
+      //   if (this.form.locationVal[1] == 'unknowFloor') {
+      //     pa.Filters += `;FloorId isNull`;
+      //   } else {
+      //     pa.Filters += `;FloorId='${this.form.locationVal[1]}'`;
+      //   }
       // }
+      if (this.form.locationVal.length > 2) {
+        pa.ZoneType = this.form.locationVal[2];
+      }
+      if (this.form.locationVal.length > 3) {
+        pa.ZoneId = this.form.locationVal[3];
+      }
       this.rTableLoading = true;
       dynamicRelatedObj({ Filters: `TypeName='${this.typeName}'` },
         response => {
@@ -423,7 +433,7 @@ export default {
           if (tempArr.length) {
             pa.Filters += `;not TenantID in ${JSON.stringify(tempArr)}`
           }
-          queryTenant(pa, res => {
+          dynamicTenantQuery(pa, res => {
             this.rPage.total = res.Total;
             let tempArr = res.Content.map(t => {
               t.ObjectID = t.TenantID.substr(14);
@@ -546,7 +556,14 @@ export default {
           let param = []
           n.map(item => {
             param.push({
-              Objs: [item],
+              Objs: [{
+                ObjectID: item.ObjectID,
+                TypeCode: 'VOTn',
+                ProjectId: item.ProjectId.substring(2),
+                ObjectLocalCode: item.ObjectLocalCode,
+                ObjectLocalName: item.ObjectLocalName,
+                SubTypeCode: 'VOTn'
+              }],
               Top: 3,
               Proximity: 0.5
             })