|
@@ -9,15 +9,18 @@
|
|
|
<div class="item">
|
|
|
<p>将位置标签图片批量补充到业务空间:</p>
|
|
|
<div v-for="item in zoneList" :key="item.objid" class="zone-item">
|
|
|
- <el-tooltip class="item" effect="light" :content="item.RoomLocalName || item.RoomName" placement="top">
|
|
|
+ <el-tooltip class="item" effect="light"
|
|
|
+ :content="`${item.Building.BuildLocalName} / ${item.Floor.FloorLocalName} / ${item.DClassDef.Name} / ${item.RoomLocalName}`"
|
|
|
+ placement="top">
|
|
|
<p>{{item.RoomLocalName || item.RoomName}}</p>
|
|
|
</el-tooltip>
|
|
|
- <el-button type="info" icon="el-icon-delete" circle style="float:right;" size="mini" @click="deleteZone(item.RoomID)"></el-button>
|
|
|
+ <i class="el-icon-delete" circle style="float:right;line-height:32px;padding: 0 9px 0 0;cursor: pointer;" size="mini"
|
|
|
+ @click="deleteZone(item.RoomID)"></i>
|
|
|
</div>
|
|
|
- <div class="zone-item" style="border:none;">
|
|
|
+ <div class="zone-item" style="border:none;border-left:-4px;width:auto;">
|
|
|
<el-cascader :props="zoneCascader" :show-all-levels="false" v-model="zoneCa" @change="changeCascader" filterable style="float:left;">
|
|
|
</el-cascader>
|
|
|
- <el-button type="primary" icon="el-icon-plus" circle style="float:right;" size="mini" @click="addZone"></el-button>
|
|
|
+ <el-button type="primary" icon="el-icon-plus" circle style="float:right;margin:2px 10px;" size="mini" @click="addZone"></el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="item">
|
|
@@ -31,7 +34,7 @@
|
|
|
|
|
|
<script>
|
|
|
import locationPointMsg from '@/views/data_admin/buildGraphy/locationPointMsg'
|
|
|
-import { queryDictionaryHead, zoneQueryByPoint, queryZone } from '@/api/scan/request';
|
|
|
+import { queryDictionaryHead, zoneQueryByPoint, queryZone, updateZonePic } from '@/api/scan/request';
|
|
|
import { mapGetters } from 'vuex'
|
|
|
export default {
|
|
|
data() {
|
|
@@ -64,20 +67,30 @@ export default {
|
|
|
methods: {
|
|
|
//创建
|
|
|
updateZ() {
|
|
|
- console.log(this.zoneList);
|
|
|
- if (this.$refs.pointMsg.choImg.length && this.zoneList.length) {
|
|
|
- let imgs = {};
|
|
|
- this.$refs.pointMsg.choImg.map((item, key) => {
|
|
|
- imgs[`additionalProp${key + 1}`] = item;
|
|
|
- })
|
|
|
- this.zoneList.map(item => {
|
|
|
- item.Pic = imgs;
|
|
|
+ let imgs = this.$refs.pointMsg.choImg.concat();
|
|
|
+ imgs = imgs.map(item => ({
|
|
|
+ Id: item.ObjectId,
|
|
|
+ Key: item.Key,
|
|
|
+ Name: item.Name,
|
|
|
+ Type: item.Type
|
|
|
+ }))
|
|
|
+ if (imgs.length && this.zoneList.length) {
|
|
|
+ let zones = this.zoneList.map(item => {
|
|
|
+ if (item.Pic) {
|
|
|
+ item.Pic = item.Pic.concat(imgs);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ item.Pic = imgs;
|
|
|
+ }
|
|
|
+ return { RoomID: item.RoomID, Pic: item.Pic, ObjectType: item.ObjectType };
|
|
|
})
|
|
|
let param = {
|
|
|
- data: {
|
|
|
- content: this.zoneList
|
|
|
- }
|
|
|
+ Content: zones
|
|
|
}
|
|
|
+ updateZonePic(param, res => {
|
|
|
+ this.$message.success("更新成功");
|
|
|
+ this.$refs.pointMsg.clearImg();
|
|
|
+ })
|
|
|
}
|
|
|
else if (!this.$refs.pointMsg.choImg.length) {
|
|
|
this.$message("请至少选择一张图片");
|
|
@@ -92,7 +105,10 @@ export default {
|
|
|
let pa = {
|
|
|
X: this.pointItem.X,
|
|
|
Y: this.pointItem.Y,
|
|
|
- data: { Filters: `buildingId = '${this.pointItem.BuildId}' and floorId = '${this.pointItem.FloorId}'` }
|
|
|
+ data: {
|
|
|
+ Filters: `buildingId = '${this.pointItem.BuildId}' and floorId = '${this.pointItem.FloorId}'`,
|
|
|
+ "Cascade": [{ "Name": "floor" }, { "Name": "building" }, { "Name": "objectTypeO" }]
|
|
|
+ }
|
|
|
}
|
|
|
zoneQueryByPoint(pa, res => {
|
|
|
this.zoneList = res.Content;
|
|
@@ -151,11 +167,16 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
queryZone(pa, res => {
|
|
|
- let nodes = res.Content.map(item => ({
|
|
|
- value: item,
|
|
|
- label: item.RoomLocalName || item.RoomName,
|
|
|
- leaf: level >= 3
|
|
|
- }))
|
|
|
+ let nodes = res.Content.map(item => {
|
|
|
+ item.Building = { BuildLocalName: node.parent.parent.label };
|
|
|
+ item.Floor = { FloorLocalName: node.parent.label };
|
|
|
+ item.DClassDef = { Name: node.label };
|
|
|
+ return {
|
|
|
+ value: item,
|
|
|
+ label: item.RoomLocalName || item.RoomName,
|
|
|
+ leaf: level >= 3
|
|
|
+ }
|
|
|
+ })
|
|
|
resolve(nodes)
|
|
|
})
|
|
|
}
|
|
@@ -168,7 +189,6 @@ export default {
|
|
|
addZone() {
|
|
|
if (this.newZoneObj.RoomID && this.zoneList.findIndex((item) => (item.RoomID == this.newZoneObj.RoomID)) == -1) {
|
|
|
this.zoneList.push(this.newZoneObj)
|
|
|
- console.log(this.zoneList)
|
|
|
}
|
|
|
else if (!this.newZoneObj.RoomID) {
|
|
|
this.$message("请选择业务空间后添加")
|
|
@@ -237,17 +257,16 @@ export default {
|
|
|
display: inline-block;
|
|
|
position: relative;
|
|
|
width: 245px;
|
|
|
- padding: 5px 10px;
|
|
|
- margin: 0 5px 5px 0;
|
|
|
+ margin: 5px 15px 10px 0;
|
|
|
+ border: 1px solid rgb(220, 223, 230);
|
|
|
+ border-radius: 5px;
|
|
|
}
|
|
|
.zone-item p {
|
|
|
width: 200px;
|
|
|
float: left;
|
|
|
height: 32px;
|
|
|
overflow: hidden;
|
|
|
- border: 1px solid rgb(220, 223, 230);
|
|
|
padding-left: 15px;
|
|
|
padding: 0 0 0 15px;
|
|
|
- border-radius: 5px;
|
|
|
}
|
|
|
</style>
|