Browse Source

修改扫楼 建筑楼层接口

haojianlong 5 years ago
parent
commit
07388f6b38
1 changed files with 24 additions and 64 deletions
  1. 24 64
      src/views/data_admin/buildData/index.vue

+ 24 - 64
src/views/data_admin/buildData/index.vue

@@ -7,12 +7,12 @@
             <!-- 建筑选择 -->
             <span style="padding-right:12px;color:#999;vertical-align: middle;">建筑名称</span>
             <el-select v-model="buildId" style="margin-right:10px;" placeholder="请选择" @change="changeBuild">
-                <el-option v-for="item in buildList" :key="item.BuildId" :label="item.BuildLocalName" :value="item.BuildId"></el-option>
+                <el-option v-for="item in buildList" :key="item.BuildID" :label="item.BuildLocalName" :value="item.BuildID"></el-option>
             </el-select>
             <!-- 楼层选择 -->
             <span style="padding-right:12px;color:#999;">楼层</span>
             <el-select v-model="floorId" placeholder="请选择" @change="changeFloor">
-                <el-option v-for="item in floorList" :key="item.FloorId" :label="item.FloorLocalName" :value="item.FloorId"></el-option>
+                <el-option v-for="item in floorList" :key="item.FloorID" :label="item.FloorLocalName" :value="item.FloorID"></el-option>
             </el-select>
             <!-- 选择时间插件 -->
             <build-time :timeArr="timeArr" @checkTime="checkTime"></build-time>
@@ -332,6 +332,8 @@
         defaultFloor, //获取默认楼层
         getdelMain, //获取过滤掉后的表格主体
         getBasicMatch, //获取完全匹配的厂商库id
+        buildingQuery, //数据中心-建筑查询
+        floorQuery, //数据中心-楼层查询
     } from "@/api/scan/request";
     import { mapGetters, mapActions } from "vuex"
     export default {
@@ -596,20 +598,8 @@
             },
             //获取建筑列表
             getBuilding() {
-                let param = {
-                    ProjId: this.projectId,
-                    UserId: this.userId
-                };
-                getBuildSelect(param).then(result => {
-                    if (result.data.Result == "success" && result.data.BuildList) {
-                        this.buildList = result.data.BuildList;
-                        //获取建筑下列数据后请求默认楼层建筑数据
-                        this.getDefaultFloor();
-                    } else {
-                        // this.dialogVisible = true;
-                        // this.ajaxMsg = "请求出错";
-                        this.$message.error("请求出错")
-                    }
+                buildingQuery({}, res => {
+                    this.buildList = res.Content;
                 });
             },
             //获取点位标签详情
@@ -684,21 +674,23 @@
                 }
                 return list;
             },
-            //获取默认楼层
-            getDefaultFloor() {
+            //获取楼层列表
+            getFloorData() {
                 let param = {
-                    ProjId: this.projectId,
-                    UserId: this.userId
+                    Filters: `BuildID='${this.buildId}'`,
+                    Orders: 'FloorSequenceID desc'
                 };
-                defaultFloor(param).then(result => {
-                    //将默认建筑id赋予标签绑定
-                    // this.buildId = result.data.BuildId;
-                    //存储默认楼层,等待楼层下拉列表出现后赋予
-                    // this.defaultFloorData = result.data.FloorId;
-                    //请求楼层下拉数据
-                    if (this.buildId) {
-                        this.getFloorData();
-                    }
+                floorQuery(param, res => {
+                    this.floorList = res.Content
+                    this.floorList.unshift({
+                    FloorName: "全部",
+                    FloorLocalName: "全部",
+                    FloorID: "all"
+                    }, {
+                        FloorName: "未明确楼层",
+                        FloorLocalName: "未明确楼层",
+                        FloorID: "noKnow"
+                    })
                 });
             },
             //保存点位标签详情的修改
@@ -744,41 +736,6 @@
                     }
                 });
             },
-            //获取楼层列表
-            getFloorData() {
-                let param = {
-                    BuildId: this.buildId,
-                    ProjId: this.projectId,
-                    UserId: this.userId
-                };
-                getFloor(param).then(res => {
-                    if (res.data.Result == "success") {
-                        this.floorList = tools.sortArr(res.data.FloorList, "FloorSequenceId", false);
-                        // this.floorId = this.defaultFloorData;
-                        for (let i = 0; i < this.floorList.length; i++) {
-                            if (this.floorId == this.floorList[i].FloorId) {
-                                this.floorName = this.floorList[i].FloorLocalName;
-                            }
-                        }
-                        this.floorList.unshift({
-                            FloorName: "全部",
-                            FloorLocalName: "全部",
-                            FloorId: "all"
-                        },{
-                            FloorName: "未明确楼层",
-                            FloorLocalName: "未明确楼层",
-                            FloorId: "noKnow"
-                        })
-                        if (this.defaultFloorData) {
-                            this.getPT();
-                        }
-                    } else {
-                        // this.dialogVisible = true;
-                        // this.ajaxMsg = "请求出错";
-                        this.$message.error("请求出错")
-                    }
-                });
-            },
             //保存设备资产的更新
             upDateTableMain(paramList) {
                 let param = {
@@ -1496,6 +1453,9 @@
             },
             //创建表格实例
             createHot(variableNum, data, headerArr) {
+                if(!headerArr){
+                    return
+                }
                 let maxRow = "";
                 //当当前页数*当前页个数小于总个数时,当前表格行数为当前页数
                 if (