|
@@ -1,45 +1,39 @@
|
|
|
<template>
|
|
|
- <el-dialog :title="title" :visible.sync="dialogVisible" :before-close="handleClose" width="900px" id="addEqDialog">
|
|
|
- <el-row class="filters" :gutter="20">
|
|
|
+ <el-dialog :title="title" :visible.sync="dialog" :before-close="handleClose" width="900px" id="addEqDialog">
|
|
|
+ <el-row class="filters">
|
|
|
<el-col :span="7" style="width:268px;padding:0px;">
|
|
|
- <el-input style="" placeholder="输入业务空间名称、本地编码进行查询" v-model="keycode" clearable @keyup.enter.native="getTableData">
|
|
|
+ <el-input style placeholder="输入业务空间名称、本地编码进行查询" v-model="keycode" clearable @keyup.enter.native="getTableData">
|
|
|
<i slot="suffix" class="el-input__icon el-icon-search" @click="getTableData"></i>
|
|
|
</el-input>
|
|
|
</el-col>
|
|
|
- <el-col :span="8.5" style="padding:0 0;margin-left:5px">
|
|
|
+ <el-col :span="8.5" style="padding:0 0;margin-left:-2px">
|
|
|
<floor-cascader ref="floorcas" @change="changeFloor"></floor-cascader>
|
|
|
</el-col>
|
|
|
<el-col :span="7.5" style="padding:0 0;">
|
|
|
<space-select ref="spacesel" @change="changeSpace"></space-select>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <el-row class="filters" :gutter="20">
|
|
|
-
|
|
|
- </el-row>
|
|
|
+ <el-row class="filters" :gutter="20"></el-row>
|
|
|
<div class="table-box">
|
|
|
<el-table :data="tableData" style="width: 100%" height="350" v-loading="loading" :header-cell-style="headerStyle" ref="multipleTable"
|
|
|
@selection-change="handleSelectionChange">
|
|
|
<el-table-column type="selection" width="55"></el-table-column>
|
|
|
<el-table-column :label="`${inSpaceType}本地名称`" show-overflow-tooltip min-width="100">
|
|
|
<template slot-scope="scope">
|
|
|
- <div>
|
|
|
- {{scope.row.RoomLocalName||scope.row.RoomName||''}}
|
|
|
- </div>
|
|
|
+ <div>{{scope.row.RoomLocalName||scope.row.RoomName||''}}</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="RoomLocalID" :label="`${inSpaceType}本地编码`" show-overflow-tooltip min-width="100"></el-table-column>
|
|
|
- <el-table-column prop="" :label="`所属建筑楼层`" show-overflow-tooltip min-width="100">
|
|
|
- <template slot-scope="scope">
|
|
|
+ <el-table-column prop :label="`所属建筑楼层`" show-overflow-tooltip min-width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
<div>
|
|
|
- {{(floorType[scope.row.BuildingId] || '') + (floorType[scope.row.FloorID] || '') || ''}}
|
|
|
+ {{ scope.row.BuildingId && floorType[scope.row.BuildingId]? ((floorType[scope.row.BuildingId] || '') + (scope.row.FloorId && floorType[scope.row.FloorId] ? (' - ' + floorType[scope.row.FloorId] || '') : '')) : ''}}
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="ObjectType" :label="`空间类型`" show-overflow-tooltip min-width="100">
|
|
|
<template slot-scope="scope">
|
|
|
- <div>
|
|
|
- {{spaceType[scope.row.ObjectType] || ''}}
|
|
|
- </div>
|
|
|
+ <div>{{spaceType[scope.row.ObjectType] || ''}}</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="action" label="操作" min-width="100">
|
|
@@ -61,10 +55,14 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { unSysZoneSpace, linkSySh, queryDictionaryHead } from "@/api/scan/request";
|
|
|
+import {
|
|
|
+ unSysZoneSpace,
|
|
|
+ linkSysSp,
|
|
|
+ queryDictionaryHead
|
|
|
+} from "@/api/scan/request";
|
|
|
import floorCascader from "@/components/ledger/lib/floorCascader";
|
|
|
-import dictionaryCas from '@/components/config_point/dictionaryCascader'
|
|
|
-import spaceSelect from '@/components/ledger/lib/spaceSelect'
|
|
|
+import dictionaryCas from "@/components/config_point/dictionaryCascader";
|
|
|
+import spaceSelect from "@/components/ledger/lib/spaceSelect";
|
|
|
import { mapGetters } from "vuex";
|
|
|
export default {
|
|
|
components: {
|
|
@@ -73,18 +71,21 @@ export default {
|
|
|
spaceSelect
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapGetters("layout", ["projectId"])
|
|
|
+ ...mapGetters("layout", ["projectId"]),
|
|
|
+ dialog() {
|
|
|
+ return this.dialogVisible;
|
|
|
+ }
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
title: "添加系统所在业务空间",
|
|
|
- keycode: '', //输入查询条件
|
|
|
- inSpaceType: '业务空间',
|
|
|
- Buildfloor: ['all'], // 选中的建筑楼层
|
|
|
- Spacecategory: null,// 选中的业务空间类型
|
|
|
+ keycode: "", //输入查询条件
|
|
|
+ inSpaceType: "业务空间",
|
|
|
+ Buildfloor: ["all"], // 选中的建筑楼层
|
|
|
+ Spacecategory: null, // 选中的业务空间类型
|
|
|
tableData: [],
|
|
|
- floorData: {},//楼层
|
|
|
- spaceData: {},//业务空间分区
|
|
|
+ floorData: {}, //楼层
|
|
|
+ spaceData: {}, //业务空间分区
|
|
|
loading: false,
|
|
|
selections: [], // 选中项
|
|
|
page: {
|
|
@@ -94,9 +95,9 @@ export default {
|
|
|
total: 0
|
|
|
},
|
|
|
headerStyle: {
|
|
|
- backgroundColor: '#e1e4e5',
|
|
|
- color: '#2b2b2b',
|
|
|
- lineHeight: '30px'
|
|
|
+ backgroundColor: "#e1e4e5",
|
|
|
+ color: "#2b2b2b",
|
|
|
+ lineHeight: "30px"
|
|
|
} // 列表样式
|
|
|
};
|
|
|
},
|
|
@@ -107,24 +108,21 @@ export default {
|
|
|
dialogVisible: Boolean,
|
|
|
floorType: Object
|
|
|
},
|
|
|
- mounted() {
|
|
|
-
|
|
|
- },
|
|
|
+ mounted() { },
|
|
|
methods: {
|
|
|
// 显示弹窗
|
|
|
showDialog() {
|
|
|
- this.dialogVisible = true
|
|
|
-
|
|
|
+ this.dialogVisible = true;
|
|
|
},
|
|
|
//修改建筑楼层
|
|
|
changeFloor(value) {
|
|
|
- this.Buildfloor = value
|
|
|
- this.getTableData()
|
|
|
+ this.Buildfloor = value;
|
|
|
+ this.getTableData();
|
|
|
},
|
|
|
//修改空间类型
|
|
|
changeSpace(value) {
|
|
|
- this.Spacecategory = value
|
|
|
- this.getTableData()
|
|
|
+ this.Spacecategory = value;
|
|
|
+ this.getTableData();
|
|
|
},
|
|
|
getTableData() {
|
|
|
let params = {
|
|
@@ -132,36 +130,35 @@ export default {
|
|
|
Filters: "not RoomID isNull",
|
|
|
Orders: "RoomLocalName desc",
|
|
|
PageNumber: this.page.pageNumber,
|
|
|
- PageSize: this.page.pageSize,
|
|
|
+ PageSize: this.page.pageSize
|
|
|
},
|
|
|
shaftId: this.params.ShaftID,
|
|
|
sysId: this.$route.query.SysID
|
|
|
- }
|
|
|
+ };
|
|
|
if (this.Buildfloor[0] == "noKnow") {
|
|
|
- params.data.Filters += `;buildingId isNull`
|
|
|
+ params.data.Filters += `;buildingId isNull`;
|
|
|
} else if (this.Buildfloor[0] && this.Buildfloor[0] != "all") {
|
|
|
- params.data.Filters += `;buildingId='${this.Buildfloor[0]}'`
|
|
|
+ params.data.Filters += `;buildingId='${this.Buildfloor[0]}'`;
|
|
|
}
|
|
|
if (this.Buildfloor[1] == "noKnow") {
|
|
|
- params.data.Filters += `;floorId isNull`
|
|
|
+ params.data.Filters += `;floorId isNull`;
|
|
|
} else if (this.Buildfloor[1] && this.Buildfloor[1] != "all") {
|
|
|
- params.data.Filters += `;floorId='${this.Buildfloor[1]}'`
|
|
|
+ params.data.Filters += `;floorId='${this.Buildfloor[1]}'`;
|
|
|
}
|
|
|
if (this.Spacecategory) {
|
|
|
- params.data.Filters += `;ObjectType='${this.Spacecategory}'`
|
|
|
+ params.data.Filters += `;ObjectType='${this.Spacecategory}'`;
|
|
|
}
|
|
|
- if (this.keycode != '') {
|
|
|
- params.data.Filters += `;RoomName contain '${this.keycode}' or RoomLocalName contain '${this.keycode}'`
|
|
|
+ if (this.keycode != "") {
|
|
|
+ params.data.Filters += `;RoomName contain '${this.keycode}' or RoomLocalName contain '${this.keycode}'`;
|
|
|
}
|
|
|
|
|
|
unSysZoneSpace(params, res => {
|
|
|
- console.log("hh ",this.floorType)
|
|
|
- this.tableData = res.Content
|
|
|
- this.page.total = res.Total
|
|
|
- })
|
|
|
+ this.tableData = res.Content;
|
|
|
+ this.page.total = res.Total;
|
|
|
+ });
|
|
|
},
|
|
|
handleClose() {
|
|
|
- this.$emit('update:dialogVisible', false)
|
|
|
+ this.$emit("update:dialogVisible", false);
|
|
|
},
|
|
|
//选中项修改
|
|
|
handleSelectionChange(val) {
|
|
@@ -170,18 +167,20 @@ export default {
|
|
|
savaRelation() {
|
|
|
if (this.selections.length) {
|
|
|
let params = {
|
|
|
- ShaftId: this.params.ShaftID,
|
|
|
- SysIdList: this.selections.map(item => {
|
|
|
- return item.SysID
|
|
|
+ Content: this.selections.map(item => {
|
|
|
+ return {
|
|
|
+ SpaceID: item.RoomID,
|
|
|
+ SysID: this.$route.query.SysID,
|
|
|
+ ObjectType: item.ObjectType
|
|
|
+ };
|
|
|
})
|
|
|
- }
|
|
|
- linkSySh(params, res => {
|
|
|
- this.dialogVisible = false
|
|
|
- this.$message.success('关联成功!')
|
|
|
- this.$emit('refresh')
|
|
|
- })
|
|
|
+ };
|
|
|
+ linkSysSp(params, res => {
|
|
|
+ this.$message.success("关联成功!");
|
|
|
+ this.$emit("refresh");
|
|
|
+ });
|
|
|
} else {
|
|
|
- this.$message('请选择要关联的设备')
|
|
|
+ this.$message("请选择要关联的设备");
|
|
|
}
|
|
|
},
|
|
|
//改变pagesize
|
|
@@ -196,16 +195,16 @@ export default {
|
|
|
},
|
|
|
// 查看详情
|
|
|
toDetail() {
|
|
|
- this.$message('开发中')
|
|
|
+ this.$message("开发中");
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
dialogVisible: {
|
|
|
handler() {
|
|
|
if (this.dialogVisible) {
|
|
|
- this.page.pageNumber = 1
|
|
|
- this.tableData = []
|
|
|
- this.getTableData()
|
|
|
+ this.page.pageNumber = 1;
|
|
|
+ this.tableData = [];
|
|
|
+ this.getTableData();
|
|
|
}
|
|
|
},
|
|
|
immediate: true
|
|
@@ -216,7 +215,7 @@ export default {
|
|
|
<style lang="less" scoped>
|
|
|
#addEqDialog {
|
|
|
.filters {
|
|
|
- margin-bottom: 10px;
|
|
|
+ margin: 0 0 10px 0;
|
|
|
}
|
|
|
.table-box {
|
|
|
height: 370px;
|