From 4c829d21f5b708abba1d2682e5418d67fbcb7096 Mon Sep 17 00:00:00 2001 From: lb Date: Mon, 7 Aug 2023 17:05:09 +0800 Subject: [PATCH] TODO: fix graphPage build*() --- .../components/graphs/line.vue | 60 +++++++++++-------- .../qualityStatistics/graphPage.vue | 46 ++++++++++++-- .../monitoring/qualityStatistics/index.vue | 5 +- 3 files changed, 80 insertions(+), 31 deletions(-) diff --git a/src/views/quality/monitoring/qualityStatistics/components/graphs/line.vue b/src/views/quality/monitoring/qualityStatistics/components/graphs/line.vue index 7e9fb167..3f3978a8 100644 --- a/src/views/quality/monitoring/qualityStatistics/components/graphs/line.vue +++ b/src/views/quality/monitoring/qualityStatistics/components/graphs/line.vue @@ -15,33 +15,42 @@ import * as echarts from 'echarts'; export default { name: 'LineDataChart', components: {}, - props: {}, + props: { + xProps: { + type: Array, + default: () => [], + }, + legend: { + type: Array, + default: () => [], + } + }, data() { return { chart: null, - inspectionContents: [ - '检测内容1', - '检测内容2', - '检测内容3', - '检测内容4', - '检测内容5', - '检测内容6', - '检测内容7', - '检测内容8', - '检测总数', - '比例%', - ], - xProps: [ - '产线1', - '产线2', - '产线3', - '产线4', - '产线5', - '产线6', - '产线7', - '产线8', - '产线9', - ], + // inspectionContents: [ + // '检测内容1', + // '检测内容2', + // '检测内容3', + // '检测内容4', + // '检测内容5', + // '检测内容6', + // '检测内容7', + // '检测内容8', + // '检测总数', + // '比例%', + // ], + // xProps: [ + // '产线1', + // '产线2', + // '产线3', + // '产线4', + // '产线5', + // '产线6', + // '产线7', + // '产线8', + // '产线9', + // ], series: [ { name: '检测内容1', @@ -106,6 +115,7 @@ export default { this.setOption(); }, setOption(option) { + console.log("legend", this.legend) const defaultOption = { // title: { // text: '折线图', @@ -121,7 +131,7 @@ export default { trigger: 'axis', }, legend: { - data: this.inspectionContents, + data: this.legend, top: '5%', icon: 'circle' }, diff --git a/src/views/quality/monitoring/qualityStatistics/graphPage.vue b/src/views/quality/monitoring/qualityStatistics/graphPage.vue index 2cd31c49..49ed1936 100644 --- a/src/views/quality/monitoring/qualityStatistics/graphPage.vue +++ b/src/views/quality/monitoring/qualityStatistics/graphPage.vue @@ -11,8 +11,11 @@ - - + + @@ -21,7 +24,7 @@ diff --git a/src/views/quality/monitoring/qualityStatistics/index.vue b/src/views/quality/monitoring/qualityStatistics/index.vue index a971930c..da93ed5e 100644 --- a/src/views/quality/monitoring/qualityStatistics/index.vue +++ b/src/views/quality/monitoring/qualityStatistics/index.vue @@ -33,7 +33,10 @@ - +