guanqb
2023-04-07 fba0b4cdc5d070394fc64b34d9e50ca65c23e0a6
src/views/activity/components/polylinePlot.vue
@@ -4,7 +4,13 @@
<template>
    <div>
        <el-dialog :title="lineEditTitle" :visible.sync="lineEditVisible" :modal="true" :close-on-click-modal="false"
            :append-to-body="true" class="edit-line-box" :before-close="cancelSaveLine">
            :modal-append-to-body="false" class="edit-line-box" :before-close="cancelSaveLine">
            <div>
                <div class="value-name-box">描述:</div>
                <div class="input-width-box" style="flex: 1;">
                    <input style="width: 100%;" type="text" v-model="lineRemark" placeholder="请输入..." />
                </div>
            </div>
            <div>
                <div class="value-name-box">设置缓冲范围:</div>
                <div class="input-width-box">
@@ -48,6 +54,7 @@
        return {
            lineEditTitle: '修改巡逻路线',
            isLineEdit: true,
            lineRemark: "",
            lineWidth: 100,
            chooseColor: '#1CA085',
            policeIconId: {},
@@ -75,6 +82,7 @@
        addPopupShow (positions, altitude) {
            this.lineEditTitle = '新增巡逻路线'
            this.chooseColor = '#1CA085'
            this.lineRemark = ''
            this.lineWidth = 100
            this.isLineEdit = false
            polygonAltArray = altitude
@@ -94,6 +102,7 @@
            curLinePosition = e.overlay.attrParams.linePositionStr
            curLinePolygonPosition = e.overlay.attrParams.polygonPositionStr
            this.lineRemark = e.overlay.attrParams.remark
            this.lineWidth = e.overlay.attrParams.width != -1 ? e.overlay.attrParams.width : 100
            this.chooseColor = e.overlay.attrParams.color != '' ? e.overlay.attrParams.color : '#1CA085'
            this.policeIconId = e.overlay.attrParams.id
@@ -122,7 +131,7 @@
        // 保存巡逻路线信息
        saveLineInfo () {
            this.$parent.updateActivityCar({ id: this.policeIconId, color: this.chooseColor, width: this.lineWidth }, polylineOverlay.overlay)
            this.$parent.updateActivityCar({ id: this.policeIconId, color: this.chooseColor, width: this.lineWidth, remark: this.lineRemark }, polylineOverlay.overlay)
            this.lineEditVisible = false
        },
@@ -150,6 +159,7 @@
                    })
                    polylineOverlay.overlay.remove()
                    polylineOverlay.overlay.attrParams.lineObj.remove()
                    this.$EventBus.$emit('activeDeleteLineOrPoint', 'policecar')
                } else {
                    this.$message({
                        message: '删除失败',
@@ -167,7 +177,8 @@
                securityId: this.showingSecurityId,
                type: 1,
                color: this.chooseColor,
                width: this.lineWidth
                width: this.lineWidth,
                remark: this.lineRemark
            })
        },
@@ -179,6 +190,7 @@
                if (res.data.success) {
                    this.$parent.addNewPolice(res.data.data, 'policecar', params.type)
                    this.$EventBus.$emit('activeDeleteLineOrPoint', 'policecar')
                    this.$message({
                        message: '添加成功',