This commit is contained in:
shijing 2024-01-17 15:49:26 +08:00
parent 6c73fda22e
commit 4fe31bb4c8
3 changed files with 77 additions and 70 deletions

View File

@ -97,21 +97,22 @@
} }
}, },
mounted() { mounted() {
let Container =this.tableHeight; let that = this;
let Container =that.tableHeight;
let tableHeight = Container-40; let tableHeight = Container-40;
let idName = 'scrollWrapper'+this.refValue; let idName = 'scrollWrapper'+that.refValue;
let idName2 = this.refValue; let idName2 = that.refValue;
document.getElementById(idName).style.height = Container+'px'; document.getElementById(idName).style.height = Container+'px';
document.getElementById(idName2).style.height = tableHeight+'px'; document.getElementById(idName2).style.height = tableHeight+'px';
// console.log(this.$refs[`${this.refValue}`]) // 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){ if(tableHeight>scrollHeight){
this.scrollVivible = false; that.scrollVivible = false;
}else{ }else{
this.scrollVivible = true; that.scrollVivible = true;
this.myScroll = setInterval(() => { that.myScroll = setInterval(() => {
this.scrollUp(); that.scrollUp();
}, this.speed); }, that.speed);
} }
}, },
methods: { methods: {
@ -162,9 +163,15 @@
this.speed); this.speed);
}, },
}, },
beforeUnmount() {
let that = this;
clearInterval(that.myScroll1);
that.myScroll1 = null;
},
beforeDestoryed() { beforeDestoryed() {
clearInterval(myScroll1); let that = this;
this.myScroll1 = null; clearInterval(that.myScroll1);
that.myScroll1 = null;
}, },
} }
</script> </script>

View File

@ -496,18 +496,18 @@ export default {
chart1Option.series[0].data=seriesData11; chart1Option.series[0].data=seriesData11;
chart1Option.series[1].data=seriesData12; chart1Option.series[1].data=seriesData12;
let chart1 = this.setChart("chart1", chart1Option); let chart1 = this.setChart("chart1", chart1Option);
let index1 = 0 // let index1 = 0
this.chartInterval1 = setInterval(function () { // this.chartInterval1 = setInterval(function () {
if (index1 < chart1Option.series[0].data.length) { // if (index1 < chart1Option.series[0].data.length) {
chart1.dispatchAction({ type: 'downplay', seriesIndex: 0 }); // chart1.dispatchAction({ type: 'downplay', seriesIndex: 0 });
chart1.dispatchAction({ type: 'highlight', seriesIndex: 0, dataIndex: index2 }); // chart1.dispatchAction({ type: 'highlight', seriesIndex: 0, dataIndex: index2 });
chart1.dispatchAction({ type: 'showTip', seriesIndex: 0, dataIndex: index2 }); // chart1.dispatchAction({ type: 'showTip', seriesIndex: 0, dataIndex: index2 });
index1++; // index1++;
} else { // } else {
index1 = 0; // index1 = 0;
} // }
}, 3000); // }, 3000);
debugger; // debugger;
}); });
// //
that.$API.bi.dataset.exec.req('saleOutDay', obj2).then((saleOutRes) => { that.$API.bi.dataset.exec.req('saleOutDay', obj2).then((saleOutRes) => {
@ -553,18 +553,18 @@ export default {
chart2Option.series[1].label.position='top'; chart2Option.series[1].label.position='top';
let chart2 = this.setChart("chart2", chart2Option); let chart2 = this.setChart("chart2", chart2Option);
let index2 = 0 // let index2 = 0
this.chartInterval2 = setInterval(function () { // this.chartInterval2 = setInterval(function () {
if (index2 < chart2Option.series[0].data.length) { // if (index2 < chart2Option.series[0].data.length) {
chart2.dispatchAction({ type: 'downplay', seriesIndex: 0 }); // chart2.dispatchAction({ type: 'downplay', seriesIndex: 0 });
chart2.dispatchAction({ type: 'highlight', seriesIndex: 0, dataIndex: index2 }); // chart2.dispatchAction({ type: 'highlight', seriesIndex: 0, dataIndex: index2 });
chart2.dispatchAction({ type: 'showTip', seriesIndex: 0, dataIndex: index2 }); // chart2.dispatchAction({ type: 'showTip', seriesIndex: 0, dataIndex: index2 });
index2++; // index2++;
} else { // } else {
index2 = 0; // index2 = 0;
} // }
}, 3000); // }, 3000);
debugger; // debugger;
}); });
}, },

View File

