Commit d23f7737 authored by 郭铭瑶's avatar 郭铭瑶 🤘

区分街镇

parent 3da9fa44
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
</body> </body>
<script src="./static/hls.js"></script> <script src="./static/hls.js"></script>
<!-- <script src="./static/SMap.min.js"></script> --> <script src="./static/SMap.min.js"></script>
<script src="./static/esm/SMap.min.js"></script> <!-- <script src="./static/esm/SMap.min.js"></script> -->
<script src="./static/Plugins.min.js"></script> <script src="./static/Plugins.min.js"></script>
</html> </html>
...@@ -122,6 +122,7 @@ export default { ...@@ -122,6 +122,7 @@ export default {
strokeWeight, strokeWeight,
label, label,
}) })
// console.log('000', this.map, polygon)
this.map.add(polygon) this.map.add(polygon)
}, },
// 添加边界 // 添加边界
......
...@@ -8,7 +8,7 @@ Vue.use(Router) ...@@ -8,7 +8,7 @@ Vue.use(Router)
export default new Router({ export default new Router({
routes: [ routes: [
{ {
path: '/', path: '*',
name: 'main', name: 'main',
component: Main, component: Main,
}, },
......
...@@ -2,17 +2,18 @@ import ajax from '@/server/ajax' ...@@ -2,17 +2,18 @@ import ajax from '@/server/ajax'
import api from '@/server/api' import api from '@/server/api'
import com from '@/util/common' import com from '@/util/common'
import moment from 'moment' import moment from 'moment'
const curStreet = '新江湾城街道' let curStreet = '新江湾城街道'
let streetId = null let streetId = null
export default { export default {
initData({dispatch, state}) { initData({dispatch, state}) {
streetId = state.currentStreetInfo.id streetId = state.currentStreetInfo.id
curStreet = state.currentStreetInfo.name
dispatch('getGreenInfo') dispatch('getGreenInfo')
dispatch('getDiscoverTrend') dispatch('getDiscoverTrend')
dispatch('getRepairRate') dispatch('getRepairRate')
dispatch('getResourceSum') dispatch('getResourceSum')
// dispatch('getCheckSum') dispatch('getCheckSum')
dispatch('getGridSum') dispatch('getGridSum')
dispatch('getPopulationInfo') dispatch('getPopulationInfo')
dispatch('getPatrolList') dispatch('getPatrolList')
...@@ -57,11 +58,11 @@ export default { ...@@ -57,11 +58,11 @@ export default {
commit('SET_RESOURCE_SUM', com.confirm(res, 'data.content', {})) commit('SET_RESOURCE_SUM', com.confirm(res, 'data.content', {}))
}) })
}, },
// getCheckSum({commit}) { getCheckSum({commit}) {
// ajax.get({url: api.GET_CHECK_SUM}).then(res => { ajax.get({url: api.GET_CHECK_SUM, params: {streetId}}).then(res => {
// commit('SET_CHECK_SUM', com.confirm(res, 'data.content', {})) commit('SET_CHECK_SUM', com.confirm(res, 'data.content', {}))
// }) })
// }, },
async getGridSum({commit}) { async getGridSum({commit}) {
const start = moment().add(-10, 'days').format('YYYY-MM-DD') const start = moment().add(-10, 'days').format('YYYY-MM-DD')
const end = moment().format('YYYY-MM-DD') const end = moment().format('YYYY-MM-DD')
...@@ -82,9 +83,11 @@ export default { ...@@ -82,9 +83,11 @@ export default {
commit('SET_LAND_POPULATION_INFO', result) commit('SET_LAND_POPULATION_INFO', result)
} }
}, },
getPatrolList({commit}) { getPatrolList({commit, state}) {
let result = []
setTimeout(() => { setTimeout(() => {
const result = [ if (state.currentStreetInfo.id === 310110020000) { // 新江湾数据
result = [
{ {
name: '建发新江湾华苑二期', name: '建发新江湾华苑二期',
event: '未落实每日自查', event: '未落实每日自查',
...@@ -129,6 +132,7 @@ export default { ...@@ -129,6 +132,7 @@ export default {
y: 8474.801 y: 8474.801
} }
] ]
}
commit('SET_PATROL_LIST', result) commit('SET_PATROL_LIST', result)
}, 3000) }, 3000)
}, },
...@@ -166,7 +170,11 @@ export default { ...@@ -166,7 +170,11 @@ export default {
}) })
}, },
getHandleList({commit}) { // 获取并全局设置联勤联动处置列表 getHandleList({commit}) { // 获取并全局设置联勤联动处置列表
ajax.get({url: api.GET_HANDLE_LIST, params: {streetId}}).then(res => { ajax.get({url: api.GET_HANDLE_LIST, params: {state_ne: 5, streetId}}).then(res => {
// const data = com.confirm(res, 'data.content', [])
// if (data.length === 0) {
// console.log('=========', res, moment().format('MM-DD HH:mm:ss'), '============')
// }
commit('SET_HANDLE_LIST', com.confirm(res, 'data.content', [])) commit('SET_HANDLE_LIST', com.confirm(res, 'data.content', []))
}) })
}, },
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -23,7 +23,10 @@ ...@@ -23,7 +23,10 @@
<m-step class="combine-step" :steps="steps" :current="getCurrent(item)" /> <m-step class="combine-step" :steps="steps" :current="getCurrent(item)" />
</div> </div>
</m-scroll> </m-scroll>
<div v-else class="no-data">— 暂无数据 —</div> <div v-else class="no-data">
<img src="@/assets/images/building.png" />
<p>— 暂无数据 —</p>
</div>
</div> </div>
</template> </template>
...@@ -64,9 +67,14 @@ export default { ...@@ -64,9 +67,14 @@ export default {
<style lang="stylus" scoped> <style lang="stylus" scoped>
.combine .combine
.no-data .no-data
$flex-center()
flex-direction column
width 100% width 100%
height 100% height 100%
$flex-center() color #999
img
width .35rem
height @width
.detail .detail
background $section-bg background $section-bg
padding .05rem .1rem .2rem padding .05rem .1rem .2rem
......
...@@ -14,22 +14,24 @@ ...@@ -14,22 +14,24 @@
<script> <script>
export default { export default {
name: 'Command', name: 'Command',
data() { computed: {
return { list() {
list: [ const {currentStreetInfo, streetInfo} = this.$store.state
const {master1, master2} = streetInfo[currentStreetInfo.id]
return [
{ {
img: 'command1.png', img: 'command1.png',
label: '指挥长', label: '指挥长',
name: '卞洪斌', name: master1,
}, },
{ {
img: 'command2.png', img: 'command2.png',
label: '值班长', label: '值班长',
name: '丁建新', name: master2,
}, },
] ]
}
}, },
}
} }
</script> </script>
......
<template> <template>
<div class="defense"> <div class="defense">
<p>民防建筑总数 <m-count style="color:#6ae7b5" :value="190" :decimal="0"/>/<m-count :value="208" :decimal="0"/></p> <p>民防建筑总数 <m-count style="color:#6ae7b5" :value="data.num" :decimal="0"/>/<m-count :value="data.totalNum" :decimal="0"/></p>
<div class="bar"> <div class="bar">
<div class="inner green" style="background:#6ae7b5;width:91%;"></div> <div class="inner green" :style="`background:#6ae7b5;width:${data.num / data.totalNum * 100}%;`"></div>
</div> </div>
<p>使用面积 <m-count style="color:#ff9502" :value="308433" /> <span class="unit"></span></p> <p>使用面积 <m-count style="color:#ff9502" :value="data.area" /> <span class="unit"></span></p>
<p>建筑面积 <m-count :value="606413.35" /> <span class="unit"></span></p> <p>建筑面积 <m-count :value="data.totalArea" /> <span class="unit"></span></p>
<div class="bar"> <div class="bar">
<div class="inner red" style="background:#ff9502;width:51%;"></div> <div class="inner red" :style="`background:#ff9502;width:${data.area / data.totalArea * 100}%;`"></div>
</div> </div>
</div> </div>
</template> </template>
...@@ -15,9 +15,12 @@ ...@@ -15,9 +15,12 @@
<script> <script>
export default { export default {
name: 'Defense', name: 'Defense',
computed: {
data() { data() {
return {} const {currentStreetInfo, streetInfo} = this.$store.state
return streetInfo[currentStreetInfo.id]
}, },
}
} }
</script> </script>
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
</div> </div>
</div> </div>
<div class="detail"> <div class="detail">
<m-scroll :length="$store.state.patrolList.length" mode="2" :limit="2" :step="0.75"> <m-scroll v-if="$store.state.patrolList.length > 0" :length="$store.state.patrolList.length" mode="2" :limit="2" :step="0.75">
<div @click="$emit('select', {...item, key: 'patrol'})" class="info" v-for="(item, i) in $store.state.patrolList" :key="item.name+i" :class="{over: item.status === '逾期'}"> <div @click="$emit('select', {...item, key: 'patrol'})" class="info" v-for="(item, i) in $store.state.patrolList" :key="item.name+i" :class="{over: item.status === '逾期'}">
<h5>{{item.name}}</h5> <h5>{{item.name}}</h5>
<div> <div>
...@@ -30,6 +30,10 @@ ...@@ -30,6 +30,10 @@
<img v-if="item.status === '逾期'" src="@/assets/images/overtime.png" /> <img v-if="item.status === '逾期'" src="@/assets/images/overtime.png" />
</div> </div>
</m-scroll> </m-scroll>
<div v-else class="no-data">
<img src="@/assets/images/building.png" />
<p>— 暂无数据 —</p>
</div>
</div> </div>
</div> </div>
</template> </template>
...@@ -39,16 +43,11 @@ export default { ...@@ -39,16 +43,11 @@ export default {
name: 'Patrol', name: 'Patrol',
computed: { computed: {
sum() { sum() {
// const {totalOrder, undoneOrder, overdueOrder} = this.$store.state.checkSum const {totalOrder, undoneOrder, overdueOrder} = this.$store.state.checkSum
// return [
// {name: '逾期整改单', value: +overdueOrder || 0, unit: '个', img: 'patrol1.png', color: '#ff1e1e'},
// {name: '整改单总数', value: +undoneOrder || 0, unit: '个', img: 'patrol2.png', color: '#fece34'},
// {name: '巡检总数', value: +totalOrder || 0, unit: '次', img: 'patrol3.png', color: '#00beff'},
// ]
return [ return [
{name: '逾期整改单', value: 4, unit: '个', img: 'patrol1.png', color: '#ff1e1e'}, {name: '逾期整改单', value: +overdueOrder || 0, unit: '个', img: 'patrol1.png', color: '#ff1e1e'},
{name: '整改单总数', value: 4, unit: '个', img: 'patrol2.png', color: '#fece34'}, {name: '整改单总数', value: +undoneOrder || 0, unit: '个', img: 'patrol2.png', color: '#fece34'},
{name: '巡检总数', value: 463, unit: '次', img: 'patrol3.png', color: '#00beff'}, {name: '巡检总数', value: +totalOrder || 0, unit: '次', img: 'patrol3.png', color: '#00beff'},
] ]
} }
}, },
...@@ -59,6 +58,15 @@ export default { ...@@ -59,6 +58,15 @@ export default {
.patrol .patrol
display flex display flex
flex-direction column flex-direction column
.no-data
$flex-center()
flex-direction column
width 100%
height 100%
color #999
img
width .35rem
height @width
h5 h5
font-size .1rem font-size .1rem
.sum .sum
......
...@@ -19,7 +19,10 @@ ...@@ -19,7 +19,10 @@
</div> </div>
<div class="chart"> <div class="chart">
<m-chart v-if="discoverTrend.length > 0" :config="config" :data="discoverTrend" :options="options" /> <m-chart v-if="discoverTrend.length > 0" :config="config" :data="discoverTrend" :options="options" />
<div v-else class="no-data">— 暂无数据 —</div> <div v-else class="no-data">
<img src="@/assets/images/building.png" />
<p>— 暂无数据 —</p>
</div>
</div> </div>
</div> </div>
</template> </template>
...@@ -84,9 +87,14 @@ export default { ...@@ -84,9 +87,14 @@ export default {
<style lang="stylus" scoped> <style lang="stylus" scoped>
.smart-discover .smart-discover
.no-data .no-data
$flex-center()
flex-direction column
width 100% width 100%
height 100% height 100%
$flex-center() color #999
img
width .35rem
height @width
.sum .sum
display flex display flex
margin-bottom .05rem margin-bottom .05rem
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<m-form :label-width=".6" :model="patrolData" :layout="patrolLayout" /> <m-form :label-width=".6" :model="patrolData" :layout="patrolLayout" />
</m-modal> </m-modal>
<m-modal title="指挥体系" :value="showCommandModal" @close="$store.commit('SET_COMMAND_MODAL', false)"> <m-modal title="指挥体系" :value="showCommandModal" @close="$store.commit('SET_COMMAND_MODAL', false)">
<m-form :label-width=".7" :model="commandData" :layout="commandLayout" /> <m-form :label-width=".7" :model="streetInfo[currentStreetInfo.id]" :layout="streetInfo[currentStreetInfo.id].layout" />
</m-modal> </m-modal>
<m-modal title="鹰眼监控" v-model="videoModal"> <m-modal title="鹰眼监控" v-model="videoModal">
<VideoComponent v-if="videoModal" :videoSrc="videoSrc" /> <VideoComponent v-if="videoModal" :videoSrc="videoSrc" />
...@@ -172,10 +172,9 @@ export default { ...@@ -172,10 +172,9 @@ export default {
computed: { computed: {
...mapState([ ...mapState([
'currentStreetInfo', 'currentStreetInfo',
'streetInfo',
'curSmartType', 'curSmartType',
'xinjiangwanPaths', 'xinjiangwanPaths',
'commandLayout',
'commandData',
'showCommandModal', 'showCommandModal',
'patrolList', 'patrolList',
'handleList', 'handleList',
...@@ -211,13 +210,18 @@ export default { ...@@ -211,13 +210,18 @@ export default {
}, 1000 * 60 * 1) }, 1000 * 60 * 1)
}, },
init() { init() {
const {name, id} = this.currentStreetInfo
document.querySelector('title').innerText = `${name}城市运行平台`
const {map} = this.$refs const {map} = this.$refs
this.initMapFocus() this.initMapFocus()
map.addPolygon({paths: this.xinjiangwanPaths, fillColor: 'rgba(51,145,255,.3)'})
map.addBoundary({name: '新江湾城'}) map.addPolygon({paths: this.$store.state.streetPaths[id], fillColor: 'rgba(51,145,255,.3)'})
map.addBoundary({name: name})
}, },
initMapFocus() { initMapFocus() {
this.$refs.map.focus(3489.0714111328125, 10384.431030273437, 4.5) const {id} = this.currentStreetInfo
// this.$refs.map.focus(3489.0714111328125, 10384.431030273437, 4.5)
this.$refs.map.focus(...this.$store.state.streetPaths[id][0], 4.5)
}, },
handleMapClick(data) { handleMapClick(data) {
if (data.key === 'patrol') { if (data.key === 'patrol') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment