|
@@ -3,16 +3,19 @@
|
|
|
<el-row>
|
|
|
<div class="l-list">
|
|
|
<div class="action-box">
|
|
|
- <el-button size="small" type="default" icon="el-icon-plus" @click="addBuild"></el-button>
|
|
|
- <el-button size="small" type="default" icon="el-icon-minus" @click="delBuild"></el-button>
|
|
|
- <el-button size="small" type="default" icon="el-icon-edit-outline" @click="editBuild"></el-button>
|
|
|
+ <div style="height:35px;"></div>
|
|
|
+ <div v-if="0">
|
|
|
+ <el-button size="small" type="default" icon="el-icon-plus" @click="addBuild"></el-button>
|
|
|
+ <el-button size="small" type="default" icon="el-icon-minus" @click="delBuild"></el-button>
|
|
|
+ <el-button size="small" type="default" icon="el-icon-edit-outline" @click="editBuild"></el-button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<h4>建筑</h4>
|
|
|
- <div class="floor-list">
|
|
|
- <div v-for="item in floorList" :key="item.id" class="floor-item" @click="changeBuild">
|
|
|
+ <div class="build-list">
|
|
|
+ <div v-for="(item,index) in buildList" :key="item.BuildID" :class="{'floor-item':true,active:item.active}" @click="changeBuild(index)">
|
|
|
<span>
|
|
|
- {{item.name}}
|
|
|
- <el-badge class="mark" is-dot />
|
|
|
+ {{item.BuildLocalName || item.BuildName}}
|
|
|
+ <el-badge class="mark" :is-dot="false" />
|
|
|
</span>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -23,10 +26,12 @@
|
|
|
</div>
|
|
|
<div class="table-box">
|
|
|
<el-table :data="tableData" style="width: 100%" height="100%" v-loading="loading" :header-cell-style="headerStyle">
|
|
|
- <el-table-column prop="EquipmentMark" label="楼层本地名" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column label="楼层本地名">
|
|
|
+ <template slot-scope="scope">{{scope.row.FloorLocalName||scope.row.FloorName}}</template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="楼层信息">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button size="mini" @click="handleDelete(scope.$index, scope.row)" plain icon="el-icon-edit-outline"></el-button>
|
|
|
+ <el-button size="mini" @click="editFloorData(scope.row)" plain icon="el-icon-edit-outline"></el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="Datasource" label="平面图">
|
|
@@ -55,7 +60,7 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="action" label="操作">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button size="mini" @click="handleDelete(scope.$index, scope.row)" type="danger" plain icon="el-icon-delete"></el-button>
|
|
|
+ <el-button size="mini" @click="handleDelete(scope.row)" type="danger" plain icon="el-icon-delete"></el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -67,15 +72,15 @@
|
|
|
</div>
|
|
|
</el-row>
|
|
|
<!-- 添加-修改楼层 -->
|
|
|
- <addFloor :title="floorTitle" ref="addFloorDialog"></addFloor>
|
|
|
+ <addFloor :title="floorTitle" ref="addFloorDialog" :curBuildId="curBuildId" :curFloorId="curFloorId" @refresh="refresh"></addFloor>
|
|
|
<!-- 添加-修改建筑 -->
|
|
|
<addBuild :title="buildTitle" ref="addBuildDialog"></addBuild>
|
|
|
<!-- 删除建筑-删除楼层 -->
|
|
|
<el-dialog title="提示" :visible.sync="delDialogVis" width="20%" @close="handleClose" id="messageDialog">
|
|
|
<div>确定要删除该{{delText}}?</div>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
- <el-button size="small">取消</el-button>
|
|
|
- <el-button size="small" type="primary" @click="confirm">确认</el-button>
|
|
|
+ <el-button size="small" @click="delDialogVis=false">取消</el-button>
|
|
|
+ <el-button size="small" type="primary" @click="confirmDel">确认</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
|
|
@@ -85,6 +90,11 @@
|
|
|
<script>
|
|
|
import addFloor from "@/views/ready/buildfloor/addFloor/index";
|
|
|
import addBuild from "@/components/ready/buildfloor/addBuild";
|
|
|
+import {
|
|
|
+ buildingQuery,
|
|
|
+ floorQuery,
|
|
|
+ manageDeleteFloor
|
|
|
+} from "@/api/scan/request";
|
|
|
export default {
|
|
|
components: {
|
|
|
addFloor,
|
|
@@ -101,11 +111,7 @@ export default {
|
|
|
color: '#2b2b2b',
|
|
|
lineHeight: '30px'
|
|
|
},
|
|
|
- floorList: [
|
|
|
- { id: 1, name: '建筑a' },
|
|
|
- { id: 2, name: '建筑b' },
|
|
|
- { id: 3, name: '建筑c' },
|
|
|
- ],
|
|
|
+ buildList: [],
|
|
|
tableData: [
|
|
|
{
|
|
|
EquipmentMark: 1
|
|
@@ -117,28 +123,96 @@ export default {
|
|
|
pageNumber: 1,
|
|
|
total: 0
|
|
|
},
|
|
|
- loading: false
|
|
|
+ loading: false, //列表loading
|
|
|
+ curBuildId: '', //当前选中的建筑id
|
|
|
+ curFloorId: '', //当前选中的楼层id
|
|
|
}
|
|
|
},
|
|
|
mounted() { },
|
|
|
+ created() {
|
|
|
+ let bdParam = {
|
|
|
+ PageNumber: 1,
|
|
|
+ PageSize: 500
|
|
|
+ }
|
|
|
+ buildingQuery(bdParam, res => {
|
|
|
+ this.buildList = res.Content;
|
|
|
+ if (this.buildList.length) {
|
|
|
+ this.changeBuild(0)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
methods: {
|
|
|
- changeBuild() { },
|
|
|
+ //change build
|
|
|
+ changeBuild(index) {
|
|
|
+ this.buildList.map(item => {
|
|
|
+ item.active = false
|
|
|
+ return item
|
|
|
+ })
|
|
|
+ this.buildList[index].active = true;
|
|
|
+ this.curBuildId = this.buildList[index].BuildID;
|
|
|
+ this.getFloorTableData()
|
|
|
+ this.$forceUpdate()
|
|
|
+ },
|
|
|
+ //add build
|
|
|
addBuild() {
|
|
|
this.$refs.addBuildDialog.showDialog()
|
|
|
},
|
|
|
+ //delete build
|
|
|
delBuild() {
|
|
|
this.delText = '建筑';
|
|
|
this.delDialogVis = true
|
|
|
},
|
|
|
+ //edit build
|
|
|
editBuild() { },
|
|
|
- handleDelete() {
|
|
|
+ //delete floor
|
|
|
+ handleDelete(floor) {
|
|
|
this.delText = '楼层';
|
|
|
- this.delDialogVis = true
|
|
|
+ this.delDialogVis = true;
|
|
|
+ this.curFloorId = floor.FloorID;
|
|
|
},
|
|
|
+ //确认删除弹窗关闭
|
|
|
+ handleClose() { },
|
|
|
handleSizeChange(pageSize) { },
|
|
|
handleCurrentChange(pageNumber) { },
|
|
|
addFloor() {
|
|
|
+ this.curFloorId = ''
|
|
|
this.$refs.addFloorDialog.showDialog()
|
|
|
+ },
|
|
|
+ // 获取列表
|
|
|
+ getFloorTableData() {
|
|
|
+ let floorParam = {
|
|
|
+ Orders: "FloorSequenceID desc",
|
|
|
+ PageNumber: this.page.pageNumber,
|
|
|
+ PageSize: this.page.pageSize,
|
|
|
+ Filters: `BuildID='${this.curBuildId}'`
|
|
|
+ }
|
|
|
+ floorQuery(floorParam, res => {
|
|
|
+ this.tableData = res.Content;
|
|
|
+ this.page.total = res.Total
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 创建楼层成功
|
|
|
+ refresh(){
|
|
|
+ this.getFloorTableData()
|
|
|
+ },
|
|
|
+ // 确认删除(删除建筑-楼层公用)
|
|
|
+ confirmDel() {
|
|
|
+ if (this.delText == '楼层') {
|
|
|
+ let delParam = [{ FloorID: this.curFloorId }]
|
|
|
+ manageDeleteFloor(delParam, res => {
|
|
|
+ this.$message.success('删除成功');
|
|
|
+ this.delDialogVis = false;
|
|
|
+ this.getFloorTableData()
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ //todo
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ // 修改楼层信息
|
|
|
+ editFloorData(floor){
|
|
|
+ this.curFloorId = floor.FloorID;
|
|
|
+ this.$refs.addFloorDialog.showDialog(floor)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -173,7 +247,7 @@ export default {
|
|
|
border-bottom: 1px solid #dfe6ec;
|
|
|
line-height: 44px;
|
|
|
}
|
|
|
- .floor-list {
|
|
|
+ .build-list {
|
|
|
line-height: 48px;
|
|
|
.floor-item {
|
|
|
white-space: nowrap;
|