Browse Source

fix: 图表默认调用

feature-v1.0.0
ruancuihong 1 month ago
parent
commit
29707ae2e4
  1. 7
      src/views/Main/DailyPatrolCard/index.vue
  2. 2
      src/views/Main/RiskInspectionCard/index.vue

7
src/views/Main/DailyPatrolCard/index.vue

@ -41,7 +41,7 @@ const handleResize = () => {
const dailyData: any = ref([]);
const dailyCount = ref(0);
const getChartData = async (time: any) => {
dailyCount.value = 0
dailyCount.value = 0;
dailyData.value = [];
const pramas = {
// endTime: '',
@ -219,14 +219,15 @@ const initChart = () => {
// Set options and render chart
chart.setOption(option);
};watch(
};
watch(
() => props.timeRange,
(newVal) => {
getChartData(newVal);
}
);
onMounted(() => {
getChartData(props.timeRange);
// getChartData(props.timeRange);
window.addEventListener('resize', handleResize);
});

2
src/views/Main/RiskInspectionCard/index.vue

@ -445,7 +445,7 @@ watch(
}
);
onMounted(() => {
getChartData(props.timeRange);
// getChartData(props.timeRange);
window.addEventListener('resize', handleResize);
});

Loading…
Cancel
Save