@ -407,19 +407,19 @@ export default {
let chart1Option = deepCopy(this.basicOption) let chart1Option = deepCopy(this.basicOption)
chart1Option.xAxis.data = xAxisData1; chart1Option.xAxis.data = xAxisData1;
chart1Option.series[0].data = seriesData1; chart1Option.series[0].data = seriesData1;
chart1Option.yAxis.name='生产数'; // chart1Option.yAxis.name='';
let chart1 = that.setChart("chart1", chart1Option); let chart1 = that.setChart("chart1", chart1Option);
let index1 = 0 // let index1 = 0
this.chartInterval1 = setInterval(function () { // this.chartInterval1 = setInterval(function () {
if (index1 < chart1Option.series[0].data.length) { // if (index1 < seriesData1.length) {
chart1.dispatchAction({ type: 'downplay', seriesIndex: 0 }); // chart1.dispatchAction({ type: 'downplay', seriesIndex: 0 });
chart1.dispatchAction({ type: 'highlight', seriesIndex: 0, dataIndex: index1 }); // chart1.dispatchAction({ type: 'highlight', seriesIndex: 0, dataIndex: index1 });
chart1.dispatchAction({ type: 'showTip', seriesIndex: 0, dataIndex: index1 }); // chart1.dispatchAction({ type: 'showTip', seriesIndex: 0, dataIndex: index1 });
index1++; // index1++;
} else { // } else {
index1 = 0; // index1 = 0;
} // }
}, 3000); // }, 3000);
}); });
// //
let obj2 ={ let obj2 ={
@ -513,17 +513,17 @@ export default {
}]; }];
chart2Option.series=series2; chart2Option.series=series2;
let chart2 = that.setChart("chart2", chart2Option); let chart2 = that.setChart("chart2", chart2Option);
let index2 = 0 // let index2 = 0
this.chartInterval2 = setInterval(function () { // this.chartInterval2 = setInterval(function () {
if (index2 < chart2Option.series[0].data.length) { // if (index2 < seriesData2.length) {
chart2.dispatchAction({ type: 'downplay', seriesIndex: 0 }); // chart2.dispatchAction({ type: 'downplay', seriesIndex: 0 });
chart2.dispatchAction({ type: 'highlight', seriesIndex: 0, dataIndex: index2 }); // chart2.dispatchAction({ type: 'highlight', seriesIndex: 0, dataIndex: index2 });
chart2.dispatchAction({ type: 'showTip', seriesIndex: 0, dataIndex: index2 }); // chart2.dispatchAction({ type: 'showTip', seriesIndex: 0, dataIndex: index2 });
index2++; // index2++;
} else { // } else {
index2 = 0; // index2 = 0;
} // }
}, 3000); // }, 3000);
}); });
// 121 // 121
@ -542,7 +542,7 @@ export default {
] ]
if(res3.data2.ds0.length>0){ if(res3.data2.ds0.length>0){
let item3 = res3.data2.ds0[0]; let item3 = res3.data2.ds0[0];
that.yesterdayObjet = item that.yesterdayObjet = item3;
seriesData3[0].value=item3.炸纹; seriesData3[0].value=item3.炸纹;
seriesData3[1].value=item3.条纹; seriesData3[1].value=item3.条纹;
seriesData3[2].value=item3.气泡; seriesData3[2].value=item3.气泡;
@ -552,17 +552,17 @@ export default {
} }
that.chart3Option.series.data = seriesData3; that.chart3Option.series.data = seriesData3;
let chart3 = that.setChart("chart3", that.chart3Option); let chart3 = that.setChart("chart3", that.chart3Option);
let index3 = 0 // let index3 = 0
this.chartInterval3 = setInterval(function () { // this.chartInterval3 = setInterval(function () {
if (index3 < that.chart3Option.series.data.length) { // if (index3 < seriesData3.length) {
chart3.dispatchAction({ type: 'downplay', seriesIndex: 0 }); // chart3.dispatchAction({ type: 'downplay', seriesIndex: 0 });
chart3.dispatchAction({ type: 'highlight', seriesIndex: 0, dataIndex: index3 }); // chart3.dispatchAction({ type: 'highlight', seriesIndex: 0, dataIndex: index3 });
chart3.dispatchAction({ type: 'showTip', seriesIndex: 0, dataIndex: index3 }); // chart3.dispatchAction({ type: 'showTip', seriesIndex: 0, dataIndex: index3 });
index3++; // index3++;
} else { // } else {
index3 = 0; // index3 = 0;
} // }
}, 3000); // }, 3000);
}); });
}, },
// //