Sfoglia il codice sorgente

首页统计问题修复

shenqilong 1 anno fa
parent
commit
ae9755f313
1 ha cambiato i file con 44 aggiunte e 27 eliminazioni
  1. 44 27
      src/views/system/dashboard/components/new-home.vue

+ 44 - 27
src/views/system/dashboard/components/new-home.vue

@@ -227,16 +227,16 @@
                         </el-row>
                     </el-card>
                 </div>
-                <div v-if="item.key==='zt'">
+                <div v-if="item.key==='zt'" v-loading="loading">
                     <el-row ref="row" :gutter="12">
 
                         <el-col :span="12">
                             <div>检测任务统计</div>
-                            <div id="a1" style="height:500px;" />
+                            <div id="a1" style="width: 100%; height:600px;" />
                         </el-col>
                         <el-col :span="12">
                             <div>任务事宜统计</div>
-                            <div id="a2" style="height:500px;" />
+                            <div id="a2" style="width: 100%;height:600px;" />
                         </el-col>
                     </el-row>
                 </div>
@@ -436,9 +436,9 @@ export default {
                         name: '检测未完成数',
                         type: 'bar',
                         data: [],
-                        // barCategoryGap: '0',
-                        barGap: '0',
-                        barWidth: 30,
+                        barCategoryGap: '20%',
+                        barGap: '20%',
+                        // barWidth: 20,
                         label: {
                             show: true,
                             position: 'top',
@@ -454,9 +454,9 @@ export default {
                         name: '检测已完成数',
                         type: 'bar',
                         data: [],
-                        // barCategoryGap: '0',
-                        barGap: '0',
-                        barWidth: 30,
+                        barCategoryGap: '20%',
+                        barGap: '20%',
+                        // barWidth: 20,
                         label: {
                             show: true,
                             position: 'top',
@@ -472,9 +472,9 @@ export default {
                         name: '复核未完成数',
                         type: 'bar',
                         data: [],
-                        // barCategoryGap: '0',
-                        barGap: '0',
-                        barWidth: 30,
+                        barCategoryGap: '20%',
+                        barGap: '20%',
+                        // barWidth: 20,
                         label: {
                             show: true,
                             position: 'top',
@@ -490,9 +490,9 @@ export default {
                         name: '复核已完成数',
                         type: 'bar',
                         data: [],
-                        // barCategoryGap: '0',
-                        barGap: '0',
-                        barWidth: 30,
+                        barCategoryGap: '20%',
+                        barGap: '20%',
+                        // barWidth: 20,
                         label: {
                             show: true,
                             position: 'top',
@@ -537,11 +537,13 @@ export default {
                         name: '待办事宜数',
                         type: 'bar',
                         data: [],
-                        barGap: '0',
-                        barWidth: 20,
+                        barCategoryGap: '20%',
+                        barGap: '20%',
+                        // barWidth: 20,
                         label: {
                             show: true,
                             position: 'top',
+                            offset: [0, 0],
                             valueAnimation: true
                         },
                         itemStyle: {
@@ -554,11 +556,13 @@ export default {
                         name: '已办事宜数',
                         type: 'bar',
                         data: [],
-                        barGap: '0',
-                        barWidth: 20,
+                        barCategoryGap: '20%',
+                        barGap: '20%',
+                        // barWidth: 20,
                         label: {
                             show: true,
                             position: 'top',
+                            offset: [-5, -5],
                             valueAnimation: true
                         },
                         itemStyle: {
@@ -571,11 +575,13 @@ export default {
                         name: '办结事宜',
                         type: 'bar',
                         data: [],
-                        barGap: '0',
-                        barWidth: 20,
+                        barCategoryGap: '20%',
+                        barGap: '20%',
+                        // barWidth: 20,
                         label: {
                             show: true,
                             position: 'top',
+                            offset: [4, 4],
                             valueAnimation: true
                         },
                         itemStyle: {
@@ -588,11 +594,13 @@ export default {
                         name: '暂存事宜',
                         type: 'bar',
                         data: [],
-                        barGap: '0',
-                        barWidth: 20,
+                        barCategoryGap: '20%',
+                        barGap: '20%',
+                        // barWidth: 20,
                         label: {
                             show: true,
                             position: 'top',
+                            offset: [0, 0],
                             valueAnimation: true
                         },
                         itemStyle: {
@@ -903,7 +911,7 @@ export default {
         // 获取表格数据
         getData (type) {
             this.loading = true
-            operate[this.activeTab](this.getFormatParams(null, this.defaultPagination)).then(response => {
+            operate[this.activeTab](this.getFormatParams(null, this.defaultPagination, null)).then(response => {
                 const { dataResult, pageResult } = response.data
                 if (dataResult && dataResult.length) {
                     // 待办事宜对任务发起人做额外处理
@@ -1078,12 +1086,20 @@ export default {
                 // this.getDpmInfo()
                 tabList.forEach((item, index) => {
                     if (item.key !== 'gr' && item.key !== 'zt') {
-                        operate[item.key](this.getFormatParams(null, this.defaultPagination)).then(response => {
+                        let finish = ''
+                        if (item.key === 'finish') {
+                            finish = 'finish'
+                        }
+                        operate[item.key](this.getFormatParams(null, this.defaultPagination, finish)).then(response => {
                             grdata[index].dataText = response.data.pageResult.totalCount
                         })
                     }
                 })
             } else if (this.activeTab === 'zt') {
+                this.loading = true
+                setTimeout(() => {
+                    this.loading = false
+                }, 30000)
                 await this.chartLoading()
                 await this.getTtaskMattersData()
                 console.log(this.optionPerson)
@@ -1095,6 +1111,7 @@ export default {
                 var chartDom2 = document.getElementById('a2')
                 var myChart2 = echarts.init(chartDom2)
                 myChart2.setOption(this.optionPerson)
+                this.loading = false
             } else {
                 this.getData(this.activeTab)
             }
@@ -1116,7 +1133,7 @@ export default {
             const s = taskState[cont]
             return s || '暂停'
         },
-        getFormatParams (v, pagination) {
+        getFormatParams (v, pagination, finish) {
             const params = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
 
             if (this.$utils.isNotEmpty(this.searchParams.typeId)) {
@@ -1129,7 +1146,7 @@ export default {
                 params[`Q^${paramsType[this.activeTab]}create_time_^DL`] = dateFormat(this.searchParams.createTime[0]).slice(0, 10)
                 params[`Q^${paramsType[this.activeTab]}create_time_^DG`] = dateFormat(this.searchParams.createTime[1]).slice(0, 10)
             }
-            if (this.activeTab === 'finish') {
+            if (this.activeTab === 'finish' || finish == 'finish') {
                 params.end = '1'
             }
             return ActionUtils.formatParams(params, pagination, this.sorts)