1
guanqb
2023-01-03 64ad01622d80801e7506ed067c6925979b92aa1e
1
2 files modified
207 ■■■■ changed files
src/api/activity/index.js 34 ●●●●● patch | view | raw | blame | history
src/views/activity/index.vue 173 ●●●● patch | view | raw | blame | history
src/api/activity/index.js
@@ -174,4 +174,38 @@
        url: `/api/blade-system/dict-biz/child-list?current=1&size=9999&parentId=${parentId}`,
        method: 'get'
    })
}
/**
 * 保存活动标绘箭头
 * @param {*} securityId  活动ID
 * @param {*} position  坐标
 * @param {*} type  箭头类型
 * @returns
 */
export const addSecurityPlot = (securityId, position, type) => {
    return request({
        url: `/api/securityPlot/securityPlot/save`,
        method: 'post',
        data: {
            securityId,
            position,
            type
        }
    })
}
/**
 * 获得活动标绘箭头列表
 * @param {*} securityId  活动ID
 * @returns
 */
export const getSecurityPlotList = (securityId) => {
    return request({
        url: `/api/securityPlot/securityPlot/all`,
        method: 'get',
        params: {
            securityId,
        }
    })
}
src/views/activity/index.vue
@@ -17,9 +17,19 @@
                <div>
                    <div class="category">活动类型:</div>
                    <div class="category-value">
                        <el-select size="small" v-model="activityType" placeholder="请选择" @change="activityTypeChange">
                            <el-option v-for="item in activityOptions" :key="item.dictKey" :label="item.dictValue"
                                :value="item.dictKey" class="activity-option"></el-option>
                        <el-select
                            size="small"
                            v-model="activityType"
                            placeholder="请选择"
                            @change="activityTypeChange"
                        >
                            <el-option
                                v-for="item in activityOptions"
                                :key="item.dictKey"
                                :label="item.dictValue"
                                :value="item.dictKey"
                                class="activity-option"
                            ></el-option>
                        </el-select>
                    </div>
                </div>
@@ -34,26 +44,46 @@
                            placeholder="选择日期"
                            style="width:268px"
                        ></el-date-picker>-->
                        <el-date-picker v-model="selectTime" type="daterange" align="right" unlink-panels
                            format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" range-separator="至"
                            start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions"
                            @change="activityTimeChange"></el-date-picker>
                        <el-date-picker
                            v-model="selectTime"
                            type="daterange"
                            align="right"
                            unlink-panels
                            format="yyyy-MM-dd HH:mm:ss"
                            value-format="yyyy-MM-dd HH:mm:ss"
                            range-separator="至"
                            start-placeholder="开始日期"
                            end-placeholder="结束日期"
                            :picker-options="pickerOptions"
                            @change="activityTimeChange"
                        ></el-date-picker>
                    </div>
                </div>
                <div>
                    <div class="category">活动名称:</div>
                    <div class="category-value">
                        <input type="text" placeholder="请输入活动名称" v-model="searchActivity" class="category-input"
                            @input="inputChange" />
                        <input
                            type="text"
                            placeholder="请输入活动名称"
                            v-model="searchActivity"
                            class="category-input"
                            @input="inputChange"
                        />
                        <button class="category-button el-icon-search" @click="searchClick"></button>
                    </div>
                </div>
            </div>
            <div class="result-content">
                <div class="table-box">
                    <div v-show="activityList.length > 0" class="row-box" :class="{ on: currentClickIndex === index }"
                        v-for="(item, index) in activityList" :key="index" @click="activityListClick(item, index)">
                    <div
                        v-show="activityList.length > 0"
                        class="row-box"
                        :class="{ on: currentClickIndex === index }"
                        v-for="(item, index) in activityList"
                        :key="index"
                        @click="activityListClick(item, index)"
                    >
                        <div class="row-title">常规安保</div>
                        <div class="row-content">
                            <div>
@@ -66,7 +96,9 @@
                            </div>
                            <div>
                                <div class="category">活动时间:</div>
                                <div class="category-value">{{ item.startTime }} 至 {{ item.endTime }}</div>
                                <div
                                    class="category-value"
                                >{{ item.startTime }} 至 {{ item.endTime }}</div>
                            </div>
                            <div>
                                <div class="category">活动详情:</div>
