shuishen
2023-02-28 35a643f2d4faa4552aae7fd0f2299aac09c3c40f
src/views/activity/index.vue
@@ -2,7 +2,7 @@
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2022-08-18 16:18:17
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2023-02-24 14:33:12
 * @LastEditTime: 2023-02-28 15:07:24
 * @FilePath: \srs-police-affairs\src\views\activity\index.vue
 * @Description: 安保活动
 *
@@ -22,11 +22,11 @@
                            v-model="activityType"
                            placeholder="请选择"
                            @change="activityTypeChange"
                                    >
                                        <el-option
                                            v-for="item in activityOptions"
                                            :key="item.dictKey"
                                            :label="item.dictValue"
                                                                                >
                                                                                    <el-option
                                                                                        v-for="item in activityOptions"
                                                                                        :key="item.dictKey"
                                                                                        :label="item.dictValue"
                                :value="item.dictKey"
                                class="activity-option"
                            ></el-option>
@@ -38,12 +38,12 @@
                    <div class="category">选择时间:</div>
                    <div class="category-value">
                        <!-- <el-date-picker
                                        size="small"
                                        v-model="selectTime"
                                        type="date"
                                        placeholder="选择日期"
                                        style="width:268px"
                                    ></el-date-picker>-->
                                                                                    size="small"
                                                                                    v-model="selectTime"
                                                                                    type="date"
                                                                                    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"
@@ -141,10 +141,10 @@
                    <ul>
                        <li>
                            <!-- <el-button
                                        title="路线绘制"
                                        @click="draw('billboard', 'policeman')"
                                        icon="el-icon-my-route"
                                        ></el-button>-->
                                                                                    title="路线绘制"
                                                                                    @click="draw('billboard', 'policeman')"
                                                                                    icon="el-icon-my-route"
                                                                                    ></el-button>-->
                            <button @click="draw('polyline', 'policecar')" title="巡逻路线">
                                <img src="../../../public/img/icon/route1.png" style="height:100%" />
                            </button>
@@ -1399,7 +1399,7 @@
                        }
                    })
                }
            },{material: global.DC.Color.RED})
            }, { material: global.DC.Color.RED })
        },
        // 删除所有地图绘制元素
@@ -1431,7 +1431,7 @@
                            }
                        })
                    }
                },{material: global.DC.Color.RED})
                }, { material: global.DC.Color.RED })
            } else {
                arrowPlot && arrowPlot.draw(type, overlay => {
                    if (overlay) {
@@ -1455,7 +1455,7 @@
                            this.addSecurityPlot(this.showingSecurityId, position, plotType)
                        })
                    }
                },{material: global.DC.Color.RED})
                }, { material: global.DC.Color.RED })
            }
        },
@@ -1463,9 +1463,13 @@
            drawArrowLayers.clear()
        },
        // 播放轨迹
        /**
         * @description: 轨迹开始
         * @return {*}
         */
        play () {
            // polylineAreaLayer.show = true
            tc.play()
            this.view('1', -20, 400)
        },
@@ -1926,18 +1930,34 @@
            }
        },
        // 观看视频
        /**
         * @description: 轨迹点击弹窗中,查看视频
         * @return {*}
         */
        watchVideo () {
            const line = this.$turf.lineString(this.linePosition.split(';').filter(item => item != '').map(item => item.split(',').map(i => Number(i))))
            // const lineLength = this.$turf.length(line) * 1000
            const chunkLine = this.$turf.lineChunk(line, 0.1)
            let newPostion = chunkLine.features.reduce((pre, cur) =>
                pre.concat(cur.geometry.coordinates)
            , [])
            newPostion = newPostion.filter((item, index) => index == newPostion.lastIndexOf(item))
            this.getRegionList(this.polygonPosition)
            this.videoShow = true
            if (tc) {
                tc.clear()
            }
            tc = new global.DC.TrackController(global.viewer)
            track = new global.DC.Track(this.linePosition, 15)
            track = new global.DC.Track(newPostion, 100)
            track.setModel('/model/qiche.gltf', {
                scale: 0.5
            })
            tc.addTrack(track)
            this.lineEditVisible = false
        },