| | |
| | | <template> |
| | | <div class="container"> |
| | | <div class="header"> |
| | | <div class="bottom-title"> |
| | | 警情动态 |
| | | <div class="history-tab"> |
| | | <span |
| | | class="beforetime" |
| | | :class="{ choosed: historytype == 0 }" |
| | | @click="historyTabClick(0)" |
| | | >实时</span> |
| | | <span |
| | | class="beforetime" |
| | | :class="{ choosed: historytype == 1 }" |
| | | @click="historyTabClick(1)" |
| | | >历史</span> |
| | | </div> |
| | | <div class="timeTab"> |
| | | <span class="beforetime" :class="{ choosed: timetype == 0 }" @click="timeTabClick(0)">周</span> |
| | | <span class="beforetime" :class="{ choosed: timetype == 1 }" @click="timeTabClick(1)">月</span> |
| | | <div class="bottom-title">警情动态</div> |
| | | <div class="timeTab" v-show="historytype"> |
| | | <span |
| | | class="beforetime" |
| | | :class="{ choosed: timetype == 0 }" |
| | | @click="timeTabClick(0)" |
| | | >周</span> |
| | | <span |
| | | class="beforetime" |
| | | :class="{ choosed: timetype == 1 }" |
| | | @click="timeTabClick(1)" |
| | | >月</span> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | <span class="callContent">报警内容</span> |
| | | </li> |
| | | </ul> |
| | | <vue-seamless-scroll :data="timetype == 0 ? policeSituationWeekArr : policeSituationMouthArr" class="warp"> |
| | | <vue-seamless-scroll |
| | | :data="historytype == 0 ? policeSituationRealtimeArr : policeSituationHistoryArr" |
| | | class="warp" |
| | | > |
| | | <ul class="item"> |
| | | <li v-for="(item, index) in (timetype == 0 ? policeSituationWeekArr : policeSituationMouthArr)" |
| | | :key="index" :data-obj="JSON.stringify(item)" class="row"> |
| | | <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> |
| | | <span class="type" v-text="item.type"></span> |
| | | <span class="state" v-text="item.state"></span> |
| | |
| | | |
| | | <script> |
| | | import vueSeamlessScroll from 'vue-seamless-scroll' |
| | | import weekArr from '@/assets/data/policeSituationArr/weekArr.js' |
| | | import mouthArr from '@/assets/data/policeSituationArr/mouthArr.js' |
| | | import realtimeArr from '@/assets/data/policeSituationArr/realtimeArr.js' |
| | | import historyArr from '@/assets/data/policeSituationArr/historyArr.js' |
| | | |
| | | export default { |
| | | data () { |
| | | return { |
| | | timetype: 0, |
| | | policeSituationWeekArr: [], |
| | | policeSituationMouthArr: [] |
| | | historytype: 0, |
| | | policeSituationRealtimeArr: [], |
| | | policeSituationHistoryArr: [] |
| | | } |
| | | }, |
| | | |
| | |
| | | }, |
| | | |
| | | created () { |
| | | this.policeSituationWeekArr = weekArr |
| | | this.policeSituationMouthArr = mouthArr |
| | | this.policeSituationRealtimeArr = realtimeArr |
| | | this.policeSituationHistoryArr = historyArr |
| | | }, |
| | | |
| | | mounted () { |
| | |
| | | methods: { |
| | | timeTabClick (type) { |
| | | this.timetype = type |
| | | }, |
| | | |
| | | historyTabClick (type) { |
| | | this.historytype = type |
| | | this.$emit('changePoliceSituationType', type) |
| | | this.$emit('policeSituationChange') |
| | | |
| | | }, |
| | | |
| | | selectPoliceSituatiionArr (name) { |
| | | if (name == '全部') { |
| | | this.policeSituationWeekArr = weekArr |
| | | this.policeSituationMouthArr = mouthArr |
| | | this.policeSituationRealtimeArr = realtimeArr |
| | | this.policeSituationHistoryArr = historyArr |
| | | } else { |
| | | let weekNewArr = [] |
| | | let mouthNewArr = [] |
| | | weekArr.forEach(item => { |
| | | realtimeArr.forEach(item => { |
| | | if (item.policeName == name) { |
| | | weekNewArr.push(item) |
| | | } |
| | | }) |
| | | this.policeSituationWeekArr = weekNewArr |
| | | mouthArr.forEach(item => { |
| | | this.policeSituationRealtimeArr = weekNewArr |
| | | historyArr.forEach(item => { |
| | | if (item.policeName == name) { |
| | | mouthNewArr.push(item) |
| | | } |
| | | }) |
| | | this.policeSituationMouthArr = mouthNewArr |
| | | this.policeSituationHistoryArr = mouthNewArr |
| | | } |
| | | }, |
| | | |
| | |
| | | line-height: 36px; |
| | | color: #fff; |
| | | text-align: center; |
| | | background: #3366e2 |
| | | background: #3366e2; |
| | | } |
| | | |
| | | .bottom-title::after { |
| | |
| | | overflow: hidden; |
| | | |
| | | span { |
| | | width: 42px; |
| | | padding: 0 10px; |
| | | height: 26px; |
| | | text-align: center; |
| | | line-height: 26px; |
| | | background: rgb(1, 76, 137); |
| | | } |
| | | |
| | | .beforetime { |
| | | color: rgb(98, 95, 95); |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .choosed { |
| | | color: #fff; |
| | | } |
| | | } |
| | | .history-tab { |
| | | position: absolute; |
| | | top: 10px; |
| | | left: 10px; |
| | | display: flex; |
| | | border-radius: 6px; |
| | | overflow: hidden; |
| | | span { |
| | | padding: 0 10px; |
| | | height: 26px; |
| | | text-align: center; |
| | | line-height: 26px; |