Bläddra i källkod

动参关联 租户模块待关联实例查询(待过滤)

haojianlong 5 år sedan
förälder
incheckning
277b901064
2 ändrade filer med 34 tillägg och 31 borttagningar
  1. 6 0
      src/api/scan/request.js
  2. 28 31
      src/views/point/dynamicdata/addRelation/tenantRela/index.vue

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

@@ -886,6 +886,12 @@ export function queryRentTableData(param, success) {
     http.postJson(url, param, success)
 }
 
+//查询租户信息
+export function queryTenant(param, success) {
+  let url = `${baseUrl}/datacenter/object/tenant/query`
+  http.postJson(url, param, success)
+}
+
 //创建租户信息
 export function createRentTableData(param, success) {
   let url = `${baseUrl}/datacenter/tenant/create`

+ 28 - 31
src/views/point/dynamicdata/addRelation/tenantRela/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,
+  queryTenant, //数据中心查询租户
 } from "@/api/scan/request";
 export default {
   components: {
@@ -390,43 +391,39 @@ export default {
     },
     //获取待关联实例-右侧
     getRightData() {
-      let param = {
+      let pa = {
         PageNumber: this.rPage.pageNumber,
-        PageSize: this.rPage.pageSize,
-        TypeNameList: [this.typeName]
+        PageSize: this.rPage.pageSize
       };
       //处理查询条件
       if (this.form.ObjectLocalName && this.form.ObjectLocalName.length) {
-        param.ObjectLocalName = 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];
-      }
-      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 = `TenantLocalName contain "${this.form.ObjectLocalName}"`;
       }
+      // if (this.form.locationVal.length > 0) {
+      //   param.BuildLocalName = 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];
+      // }
       this.rTableLoading = true;
-      dynamicPendingobjs(param, res => {
-        this.rPage.total = res.PageSize < 50 ? res.PageSize : res.Total;
+      queryTenant(pa, res => {
+        this.rPage.total = res.Total;
+        let tempArr = res.Content.map(t => {
+          t.ObjectID = t.TenantID.substr(14);
+          t.ObjectLocalName = t.TenantLocalName;
+          t.ObjectLocalCode = t.TenantLocalID;
+          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;
       });