skyline vor 1 Tag
Ursprung
Commit
440ebcbf26
1 geänderte Dateien mit 6 neuen und 5 gelöschten Zeilen
  1. 6 5
      admin-web/src/views/admin/notice/index.vue

+ 6 - 5
admin-web/src/views/admin/notice/index.vue

@@ -138,7 +138,6 @@
 import { ref, reactive, onMounted } from 'vue';
 import { ElMessage, ElMessageBox, FormInstance } from 'element-plus';
 import { $get, $body } from '/@/utils/request';
-import u from '/@/utils/u';
 
 // 查询参数
 const queryParams = reactive({
@@ -180,13 +179,15 @@ const mockData = [
     { id: 3, title: '新功能上线', content: '消息通知中心功能已上线', adminUserName: '管理员', status: 2, target: 'merchant', startTime: '2024-01-01 00:00:00', endTime: '2024-01-10 23:59:59', createTime: '2024-01-01 08:00:00' }
 ];
 
-// 目标显示映射(不依赖字典,确保字典未加载时也能正常显示)
+// 目标显示映射
 const targetMap: Record<string, string> = { client: '客户端', merchant: '商户端', all: '全部' };
 const getTargetLabel = (target: string) => targetMap[target] || target || '--';
 
-// 获取状态标签
-const getStatusLabel = (status: number) => u.fmt.fmtDict(status, 'notice_status');
-const getStatusType = (status: number) => u.fmt.fmtDictColor(status, 'notice_status');
+// 状态显示映射(不依赖字典,避免字典未加载时崩溃)
+const statusLabelMap: Record<number, string> = { 0: '未开始', 1: '生效中', 2: '已结束', 3: '已取消' };
+const statusTypeMap: Record<number, string> = { 0: 'info', 1: 'success', 2: '', 3: 'danger' };
+const getStatusLabel = (status: number) => statusLabelMap[status] || '--';
+const getStatusType = (status: number) => statusTypeMap[status] || '';
 
 // 查询数据
 const handleQuery = async () => {