|
@@ -1,19 +1,39 @@
|
|
|
<template>
|
|
|
<el-dialog :title="title" :visible.sync="dialogVisible" width="800px" id="addSyDialog">
|
|
|
<div class="table-box">
|
|
|
- <el-table :data="tableData" style="width: 100%" height="100%" v-loading="loading" :header-cell-style="headerStyle" ref="multipleTable">
|
|
|
+ <el-table :data="tableData" style="width: 100%" height="100%" v-loading="loading" :header-cell-style="headerStyle" ref="multipleTable" border>
|
|
|
<el-table-column label="业务空间名称" show-overflow-tooltip min-width="100">
|
|
|
<template slot-scope="scope">
|
|
|
<div>
|
|
|
- {{scope.row.SysLocalName||scope.row.SysName||''}}
|
|
|
+ {{scope.row.RoomLocalName||scope.row.RoomName||''}}
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="SysLocalID" label="所属建筑" show-overflow-tooltip min-width="100"></el-table-column>
|
|
|
- <el-table-column prop="SysLocalID" label="所属楼层" show-overflow-tooltip min-width="100"></el-table-column>
|
|
|
- <el-table-column prop="action" label="操作" min-width="100">
|
|
|
+ <el-table-column label="所属建筑" show-overflow-tooltip min-width="100" class-name="mutiCol">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button size="mini" @click="toDetail(scope.$index, scope.row)" type="primary" plain>查看详情</el-button>
|
|
|
+ <div>
|
|
|
+ <div v-for="(t,i) in scope.row.FloorList" :key="i" class="muti">
|
|
|
+ {{t.Building.BuildLocalName||t.Building.BuildName}}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="SysLocalID" label="所属楼层" show-overflow-tooltip min-width="100" class-name="mutiCol">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>
|
|
|
+ <div v-for="t in scope.row.FloorList" :key="t.FloorID" class="muti">
|
|
|
+ {{t.FloorLocalName||t.FloorName}}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="action" label="操作" min-width="50" align='center' class-name="mutiCol">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>
|
|
|
+ <div v-for="t in scope.row.FloorList" :key="t.FloorID" class="muti">
|
|
|
+ <el-radio v-model="scope.row.selected" :label="t">{{''}}</el-radio>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -24,12 +44,10 @@
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
</template>
|
|
|
-
|
|
|
-
|
|
|
<script>
|
|
|
import {
|
|
|
- notSyInSpaceQuery, //没有和当前空间绑定的系统
|
|
|
- syInSpaceCreate, //系统所在业务空间--创建关系
|
|
|
+ getSpaceBdFlData, // 属于多建筑楼层的空间数据
|
|
|
+ updateRelateInSpAndBuild, //保存业务空间与建筑楼层关系
|
|
|
} from "@/api/scan/request";
|
|
|
export default {
|
|
|
data() {
|
|
@@ -59,45 +77,39 @@ export default {
|
|
|
this.tableData = [];
|
|
|
this.getTableData();
|
|
|
},
|
|
|
- // 选中项修改
|
|
|
- handleSelectionChange(val) {
|
|
|
- this.selections = val;
|
|
|
- },
|
|
|
// 确认
|
|
|
savaRelation() {
|
|
|
- let pa = {
|
|
|
- data: {
|
|
|
- SpaceId: this.spaceId,
|
|
|
- SysIdList: []
|
|
|
- },
|
|
|
- type: this.zone
|
|
|
- }
|
|
|
- this.selections.map(t => {
|
|
|
- pa.data.SysIdList.push(t.SysID)
|
|
|
- })
|
|
|
- syInSpaceCreate(pa, res => {
|
|
|
- this.$message.success('关联成功');
|
|
|
- this.$emit('refresh');
|
|
|
- this.dialogVisible = false;
|
|
|
+ let arr = [];
|
|
|
+ this.tableData.forEach(t => {
|
|
|
+ if (t.selected) {
|
|
|
+ arr.push({
|
|
|
+ spaceId: t.RoomID,
|
|
|
+ id: t.selected.FloorID,
|
|
|
+ type: t.ObjectType
|
|
|
+ })
|
|
|
+ }
|
|
|
})
|
|
|
+ if (arr.length) {
|
|
|
+ updateRelateInSpAndBuild(arr, res => {
|
|
|
+ this.$emit('relaSuc');
|
|
|
+ this.$message.success('关联成功');
|
|
|
+ this.dialogVisible = false;
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$message.warning('请选择关联建筑楼层');
|
|
|
+ }
|
|
|
},
|
|
|
// 获取表格数据
|
|
|
getTableData() {
|
|
|
let pa = {
|
|
|
- data: {
|
|
|
- PageSize: 200,
|
|
|
- Orders: 'SysID asc'
|
|
|
- },
|
|
|
- type: this.zone,
|
|
|
- spaceId: this.spaceId
|
|
|
+ Cascade: [
|
|
|
+ { Name: "floorlList", Cascade: [{ Name: 'building' }] }
|
|
|
+ ],
|
|
|
+ PageSize: 1000
|
|
|
}
|
|
|
- notSyInSpaceQuery(pa, res => {
|
|
|
+ getSpaceBdFlData(pa, res => {
|
|
|
this.tableData = res.Content;
|
|
|
})
|
|
|
- },
|
|
|
- // 查看详情
|
|
|
- toDetail() {
|
|
|
- this.$message('开发中')
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -106,6 +118,19 @@ export default {
|
|
|
#addSyDialog {
|
|
|
.table-box {
|
|
|
height: 350px;
|
|
|
+ /deep/ .mutiCol {
|
|
|
+ padding: 0;
|
|
|
+ & > div {
|
|
|
+ padding: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .muti {
|
|
|
+ line-height: 32px;
|
|
|
+ padding: 0 10px;
|
|
|
+ & + .muti {
|
|
|
+ border-top: 1px solid #ebeef5;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</style>
|