guanqb
2023-04-07 fba0b4cdc5d070394fc64b34d9e50ca65c23e0a6
src/views/home/components/bottomContainer.vue
@@ -2,7 +2,7 @@
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2023-01-13 15:52:59
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2023-04-05 03:59:40
 * @LastEditTime: 2023-04-06 18:10:22
 * @FilePath: \srs-police-affairs\src\views\home\components\bottomContainer.vue
 * @Description: 
 * 
@@ -39,12 +39,12 @@
                </div>
            </div>
            <div class="body" v-if="historytype == 0" ref="tableBox" @click="handleSelectClick($event)">
            <div class="body" v-if="historytype == 0" ref="tableBox">
                <ul class="title-header">
                    <li>
                        <span class="num">序号</span>
                        <span class="receiving-alarm-unit">接警单位</span>
                    <span class="receiving-alarm-time">报警时间</span>
                        <span class="receiving-alarm-time">报警时间</span>
                        <span class="call-police-content">报警内容</span>
                        <span class="incident-site">事发地址</span>
                        <span class="call-police-type">报警类型</span>
@@ -53,22 +53,24 @@
                    </li>
                </ul>
                <!-- <vue-seamless-scroll v-if="policeSituationRealtimeArr.length > 0" :data="policeSituationRealtimeArr"
                                                                                                                                                                    class="warp" :class-option="classOption"> -->
                <!-- <vue-seamless-scroll v-if="policeSituationRealtimeArr.length > 0" :data="policeSituationRealtimeArr" class="warp" :class-option="classOption"> -->
                <div v-if="policeSituationRealtimeArr.length > 0" :data="policeSituationRealtimeArr" class="warp"
                    :class-option="classOption">
                    <el-carousel indicator-position="none" direction="vertical" @change="changeAlarm">
                        <el-carousel-item v-for="item in alarmPageCount" :key="item">
                            <ul class="item">
                                <li v-for="(item, index) in policeSituationRealtimeArr" :key="index"
                                    :data-obj="JSON.stringify(item)" class="row">
                                <li v-for="(item, index) in policeSituationRealtimeArr" :key="index" class="row"
                                    @click.stop="handleSelectClick(item)">
                                    <span class="num" v-text="item.index"></span>
                                    <span class="receiving-alarm-unit" v-text="item.JJDWMC"></span>
                                    <span class="receiving-alarm-time" v-text="item.BJSJ"></span>
                                    <span class="call-police-content" :title="item.BJNR" v-text="item.BJNR"></span>
                                    <span class="incident-site" :title="item.SFDZ" v-text="item.SFDZ"></span>
                                    <span class="call-police-type" v-text="item.BJLX"></span>
                                    <span class="have-position" v-text="item.position"></span>
                                    <span class="have-position">
                                        <i v-show="item.position == '有'" class="el-icon-location" style="color: #1AFA29;"
                                            @click.stop="policeSituationClick(item)"></i>
                                    </span>
                                    <span class="alarm-bz" v-text="item.MEMO"></span>
                                </li>
                            </ul>
@@ -85,7 +87,7 @@
                <el-table :data="policeSituationHistoryArr" :key="currentPage" style="width: 100%"
                    :height="currentTableHeight"
                    :header-cell-style="{ 'text-align': 'center', 'background-color': 'rgba(9, 40, 199, 0.5)', 'borderColor': '#324e75' }"
                    :cell-style="{ 'text-align': 'center', 'borderColor': '#324e75' }" @cell-click="rowClick">
                    :cell-style="{ 'text-align': 'center', 'borderColor': '#324e75' }" @cell-click="handleSelectClick">
                    <el-table-column :show-overflow-tooltip="true" prop="index" label="序号" width="60"></el-table-column>
                    <el-table-column :show-overflow-tooltip="true" prop="JJDWMC" label="接警单位"></el-table-column>
                    <el-table-column prop="BJSJ" label="报警时间">
@@ -93,7 +95,14 @@
                    <el-table-column :show-overflow-tooltip="true" prop="BJNR" label="报警内容"></el-table-column>
                    <el-table-column :show-overflow-tooltip="true" prop="SFDZ" label="事发地址"></el-table-column>
                    <el-table-column :show-overflow-tooltip="true" prop="BJLX" label="报警类型"></el-table-column>
                    <el-table-column :show-overflow-tooltip="true" prop="position" label="坐标" width="60"></el-table-column>
                    <el-table-column :show-overflow-tooltip="true" prop="position" label="坐标" width="60">
                        <template slot-scope="scope">
                            <el-button v-show="scope.row.position == '有'" @click.stop="policeSituationClick(scope.row)"
                                type="text" size="small" title="定位">
                                <i class="el-icon-location" style="color: #1AFA29;"></i>
                            </el-button>
                        </template>
                    </el-table-column>
                    <el-table-column :show-overflow-tooltip="true" prop="MEMO" label="备注"></el-table-column>
                </el-table>
