Commit 7d6ebf8b by 李伟康

feat(src/views/earlyWarningManager/strategyCentre): 添加监控卡片入场动画和加载状态

1. 为monitorCard组件添加showCard淡入动画并应用到卡片样式
2. 为策略中心页面添加加载状态逻辑,包括加载容器样式
3. 调整卡片列表渲染逻辑,增加加载态判断和空状态模板封装
1 parent 617a5909
...@@ -251,7 +251,14 @@ $bg-red: #fef0f0; ...@@ -251,7 +251,14 @@ $bg-red: #fef0f0;
$text-red: #f53f3f; $text-red: #f53f3f;
$bg-orange: #fdf6ec; $bg-orange: #fdf6ec;
$text-orange: #ff7d00; $text-orange: #ff7d00;
@keyframes showCard {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
.monitor-card { .monitor-card {
background: #fff; background: #fff;
border-radius: 8px; border-radius: 8px;
...@@ -261,6 +268,7 @@ $text-orange: #ff7d00; ...@@ -261,6 +268,7 @@ $text-orange: #ff7d00;
transition: all 0.3s; transition: all 0.3s;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
animation: showCard 0.3s ease-in-out;
&:hover { &:hover {
border: 1px solid #0000001a; border: 1px solid #0000001a;
background: #f9f9f9; background: #f9f9f9;
......
...@@ -64,30 +64,36 @@ ...@@ -64,30 +64,36 @@
<!-- 3. 卡片内容区 --> <!-- 3. 卡片内容区 -->
<div class="content-area"> <div class="content-area">
<el-row v-if="cardList.length > 0" <div v-if="loading"
justify="start" v-loading="loading"
type="flex" class="loading-container">
:gutter="16">
<el-col v-for="(item, index) in cardList"
:key="index"
class="col-item"
:span="8">
<MonitorCard :card-data="item"
:current-tab="currentTab"
:date-range="dateRange"
:index="index"
:time-range-type="timeRangeType"
@checkbox-change="handleCheckboxChange"
@jumpDetail="handleJumpDetail">
</MonitorCard>
</el-col>
</el-row>
<div v-else class="empty-data">
<img alt="暂无数据" :src="noDataImg">
<div class="empty-text">
暂无数据
</div>
</div> </div>
<template v-else>
<el-row v-if="cardList.length > 0"
justify="start"
type="flex"
:gutter="16">
<el-col v-for="(item, index) in cardList"
:key="index"
class="col-item"
:span="8">
<MonitorCard :card-data="item"
:current-tab="currentTab"
:date-range="dateRange"
:index="index"
:time-range-type="timeRangeType"
@checkbox-change="handleCheckboxChange"
@jumpDetail="handleJumpDetail">
</MonitorCard>
</el-col>
</el-row>
<div v-else class="empty-data">
<img alt="暂无数据" :src="noDataImg">
<div class="empty-text">
暂无数据
</div>
</div>
</template>
</div> </div>
<!-- 批量下发策略组件 --> <!-- 批量下发策略组件 -->
...@@ -206,6 +212,7 @@ export default { ...@@ -206,6 +212,7 @@ export default {
cardList: [], cardList: [],
// 批量下发策略弹窗 // 批量下发策略弹窗
addStrategyVisible: false, addStrategyVisible: false,
loading: true,
}; };
}, },
computed: { computed: {
...@@ -403,6 +410,7 @@ export default { ...@@ -403,6 +410,7 @@ export default {
Object.entries(params).filter(([_, v]) => v != null && v !== "" && !(Array.isArray(v) && v.length === 0)), Object.entries(params).filter(([_, v]) => v != null && v !== "" && !(Array.isArray(v) && v.length === 0)),
); );
// getMonitorList(cleanParams).then((res) => { // getMonitorList(cleanParams).then((res) => {
this.loading = true;
getWarningSummaryList(cleanParams).then((res) => { getWarningSummaryList(cleanParams).then((res) => {
if (res) { if (res) {
console.log("getWarningSummaryList", res); console.log("getWarningSummaryList", res);
...@@ -410,7 +418,12 @@ export default { ...@@ -410,7 +418,12 @@ export default {
this.cardList = Array.isArray(res) this.cardList = Array.isArray(res)
? res.map(item => ({ ...item, checked: false })) ? res.map(item => ({ ...item, checked: false }))
: res; : res;
this.loading = false;
} else {
this.loading = false;
} }
}).finally(() => {
this.loading = false;
}); });
}, },
// 获取车品牌列表 // 获取车品牌列表
...@@ -885,6 +898,10 @@ $bg-white: #fff; ...@@ -885,6 +898,10 @@ $bg-white: #fff;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: flex-start; justify-content: flex-start;
} }
.loading-container {
width: 100%;
height: 100%;
}
} }
.col-item { .col-item {
margin-bottom: 16px; margin-bottom: 16px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!