Commit 4a311364 authored by mahui's avatar mahui

init

parent c7994539
...@@ -443,6 +443,9 @@ ...@@ -443,6 +443,9 @@
function tabActive(item) { function tabActive(item) {
if (state.tab != item.value) { if (state.tab != item.value) {
state.tab = item.value; state.tab = item.value;
if(item.value=='base'){
initGauge();
}
if(item.value=='history'){ if(item.value=='history'){
getList(); getList();
} }
...@@ -452,6 +455,7 @@ ...@@ -452,6 +455,7 @@
} }
} }
function initGauge(){ function initGauge(){
nextTick(()=>{
state.myChart = echarts.init(chart.value); state.myChart = echarts.init(chart.value);
let option = { let option = {
series: [ series: [
...@@ -541,7 +545,10 @@ ...@@ -541,7 +545,10 @@
} }
] ]
}; };
state.myChart.clear();
state.myChart.setOption(option); state.myChart.setOption(option);
state.myChart.resize();
})
} }
function getList(){ function getList(){
...@@ -585,11 +592,9 @@ ...@@ -585,11 +592,9 @@
return {text:'...',color:'#f78131'}; return {text:'...',color:'#f78131'};
} }
} }
onMounted(async () => { onMounted(() => {
getDetail(); getDetail();
await nextTick(()=>{
initGauge(); initGauge();
})
}); });
return { return {
...toRefs(state), ...toRefs(state),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment