From 2d500e396dbc109496668adc37360e56a1e83edb Mon Sep 17 00:00:00 2001 From: shijing Date: Fri, 29 Mar 2024 09:42:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:6=E3=80=8110=E8=BD=A6=E9=97=B4=E7=9C=8B?= =?UTF-8?q?=E6=9D=BF=E5=9B=BE=E6=A0=87=E6=95=B0=E6=8D=AE=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/bigScreen/index_10dept.vue | 38 ++- src/views/bigScreen/index_6dept.vue | 477 +++++++-------------------- 2 files changed, 140 insertions(+), 375 deletions(-) diff --git a/src/views/bigScreen/index_10dept.vue b/src/views/bigScreen/index_10dept.vue index 9c272c28..9bd614e8 100644 --- a/src/views/bigScreen/index_10dept.vue +++ b/src/views/bigScreen/index_10dept.vue @@ -558,27 +558,35 @@ export default { dept_name: "10车间", }, }; + let seriesData1 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + xAxisData1 = [ + "1月", + "2月", + "3月", + "4月", + "5月", + "6月", + "7月", + "8月", + "9月", + "10月", + "11月", + "12月", + ]; that.$API.bi.dataset.exec.req("lineMonth", obj1).then((res1) => { console.log("全年生产统计:", res1); - let list1 = res1.data2.ds0; - let seriesData1 = [], - xAxisData1 = []; - for (let i = 0; i < 12; i++) { - let day = i + 1; - let text = day + "月"; - xAxisData1[i] = text; - seriesData1[i] = 0; - } - if (list1.length > 0) { - list1.forEach((item1) => { - let index1 = item1.月 - 1; - seriesData1[index1] = item1.合格数; - }); + if (res1.data2.ds0) { + let list1 = res1.data2.ds0; + if (list1.length > 0) { + list1.forEach((item1) => { + let index1 = item1.月 - 1; + seriesData1[index1] += item1.合格数; + }); + } } let chart1Option = deepCopy(this.basicOption); chart1Option.xAxis.data = xAxisData1; chart1Option.series[0].data = seriesData1; - // chart1Option.yAxis.name='合格数'; let chart1 = this.setChart("chart1", chart1Option); let index1 = 0; this.chartInterval1 = setInterval(function () { diff --git a/src/views/bigScreen/index_6dept.vue b/src/views/bigScreen/index_6dept.vue index 9946313b..4abff1a1 100644 --- a/src/views/bigScreen/index_6dept.vue +++ b/src/views/bigScreen/index_6dept.vue @@ -1,18 +1,8 @@