湖里大屏(安全管理):问题占比联调

This commit is contained in:
Jack 2022-08-13 18:53:31 +08:00
parent 799264f561
commit f05125cb34
2 changed files with 22 additions and 14 deletions

View File

@ -85,6 +85,11 @@ export default {
} }
this.jNestedRingChart.setOption(option) this.jNestedRingChart.setOption(option)
} }
},
watch: {
series() {
this.createChart()
}
} }
} }
</script> </script>

View File

@ -17,13 +17,13 @@
</div> </div>
</div> --> </div> -->
<JNestedRingChart :title="{ text: 654, subTitle: '问题总数', y: '35%' }" :series="series" /> <JNestedRingChart :title="{ text: totalNum, subTitle: '问题总数', y: '35%' }" :series="series" />
</Card> </Card>
</template> </template>
<script> <script>
import Card from '../components/Card.vue' import Card from '../components/Card.vue'
import { getNewestSecurityManageDataList2Api } from '@/assets/js/api/dataBoard' import { selectSecurityManageStatisticsApi } from '@/assets/js/api/dataBoard'
import JNestedRingChart from '../jChart/pie/JNestedRingChart.vue' import JNestedRingChart from '../jChart/pie/JNestedRingChart.vue'
export default { export default {
components: { Card, JNestedRingChart }, components: { Card, JNestedRingChart },
@ -34,23 +34,26 @@ export default {
} }
}, },
mounted() { mounted() {
getNewestSecurityManageDataList2Api({ projectSn: this.projectSn }).then(res => { selectSecurityManageStatisticsApi({ projectSn: this.projectSn }).then(res => {
this.alarmList = res.result || [] const totals = res.result.total
this.series = [
{
color: ['#FE6C7F', '#786FF0', '#5CE2F6'],
data: [
{ value: totals.weekInspectNum, name: '周检' },
{ value: totals.monthInspectNum, name: '月检' },
{ value: totals.otherInspectNum, name: '其他' }
]
}
]
this.totalNum = totals.totalNum
}) })
}, },
data() { data() {
return { return {
projectSn: this.$store.state.projectSn, projectSn: this.$store.state.projectSn,
series: [ series: [],
{ total: 0
color: ['#FE6C7F', '#786FF0', '#5CE2F6'],
data: [
{ value: 45, name: '周检' },
{ value: 5, name: '月检' },
{ value: 15, name: '其他' }
]
}
]
} }
} }
} }