Commit 7d6ebf8b by 李伟康

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

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