Parcourir la source

动参 项目模块接口替换

haojianlong il y a 5 ans
Parent
commit
cfe174b93e

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

@@ -1450,6 +1450,12 @@ export function dynamicAutoRelate(param, success) {
   http.postJson(url, param, success)
 }
 
+//查询项目信息
+export function projectQuery(param, success) {
+  let url = `${baseUrl}/datacenter/project/query`;
+  http.postJson(url, param, success)
+}
+
 //查询楼层信息
 export function floorQuery(param, success) {
   let url = `${baseUrl}/datacenter/floor/query`;

+ 15 - 31
src/views/point/dynamicdata/addRelation/projectRela/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,
+  projectQuery, //数据中心查询项目信息
 } from "@/api/scan/request";
 export default {
   components: {
@@ -390,43 +391,26 @@ 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 = `ProjLocalName contain '${this.form.ObjectLocalName}'`;
       }
       this.rTableLoading = true;
-      dynamicPendingobjs(param, res => {
-        this.rPage.total = res.PageSize < 50 ? res.PageSize : res.Total;
+      projectQuery(pa, res => {
+        let tempArr = res.Content.map(t => {
+          t.ObjectID = t.ProjID.substr(2);
+          t.ObjectLocalName = t.ProjLocalName;
+          t.ObjectLocalCode = t.ProjLocalID;
+          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;
       });