From a88e8e55aafca4957ce83ceb04ab0de90adf920b Mon Sep 17 00:00:00 2001
From: gaoshp <291585735@qq.com>
Date: 星期一, 17 六月 2024 23:39:14 +0800
Subject: [PATCH] update
---
src/views/mdc/components/Time.vue | 50 +++++++++++++++++++------
src/views/mdc/output-statistics.vue | 40 +++++++++++++++++++-
2 files changed, 76 insertions(+), 14 deletions(-)
diff --git a/src/views/mdc/components/Time.vue b/src/views/mdc/components/Time.vue
index b552b66..5bb8fcd 100644
--- a/src/views/mdc/components/Time.vue
+++ b/src/views/mdc/components/Time.vue
@@ -1,7 +1,7 @@
<!--
* @Date: 2024-04-18 21:52:18
* @LastEditors: Sneed
- * @LastEditTime: 2024-06-17 22:37:51
+ * @LastEditTime: 2024-06-17 23:37:51
* @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/components/Time.vue
-->
<template>
@@ -16,7 +16,7 @@
</el-col>
<el-col style="margin-top: 12px;">
<el-card shadow="never">
- <scEcharts height="300px" :option="option2"></scEcharts>
+ <scEcharts height="300px" :option="option2" v-if="option2.title" />
</el-card>
</el-col>
<el-col>
@@ -140,19 +140,46 @@
queryType: 0,
statisticalMethod: this.statisticalMethod
}
- // console.log(this.option2.series, '>>>>>>>>>>???')
- try {
- this.option2.dataset.source = []
- this.option2.series = []
- } catch (error) {
-
- }
+ this.option2 = {}
return this.$HTTP.post(this.url, dataSend, { params }).then(res => {
this.chartsData = res.data.items.records
let option2 = {
- ...this.options
+ // legend: {
+ // type: 'plain',
+ // },
+ title: {
+ text: '缁熻鍥捐〃',
+ subtext: '',
+ },
+ grid: {
+ top: '80px'
+ },
+ tooltip: {
+ trigger: 'axis'
+ },
+ xAxis: {
+ type: 'category',
+ axisLabel: {
+ interval: 'auto',
+ }
+ },
+ yAxis: {
+ type: 'value',
+ axisLabel: {
+ formatter: (value) => {
+ return value + '%'
+ }
+ },
+ },
+ dataZoom: [
+ { type: 'slider' }
+ ],
+ dataset: {
+ source: []
+ },
+ ...this.options,
+ series: [],
}
- option2.series = []
let source1 = ['product']
let row = res.data.items.records[0]
Object.values(row.nameData).forEach(v => {
@@ -161,7 +188,6 @@
})
source1.push(v)
})
-
option2.dataset.source = [source1]
res.data.items.records.forEach(v => {
let current = [v.id]
diff --git a/src/views/mdc/output-statistics.vue b/src/views/mdc/output-statistics.vue
index 1d9c0d0..2418599 100644
--- a/src/views/mdc/output-statistics.vue
+++ b/src/views/mdc/output-statistics.vue
@@ -1,7 +1,7 @@
<!--
* @Date: 2024-04-09 22:11:21
* @LastEditors: Sneed
- * @LastEditTime: 2024-06-17 22:01:34
+ * @LastEditTime: 2024-06-17 23:32:46
* @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/output-statistics.vue
* 鏁堢巼鍒嗘瀽
-->
@@ -79,7 +79,43 @@
time: [],
treeChecked: [],
chartOption1: {
-
+ title: {
+ text: '缁熻鍥捐〃',
+ subtext: '',
+ },
+ grid: {
+ top: '80px'
+ },
+ tooltip: {
+ trigger: 'axis'
+ },
+ tooltip: {
+ trigger: 'axis',
+ valueFormatter: (params) => {
+ return params
+ }
+ },
+ xAxis: {
+ type: 'category',
+ axisLabel: {
+ interval: 'auto',
+ }
+ },
+ yAxis: {
+ type: 'value',
+ axisLabel: {
+ formatter: (value) => {
+ return value
+ }
+ },
+ },
+ dataZoom: [
+ { type: 'slider' }
+ ],
+ dataset: {
+ source: []
+ },
+ series: []
},
chartOption: {
legend: {
--
Gitblit v1.9.3