| | |
| | | <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 }" |
| | |
| | | <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> |
| | | |
| | |
| | | |
| | | <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 () { |
| | |
| | | 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 |
| | | } |
| | |
| | | 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 () { |
| | |
| | | }, |
| | | |
| | | 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) { |
| | |
| | | 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) { |
| | |
| | | height: calc(100% - 44px); |
| | | } |
| | | |
| | | .warp.no-data { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | |
| | | ul { |
| | | li { |
| | | height: 44px; |
| | |
| | | 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; |
| | | } |
| | | } |