|
@@ -1,16 +1,16 @@
|
|
|
<template>
|
|
|
<div id="handsontable" v-loading="isLoading">
|
|
|
<el-row class="left">
|
|
|
- <div style="display: inline-block" v-show="zoneCode === 'OtherZone'">
|
|
|
- <!-- <div style="display: inline-block" v-show="!onlyRead && zoneCode === 'OtherZone'">-->
|
|
|
+ <!-- <div style="display: inline-block" v-show="zoneCode === 'OtherZone'">
|
|
|
<el-button @click="addZoneBtn" type="primary">添加分区</el-button>
|
|
|
<el-select v-model="OtherValue" placeholder="请选择分区类型" @change="changeOtherZone">
|
|
|
<el-option v-for="item in OtherList" :key="item.value" :label="item.label" :value="item.value">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
|
|
|
|
- </div>
|
|
|
- <el-select v-model="onlyRead" @change="getData(false)" style="width:100px;margin-right:20px;vertical-align:bottom;">
|
|
|
+ </div> -->
|
|
|
+ <el-select v-model="onlyRead" @change="getData(false)"
|
|
|
+ style="width:100px;margin-right:20px;vertical-align:bottom;">
|
|
|
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
|
|
</el-select>
|
|
|
<el-select v-model="showType" @change="initHot" style="width:100px;margin-right:10px;vertical-align:bottom;">
|
|
@@ -19,7 +19,8 @@
|
|
|
<el-button v-show="!onlyRead" @click="addSp">添加</el-button>
|
|
|
<el-button @click="reset">刷新</el-button>
|
|
|
<el-button v-show="!onlyRead" @click="undo">撤销</el-button>
|
|
|
- <el-input v-model="zoneItemID" placeholder="请输入业务空间id" @keyup.enter.native="getData" style="display:inline-block;width:500px;margin-left:20px;">
|
|
|
+ <el-input v-model="zoneItemID" placeholder="请输入业务空间id" @keyup.enter.native="getData"
|
|
|
+ style="display:inline-block;width:500px;margin-left:20px;">
|
|
|
<i slot="suffix" class="el-input__icon el-icon-search" @click="getData"></i>
|
|
|
</el-input>
|
|
|
</el-row>
|
|
@@ -29,9 +30,11 @@
|
|
|
暂无数据
|
|
|
</div>
|
|
|
<!-- <add-business :buildMess="buildMess" :dialog="dialog"></add-business> -->
|
|
|
- <el-pagination class="right" v-show="main && main.length" @size-change="handleSizeChange" @current-change="handleCurrentChange"
|
|
|
- :current-page="page.pageNumber" :page-sizes="page.pageSizes" :page-size="page.pageSize" layout="total, sizes, prev, pager, next, jumper"
|
|
|
- :total="page.total">
|
|
|
+ <el-pagination class="right" v-show="main && main.length" @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ :current-page="page.pageNumber" :page-sizes="page.pageSizes" :page-size="page.pageSize"
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ :total="page.total">
|
|
|
</el-pagination>
|
|
|
<!-- <div class="right" v-show="main && main.length">
|
|
|
<my-pagination :page="page" @change="pageChange"></my-pagination>
|
|
@@ -39,8 +42,8 @@
|
|
|
<!-- 二维码弹窗 -->
|
|
|
<qrcode :dialog="dialog" :qrcodeUrl="qrcodeUrl" :addBody="true" ref="qrcode"></qrcode>
|
|
|
<!-- 上传图片-->
|
|
|
- <upload-img-dialog :read="onlyRead" @changeFile="imgChange" :keysArr="imgsArr" :dialog="myDialog" />
|
|
|
- <dialogZone ref="zone" @createSuccess="getOtherType" />
|
|
|
+ <upload-img-dialog :read="onlyRead" @changeFile="imgChange" :keysArr="imgsArr" :dialog="myDialog"/>
|
|
|
+ <dialogZone ref="zone" @createSuccess="getOtherType"/>
|
|
|
<!-- 不支持的输入方式 -->
|
|
|
<el-dialog title="临时维护信息点" :visible.sync="myDialog.update" @close="handleCloseUpdate" width="670px">
|
|
|
<el-row>
|
|
@@ -69,53 +72,51 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
- // 引用handsontable插件
|
|
|
- import "@/assets/js/chosen.jquery.min";
|
|
|
- import tools from "@/utils/scan/tools";
|
|
|
- import "@/assets/js/handsontable-chosen-editor";
|
|
|
- import lStorage from '@/utils/localStorage'
|
|
|
- import myPagination from "@/components/common/myPagination";
|
|
|
- import addBusiness from "@/components/business_space/dialogs/addDialog/businessDialog"
|
|
|
- import showTools from "@/utils/handsontable/notShow"
|
|
|
- import handsonUtils from "@/utils/hasontableUtils"
|
|
|
- import Handsontable from "handsontable-pro"
|
|
|
- import buildFloor from '@/utils/handsontable/buildFloorData'
|
|
|
- import spaceCascader from '@/components/ledger/lib/spaceSelect'
|
|
|
- import 'handsontable-pro/dist/handsontable.full.css'
|
|
|
- import uploadImgDialog from "@/components/business_space/dialogs/list/uploadImgDialog"
|
|
|
- import qrcode from "@/components/ledger/lib/qrcode";
|
|
|
- import {
|
|
|
- BeatchQueryParam,
|
|
|
- handleZoneUpdateBd,
|
|
|
- queryAllZoneType,
|
|
|
- zoneCreate,
|
|
|
- zoneDelete,
|
|
|
- zoneQuery,
|
|
|
- zoneUpdate
|
|
|
- } from "@/api/scan/request";
|
|
|
- import {mapGetters} from "vuex";
|
|
|
- import dialogZone from "../../ledger/addDialog/dialogZone";
|
|
|
+// 引用handsontable插件
|
|
|
+import "@/assets/js/chosen.jquery.min";
|
|
|
+import tools from "@/utils/scan/tools";
|
|
|
+import "@/assets/js/handsontable-chosen-editor";
|
|
|
+import lStorage from '@/utils/localStorage'
|
|
|
+import myPagination from "@/components/common/myPagination";
|
|
|
+import showTools from "@/utils/handsontable/notShow"
|
|
|
+import handsonUtils from "@/utils/hasontableUtils"
|
|
|
+import Handsontable from "handsontable-pro"
|
|
|
+import buildFloor from '@/utils/handsontable/buildFloorData'
|
|
|
+import spaceCascader from '@/components/ledger/lib/spaceSelect'
|
|
|
+import 'handsontable-pro/dist/handsontable.full.css'
|
|
|
+import uploadImgDialog from "@/components/business_space/dialogs/list/uploadImgDialog"
|
|
|
+import qrcode from "@/components/ledger/lib/qrcode";
|
|
|
+import {
|
|
|
+ BeatchQueryParam,
|
|
|
+ handleZoneUpdateBd,
|
|
|
+ queryAllZoneType,
|
|
|
+ zoneCreate,
|
|
|
+ zoneDelete,
|
|
|
+ zoneQuery,
|
|
|
+ zoneUpdate
|
|
|
+} from "@/api/scan/request";
|
|
|
+import {mapGetters} from "vuex";
|
|
|
+import dialogZone from "../../ledger/addDialog/dialogZone";
|
|
|
|
|
|
- export default {
|
|
|
- props: {
|
|
|
- id: {},
|
|
|
- zoneCode: {},
|
|
|
- otherType: String
|
|
|
- },
|
|
|
- components: {
|
|
|
- qrcode, //二维码页面
|
|
|
- myPagination,
|
|
|
- addBusiness,
|
|
|
- uploadImgDialog,
|
|
|
+export default {
|
|
|
+ props: {
|
|
|
+ id: {},
|
|
|
+ zoneCode: {},
|
|
|
+ otherType: String
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ qrcode, //二维码页面
|
|
|
+ myPagination,
|
|
|
+ uploadImgDialog,
|
|
|
dialogZone,
|
|
|
spaceCascader,
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapGetters("layout", ["projectId", "secret", "userId"]),
|
|
|
+ ...mapGetters("layout", ["projectId", "secret", "userId", "group_code"]),
|
|
|
showTypes() {
|
|
|
return this.onlyRead ?
|
|
|
- [{ value: "Visible", label: '只看采集信息' }, { value: "all", label: '全部' }] :
|
|
|
- [{ value: "Visible", label: '只看采集信息' }, { value: "all", label: '全部' }]
|
|
|
+ [{value: "Visible", label: '只看采集信息'}, {value: "all", label: '全部'}] :
|
|
|
+ [{value: "Visible", label: '只看采集信息'}, {value: "all", label: '全部'}]
|
|
|
}
|
|
|
},
|
|
|
data() {
|
|
@@ -137,7 +138,7 @@
|
|
|
label: '编辑模式'
|
|
|
}],
|
|
|
onlyRead: true,
|
|
|
- showType: "",
|
|
|
+ showType: "Visible",
|
|
|
page: {
|
|
|
pageSize: 50,
|
|
|
pageSizes: [10, 20, 50, 100],
|
|
@@ -156,11 +157,12 @@
|
|
|
zoneItemID: '',
|
|
|
inputMap: {
|
|
|
flowBuild: {
|
|
|
- InputMode: 'D1',
|
|
|
- Editable:true,
|
|
|
- InfoPointCode:"flowBuild",
|
|
|
- InfoPointName:"建筑楼层",
|
|
|
- Path:"flowBuild"
|
|
|
+ editable:true,
|
|
|
+ code:"flowBuild",
|
|
|
+ name:"建筑楼层",
|
|
|
+ path:"flowBuild",
|
|
|
+ category: 'STATIC',
|
|
|
+ dataType: "ENUM"
|
|
|
}
|
|
|
}, //信息点和输入方式映射表
|
|
|
updateInputShow: false, //是否显示临时维护输入框
|
|
@@ -192,9 +194,20 @@
|
|
|
//获取表格数据
|
|
|
getHeader(headers, buildFloorSelectd) {
|
|
|
this.headers = headers
|
|
|
+ this.codeToDataSource = {}
|
|
|
this.headers.forEach(item => {
|
|
|
- if (item.Path) {
|
|
|
- this.inputMap[item.Path] = item
|
|
|
+ if (item.path) {
|
|
|
+ this.inputMap[item.path] = 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.buildFloorSelectd = buildFloorSelectd
|
|
@@ -204,15 +217,15 @@
|
|
|
|
|
|
getData() {
|
|
|
this.zoneParam = {
|
|
|
- ZoneType: this.zoneCode,
|
|
|
- PageNumber: this.page.pageNumber,
|
|
|
- PageSize: this.page.pageSize,
|
|
|
- Orders: "createTime desc, RoomLocalName desc, RoomLocalID desc, RoomID asc"
|
|
|
+ zoneType: this.zoneCode,
|
|
|
+ pageNumber: this.page.pageNumber,
|
|
|
+ pageSize: this.page.pageSize,
|
|
|
+ orders: "createTime desc, localName desc, localId desc, id asc"
|
|
|
}
|
|
|
if (this.buildFloorSelectd.length === 1) {
|
|
|
switch (this.buildFloorSelectd[0]) {
|
|
|
case 'noKnow':
|
|
|
- this.zoneParam.BuildingId = 'isnull';
|
|
|
+ this.zoneParam.buildingId = 'isnull';
|
|
|
break;
|
|
|
case 'all':
|
|
|
// params.BuildingId = '';
|
|
@@ -221,60 +234,65 @@
|
|
|
} else if (this.buildFloorSelectd.length === 2) {
|
|
|
switch (this.buildFloorSelectd[1]) {
|
|
|
case 'noKnow':
|
|
|
- this.zoneParam.BuildingId = this.buildFloorSelectd[0];
|
|
|
- this.zoneParam.FloorId = 'isnull';
|
|
|
+ this.zoneParam.buildingId = this.buildFloorSelectd[0];
|
|
|
+ this.zoneParam.floorId = 'isnull';
|
|
|
break;
|
|
|
case 'all':
|
|
|
- this.zoneParam.BuildingId = this.buildFloorSelectd[0];
|
|
|
+ this.zoneParam.buildingId = this.buildFloorSelectd[0];
|
|
|
// params.FloorId = '';
|
|
|
break;
|
|
|
default:
|
|
|
- this.zoneParam.BuildingId = this.buildFloorSelectd[0];
|
|
|
- this.zoneParam.FloorId = this.buildFloorSelectd[1]
|
|
|
+ this.zoneParam.buildingId = this.buildFloorSelectd[0];
|
|
|
+ this.zoneParam.floorId = this.buildFloorSelectd[1]
|
|
|
|
|
|
}
|
|
|
}
|
|
|
if (this.zoneItemID) {
|
|
|
- this.zoneParam.Filters = `RoomID="${this.zoneItemID}"`
|
|
|
+ this.zoneParam.Filters = `id="${this.zoneItemID}"`
|
|
|
}
|
|
|
- if (this.zoneCode != 'OtherZone') {
|
|
|
- this.isLoading = true
|
|
|
- this.getZoneMessage(this.zoneParam)
|
|
|
- } else {
|
|
|
+ this.isLoading = true
|
|
|
+ this.getZoneMessage(this.zoneParam)
|
|
|
+ /**
|
|
|
+ * TODO: 其他分区下已不再划分分区(注释的代码是其他分区下再划分分区的代码)
|
|
|
+ */
|
|
|
+ // if (this.zoneCode != 'OtherZone') {
|
|
|
+ // this.isLoading = true
|
|
|
+ // this.getZoneMessage(this.zoneParam)
|
|
|
+ // } else {
|
|
|
// 其他分区类型查询表数据接口
|
|
|
// if (localStorage.getItem('otherZone')) {
|
|
|
// // this.OtherValue = (localStorage.getItem('otherZone'))
|
|
|
// localStorage.removeItem('otherZone')
|
|
|
// }
|
|
|
- if (this.OtherValue) {
|
|
|
- this.zoneParam.ZoneType = this.OtherValue;
|
|
|
- this.getZoneMessage(this.zoneParam)
|
|
|
- } else {
|
|
|
- this.main = []
|
|
|
- }
|
|
|
- this.isLoading = false
|
|
|
- this.getOtherType();
|
|
|
- }
|
|
|
+ // if (this.OtherValue) {
|
|
|
+ // this.zoneParam.ZoneType = this.OtherValue;
|
|
|
+ // this.getZoneMessage(this.zoneParam)
|
|
|
+ // } else {
|
|
|
+ // this.main = []
|
|
|
+ // }
|
|
|
+ // this.isLoading = false
|
|
|
+ // this.getOtherType();
|
|
|
+ // }
|
|
|
},
|
|
|
//查询空间信息
|
|
|
getZoneMessage(param) {
|
|
|
let params = param
|
|
|
- params.Orders = "createTime desc, RoomID asc, RoomLocalName desc, RoomLocalID desc"
|
|
|
+ params.orders = "createTime desc,localName desc,id desc"
|
|
|
zoneQuery(params, res => {
|
|
|
- this.page.total = res.Total;
|
|
|
- this.main = res.Content.map((item) => {
|
|
|
- if (item.hasOwnProperty("BuildingId") && item.hasOwnProperty("FloorId")) {
|
|
|
- item.flowBuild = item.BuildingId + "-" + item.FloorId
|
|
|
- } else if (item.hasOwnProperty("BuildingId") && !item.hasOwnProperty("FloorId")) {
|
|
|
- item.flowBuild = item.BuildingId
|
|
|
- }
|
|
|
- if (item.Outline) {
|
|
|
- item.Outline = JSON.stringify(item.Outline)
|
|
|
+ this.page.total = res.total;
|
|
|
+ this.main = res.content.map((item) => {
|
|
|
+ if (item.hasOwnProperty("buildingId") && item.hasOwnProperty("floorId")) {
|
|
|
+ item.flowBuild = item.buildingId + "-" + item.floorId
|
|
|
+ } else if (item.hasOwnProperty("buildingId") && !item.hasOwnProperty("floorId")) {
|
|
|
+ item.flowBuild = item.buildingId
|
|
|
}
|
|
|
+ // if (item.outline) {
|
|
|
+ // item.outline = JSON.stringify(item.outline)
|
|
|
+ // }
|
|
|
return item
|
|
|
});
|
|
|
|
|
|
- if (this.main && this.main.length && this.main[0].RoomID) {
|
|
|
+ if (this.main && this.main.length && this.main[0].id) {
|
|
|
this.copyMain = tools.deepCopy(this.main);
|
|
|
if (this.onlyRead) {
|
|
|
this.getBatch(this.main)
|
|
@@ -284,70 +302,6 @@
|
|
|
this.getMain()
|
|
|
})
|
|
|
},
|
|
|
- // getData() {
|
|
|
- // if (this.zoneCode != 'OtherZone') {
|
|
|
- // this.isLoading = true
|
|
|
- // let params = {
|
|
|
- // zone: this.zoneCode,
|
|
|
- // data: {
|
|
|
- // Filters: ``,
|
|
|
- // Orders: "createTime desc, RoomID asc",
|
|
|
- // PageNumber: this.page.pageNumber,
|
|
|
- // PageSize: this.page.pageSize
|
|
|
- // }
|
|
|
- // }
|
|
|
- // if (this.buildFloorSelectd[0] == "noKnow") {
|
|
|
- // params.data.Filters += `buildingId isNull`
|
|
|
- // } else if (this.buildFloorSelectd[0] && this.buildFloorSelectd[0] != "all") {
|
|
|
- // params.data.Filters += `buildingId='${this.buildFloorSelectd[0]}'`
|
|
|
- // }
|
|
|
- // if (this.buildFloorSelectd.length > 1) {
|
|
|
- // if (this.buildFloorSelectd[1] == "noKnow") {
|
|
|
- // params.data.Filters += `;floorId isNull`
|
|
|
- // } else if (this.buildFloorSelectd[1] && this.buildFloorSelectd[1] != "all") {
|
|
|
- // params.data.Filters += `;floorId='${this.buildFloorSelectd[1]}'`
|
|
|
- // }
|
|
|
- // }
|
|
|
- // if (this.zoneItemID) {
|
|
|
- // params.data.Filters += `;RoomID='${this.zoneItemID}'`
|
|
|
- // }
|
|
|
- // if (!params.data.Filters) {
|
|
|
- // delete params.data.Filters
|
|
|
- // }
|
|
|
- // // if (this.buildFloorSelectd.length && this.buildFloorSelectd[0] && this.buildFloorSelectd[1]) {
|
|
|
- // // params.data.Filters = `BuildingId='${this.buildFloorSelectd[0]}';FloorId='${this.buildFloorSelectd[1]}'`
|
|
|
- // // }
|
|
|
- // // else if (buildFloorSelectd.length && buildFloorSelectd[0] && !buildFloorSelectd[1]) {
|
|
|
- // // params.data.Filters = `BuildingId='${buildFloorSelectd[0]}'`
|
|
|
- // // } else {
|
|
|
- // // params.data.Filters = `BuildingId='';FloorId=''`
|
|
|
- // // }
|
|
|
- //
|
|
|
- // queryZone(params, res => {
|
|
|
- // this.page.total = res.Total
|
|
|
- // this.main = res.Content.map((item) => {
|
|
|
- // if (item.hasOwnProperty("BuildingId") && item.hasOwnProperty("FloorId")) {
|
|
|
- // item.flowBuild = item.BuildingId + "-" + item.FloorId
|
|
|
- // } else if (item.hasOwnProperty("BuildingId") && !item.hasOwnProperty("FloorId")) {
|
|
|
- // item.flowBuild = item.BuildingId
|
|
|
- // }
|
|
|
- // return item
|
|
|
- // });
|
|
|
- // if (this.main && this.main.length && this.main[0].RoomID) {
|
|
|
- // this.copyMain = tools.deepCopy(this.main);
|
|
|
- // if (this.onlyRead) {
|
|
|
- // this.getBatch(this.main)
|
|
|
- // }
|
|
|
- // }
|
|
|
- // this.isLoading = false
|
|
|
- // this.getMain()
|
|
|
- // })
|
|
|
- // } else {
|
|
|
- // // 其他分区类型查询表数据接口
|
|
|
- // this.isLoading = false
|
|
|
- // this.getOtherType();
|
|
|
- // }
|
|
|
- // },
|
|
|
//获取表格主体内容
|
|
|
getMain() {
|
|
|
if (!!this.hot) {
|
|
@@ -362,6 +316,10 @@
|
|
|
initHot() {
|
|
|
var container = document.getElementById(this.id);
|
|
|
let winHeight = document.documentElement.clientHeight;
|
|
|
+ if (this.hot) {
|
|
|
+ this.hot.destroy();
|
|
|
+ this.hot = null;
|
|
|
+ }
|
|
|
this.hot = new Handsontable(container, {
|
|
|
data: this.main,
|
|
|
colHeaders: this.delHeader(this.headers), //表头文案
|
|
@@ -377,6 +335,7 @@
|
|
|
observeChanges: false,
|
|
|
language: "zh-CN",
|
|
|
manualColumnResize: true,
|
|
|
+ fillHandle: 'vertical', //允许纵向填充
|
|
|
manualColumnMove: true,
|
|
|
dropdownMenu: [
|
|
|
"filter_by_condition",
|
|
@@ -431,10 +390,10 @@
|
|
|
let val = this.hot.colToProp(row.col);
|
|
|
this.row = row.row;
|
|
|
let inputData = this.inputMap[val];
|
|
|
- lStorage.set('screen_data', {path: this.$route.path, data: {RoomID: infos.RoomID, zone: this.zoneCode}})
|
|
|
+ lStorage.set('screen_data', {path: this.$route.path, data: {RoomID: infos.id, zone: this.zoneCode}})
|
|
|
if (val == "point") {
|
|
|
let query = {
|
|
|
- RoomID: infos.RoomID,
|
|
|
+ RoomID: infos.id,
|
|
|
zone: this.zoneCode,
|
|
|
isMyTab: 2,
|
|
|
buildFloorSelectd: this.buildFloorSelectd
|
|
@@ -450,19 +409,24 @@
|
|
|
} else {
|
|
|
this.$message("此空间没有二维码")
|
|
|
}
|
|
|
- } else if (val == "Pic") {
|
|
|
+ } else if (val == "pic") {
|
|
|
let Picdata = tools.dataForKey(this.main[row.row], val);
|
|
|
this.imgsArr = Picdata ? Picdata : [];
|
|
|
if (!this.onlyRead || this.imgsArr.length) {
|
|
|
this.myDialog.uploadImgs = true;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- if (!this.onlyRead && !inputData.Editable) {
|
|
|
- this.$message("该信息点的值为自动生成,不可人工维护!");
|
|
|
- return false;
|
|
|
+ if (!this.onlyRead && !inputData.editable) {
|
|
|
+ this.$confirm('该信息点的值为自动生成,不可人工维护!', '提示', {
|
|
|
+ confirmButtonText: '我知道了',
|
|
|
+ showCancelButton: false,
|
|
|
+ type: 'warning',
|
|
|
+ center: true
|
|
|
+ }).then(() => {
|
|
|
+ return false;
|
|
|
+ });
|
|
|
}
|
|
|
- if (!this.onlyRead && showTools.InputModeArr.indexOf(inputData.InputMode) == '-1') {
|
|
|
+ if (!this.onlyRead && showTools.inputModeArr.indexOf(inputData.dataType) == '-1') {
|
|
|
this.updateInfoPoint = val;
|
|
|
this.updateInput = tools.dataForKey(this.tableData[row.row], val);
|
|
|
this.myDialog.update = true;
|
|
@@ -471,17 +435,17 @@
|
|
|
},
|
|
|
//关闭临时维护弹窗回调
|
|
|
handleCloseUpdate() {
|
|
|
- this.updateInputShow = false
|
|
|
- this.updateInfoPoint = ''
|
|
|
- this.updateInput = ''
|
|
|
+ this.updateInputShow = false
|
|
|
+ this.updateInfoPoint = ''
|
|
|
+ this.updateInput = ''
|
|
|
},
|
|
|
//更新临时维护信息点
|
|
|
handleClickUpdate() {
|
|
|
- tools.setDataForKey(this.tableData[this.row], this.updateInfoPoint, this.updateInput)
|
|
|
- this.tdChange([[this.row, this.updateInfoPoint, null, this.updateInput]], "edit")
|
|
|
- this.updateInputShow = false
|
|
|
- this.myDialog.update = false
|
|
|
- this.updateInput = ''
|
|
|
+ tools.setDataForKey(this.tableData[this.row], this.updateInfoPoint, this.updateInput)
|
|
|
+ this.tdChange([[this.row, this.updateInfoPoint, null, this.updateInput]], "edit")
|
|
|
+ this.updateInputShow = false
|
|
|
+ this.myDialog.update = false
|
|
|
+ this.updateInput = ''
|
|
|
},
|
|
|
//表格发生更改
|
|
|
tdChange(changeData, source) {
|
|
@@ -491,7 +455,7 @@
|
|
|
let param = handsonUtils.getParam(changeData, source, this.hot, trimmedArr);
|
|
|
let data = []
|
|
|
for (let i = 0; i < param.length; i++) {
|
|
|
- if (param[i].RoomID) {
|
|
|
+ if (param[i].id) {
|
|
|
data.push(param[i])
|
|
|
} else {
|
|
|
this.handleCreateZone(param[i])
|
|
@@ -517,8 +481,8 @@
|
|
|
}
|
|
|
let param = []
|
|
|
params.map(item => {
|
|
|
- if (item.RoomID)
|
|
|
- param.push({ RoomID: item.RoomID })
|
|
|
+ if (item.id)
|
|
|
+ param.push({ id: item.id })
|
|
|
})
|
|
|
params.map(i => i.ObjectType = this.zoneParam.ZoneType ? this.zoneParam.ZoneType : i.ObjectType);
|
|
|
this.$confirm("此操作将删除业务空间,是否继续?", "提示", {
|
|
@@ -543,7 +507,7 @@
|
|
|
delete param[key]
|
|
|
}
|
|
|
})
|
|
|
- if (!param.RoomLocalName) {
|
|
|
+ if (!param.localName) {
|
|
|
this.$message("新增业务空间本地名称不能为空!")
|
|
|
return
|
|
|
}
|
|
@@ -552,37 +516,22 @@
|
|
|
return
|
|
|
}
|
|
|
if (param.flowBuild) {
|
|
|
-
|
|
|
- param.BuildingId = param.flowBuild.split('-')[0]
|
|
|
- param.FloorId = param.flowBuild.split('-')[1] || null
|
|
|
+ param.buildingId = param.flowBuild.split('-')[0]
|
|
|
+ param.floorId = param.flowBuild.split('-')[1] || null
|
|
|
} else {
|
|
|
if (this.buildFloorSelectd) {
|
|
|
if (this.buildFloorSelectd[0] != 'all' && this.buildFloorSelectd[0] != 'noKnow') {
|
|
|
- param.BuildingId = this.buildFloorSelectd[0]
|
|
|
+ param.buildingId = this.buildFloorSelectd[0]
|
|
|
}
|
|
|
if (this.buildFloorSelectd[1] && this.buildFloorSelectd[1] != 'all' && this.buildFloorSelectd[1] != 'noKnow') {
|
|
|
- param.FloorId = this.buildFloorSelectd[1]
|
|
|
+ param.floorId = this.buildFloorSelectd[1]
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- param.ObjectType = this.zoneParam.ZoneType ? this.zoneParam.ZoneType : this.zoneCode;
|
|
|
+ param.classCode = this.zoneParam.ZoneType ? this.zoneParam.ZoneType : this.zoneCode;
|
|
|
let params = {
|
|
|
- Content: [param]
|
|
|
+ content: [param]
|
|
|
};
|
|
|
-
|
|
|
- // let params = {
|
|
|
- // zone: this.zoneCode,
|
|
|
- // data: {
|
|
|
- // Content: [param]
|
|
|
- // }
|
|
|
- // }
|
|
|
- // createZone(params, res => {
|
|
|
- //
|
|
|
- // this.$message.success("添加成功!")
|
|
|
- // this.getData()
|
|
|
- // })
|
|
|
-
|
|
|
zoneCreate(params, res => {
|
|
|
this.$message.success("添加成功!")
|
|
|
this.getData()
|
|
@@ -592,8 +541,9 @@
|
|
|
updateBusiness(data, change) {
|
|
|
let param = {
|
|
|
data: {
|
|
|
- Content: [],
|
|
|
- Projection: []
|
|
|
+ content: [],
|
|
|
+ projection: [],
|
|
|
+ nullItems: []
|
|
|
},
|
|
|
zone: this.zoneCode
|
|
|
};
|
|
@@ -603,13 +553,18 @@
|
|
|
let key = item[1].split(".")[0]
|
|
|
if (key == "flowBuild" && keyList.indexOf(key) == -1) {
|
|
|
keyList.push("BuildingId", "FloorId")
|
|
|
- param.data.Projection.push("BuildingId", "FloorId")
|
|
|
+ param.data.projection.push("BuildingId", "FloorId")
|
|
|
}
|
|
|
if (item[1] && keyList.indexOf(key) == -1) {
|
|
|
keyList.push(key)
|
|
|
}
|
|
|
- if (item[1] && item[3] == "" && param.data.Projection.indexOf(key) == -1) {
|
|
|
- param.data.Projection.push(key)
|
|
|
+ if (item[1] && item[3] == "" && param.data.projection.indexOf(key) == -1) {
|
|
|
+ param.data.projection.push(key)
|
|
|
+ keyList.push(item[1])
|
|
|
+ }
|
|
|
+ // 保存置空字段
|
|
|
+ if (item[1] && item[3] == "" && param.data.nullItems.indexOf(item[1]) == -1) {
|
|
|
+ param.data.nullItems.push(item[1])
|
|
|
}
|
|
|
})
|
|
|
//生成对应修改数据
|
|
@@ -636,14 +591,14 @@
|
|
|
tools.setDataForKey(item, value, itemData == "" ? null : itemData)
|
|
|
}
|
|
|
})
|
|
|
- param.data.Content.push(item);
|
|
|
+ param.data.content.push(item);
|
|
|
})
|
|
|
- if (param.data.Projection.indexOf('BuildingId') > -1) {
|
|
|
- let pa = param.data.Content.map(t => {
|
|
|
+ if (param.data.projection.indexOf('BuildingId') > -1) {
|
|
|
+ let pa = param.data.content.map(t => {
|
|
|
return {
|
|
|
- Type: this.zoneCode,
|
|
|
- SpaceId: t.RoomID,
|
|
|
- Id: t.FloorId || t.BuildingId || null,
|
|
|
+ type: this.zoneCode,
|
|
|
+ spaceId: t.id,
|
|
|
+ id: t.FloorId || t.BuildingId || null,
|
|
|
}
|
|
|
})
|
|
|
handleZoneUpdateBd(pa, res => {
|
|
@@ -656,7 +611,7 @@
|
|
|
} else {
|
|
|
// updateZone(param, (res) => {
|
|
|
// })
|
|
|
- let obj = param.data.Content.map(i => {
|
|
|
+ let obj = param.data.content.map(i => {
|
|
|
i.Outline = typeof i.Outline == 'string' ? JSON.parse(i.Outline) : i.Outline
|
|
|
return {
|
|
|
...i,
|
|
@@ -664,8 +619,9 @@
|
|
|
}
|
|
|
})
|
|
|
let updateParam = {
|
|
|
- Content: obj,
|
|
|
- Projection: param.data.Projection
|
|
|
+ content: obj,
|
|
|
+ nullItems: param.data.nullItems
|
|
|
+ // projection: param.data.projection
|
|
|
};
|
|
|
zoneUpdate(updateParam, res => {
|
|
|
this.$message.success('更新成功')
|
|
@@ -709,51 +665,48 @@
|
|
|
//获取动态参数
|
|
|
getBatch(data) {
|
|
|
let param = {
|
|
|
- secret: this.secret,
|
|
|
- ProjId: this.projectId,
|
|
|
- data: {
|
|
|
- criterias: []
|
|
|
- }
|
|
|
+ groupCode: this.group_code,
|
|
|
+ appId: "datacenter",
|
|
|
+ projectId: this.projectId,
|
|
|
+ data: []
|
|
|
};
|
|
|
this.headers.map(head => {
|
|
|
- if (
|
|
|
- head.InputMode == "L" ||
|
|
|
- head.InputMode == "L1" ||
|
|
|
- head.InputMode == "L2" ||
|
|
|
- head.InputMode == "M"
|
|
|
- ) {
|
|
|
+ if (head.category != 'STATIC') {
|
|
|
data.map(item => {
|
|
|
- let cur = tools.dataForKey(item, head.Path);
|
|
|
+ let cur = tools.dataForKey(item, head.path);
|
|
|
if (cur) {
|
|
|
- param.data.criterias.push({
|
|
|
- id: item.RoomID,
|
|
|
- code: head.InfoPointCode
|
|
|
+ param.data.push({
|
|
|
+ objectId: item.id,
|
|
|
+ infoCode: head.code
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
- if (param.data.criterias.length) {
|
|
|
+ if (param.data.length) {
|
|
|
BeatchQueryParam(param, res => {
|
|
|
if (!this.onlyRead) {
|
|
|
return false
|
|
|
}
|
|
|
this.main = data.map(item => {
|
|
|
- res.Content.map(child => {
|
|
|
- if (item.RoomID == child.id) {
|
|
|
+ res.data.map(child => {
|
|
|
+ if (item.id == child.objectId) {
|
|
|
if (child.data || child.data == 0) {
|
|
|
this.headers.map(head => {
|
|
|
- if (head.InfoPointCode == child.code) {
|
|
|
- tools.setDataForKey(item, head.Path, child.data);
|
|
|
+ if (head.code == child.infoCode) {
|
|
|
+ let contentVal = child.data
|
|
|
+ if (this.codeToDataSource[child.infoCode]) {
|
|
|
+ contentVal = this.codeToDataSource[child.infoCode][child.data]
|
|
|
+ }
|
|
|
+ tools.setDataForKey(item, head.path, contentVal);
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
this.headers.map(head => {
|
|
|
- if (head.InfoPointCode == child.code) {
|
|
|
+ if (head.code == child.infoCode) {
|
|
|
tools.setDataForKey(
|
|
|
item,
|
|
|
- head.Path,
|
|
|
- // child.error ? "表号功能号格式错误" : "表号功能号不存在"
|
|
|
+ head.path,
|
|
|
child.error ? child.value ? "表号功能号格式错误" : "表号功能号不存在" : "暂未采集到实时数据"
|
|
|
);
|
|
|
}
|
|
@@ -792,7 +745,7 @@
|
|
|
let arr = tools.copyArr(list)
|
|
|
let data = showTools.headerTypeFilter(arr, "space", this.onlyRead, this.showType)
|
|
|
data.unshift({
|
|
|
- data: "Outline",
|
|
|
+ data: "outline",
|
|
|
renderer: this.myRenderer,
|
|
|
readOnly: true
|
|
|
}, {
|
|
@@ -830,15 +783,17 @@
|
|
|
/** 页面中的按钮事件--------------------------- */
|
|
|
addSp() {
|
|
|
this.myDialog.addSpace = true;
|
|
|
- if (this.zoneCode && this.zoneCode != 'OtherZone') {
|
|
|
+ // 其他分区 已删除在其他分区下添加子分区
|
|
|
+ // if (this.zoneCode && this.zoneCode != 'OtherZone') {
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.cascader.setValue([this.zoneCode])
|
|
|
})
|
|
|
- } else if (this.zoneCode == 'OtherZone' && this.OtherValue) {
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.cascader.setValue([this.zoneCode,this.OtherValue])
|
|
|
- })
|
|
|
- }
|
|
|
+ // } else if (this.zoneCode == 'OtherZone' && this.OtherValue) {
|
|
|
+ // this.$nextTick(() => {
|
|
|
+ // this.$refs.cascader.setValue([this.zoneCode, this.OtherValue])
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // 以下是直接在列表中添加的方法
|
|
|
// if (this.main && this.main.length && this.main[0].RoomID) {
|
|
|
// this.hot.destroy()
|
|
|
// this.hot = null
|
|
@@ -866,18 +821,18 @@
|
|
|
},
|
|
|
//选择业务空间类型-添加业务空间
|
|
|
changeAddType(val, item, value) {
|
|
|
- if (value.length == 2 && value[0] == "OtherZone") {
|
|
|
- this.addData.spaceType = val;
|
|
|
- this.addData.otherType = value[0]
|
|
|
- this.addData.spaceName = `其他分区-${item.Name}`;
|
|
|
- this.addData.showType = this.showType;
|
|
|
- this.addData.buildFloorSelectd = this.buildFloorSelectd;
|
|
|
- } else {
|
|
|
+ // if (value.length == 2 && value[0] == "OtherZone") {
|
|
|
+ // this.addData.spaceType = val;
|
|
|
+ // this.addData.otherType = value[0]
|
|
|
+ // this.addData.spaceName = `其他分区-${item.name}`;
|
|
|
+ // this.addData.showType = this.showType;
|
|
|
+ // this.addData.buildFloorSelectd = this.buildFloorSelectd;
|
|
|
+ // } else {
|
|
|
this.addData.spaceType = val;
|
|
|
- this.addData.spaceName = item.Name;
|
|
|
+ this.addData.spaceName = item.name;
|
|
|
this.addData.showType = this.showType;
|
|
|
this.addData.buildFloorSelectd = this.buildFloorSelectd;
|
|
|
- }
|
|
|
+ // }
|
|
|
},
|
|
|
//刷新
|
|
|
reset() {
|
|
@@ -901,7 +856,7 @@
|
|
|
},
|
|
|
//上传图片弹窗触发事件
|
|
|
imgChange(keys) {
|
|
|
- this.setDataToMain(keys, 'Pic', this.row);
|
|
|
+ this.setDataToMain(keys, 'pic', this.row);
|
|
|
},
|
|
|
//判断是否有值,有值赋值
|
|
|
setDataToMain(data, key, row) {
|
|
@@ -924,14 +879,14 @@
|
|
|
// 其他分区类型查询
|
|
|
getOtherType() {
|
|
|
let param = {
|
|
|
- Cascade: [{ Name: 'zoneType', Filters: `ProjectId='${this.projectId}'` }],
|
|
|
- Filters: `Code="OtherZone"`
|
|
|
+ cascade: [{ name: 'zoneType', filters: `projectId='${this.projectId}'` }],
|
|
|
+ filters: `code="otherZone"`
|
|
|
}
|
|
|
queryAllZoneType(param, res => {
|
|
|
- if (res.Content[0].ZoneType && res.Content[0].ZoneType.length) {
|
|
|
- this.OtherList = res.Content[0].ZoneType.map(t => {
|
|
|
- t.value = t.Code
|
|
|
- t.label = t.Name
|
|
|
+ if (res.content[0].zoneType && res.content[0].zoneType.length) {
|
|
|
+ this.OtherList = res.content[0].zoneType.map(t => {
|
|
|
+ t.value = t.code
|
|
|
+ t.label = t.name
|
|
|
return t
|
|
|
})
|
|
|
} else {
|
|
@@ -968,7 +923,7 @@
|
|
|
if (newName && newName[0] && newName[0].value) {
|
|
|
this.showType = newName[0].value
|
|
|
} else {
|
|
|
- this.showType = ""
|
|
|
+ this.showType = "Visible"
|
|
|
}
|
|
|
},
|
|
|
immediate: true,
|
|
@@ -980,6 +935,7 @@
|
|
|
<style lang="less" scoped>
|
|
|
#handsontable {
|
|
|
padding: 0 10px;
|
|
|
+
|
|
|
.left {
|
|
|
padding: 0;
|
|
|
margin-bottom: 10px;
|