Browse Source

adm:feat> 分区包含的功能空间

onlyh 3 years ago
parent
commit
d161bc5b60
2 changed files with 89 additions and 72 deletions
  1. 88 71
      src/views/maintain/space/index.vue
  2. 1 1
      src/views/scene/tiepoint/index.vue

+ 88 - 71
src/views/maintain/space/index.vue

@@ -15,6 +15,7 @@
                                      @change="changeCascader" style="margin-right: 12px"
                         ></el-cascader>
                         <el-cascader v-model="zoneTypeValue" :options="zoneTypeOption" placeholder="请选择分区"
+                                     ref="cascaderZone"
                                      @change="changeZoneTypes"
                                      class="item"></el-cascader>
                         <admSearch @SearchValue="searchValue" class="item"/>
@@ -379,8 +380,7 @@ export default class spaceIndex extends Vue {
                     {name: "building"},
                     {name: "floor", orders: "floorSequenceId desc"},
                 ],
-                // zoneType: "FunctionZone",
-                zoneType: this.zoneTypeValue[this.zoneTypeValue.length - 1],
+                classCode: this.zoneTypeValue[this.zoneTypeValue.length - 1],
                 pageNumber: this.paginationList.page,
                 pageSize: this.paginationList.size,
                 orders: "createTime desc, localName asc, localId desc, id asc",
@@ -431,78 +431,95 @@ export default class spaceIndex extends Vue {
                 let basicInfos = [],
                     dictStages = [];
                 this.all = res[0].content;
-                res[0].content.forEach((item) => {
-                    let i = ["localName", "localId", "building", "floor"];
-                    if (i.includes(item.path)) {
-                        basicInfos.push(item);
-                    } else {
-                        dictStages.push(item);
-                    }
-                });
-                dictStages.map((val, index) => {
-                    if (val.path == "outline") {
-                        dictStages.splice(index, 1);
-                    }
-                    return val;
-                });
-                basicInfos.map((item) => {
-                    if (item.path == "building") {
-                        item.path = "buildingSign";
-                    }
-                    if (item.path == "floor") {
-                        item.path = "floorSign";
-                    }
-                    return item;
-                });
+                if (this.zoneTypeValue[0] != "FunctionZone") {
+                    // todo 列表只展示 分区 / 包含的功能空间
+                    const currentZone = this.$refs['cascaderZone'].getCheckedNodes()[0].label
+
+                    this.headersStage = {
+                        basicInfos: {
+                            name: "基础信息台账",
+                            data: [
+                                {path: 'localName', editable: false, aliasName: currentZone},
+                                {path: 'defaultSpace', editable: false, aliasName: '包含的功能分区'}
+                            ],
+                        },
+                    };
+                    this.paginationList.total = res[1].total;
+                    tableData = res[1].content.map(i => i.path == 'localName'); // 主体数据
+                } else {
+                    res[0].content.forEach((item) => {
+                        let i = ["localName", "localId", "building", "floor"];
+                        if (i.includes(item.path)) {
+                            basicInfos.push(item);
+                        } else {
+                            dictStages.push(item);
+                        }
+                    });
+                    dictStages.map((val, index) => {
+                        if (val.path == "outline") {
+                            dictStages.splice(index, 1);
+                        }
+                        return val;
+                    });
+                    basicInfos.map((item) => {
+                        if (item.path == "building") {
+                            item.path = "buildingSign";
+                        }
+                        if (item.path == "floor") {
+                            item.path = "floorSign";
+                        }
+                        return item;
+                    });
 
-                this.headersStage = {
-                    basicInfos: {
-                        name: "基础信息台账",
-                        data: basicInfos,
-                    },
-                    dictStages: {
-                        name: "租赁系统",
-                        data: dictStages,
-                    },
-                };
-                this.paginationList.total = res[1].total;
-                tableData = res[1].content; // 主体数据
-                // 处理 outline BIM模型中轮廓坐标 展示
-                // 添加建筑,楼层展示(从下拉框获取)
-                this.tableData = tableData.map((item) => {
-                    if (item.building) {
-                        item.buildingSign = item.building.localName;
-                    }
-                    if (item.floor) {
-                        item.floorSign = item.floor.localName;
-                    }
-                    // 删除轮廓线
-                    if (item.outline) {
-                        delete item.outline;
-                    }
-                    // item = {
-                    //     ...item,
-                    //     outline: JSON.stringify(item.outline),
-                    // };
+                    this.headersStage = {
+                        basicInfos: {
+                            name: "基础信息台账",
+                            data: basicInfos,
+                        },
+                        dictStages: {
+                            name: "租赁系统",
+                            data: dictStages,
+                        },
+                    };
+                    this.paginationList.total = res[1].total;
+                    tableData = res[1].content; // 主体数据
+                    // 处理 outline BIM模型中轮廓坐标 展示
+                    // 添加建筑,楼层展示(从下拉框获取)
+                    this.tableData = tableData.map((item) => {
+                        if (item.building) {
+                            item.buildingSign = item.building.localName;
+                        }
+                        if (item.floor) {
+                            item.floorSign = item.floor.localName;
+                        }
+                        // 删除轮廓线
+                        if (item.outline) {
+                            delete item.outline;
+                        }
+                        // item = {
+                        //     ...item,
+                        //     outline: JSON.stringify(item.outline),
+                        // };
 
-                    return item;
-                });
-                //  列表信息展示,获取动态数据
-                this.codeToDataSource = {};
-                this.all.forEach((item) => {
-                    if (item.dataSource) {
-                        try {
-                            this.codeToDataSource[item.code] = {};
-                            item.dataSource.forEach((dic) => {
-                                this.codeToDataSource[item.code][dic.code] =
-                                    dic.name;
-                            });
-                        } catch (e) {
-                            console.log(e);
+                        return item;
+                    });
+                    //  列表信息展示,获取动态数据
+                    this.codeToDataSource = {};
+                    this.all.forEach((item) => {
+                        if (item.dataSource) {
+                            try {
+                                this.codeToDataSource[item.code] = {};
+                                item.dataSource.forEach((dic) => {
+                                    this.codeToDataSource[item.code][dic.code] =
+                                        dic.name;
+                                });
+                            } catch (e) {
+                                console.log(e);
+                            }
                         }
-                    }
-                });
-                this.getBatch(this.tableData);
+                    });
+                    this.getBatch(this.tableData);
+                }
             });
         } else {
             console.log("void");

+ 1 - 1
src/views/scene/tiepoint/index.vue

@@ -1,5 +1,5 @@
 <template>
-    <div class="adm-tiepoint"style="display: none">
+    <div class="adm-tiepoint">
         <div class="tabs">
             <el-tabs v-model="activeName" type="card" @tab-click="tabChange">
                 <el-tab-pane label="设备" name="equip">