diff --git a/src/components/Echarts/barChart.vue b/src/components/Echarts/barChart.vue index 5a467d0..f0b7a15 100644 --- a/src/components/Echarts/barChart.vue +++ b/src/components/Echarts/barChart.vue @@ -3,6 +3,7 @@ diff --git a/src/components/Echarts/barChart.vue b/src/components/Echarts/barChart.vue index 5a467d0..f0b7a15 100644 --- a/src/components/Echarts/barChart.vue +++ b/src/components/Echarts/barChart.vue @@ -3,6 +3,7 @@ diff --git a/src/views/oneMap/Echarts/AssessmentjsEcharts.vue b/src/views/oneMap/Echarts/AssessmentjsEcharts.vue index 5fea924..b58cdc4 100644 --- a/src/views/oneMap/Echarts/AssessmentjsEcharts.vue +++ b/src/views/oneMap/Echarts/AssessmentjsEcharts.vue @@ -20,9 +20,11 @@ timer: null, }); const resizeTheChart = () => { - if (allData.chart) { - allData.chart.resize(); - } + nextTick(() => { + if (allData.chart) { + allData.chart.resize(); + } + }); }; const init = () => { diff --git a/src/components/Echarts/barChart.vue b/src/components/Echarts/barChart.vue index 5a467d0..f0b7a15 100644 --- a/src/components/Echarts/barChart.vue +++ b/src/components/Echarts/barChart.vue @@ -3,6 +3,7 @@ diff --git a/src/views/oneMap/Echarts/AssessmentjsEcharts.vue b/src/views/oneMap/Echarts/AssessmentjsEcharts.vue index 5fea924..b58cdc4 100644 --- a/src/views/oneMap/Echarts/AssessmentjsEcharts.vue +++ b/src/views/oneMap/Echarts/AssessmentjsEcharts.vue @@ -20,9 +20,11 @@ timer: null, }); const resizeTheChart = () => { - if (allData.chart) { - allData.chart.resize(); - } + nextTick(() => { + if (allData.chart) { + allData.chart.resize(); + } + }); }; const init = () => { diff --git a/src/views/oneMap/Echarts/ChartLs.vue b/src/views/oneMap/Echarts/ChartLs.vue index b083a8b..c88eca0 100644 --- a/src/views/oneMap/Echarts/ChartLs.vue +++ b/src/views/oneMap/Echarts/ChartLs.vue @@ -48,9 +48,11 @@ ); //自适应 function resizeTheChart() { - if (myChart.value) { - myChart.value.resize(); - } + nextTick(() => { + if (myChart.value) { + myChart.value.resize(); + } + }); } // 重绘之前的样式填充 function reasizeFun() { diff --git a/src/components/Echarts/barChart.vue b/src/components/Echarts/barChart.vue index 5a467d0..f0b7a15 100644 --- a/src/components/Echarts/barChart.vue +++ b/src/components/Echarts/barChart.vue @@ -3,6 +3,7 @@ diff --git a/src/views/oneMap/Echarts/AssessmentjsEcharts.vue b/src/views/oneMap/Echarts/AssessmentjsEcharts.vue index 5fea924..b58cdc4 100644 --- a/src/views/oneMap/Echarts/AssessmentjsEcharts.vue +++ b/src/views/oneMap/Echarts/AssessmentjsEcharts.vue @@ -20,9 +20,11 @@ timer: null, }); const resizeTheChart = () => { - if (allData.chart) { - allData.chart.resize(); - } + nextTick(() => { + if (allData.chart) { + allData.chart.resize(); + } + }); }; const init = () => { diff --git a/src/views/oneMap/Echarts/ChartLs.vue b/src/views/oneMap/Echarts/ChartLs.vue index b083a8b..c88eca0 100644 --- a/src/views/oneMap/Echarts/ChartLs.vue +++ b/src/views/oneMap/Echarts/ChartLs.vue @@ -48,9 +48,11 @@ ); //自适应 function resizeTheChart() { - if (myChart.value) { - myChart.value.resize(); - } + nextTick(() => { + if (myChart.value) { + myChart.value.resize(); + } + }); } // 重绘之前的样式填充 function reasizeFun() { diff --git a/src/views/oneMap/Echarts/RainfallLegend.vue b/src/views/oneMap/Echarts/RainfallLegend.vue index 62292a6..ce39fe6 100644 --- a/src/views/oneMap/Echarts/RainfallLegend.vue +++ b/src/views/oneMap/Echarts/RainfallLegend.vue @@ -2,11 +2,11 @@
diff --git a/src/views/oneMap/Echarts/AssessmentjsEcharts.vue b/src/views/oneMap/Echarts/AssessmentjsEcharts.vue index 5fea924..b58cdc4 100644 --- a/src/views/oneMap/Echarts/AssessmentjsEcharts.vue +++ b/src/views/oneMap/Echarts/AssessmentjsEcharts.vue @@ -20,9 +20,11 @@ timer: null, }); const resizeTheChart = () => { - if (allData.chart) { - allData.chart.resize(); - } + nextTick(() => { + if (allData.chart) { + allData.chart.resize(); + } + }); }; const init = () => { diff --git a/src/views/oneMap/Echarts/ChartLs.vue b/src/views/oneMap/Echarts/ChartLs.vue index b083a8b..c88eca0 100644 --- a/src/views/oneMap/Echarts/ChartLs.vue +++ b/src/views/oneMap/Echarts/ChartLs.vue @@ -48,9 +48,11 @@ ); //自适应 function resizeTheChart() { - if (myChart.value) { - myChart.value.resize(); - } + nextTick(() => { + if (myChart.value) { + myChart.value.resize(); + } + }); } // 重绘之前的样式填充 function reasizeFun() { diff --git a/src/views/oneMap/Echarts/RainfallLegend.vue b/src/views/oneMap/Echarts/RainfallLegend.vue index 62292a6..ce39fe6 100644 --- a/src/views/oneMap/Echarts/RainfallLegend.vue +++ b/src/views/oneMap/Echarts/RainfallLegend.vue @@ -2,11 +2,11 @@
diff --git a/src/components/Echarts/barChart.vue b/src/components/Echarts/barChart.vue index 5a467d0..f0b7a15 100644 --- a/src/components/Echarts/barChart.vue +++ b/src/components/Echarts/barChart.vue @@ -3,6 +3,7 @@ diff --git a/src/views/oneMap/Echarts/AssessmentjsEcharts.vue b/src/views/oneMap/Echarts/AssessmentjsEcharts.vue index 5fea924..b58cdc4 100644 --- a/src/views/oneMap/Echarts/AssessmentjsEcharts.vue +++ b/src/views/oneMap/Echarts/AssessmentjsEcharts.vue @@ -20,9 +20,11 @@ timer: null, }); const resizeTheChart = () => { - if (allData.chart) { - allData.chart.resize(); - } + nextTick(() => { + if (allData.chart) { + allData.chart.resize(); + } + }); }; const init = () => { diff --git a/src/views/oneMap/Echarts/ChartLs.vue b/src/views/oneMap/Echarts/ChartLs.vue index b083a8b..c88eca0 100644 --- a/src/views/oneMap/Echarts/ChartLs.vue +++ b/src/views/oneMap/Echarts/ChartLs.vue @@ -48,9 +48,11 @@ ); //自适应 function resizeTheChart() { - if (myChart.value) { - myChart.value.resize(); - } + nextTick(() => { + if (myChart.value) { + myChart.value.resize(); + } + }); } // 重绘之前的样式填充 function reasizeFun() { diff --git a/src/views/oneMap/Echarts/RainfallLegend.vue b/src/views/oneMap/Echarts/RainfallLegend.vue index 62292a6..ce39fe6 100644 --- a/src/views/oneMap/Echarts/RainfallLegend.vue +++ b/src/views/oneMap/Echarts/RainfallLegend.vue @@ -2,11 +2,11 @@
diff --git a/src/views/oneMap/SmartDrainage/qzfk_3d.vue b/src/views/oneMap/SmartDrainage/qzfk_3d.vue index 9b252a0..7aeff03 100644 --- a/src/views/oneMap/SmartDrainage/qzfk_3d.vue +++ b/src/views/oneMap/SmartDrainage/qzfk_3d.vue @@ -386,9 +386,11 @@ //自适应 function resizeTheChart() { - if (myChart.value) { - myChart.value.resize(); - } + nextTick(() => { + if (myChart.value) { + myChart.value.resize(); + } + }); } watch( () => props.refresh, diff --git a/src/components/Echarts/barChart.vue b/src/components/Echarts/barChart.vue index 5a467d0..f0b7a15 100644 --- a/src/components/Echarts/barChart.vue +++ b/src/components/Echarts/barChart.vue @@ -3,6 +3,7 @@ diff --git a/src/views/oneMap/Echarts/AssessmentjsEcharts.vue b/src/views/oneMap/Echarts/AssessmentjsEcharts.vue index 5fea924..b58cdc4 100644 --- a/src/views/oneMap/Echarts/AssessmentjsEcharts.vue +++ b/src/views/oneMap/Echarts/AssessmentjsEcharts.vue @@ -20,9 +20,11 @@ timer: null, }); const resizeTheChart = () => { - if (allData.chart) { - allData.chart.resize(); - } + nextTick(() => { + if (allData.chart) { + allData.chart.resize(); + } + }); }; const init = () => { diff --git a/src/views/oneMap/Echarts/ChartLs.vue b/src/views/oneMap/Echarts/ChartLs.vue index b083a8b..c88eca0 100644 --- a/src/views/oneMap/Echarts/ChartLs.vue +++ b/src/views/oneMap/Echarts/ChartLs.vue @@ -48,9 +48,11 @@ ); //自适应 function resizeTheChart() { - if (myChart.value) { - myChart.value.resize(); - } + nextTick(() => { + if (myChart.value) { + myChart.value.resize(); + } + }); } // 重绘之前的样式填充 function reasizeFun() { diff --git a/src/views/oneMap/Echarts/RainfallLegend.vue b/src/views/oneMap/Echarts/RainfallLegend.vue index 62292a6..ce39fe6 100644 --- a/src/views/oneMap/Echarts/RainfallLegend.vue +++ b/src/views/oneMap/Echarts/RainfallLegend.vue @@ -2,11 +2,11 @@
diff --git a/src/views/oneMap/SmartDrainage/qzfk_3d.vue b/src/views/oneMap/SmartDrainage/qzfk_3d.vue index 9b252a0..7aeff03 100644 --- a/src/views/oneMap/SmartDrainage/qzfk_3d.vue +++ b/src/views/oneMap/SmartDrainage/qzfk_3d.vue @@ -386,9 +386,11 @@ //自适应 function resizeTheChart() { - if (myChart.value) { - myChart.value.resize(); - } + nextTick(() => { + if (myChart.value) { + myChart.value.resize(); + } + }); } watch( () => props.refresh, diff --git a/src/views/oneMap/components/PublicHead.vue b/src/views/oneMap/components/PublicHead.vue index e661304..f0bc0cd 100644 --- a/src/views/oneMap/components/PublicHead.vue +++ b/src/views/oneMap/components/PublicHead.vue @@ -51,14 +51,16 @@ // 获取要显示倒计时的HTML元素 const intervalId = ref(null); -const currentTime = ref(null); +// const currentTime = ref(null); const futureTime2 = ref(null); const futureTime = ref(null); const timeDifference = ref(null); function runTime() { - futureTime2.value = new Date(AllData.showTipsData.warnStartTime).getTime(); //开始时间 - currentTime.value = new Date().getTime(); - futureTime.value = new Date(currentTime.value).getTime(); // 当前时间 + if (futureTime2.value == null) { + futureTime2.value = new Date(AllData.showTipsData.warnStartTime).getTime(); //开始时间 + } + // currentTime.value = new Date().getTime(); + futureTime.value = new Date().getTime(); // 当前时间 // console.log(futureTime, '当前时间'); timeDifference.value = futureTime2.value - futureTime.value; let days = Math.floor(timeDifference.value / (1000 * 60 * 60 * 24)); @@ -91,6 +93,7 @@ } else { showTips.value = true; AllData.showTipsData = val; + futureTime2.value = null; runTime(); } }); diff --git a/src/components/Echarts/barChart.vue b/src/components/Echarts/barChart.vue index 5a467d0..f0b7a15 100644 --- a/src/components/Echarts/barChart.vue +++ b/src/components/Echarts/barChart.vue @@ -3,6 +3,7 @@ diff --git a/src/views/oneMap/Echarts/AssessmentjsEcharts.vue b/src/views/oneMap/Echarts/AssessmentjsEcharts.vue index 5fea924..b58cdc4 100644 --- a/src/views/oneMap/Echarts/AssessmentjsEcharts.vue +++ b/src/views/oneMap/Echarts/AssessmentjsEcharts.vue @@ -20,9 +20,11 @@ timer: null, }); const resizeTheChart = () => { - if (allData.chart) { - allData.chart.resize(); - } + nextTick(() => { + if (allData.chart) { + allData.chart.resize(); + } + }); }; const init = () => { diff --git a/src/views/oneMap/Echarts/ChartLs.vue b/src/views/oneMap/Echarts/ChartLs.vue index b083a8b..c88eca0 100644 --- a/src/views/oneMap/Echarts/ChartLs.vue +++ b/src/views/oneMap/Echarts/ChartLs.vue @@ -48,9 +48,11 @@ ); //自适应 function resizeTheChart() { - if (myChart.value) { - myChart.value.resize(); - } + nextTick(() => { + if (myChart.value) { + myChart.value.resize(); + } + }); } // 重绘之前的样式填充 function reasizeFun() { diff --git a/src/views/oneMap/Echarts/RainfallLegend.vue b/src/views/oneMap/Echarts/RainfallLegend.vue index 62292a6..ce39fe6 100644 --- a/src/views/oneMap/Echarts/RainfallLegend.vue +++ b/src/views/oneMap/Echarts/RainfallLegend.vue @@ -2,11 +2,11 @@
diff --git a/src/views/oneMap/SmartDrainage/qzfk_3d.vue b/src/views/oneMap/SmartDrainage/qzfk_3d.vue index 9b252a0..7aeff03 100644 --- a/src/views/oneMap/SmartDrainage/qzfk_3d.vue +++ b/src/views/oneMap/SmartDrainage/qzfk_3d.vue @@ -386,9 +386,11 @@ //自适应 function resizeTheChart() { - if (myChart.value) { - myChart.value.resize(); - } + nextTick(() => { + if (myChart.value) { + myChart.value.resize(); + } + }); } watch( () => props.refresh, diff --git a/src/views/oneMap/components/PublicHead.vue b/src/views/oneMap/components/PublicHead.vue index e661304..f0bc0cd 100644 --- a/src/views/oneMap/components/PublicHead.vue +++ b/src/views/oneMap/components/PublicHead.vue @@ -51,14 +51,16 @@ // 获取要显示倒计时的HTML元素 const intervalId = ref(null); -const currentTime = ref(null); +// const currentTime = ref(null); const futureTime2 = ref(null); const futureTime = ref(null); const timeDifference = ref(null); function runTime() { - futureTime2.value = new Date(AllData.showTipsData.warnStartTime).getTime(); //开始时间 - currentTime.value = new Date().getTime(); - futureTime.value = new Date(currentTime.value).getTime(); // 当前时间 + if (futureTime2.value == null) { + futureTime2.value = new Date(AllData.showTipsData.warnStartTime).getTime(); //开始时间 + } + // currentTime.value = new Date().getTime(); + futureTime.value = new Date().getTime(); // 当前时间 // console.log(futureTime, '当前时间'); timeDifference.value = futureTime2.value - futureTime.value; let days = Math.floor(timeDifference.value / (1000 * 60 * 60 * 24)); @@ -91,6 +93,7 @@ } else { showTips.value = true; AllData.showTipsData = val; + futureTime2.value = null; runTime(); } }); diff --git a/src/views/oneMap/floodPrevention/dispatchEch.vue b/src/views/oneMap/floodPrevention/dispatchEch.vue index 457b3cb..c4d2b1f 100644 --- a/src/views/oneMap/floodPrevention/dispatchEch.vue +++ b/src/views/oneMap/floodPrevention/dispatchEch.vue @@ -34,9 +34,11 @@ ); //自适应 function resizeTheChart() { - if (myChart.value) { - myChart.value.resize(); - } + nextTick(() => { + if (myChart.value) { + myChart.value.resize(); + } + }); } //初始化 function intChart() { diff --git a/src/components/Echarts/barChart.vue b/src/components/Echarts/barChart.vue index 5a467d0..f0b7a15 100644 --- a/src/components/Echarts/barChart.vue +++ b/src/components/Echarts/barChart.vue @@ -3,6 +3,7 @@ diff --git a/src/views/oneMap/Echarts/AssessmentjsEcharts.vue b/src/views/oneMap/Echarts/AssessmentjsEcharts.vue index 5fea924..b58cdc4 100644 --- a/src/views/oneMap/Echarts/AssessmentjsEcharts.vue +++ b/src/views/oneMap/Echarts/AssessmentjsEcharts.vue @@ -20,9 +20,11 @@ timer: null, }); const resizeTheChart = () => { - if (allData.chart) { - allData.chart.resize(); - } + nextTick(() => { + if (allData.chart) { + allData.chart.resize(); + } + }); }; const init = () => { diff --git a/src/views/oneMap/Echarts/ChartLs.vue b/src/views/oneMap/Echarts/ChartLs.vue index b083a8b..c88eca0 100644 --- a/src/views/oneMap/Echarts/ChartLs.vue +++ b/src/views/oneMap/Echarts/ChartLs.vue @@ -48,9 +48,11 @@ ); //自适应 function resizeTheChart() { - if (myChart.value) { - myChart.value.resize(); - } + nextTick(() => { + if (myChart.value) { + myChart.value.resize(); + } + }); } // 重绘之前的样式填充 function reasizeFun() { diff --git a/src/views/oneMap/Echarts/RainfallLegend.vue b/src/views/oneMap/Echarts/RainfallLegend.vue index 62292a6..ce39fe6 100644 --- a/src/views/oneMap/Echarts/RainfallLegend.vue +++ b/src/views/oneMap/Echarts/RainfallLegend.vue @@ -2,11 +2,11 @@
diff --git a/src/views/oneMap/SmartDrainage/qzfk_3d.vue b/src/views/oneMap/SmartDrainage/qzfk_3d.vue index 9b252a0..7aeff03 100644 --- a/src/views/oneMap/SmartDrainage/qzfk_3d.vue +++ b/src/views/oneMap/SmartDrainage/qzfk_3d.vue @@ -386,9 +386,11 @@ //自适应 function resizeTheChart() { - if (myChart.value) { - myChart.value.resize(); - } + nextTick(() => { + if (myChart.value) { + myChart.value.resize(); + } + }); } watch( () => props.refresh, diff --git a/src/views/oneMap/components/PublicHead.vue b/src/views/oneMap/components/PublicHead.vue index e661304..f0bc0cd 100644 --- a/src/views/oneMap/components/PublicHead.vue +++ b/src/views/oneMap/components/PublicHead.vue @@ -51,14 +51,16 @@ // 获取要显示倒计时的HTML元素 const intervalId = ref(null); -const currentTime = ref(null); +// const currentTime = ref(null); const futureTime2 = ref(null); const futureTime = ref(null); const timeDifference = ref(null); function runTime() { - futureTime2.value = new Date(AllData.showTipsData.warnStartTime).getTime(); //开始时间 - currentTime.value = new Date().getTime(); - futureTime.value = new Date(currentTime.value).getTime(); // 当前时间 + if (futureTime2.value == null) { + futureTime2.value = new Date(AllData.showTipsData.warnStartTime).getTime(); //开始时间 + } + // currentTime.value = new Date().getTime(); + futureTime.value = new Date().getTime(); // 当前时间 // console.log(futureTime, '当前时间'); timeDifference.value = futureTime2.value - futureTime.value; let days = Math.floor(timeDifference.value / (1000 * 60 * 60 * 24)); @@ -91,6 +93,7 @@ } else { showTips.value = true; AllData.showTipsData = val; + futureTime2.value = null; runTime(); } }); diff --git a/src/views/oneMap/floodPrevention/dispatchEch.vue b/src/views/oneMap/floodPrevention/dispatchEch.vue index 457b3cb..c4d2b1f 100644 --- a/src/views/oneMap/floodPrevention/dispatchEch.vue +++ b/src/views/oneMap/floodPrevention/dispatchEch.vue @@ -34,9 +34,11 @@ ); //自适应 function resizeTheChart() { - if (myChart.value) { - myChart.value.resize(); - } + nextTick(() => { + if (myChart.value) { + myChart.value.resize(); + } + }); } //初始化 function intChart() { diff --git a/src/views/oneMap/index.vue b/src/views/oneMap/index.vue index 5b466eb..9acc3cb 100644 --- a/src/views/oneMap/index.vue +++ b/src/views/oneMap/index.vue @@ -60,7 +60,7 @@