|
@@ -1,6 +1,15 @@
|
|
|
<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'">-->
|
|
|
+ <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;">
|
|
|
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
|
|
</el-select>
|
|
@@ -10,6 +19,9 @@
|
|
|
<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;">
|
|
|
+ <i slot="suffix" class="el-input__icon el-icon-search" @click="getData"></i>
|
|
|
+ </el-input>
|
|
|
</el-row>
|
|
|
<div v-show="main &&main.length" :id="id"></div>
|
|
|
<div class="center" v-show="!main || !main.length" style="height: 400px;padding-top:140px;box-sizing:border-box;">
|
|
@@ -26,40 +38,84 @@
|
|
|
</div> -->
|
|
|
<!-- 二维码弹窗 -->
|
|
|
<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" />
|
|
|
+ <!-- 不支持的输入方式 -->
|
|
|
+ <el-dialog title="临时维护信息点" :visible.sync="myDialog.update" @close="handleCloseUpdate" width="670px">
|
|
|
+ <el-row>
|
|
|
+ 该信息点未定义对应组件,现在维护数据不确定后续是否可用。如确实需要维护,请点击
|
|
|
+ <el-link @click="updateInputShow = true" type="primary" :underline="false">继续维护</el-link>
|
|
|
+ 。
|
|
|
+ </el-row>
|
|
|
+ <el-row style="margin-top:20px;" v-show="updateInputShow">
|
|
|
+ <el-input type="textarea" :autosize="{ minRows: 4, maxRows: 8}" placeholder="请输入内容"
|
|
|
+ v-model="updateInput"></el-input>
|
|
|
+ </el-row>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="myDialog.update = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="handleClickUpdate">确 认</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ <!-- 新增业务空间 -->
|
|
|
+ <el-dialog title="确定新增业务空间的分区类型" :visible.sync="myDialog.addSpace" width="670px">
|
|
|
+ <el-row>
|
|
|
+ <space-cascader ref="cascader" @change="changeAddType"></space-cascader>
|
|
|
+ </el-row>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="toAddSpace">下 一 步</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-// 引用handsontable插件
|
|
|
-import "@/assets/js/chosen.jquery.min";
|
|
|
-import tools from "@/utils/scan/tools";
|
|
|
-import "@/assets/js/handsontable-chosen-editor";
|
|
|
-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 'handsontable-pro/dist/handsontable.full.css'
|
|
|
-import zhCN from 'handsontable-pro/languages/zh-CN';
|
|
|
-import qrcode from "@/components/ledger/lib/qrcode";
|
|
|
-import { queryZone, updateZone, deleteZone, createZone, BeatchQueryParam, updateRelateInSpAndBuild } from "@/api/scan/request";
|
|
|
-import { mapGetters, mapActions } from "vuex";
|
|
|
-export default {
|
|
|
- props: {
|
|
|
- id: {},
|
|
|
- zoneCode: {}
|
|
|
- },
|
|
|
- components: {
|
|
|
- qrcode, //二维码页面
|
|
|
- myPagination,
|
|
|
- addBusiness
|
|
|
+ // 引用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";
|
|
|
+
|
|
|
+ export default {
|
|
|
+ props: {
|
|
|
+ id: {},
|
|
|
+ zoneCode: {},
|
|
|
+ otherType: String
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ qrcode, //二维码页面
|
|
|
+ myPagination,
|
|
|
+ addBusiness,
|
|
|
+ uploadImgDialog,
|
|
|
+ dialogZone,
|
|
|
+ spaceCascader,
|
|
|
},
|
|
|
computed: {
|
|
|
...mapGetters("layout", ["projectId", "secret", "userId"]),
|
|
|
showTypes() {
|
|
|
return this.onlyRead ?
|
|
|
[{ value: "Visible", label: '只看采集信息' }, { value: "all", label: '全部' }] :
|
|
|
- [{ value: "partInfo", label: '隐藏信息点' }, { value: "all", label: '全部' }]
|
|
|
+ [{ value: "Visible", label: '只看采集信息' }, { value: "all", label: '全部' }]
|
|
|
}
|
|
|
},
|
|
|
data() {
|
|
@@ -97,13 +153,36 @@ export default {
|
|
|
filtersArr: [], //表格数据被过滤后的下标
|
|
|
copyMain: [], //深拷贝数组
|
|
|
buildFloorData: [], //楼层数据
|
|
|
+ zoneItemID: '',
|
|
|
+ inputMap: {
|
|
|
+ flowBuild: {
|
|
|
+ InputMode: 'D1',
|
|
|
+ Editable:true,
|
|
|
+ InfoPointCode:"flowBuild",
|
|
|
+ InfoPointName:"建筑楼层",
|
|
|
+ Path:"flowBuild"
|
|
|
+ }
|
|
|
+ }, //信息点和输入方式映射表
|
|
|
+ updateInputShow: false, //是否显示临时维护输入框
|
|
|
+ updateInfoPoint: '',//临时维护信息点
|
|
|
+ updateInput: '', //临时维护信息点值
|
|
|
+ myDialog: {
|
|
|
+ uploadImgs: false, //上传图片弹窗
|
|
|
+ update: false,//临时维护信息点
|
|
|
+ addSpace: false, //批量添加业务空间
|
|
|
+ },
|
|
|
+ imgsArr: [], //空间图片
|
|
|
+ OtherList: [],//其他分区筛选框
|
|
|
+ OtherValue: '',
|
|
|
+ addData: {},
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
this.setData()
|
|
|
buildFloor.getData(this.buildFloorData)
|
|
|
},
|
|
|
- mounted() { },
|
|
|
+ mounted() {
|
|
|
+ },
|
|
|
methods: {
|
|
|
setData() {
|
|
|
this.param.ProjId = this.projectId
|
|
@@ -113,63 +192,162 @@ export default {
|
|
|
//获取表格数据
|
|
|
getHeader(headers, buildFloorSelectd) {
|
|
|
this.headers = headers
|
|
|
+ this.headers.forEach(item => {
|
|
|
+ if (item.Path) {
|
|
|
+ this.inputMap[item.Path] = item
|
|
|
+ }
|
|
|
+ })
|
|
|
this.buildFloorSelectd = buildFloorSelectd
|
|
|
+ this.page.pageNumber = 1
|
|
|
this.getData()
|
|
|
},
|
|
|
+
|
|
|
getData() {
|
|
|
- this.isLoading = true
|
|
|
- let params = {
|
|
|
- zone: this.zoneCode,
|
|
|
- data: {
|
|
|
- Filters: ``,
|
|
|
- Orders: "createTime desc, RoomID asc",
|
|
|
- PageNumber: this.page.pageNumber,
|
|
|
- PageSize: this.page.pageSize
|
|
|
+ this.zoneParam = {
|
|
|
+ ZoneType: this.zoneCode,
|
|
|
+ PageNumber: this.page.pageNumber,
|
|
|
+ PageSize: this.page.pageSize,
|
|
|
+ Orders: "createTime desc, RoomLocalName desc, RoomLocalID desc, RoomID asc"
|
|
|
+ }
|
|
|
+ if (this.buildFloorSelectd.length === 1) {
|
|
|
+ switch (this.buildFloorSelectd[0]) {
|
|
|
+ case 'noKnow':
|
|
|
+ this.zoneParam.BuildingId = 'isnull';
|
|
|
+ break;
|
|
|
+ case 'all':
|
|
|
+ // params.BuildingId = '';
|
|
|
+ break
|
|
|
+ }
|
|
|
+ } else if (this.buildFloorSelectd.length === 2) {
|
|
|
+ switch (this.buildFloorSelectd[1]) {
|
|
|
+ case 'noKnow':
|
|
|
+ this.zoneParam.BuildingId = this.buildFloorSelectd[0];
|
|
|
+ this.zoneParam.FloorId = 'isnull';
|
|
|
+ break;
|
|
|
+ case 'all':
|
|
|
+ this.zoneParam.BuildingId = this.buildFloorSelectd[0];
|
|
|
+ // params.FloorId = '';
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ this.zoneParam.BuildingId = this.buildFloorSelectd[0];
|
|
|
+ this.zoneParam.FloorId = this.buildFloorSelectd[1]
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
- 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.zoneItemID) {
|
|
|
+ this.zoneParam.Filters = `RoomID="${this.zoneItemID}"`
|
|
|
}
|
|
|
- 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.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 (!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
|
|
|
+ },
|
|
|
+ //查询空间信息
|
|
|
+ getZoneMessage(param) {
|
|
|
+ let params = param
|
|
|
+ params.Orders = "createTime desc, RoomID asc, RoomLocalName desc, RoomLocalID 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)
|
|
|
+ }
|
|
|
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.isLoading = false;
|
|
|
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) {
|
|
@@ -190,7 +368,7 @@ export default {
|
|
|
columns: this.getType(this.headers), //数据显示格式
|
|
|
filters: true,
|
|
|
fixedColumnsLeft: 4,
|
|
|
- maxRows: this.main.length,
|
|
|
+ maxRows: this.main ? this.main.length : '',
|
|
|
height: winHeight - 100 - 50 - 176,
|
|
|
columnSorting: true, //添加排序
|
|
|
sortIndicator: true, //添加排序
|
|
@@ -205,7 +383,7 @@ export default {
|
|
|
"filter_by_value",
|
|
|
"filter_action_bar"
|
|
|
],
|
|
|
- contextMenu: {
|
|
|
+ contextMenu: this.onlyRead ? false : {
|
|
|
items: {
|
|
|
remove_row: {
|
|
|
name: "删除该业务空间"
|
|
@@ -230,7 +408,7 @@ export default {
|
|
|
let trimmedArr = this.trimmedRows();
|
|
|
//是否启用了排序
|
|
|
let isSort = this.hot.getPlugin("columnSorting").isSorted();
|
|
|
- // debugger
|
|
|
+ //
|
|
|
if (trimmedArr.length && isSort) {
|
|
|
let sortArr = this.myHotArr.getPlugin("columnSorting").rowsMapper
|
|
|
.__arrayMap;
|
|
@@ -251,22 +429,60 @@ export default {
|
|
|
},
|
|
|
getInfors(infos, row) {
|
|
|
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}})
|
|
|
if (val == "point") {
|
|
|
+ let query = {
|
|
|
+ RoomID: infos.RoomID,
|
|
|
+ zone: this.zoneCode,
|
|
|
+ isMyTab: 2,
|
|
|
+ buildFloorSelectd: this.buildFloorSelectd
|
|
|
+ }
|
|
|
this.$router.push({
|
|
|
path: "/ledger/spaceDetail",
|
|
|
- query: { RoomID: infos.RoomID, zone: this.zoneCode, isMyTab: 2 }
|
|
|
+ query: query
|
|
|
})
|
|
|
} else if (val == "RoomQRCode") {
|
|
|
this.qrcodeUrl = this.main[row.row].RoomQRCode
|
|
|
if (!!this.qrcodeUrl) {
|
|
|
this.dialog.qrcode = true;
|
|
|
} else {
|
|
|
- this.$message("此设备没有设备二维码")
|
|
|
+ this.$message("此空间没有二维码")
|
|
|
}
|
|
|
- } else {
|
|
|
+ } 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 && showTools.InputModeArr.indexOf(inputData.InputMode) == '-1') {
|
|
|
+ this.updateInfoPoint = val;
|
|
|
+ this.updateInput = tools.dataForKey(this.tableData[row.row], val);
|
|
|
+ this.myDialog.update = true;
|
|
|
return false;
|
|
|
}
|
|
|
},
|
|
|
+ //关闭临时维护弹窗回调
|
|
|
+ handleCloseUpdate() {
|
|
|
+ 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 = ''
|
|
|
+ },
|
|
|
//表格发生更改
|
|
|
tdChange(changeData, source) {
|
|
|
if (!this.onlyRead) {
|
|
@@ -299,20 +515,18 @@ export default {
|
|
|
if (params.length < 1 || this.main > this.copyMain) {
|
|
|
return
|
|
|
}
|
|
|
- let param = {
|
|
|
- data: [],
|
|
|
- zone: this.zoneCode
|
|
|
- }
|
|
|
+ let param = []
|
|
|
params.map(item => {
|
|
|
if (item.RoomID)
|
|
|
- param.data.push({ RoomID: item.RoomID })
|
|
|
+ param.push({ RoomID: item.RoomID })
|
|
|
})
|
|
|
+ params.map(i => i.ObjectType = this.zoneParam.ZoneType ? this.zoneParam.ZoneType : i.ObjectType);
|
|
|
this.$confirm("此操作将删除业务空间,是否继续?", "提示", {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
- deleteZone(param, res => {
|
|
|
+ zoneDelete(param, res => {
|
|
|
this.$message.success("删除成功!")
|
|
|
this.getData()
|
|
|
})
|
|
@@ -337,20 +551,39 @@ export default {
|
|
|
this.$message("新添加业务空间内容不能为空!")
|
|
|
return
|
|
|
}
|
|
|
- if (this.buildFloorSelectd && this.buildFloorSelectd[0] && this.buildFloorSelectd[1]) {
|
|
|
- param.BuildingId = this.buildFloorSelectd[0]
|
|
|
- param.FloorId = this.buildFloorSelectd[1]
|
|
|
- }
|
|
|
- // else if (this.buildMess.selectd && this.buildMess.selectd[0] && !this.buildMess.selectd[1]) {
|
|
|
- // param.BuildingId = this.buildMess.selectd[0]
|
|
|
- // }
|
|
|
- let params = {
|
|
|
- zone: this.zoneCode,
|
|
|
- data: {
|
|
|
- Content: [param]
|
|
|
+ if (param.flowBuild) {
|
|
|
+
|
|
|
+ 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]
|
|
|
+ }
|
|
|
+ if (this.buildFloorSelectd[1] && this.buildFloorSelectd[1] != 'all' && this.buildFloorSelectd[1] != 'noKnow') {
|
|
|
+ param.FloorId = this.buildFloorSelectd[1]
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- createZone(params, res => {
|
|
|
+
|
|
|
+ param.ObjectType = this.zoneParam.ZoneType ? this.zoneParam.ZoneType : this.zoneCode;
|
|
|
+ let params = {
|
|
|
+ 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()
|
|
|
})
|
|
@@ -408,17 +641,35 @@ export default {
|
|
|
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.RoomID,
|
|
|
+ Id: t.FloorId || t.BuildingId || null,
|
|
|
}
|
|
|
})
|
|
|
- updateRelateInSpAndBuild(pa, res => {
|
|
|
+ handleZoneUpdateBd(pa, res => {
|
|
|
this.$message.success('修改成功')
|
|
|
})
|
|
|
+ // Orders: "createTime desc, EquipLocalName desc, EquipLocalID desc, EquipID desc"
|
|
|
+ // updateRelateInSpAndBuild(pa, res => {
|
|
|
+ // this.$message.success('修改成功')
|
|
|
+ // })
|
|
|
} else {
|
|
|
- param.data.Projection = []
|
|
|
- updateZone(param, (res) => { })
|
|
|
+ // updateZone(param, (res) => {
|
|
|
+ // })
|
|
|
+ let obj = param.data.Content.map(i => {
|
|
|
+ i.Outline = typeof i.Outline == 'string' ? JSON.parse(i.Outline) : i.Outline
|
|
|
+ return {
|
|
|
+ ...i,
|
|
|
+ ObjectType: this.zoneParam.ZoneType || i.ObjectType
|
|
|
+ }
|
|
|
+ })
|
|
|
+ let updateParam = {
|
|
|
+ Content: obj,
|
|
|
+ Projection: param.data.Projection
|
|
|
+ };
|
|
|
+ zoneUpdate(updateParam, res => {
|
|
|
+ this.$message.success('更新成功')
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
//获取被筛选掉的行号
|
|
@@ -578,18 +829,54 @@ export default {
|
|
|
},
|
|
|
/** 页面中的按钮事件--------------------------- */
|
|
|
addSp() {
|
|
|
- if (this.main && this.main.length && this.main[0].RoomID) {
|
|
|
- this.hot.destroy()
|
|
|
- this.hot = null
|
|
|
- this.main.unshift({})
|
|
|
- this.getMain()
|
|
|
+ this.myDialog.addSpace = true;
|
|
|
+ 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])
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // if (this.main && this.main.length && this.main[0].RoomID) {
|
|
|
+ // this.hot.destroy()
|
|
|
+ // this.hot = null
|
|
|
+ // this.main.unshift({})
|
|
|
+ // this.getMain()
|
|
|
+ // } else {
|
|
|
+ // if (this.main && this.main.length) {
|
|
|
+ // this.$message("请添加完成后继续添加")
|
|
|
+ // } else {
|
|
|
+ // this.main.unshift({})
|
|
|
+ // this.getMain()
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ },
|
|
|
+ //下一步
|
|
|
+ toAddSpace() {
|
|
|
+ if (this.addData.spaceType) {
|
|
|
+ this.$router.push({
|
|
|
+ path: "/ledger/spaceadd",
|
|
|
+ query: this.addData
|
|
|
+ });
|
|
|
} else {
|
|
|
- if (this.main && this.main.length) {
|
|
|
- this.$message("请添加完成后继续添加")
|
|
|
- } else {
|
|
|
- this.main.unshift({})
|
|
|
- this.getMain()
|
|
|
- }
|
|
|
+ this.$message("请选择要添加的业务空间类型!")
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //选择业务空间类型-添加业务空间
|
|
|
+ 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 {
|
|
|
+ this.addData.spaceType = val;
|
|
|
+ this.addData.spaceName = item.Name;
|
|
|
+ this.addData.showType = this.showType;
|
|
|
+ this.addData.buildFloorSelectd = this.buildFloorSelectd;
|
|
|
}
|
|
|
},
|
|
|
//刷新
|
|
@@ -604,16 +891,75 @@ export default {
|
|
|
//切换每页显示多少条数据
|
|
|
handleSizeChange(val) {
|
|
|
this.page.pageSize = val
|
|
|
+ this.page.pageNumber = 1
|
|
|
this.getData()
|
|
|
},
|
|
|
//切换页数
|
|
|
handleCurrentChange(val) {
|
|
|
this.page.pageNumber = val
|
|
|
this.getData()
|
|
|
- }
|
|
|
+ },
|
|
|
+ //上传图片弹窗触发事件
|
|
|
+ imgChange(keys) {
|
|
|
+ this.setDataToMain(keys, 'Pic', this.row);
|
|
|
+ },
|
|
|
+ //判断是否有值,有值赋值
|
|
|
+ setDataToMain(data, key, row) {
|
|
|
+ if (!!data && data != '--') {
|
|
|
+ if (!!this.main[row]) {
|
|
|
+ tools.setDataForKey(this.main[row], key, data);
|
|
|
+ this.tdChange([[row, key, null, data]], "edit");
|
|
|
+ } else {
|
|
|
+ this.main[row] = {};
|
|
|
+ tools.setDataForKey(this.main[row], key, data);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ tools.setDataForKey(this.main[row], key, "");
|
|
|
+ }
|
|
|
+ this.hot.render()
|
|
|
+ },
|
|
|
+ addZoneBtn() {
|
|
|
+ this.$refs.zone.dialogFormVisible = true
|
|
|
+ },
|
|
|
+ // 其他分区类型查询
|
|
|
+ getOtherType() {
|
|
|
+ let param = {
|
|
|
+ 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
|
|
|
+ return t
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.OtherList = []
|
|
|
+ }
|
|
|
+ if (this.otherType) {
|
|
|
+ this.OtherValue = this.otherType
|
|
|
+ this.changeOtherZone(this.otherType)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 其他类型下拉change
|
|
|
+ changeOtherZone(val) {
|
|
|
+ this.zoneParam.ZoneType = val;
|
|
|
+ this.getZoneMessage(this.zoneParam);
|
|
|
+ // if (localStorage.getItem('otherZone')) {
|
|
|
+ // localStorage.setItem('otherZone', val)
|
|
|
+ // } else {
|
|
|
+ // localStorage.setItem('otherZone', val)
|
|
|
+ // }
|
|
|
+ console.log(val)
|
|
|
+ },
|
|
|
},
|
|
|
+
|
|
|
watch: {
|
|
|
projectId() {
|
|
|
+ this.buildFloorData = []
|
|
|
+ buildFloor.getData(this.buildFloorData)
|
|
|
this.setData()
|
|
|
this.main = null
|
|
|
},
|
|
@@ -633,10 +979,12 @@ export default {
|
|
|
</script>
|
|
|
<style lang="less" scoped>
|
|
|
#handsontable {
|
|
|
+ padding: 0 10px;
|
|
|
.left {
|
|
|
- padding-top: 0;
|
|
|
- padding-bottom: 10px;
|
|
|
+ padding: 0;
|
|
|
+ margin-bottom: 10px;
|
|
|
}
|
|
|
+
|
|
|
.no-data {
|
|
|
height: 150px;
|
|
|
line-height: 150px;
|
|
@@ -644,4 +992,4 @@ export default {
|
|
|
color: gray;
|
|
|
}
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|