From 74479378a65ce1cb80a9386c5d66270f569ff77b Mon Sep 17 00:00:00 2001
From: heyujie <516346543@qq.com>
Date: 星期四, 11 三月 2021 10:55:41 +0800
Subject: [PATCH] 朔黄任务分配固定区域,避免按钮的上移
---
src/pages/panoramicView/components/RelateCamera.vue | 91 +++++++++++++++++++++++++++++++++++----------
1 files changed, 71 insertions(+), 20 deletions(-)
diff --git a/src/pages/panoramicView/components/RelateCamera.vue b/src/pages/panoramicView/components/RelateCamera.vue
index caf3ada..8b846d3 100644
--- a/src/pages/panoramicView/components/RelateCamera.vue
+++ b/src/pages/panoramicView/components/RelateCamera.vue
@@ -58,7 +58,7 @@
</div>
</div>
<div class="relative-list">
- <div class="relative-item" v-for="item in relativeList" :key="item.id">
+ <div class="relative-item" v-for="(item,index) in relativeList" :key="item.id">
<div class="left">
<el-select v-model="item.sourceObj" value-key="polygonId" size="small">
<el-option
@@ -80,9 +80,18 @@
</div>
<div class="right">
<el-button type="text" @click="saveRelativePolygon(item)">淇濆瓨</el-button>
- <div class="btn-del" @click="delRelation(item)">
- <i class="el-icon-delete"></i>
- </div>
+
+ <el-popconfirm title="纭畾鍒犻櫎璇ラ厤缃悧?" @onConfirm="delRelation(item)" v-if="item.id">
+ <el-button class="btn-del" slot="reference" type="text" icon="el-icon-delete"></el-button>
+ </el-popconfirm>
+ <el-button
+ @click="delRelation(item,index)"
+ class="btn-del"
+ slot="reference"
+ type="text"
+ icon="el-icon-delete"
+ v-else
+ ></el-button>
</div>
</div>
</div>
@@ -170,17 +179,22 @@
polygonUpdate () {
this.getAllGroups();
},
- delRelation (item) {
+ delRelation (item, index) {
let _this = this;
- delRelation(item.id).then(res => {
- if (res.success) {
- this.$notify({
- type: 'success',
- message: res.data
- });
- _this.findRelationByGroup();
- }
- })
+ if (item.id) {
+ delRelation(item.id).then(res => {
+ if (res.success) {
+ this.$notify({
+ type: 'success',
+ message: res.data
+ });
+ _this.findRelationByGroup();
+ }
+ })
+ }else{
+ this.relativeList.splice(index,1);
+ }
+
},
findRelationByGroup () {
let _this = this;
@@ -200,7 +214,21 @@
})
},
saveRelativePolygon (item) {
- debugger
+ // debugger
+ if (!item.sourceObj || !item.targetObj) {
+ this.$notify({
+ type: 'warning',
+ message: '璇峰畬鍠勫叧鑱斿尯鍩熶俊鎭�!'
+ });
+ return;
+ }
+ if (item.sourceObj.cameraId == item.targetObj.cameraId) {
+ this.$notify({
+ type: 'warning',
+ message: '鐩稿悓鎽勫儚鏈轰笉瀛樺湪鍏宠仈鍖哄煙锛岃閲嶆柊閫夋嫨!'
+ });
+ return;
+ }
let _this = this;
let params = {
groupId: this.curGroup.id,
@@ -282,8 +310,20 @@
groups[i].cameras = await _this.findPolygonByIds(groups[i].cameras)
}
this.groupList = groups;
- //閫変腑绗竴涓�
- this.groupList.length && this.checkCurrentGroup(_this.groupList[0]);
+ this.groupList.reverse();
+ //濡傛灉鍒氭柊寤哄垯閫変腑绗竴涓�,缂栬緫鍒欓�変腑缂栬緫鐨勯偅鏉�
+ if (!this.groupForm.id) {
+ this.groupList.length && this.checkCurrentGroup(_this.groupList[0]);
+ } else {
+ let group = this.groupList.find(one => one.id == this.groupForm.id);
+ if(group){
+ this.groupList.length && this.checkCurrentGroup(group);
+ }else{
+ this.groupList.length && this.checkCurrentGroup(_this.groupList[0]);
+ }
+
+ }
+
},
@@ -293,6 +333,7 @@
},
editGroup (group) {
+ // debugger
this.groupModelVisible = true;
//this.$refs['groupForm'].resetFields();
//this.groupForm = group;
@@ -307,8 +348,9 @@
checkCurrentGroup (group) {
this.groupList.forEach(group => {
group.checked = false;
- })
+ });
this.curGroup = group;
+ this.groupForm = JSON.parse(JSON.stringify(group));
this.curGroup.checked = true;
this.findRelationByGroup();
//鏌ヨ绗竴涓垎缁勪笅鎽勫儚鏈哄尯鍩�
@@ -371,6 +413,12 @@
})
//this.groupList.push(this.groupForm);
saveCameraGroupInfo(params).then(res => {
+ if(res.success){
+ this.$notify({
+ type: 'success',
+ message: '淇濆瓨鎴愬姛!'
+ })
+ }
_this.getAllGroups();
})
this.groupModelVisible = false;
@@ -441,8 +489,8 @@
.details {
display: -webkit-box;
overflow: hidden;
- text-overflow:ellipsis;
- word-break:break-all;
+ text-overflow: ellipsis;
+ word-break: break-all;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
//flex-wrap: wrap;
@@ -513,6 +561,9 @@
.right {
display: flex;
align-items: center;
+ .el-button + .el-button{
+ margin-left: 0;
+ }
}
i {
font-size: 20px;
--
Gitblit v1.8.0