feat: 修改主页展示
This commit is contained in:
parent
db3dc079aa
commit
039f780bc5
|
|
@ -7,7 +7,7 @@
|
|||
<span style="font-size: 26px; font-weight: 600;color:var(--td-brand-color)">{{systemInfo.base_name}}</span>
|
||||
</template>
|
||||
<template #operations>
|
||||
<t-button variant="outline" :icon="user">{{ userInfo.name }}
|
||||
<t-button variant="outline">{{ userInfo.name }}
|
||||
</t-button>
|
||||
<t-button variant="text" shape="square" @click="handleQuit" style="margin-left: 2px;">
|
||||
<template #icon><t-icon name="logout" style="color: #ff0000;" /></template>
|
||||
|
|
|
|||
|
|
@ -191,35 +191,32 @@ const textInterval = setInterval(() => {
|
|||
textIndex = (textIndex + 1) % loadingTexts.length;
|
||||
}, 800);
|
||||
|
||||
// 模拟API调用延迟
|
||||
setTimeout(() => {
|
||||
http.postForm("/cal/", formData).then(res => {
|
||||
const elapsedTime = Date.now() - startTime; // 已过去的时间
|
||||
const remainingTime = Math.max(0, minLoadingTime - elapsedTime); // 还需要等待的时间
|
||||
http.postForm("/cal/", formData).then(res => {
|
||||
const elapsedTime = Date.now() - startTime; // 已过去的时间
|
||||
const remainingTime = Math.max(0, minLoadingTime - elapsedTime); // 还需要等待的时间
|
||||
|
||||
setTimeout(() => {
|
||||
clearInterval(textInterval);
|
||||
calLoading.value = false;
|
||||
score.value = res.total_score;
|
||||
|
||||
// 动画完成后显示结果
|
||||
setTimeout(() => {
|
||||
clearInterval(textInterval);
|
||||
calLoading.value = false;
|
||||
score.value = res.total_score;
|
||||
|
||||
// 动画完成后显示结果
|
||||
setTimeout(() => {
|
||||
showAnimation.value = false;
|
||||
showResult.value = true;
|
||||
}, 500);
|
||||
}, remainingTime);
|
||||
|
||||
}).catch(e => {
|
||||
const elapsedTime = Date.now() - startTime;
|
||||
const remainingTime = Math.max(0, minLoadingTime - elapsedTime);
|
||||
|
||||
setTimeout(() => {
|
||||
clearInterval(textInterval);
|
||||
calLoading.value = false;
|
||||
showAnimation.value = false;
|
||||
}, remainingTime);
|
||||
});
|
||||
}, 3000); // 模拟网络延迟
|
||||
showResult.value = true;
|
||||
}, 500);
|
||||
}, remainingTime);
|
||||
|
||||
}).catch(e => {
|
||||
const elapsedTime = Date.now() - startTime;
|
||||
const remainingTime = Math.max(0, minLoadingTime - elapsedTime);
|
||||
|
||||
setTimeout(() => {
|
||||
clearInterval(textInterval);
|
||||
calLoading.value = false;
|
||||
showAnimation.value = false;
|
||||
}, remainingTime);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,13 @@
|
|||
<template>
|
||||
<t-row>
|
||||
<t-col :flex="3">
|
||||
<t-col :sm="12" :md="6">
|
||||
<t-card hoverShadow header-bordered>
|
||||
<template #header>
|
||||
<div class="redTitle" @click="goDq">转型金融贷前计算器</div>
|
||||
<t-button @click="goDq">前往测算</t-button>
|
||||
</template>
|
||||
<xt-chart :option="option" :key="chartKey" height="400px" @chart-click="handleChartClick"></xt-chart>
|
||||
<div style="height:400px" v-if="!chartShow"></div>
|
||||
<xt-chart :option="option" height="400px" @chart-click="handleChartClick" v-else></xt-chart>
|
||||
<!-- 悬浮提示框 -->
|
||||
<t-dialog
|
||||
v-model:visible="dialogVisible"
|
||||
|
|
@ -47,7 +49,7 @@
|
|||
</div>
|
||||
</t-card>
|
||||
</t-col>
|
||||
<t-col :flex="3">
|
||||
<t-col :sm="12" :md="6">
|
||||
<t-card hoverShadow header-bordered>
|
||||
<template #header>
|
||||
<div class="redTitle" @click="goDh">转型金融贷后计算器</div>
|
||||
|
|
@ -71,7 +73,6 @@ const goDh = () => {
|
|||
}
|
||||
|
||||
// 添加响应式变量
|
||||
const chartKey = ref(0);
|
||||
const currentData = ref([35, 20, 10, 10, 10, 8, 7]);
|
||||
const dialogVisible = ref(false);
|
||||
const currentIndicator = ref(null);
|
||||
|
|
@ -256,16 +257,14 @@ const updateRadarData = () => {
|
|||
|
||||
// 更新图表数据
|
||||
option.value.series[0].data[0].value = newData;
|
||||
|
||||
// 强制图表重新渲染
|
||||
chartKey.value += 1;
|
||||
};
|
||||
|
||||
// 定时器引用
|
||||
let timer = null;
|
||||
|
||||
const chartShow = ref(false);
|
||||
onMounted(() => {
|
||||
// 每2秒更新一次数据
|
||||
// 每4秒更新一次数据
|
||||
setTimeout(() =>{ chartShow.value = true;}, 200);
|
||||
timer = setInterval(updateRadarData, 4000);
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue