|
@@ -1,39 +1,34 @@
|
|
<template>
|
|
<template>
|
|
<div class="space-index">
|
|
<div class="space-index">
|
|
- <statistics :statistics-msg="statisticsMsg"/>
|
|
|
|
|
|
+ <statistics :statistics-msg="statisticsMsg" />
|
|
<el-divider class="small-divider"></el-divider>
|
|
<el-divider class="small-divider"></el-divider>
|
|
<div class="tabs">
|
|
<div class="tabs">
|
|
- <el-tabs v-model="activeName" type="card">
|
|
|
|
|
|
+ <el-tabs v-model="activeName" type="card" @tab-click="tabChange">
|
|
<el-tab-pane label="列表" name="table"></el-tab-pane>
|
|
<el-tab-pane label="列表" name="table"></el-tab-pane>
|
|
<el-tab-pane label="平面图" name="picture"></el-tab-pane>
|
|
<el-tab-pane label="平面图" name="picture"></el-tab-pane>
|
|
</el-tabs>
|
|
</el-tabs>
|
|
<div class="tab-content">
|
|
<div class="tab-content">
|
|
- <div class="search">
|
|
|
|
- <el-cascader clearable ref="floorCascader" placeholder="请选择建筑楼层" :options="options"
|
|
|
|
- v-model="building"
|
|
|
|
- filterable size="small" @change="changeCascader"
|
|
|
|
- style="margin-right: 12px"></el-cascader>
|
|
|
|
- <el-cascader v-model="value2" :options="options2" @change="handleChange" placeholder="请选择分区"
|
|
|
|
- class="item"
|
|
|
|
- v-if="activeName==='picture'"></el-cascader>
|
|
|
|
- <admSearch @SearchValue="searchValue" class="item" v-if="activeName==='table'"/>
|
|
|
|
|
|
+ <div class="search" :class="{ 'borderBottom': activeName==='picture' }">
|
|
|
|
+ <el-cascader clearable ref="floorCascader" placeholder="请选择建筑楼层" :options="options" v-model="building" filterable size="small"
|
|
|
|
+ @change="changeCascader" style="margin-right: 12px"></el-cascader>
|
|
|
|
+ <el-cascader v-model="zoneTypeVal" :options="zoneTypeOption" @change="handleChange" placeholder="请选择分区" class="item"
|
|
|
|
+ v-if="activeName==='picture'"></el-cascader>
|
|
|
|
+ <admSearch @SearchValue="searchValue" class="item" v-if="activeName==='table'" />
|
|
</div>
|
|
</div>
|
|
- <div v-if="activeName==='table'" v-loading="loading" style="height: calc(100% - 100px);">
|
|
|
|
|
|
+ <div v-if="activeName==='table'" v-loading="loading" style="height: calc(100% - 100px);padding: 0 12px">
|
|
<template style="height: 100%;" v-if="building.length > 0">
|
|
<template style="height: 100%;" v-if="building.length > 0">
|
|
- <admMultiTable :currentHeader="currentHeader" :headersStage="headersStage"
|
|
|
|
- :tableData="tableData"/>
|
|
|
|
- <Pagination v-if="tableData.length > 0" :paginationList="paginationList"
|
|
|
|
- @handleCurrentChange="handleCurrentChange"
|
|
|
|
- @handleSizeChange="handleSizeChange"/>
|
|
|
|
|
|
+ <admMultiTable :currentHeader="currentHeader" :headersStage="headersStage" :tableData="tableData" />
|
|
|
|
+ <Pagination v-if="tableData.length > 0" :paginationList="paginationList" @handleCurrentChange="handleCurrentChange"
|
|
|
|
+ @handleSizeChange="handleSizeChange" />
|
|
</template>
|
|
</template>
|
|
<div v-else class="void align">
|
|
<div v-else class="void align">
|
|
- <svg-icon name="void" :width="String(120)" :height="String(123)"/>
|
|
|
|
|
|
+ <svg-icon name="void" :width="String(120)" :height="String(123)" />
|
|
<p class="void-title">暂无内容</p>
|
|
<p class="void-title">暂无内容</p>
|
|
<p class="void-tips">可点击左上角选择设备类型</p>
|
|
<p class="void-tips">可点击左上角选择设备类型</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="graph" v-if="activeName==='picture'">
|
|
<div class="graph" v-if="activeName==='picture'">
|
|
- <spaceGraph/>
|
|
|
|
|
|
+ <spaceGraph ref="spaceGraph" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -42,111 +37,157 @@
|
|
|
|
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
import { Component, Vue } from "vue-property-decorator";
|
|
import { Component, Vue } from "vue-property-decorator";
|
|
-import { AdmMultiTable, AdmSearch, Pagination, Statistics } from "../components/index";
|
|
|
|
|
|
+import {
|
|
|
|
+ AdmMultiTable,
|
|
|
|
+ AdmSearch,
|
|
|
|
+ Pagination,
|
|
|
|
+ Statistics,
|
|
|
|
+} from "../components/index";
|
|
import spaceGraph from "./components/spaceGraph.vue";
|
|
import spaceGraph from "./components/spaceGraph.vue";
|
|
-import { buildingQuery, dictQuery, floorQuery, queryCountSpace, queryZone } from "@/api/datacenter";
|
|
|
|
|
|
+import {
|
|
|
|
+ buildingQuery,
|
|
|
|
+ dictQuery,
|
|
|
|
+ floorQuery,
|
|
|
|
+ queryCountSpace,
|
|
|
|
+ queryZone,
|
|
|
|
+} from "@/api/datacenter";
|
|
import tools from "@/utils/maintain";
|
|
import tools from "@/utils/maintain";
|
|
import { BeatchQueryParam } from "@/api/equipComponent";
|
|
import { BeatchQueryParam } from "@/api/equipComponent";
|
|
import { UserModule } from "@/store/modules/user";
|
|
import { UserModule } from "@/store/modules/user";
|
|
-import it from "element-ui/src/locale/lang/it";
|
|
|
|
|
|
|
|
@Component({
|
|
@Component({
|
|
name: "space-index",
|
|
name: "space-index",
|
|
- components: { Statistics, AdmSearch, AdmMultiTable, spaceGraph, Pagination },
|
|
|
|
|
|
+ components: {
|
|
|
|
+ Statistics,
|
|
|
|
+ AdmSearch,
|
|
|
|
+ AdmMultiTable,
|
|
|
|
+ spaceGraph,
|
|
|
|
+ Pagination,
|
|
|
|
+ },
|
|
})
|
|
})
|
|
-
|
|
|
|
export default class spaceIndex extends Vue {
|
|
export default class spaceIndex extends Vue {
|
|
// loading
|
|
// loading
|
|
- loading = false
|
|
|
|
|
|
+ loading = false;
|
|
private statisticsMsg = {
|
|
private statisticsMsg = {
|
|
title: "全部空间",
|
|
title: "全部空间",
|
|
total: 93640,
|
|
total: 93640,
|
|
};
|
|
};
|
|
- currentHeader = '租赁系统'
|
|
|
|
|
|
+ currentHeader = "租赁系统";
|
|
activeName = "table";
|
|
activeName = "table";
|
|
- building = ['all'];
|
|
|
|
|
|
+ building = ["all"];
|
|
|
|
|
|
- value2 = [];
|
|
|
|
|
|
+ zoneTypeVal = ['FunctionZone'];
|
|
// 分页
|
|
// 分页
|
|
private paginationList = {
|
|
private paginationList = {
|
|
page: 1,
|
|
page: 1,
|
|
size: 50,
|
|
size: 50,
|
|
sizes: [10, 30, 50, 100, 150, 200],
|
|
sizes: [10, 30, 50, 100, 150, 200],
|
|
- total: 0
|
|
|
|
- }
|
|
|
|
|
|
+ total: 0,
|
|
|
|
+ };
|
|
options = [];
|
|
options = [];
|
|
- options2 = []
|
|
|
|
|
|
+ zoneTypeOption = [
|
|
|
|
+ {
|
|
|
|
+ value: "FunctionZone",
|
|
|
|
+ label: "功能分区",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ value: "Zone",
|
|
|
|
+ label: "业务分区",
|
|
|
|
+ children: [
|
|
|
|
+ {
|
|
|
|
+ value: "FireZone",
|
|
|
|
+ label: "防火分区",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ value: "PowerSupplyZone",
|
|
|
|
+ label: "供电分区",
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ ];
|
|
|
|
+
|
|
// 信息点集合(表头)
|
|
// 信息点集合(表头)
|
|
- all = []
|
|
|
|
- codeToDataSource = {}
|
|
|
|
- tableData = []
|
|
|
|
|
|
+ all = [];
|
|
|
|
+ codeToDataSource = {};
|
|
|
|
+ tableData = [];
|
|
// 表头阶段信息结合
|
|
// 表头阶段信息结合
|
|
- headersStage = {}
|
|
|
|
|
|
+ headersStage = {};
|
|
// 搜索框字段
|
|
// 搜索框字段
|
|
- inputSearch = ''
|
|
|
|
-
|
|
|
|
|
|
+ inputSearch = "";
|
|
|
|
+ // 楼层映射
|
|
|
|
+ floorToMap = {};
|
|
|
|
+ //
|
|
// 项目id
|
|
// 项目id
|
|
private get projectId(): string {
|
|
private get projectId(): string {
|
|
- return UserModule.projectId
|
|
|
|
|
|
+ return UserModule.projectId;
|
|
}
|
|
}
|
|
|
|
|
|
created() {
|
|
created() {
|
|
- this.getData()
|
|
|
|
- this.dataCount()
|
|
|
|
- // 默认显示全部建筑信息
|
|
|
|
- this.changeCascader()
|
|
|
|
|
|
+ this.getData();
|
|
|
|
+ this.dataCount();
|
|
|
|
+ // 默认显示全部建筑信息
|
|
|
|
+ this.changeCascader();
|
|
}
|
|
}
|
|
|
|
|
|
-//查询统计数量
|
|
|
|
|
|
+ //查询统计数量
|
|
dataCount() {
|
|
dataCount() {
|
|
- queryCountSpace({}).then(res => {
|
|
|
|
- this.statisticsMsg.total = res.count
|
|
|
|
- })
|
|
|
|
|
|
+ queryCountSpace({}).then((res) => {
|
|
|
|
+ this.statisticsMsg.total = res.count;
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
//获取楼层数据
|
|
//获取楼层数据
|
|
getData() {
|
|
getData() {
|
|
- let data, buildParams = {
|
|
|
|
- pageNumber: 1,
|
|
|
|
- pageSize: 1000,
|
|
|
|
- orders: "localName asc",
|
|
|
|
- projection: [
|
|
|
|
- "id",
|
|
|
|
- "localName"
|
|
|
|
- ]
|
|
|
|
- }, floorParams = {
|
|
|
|
- orders: "floorSequenceId desc",
|
|
|
|
- pageNumber: 1,
|
|
|
|
- pageSize: 1000
|
|
|
|
- }
|
|
|
|
|
|
+ let data,
|
|
|
|
+ buildParams = {
|
|
|
|
+ pageNumber: 1,
|
|
|
|
+ pageSize: 1000,
|
|
|
|
+ orders: "localName asc",
|
|
|
|
+ projection: ["id", "localName"],
|
|
|
|
+ },
|
|
|
|
+ floorParams = {
|
|
|
|
+ orders: "floorSequenceId desc",
|
|
|
|
+ pageNumber: 1,
|
|
|
|
+ pageSize: 1000,
|
|
|
|
+ };
|
|
let promise1 = new Promise((resolve) => {
|
|
let promise1 = new Promise((resolve) => {
|
|
- buildingQuery(buildParams).then(res => {
|
|
|
|
- resolve(res)
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
|
|
+ buildingQuery(buildParams).then((res) => {
|
|
|
|
+ resolve(res);
|
|
|
|
+ });
|
|
|
|
+ });
|
|
let promise2 = new Promise((resolve) => {
|
|
let promise2 = new Promise((resolve) => {
|
|
- floorQuery(floorParams).then(res => {
|
|
|
|
- resolve(res)
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
- Promise.all([promise1, promise2]).then(values => {
|
|
|
|
- let buildData = values[0].content, floorData = values[1].content
|
|
|
|
- data = buildData.map(build => {
|
|
|
|
|
|
+ floorQuery(floorParams).then((res) => {
|
|
|
|
+ resolve(res);
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ Promise.all([promise1, promise2]).then((values) => {
|
|
|
|
+ let buildData = values[0].content,
|
|
|
|
+ floorData = values[1].content;
|
|
|
|
+ this.floorToMap = {};
|
|
|
|
+ data = buildData.map((build) => {
|
|
return {
|
|
return {
|
|
value: build.id,
|
|
value: build.id,
|
|
- label: build.localName
|
|
|
|
|
|
+ label: build.localName,
|
|
|
|
+ };
|
|
|
|
+ });
|
|
|
|
+ data.unshift(
|
|
|
|
+ {
|
|
|
|
+ value: "all",
|
|
|
|
+ label: "全部",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ value: "noKnow",
|
|
|
|
+ label: "未明确建筑",
|
|
}
|
|
}
|
|
- })
|
|
|
|
- data.unshift({
|
|
|
|
- value: "all",
|
|
|
|
- label: "全部"
|
|
|
|
- }, {
|
|
|
|
- value: "noKnow",
|
|
|
|
- label: "未明确建筑"
|
|
|
|
- })
|
|
|
|
- data.forEach(build => {
|
|
|
|
- floorData.forEach(floor => {
|
|
|
|
- if (build.value == floor.buildingId && floor.id && floor.localName) {
|
|
|
|
|
|
+ );
|
|
|
|
+ data.forEach((build) => {
|
|
|
|
+ floorData.forEach((floor) => {
|
|
|
|
+ this.floorToMap[floor.id] = floor;
|
|
|
|
+ if (
|
|
|
|
+ build.value == floor.buildingId &&
|
|
|
|
+ floor.id &&
|
|
|
|
+ floor.localName
|
|
|
|
+ ) {
|
|
if (build.children) {
|
|
if (build.children) {
|
|
build.children.push({
|
|
build.children.push({
|
|
value: floor.id,
|
|
value: floor.id,
|
|
@@ -154,16 +195,17 @@ export default class spaceIndex extends Vue {
|
|
FloorSequenceID: floor.floorSequenceId,
|
|
FloorSequenceID: floor.floorSequenceId,
|
|
infos: floor.infos || {},
|
|
infos: floor.infos || {},
|
|
outline: floor.outline || null,
|
|
outline: floor.outline || null,
|
|
- })
|
|
|
|
|
|
+ });
|
|
} else {
|
|
} else {
|
|
- build.children = []
|
|
|
|
|
|
+ build.children = [];
|
|
build.children.push(
|
|
build.children.push(
|
|
{
|
|
{
|
|
value: "all",
|
|
value: "all",
|
|
- label: "全部"
|
|
|
|
- }, {
|
|
|
|
- value: 'noKnow',
|
|
|
|
- label: "未明确楼层"
|
|
|
|
|
|
+ label: "全部",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ value: "noKnow",
|
|
|
|
+ label: "未明确楼层",
|
|
},
|
|
},
|
|
{
|
|
{
|
|
value: floor.id,
|
|
value: floor.id,
|
|
@@ -171,13 +213,14 @@ export default class spaceIndex extends Vue {
|
|
FloorSequenceID: floor.floorSequenceId,
|
|
FloorSequenceID: floor.floorSequenceId,
|
|
infos: floor.infos || {},
|
|
infos: floor.infos || {},
|
|
outline: floor.outline || null,
|
|
outline: floor.outline || null,
|
|
- })
|
|
|
|
|
|
+ }
|
|
|
|
+ );
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- })
|
|
|
|
- })
|
|
|
|
- this.options = data
|
|
|
|
- })
|
|
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ this.options = data;
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
//改变楼层
|
|
//改变楼层
|
|
@@ -186,173 +229,187 @@ export default class spaceIndex extends Vue {
|
|
// if (value && value.length > 0 && this.building[0] != 'all') {
|
|
// if (value && value.length > 0 && this.building[0] != 'all') {
|
|
// this.buildingLabel = this.$refs['floorCascader'].getCheckedNodes()[0].pathLabels
|
|
// this.buildingLabel = this.$refs['floorCascader'].getCheckedNodes()[0].pathLabels
|
|
// }
|
|
// }
|
|
- if (this.building.length > 0) {
|
|
|
|
- this.loading = true
|
|
|
|
- let param = {
|
|
|
|
- "type": "FunctionZone",
|
|
|
|
- "orders": "sort asc, name desc",
|
|
|
|
- pageNumber: 1,
|
|
|
|
- pageSize: 1000
|
|
|
|
- }
|
|
|
|
- let param2 = {
|
|
|
|
- // 级联查建筑楼层信息
|
|
|
|
- cascade: [{ name: 'building' }, { name: 'floor', orders: 'floorSequenceId desc' }],
|
|
|
|
- zoneType: 'FunctionZone',
|
|
|
|
- pageNumber: this.paginationList.page,
|
|
|
|
- pageSize: this.paginationList.size,
|
|
|
|
- orders: "createTime desc, localName desc, localId desc, id asc"
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- if (this.building.length === 1) {
|
|
|
|
- param2.filters = ''
|
|
|
|
- switch (this.building[0]) {
|
|
|
|
- case 'noKnow':
|
|
|
|
- param2.filters =`buildingId='isnull'`
|
|
|
|
- break;
|
|
|
|
- case 'all':
|
|
|
|
- delete param2.filters
|
|
|
|
-
|
|
|
|
- break
|
|
|
|
- }
|
|
|
|
- } else if (this.building.length === 2) {
|
|
|
|
- switch (this.building[1]) {
|
|
|
|
- case 'noKnow':
|
|
|
|
- param2.filters = `buildingId='${ this.building[0] }';floorId='isnull'`
|
|
|
|
-
|
|
|
|
- break;
|
|
|
|
- case 'all':
|
|
|
|
- param2.filters = `buildingId='${ this.building[0] }'`
|
|
|
|
- break;
|
|
|
|
- default:
|
|
|
|
- param2.filters = `buildingId='${ this.building[0] }';floorId='${ this.building[1] }'`
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- let promise = new Promise(resolve => {
|
|
|
|
- dictQuery(param).then(res => {
|
|
|
|
- resolve(res)
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
- let promise2 = new Promise(resolve => {
|
|
|
|
- queryZone(param2).then(res => {
|
|
|
|
- resolve(res)
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
- Promise.all([promise, promise2]).then(res => {
|
|
|
|
- let tableData = []
|
|
|
|
- this.loading = false
|
|
|
|
- // 类型下信息点,重组数据
|
|
|
|
- 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)
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- basicInfos.map(item => {
|
|
|
|
- if(item.path == 'building') {
|
|
|
|
- item.path='buildingSign'
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- if(item.path == 'floor') {
|
|
|
|
- item.path='floorSign'
|
|
|
|
-
|
|
|
|
|
|
+ if (this.activeName == 'table') {
|
|
|
|
+ if (this.building.length > 0) {
|
|
|
|
+ this.loading = true;
|
|
|
|
+ let param = {
|
|
|
|
+ type: "FunctionZone",
|
|
|
|
+ orders: "sort asc, name desc",
|
|
|
|
+ pageNumber: 1,
|
|
|
|
+ pageSize: 1000,
|
|
|
|
+ };
|
|
|
|
+ let param2 = {
|
|
|
|
+ // 级联查建筑楼层信息
|
|
|
|
+ cascade: [
|
|
|
|
+ { name: "building" },
|
|
|
|
+ { name: "floor", orders: "floorSequenceId desc" },
|
|
|
|
+ ],
|
|
|
|
+ zoneType: "FunctionZone",
|
|
|
|
+ pageNumber: this.paginationList.page,
|
|
|
|
+ pageSize: this.paginationList.size,
|
|
|
|
+ orders: "createTime desc, localName desc, localId desc, id asc",
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ if (this.building.length === 1) {
|
|
|
|
+ param2.filters = "";
|
|
|
|
+ switch (this.building[0]) {
|
|
|
|
+ case "noKnow":
|
|
|
|
+ param2.filters = `buildingId='isnull'`;
|
|
|
|
+ break;
|
|
|
|
+ case "all":
|
|
|
|
+ delete param2.filters;
|
|
|
|
+
|
|
|
|
+ break;
|
|
}
|
|
}
|
|
- return item
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
- this.headersStage = {
|
|
|
|
- basicInfos: {
|
|
|
|
- name: '模型解析',
|
|
|
|
- data: basicInfos
|
|
|
|
- },
|
|
|
|
- dictStages: {
|
|
|
|
- name: '租赁系统',
|
|
|
|
- data: dictStages
|
|
|
|
|
|
+ } else if (this.building.length === 2) {
|
|
|
|
+ switch (this.building[1]) {
|
|
|
|
+ case "noKnow":
|
|
|
|
+ param2.filters = `buildingId='${this.building[0]}';floorId='isnull'`;
|
|
|
|
+
|
|
|
|
+ break;
|
|
|
|
+ case "all":
|
|
|
|
+ param2.filters = `buildingId='${this.building[0]}'`;
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ param2.filters = `buildingId='${this.building[0]}';floorId='${this.building[1]}'`;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- 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
|
|
|
|
- }
|
|
|
|
- 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);
|
|
|
|
|
|
+
|
|
|
|
+ let promise = new Promise((resolve) => {
|
|
|
|
+ dictQuery(param).then((res) => {
|
|
|
|
+ resolve(res);
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ let promise2 = new Promise((resolve) => {
|
|
|
|
+ queryZone(param2).then((res) => {
|
|
|
|
+ resolve(res);
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ Promise.all([promise, promise2]).then((res) => {
|
|
|
|
+ let tableData = [];
|
|
|
|
+ this.loading = false;
|
|
|
|
+ // 类型下信息点,重组数据
|
|
|
|
+ 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);
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ });
|
|
|
|
+ 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;
|
|
|
|
+ }
|
|
|
|
+ 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);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ this.getBatch(this.tableData);
|
|
});
|
|
});
|
|
- this.getBatch(this.tableData)
|
|
|
|
- })
|
|
|
|
- } else {
|
|
|
|
- console.log('void')
|
|
|
|
|
|
+ } else {
|
|
|
|
+ console.log("void");
|
|
|
|
+ }
|
|
|
|
+ } else if (this.activeName == 'picture') {
|
|
|
|
+ this.toGraph()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
// 动态信息点
|
|
// 动态信息点
|
|
getBatch(data) {
|
|
getBatch(data) {
|
|
let param = {
|
|
let param = {
|
|
- groupCode: 'WD',
|
|
|
|
- appId: 'datacenter',
|
|
|
|
|
|
+ groupCode: "WD",
|
|
|
|
+ appId: "datacenter",
|
|
projectId: this.projectId,
|
|
projectId: this.projectId,
|
|
- data: []
|
|
|
|
- }
|
|
|
|
- this.all.forEach(head => {
|
|
|
|
- if (head.category != 'STATIC') {
|
|
|
|
- data.forEach(item => {
|
|
|
|
- let cur = tools.dataForKey(item, head.path)
|
|
|
|
|
|
+ data: [],
|
|
|
|
+ };
|
|
|
|
+ this.all.forEach((head) => {
|
|
|
|
+ if (head.category != "STATIC") {
|
|
|
|
+ data.forEach((item) => {
|
|
|
|
+ let cur = tools.dataForKey(item, head.path);
|
|
if (cur) {
|
|
if (cur) {
|
|
param.data.push({
|
|
param.data.push({
|
|
objectId: item.id,
|
|
objectId: item.id,
|
|
- infoCode: head.code
|
|
|
|
- })
|
|
|
|
|
|
+ infoCode: head.code,
|
|
|
|
+ });
|
|
}
|
|
}
|
|
- })
|
|
|
|
|
|
+ });
|
|
}
|
|
}
|
|
-
|
|
|
|
- })
|
|
|
|
|
|
+ });
|
|
if (param.data.length) {
|
|
if (param.data.length) {
|
|
- BeatchQueryParam(param).then(res => {
|
|
|
|
- this.tableData = data.map(item => {
|
|
|
|
- res.data.map(child => {
|
|
|
|
|
|
+ BeatchQueryParam(param).then((res) => {
|
|
|
|
+ this.tableData = data.map((item) => {
|
|
|
|
+ res.data.map((child) => {
|
|
if (item.id == child.objectId) {
|
|
if (item.id == child.objectId) {
|
|
if (!!child.data || child.data == 0) {
|
|
if (!!child.data || child.data == 0) {
|
|
- this.all.map(head => {
|
|
|
|
|
|
+ this.all.map((head) => {
|
|
if (head.code == child.infoCode) {
|
|
if (head.code == child.infoCode) {
|
|
- let contentVal = child.data
|
|
|
|
- if (this.codeToDataSource[child.infoCode]) {
|
|
|
|
- contentVal = this.codeToDataSource[child.infoCode][child.data]
|
|
|
|
|
|
+ let contentVal = child.data;
|
|
|
|
+ if (
|
|
|
|
+ this.codeToDataSource[
|
|
|
|
+ child.infoCode
|
|
|
|
+ ]
|
|
|
|
+ ) {
|
|
|
|
+ contentVal = this.codeToDataSource[
|
|
|
|
+ child.infoCode
|
|
|
|
+ ][child.data];
|
|
}
|
|
}
|
|
- tools.setDataForKey(item, head.path, contentVal);
|
|
|
|
|
|
+ tools.setDataForKey(
|
|
|
|
+ item,
|
|
|
|
+ head.path,
|
|
|
|
+ contentVal
|
|
|
|
+ );
|
|
}
|
|
}
|
|
- })
|
|
|
|
|
|
+ });
|
|
} else {
|
|
} else {
|
|
- this.all.map(head => {
|
|
|
|
|
|
+ this.all.map((head) => {
|
|
if (head.code == child.infoCode) {
|
|
if (head.code == child.infoCode) {
|
|
tools.setDataForKey(
|
|
tools.setDataForKey(
|
|
item,
|
|
item,
|
|
@@ -363,41 +420,63 @@ export default class spaceIndex extends Vue {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- })
|
|
|
|
- return item
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
|
|
+ });
|
|
|
|
+ return item;
|
|
|
|
+ });
|
|
|
|
+ });
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
handleChange(val) {
|
|
handleChange(val) {
|
|
- console.log(val)
|
|
|
|
|
|
+ console.log(val);
|
|
}
|
|
}
|
|
|
|
|
|
// 当前分页
|
|
// 当前分页
|
|
handleCurrentChange(val: number) {
|
|
handleCurrentChange(val: number) {
|
|
- console.log(val)
|
|
|
|
- this.paginationList.page = val
|
|
|
|
- this.changeCascader()
|
|
|
|
|
|
+ this.paginationList.page = val;
|
|
|
|
+ this.changeCascader();
|
|
}
|
|
}
|
|
|
|
|
|
handleSizeChange(val: number) {
|
|
handleSizeChange(val: number) {
|
|
- this.paginationList.size = val
|
|
|
|
- this.changeCascader()
|
|
|
|
|
|
+ this.paginationList.size = val;
|
|
|
|
+ this.changeCascader();
|
|
}
|
|
}
|
|
|
|
|
|
// 搜索
|
|
// 搜索
|
|
searchValue(val: string) {
|
|
searchValue(val: string) {
|
|
- this.inputSearch = val
|
|
|
|
- this.changeCascader()
|
|
|
|
|
|
+ this.inputSearch = val;
|
|
|
|
+ this.changeCascader();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // tab页切换
|
|
|
|
+ tabChange() {
|
|
|
|
+ if (this.activeName == "picture") {
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.toGraph()
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 切换至图
|
|
|
|
+ toGraph() {
|
|
|
|
+ if (this.building.length) {
|
|
|
|
+ if (
|
|
|
|
+ this.building.indexOf("noKnow") < 0 &&
|
|
|
|
+ this.building.indexOf("all") < 0
|
|
|
|
+ ) {
|
|
|
|
+ this.$refs.spaceGraph.getData(this.floorToMap[this.building[1]]);
|
|
|
|
+ } else {
|
|
|
|
+ this.$refs.spaceGraph.noMap();
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ this.$refs.spaceGraph.noMap();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
.void {
|
|
.void {
|
|
-
|
|
|
|
margin-top: 200px;
|
|
margin-top: 200px;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -430,7 +509,7 @@ export default class spaceIndex extends Vue {
|
|
height: calc(100% - 41px);
|
|
height: calc(100% - 41px);
|
|
border: 1px solid #e1e7ea;
|
|
border: 1px solid #e1e7ea;
|
|
border-top: none;
|
|
border-top: none;
|
|
- padding: 12px;
|
|
|
|
|
|
+ padding-bottom: 12px;
|
|
|
|
|
|
.search {
|
|
.search {
|
|
padding: 16px;
|
|
padding: 16px;
|
|
@@ -439,9 +518,11 @@ export default class spaceIndex extends Vue {
|
|
margin-left: 16px;
|
|
margin-left: 16px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ .borderBottom{
|
|
|
|
+ border-bottom: 1px solid #e1e7ea;
|
|
|
|
+ }
|
|
.graph {
|
|
.graph {
|
|
- height: calc(100% - 64px)
|
|
|
|
|
|
+ height: calc(100% - 64px);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|