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

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

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