shuishen
2023-03-08 571e96ffb74264f998af86f7994151fe1fb2cba9
Merge branch 'master' of http://s16s652780.51mypc.cn:49896/r/srs-police-affairs
2 files modified
30 ■■■■ changed files
src/views/activity/components/drawBtnBox.vue 27 ●●●● patch | view | raw | blame | history
src/views/activity/index.vue 3 ●●●● patch | view | raw | blame | history
src/views/activity/components/drawBtnBox.vue
@@ -64,7 +64,7 @@
            </div>
        </div>
        <el-dialog title="添加文字标注" :modal="false" :visible.sync="addLabelVisible" :close-on-click-modal="true"
        <el-dialog :title="labelPopupTitle" :modal="false" :visible.sync="addLabelVisible" :close-on-click-modal="true"
            class="add-label-box" :before-close="cancelSaveLabel">
            <div>
                <div class="value-name-box">文字内容:</div>
@@ -73,7 +73,7 @@
                </div>
            </div>
            <div class="btn-box">
                <el-button @click="lableBoxSave">添加</el-button>
                <el-button @click="lableBoxSave">保存</el-button>
                <el-button @click="cancelSaveLabel">取消</el-button>
            </div>
        </el-dialog>
@@ -108,6 +108,8 @@
            addLabelVisible: false,// 文字标注的窗口(内容是名称)
            labelInput: '',
            addLabelPosition: null,
            labelPopupTitle:'添加文字标注',
            labelId:'',
        }
    },
@@ -385,6 +387,7 @@
        },
        drawArrowLabel () {
            this.labelPopupTitle = ""
            isAddLabel = true
            drawLabelStatus = 'start'
            global.viewer.tooltip.enable = true
@@ -426,7 +429,11 @@
                    type: 'error'
                })
            } else {
                this.$parent.addSecurityPlot({ securityId: this.showingSecurityId, position: this.addLabelPosition, type: 9, name: this.labelInput })
                if(this.labelPopupTitle == "添加文字标注"){
                    this.$parent.addSecurityPlot({ securityId: this.showingSecurityId, position: this.addLabelPosition, type: 9, name: this.labelInput })
                }else{
                    this.updateSecurityPlot({ id: this.labelId, name: this.labelInput })
                }
                this.cancelSaveLabel()
            }
        },
@@ -437,7 +444,6 @@
        labelDowm (e) {
            labelPositionChange = true
            curLabelOverLayer = e.overlay
            global.viewer.scene.screenSpaceCameraController.enableRotate = false
            global.viewer.on(global.DC.MouseEventType.MOUSE_MOVE, this.updateLableMove)
@@ -449,6 +455,8 @@
                global.viewer.off(global.DC.MouseEventType.MOUSE_MOVE, this.updateLableMove)
                // curLabelOverLayer 中的位置就是移动后的位置
                let position = curLabelOverLayer._position._lng + ' ' + curLabelOverLayer._position._lat  + ',' + curLabelOverLayer._position._lng  + ' ' + curLabelOverLayer._position._lat
                this.updateSecurityPlot({ id: curLabelOverLayer.attrParams.id, position: position })
            }
        },
@@ -472,7 +480,16 @@
            isAddLabel = false
            this.addLabelVisible = false
            drawLabelStatus = 'end'
        }
        },
        // 单击文字标绘
        reEditLabel(e){
            console.log(66,e);
            this.labelId = e.overlay.attrParams.id
            this.labelPopupTitle = "修改文字标注"
            this.labelInput = e.overlay.attrParams.item.name
            this.addLabelVisible = true
        },
    },
    destroyed () {
src/views/activity/index.vue
@@ -831,7 +831,8 @@
                        position = new global.DC.Position(Number(position[0]), Number(position[1]))
                        let label = new global.DC.Label(position, item.name)
                        label.on(global.DC.MouseEventType.LEFT_UP, e => console.log(e))
                        label.on(global.DC.MouseEventType.CLICK, this.$refs.DRAWBTNBOX.reEditLabel)
                        label.attrParams = { 'id': item.id, item }
                        this.$refs.DRAWBTNBOX.lableAllEvent(label)
                        arrowsListLayer.addOverlay(label)
                    }