Browse Source

去除物理世界请求楼层的接口

zhangyu 5 năm trước cách đây
mục cha
commit
19f67b0e16
1 tập tin đã thay đổi với 26 bổ sung46 xóa
  1. 26 46
      src/components/dialogs/changeRea.vue

+ 26 - 46
src/components/dialogs/changeRea.vue

@@ -6,12 +6,13 @@
     <div>
       <div id="changeRea">
         <div class="title-search" style="margin-bottom: 10px;">
-          <el-input placeholder="输入名称或编码查询" v-model="search" size="small" style="width:300px;" clearable></el-input>
+          <floor-cascader @change="changeFloor"></floor-cascader>
+          <el-input placeholder="输入本地名称或本地编码查询" v-model="search" size="small" style="width:250px;marginLeft:30px;" clearable></el-input>
           <el-button @click="getPropertyData" size="small">查找</el-button>
         </div>
-        <div>
+        <!-- <div>
           <floor-cascader @change="changeFloor"></floor-cascader>
-        </div>
+        </div> -->
         <el-radio-group v-model="radio" style="width:100%;">
           <el-table :data="tableData" style="width: 100%" height="300px">
             <el-table-column label="资产名称">
@@ -25,10 +26,14 @@
               <template slot-scope="scope">{{scope.row.EquipLocalID || scope.row.EquipID}}</template>
             </el-table-column>
             <el-table-column prop="name" label="所在楼层">
-              <template slot-scope="scope">{{getFloor(scope.row.FloorId)}}</template>
+              <template slot-scope="scope">
+                {{ scope.row.Building?scope.row.Building.BuildLocalName?scope.row.Building.BuildLocalName:'':'' }}-{{ scope.row.Floor?scope.row.Floor.FloorLocalName?scope.row.Floor.FloorLocalName:'':'' }}
+              </template>
             </el-table-column>
             <el-table-column label="设备族">
-              <span>{{this.category.assetName}}</span>
+              <template slot-scope="scope">
+                {{scope.row.EquipFamilyList[0].FamilyName}}
+              </template>
             </el-table-column>
             <el-table-column label="安装位置">
               <template slot-scope="scope">
@@ -48,7 +53,7 @@
 <script>
 import myPagination from "@/components/ledger/lib/myPagination";
 import paramDetails from "@/components/dialogs/list/paramDetails"
-import { getSpaceFloor, queryProperty } from "@/api/scan/request"
+import { queryProperty } from "@/api/scan/request"
 import floorCascader from "@/components/ledger/lib/floorCascader";
 import { mapGetters, mapActions } from "vuex"
 export default {
@@ -86,36 +91,13 @@ export default {
       },
       mess: {},
       codeListCode: [],
-      floorList: []
     };
   },
-  created() {
-    this.getFloorList();
-  },
   computed: {
     ...mapGetters("layout", ["projectId", "secret", "userId"])
   },
   mounted() { },
   methods: {
-    //根据楼层id对应楼层
-    getFloor(relation) {
-      let floor = !!relation ? relation.floor || "" : ""
-      if (!!floor) {
-        let floorName = ""
-        this.floorList.map(item => {
-          if (!!item.floors && item.floors.length) {
-            item.floors.map(child => {
-              if (child.id == floor) {
-                floorName = child.infos.FloorLocalName || child.infos.FloorName
-              }
-            })
-          }
-        })
-        return floorName
-      } else {
-        return "--"
-      }
-    },
     //确认选择
     clickTrue() {
       if (this.radio) {
@@ -125,22 +107,6 @@ export default {
         this.$message("请先选择资产")
       }
     },
-    //查询条件-所在建筑楼层
-    getFloorList() {
-      let param = {
-        secret: this.secret,
-        ProjId: this.projectId
-      }
-      getSpaceFloor(param).then(res => {
-        if (res.data.Result == "success") {
-          this.floorList = res.data.Content
-        } else {
-          this.$message.error("请求错误:" + res.data.ResultMsg)
-        }
-      }).catch(_ => {
-        this.$message.error("请求错误")
-      })
-    },
     //所在建筑楼层修改
     changeFloor(val) {
       this.mess = {
@@ -166,6 +132,20 @@ export default {
     //查询表数据
     getPropertyData() {
       let param = { 
+        Cascade: [
+          {
+            Name: "equipFamilyList",
+            Projection: [ "Family", "FamilyName" ]
+          },
+          {
+            Name: "building",
+            Projection: ["BuildLocalName", "BuildName", "BuildID"]
+          },
+          {
+            Name: "floor",
+            Projection: ["FloorLocalName", "FloorName", "FloorID"]
+          }
+        ],
         Filters: `EquipmentId isNull;Family="${this.category.assetType}"`,
         PageNumber: this.page.currentPage,
         PageSize: this.page.size
@@ -184,7 +164,7 @@ export default {
       }
       //名称和编码
       if (this.search) {
-        param.Filters += `;floorId='${this.mess.floorId}'`
+        param.Filters += `;EquipLocalName contain '${this.search}' || EquipLocalID contain '${this.search}'`
       }
       queryProperty(param, res => {
         this.tableData = res.Content