From 6be1a83dd8564b46a868d4361a690a1f7c687568 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98937886381=E2=80=99?= <‘937886381@qq.com’> Date: Thu, 20 Jun 2024 20:38:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/report/index.js | 61 +- .../report/components/produceLineBar.vue | 151 ++- .../components/produceLineBarTarget.vue | 252 ++++ .../components/produceLineBarYearTarget.vue | 245 ++++ src/views/report/comprehensiveData.vue | 284 +++-- src/views/report/produceConversion.vue | 450 ++++++-- src/views/report/productionSituationMW.vue | 819 ++++++++++--- .../report/productionSituationTablets.vue | 1020 +++++++++++++++-- src/views/report/productionYield.vue | 551 ++++++--- 9 files changed, 3165 insertions(+), 668 deletions(-) create mode 100644 src/views/report/components/produceLineBarTarget.vue create mode 100644 src/views/report/components/produceLineBarYearTarget.vue diff --git a/src/api/report/index.js b/src/api/report/index.js index 9c6ea60..1cde283 100644 --- a/src/api/report/index.js +++ b/src/api/report/index.js @@ -1,7 +1,7 @@ /* * @Author: zhp * @Date: 2024-06-17 09:41:03 - * @LastEditTime: 2024-06-19 13:30:14 + * @LastEditTime: 2024-06-20 15:39:21 * @LastEditors: zhp * @Description: */ @@ -9,11 +9,21 @@ import request from '@/utils/request' export function getComprehensiveDataPage(data) { return request({ url: 'ip/comprehensive/data/get/comprehensive/data', - method: 'get', - params: data + method: 'post', + data: data }) } +export function exportComprehensiveDataPage(data) { + return request({ + url: 'ip/comprehensive/data/export/comprehensive/data', + method: 'post', + data: data, + responseType: 'blob', + }) +} + + export function getProduceTransData(data) { return request({ url: 'ip/prod-output/queryYCEReportByDateRange', @@ -22,6 +32,15 @@ export function getProduceTransData(data) { }) } +export function exportProduceTransData(data) { + return request({ + url: 'ip/prod-output/queryYCEReportByDateRangeExcel', + method: 'post', + data: data, + responseType: 'blob', + }) +} + export function getProduceSituationData(data) { return request({ @@ -31,6 +50,15 @@ export function getProduceSituationData(data) { }) } +export function exportProduceSituationData(data) { + return request({ + url: 'ip/production/situation/export/production/situation', + method: 'post', + data: data, + responseType: 'blob', + }) +} + export function getProductionSituationMWData(data) { return request({ url: 'ip/production/situation/power/get/production/situation', @@ -38,3 +66,30 @@ export function getProductionSituationMWData(data) { data: data }) } + +export function exportProductionSituationMWData(data) { + return request({ + url: 'ip/production/situation/power/export/production/situation', + method: 'post', + data: data, + responseType: 'blob', + }) +} + + +export function getProductionYieldSituationMWData(data) { + return request({ + url: 'ip/product/yield/get/production/situation', + method: 'post', + data: data + }) +} + +export function exportProductionYieldSituationMWData(data) { + return request({ + url: 'ip/product/yield/export/production/situation', + method: 'post', + data: data, + responseType: 'blob', + }) +} diff --git a/src/views/report/components/produceLineBar.vue b/src/views/report/components/produceLineBar.vue index 19a58f0..aea2cb5 100644 --- a/src/views/report/components/produceLineBar.vue +++ b/src/views/report/components/produceLineBar.vue @@ -1,44 +1,26 @@ @@ -54,10 +36,11 @@ export default { color: [], // color: ["#8EF0AB", "#63BDFF", "#288AFF"], grid: { - left: 100, - right: 10, + left: 30, + right: 0, bottom: 30, top: 30, + containLabel:true, }, tooltip: { trigger: "axis", @@ -68,17 +51,20 @@ export default { }, }, formatter: function (params) { + console.log('params', params); var res = `${params[0].axisValueLabel}`; for (var i = 0, l = params.length; i < l; i++) { res += "
" + `` + `${params[i].seriesName}` + - `${ - params[i].name === "%" - ? (params[i].value ? params[i].value.toFixed(2) : 0.0) + - params[i].name - : params[i].value + `${params[i].name.search('率') === "综合良率" + ? (params[i].value ? params[i].value.toFixed(2) : 0.0) + "%" + : params[i].seriesName === "转化效率" + ? (params[i].value ? params[i].value.toFixed(2) : 0.0) + "%" + : params[i].seriesName.search('总功率') != -1 + ? (params[i].value ? params[i].value.toFixed(2) : 0.0) + "MW" + : params[i].value + "片" }`; } return res; @@ -94,15 +80,53 @@ export default { type: "shadow", }, }, - yAxis: { - type: "value", - name: "", - nameTextStyle: { - fontSize: 12, - align: "right", + dataZoom: [//滚动条 + { + // 设置滚动条的隐藏与显示 + show: true, + // 设置滚动条类型 + type: "slider", + // 设置背景颜色 + backgroundColor: "rgb(19, 63, 100)", + // 设置选中范围的填充颜色 + fillerColor: "rgb(16, 171, 198)", + // 设置边框颜色 + borderColor: "rgb(19, 63, 100)", + // 是否显示detail,即拖拽时候显示详细数值信息 + showDetail: false, + // 数据窗口范围的起始数值 + startValue: 0, + // 数据窗口范围的结束数值(一页显示多少条数据) + endValue: 5, + // empty:当前数据窗口外的数据,被设置为空。 + // 即不会影响其他轴的数据范围 + filterMode: "empty", + // 设置滚动条宽度,相对于盒子宽度 + width: "50%", + // 设置滚动条高度 + height: 8, + // 设置滚动条显示位置 + left: "center", + // 是否锁定选择区域(或叫做数据窗口)的大小 + zoomLoxk: true, + // 控制手柄的尺寸 + handleSize: 0, + // dataZoom-slider组件离容器下侧的距离 + bottom: 3, }, - axisLabel: {}, - }, + { + // 没有下面这块的话,只能拖动滚动条, + // 鼠标滚轮在区域内不能控制外部滚动条 + type: "inside", + // 滚轮是否触发缩放 + zoomOnMouseWheel: false, + // 鼠标滚轮触发滚动 + moveOnMouseMove: true, + moveOnMouseWheel: true, + }, + + ], + yAxis:undefined, series: [], }, }; @@ -112,6 +136,14 @@ export default { type: Number, default: 300, }, + type: { + type: Number, + default: 2, + }, + show: { + type: Boolean, + default: true, + }, legendList: { type: Array, default: () => [], @@ -135,6 +167,9 @@ export default { this.chartHeight = newVal; }, }, + type() { + this.canvasReset(); + }, chartNum(val) { this.canvasReset(); }, @@ -162,34 +197,24 @@ export default { this.myChart = echarts.init(chartDom); this.option.color = this.chartMsg.color; this.option.xAxis.data = this.chartMsg.xData; - this.option.yAxis.name = this.chartMsg.yName; - if ( - this.chartMsg.series.length > 0 && - this.chartMsg.series[0].data[0].name === "%" - ) { - this.option.yAxis.axisLabel = { - formatter: function (value) { - return value + ".00%"; - }, - }; - } else { - this.option.yAxis.axisLabel = { - formatter: function (value) { - return value; - }, - }; - } + // this.option.yAxis.name = this.chartMsg.yName; + // this.option.yAxis.axisLabel = this.chartMsg.yAxisLabel; this.option.series = this.chartMsg.series; + this.option.yAxis = this.chartMsg.yAxis; + this.myChart.setOption(this.option); }, }, }; - diff --git a/src/views/report/components/produceLineBarYearTarget.vue b/src/views/report/components/produceLineBarYearTarget.vue new file mode 100644 index 0000000..8fb9c80 --- /dev/null +++ b/src/views/report/components/produceLineBarYearTarget.vue @@ -0,0 +1,245 @@ + + + + diff --git a/src/views/report/comprehensiveData.vue b/src/views/report/comprehensiveData.vue index 7d2b818..416d87c 100644 --- a/src/views/report/comprehensiveData.vue +++ b/src/views/report/comprehensiveData.vue @@ -1,7 +1,7 @@ @@ -76,7 +76,7 @@