From c51bc97d413f6be22da96efe0c7fd331f05afa0f Mon Sep 17 00:00:00 2001
From: Admin <978517621@qq.com>
Date: Wed, 26 Oct 2022 11:01:55 +0800
Subject: [PATCH] 默认更改列表
---
src/views/doublePreventAction/hiddenDanger/inspectionStatistics/components/todayUnusual/index.vue | 95 ++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 92 insertions(+), 3 deletions(-)
diff --git a/src/views/doublePreventAction/hiddenDanger/inspectionStatistics/components/todayUnusual/index.vue b/src/views/doublePreventAction/hiddenDanger/inspectionStatistics/components/todayUnusual/index.vue
index db27c8a..77f7d80 100644
--- a/src/views/doublePreventAction/hiddenDanger/inspectionStatistics/components/todayUnusual/index.vue
+++ b/src/views/doublePreventAction/hiddenDanger/inspectionStatistics/components/todayUnusual/index.vue
@@ -1,11 +1,100 @@
<template>
-
+ <div id="todayUnusual" style="width:90%;height:380px;margin: 0 auto;">
+ </div>
</template>
<script>
- export default {
- name: "index"
+
+import {getInspectPerson, getInspectTask} from "../../../../../../api/inspectStatistics";
+
+export default {
+ name: 'index',
+ data(){
+ return{
+ claimedData:[],
+ timeData:[],
+ completedData:[],
+ uncompletedData:[],
+ }
+ },
+ methods:{
+ async updateData(val) {
+ debugger
+ let res = await getInspectTask(val)
+ if(res.data.code === '200'){
+ debugger
+ this.claimedData = res.data.data.claimed.map(item =>{
+ return item.num
+ })
+ this.completedData = res.data.data.completed.map(item =>{
+ return item.num
+ })
+ this.uncompletedData = res.data.data.uncompleted.map(item =>{
+ return item.num
+ })
+ this.timeData = res.data.data.claimed.map(item =>{
+ return item.taskDate
+ })
+ }else{
+ this.$message({
+ type:'warning',
+ message:res.data.message
+ })
+ }
+ await this.drawTodayLine()
+ },
+ async drawTodayLine(){
+ this.myChart = this.$echarts.init(document.getElementById('todayUnusual'))
+ this.myChart.setOption({
+ tooltip: {
+ trigger: 'item'
+ },
+ legend: {
+ left: 'center',
+ top: '5%',
+ data:['任务数量','已完成','未完成']
+ },
+ xAxis: {
+ type: 'category',
+ data: this.timeData
+ },
+ color:['#0180ff','#91cc75','#ee6666',],
+ yAxis: {
+ type: 'value'
+ },
+ series: [
+ {
+ data: this.claimedData,
+ type: 'bar',
+ name:'任务数量',
+ showBackground: true,
+ backgroundStyle: {
+ color: '#91cc75'
+ }
+ },
+ {
+ data: this.completedData,
+ type: 'bar',
+ name:'已完成',
+ showBackground: true,
+ backgroundStyle: {
+ color: '#fac858'
+ }
+ },
+ {
+ data: this.uncompletedData,
+ type: 'bar',
+ name:'未完成',
+ showBackground: true,
+ backgroundStyle: {
+ color: '#ee6666'
+ }
+ },
+ ]
+ })
+ }
}
+}
</script>
<style scoped>
--
Gitblit v1.9.2