guanqb
2023-02-28 2d95b4233c7bd28f06cdb244b98c6b261d0397b0
巡逻路线新增修改调色盘
3 files modified
95 ■■■■ changed files
src/api/activity/index.js 9 ●●●● patch | view | raw | blame | history
src/styles/base/index.scss 34 ●●●●● patch | view | raw | blame | history
src/views/activity/index.vue 52 ●●●● patch | view | raw | blame | history
src/api/activity/index.js
@@ -69,16 +69,11 @@
 * @param {*} type  范围类型
 * @returns
 */
export const addCarAndRange = (carId, position, securityId, type) => {
export const addCarAndRange = (params) => {
    return request({
        url: `/api/securityManageCar/securityManageCar/save`,
        method: 'post',
        params: {
            carId,
            position,
            securityId,
            type
        }
        params: params
    })
}
src/styles/base/index.scss
@@ -843,39 +843,9 @@
                width: 120px;
            }
            .color-box {
            .edit-line-btn-box {
                display: flex;
                width: 140px;
                height: 32px;
                background-color: rgba(8, 56, 185, 0.5);
                padding: 6px;
                &>div {
                    width: 20px;
                    height: 20px;
                    line-height: 20px;
                    border: 1px solid #409EFF;
                    margin-right: 10px;
                    cursor: pointer;
                    user-select: none;
                }
                &>div:hover {
                    border: 1px solid #eee;
                }
                .red-color {
                    background-color: red;
                }
                .green-color {
                    background-color: green;
                }
                .blue-color {
                    background-color: blue;
                }
                justify-content: center;
            }
            .units {
src/views/activity/index.vue
@@ -350,8 +350,8 @@
                        :value="item.value"></el-option>
                </el-select>
                <el-button @click="determine" v-show="!isChoosePoliceElementDisabled">确定</el-button>
                <el-button @click="cancel" v-show="!isChoosePoliceElementDisabled">取消</el-button>
                <el-button @click="deletePoliceElement" v-show="!isChoosePoliceElementDisabled">删除</el-button>
                <el-button @click="cancel" v-show="!isChoosePoliceElementDisabled">取消</el-button>
            </div>
        </el-dialog>
@@ -373,7 +373,7 @@
        </el-dialog>
        <el-dialog :title="lineEditTitle" :modal="false" :visible.sync="lineEditVisible" :close-on-click-modal="true"
            class="edit-line-box">
            class="edit-line-box" :before-close="cancelSaveLine">
            <div>
                <div class="value-name-box">设置缓冲范围:</div>
                <div class="input-width-box">
@@ -387,12 +387,13 @@
                   <v-swatches v-model="chooseColor"></v-swatches>
                </div>
            </div>
            <div>
                <el-button @click="watchVideo">查看视频</el-button>
                <el-button @click="editLineInfo">编辑</el-button>
                <el-button @click="saveLineInfo">保存</el-button>
                <el-button @click="deleteLine">删除</el-button>
                <el-button @click="lineEditVisible = false">取消</el-button>
            <div class="edit-line-btn-box">
                <el-button @click="watchVideo" v-show="isLineEdit">查看视频</el-button>
                <el-button @click="editLineInfo" v-show="isLineEdit">编辑</el-button>
                <el-button @click="saveLineInfo"  v-show="isLineEdit">保存</el-button>
                <el-button @click="deleteLine" v-show="isLineEdit">删除</el-button>
                <el-button @click="addLineInfo" v-show="!isLineEdit">添加</el-button>
                <el-button @click="cancelSaveLine">取消</el-button>
            </div>
        </el-dialog>
@@ -670,6 +671,8 @@
            isNeedName:false,
            plotSaveType:1,
            arrowPositionSre:'',
            isLineEdit:true,
            addLinePosition:'',
        }
    },
@@ -1071,8 +1074,9 @@
        },
        // 活动添加警车和范围
        addCarAndRange (carId, position, securityId, type) {
            addCarAndRange(carId, position, securityId, type).then(res => {
        // carId警车id, position坐标, securityId活动id, type线面类型,width缓存范围,color范围颜色
        addCarAndRange (params) {
            addCarAndRange(params).then(res => {
                if (res.data.success) {
                    this.$message({
                        message: '添加成功',
@@ -1083,7 +1087,7 @@
                        message: '添加失败'
                    })
                }
                this.getSecurityCarList(securityId, this.policeSwitch, this.polylineBtnSwitch)
                this.getSecurityCarList(params.securityId, this.policeSwitch, this.polylineBtnSwitch)
            })
        },
@@ -1372,6 +1376,7 @@
                if (overlay) {
                    drawLayers.addOverlay(overlay)
                    plot.edit(overlay, (e) => {
                    drawLayers.addOverlay(overlay)
                        flag = true
                        overlay.on(global.DC.MouseEventType.CLICK, this.overlayTypeClick)
                        overlay.drawType = poltType
@@ -1395,7 +1400,12 @@
                                })
                                position = position.slice(0, position.length - 1)
                                that.polylineBtnSwitch = true
                                that.addCarAndRange('', position, that.showingSecurityId, 1)
                                that.lineEditTitle = '新增巡逻路线'
                                that.isLineEdit = false
                                that.chooseColor = '#1CA085'
                                that.lineWidth = 100
                                that.addLinePosition = position
                                that.lineEditVisible = true
                                flag = false
                            }
                        }
@@ -1586,7 +1596,7 @@
                }
                if (this.policeChooseCarVisible == true) {
                    this.policeChooseCarVisible = false
                    this.addCarAndRange(this.policeType, position, this.showingSecurityId, type)
                    this.addCarAndRange({carId:this.policeType, position:position, securityId:this.showingSecurityId, type:type})
                } else if (this.policeChooseVisible == true) {
                    this.policeChooseVisible = false
@@ -1628,6 +1638,14 @@
            }
        },
        // 取消保存巡逻路线
        cancelSaveLine(){
            this.lineEditVisible = false
            if(drawLayers!=null){
                drawLayers.clear()
            }
        },
        // 巡逻路线面点击事件
        lineOverlayTypeClick (e) {
            this.videoShow = false
@@ -1638,6 +1656,8 @@
            this.lineObjdata = e.overlay.attrParams.lineObj
            this.polygonPosition = e.overlay.attrParams.polygonPositionStr
            if (this.userInfo.dept_id == '1123598813738675201' || this.userInfo.dept_id == this.activityDeptId) {
                this.lineEditTitle = '修改巡逻路线'
                this.isLineEdit = true
                this.lineEditVisible = true
            } else {
                this.lineEditVisible = false
@@ -1979,6 +1999,12 @@
            this.lineEditVisible = false
        },
        // 新增巡逻路线信息
        addLineInfo(){
            this.addCarAndRange({position:this.addLinePosition, securityId:this.showingSecurityId, type:1,color:this.chooseColor,width:this.lineWidth})
            this.cancelSaveLine()
        },
        // 遍历监控图标
        initMonitoringIcon (monitoringList) {
            monitoringList.forEach(item => {