|
@@ -29,7 +29,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div v-show="spaceDetails.Outline && !spaceDetails.Outline[0] || !spaceDetails.Outline"
|
|
|
- style="height: 280px;transform: translateY(30%);textAlign:center;">
|
|
|
+ style="height: 280px;transform: translateY(30%);text-align:center;">
|
|
|
<i class="icon-wushuju iconfont"></i>
|
|
|
数据暂无
|
|
|
</div>
|
|
@@ -52,11 +52,24 @@
|
|
|
<el-tabs v-model="activeTab" type='card'>
|
|
|
<template v-for="(item,index) in tabsList">
|
|
|
<el-tab-pane :name="item.Code" :key="index" :label="item.Name">
|
|
|
- <div v-show="activeTab === 'staticData'" style="width:100%;height:100%;text-align: left;"
|
|
|
- id="iframe-box"></div>
|
|
|
+ <section v-show="activeTab === 'staticData'">
|
|
|
+ <el-radio-group
|
|
|
+ v-model="radio"
|
|
|
+ style=" margin: 0 10px;"
|
|
|
+ @change="changRadio"
|
|
|
+ v-for="(item,index) in radioList"
|
|
|
+ :key="index"
|
|
|
+ >
|
|
|
+ <el-radio :label="item.label">{{item.value}}</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+
|
|
|
+ <exhibitionBaseInformation :exhibitionBaseInformation="exhibitionBaseInformation"/>
|
|
|
+ </section>
|
|
|
<div v-show="activeTab === 'dynamicData'" style="width:100%;height:100%;">
|
|
|
<div class="content-box">
|
|
|
- <div style="text-align: left;margin-bottom: 10px"> <el-checkbox v-model="onlyMessage" @change="handleCheckbox">只看需采集的信息点</el-checkbox></div>
|
|
|
+ <div style="text-align: left;margin-bottom: 10px">
|
|
|
+ <el-checkbox v-model="onlyMessage" @change="handleCheckbox">只看需采集的信息点</el-checkbox>
|
|
|
+ </div>
|
|
|
|
|
|
<el-table ref="multipleTable" :data="tableData" stripe :header-cell-style="headerStyle">
|
|
|
<el-table-column prop="InfoPointName" label="信息点名称">
|
|
@@ -110,6 +123,8 @@
|
|
|
import syInSpaceTable from '@/components/business_space/newTables/syInSpaceTable'
|
|
|
import {DivideFloorScene, FloorView} from "@saga-web/cad-engine/lib";
|
|
|
import tools from "@/utils/scan/tools";
|
|
|
+ import exhibitionBaseInformation from "@/components/ledger/details/detail/exhibitionBaseInformation";
|
|
|
+
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
@@ -144,12 +159,29 @@
|
|
|
secret: '',
|
|
|
canvasLoading: false,
|
|
|
buildingFloor: localStorage.getItem('buildingFloor'),
|
|
|
- onlyMessage: false
|
|
|
+ onlyMessage: false,
|
|
|
+ exhibitionBaseInformation: {
|
|
|
+ information: {},
|
|
|
+ },
|
|
|
+ pointData: [],
|
|
|
+ instance: {},
|
|
|
+ radioList: [
|
|
|
+ {
|
|
|
+ value: '显示全部信息点',
|
|
|
+ label: '1'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: '显示有值信息点',
|
|
|
+ label: '2'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ radio: '1'
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
|
eqToSpaceTable,
|
|
|
- syInSpaceTable
|
|
|
+ syInSpaceTable,
|
|
|
+ exhibitionBaseInformation
|
|
|
},
|
|
|
beforeRouteEnter(to, from, next) {
|
|
|
if (to.query.RoomID && to.query.zone) {
|
|
@@ -166,129 +198,241 @@
|
|
|
computed: {},
|
|
|
methods: {
|
|
|
getData() {
|
|
|
- this.params = this.$route.query;
|
|
|
- // 获取空间数据
|
|
|
- let params = {
|
|
|
- Filters: `RoomID="${this.$route.query.RoomID}"`,
|
|
|
- ZoneType: this.$route.query.zone
|
|
|
- }
|
|
|
- zoneQuery(params, res => {
|
|
|
- this.spaceDetails = res.Content[0];
|
|
|
- if (this.spaceDetails.Outline && this.spaceDetails.Outline[0] && this.spaceDetails.Outline[0].length) {
|
|
|
- this.getSpaceFloor();
|
|
|
+ //获取表头
|
|
|
+ let params1 = {
|
|
|
+ data: {
|
|
|
+ Orders: "sort asc",
|
|
|
+ PageNumber: 1,
|
|
|
+ PageSize: 1000
|
|
|
+ },
|
|
|
+ type: this.$route.query.zone
|
|
|
}
|
|
|
- this.setFrame();
|
|
|
- this.getInFormationPoitnName();
|
|
|
- })
|
|
|
- },
|
|
|
- setFrame() {
|
|
|
- // 设置静态数据tab的iframe地址
|
|
|
- this.proId = localStorage.getItem('projectId');
|
|
|
- this.secret = localStorage.getItem('secret');
|
|
|
- this.iframeSrc = `${process.env.BASE_URL}:8889/#/details?perjectId=${this.proId}&secret=${this.secret}&FmId=${this.$route.query.RoomID}&type=0&code=${this.$route.query.zone}`
|
|
|
- let box = document.getElementById('iframe-box');
|
|
|
- box.innerHTML = '';
|
|
|
- let iframe = document.createElement('iframe');
|
|
|
- iframe.src = this.iframeSrc
|
|
|
- iframe.style.width = '100%';
|
|
|
- iframe.style.height = '100%';
|
|
|
- box.appendChild(iframe);
|
|
|
- },
|
|
|
- getSpaceFloor() {
|
|
|
- // 获取业务空间楼层
|
|
|
- let params = {
|
|
|
- Filters: `FloorID='${this.spaceDetails.FloorId}'`
|
|
|
- }
|
|
|
- floorQuery(params, res => {
|
|
|
- if (res.Content[0] && res.Content[0].StructureInfo && res.Content[0].StructureInfo.FloorMap) {
|
|
|
- this.FloorMap = res.Content[0].StructureInfo.FloorMap;
|
|
|
- this.getGraphy();
|
|
|
+ // 获取空间数据
|
|
|
+ let params2 = {
|
|
|
+ Filters: `RoomID="${this.$route.query.RoomID}"`,
|
|
|
+ ZoneType: this.$route.query.zone
|
|
|
}
|
|
|
- })
|
|
|
- },
|
|
|
- getGraphy() {// 绘制空间位置图片
|
|
|
- let that = this;
|
|
|
- that.clearGraphy()
|
|
|
- that.scene = new DivideFloorScene();
|
|
|
- this.canvasLoading = true;
|
|
|
- that.scene.loadUrl(`/image-service/common/file_get?systemId=revit&key=${this.FloorMap}`).then(res => {
|
|
|
- that.canvasLoading = false;
|
|
|
- if (res == 'error') {
|
|
|
- this.FloorMap = '';
|
|
|
- this.$message.warning('数据解析异常');
|
|
|
- return;
|
|
|
+ this.params = this.$route.query;
|
|
|
+ let promise1 = new Promise((resolve, reject) => {
|
|
|
+ getDataDictionary(params1, res => {
|
|
|
+ resolve(res)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ let promise2 = new Promise((resolve, reject) => {
|
|
|
+ zoneQuery(params2, res => {
|
|
|
+ resolve(res)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ Promise.all([promise1, promise2]).then(values => {
|
|
|
+ this.pointData = values[0].Content;
|
|
|
+ this.spaceDetails = values[1].Content[0];
|
|
|
+ if (this.spaceDetails.Outline && this.spaceDetails.Outline[0] && this.spaceDetails.Outline[0].length) {
|
|
|
+ this.getSpaceFloor();
|
|
|
+ }
|
|
|
+ let obj = values[1].Content[0] ? this.deepCopy(values[1].Content[0]) : values[1].Content[0];
|
|
|
+ obj = tools.flattenKeys(obj);
|
|
|
+ for(let key in obj) {
|
|
|
+ if(Array.isArray(obj[key]) && !obj[key].length) {
|
|
|
+ delete obj[key]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.instance = obj;
|
|
|
+ this.getInFormationPoitnName();
|
|
|
+ this.handleRadios(this.radio);
|
|
|
+ })
|
|
|
+ },
|
|
|
+ deepCopy(obj) {
|
|
|
+ return JSON.parse(JSON.stringify(obj))
|
|
|
+ },
|
|
|
+ getSpaceFloor() {
|
|
|
+ // 获取业务空间楼层
|
|
|
+ let params = {
|
|
|
+ Filters: `FloorID='${this.spaceDetails.FloorId}'`
|
|
|
}
|
|
|
- that.view.scene = that.scene;
|
|
|
- that.view.fitSceneToView();
|
|
|
- let tempArr = {
|
|
|
- RoomLocalName: this.spaceDetails.RoomLocalName,
|
|
|
- OutLine: this.spaceDetails.Outline,
|
|
|
- RoomID: this.spaceDetails.RoomID,
|
|
|
- Color: "#F56C6C",
|
|
|
- HighLightFlag: true
|
|
|
+ floorQuery(params, res => {
|
|
|
+ if (res.Content[0] && res.Content[0].StructureInfo && res.Content[0].StructureInfo.FloorMap) {
|
|
|
+ this.FloorMap = res.Content[0].StructureInfo.FloorMap;
|
|
|
+ this.getGraphy();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getGraphy() {// 绘制空间位置图片
|
|
|
+ let that = this;
|
|
|
+ that.clearGraphy()
|
|
|
+ that.scene = new DivideFloorScene();
|
|
|
+ this.canvasLoading = true;
|
|
|
+ that.scene.loadUrl(`/image-service/common/file_get?systemId=revit&key=${this.FloorMap}`).then(res => {
|
|
|
+ that.canvasLoading = false;
|
|
|
+ if (res == 'error') {
|
|
|
+ this.FloorMap = '';
|
|
|
+ this.$message.warning('数据解析异常');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ that.view.scene = that.scene;
|
|
|
+ that.view.fitSceneToView();
|
|
|
+ let tempArr = {
|
|
|
+ RoomLocalName: this.spaceDetails.RoomLocalName,
|
|
|
+ OutLine: this.spaceDetails.Outline,
|
|
|
+ RoomID: this.spaceDetails.RoomID,
|
|
|
+ Color: "#F56C6C",
|
|
|
+ HighLightFlag: true
|
|
|
+ }
|
|
|
+ that.scene.addZoneList([tempArr]);
|
|
|
+ this.scene.isSpaceSelectable = false;
|
|
|
+ })
|
|
|
+ },
|
|
|
+ clearGraphy() {
|
|
|
+ if (this.view && this.view.scene) {
|
|
|
+ this.view.scene = null;
|
|
|
+ return
|
|
|
}
|
|
|
- that.scene.addZoneList([tempArr]);
|
|
|
- this.scene.isSpaceSelectable = false;
|
|
|
- })
|
|
|
- },
|
|
|
- clearGraphy() {
|
|
|
- if (this.view && this.view.scene) {
|
|
|
- this.view.scene = null;
|
|
|
- return
|
|
|
- }
|
|
|
- this.view = new FloorView('floorCanvas')
|
|
|
- },
|
|
|
- getInFormationPoitnName() {// 获取动态数据
|
|
|
- let proId = localStorage.getItem('projectId');
|
|
|
- let secret = localStorage.getItem('secret');
|
|
|
- let params = {
|
|
|
- data: {
|
|
|
- Filters: 'InputMode in ["L1","L2","L","M"]',
|
|
|
- Orders: "sort asc",
|
|
|
- PageNumber: 1,
|
|
|
- PageSize: 500
|
|
|
- },
|
|
|
- type: this.$route.query.zone
|
|
|
- }
|
|
|
- let param = {
|
|
|
- secret: secret,
|
|
|
- ProjId: proId,
|
|
|
- data: {
|
|
|
- criterias: []
|
|
|
+ this.view = new FloorView('floorCanvas')
|
|
|
+ },
|
|
|
+ getInFormationPoitnName() {// 获取动态数据
|
|
|
+ let proId = localStorage.getItem('projectId');
|
|
|
+ let secret = localStorage.getItem('secret');
|
|
|
+ let params = {
|
|
|
+ data: {
|
|
|
+ Filters: 'InputMode in ["L1","L2","L","M"]',
|
|
|
+ Orders: "sort asc",
|
|
|
+ PageNumber: 1,
|
|
|
+ PageSize: 500
|
|
|
+ },
|
|
|
+ type: this.$route.query.zone
|
|
|
}
|
|
|
- }
|
|
|
- getDataDictionary(params, res => {// 获取表号功能号
|
|
|
- // this.tableData = res.Content;
|
|
|
-
|
|
|
- if (this.onlyMessage) {
|
|
|
- this.tableData = res.Content.filter(i => i.Visible)
|
|
|
- } else {
|
|
|
- this.tableData = res.Content
|
|
|
+ let param = {
|
|
|
+ secret: secret,
|
|
|
+ ProjId: proId,
|
|
|
+ data: {
|
|
|
+ criterias: []
|
|
|
+ }
|
|
|
}
|
|
|
- this.tableData.map(item => {
|
|
|
- let cur = tools.dataForKey(this.spaceDetails, item.Path);
|
|
|
- // item.functionNo = cur;
|
|
|
- param.data.criterias.push({
|
|
|
- id: this.spaceDetails.RoomID,
|
|
|
- code: item.InfoPointCode
|
|
|
+ getDataDictionary(params, res => {// 获取表号功能号
|
|
|
+ // this.tableData = res.Content;
|
|
|
+
|
|
|
+ if (this.onlyMessage) {
|
|
|
+ this.tableData = res.Content.filter(i => i.Visible)
|
|
|
+ } else {
|
|
|
+ this.tableData = res.Content
|
|
|
+ }
|
|
|
+ this.tableData.map(item => {
|
|
|
+ let cur = tools.dataForKey(this.spaceDetails, item.Path);
|
|
|
+ // item.functionNo = cur;
|
|
|
+ param.data.criterias.push({
|
|
|
+ id: this.spaceDetails.RoomID,
|
|
|
+ code: item.InfoPointCode
|
|
|
+ });
|
|
|
+ })
|
|
|
+ BeatchQueryParam(param, res => {// 获取动态数据
|
|
|
+ res.Content.forEach((item, index) => {
|
|
|
+ this.$set(this.tableData[index], 'functionNo', item.data)
|
|
|
+ this.$set(this.tableData[index], 'functionNoTime', item.receivetime)
|
|
|
+ tools.setDataForKey(
|
|
|
+ this.spaceDetails,
|
|
|
+ this.tableData[index].Path,
|
|
|
+ this.$set(this.tableData[index], "functionNoDynamicData", item.interrupt ? '已断数' : (item.error ? item.value ? "表号功能号不存在" : "未维护" : "暂未采集到实时数据"))
|
|
|
+ );
|
|
|
+ })
|
|
|
});
|
|
|
})
|
|
|
- BeatchQueryParam(param, res => {// 获取动态数据
|
|
|
- res.Content.forEach((item, index) => {
|
|
|
- this.$set(this.tableData[index], 'functionNo', item.data)
|
|
|
- this.$set(this.tableData[index], 'functionNoTime', item.receivetime)
|
|
|
- tools.setDataForKey(
|
|
|
- this.spaceDetails,
|
|
|
- this.tableData[index].Path,
|
|
|
- this.$set(this.tableData[index], "functionNoDynamicData", item.interrupt ? '已断数' :(item.error ? item.value ? "表号功能号不存在" : "未维护" : "暂未采集到实时数据"))
|
|
|
- );
|
|
|
- })
|
|
|
- });
|
|
|
- })
|
|
|
- },
|
|
|
+ },
|
|
|
handleCheckbox(val) {
|
|
|
this.onlyMessage = val
|
|
|
this.getInFormationPoitnName()
|
|
|
+ },
|
|
|
+ displayData(arr) {//对数据进行处理传给组件展示
|
|
|
+ const result = {}
|
|
|
+ const resultEnergy = {};
|
|
|
+ arr.forEach(i => {
|
|
|
+ if (this.instance && this.instance.hasOwnProperty(i.Path) && this.currentRadio != 2) {
|
|
|
+ i.value = this.instance[i.Path]
|
|
|
+ }
|
|
|
+ if (i.InputMode == 'C5') {
|
|
|
+ if (this.instance && this.instance.hasOwnProperty(i.Path)) {
|
|
|
+ let time = this.instance[i.Path]
|
|
|
+ i.value = this.formatDate(time)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (i.DataSource && i.DataSource.length) {
|
|
|
+ let source = JSON.parse(i.DataSource)
|
|
|
+ //判断输入类型
|
|
|
+ if (i.InputMode == 'D1L') {
|
|
|
+ let d1l = tools.formatDataSource(i.DataSource)
|
|
|
+ d1l.forEach(k => {
|
|
|
+ if (k.Code == this.instance[i.Path]) {
|
|
|
+ i.value = k.Name
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else if (i.InputMode == 'D2' || i.InputMode == 'C6') {
|
|
|
+ if (this.instance && this.instance.hasOwnProperty(i.Path)) {
|
|
|
+ if (!Array.isArray(this.instance[i.Path])) {
|
|
|
+ let transArray = this.instance[i.Path].split(',')
|
|
|
+ i.value = source.filter(item => transArray.includes(item.Code)).map(item => item.Name).join(',')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ source.forEach(j => {
|
|
|
+ if (this.instance && j.Code == this.instance[i.Path]) {
|
|
|
+ i.value = j.Name
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ switch (i.InputMode) {
|
|
|
+ case "L":
|
|
|
+ case "L1":
|
|
|
+ case "L2":
|
|
|
+ case "M":
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ if (result[`${i.FirstName}${i.SecondName ? '/' + i.SecondName : ''}`]) {
|
|
|
+ result[`${i.FirstName}${i.SecondName ? '/' + i.SecondName : ''}`].paths.push({
|
|
|
+ Path: i.Path,
|
|
|
+ InfoPointName: i.InfoPointName,
|
|
|
+ InfoPointCode: i.InfoPointCode,
|
|
|
+ Value: i.value,
|
|
|
+ Visible: i.Visible,
|
|
|
+ KeyWord: i.KeyWord,
|
|
|
+ InputMode: i.InputMode
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ result[`${i.FirstName}${i.SecondName ? '/' + i.SecondName : ''}`] = {
|
|
|
+ paths: [{
|
|
|
+ Path: i.Path,
|
|
|
+ InfoPointName: i.InfoPointName,
|
|
|
+ InfoPointCode: i.InfoPointCode,
|
|
|
+ Value: i.value,
|
|
|
+ Visible: i.Visible,
|
|
|
+ KeyWord: i.KeyWord,
|
|
|
+ InputMode: i.InputMode
|
|
|
+ }]
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.exhibitionBaseInformation.information = result
|
|
|
+ },
|
|
|
+ changRadio(val) {
|
|
|
+ this.handleRadios(val)
|
|
|
+ this.radio = val
|
|
|
+ },
|
|
|
+ handleRadios(val) {
|
|
|
+ let arr = []
|
|
|
+ if (val == 1) {
|
|
|
+ arr = this.pointData
|
|
|
+ } else {
|
|
|
+ let list = this.pointData
|
|
|
+ list.map(j => {
|
|
|
+ if (this.instance.hasOwnProperty(j.Path)) {
|
|
|
+ return {
|
|
|
+ ...j,
|
|
|
+ value: this.instance[j.Path]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ arr = list.filter(k => k.value)
|
|
|
+ }
|
|
|
+ this.displayData(arr)
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
@@ -356,7 +500,6 @@
|
|
|
.space-img {
|
|
|
width: 100%;
|
|
|
.img-box {
|
|
|
- margin-bottom: 20px;
|
|
|
float: left;
|
|
|
position: relative;
|
|
|
width: 47%;
|
|
@@ -380,7 +523,7 @@
|
|
|
}
|
|
|
.el-main {
|
|
|
color: #333;
|
|
|
- text-align: center;
|
|
|
+ /*text-align: center;*/
|
|
|
overflow: hidden;
|
|
|
width: 100%;
|
|
|
padding: 10px 0 0 10px;
|