|
@@ -1,36 +1,63 @@
|
|
<template>
|
|
<template>
|
|
- <el-dialog :title="title" :visible.sync="dialogVisible" width="900px" id="addEqDialog">
|
|
|
|
|
|
+ <el-dialog
|
|
|
|
+ :title="title"
|
|
|
|
+ :visible.sync="dialogVisible"
|
|
|
|
+ :before-close="handleClose"
|
|
|
|
+ width="900px"
|
|
|
|
+ id="addEqDialog"
|
|
|
|
+ >
|
|
<el-row class="filters" :gutter="20">
|
|
<el-row class="filters" :gutter="20">
|
|
- <el-col :span="8">
|
|
|
|
- <el-input placeholder="输入业务空间名称、本地编码进行查询" v-model="keycode" clearable @keyup.enter.native="getTableData">
|
|
|
|
|
|
+ <el-col :span="7" style="width:268px;padding:0px;">
|
|
|
|
+ <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>
|
|
<i slot="suffix" class="el-input__icon el-icon-search" @click="getTableData"></i>
|
|
</el-input>
|
|
</el-input>
|
|
</el-col>
|
|
</el-col>
|
|
- <el-col :span="8.5" style="padding:0 0;">
|
|
|
|
- <floor-cascader @change="changeFloor"></floor-cascader>
|
|
|
|
|
|
+ <el-col :span="8.5" style="padding:0 0;margin-left:5px">
|
|
|
|
+ <floor-cascader ref="floorcas" @change="changeFloor"></floor-cascader>
|
|
</el-col>
|
|
</el-col>
|
|
- <el-col :span="8.5" style="padding:0 0;">
|
|
|
|
- <space-select @change="changeSpace"></space-select>
|
|
|
|
|
|
+ <el-col :span="7.5" style="padding:0 0;">
|
|
|
|
+ <space-select ref="spacesel" @change="changeSpace"></space-select>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
- <el-row class="filters" :gutter="20">
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- </el-row>
|
|
|
|
|
|
+ <el-row class="filters" :gutter="20"></el-row>
|
|
<div class="table-box">
|
|
<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
|
|
|
|
+ :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">
|
|
<el-table-column :label="`${inSpaceType}本地名称`" show-overflow-tooltip min-width="100">
|
|
<template slot-scope="scope">
|
|
<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">
|
|
|
|
+ <div>{{(floorType[scope.row.BuildingId] || '') + (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>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</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"></el-table-column>
|
|
|
|
- <el-table-column prop="" :label="`空间类型`" show-overflow-tooltip min-width="100"></el-table-column>
|
|
|
|
<el-table-column prop="action" label="操作" min-width="100">
|
|
<el-table-column prop="action" label="操作" min-width="100">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-button size="mini" @click="toDetail(scope.$index, scope.row)" plain>查看详情</el-button>
|
|
<el-button size="mini" @click="toDetail(scope.$index, scope.row)" plain>查看详情</el-button>
|
|
@@ -38,22 +65,34 @@
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
<!-- 分页 -->
|
|
<!-- 分页 -->
|
|
- <el-pagination class="fr" v-show="tableData && tableData.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>
|
|
|
|
|
|
+ <el-pagination
|
|
|
|
+ class="fr"
|
|
|
|
+ v-show="tableData && tableData.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>
|
|
</div>
|
|
<span slot="footer" class="dialog-footer">
|
|
<span slot="footer" class="dialog-footer">
|
|
- <el-button size="small" @click="dialogVisible = false">取 消</el-button>
|
|
|
|
|
|
+ <el-button size="small" @click="handleClose">取 消</el-button>
|
|
<el-button size="small" type="primary" @click="savaRelation">确 定</el-button>
|
|
<el-button size="small" type="primary" @click="savaRelation">确 定</el-button>
|
|
</span>
|
|
</span>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { unSysZoneSpace, linkSySh } from "@/api/scan/request";
|
|
|
|
|
|
+import {
|
|
|
|
+ unSysZoneSpace,
|
|
|
|
+ linkSysSp,
|
|
|
|
+ queryDictionaryHead
|
|
|
|
+} from "@/api/scan/request";
|
|
import floorCascader from "@/components/ledger/lib/floorCascader";
|
|
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";
|
|
import { mapGetters } from "vuex";
|
|
export default {
|
|
export default {
|
|
components: {
|
|
components: {
|
|
@@ -67,12 +106,13 @@ export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
title: "添加系统所在业务空间",
|
|
title: "添加系统所在业务空间",
|
|
- keycode: '', //输入查询条件
|
|
|
|
- inSpaceType: '业务空间',
|
|
|
|
- dialogVisible: false,
|
|
|
|
- Buildfloor: ['all'], // 选中的建筑楼层
|
|
|
|
- Spacecategory: null,// 选中的业务空间类型
|
|
|
|
|
|
+ keycode: "", //输入查询条件
|
|
|
|
+ inSpaceType: "业务空间",
|
|
|
|
+ Buildfloor: ["all"], // 选中的建筑楼层
|
|
|
|
+ Spacecategory: null, // 选中的业务空间类型
|
|
tableData: [],
|
|
tableData: [],
|
|
|
|
+ floorData: {}, //楼层
|
|
|
|
+ spaceData: {}, //业务空间分区
|
|
loading: false,
|
|
loading: false,
|
|
selections: [], // 选中项
|
|
selections: [], // 选中项
|
|
page: {
|
|
page: {
|
|
@@ -82,86 +122,94 @@ export default {
|
|
total: 0
|
|
total: 0
|
|
},
|
|
},
|
|
headerStyle: {
|
|
headerStyle: {
|
|
- backgroundColor: '#e1e4e5',
|
|
|
|
- color: '#2b2b2b',
|
|
|
|
- lineHeight: '30px'
|
|
|
|
|
|
+ backgroundColor: "#e1e4e5",
|
|
|
|
+ color: "#2b2b2b",
|
|
|
|
+ lineHeight: "30px"
|
|
} // 列表样式
|
|
} // 列表样式
|
|
};
|
|
};
|
|
},
|
|
},
|
|
props: {
|
|
props: {
|
|
type: String, //选中的tab页
|
|
type: String, //选中的tab页
|
|
- params: Object //查看的竖井关系信息
|
|
|
|
|
|
+ params: Object, //查看的竖井关系信息
|
|
|
|
+ spaceType: Object,
|
|
|
|
+ dialogVisible: Boolean,
|
|
|
|
+ floorType: Object
|
|
},
|
|
},
|
|
- created() { },
|
|
|
|
|
|
+ mounted() {},
|
|
methods: {
|
|
methods: {
|
|
// 显示弹窗
|
|
// 显示弹窗
|
|
showDialog() {
|
|
showDialog() {
|
|
- this.dialogVisible = true
|
|
|
|
- this.page.pageNumber = 1
|
|
|
|
- this.tableData = []
|
|
|
|
- this.getTableData()
|
|
|
|
|
|
+ this.dialogVisible = true;
|
|
},
|
|
},
|
|
//修改建筑楼层
|
|
//修改建筑楼层
|
|
changeFloor(value) {
|
|
changeFloor(value) {
|
|
- this.Buildfloor = value
|
|
|
|
- this.getTableData()
|
|
|
|
|
|
+ this.Buildfloor = value;
|
|
|
|
+ this.getTableData();
|
|
},
|
|
},
|
|
//修改空间类型
|
|
//修改空间类型
|
|
changeSpace(value) {
|
|
changeSpace(value) {
|
|
- this.Spacecategory = value
|
|
|
|
- this.getTableData()
|
|
|
|
|
|
+ this.Spacecategory = value;
|
|
|
|
+ this.getTableData();
|
|
},
|
|
},
|
|
getTableData() {
|
|
getTableData() {
|
|
let params = {
|
|
let params = {
|
|
data: {
|
|
data: {
|
|
- Filters:"not LocalId isNull",
|
|
|
|
- Orders: "Name desc",
|
|
|
|
|
|
+ Filters: "not RoomID isNull",
|
|
|
|
+ Orders: "RoomLocalName desc",
|
|
PageNumber: this.page.pageNumber,
|
|
PageNumber: this.page.pageNumber,
|
|
- PageSize: this.page.pageSize,
|
|
|
|
|
|
+ PageSize: this.page.pageSize
|
|
},
|
|
},
|
|
shaftId: this.params.ShaftID,
|
|
shaftId: this.params.ShaftID,
|
|
- sysId:this.$route.query.SysID
|
|
|
|
- }
|
|
|
|
|
|
+ sysId: this.$route.query.SysID
|
|
|
|
+ };
|
|
if (this.Buildfloor[0] == "noKnow") {
|
|
if (this.Buildfloor[0] == "noKnow") {
|
|
- params.data.Filters += `;buildingId isNull`
|
|
|
|
|
|
+ params.data.Filters += `;buildingId isNull`;
|
|
} else if (this.Buildfloor[0] && this.Buildfloor[0] != "all") {
|
|
} 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") {
|
|
if (this.Buildfloor[1] == "noKnow") {
|
|
- params.data.Filters += `;floorId isNull`
|
|
|
|
|
|
+ params.data.Filters += `;floorId isNull`;
|
|
} else if (this.Buildfloor[1] && this.Buildfloor[1] != "all") {
|
|
} 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}'`
|
|
|
|
|
|
+ if (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 => {
|
|
unSysZoneSpace(params, res => {
|
|
- this.tableData = res.Content
|
|
|
|
- this.page.total = res.Total
|
|
|
|
- })
|
|
|
|
|
|
+ this.tableData = res.Content;
|
|
|
|
+ this.page.total = res.Total;
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ handleClose() {
|
|
|
|
+ this.$emit("update:dialogVisible", false);
|
|
},
|
|
},
|
|
//选中项修改
|
|
//选中项修改
|
|
handleSelectionChange(val) {
|
|
handleSelectionChange(val) {
|
|
this.selections = val;
|
|
this.selections = val;
|
|
},
|
|
},
|
|
savaRelation() {
|
|
savaRelation() {
|
|
- if(this.selections.length){
|
|
|
|
|
|
+ if (this.selections.length) {
|
|
let params = {
|
|
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')
|
|
|
|
- })
|
|
|
|
- }else {
|
|
|
|
- this.$message('请选择要关联的设备')
|
|
|
|
|
|
+ };
|
|
|
|
+ linkSysSp(params, res => {
|
|
|
|
+ this.dialogVisible = false;
|
|
|
|
+ this.$message.success("关联成功!");
|
|
|
|
+ this.$emit("update:dialogVisible", false);
|
|
|
|
+ this.$emit("refresh");
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ this.$message("请选择要关联的设备");
|
|
}
|
|
}
|
|
},
|
|
},
|
|
//改变pagesize
|
|
//改变pagesize
|
|
@@ -176,19 +224,31 @@ export default {
|
|
},
|
|
},
|
|
// 查看详情
|
|
// 查看详情
|
|
toDetail() {
|
|
toDetail() {
|
|
- this.$message('开发中')
|
|
|
|
|
|
+ this.$message("开发中");
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ watch: {
|
|
|
|
+ dialogVisible: {
|
|
|
|
+ handler() {
|
|
|
|
+ if (this.dialogVisible) {
|
|
|
|
+ this.page.pageNumber = 1;
|
|
|
|
+ this.tableData = [];
|
|
|
|
+ this.getTableData();
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ immediate: true
|
|
|
|
+ }
|
|
|
|
+ }
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
<style lang="less" scoped>
|
|
<style lang="less" scoped>
|
|
#addEqDialog {
|
|
#addEqDialog {
|
|
.filters {
|
|
.filters {
|
|
- margin-bottom: 10px;
|
|
|
|
|
|
+ margin-bottom: 10px;
|
|
}
|
|
}
|
|
.table-box {
|
|
.table-box {
|
|
height: 370px;
|
|
height: 370px;
|
|
- .fr{
|
|
|
|
|
|
+ .fr {
|
|
margin-top: 10px;
|
|
margin-top: 10px;
|
|
}
|
|
}
|
|
}
|
|
}
|