| | |
| | | </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 |
| | |
| | | </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> |
| | |
| | | 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; |
| | |
| | | }, |
| | | saveRelativePolygon (item) { |
| | | 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, |
| | |
| | | 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]); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | }, |
| | | |
| | |
| | | }, |
| | | |
| | | editGroup (group) { |
| | | debugger |
| | | this.groupModelVisible = true; |
| | | //this.$refs['groupForm'].resetFields(); |
| | | //this.groupForm = group; |
| | |
| | | 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(); |
| | | //查询第一个分组下摄像机区域 |
| | |
| | | }) |
| | | //this.groupList.push(this.groupForm); |
| | | saveCameraGroupInfo(params).then(res => { |
| | | if(res.success){ |
| | | this.$notify({ |
| | | type: 'success', |
| | | message: '保存成功!' |
| | | }) |
| | | } |
| | | _this.getAllGroups(); |
| | | }) |
| | | this.groupModelVisible = false; |
| | |
| | | .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; |