From 756be572e470c4a2e2e971350a545b3e8d9c0180 Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期五, 12 七月 2024 17:17:07 +0800 Subject: [PATCH] 2024.7.12 --- src/views/inspection/problem/component/ProblemChangeChart.vue | 56 ++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 48 insertions(+), 8 deletions(-) diff --git a/src/views/inspection/problem/component/ProblemChangeChart.vue b/src/views/inspection/problem/component/ProblemChangeChart.vue index a033240..3e6314d 100644 --- a/src/views/inspection/problem/component/ProblemChangeChart.vue +++ b/src/views/inspection/problem/component/ProblemChangeChart.vue @@ -1,7 +1,20 @@ <template> <el-row justify="space-between"> - <div>鍒嗘湡瓒嬪娍</div> - <OptionTime v-model="time"></OptionTime> + <el-col :span="18"> + <div> + 鍦烘櫙鏁帮細{{ sceneNum }}锛岄棶棰樻�绘暟锛歿{ proNum }}锛屽崟鍦烘櫙闂鍧囧�硷細{{ proEachSceneNum }}锛� + </div> + <div> + 鏁存敼鎬绘暟锛歿{ changeNum }}锛屾湁鏁堟暣鏀规暟锛歿{ changePassNum }}锛岄棶棰樻暣鏀圭巼锛歿{ + changePer + }}锛屾湁鏁堟暣鏀圭巼锛歿{ changePassPer }} + </div> + </el-col> + <el-col :span="6"> + <el-row justify="end"> + <OptionTime v-model="time"></OptionTime> + </el-row> + </el-col> </el-row> <div ref="echart" class="line-chart"></div> </template> @@ -9,12 +22,39 @@ import * as echarts from 'echarts' export default { + data() { + return { + sceneNum: 51, + proNum: 161, + changeNum: 40, + changePassNum: 40 + } + }, + computed: { + proEachSceneNum() { + return Math.round((this.proNum / this.sceneNum) * 10) / 10 + }, + changePer() { + if (this.proNum > 0) { + return Math.round((this.changeNum / this.proNum) * 100) + '%' + } else { + return '/' + } + }, + changePassPer() { + if (this.proNum > 0) { + return Math.round((this.changePassNum / this.proNum) * 100) + '%' + } else { + return '/' + } + } + }, methods: { refresh() { const fontSize = 12 const option = { legend: { - data: ['闂', '鏁存敼'], + data: ['闂鏁�', '鏁存敼鏁�'], textStyle: { fontSize: fontSize, color: 'white' @@ -28,7 +68,7 @@ }, xAxis: { type: 'category', - data: ['1鍙�', '2鍙�', '3鍙�', '4鍙�', '5鍙�', '6鍙�'], + data: ['1鍙�', '2鍙�', '3鍙�', '4鍙�', '5鍙�', '6鍙�', '7鍙�', '8鍙�', '9鍙�'], axisLabel: { textStyle: { fontSize: fontSize @@ -48,14 +88,14 @@ }, series: [ { - name: '闂', + name: '闂鏁�', type: 'bar', - data: [67, 45, 90, 67, 45, 90] + data: [12, 8, 9, 7, 14, 19, 9, 7, 14] }, { - name: '鏁存敼', + name: '鏁存敼鏁�', type: 'bar', - data: [67, 45, 90, 67, 40, 81] + data: [6, 2, 5, 3, 6, 3, 6, 2, 5] } // { // name: '鏁存敼鐜�', -- Gitblit v1.9.3