feat:代码优化与Mock数据清理

This commit is contained in:
liailing1026
2026-01-30 15:27:00 +08:00
parent 6e4d8f0b6d
commit 1682a8892d
24 changed files with 1364 additions and 3193 deletions

View File

@@ -1,18 +1,11 @@
<template>
<teleport to="body">
<div class="notification-container">
<transition-group
name="notification"
tag="div"
class="notification-list"
>
<transition-group name="notification" tag="div" class="notification-list">
<div
v-for="notification in notifications"
:key="notification.id"
:class="[
'notification-item',
`notification-${notification.type || 'info'}`
]"
:class="['notification-item', `notification-${notification.type || 'info'}`]"
:style="{ zIndex: notification.zIndex || 1000 }"
>
<div class="notification-content">
@@ -36,10 +29,7 @@
</div>
</div>
<div v-if="notification.showProgress" class="notification-progress">
<div
class="progress-bar"
:style="{ width: `${notification.progress || 0}%` }"
></div>
<div class="progress-bar" :style="{ width: `${notification.progress || 0}%` }"></div>
</div>
</div>
</transition-group>
@@ -48,12 +38,10 @@
</template>
<script setup lang="ts">
import { computed } from 'vue'
import {
Close,
SuccessFilled as IconSuccess,
WarningFilled as IconWarning,
CircleCloseFilled,
InfoFilled
} from '@element-plus/icons-vue'
import type { NotificationItem } from '@/composables/useNotification'
@@ -138,22 +126,6 @@ const getIcon = (type?: string) => {
justify-content: center;
}
.notification-icon .success {
color: #67c23a;
}
.notification-icon .warning {
color: #e6a23c;
}
.notification-icon .error {
color: #f56c6c;
}
.notification-icon .info {
color: #409eff;
}
.notification-message {
flex: 1;
min-width: 0;