Commit 30743bf7 authored by 程卓's avatar 程卓

公共安全除饼图和切换年份换数据,接口完成

parent 3bbe493c
......@@ -43,9 +43,30 @@ export default {
const { content } = (
await ajax.get({ url: api.GET_PUBLICSAFE_NEWFIND })
).data
console.log(content)
const obj = {
done: 0,
doing: 0,
find: 0,
newFind: content.newDiscovery,
}
function format(params: any) {
params.forEach((item: any) => {
obj.find += item.num
switch (item.status) {
case '已结案':
obj.done = item.num
break
case '待处置':
obj.find = item.num
break
default:
break
}
})
}
format(content.caseNum)
// commit('SET_PUBLICSAFE_NEWFIND', publicHouse)
commit('SET_PUBLICSAFE_NEWFIND', obj)
},
// 公共服务 - 门岗值守 - 社会物业和直管公房数据
async GET_PUBLICSAFE_RIGHT_GATE({
......@@ -196,8 +217,7 @@ export default {
const { content } = (
await ajax.get({ url: api.GET_PUBLICSAFE_OUTHOUSEWALL })
).data
console.log(content)
// console.log(content)
commit('SET_PUBLICSAFE_OUTHOUSEWALL_2019', content[0])
commit('SET_PUBLICSAFE_OUTHOUSEWALL_2020', content[1])
},
......@@ -213,7 +233,6 @@ export default {
params: { pageSize: 1000 },
})
).data
console.log(content)
commit('SET_PUBLICSAFE_BUILDINGS', content)
},
// 公共服务 - 房屋外立面饼图
......
......@@ -29,6 +29,7 @@ export interface GlobalStateProps {
pubulicSafeOutHouseWall2020: { [key: string]: number }
pubulicSafeBuildings: unknown[]
pubulicSafePieData: unknown[]
pubulicSafeNewFindNum: { [key: string]: number }
}
export default createStore<GlobalStateProps>({
state,
......
......@@ -113,4 +113,11 @@ export default {
): void {
state.pubulicSafePieData = data
},
SET_PUBLICSAFE_NEWFIND(
// 公共安全-最新发现数
state: GlobalStateProps,
data: { [key: string]: number }
): void {
state.pubulicSafeNewFindNum = data
},
}
......@@ -26,4 +26,5 @@ export default {
pubulicSafeOutHouseWall2020: {},
pubulicSafeBuildings: [],
pubulicSafePieData: [],
pubulicSafeNewFindNum: {},
} as GlobalStateProps
......@@ -17,7 +17,7 @@
<m-count class="count" :value="pubulicSafeHouse.befor" />
<span class="unit"></span>
</p>
<img src="@/assets/images/location.png" />
<!-- <img src="@/assets/images/location.png" /> -->
</div>
<m-progress
v-if="allTrueHouse"
......
<template>
<m-card title="110非警情">
<div>
<m-sub :addition="{ value: 3, unit: '近30mins' }">最新发现</m-sub>
<m-sub :addition="{ value: String(newFind.newFind), unit: '近30mins' }">
最新发现
</m-sub>
<Brief :list="sumList" />
<div v-if="showChart" class="chart">
<m-line :dataset="lineData" :option="lineOption" />
......@@ -70,6 +72,8 @@ export default defineComponent({
setup() {
store.dispatch('GET_PUBLICSAFE_RIGHT_GATE')
store.dispatch('GET_PUBLICSAFE_RIGHT_SAFEMAP')
store.dispatch('GET_PUBLICSAFE_NEWFIND')
const newFind = computed(() => store.state.pubulicSafeNewFindNum)
const searchModal = ref(false)
const showChart = computed(() => store.state.curTheme === 'safety')
const fontSize = computed(() => Math.floor((screen.height * 1.6) / 100))
......@@ -82,11 +86,13 @@ export default defineComponent({
const safeMap = computed(() => store.state.pubulicSafeMap) // 门岗值守数据 - 社会物业
const streetData = ref('')
const sumList = ref<BriefProp[]>([
{ name: '今日发现', value: 157, icon: icon15 },
{ name: '今日处置中', value: 64, icon: icon16 },
{ name: '今日结案', value: 37, icon: icon17 },
])
const sumList = computed(() => {
return [
{ name: '今日发现', value: newFind.value.find, icon: icon15 },
{ name: '今日处置中', value: newFind.value.doing, icon: icon16 },
{ name: '今日结案', value: newFind.value.done, icon: icon17 },
]
})
const lineData = ref({
dimensions: [
{ name: 'time', displayName: '时间' },
......@@ -175,6 +181,7 @@ export default defineComponent({
zggfList,
shwyList,
clickStreetName,
newFind,
}
},
})
......
......@@ -36,9 +36,7 @@
</a-select-option>
</a-select>
</div>
<Summary class="summary" :two-child="true" :list="houseSum" />
<div class="chartBox">
<div v-if="showChart" class="drawCharts">
<div>
......@@ -64,8 +62,7 @@
<span :style="{ background: pieOption.color[i][0] }" />
<m-count class="count" :value="item.value" />
</p>
<p>外墙面层开裂</p>
<p>高坠隐患点</p>
<span style="">{{ item.name }}</span>
</div>
</div>
</div>
......@@ -194,17 +191,31 @@ export default defineComponent({
{ name: '楼宇名称', value: 4, danger: 1 },
])
const pieData1 = ref({
const pieData1 = computed(() => {
return {
dimensions: [
{ name: 'name', displayName: '类型' },
{ name: 'value', displayName: '数量' },
],
source: [
{ name: '事业单位', value: 4591 },
{ name: '企业单位', value: 4591 },
{ name: '机关团体', value: 1020 },
{ name: '其他', value: 899 },
{
name: '外立面附加设施危险点',
value: outHouseWall2019.value.outerWallFacilityDangerPoint,
},
{
name: '外立面附加设施隐患点',
value: outHouseWall2019.value.outerWallFacilityHiddenPoint,
},
{
name: '外墙面层隐患点',
value: outHouseWall2019.value.outerWallHiddenPoint,
},
{
name: '外墙面层危险点',
value: outHouseWall2019.value.outerWallDangerPoint,
},
],
}
})
const pieData2 = ref({
dimensions: [
......@@ -310,7 +321,7 @@ export default defineComponent({
font-size 0.2rem
font-family $font-pang
.outHouse
white-space nowrap
// white-space nowrap
flex 2
.chartBox
height 40%
......@@ -368,6 +379,8 @@ export default defineComponent({
flex-direction column
justify-content space-between
align-items center
>span
width 70%
>p
flex 1
white-space nowrap
......
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