|
@@ -1,19 +1,23 @@
|
|
|
<template>
|
|
|
<el-dialog :title="title" :visible.sync="dialogVisible" width="900px" id="addEqDialog">
|
|
|
<el-row class="filters">
|
|
|
- <el-col :span="9">
|
|
|
+ <el-col :span="8" style="width:276px">
|
|
|
<el-input 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="15">
|
|
|
+ <el-col :span="8.5" style="padding:0 0;">
|
|
|
<floor-cascader @change="changeFloor"></floor-cascader>
|
|
|
</el-col>
|
|
|
+ <el-col :span="8.5" style="padding-right:0;">
|
|
|
+ <my-cascader @change="changeDevice"></my-cascader>
|
|
|
+ </el-col>
|
|
|
</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 type="selection" width="55"></el-table-column>
|
|
|
<el-table-column :label="`${inSpaceType}名称`" show-overflow-tooltip min-width="100">
|
|
|
<template slot-scope="scope">
|
|
|
<div>
|
|
@@ -44,10 +48,12 @@
|
|
|
<script>
|
|
|
import { unshaftInEq, linkEqSh } from "@/api/scan/request";
|
|
|
import floorCascader from "@/components/ledger/lib/floorCascader";
|
|
|
+import myCascader from "@/components/ledger/lib/cascader";
|
|
|
import { mapGetters } from "vuex";
|
|
|
export default {
|
|
|
components: {
|
|
|
- floorCascader
|
|
|
+ floorCascader,
|
|
|
+ myCascader
|
|
|
},
|
|
|
computed: {
|
|
|
...mapGetters("layout", ["projectId"])
|
|
@@ -57,6 +63,7 @@ export default {
|
|
|
title: "添加系统内设备",
|
|
|
keycode: '', //输入查询条件
|
|
|
Buildfloor: ['all'], // 选中的建筑楼层
|
|
|
+ Equipcategory: null,// 选中的设备类型
|
|
|
inSpaceType: '设备',
|
|
|
dialogVisible: false,
|
|
|
tableData: [],
|
|
@@ -86,6 +93,11 @@ export default {
|
|
|
this.Buildfloor = value
|
|
|
this.getTableData()
|
|
|
},
|
|
|
+ //修改设备类别
|
|
|
+ changeDevice(value) {
|
|
|
+ this.Equipcategory = value.code
|
|
|
+ this.getTableData()
|
|
|
+ },
|
|
|
// 显示弹窗
|
|
|
showDialog() {
|
|
|
this.dialogVisible = true
|
|
@@ -96,8 +108,8 @@ export default {
|
|
|
getTableData() {
|
|
|
let params = {
|
|
|
data: {
|
|
|
- Cascade: [{ Name: 'equipCategory' }, {Name: 'shaftList'}],
|
|
|
- Filters:`not EquipID isNull`,
|
|
|
+ Cascade: [{ Name: 'equipCategory' }, { Name: 'shaftList' }],
|
|
|
+ Filters: `not EquipID isNull`,
|
|
|
Orders: "createTime desc, EquipID desc",
|
|
|
PageNumber: this.page.pageNumber,
|
|
|
PageSize: this.page.pageSize,
|
|
@@ -114,15 +126,18 @@ export default {
|
|
|
} else if (this.Buildfloor[1] && this.Buildfloor[1] != "all") {
|
|
|
params.data.Filters += `;floorId='${this.Buildfloor[1]}'`
|
|
|
}
|
|
|
- if(this.keycode!=''){
|
|
|
+ if (this.keycode != '') {
|
|
|
params.data.Filters += `;EquipName contain '${this.keycode}' or EquipLocalName contain '${this.keycode}' or EquipLocalID contain '${this.keycode}'`
|
|
|
}
|
|
|
+ if (this.Equipcategory) {
|
|
|
+ params.data.Filters += `;category='${this.Equipcategory}'`
|
|
|
+ }
|
|
|
unshaftInEq(params, res => {
|
|
|
res.Content.forEach(item => {
|
|
|
item.ShaftListName = ""
|
|
|
- if(item.ShaftList && item.ShaftList.length){
|
|
|
+ if (item.ShaftList && item.ShaftList.length) {
|
|
|
item.ShaftListName = item.ShaftList.map(shaft => {
|
|
|
- return shaft.ShaftLocalName?shaft.ShaftLocalName:shaft.ShaftName
|
|
|
+ return shaft.ShaftLocalName ? shaft.ShaftLocalName : shaft.ShaftName
|
|
|
}).join("、")
|
|
|
}
|
|
|
})
|
|
@@ -135,7 +150,7 @@ export default {
|
|
|
this.selections = val;
|
|
|
},
|
|
|
savaRelation() {
|
|
|
- if(this.selections.length){
|
|
|
+ if (this.selections.length) {
|
|
|
let params = {
|
|
|
ShaftId: this.params.ShaftID,
|
|
|
EquipIdList: this.selections.map(item => {
|
|
@@ -147,7 +162,7 @@ export default {
|
|
|
this.$message.success('关联成功!')
|
|
|
this.$emit('refresh')
|
|
|
})
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
this.$message('请选择要关联的设备')
|
|
|
}
|
|
|
},
|
|
@@ -172,13 +187,10 @@ export default {
|
|
|
#addEqDialog {
|
|
|
.filters {
|
|
|
margin-bottom: 10px;
|
|
|
- /deep/ .el-input__inner {
|
|
|
- vertical-align: baseline;
|
|
|
- }
|
|
|
}
|
|
|
.table-box {
|
|
|
height: 370px;
|
|
|
- .fr{
|
|
|
+ .fr {
|
|
|
margin-top: 10px;
|
|
|
}
|
|
|
}
|