@@ -247,11 +256,6 @@
            })
        },
        // table行点击事件
        rowClick (row) {
            this.policeSituationClick(row)
        },
        // 分页选择事件
        handleCurrentChange: function (currentPage) {
            this.currentPage = currentPage
@@ -275,7 +279,6 @@
            }
        },
        // 设置默认时间
        defaultDate () {
@@ -339,6 +342,10 @@
                    this.alarmPageCount = Math.ceil(res.data.length / this.alarmPageSize)
                    this.policeSituationRealtimeAllArr = res.data.map((item, index) => {
                        const bjlxText = BjlxData.filter(i => item.BJLX == i.BJLX)[0].VALUE || ''
                        if (item.JJDWMC.indexOf('上饶市公安局') != -1) item.JJDWMC = item.JJDWMC.replace(/上饶市公安局/, '市局')
                        if (item.JJDWMC.indexOf('信州区分局') != -1) item.JJDWMC = item.JJDWMC.replace(/信州区分局/, '')
                        if (item.JJDWMC.indexOf('信州') != -1) item.JJDWMC = item.JJDWMC.replace(/信州/, '')
                        return { ...item, index: index + 1, lng: item.ZDDWXZB, lat: item.ZDDWYZB, position: item.ZDDWYZB && item.ZDDWYZB != 0 ? '有' : '无', BJLX: bjlxText }
                    })
@@ -472,6 +479,10 @@
                if (res.data.data.records.length > 0) {
                    this.policeSituationHistoryArr = res.data.data.records.map((item, index) => {
                        const bjlxText = BjlxData.filter(i => item.BJLX == i.BJLX)[0].VALUE || ''
                        if (item.JJDWMC.indexOf('上饶市公安局') != -1) item.JJDWMC = item.JJDWMC.replace(/上饶市公安局/, '市局')
                        if (item.JJDWMC.indexOf('信州区分局') != -1) item.JJDWMC = item.JJDWMC.replace(/信州区分局/, '')
                        if (item.JJDWMC.indexOf('信州') != -1) item.JJDWMC = item.JJDWMC.replace(/信州/, '')
                        return { ...item, index: index + 1, lng: item.ZDDWXZB, lat: item.ZDDWYZB, position: item.ZDDWYZB && item.ZDDWYZB != 0 ? '有' : '无', BJLX: bjlxText }
                    })
@@ -643,51 +654,40 @@
        },
        // 列表行选择
        handleSelectClick (e) {
            let element
            for (let i = 0; i < e.path.length; i++) {
                if (e.path[i].className == "row") {
                    element = e.path[i]
                    break
                }
            }
            let currentItem = JSON.parse(element.dataset.obj)
            this.policeSituationClick(currentItem)
        handleSelectClick (item) {
            this.$emit('policeSituationSiteClick', item)
        },
        // 点击定位或者显示弹窗
        policeSituationClick (item) {
            if (item.ZDDWXZB && item.ZDDWXZB != 0 && item.ZDDWYZB && item.ZDDWYZB != 0) {
                this.$EventBus.$emit('toPosition', {
                    layerName: 'policeSituationyLayers',
                    siteJd: Number(item.ZDDWXZB),
                    siteWd: Number(item.ZDDWYZB)
                })
                this.$store.commit('SET_DETAILSPOPUP', {
                    showBox: true,
                    showBtn: true
                })
            console.log(item, 959999)
                this.$store.commit('SET_DATAPOPUP', item)
            this.$EventBus.$emit('toPosition', {
                layerName: 'policeSituationyLayers',
                siteJd: Number(item.ZDDWXZB),
                siteWd: Number(item.ZDDWYZB)
            })
                var popup = new global.DC.DivForms(global.viewer, {
                    domId: 'divFormsDomBox',
                    position: [
                        global.DC.Transform.transformWGS84ToCartesian(
                            new global.DC.Position(
                                Number(item.ZDDWXZB),
                                Number(item.ZDDWYZB),
                                0
                            )
            this.$store.commit('SET_DETAILSPOPUP', {
                showBox: true,
                showBtn: true
            })
            this.$store.commit('SET_DATAPOPUP', item)
            var popup = new global.DC.DivForms(global.viewer, {
                domId: 'divFormsDomBox',
                position: [
                    global.DC.Transform.transformWGS84ToCartesian(
                        new global.DC.Position(
                            Number(item.ZDDWXZB),
                            Number(item.ZDDWYZB),
                            0
                        )
                    ]
                })
            } else {
                this.$emit('policeSituationSiteClick', item)
            }
                    )
                ]
            })
        }
    },