@@ -78,8 +110,14 @@
                    <div v-show="activityList == 0" class="no-data">暂无数据</div>
                </div>
                <div class="pages">
                    <el-pagination background layout="prev, pager, next" :page-size="pagesize" :page-count="pagesCount"
                        :current-page="currentPage" @current-change="handleCurrentChange"></el-pagination>
                    <el-pagination
                        background
                        layout="prev, pager, next"
                        :page-size="pagesize"
                        :page-count="pagesCount"
                        :current-page="currentPage"
                        @current-change="handleCurrentChange"
                    ></el-pagination>
                </div>
            </div>
        </div>
@@ -91,7 +129,10 @@
                <ul>
                    <li>
                        <button @click="draw('billboard', 'policeman')">
                            <img src="../../../public/img/icon/police-people-btn.png" style="height:100%" />
                            <img
                                src="../../../public/img/icon/police-people-btn.png"
                                style="height:100%"
                            />
                        </button>
                    </li>
                    <li>
@@ -180,7 +221,9 @@
            </div>
            <div class="row-box">
                <div class="category">活动时间:</div>
                <div class="category-value">{{ activityDetails.startTime }} 至 {{ activityDetails.endTime }}</div>
                <div
                    class="category-value"
                >{{ activityDetails.startTime }} 至 {{ activityDetails.endTime }}</div>
            </div>
            <div class="row-box">
                <div class="category">活动内容:</div>
@@ -229,16 +272,24 @@
            <div class="row-box">
                <div class="category">应急预案:</div>
                <div class="category-value">
                    <el-switch v-model="polylineSwitch" @change="switchChange" active-color="#13ce66"
                        inactive-color="#ccc"></el-switch>
                    <el-switch
                        v-model="polylineSwitch"
                        @change="switchChange"
                        active-color="#13ce66"
                        inactive-color="#ccc"
                    ></el-switch>
                </div>
            </div>
            <div class="row-box">
                <div class="category">巡逻路线:</div>
                <div class="category-value">
                    <el-switch v-model="polylineBtnSwitch" @change="switchBtnChange" active-color="#13ce66"
                        inactive-color="#ccc"></el-switch>
                    <el-switch
                        v-model="polylineBtnSwitch"
                        @change="switchBtnChange"
                        active-color="#13ce66"
                        inactive-color="#ccc"
                    ></el-switch>
                </div>
            </div>
        </div>
@@ -269,12 +320,22 @@
            </ul>
        </div>
        <el-dialog :title="policeChooseTitle" :modal="false" :visible.sync="policeChooseVisible"
            :before-close="policeChooseBeforeClose" :close-on-click-modal="true" class="choose-police-box">
        <el-dialog
            :title="policeChooseTitle"
            :modal="false"
            :visible.sync="policeChooseVisible"
            :before-close="policeChooseBeforeClose"
            :close-on-click-modal="true"
            class="choose-police-box"
        >
            <div>
                <el-select size="small" v-model="policeType" placeholder="请选择">
                    <el-option v-for="item in policeOption" :key="item.value" :label="item.label"
                        :value="item.value"></el-option>
                    <el-option
                        v-for="item in policeOption"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value"
                    ></el-option>
                </el-select>
                <el-button @click="determine">确定</el-button>
                <el-button @click="cancel">取消</el-button>
@@ -284,7 +345,7 @@
</template>
<script>
import { getSecurityList, getPoliceList, getCarList, addCarAndRange, addActivityPolice, getSecurityPoliceList, getSecurityCarList, updateActivityPolice, updateActivityCar, getServiceDictionary, getActivityType } from '@/api/activity/index.js'
import { getSecurityList, getPoliceList, getCarList, addCarAndRange, addActivityPolice, getSecurityPoliceList, getSecurityCarList, updateActivityPolice, updateActivityCar, getServiceDictionary, getActivityType, addSecurityPlot, getSecurityPlotList } from '@/api/activity/index.js'
let analyseLayer = null
let analysePolygon = null
@@ -534,7 +595,6 @@
                getActivityType(activityType[0].id).then(res => {
                    this.activityOptions.push(...res.data.data)
                })
                console.log(this.activityOptions, 2233)
            })
        },
