Parcourir la source

动参关联空间未关联实例查询(待过滤)

haojianlong il y a 5 ans
Parent
commit
209f01e24e

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

@@ -1515,6 +1515,12 @@ export function countZone(param, success) {
   http.postJson(url, data, success)
 }
 
+//查询所有空间信息
+export function queryAllZone(param, success) {
+  let url = `${baseUrl}/datacenter/object/zone/query`;
+  http.postJson(url, param, success)
+}
+
 //查询空间信息父类
 export function queryParentZone(param, success) {
     let url = `${baseUrl}/datacenter/zonespacebase/query`;

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

@@ -400,6 +400,7 @@ export default {
       }
       this.rTableLoading = true;
       buildingQuery(pa, res => {
+        this.rPage.total = res.Total;
         let tempArr = res.Content.map(t => {
           t.ObjectID = t.BuildID.substr(12);
           t.ObjectLocalName = t.BuildLocalName;

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

@@ -401,6 +401,7 @@ export default {
       }
       this.rTableLoading = true;
       projectQuery(pa, res => {
+        this.rPage.total = res.Total;
         let tempArr = res.Content.map(t => {
           t.ObjectID = t.ProjID.substr(2);
           t.ObjectLocalName = t.ProjLocalName;

+ 25 - 26
src/views/point/dynamicdata/addRelation/spaceRela/index.vue

@@ -156,12 +156,13 @@ import dataSource from "@/components/point/dynamicdata/dataSource";
 import locationFlag from "@/components/point/dynamicdata/locationFlag";
 import { mapGetters, mapActions } from "vuex";
 import {
-  dynamicPendingobjs,
+  // dynamicPendingobjs,
   dynamicPendingPoint,
   dynamicCreateRelation,
   dynamicDeleteRelation,
   dynamicPointTypeList,
-  dynamicQueryAI
+  dynamicQueryAI,
+  queryAllZone, //数据中心所有空间实例
 } from "@/api/scan/request";
 export default {
   components: {
@@ -390,43 +391,41 @@ export default {
     },
     //获取待关联实例-右侧
     getRightData() {
-      let param = {
+      let pa = {
         PageNumber: this.rPage.pageNumber,
         PageSize: this.rPage.pageSize,
-        TypeNameList: [this.typeName]
+        Cascade: [{ Name: 'building' }, { Name: 'floor' }, { Name: 'objectType' }],
+        Filters: 'not RoomID isNull'
       };
       //处理查询条件
       if (this.form.ObjectLocalName && this.form.ObjectLocalName.length) {
-        param.ObjectLocalName = this.form.ObjectLocalName;
-      }
-      if (this.form.SubTypeName.length) {
-        param.SubTypeNameList = this.form.SubTypeName;
+        pa.Filters += `;RoomLocalName contain "${this.form.ObjectLocalName}"`;
       }
+      // if (this.form.SubTypeName.length) {
+      //   param.SubTypeNameList = this.form.SubTypeName;
+      // }
       if (this.form.locationVal.length > 0) {
-        param.BuildLocalName = this.form.locationVal[0];
+        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.length) {
-        delete param.BuildLocalName
-        delete param.FloorLocalName
-        delete param.SpaceType
-        delete param.RoomLocalName
+        pa.Filters += `;FloorId="${this.form.locationVal[1]}"`;
       }
       this.rTableLoading = true;
-      dynamicPendingobjs(param, res => {
-        this.rPage.total = res.PageSize < 50 ? res.PageSize : res.Total;
+      queryAllZone(pa, res => {
+        this.rPage.total = res.Total;
+        let tempArr = res.Content.map(t => {
+          t.ObjectID = t.RoomID.substr(12);
+          t.ObjectLocalName = t.RoomLocalName;
+          t.ObjectLocalCode = t.RoomLocalID;
+          t.BuildLocalName = t.Building.BuildLocalName;
+          t.FloorLocalName = t.Floor.FloorLocalName;
+          t.SubTypeName = t.ObjectType;
+          return t;
+        });
         if (this.rPage.pageNumber == 1) {
-          this.RtableData = res.Content;
+          this.RtableData = tempArr;
         } else {
-          this.RtableData = this.RtableData.concat(res.Content);
+          this.RtableData = this.RtableData.concat(tempArr);
         }
         this.rTableLoading = false;
       });

+ 1 - 0
src/views/point/dynamicdata/addRelation/systemRela/index.vue

@@ -400,6 +400,7 @@ export default {
       }
       this.rTableLoading = true;
       queryLinkSys(pa, res => {
+        this.rPage.total = res.Total;
         let tempArr = res.Content.map(t => {
           t.ObjectID = t.SysID.substr(12);
           t.ObjectLocalName = t.SysLocalName;