|
@@ -15,6 +15,7 @@
|
|
|
<div class="table-box">
|
|
|
<el-table :data="tableData" style="width: 100%" height="100%" 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>
|
|
@@ -23,11 +24,11 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="EquipLocalID" :label="`${inSpaceType}本地编码`" show-overflow-tooltip min-width="100"></el-table-column>
|
|
|
- <el-table-column prop="EquipLocalID" :label="`${inSpaceType}类`" show-overflow-tooltip min-width="100"></el-table-column>
|
|
|
+ <el-table-column prop="EquipCategory.EquipName" :label="`${inSpaceType}类`" show-overflow-tooltip min-width="100"></el-table-column>
|
|
|
<el-table-column prop="EquipLocalID" label="已关联其他业务空间" show-overflow-tooltip min-width="100"></el-table-column>
|
|
|
<el-table-column prop="action" label="操作" min-width="100">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button size="mini" @click="toDetail(scope.$index, scope.row)" type="danger" plain icon="el-icon-delete"></el-button>
|
|
|
+ <el-button size="mini" @click="toDetail(scope.$index, scope.row)" type="primary" plain>查看详情</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -91,7 +92,7 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
props: {
|
|
|
- type: {}, //equipment--equipmentFor
|
|
|
+ type: {}, //Equipment--EquipmentFor
|
|
|
spaceId: {},
|
|
|
zone: {}, //分区类型
|
|
|
},
|
|
@@ -126,42 +127,74 @@ export default {
|
|
|
this.dialogVisible = true;
|
|
|
this.getTableData();
|
|
|
},
|
|
|
+ // 获取列表数据
|
|
|
getTableData() {
|
|
|
let pa = {
|
|
|
data: {
|
|
|
- Filters:`BuildingId="${this.floor[0]}";FloorId="${this.floor[1]}"`,
|
|
|
+ Cascade: [{ Name: "equipCategory" }],
|
|
|
+ Filters: `BuildingId="${this.floor[0]}";FloorId="${this.floor[1]}"`,
|
|
|
PageNumber: this.page.pageNumber,
|
|
|
PageSize: this.page.pageSize,
|
|
|
},
|
|
|
type: this.zone,
|
|
|
spaceId: this.spaceId
|
|
|
}
|
|
|
- if(this.keycode!=''){
|
|
|
+ if (this.keycode != '') {
|
|
|
pa.data.Filters += `;EquipName contain "${this.keycode}" or EquipLocalName contain "${this.keycode}" or EquipLocalID contain "${this.keycode}"`
|
|
|
}
|
|
|
- if (this.type == "equipment") {
|
|
|
+ if (this.type == "Equipment") {
|
|
|
notEqInSpaceQuery(pa, res => {
|
|
|
- this.tableData = res.Content;
|
|
|
- this.page.total = res.Total;
|
|
|
+ this.getDataSuc(res)
|
|
|
})
|
|
|
} else {
|
|
|
notEqForSpaceQuery(pa, res => {
|
|
|
- this.tableData = res.Content;
|
|
|
- this.page.total = res.Total;
|
|
|
+ this.getDataSuc(res)
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
+ // 获取列表成功回调
|
|
|
+ getDataSuc(res) {
|
|
|
+ this.tableData = res.Content;
|
|
|
+ this.page.total = res.Total;
|
|
|
+ },
|
|
|
//选中项修改
|
|
|
handleSelectionChange(val) {
|
|
|
this.selections = val;
|
|
|
},
|
|
|
- savaRelation() { },
|
|
|
- //改变pagesize
|
|
|
+ // 确认 保存关系
|
|
|
+ savaRelation() {
|
|
|
+ let pa = {
|
|
|
+ data: {
|
|
|
+ SpaceId: this.spaceId,
|
|
|
+ EquipIdList: []
|
|
|
+ },
|
|
|
+ type: this.zone
|
|
|
+ }
|
|
|
+ this.selections.map(t => {
|
|
|
+ pa.data.EquipIdList.push(t.EquipID)
|
|
|
+ })
|
|
|
+ if (this.type == "Equipment") {
|
|
|
+ eqInSpaceCreate(pa, res => {
|
|
|
+ this.successCallback()
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ eqForSpaceCreate(pa, res => {
|
|
|
+ this.successCallback()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 关联成功回调
|
|
|
+ successCallback() {
|
|
|
+ this.$message.success('关联成功');
|
|
|
+ this.$emit('refresh');
|
|
|
+ this.dialogVisible = false;
|
|
|
+ },
|
|
|
+ // 改变pagesize
|
|
|
handleSizeChange(pageSize) {
|
|
|
this.page.pageSize = pageSize;
|
|
|
this.getTableData();
|
|
|
},
|
|
|
- //改变pageno
|
|
|
+ // 改变pageno
|
|
|
handleCurrentChange(pageNo) {
|
|
|
this.page.pageNumber = pageNo;
|
|
|
this.getTableData();
|