| | |
| | | import { guid } from '@/scripts/util.js' |
| | | import { findAllPolygons, getAllAreas, saveAreaInfo, delArea } from '@/api/camera' |
| | | export default { |
| | | data () { |
| | | data() { |
| | | return { |
| | | isEdit: false, |
| | | groups: [], |
| | |
| | | checkedData: [] |
| | | } |
| | | }, |
| | | mounted () { |
| | | mounted() { |
| | | this.renderTable(); |
| | | this.getAllPolygons(); |
| | | }, |
| | | methods: { |
| | | renderTable () { |
| | | renderTable() { |
| | | getAllAreas().then(res => { |
| | | if (res.code == 200) { |
| | | this.groups = res.data |
| | | } |
| | | }) |
| | | }, |
| | | getAllPolygons () { |
| | | getAllPolygons() { |
| | | findAllPolygons().then(res => { |
| | | if (res.code == 200) { |
| | | this.areaData = res.data.map(item => { |
| | |
| | | } |
| | | }); |
| | | }, |
| | | edit (row) { |
| | | edit(row) { |
| | | this.isEdit = true; |
| | | this.dialogFormVisible = true; |
| | | this.areaForm = row; |
| | | debugger |
| | | //回显穿梭框 |
| | | let _this = this; |
| | | _this.checkedData = []; |
| | |
| | | }); |
| | | console.log(this.checkedData) |
| | | }, |
| | | createArea () { |
| | | createArea() { |
| | | this.isEdit = false; |
| | | this.dialogFormVisible = true; |
| | | this.areaForm = JSON.parse(JSON.stringify(this.areaForm)); |
| | |
| | | this.areaForm.camPolygons = []; |
| | | this.checkedData = []; |
| | | }, |
| | | removeItem (id) { |
| | | removeItem(id) { |
| | | this.$confirm('确定删除该项吗?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | |
| | | |
| | | }); |
| | | }, |
| | | getIdCode () { |
| | | getIdCode() { |
| | | this.areaForm.id = guid(); |
| | | }, |
| | | handleChange (value, direction, movedKeys) { |
| | | handleChange(value, direction, movedKeys) { |
| | | console.log(value, direction, movedKeys); |
| | | |
| | | }, |
| | | save () { |
| | | // this.checkedData.forEach(item=>{ |
| | | // let node = JSON.parse(item); |
| | | // this.camPolygon.cameraId = node.cameraId; |
| | | // this.camPolygon.cameraName = node.cameraName; |
| | | // this.pgn.polygonId = node.polygonId; |
| | | // this.pgn.polygonName = node.polygonName; |
| | | // this.camPolygon.pgns.push(this.pgn); |
| | | // this.areaForm.camPolygons.push(this.camPolygon); |
| | | // let _this = this; |
| | | // saveAreaInfo(this.areaForm).then(res=>{ |
| | | // if(res.code==200){ |
| | | // _this.$notify({ |
| | | // type:'success', |
| | | // message:'保存成功!' |
| | | // }); |
| | | // _this.dialogFormVisible = false; |
| | | // _this.getAllAreas(); |
| | | // } |
| | | // }) |
| | | // }); |
| | | save() { |
| | | if (this.areaForm.id === "") { |
| | | this.$notify({ |
| | | type: 'error', |
| | | message: '区域ID不能为空' |
| | | }); |
| | | |
| | | return; |
| | | } |
| | | |
| | | let tempArr = []; |
| | | let tempIdArr = []; |
| | | this.areaForm.camPolygons = []; |
| | |
| | | }) |
| | | let _this = this; |
| | | console.log(this.areaForm); |
| | | debugger |
| | | saveAreaInfo(this.areaForm).then(res => { |
| | | if (res.code == 200) { |
| | | _this.$notify({ |
| | |
| | | /deep/.el-transfer-panel__item.el-checkbox .el-checkbox__label { |
| | | overflow: visible; |
| | | } |
| | | /deep/.el-transfer-panel__item.el-checkbox .el-checkbox__label span{ |
| | | /deep/.el-transfer-panel__item.el-checkbox .el-checkbox__label span { |
| | | font-size: 12px !important; |
| | | padding-right: 20px; |
| | | } |
| | |
| | | .el-checkbox__label { |
| | | font-size: 14px !important; |
| | | } |
| | | /deep/.el-transfer-panel{ |
| | | width:300px; |
| | | /deep/.el-transfer-panel { |
| | | width: 300px; |
| | | } |
| | | </style> |