diff --git a/src/views/sponeScreen/Echarts/AssessmentEcharts.vue b/src/views/sponeScreen/Echarts/AssessmentEcharts.vue index 36d9c33..bc4be4f 100644 --- a/src/views/sponeScreen/Echarts/AssessmentEcharts.vue +++ b/src/views/sponeScreen/Echarts/AssessmentEcharts.vue @@ -18,6 +18,7 @@ id: guid(), chart: null, timer: null, + anIndex: 0, }); const resizeTheChart = () => { if (allData.chart) { @@ -78,7 +79,6 @@ color: '#fff', show: true, }, - min: 1, nameTextStyle: { color: '#fff', }, @@ -153,22 +153,23 @@ allData.chart.dispose(); allData.chart = null; } + if (allData.timer) clearInterval(allData.timer); setTimeout(() => { init(); + allData.anIndex = 0; }, 0); } ); // echarts动画 function animateChart() { let length = props.data.xAxis.length; - let i = 0; allData.timer = setInterval(() => { - i++; - if (i == length) i = 0; + allData.anIndex++; + if (allData.anIndex == length) allData.anIndex = 0; allData.chart.dispatchAction({ type: 'showTip', seriesIndex: 0, - dataIndex: i, + dataIndex: allData.anIndex, }); }, 2000); } diff --git a/src/views/sponeScreen/Echarts/AssessmentEcharts.vue b/src/views/sponeScreen/Echarts/AssessmentEcharts.vue index 36d9c33..bc4be4f 100644 --- a/src/views/sponeScreen/Echarts/AssessmentEcharts.vue +++ b/src/views/sponeScreen/Echarts/AssessmentEcharts.vue @@ -18,6 +18,7 @@ id: guid(), chart: null, timer: null, + anIndex: 0, }); const resizeTheChart = () => { if (allData.chart) { @@ -78,7 +79,6 @@ color: '#fff', show: true, }, - min: 1, nameTextStyle: { color: '#fff', }, @@ -153,22 +153,23 @@ allData.chart.dispose(); allData.chart = null; } + if (allData.timer) clearInterval(allData.timer); setTimeout(() => { init(); + allData.anIndex = 0; }, 0); } ); // echarts动画 function animateChart() { let length = props.data.xAxis.length; - let i = 0; allData.timer = setInterval(() => { - i++; - if (i == length) i = 0; + allData.anIndex++; + if (allData.anIndex == length) allData.anIndex = 0; allData.chart.dispatchAction({ type: 'showTip', seriesIndex: 0, - dataIndex: i, + dataIndex: allData.anIndex, }); }, 2000); } diff --git a/src/views/sponeScreen/Echarts/AssessmentjsEcharts.vue b/src/views/sponeScreen/Echarts/AssessmentjsEcharts.vue index 59e7389..8cd4ac5 100644 --- a/src/views/sponeScreen/Echarts/AssessmentjsEcharts.vue +++ b/src/views/sponeScreen/Echarts/AssessmentjsEcharts.vue @@ -18,6 +18,7 @@ id: guid(), chart: null, timer: null, + anIndex: 0, }); const resizeTheChart = () => { if (allData.chart) { @@ -142,22 +143,23 @@ allData.chart.dispose(); allData.chart = null; } + if (allData.timer) clearInterval(allData.timer); setTimeout(() => { init(); + allData.anIndex = 0; }, 0); } ); // echarts动画 function animateChart() { let length = props.data.xAxis.length; - let i = 0; allData.timer = setInterval(() => { - i++; - if (i == length) i = 0; + allData.anIndex++; + if (allData.anIndex == length) allData.anIndex = 0; allData.chart.dispatchAction({ type: 'showTip', seriesIndex: 0, - dataIndex: i, + dataIndex: allData.anIndex, }); }, 2000); } diff --git a/src/views/sponeScreen/Echarts/AssessmentEcharts.vue b/src/views/sponeScreen/Echarts/AssessmentEcharts.vue index 36d9c33..bc4be4f 100644 --- a/src/views/sponeScreen/Echarts/AssessmentEcharts.vue +++ b/src/views/sponeScreen/Echarts/AssessmentEcharts.vue @@ -18,6 +18,7 @@ id: guid(), chart: null, timer: null, + anIndex: 0, }); const resizeTheChart = () => { if (allData.chart) { @@ -78,7 +79,6 @@ color: '#fff', show: true, }, - min: 1, nameTextStyle: { color: '#fff', }, @@ -153,22 +153,23 @@ allData.chart.dispose(); allData.chart = null; } + if (allData.timer) clearInterval(allData.timer); setTimeout(() => { init(); + allData.anIndex = 0; }, 0); } ); // echarts动画 function animateChart() { let length = props.data.xAxis.length; - let i = 0; allData.timer = setInterval(() => { - i++; - if (i == length) i = 0; + allData.anIndex++; + if (allData.anIndex == length) allData.anIndex = 0; allData.chart.dispatchAction({ type: 'showTip', seriesIndex: 0, - dataIndex: i, + dataIndex: allData.anIndex, }); }, 2000); } diff --git a/src/views/sponeScreen/Echarts/AssessmentjsEcharts.vue b/src/views/sponeScreen/Echarts/AssessmentjsEcharts.vue index 59e7389..8cd4ac5 100644 --- a/src/views/sponeScreen/Echarts/AssessmentjsEcharts.vue +++ b/src/views/sponeScreen/Echarts/AssessmentjsEcharts.vue @@ -18,6 +18,7 @@ id: guid(), chart: null, timer: null, + anIndex: 0, }); const resizeTheChart = () => { if (allData.chart) { @@ -142,22 +143,23 @@ allData.chart.dispose(); allData.chart = null; } + if (allData.timer) clearInterval(allData.timer); setTimeout(() => { init(); + allData.anIndex = 0; }, 0); } ); // echarts动画 function animateChart() { let length = props.data.xAxis.length; - let i = 0; allData.timer = setInterval(() => { - i++; - if (i == length) i = 0; + allData.anIndex++; + if (allData.anIndex == length) allData.anIndex = 0; allData.chart.dispatchAction({ type: 'showTip', seriesIndex: 0, - dataIndex: i, + dataIndex: allData.anIndex, }); }, 2000); } diff --git a/src/views/sponeScreen/projectHM/ProjectEvaluation.vue b/src/views/sponeScreen/projectHM/ProjectEvaluation.vue index d7ac84a..68407d4 100644 --- a/src/views/sponeScreen/projectHM/ProjectEvaluation.vue +++ b/src/views/sponeScreen/projectHM/ProjectEvaluation.vue @@ -154,7 +154,6 @@ }); // 海绵设施监测站点切换 const changeHmss = () => { - // hmssVal.value = val; getDataSS(); }; // 海绵设施数据渲染 @@ -170,7 +169,7 @@ if (res && res.code == 200) { let datas = res.data; chartDataSS.value.xAxis = datas.propertyMonitorXList; - chartDataSS.value.yAxis = datas.propertyMonitorList[0].ylist; + chartDataSS.value.yAxis = datas.propertyMonitorList[0] ? datas.propertyMonitorList[0].ylist : []; } // 获取监测值 @@ -182,7 +181,7 @@ let res2 = await graphicReport(params2); if (res2 && res2.code == 200) { let datas = res2.data; - chartDataSS.value.yAxis2 = datas.propertyMonitorList[0].ylist; + chartDataSS.value.yAxis2 = datas.propertyMonitorList[0] ? datas.propertyMonitorList[0].ylist : []; } chartDataSS.value.refresh = Math.random(); loadingSS.value = false; @@ -223,7 +222,6 @@ onMounted(() => { hmssVal.value = hmssList.value[0].value; //默认第一个监测点 - console.log('33333', hmssVal.value); // 获取降雨日历的日期来加载对应数据 bus.on('setRainDate', date => { console.log('降雨日历的日期----', date);