From 4fe31bb4c85d88d3586258df21333724b9fba7c8 Mon Sep 17 00:00:00 2001 From: shijing Date: Wed, 17 Jan 2024 15:49:26 +0800 Subject: [PATCH] #116 --- src/components/scScrollTable.vue | 29 +++++++----- src/views/bigScreen/index_6dept.vue | 48 ++++++++++---------- src/views/bigScreen/index_7dept.vue | 70 ++++++++++++++--------------- 3 files changed, 77 insertions(+), 70 deletions(-) diff --git a/src/components/scScrollTable.vue b/src/components/scScrollTable.vue index c0219b23..0795e67b 100644 --- a/src/components/scScrollTable.vue +++ b/src/components/scScrollTable.vue @@ -97,21 +97,22 @@ } }, mounted() { - let Container =this.tableHeight; + let that = this; + let Container =that.tableHeight; let tableHeight = Container-40; - let idName = 'scrollWrapper'+this.refValue; - let idName2 = this.refValue; + let idName = 'scrollWrapper'+that.refValue; + let idName2 = that.refValue; document.getElementById(idName).style.height = Container+'px'; document.getElementById(idName2).style.height = tableHeight+'px'; // console.log(this.$refs[`${this.refValue}`]) - let scrollHeight = this.$refs[`${this.refValue}`].scrollHeight/2; + let scrollHeight = that.$refs[`${that.refValue}`].scrollHeight/2; if(tableHeight>scrollHeight){ - this.scrollVivible = false; + that.scrollVivible = false; }else{ - this.scrollVivible = true; - this.myScroll = setInterval(() => { - this.scrollUp(); - }, this.speed); + that.scrollVivible = true; + that.myScroll = setInterval(() => { + that.scrollUp(); + }, that.speed); } }, methods: { @@ -162,9 +163,15 @@ this.speed); }, }, + beforeUnmount() { + let that = this; + clearInterval(that.myScroll1); + that.myScroll1 = null; + }, beforeDestoryed() { - clearInterval(myScroll1); - this.myScroll1 = null; + let that = this; + clearInterval(that.myScroll1); + that.myScroll1 = null; }, } diff --git a/src/views/bigScreen/index_6dept.vue b/src/views/bigScreen/index_6dept.vue index 9c8c08b4..faf20590 100644 --- a/src/views/bigScreen/index_6dept.vue +++ b/src/views/bigScreen/index_6dept.vue @@ -496,18 +496,18 @@ export default { chart1Option.series[0].data=seriesData11; chart1Option.series[1].data=seriesData12; let chart1 = this.setChart("chart1", chart1Option); - let index1 = 0 - this.chartInterval1 = setInterval(function () { - if (index1 < chart1Option.series[0].data.length) { - chart1.dispatchAction({ type: 'downplay', seriesIndex: 0 }); - chart1.dispatchAction({ type: 'highlight', seriesIndex: 0, dataIndex: index2 }); - chart1.dispatchAction({ type: 'showTip', seriesIndex: 0, dataIndex: index2 }); - index1++; - } else { - index1 = 0; - } - }, 3000); - debugger; + // let index1 = 0 + // this.chartInterval1 = setInterval(function () { + // if (index1 < chart1Option.series[0].data.length) { + // chart1.dispatchAction({ type: 'downplay', seriesIndex: 0 }); + // chart1.dispatchAction({ type: 'highlight', seriesIndex: 0, dataIndex: index2 }); + // chart1.dispatchAction({ type: 'showTip', seriesIndex: 0, dataIndex: index2 }); + // index1++; + // } else { + // index1 = 0; + // } + // }, 3000); + // debugger; }); //本月交付统计 that.$API.bi.dataset.exec.req('saleOutDay', obj2).then((saleOutRes) => { @@ -553,18 +553,18 @@ export default { chart2Option.series[1].label.position='top'; let chart2 = this.setChart("chart2", chart2Option); - let index2 = 0 - this.chartInterval2 = setInterval(function () { - if (index2 < chart2Option.series[0].data.length) { - chart2.dispatchAction({ type: 'downplay', seriesIndex: 0 }); - chart2.dispatchAction({ type: 'highlight', seriesIndex: 0, dataIndex: index2 }); - chart2.dispatchAction({ type: 'showTip', seriesIndex: 0, dataIndex: index2 }); - index2++; - } else { - index2 = 0; - } - }, 3000); - debugger; + // let index2 = 0 + // this.chartInterval2 = setInterval(function () { + // if (index2 < chart2Option.series[0].data.length) { + // chart2.dispatchAction({ type: 'downplay', seriesIndex: 0 }); + // chart2.dispatchAction({ type: 'highlight', seriesIndex: 0, dataIndex: index2 }); + // chart2.dispatchAction({ type: 'showTip', seriesIndex: 0, dataIndex: index2 }); + // index2++; + // } else { + // index2 = 0; + // } + // }, 3000); + // debugger; }); }, diff --git a/src/views/bigScreen/index_7dept.vue b/src/views/bigScreen/index_7dept.vue index 567acc9d..066aeb37 100644 --- a/src/views/bigScreen/index_7dept.vue +++ b/src/views/bigScreen/index_7dept.vue @@ -407,19 +407,19 @@ export default { let chart1Option = deepCopy(this.basicOption) chart1Option.xAxis.data = xAxisData1; chart1Option.series[0].data = seriesData1; - chart1Option.yAxis.name='生产数'; + // chart1Option.yAxis.name='生产数'; let chart1 = that.setChart("chart1", chart1Option); - let index1 = 0 - this.chartInterval1 = setInterval(function () { - if (index1 < chart1Option.series[0].data.length) { - chart1.dispatchAction({ type: 'downplay', seriesIndex: 0 }); - chart1.dispatchAction({ type: 'highlight', seriesIndex: 0, dataIndex: index1 }); - chart1.dispatchAction({ type: 'showTip', seriesIndex: 0, dataIndex: index1 }); - index1++; - } else { - index1 = 0; - } - }, 3000); + // let index1 = 0 + // this.chartInterval1 = setInterval(function () { + // if (index1 < seriesData1.length) { + // chart1.dispatchAction({ type: 'downplay', seriesIndex: 0 }); + // chart1.dispatchAction({ type: 'highlight', seriesIndex: 0, dataIndex: index1 }); + // chart1.dispatchAction({ type: 'showTip', seriesIndex: 0, dataIndex: index1 }); + // index1++; + // } else { + // index1 = 0; + // } + // }, 3000); }); //本月合格率统计 let obj2 ={ @@ -513,17 +513,17 @@ export default { }]; chart2Option.series=series2; let chart2 = that.setChart("chart2", chart2Option); - let index2 = 0 - this.chartInterval2 = setInterval(function () { - if (index2 < chart2Option.series[0].data.length) { - chart2.dispatchAction({ type: 'downplay', seriesIndex: 0 }); - chart2.dispatchAction({ type: 'highlight', seriesIndex: 0, dataIndex: index2 }); - chart2.dispatchAction({ type: 'showTip', seriesIndex: 0, dataIndex: index2 }); - index2++; - } else { - index2 = 0; - } - }, 3000); + // let index2 = 0 + // this.chartInterval2 = setInterval(function () { + // if (index2 < seriesData2.length) { + // chart2.dispatchAction({ type: 'downplay', seriesIndex: 0 }); + // chart2.dispatchAction({ type: 'highlight', seriesIndex: 0, dataIndex: index2 }); + // chart2.dispatchAction({ type: 'showTip', seriesIndex: 0, dataIndex: index2 }); + // index2++; + // } else { + // index2 = 0; + // } + // }, 3000); }); //车间生产昨日统计 12月1号 @@ -542,7 +542,7 @@ export default { ] if(res3.data2.ds0.length>0){ let item3 = res3.data2.ds0[0]; - that.yesterdayObjet = item + that.yesterdayObjet = item3; seriesData3[0].value=item3.炸纹; seriesData3[1].value=item3.条纹; seriesData3[2].value=item3.气泡; @@ -552,17 +552,17 @@ export default { } that.chart3Option.series.data = seriesData3; let chart3 = that.setChart("chart3", that.chart3Option); - let index3 = 0 - this.chartInterval3 = setInterval(function () { - if (index3 < that.chart3Option.series.data.length) { - chart3.dispatchAction({ type: 'downplay', seriesIndex: 0 }); - chart3.dispatchAction({ type: 'highlight', seriesIndex: 0, dataIndex: index3 }); - chart3.dispatchAction({ type: 'showTip', seriesIndex: 0, dataIndex: index3 }); - index3++; - } else { - index3 = 0; - } - }, 3000); + // let index3 = 0 + // this.chartInterval3 = setInterval(function () { + // if (index3 < seriesData3.length) { + // chart3.dispatchAction({ type: 'downplay', seriesIndex: 0 }); + // chart3.dispatchAction({ type: 'highlight', seriesIndex: 0, dataIndex: index3 }); + // chart3.dispatchAction({ type: 'showTip', seriesIndex: 0, dataIndex: index3 }); + // index3++; + // } else { + // index3 = 0; + // } + // }, 3000); }); }, //今日任务