feat: 修改主页展示

This commit is contained in:
caoqianming 2025-11-12 16:24:28 +08:00
parent db3dc079aa
commit 039f780bc5
3 changed files with 32 additions and 36 deletions

View File

@ -7,7 +7,7 @@
<span style="font-size: 26px; font-weight: 600;color:var(--td-brand-color)">{{systemInfo.base_name}}</span> <span style="font-size: 26px; font-weight: 600;color:var(--td-brand-color)">{{systemInfo.base_name}}</span>
</template> </template>
<template #operations> <template #operations>
<t-button variant="outline" :icon="user">{{ userInfo.name }} <t-button variant="outline">{{ userInfo.name }}
</t-button> </t-button>
<t-button variant="text" shape="square" @click="handleQuit" style="margin-left: 2px;"> <t-button variant="text" shape="square" @click="handleQuit" style="margin-left: 2px;">
<template #icon><t-icon name="logout" style="color: #ff0000;" /></template> <template #icon><t-icon name="logout" style="color: #ff0000;" /></template>

View File

@ -191,35 +191,32 @@ const textInterval = setInterval(() => {
textIndex = (textIndex + 1) % loadingTexts.length; textIndex = (textIndex + 1) % loadingTexts.length;
}, 800); }, 800);
// API http.postForm("/cal/", formData).then(res => {
setTimeout(() => { const elapsedTime = Date.now() - startTime; //
http.postForm("/cal/", formData).then(res => { const remainingTime = Math.max(0, minLoadingTime - elapsedTime); //
const elapsedTime = Date.now() - startTime; //
const remainingTime = Math.max(0, minLoadingTime - elapsedTime); //
setTimeout(() => {
clearInterval(textInterval);
calLoading.value = false;
score.value = res.total_score;
//
setTimeout(() => { 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; showAnimation.value = false;
}, remainingTime); showResult.value = true;
}); }, 500);
}, 3000); // }, 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> </script>

View File

@ -1,11 +1,13 @@
<template> <template>
<t-row> <t-row>
<t-col :flex="3"> <t-col :sm="12" :md="6">
<t-card hoverShadow header-bordered> <t-card hoverShadow header-bordered>
<template #header> <template #header>
<div class="redTitle" @click="goDq">转型金融贷前计算器</div> <div class="redTitle" @click="goDq">转型金融贷前计算器</div>
<t-button @click="goDq">前往测算</t-button>
</template> </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 <t-dialog
v-model:visible="dialogVisible" v-model:visible="dialogVisible"
@ -47,7 +49,7 @@
</div> </div>
</t-card> </t-card>
</t-col> </t-col>
<t-col :flex="3"> <t-col :sm="12" :md="6">
<t-card hoverShadow header-bordered> <t-card hoverShadow header-bordered>
<template #header> <template #header>
<div class="redTitle" @click="goDh">转型金融贷后计算器</div> <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 currentData = ref([35, 20, 10, 10, 10, 8, 7]);
const dialogVisible = ref(false); const dialogVisible = ref(false);
const currentIndicator = ref(null); const currentIndicator = ref(null);
@ -256,16 +257,14 @@ const updateRadarData = () => {
// //
option.value.series[0].data[0].value = newData; option.value.series[0].data[0].value = newData;
//
chartKey.value += 1;
}; };
// //
let timer = null; let timer = null;
const chartShow = ref(false);
onMounted(() => { onMounted(() => {
// 2 // 4
setTimeout(() =>{ chartShow.value = true;}, 200);
timer = setInterval(updateRadarData, 4000); timer = setInterval(updateRadarData, 4000);
}); });