| | |
| | | boxShow: true, |
| | | policeChooseTitle: '选择警员', |
| | | policeChooseVisible: false, |
| | | overlayObj1: {}, |
| | | overlayObj2: {}, |
| | | } |
| | | }, |
| | | created () { |
| | |
| | | draw (type) { |
| | | let flag = false |
| | | const that = this |
| | | |
| | | this.policeType = '' |
| | | plot && plot.draw(type, overlay => { |
| | | if (overlay) { |
| | | |
| | |
| | | |
| | | plot.edit(overlay, (e) => { |
| | | flag = true |
| | | // if ('_positions' in e) { |
| | | // console.log(e._positions) |
| | | // } else { |
| | | console.log(e) |
| | | // } |
| | | overlay.on(global.DC.MouseEventType.CLICK, this.overlayTypeClick) |
| | | overlay.policeType = this.policeType |
| | | this.overlayObj1 = overlay |
| | | document.oncontextmenu = function () { |
| | | if (flag == true) { |
| | | that.policeChooseVisible = true |
| | | |
| | | flag = false |
| | | } |
| | | } |
| | | |
| | | }) |
| | | |
| | | } |
| | |
| | | |
| | | cancel () { |
| | | this.policeChooseVisible = false |
| | | this.overlayObj2 = {} |
| | | }, |
| | | |
| | | determine () { |
| | | if ('_id' in this.overlayObj2) { |
| | | this.overlayObj2.policeType = this.policeType |
| | | } else { |
| | | this.overlayObj1.policeType = this.policeType |
| | | } |
| | | this.policeChooseVisible = false |
| | | }, |
| | | |
| | | overlayTypeClick (e) { |
| | | this.overlayObj2 = e.overlay |
| | | this.policeType = this.overlayObj2.policeType |
| | | this.policeChooseVisible = true |
| | | this.overlayObj2 = {} |
| | | } |
| | | }, |
| | | |
| | | destroyed () { |