@@ -606,7 +666,7 @@
                                id: item.id,
                                policemanId: item.policemanId
                            },
                            incident: this.overlayTypeClick
                            // incident: this.overlayTypeClick
                        })
                    } else if (item.type == 2) {
                        let positionNewArr = this.convertPolylineOrPolygonPositionDate(item.position, item.type)
@@ -642,10 +702,8 @@
                type: 'VectorLayer'
            })
            getSecurityCarList(securityId).then(res => {
                console.log(res.data.data, 3333)
                res.data.data.forEach(item => {
                    if (item.type == 1) {
                        console.log(item, 124)
                        let positionNewArr = this.convertPolylineOrPolygonPositionDate(item.position, item.type)
                        this.$EventBus.$emit('layerPolylineAdd', {
                            layerName: 'newCarDrawLayers',
@@ -840,6 +898,7 @@
            })
            this.getSecurityPoliceList(item.id)
            this.getSecurityCarList(item.id)
            this.getSecurityPlotList(item.id)
            if (this.currentClickIndex !== '' && this.currentClickIndex == index) {
                return
            }
@@ -980,7 +1039,7 @@
                                    position += item._lng + ' ' + item._lat + ','
                                })
                                position = position.slice(0, position.length - 1)
                                that.addActivityPolice(this.policeType, position, this.showingSecurityId, 1)
                                that.addCarAndRange('', position, that.showingSecurityId, 1)
                            }
                        }
                    })
@@ -997,8 +1056,30 @@
            arrowPlot && arrowPlot.draw(type, overlay => {
                if (overlay) {
                    console.log(overlay._positions, 123)
                    let plotType = ''
                    if (type == 'attack_arrow') {
                        plotType = 1
                    } else if (type == 'double_arrow') {
                        plotType = 2
                    } else if (type == 'fine_arrow') {
                        plotType = 3
                    } else if (type == 'tailed_attack_arrow') {
                        plotType = 4
                    }
                    let position = ''
                    overlay._positions.forEach(item => {
                        position += item._lng + ' ' + item._lat + ','
                    })
                    position = position.slice(0, position.length - 1)
                    console.log(position, 123445)
                    drawArrowLayers.addOverlay(overlay)
                    plot.edit(overlay)
                    plot.edit(overlay, (e) => {
                        this.addSecurityPlot(this.showingSecurityId, '102.371 35.0049,102.249 33.8775,102.227 33.9519,102.34 35.0212', '1')
                    })
                }
            })
        },
@@ -1008,7 +1089,6 @@
        },
        arrangeDraw () {
            console.log(123)
            this.arrangeVisible = true
        },
@@ -1112,6 +1192,20 @@
                this.policeType = e.overlay.attrParams.carId
            }
            this.policeChooseVisible = true
        },
        // 保存活动标绘箭头
        addSecurityPlot (securityId, position, type) {
            addSecurityPlot(securityId, position, type).then(res => {
                console.log(res, '保存标绘返回值')
            })
        },
        // 获取活动标绘箭头列表
        getSecurityPlotList (securityId) {
            getSecurityPlotList(securityId).then(res => {
                console.log(res, '标绘列表')
            })
        }
    },
@@ -1181,11 +1275,11 @@
        .search-box {
            padding: 0 10px;
            &>div:first-child {
            & > div:first-child {
                margin-top: 0;
            }
            &>div {
            & > div {
                margin-top: 10px;
                display: flex;
                align-items: center;
@@ -1260,7 +1354,7 @@
                    font-size: 14px;
                    .row-content {
                        &>div {
                        & > div {
                            display: flex;
                            line-height: 28px;
@@ -1322,7 +1416,7 @@
        white-space: nowrap;
        transform: translate(-50%, 0);
        &>div {
        & > div {
            display: flex;
        }
@@ -1425,7 +1519,7 @@
            line-height: 28px;
            display: flex;
            &>div {
            & > div {
                text-align: left;
            }
@@ -1439,7 +1533,6 @@
        }
        .row-btn-box {
            // height: 30px;
            :deep(.el-button) {
                // padding: 7px 20px;
@@ -1451,7 +1544,7 @@
            }
            :deep(.el-button:hover) {
                background-color: #409EFF;
                background-color: #409eff;
            }
        }
    }
@@ -1470,7 +1563,7 @@
            line-height: 28px;
            display: flex;
            &>div {
            & > div {
                text-align: left;
            }