guanqb
2022-11-24 f0c77533625d365daa9806c5a344fffafc79967e
下拉选择警员
1 files modified
31 ■■■■ changed files
src/views/activity/index.vue 31 ●●●● patch | view | raw | blame | history
src/views/activity/index.vue
@@ -481,6 +481,8 @@
            boxShow: true,
            policeChooseTitle: '选择警员',
            policeChooseVisible: false,
            overlayObj1: {},
            overlayObj2: {},
        }
    },
    created () {
@@ -664,7 +666,7 @@
        draw (type) {
            let flag = false
            const that = this
            this.policeType = ''
            plot && plot.draw(type, overlay => {
                if (overlay) {
@@ -672,18 +674,16 @@
                    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
                            }
                        }
                    })
                }
@@ -722,7 +722,24 @@
        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 () {