shuishen
2023-01-05 12ab2dadb99853277dfa5d17a8090fe208a7599f
警情相关更改
3 files modified
319 ■■■■■ changed files
src/api/home/index.js 9 ●●●● patch | view | raw | blame | history
src/components/map/components/mapPopup.vue 76 ●●●●● patch | view | raw | blame | history
src/views/home/components/bottomContainer.vue 234 ●●●●● patch | view | raw | blame | history
src/api/home/index.js
@@ -2,7 +2,7 @@
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2022-12-27 14:19:19
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2023-01-03 16:02:57
 * @LastEditTime: 2023-01-05 15:16:20
 * @FilePath: \srs-police-affairs\src\api\home\index.js
 * @Description: 
 * 
@@ -28,6 +28,13 @@
    })
}
export const getAnswerPolices = () => {
    return request({
        url: `/api/doorplate/doorplate/acceptAlarmList`,
        method: 'get',
        params: {}
    })
}
export const getCallPolices = () => {
    return request({
src/components/map/components/mapPopup.vue
@@ -16,6 +16,10 @@
                                    详细信息
                                    <div class="close" @click="closePopup" title="关闭"></div>
                                </div>
                                <div class="change-btn">
                                    <div class="on">接警信息</div>
                                    <div>出警信息</div>
                                </div>
                                <div class="label-content">
                                    <div class="item">
                                        <div>警情类别:</div>
@@ -89,28 +93,6 @@
</script>
<style lang="scss" scoped>
// .item {
//     display: flex;
//     flex-direction: row;
//     width: calc(100% - 20px);
//     height: 30px;
//     line-height: 30px;
//     margin: 0 10px;
//     text-align: left;
//     &>div:first-child {
//         width: 100px;
//         text-align: justify;
//         display: inline-block;
//         text-align-last: justify;
//         margin-right: 20px;
//     }
//     &>div:nth-of-type(2) {
//         width: calc(100% - 120px);
//     }
// }
.divForms-dom {
    position: fixed;
    left: 0;
@@ -223,6 +205,52 @@
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    .change-btn {
        margin-top: 6px;
        display: flex;
        align-items: center;
        justify-content: space-around;
        &>div {
            width: 36%;
            height: 36px;
            line-height: 36px;
            cursor: pointer;
        }
        &>div.on {
            border-bottom: 2px solid #1831a7;
        }
    }
    .label-content {
        padding: 4px 0;
        .item {
            display: flex;
            flex-direction: row;
            width: calc(100% - 20px);
            height: 30px;
            line-height: 30px;
            margin: 0 10px;
            text-align: left;
            &>div:first-child {
                width: 96px;
                text-align: justify;
                display: inline-block;
                text-align-last: justify;
                margin-right: 20px;
            }
            &>div:nth-of-type(2) {
                width: calc(100% - 120px);
            }
        }
    }
}
.divForms .title {
@@ -254,10 +282,6 @@
    background-image: linear-gradient(135deg,
            transparent 25px,
            #1c309e9a 25px);
}
.divForms .label-content {
    padding: 4px 0;
}
.divForms-theme .arrow,
src/views/home/components/bottomContainer.vue
@@ -8,9 +8,17 @@
                    <span class="beforetime" :class="{ choosed: timetype == 1 }" @click="timeTabClick(1)">月</span>
                </div>
                <div class="timeSeclect" v-show="historytype">
                    <el-date-picker v-model="eventTime" type="daterange" align="right" unlink-panels range-separator="至"
                        start-placeholder="开始日期" end-placeholder="结束日期"
                        :picker-options="pickerOptions"></el-date-picker>
                    <!-- <el-date-picker v-model="eventTime" type="daterange" align="right" unlink-panels range-separator="至"
                        start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker> -->
                    <el-date-picker @change="datePickerChange" v-show="timetype == 0" v-model="currentTime" type="week"
                        format="yyyy 第 WW 周" :picker-options="pickerOptions" placeholder="选择周">
                    </el-date-picker>
                    <el-date-picker @change="datePickerChange" v-show="timetype == 1" v-model="currentTime" type="month"
                        :picker-options="pickerOptions" placeholder="选择月">
                    </el-date-picker>
                </div>
                <div class="history-tab">
                    <span class="beforetime" :class="{ choosed: historytype == 0 }"
@@ -25,34 +33,40 @@
                <ul class="title-header">
                    <li>
                        <span class="num">序号</span>
                        <span class="type">报警类别</span>
                        <span class="out-people">出动人员</span>
                        <span class="out-car">出动车辆</span>
                        <span class="receiving-alarm-unit">接警单位</span>
                        <span class="receiving-alarm-people">接警员</span>
                        <span class="receiving-alarm-time">接警时间</span>
                        <span class="arrive-time">到达现场时间</span>
                        <span class="dispose-time">处理完毕时间</span>
                        <span class="police-unit">处警单位</span>
                        <span class="out-police-bz">备注</span>
                        <span class="call-people">报警人</span>
                        <span class="call-phone">联系电话</span>
                        <span class="call-police-content">报警内容</span>
                        <span class="incident-site">事发地址</span>
                        <span class="call-police-type">报警类型</span>
                        <span class="alarm-bz">备注</span>
                    </li>
                </ul>
                <vue-seamless-scroll :data="historytype == 0 ? policeSituationRealtimeArr : policeSituationHistoryArr"
                    class="warp" :class-option="classOption">
                <vue-seamless-scroll v-if="currentUseDataLength > 0" :data="listCurrentData" class="warp"
                    :class-option="classOption">
                    <ul class="item">
                        <li v-for="(item, index) in (historytype == 0 ? policeSituationRealtimeArr : policeSituationHistoryArr)"
                            :key="index" :data-obj="JSON.stringify(item)" class="row">
                            <!-- <span class="num" v-text="item.num"></span> -->
                        <li v-for="(item, index) in listCurrentData" :key="index" :data-obj="JSON.stringify(item)"
                            class="row">
                            <span class="num" v-text="index + 1"></span>
                            <span class="type" v-text="item.type"></span>
                            <span class="out-people" v-text="item.dealTime"></span>
                            <span class="out-car" v-text="item.state"></span>
                            <span class="receiving-alarm-time" v-text="item.dealPolice"></span>
                            <span class="arrive-time" v-text="item.callPeople"></span>
                            <span class="dispose-time" v-text="item.comingPhone"></span>
                            <span class="police-unit" v-text="item.callPhone"></span>
                            <span class="out-police-bz" v-text="item.callContent"></span>
                            <span class="receiving-alarm-unit" v-text="JJDWMC"></span>
                            <span class="receiving-alarm-people" v-text="JJYXM"></span>
                            <span class="receiving-alarm-time" v-text="JJSJ"></span>
                            <span class="call-people" v-text="BJRXM"></span>
                            <span class="call-phone" v-text="LXDH"></span>
                            <span class="call-police-content" v-text="BJNR"></span>
                            <span class="incident-site" v-text="SFDZ"></span>
                            <span class="call-police-type" v-text="BJLX"></span>
                            <span class="alarm-bz" v-text="MEMO"></span>
                        </li>
                    </ul>
                </vue-seamless-scroll>
                <div class="warp no-data" v-else>
                    暂无数据
                </div>
            </div>
        </div>
@@ -89,10 +103,9 @@
<script>
import vueSeamlessScroll from 'vue-seamless-scroll'
import realtimeArr from '@/assets/data/policeSituationArr/realtimeArr.js'
import historyArr from '@/assets/data/policeSituationArr/historyArr.js'
import { getCallPolices } from "@/api/home/index.js"
import { getCallPolices, getAnswerPolices } from "@/api/home/index.js"
export default {
    data () {
@@ -103,33 +116,8 @@
            policeSituationHistoryArr: [],
            policeSituationHistorySaveArr: [],
            eventTime: '',
            pickerOptions: {
                shortcuts: [{
                    text: '最近一周',
                    onClick (picker) {
                        const end = new Date()
                        const start = new Date()
                        start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
                        picker.$emit('pick', [start, end])
                    }
                }, {
                    text: '最近一个月',
                    onClick (picker) {
                        const end = new Date()
                        const start = new Date()
                        start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
                        picker.$emit('pick', [start, end])
                    }
                }, {
                    text: '最近三个月',
                    onClick (picker) {
                        const end = new Date()
                        const start = new Date()
                        start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
                        picker.$emit('pick', [start, end])
                    }
                }]
            },
            currentTime: '',
            pickerOptions: {}, // 日期设置对象
            classOption: {
                step: 1
            }
@@ -142,12 +130,43 @@
        vueSeamlessScroll
    },
    computed: {
        listCurrentData () {
            if (this.historytype == 0) {
                return this.policeSituationRealtimeArr
            } else {
                return this.policeSituationHistoryArr
            }
        },
        currentUseDataLength () {
            if (this.historytype == 0) {
                return this.policeSituationRealtimeArr.length
            } else {
                return this.policeSituationHistoryArr.length
            }
        }
    },
    created () {
        this.policeSituationRealtimeArr = realtimeArr
        this.policeSituationHistoryArr = historyArr
        this.policeSituationHistorySaveArr = historyArr
        this.getCallPolices()
        setInterval(() => {
            console.log(this.currentTime)
        }, 5000)
        // disabledDate 为true表示不可选,false表示可选
        this.pickerOptions = {
            disabledDate (time) {
                // 设置可选择的日期为今天之后的一个月内
                let curDate = (new Date()).getTime()
                return time.getTime() > curDate
            }
        }
    },
    mounted () {
@@ -163,12 +182,44 @@
    },
    methods: {
        datePickerChange (e) {
            // this.timetype
            const dateStr = this.dateFormat(e)
        },
        // 获取当前日期
        dateFormat (dateData) {
            var date = new Date(dateData)
            var y = date.getFullYear()
            var m = date.getMonth() + 1
            m = m < 10 ? ('0' + m) : m
            var d = date.getDate()
            d = d < 10 ? ('0' + d) : d
            const time = y + '-' + m + '-' + d
            return time
        },
        getCallPolices () {
            getCallPolices().thne(res => {
                setTimeout(() => {
                    console.log(res, 465464)
                }, 5000)
            })
            // getCallPolices().then(res => {
            //     res.data.result
            // })
            // getAnswerPolices().then(res => {
            //     this.policeSituationRealtimeArr = res.data.result
            // })
            this.policeSituationRealtimeArr = [
                {
                    JJDW: '公安局',
                    lat: 28,
                    lng: 112
                },
                {
                    JJDW: '派出所'
                },
            ]
        },
        timeTabClick (type) {
@@ -186,31 +237,6 @@
            this.historytype = type
            this.$emit('changePoliceSituationHistoryType', type)
            this.$emit('policeSituationChange')
        },
        selectPoliceSituatiionArr (name) {
            if (name == '全部') {
                this.policeSituationRealtimeArr = realtimeArr
                this.policeSituationHistoryArr = historyArr
                this.timeTabClick(this.timetype)
            } else {
                let realtimeNewArr = []
                let historyNewArr = []
                realtimeArr.forEach(item => {
                    if (item.policeName == name) {
                        realtimeNewArr.push(item)
                    }
                })
                this.policeSituationRealtimeArr = realtimeNewArr
                historyArr.forEach(item => {
                    if (item.policeName == name) {
                        historyNewArr.push(item)
                    }
                })
                this.policeSituationHistorySaveArr = historyNewArr
                this.policeSituationHistoryArr = historyNewArr
                this.timeTabClick(this.timetype)
            }
        },
        chooseWeekTimeDate (arr) {
@@ -399,6 +425,12 @@
            height: calc(100% - 44px);
        }
        .warp.no-data {
            display: flex;
            align-items: center;
            justify-content: center;
        }
        ul {
            li {
                height: 44px;
@@ -410,35 +442,39 @@
                    width: 6%;
                }
                .type {
                    width: 10%;
                .receiving-alarm-unit {
                    width: 12%;
                }
                .out-people {
                    width: 10%;
                }
                .out-car {
                    width: 10%;
                .receiving-alarm-people {
                    width: 8%;
                }
                .receiving-alarm-time {
                    width: 10%;
                }
                .call-people {
                    width: 8%;
                }
                .call-phone {
                    width: 8%;
                }
                .call-police-content {
                    width: 12%;
                }
                .arrive-time {
                .incident-site {
                    width: 12%;
                }
                .dispose-time {
                    width: 12%;
                .call-police-type {
                    width: 8%;
                }
                .police-unit {
                    width: 12%;
                }
                .out-police-bz {
                .alarm-bz {
                    flex: 1;
                }
            }