|
|
@@ -111,7 +111,7 @@
|
|
|
|
|
|
<script>
|
|
|
import * as echarts from 'echarts'
|
|
|
-import { getLabBasicStatistics } from '@/api/screen'
|
|
|
+import { getLabBasicStatistics,getLevelTitleList } from '@/api/screen'
|
|
|
|
|
|
export default {
|
|
|
name: 'EventStats',
|
|
|
@@ -153,7 +153,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.fetchData()
|
|
|
+ this.getLevelTitleList()
|
|
|
this.timer = setInterval(this.fetchData, 5 * 60 * 1000)
|
|
|
},
|
|
|
beforeDestroy() {
|
|
|
@@ -164,18 +164,43 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ async getLevelTitleList() {
|
|
|
+ const res = await getLevelTitleList()
|
|
|
+ if (res.code === 200) {
|
|
|
+ let list = [];
|
|
|
+ for(let i=0;i<res.data.length;i++){
|
|
|
+ list.push({
|
|
|
+ levelGrade: res.data[i].levelGrade,
|
|
|
+ name: res.data[i].titleName,
|
|
|
+ label: res.data[i].showTitleName,
|
|
|
+ value: '',
|
|
|
+ color: res.data[i].titleColor
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.$set(this,'levels',list);
|
|
|
+ this.fetchData();
|
|
|
+ }
|
|
|
+ },
|
|
|
async fetchData() {
|
|
|
+ let self = this;
|
|
|
try {
|
|
|
const res = await getLabBasicStatistics()
|
|
|
if (res.code === 200) {
|
|
|
const d = res.data
|
|
|
this.total = d.labTotal
|
|
|
- this.levels = [
|
|
|
- { name: 'I级', label: 'I 级(重大风险)', value: d.levelOneCount, color: '#cc0000' },
|
|
|
- { name: 'II级', label: 'II 级(高风险)', value: d.levelTwoCount, color: '#ff8000' },
|
|
|
- { name: 'III级',label: 'III 级(中风险)', value: d.levelThreeCount, color: '#ffcc00' },
|
|
|
- { name: 'IV级', label: 'IV 级(低风险)', value: d.levelFourCount, color: '#0066cc' }
|
|
|
- ]
|
|
|
+ let list = JSON.parse(JSON.stringify(self.levels));
|
|
|
+ for(let i=0;i<list.length;i++){
|
|
|
+ if(list[i].levelGrade == 1){
|
|
|
+ list[i].value = d.levelOneCount;
|
|
|
+ }else if(list[i].levelGrade == 2){
|
|
|
+ list[i].value = d.levelTwoCount;
|
|
|
+ }else if(list[i].levelGrade == 3){
|
|
|
+ list[i].value = d.levelThreeCount;
|
|
|
+ }else if(list[i].levelGrade == 4){
|
|
|
+ list[i].value = d.levelFourCount;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.$set(this,'levels',list);
|
|
|
this.status = {
|
|
|
active: d.useTotal,
|
|
|
warning: d.exceptionalTotal,
|