优化项目结构
优化路由结构及跳转 优化系统异常捕获 1 号线增加导出功能 增加全局状态管理
This commit is contained in:
42
src/views/Line1/alarm-records/data.ts
Normal file
42
src/views/Line1/alarm-records/data.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import type { TableColumnType, TableColumnsType } from "ant-design-vue";
|
||||
|
||||
const INDEX_COLUMN: TableColumnType = {
|
||||
key: "index",
|
||||
title: "序号",
|
||||
width: 60,
|
||||
fixed: true,
|
||||
align: "center",
|
||||
} as const;
|
||||
|
||||
// 定义操作列配置
|
||||
const ACTION_COLUMN: TableColumnType = {
|
||||
key: "action",
|
||||
title: "操作",
|
||||
width: 120,
|
||||
ellipsis: true,
|
||||
fixed: "right",
|
||||
align: "center",
|
||||
} as const;
|
||||
|
||||
// 使用 Record 类型确保键值对的安全性
|
||||
export const fields: Record<string, string> = {
|
||||
alarmId: "报警ID",
|
||||
alarmCode: "报警代码",
|
||||
alarmMsg: "报警信息",
|
||||
alarmDatetime: "报警时间",
|
||||
updateTime: "更新时间",
|
||||
updateBy: "更新人",
|
||||
createTime: "创建时间",
|
||||
createBy: "创建人",
|
||||
} as const;
|
||||
|
||||
// 导出完整的列配置
|
||||
export const columns: TableColumnsType = [
|
||||
INDEX_COLUMN,
|
||||
...Object.entries(fields).map(([key, title]) => ({
|
||||
key,
|
||||
title,
|
||||
ellipsis: true,
|
||||
})),
|
||||
ACTION_COLUMN,
|
||||
];
|
||||
Reference in New Issue
Block a user