diff --git a/.env.development b/.env.development index 1da30e4..40f3eed 100644 --- a/.env.development +++ b/.env.development @@ -2,4 +2,5 @@ VITE_APP_BASE_API=/api -VITE_APP_BASE_URL=http://192.168.1.38:18081 \ No newline at end of file +VITE_APP_BASE_URL=http://192.168.1.143:18081 +# VITE_APP_BASE_URL=http://192.168.1.38:18081 \ No newline at end of file diff --git a/src/api/data/index.ts b/src/api/data/index.ts index 3d1fffc..87f75d0 100644 --- a/src/api/data/index.ts +++ b/src/api/data/index.ts @@ -17,4 +17,13 @@ export function getL4Data(params: QueryParams) { method: 'get', params }) -} \ No newline at end of file +} + +// 获取 报警记录 数据 +export function getAlarmRecords(params: QueryParams) { + return request({ + url: '/jinghua/alarmRecord/list', + method: 'get', + params + }) +} diff --git a/src/components/LmsStatus/index.vue b/src/components/LmsStatus/index.vue index b74eef3..b87b7fe 100644 --- a/src/components/LmsStatus/index.vue +++ b/src/components/LmsStatus/index.vue @@ -20,8 +20,9 @@
- L1 数据 - L4 数据 + L1 数据 + L4 数据 + 报警记录
@@ -77,7 +78,7 @@ async function initLmsStatus() { const router = useRouter(); function redirectTo(type: string) { - router.push(`/${type}-data`); + router.push(`/${type}`); } // 初始化 LMS 状态 diff --git a/src/router/index.ts b/src/router/index.ts index 2724539..c5681bc 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -6,6 +6,11 @@ const routes = [ name: 'Index', component: () => import('@/views/index.vue') }, + { + path: '/lms', + name: 'Lms', + component: () => import('@/views/lms/index.vue') + }, { path: '/login', name: 'Login', @@ -25,6 +30,11 @@ const routes = [ path: '/L4-data', name: 'L4Data', component: () => import('@/views/L4-data-list/index.vue') + }, + { + path: '/alarm-records', + name: 'AlarmRecords', + component: () => import('@/views/alarm-records/index.vue') } ]; diff --git a/src/views/alarm-records/data.ts b/src/views/alarm-records/data.ts new file mode 100644 index 0000000..d84b66e --- /dev/null +++ b/src/views/alarm-records/data.ts @@ -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 = { + 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, +]; diff --git a/src/views/alarm-records/index.vue b/src/views/alarm-records/index.vue new file mode 100644 index 0000000..7e25a41 --- /dev/null +++ b/src/views/alarm-records/index.vue @@ -0,0 +1,237 @@ + + + + + diff --git a/src/views/alarm-records/types.ts b/src/views/alarm-records/types.ts new file mode 100644 index 0000000..43c3754 --- /dev/null +++ b/src/views/alarm-records/types.ts @@ -0,0 +1,25 @@ +export interface AlarmRecord { + /** 报警ID */ + alarmId: number; + + /** 报警代码 */ + alarmCode: number; + + /** 报警信息 */ + alarmMsg: string; + + /** 报警时间 */ + alarmDatetime: string; // ISO 8601 格式,如 "2025-09-23T12:34:56" + + /** 更新时间 */ + updateTime: string; // ISO 8601 格式 + + /** 更新人 */ + updateBy: string; + + /** 创建时间 */ + createTime: string; // ISO 8601 格式 + + /** 创建人 */ + createBy: string; +} diff --git a/src/views/index.vue b/src/views/index.vue index 1fba1df..2e2f543 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -142,13 +142,13 @@ const handleProcessPass = () => { // 复检序号检查 const handleRecheckSequence = () => { - addPackageLog('开始执行复检序号检查操作'); + addDetectionLog('开始执行复检序号检查操作'); console.log('复检序号检查'); }; // 序号检查 const handleSequenceCheck = () => { - addPackageLog('开始执行序号检查操作'); + addDetectionLog('开始执行序号检查操作'); console.log('序号检查'); }; diff --git a/src/views/lms/index.vue b/src/views/lms/index.vue new file mode 100644 index 0000000..ccc22c7 --- /dev/null +++ b/src/views/lms/index.vue @@ -0,0 +1,937 @@ + + + + + \ No newline at end of file