From 8667045f91eea404cb9d948716fb4dbdb7e639a8 Mon Sep 17 00:00:00 2001 From: 15683799673 Date: Fri, 12 Sep 2025 23:05:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=A7=86=E9=A2=91=E9=A2=84?= =?UTF-8?q?=E8=AD=A6=E6=9C=AA=E6=8C=87=E6=B4=BE=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../videoWarningNotAssigned/data.ts | 246 ++++++++++++++++++ .../videoWarningNotAssigned/index.vue | 186 +++++++++++++ .../warning-detail.vue | 148 +++++++++++ .../videoWarningNotAssigned/warning-modal.vue | 159 +++++++++++ 4 files changed, 739 insertions(+) create mode 100644 apps/web-antd/src/views/videoSystem/videoWarning/videoWarningNotAssigned/data.ts create mode 100644 apps/web-antd/src/views/videoSystem/videoWarning/videoWarningNotAssigned/index.vue create mode 100644 apps/web-antd/src/views/videoSystem/videoWarning/videoWarningNotAssigned/warning-detail.vue create mode 100644 apps/web-antd/src/views/videoSystem/videoWarning/videoWarningNotAssigned/warning-modal.vue diff --git a/apps/web-antd/src/views/videoSystem/videoWarning/videoWarningNotAssigned/data.ts b/apps/web-antd/src/views/videoSystem/videoWarning/videoWarningNotAssigned/data.ts new file mode 100644 index 00000000..6299b0b6 --- /dev/null +++ b/apps/web-antd/src/views/videoSystem/videoWarning/videoWarningNotAssigned/data.ts @@ -0,0 +1,246 @@ +import type { FormSchemaGetter } from '#/adapter/form'; +import type { VxeGridProps } from '#/adapter/vxe-table'; +import { h } from 'vue'; +import { getPopupContainer } from '@vben/utils'; +import { getDictOptions } from '#/utils/dict'; +import { DictEnum } from '@vben/constants'; + +export const querySchema: FormSchemaGetter = () => [ + { + component: 'Input', + fieldName: 'deviceName', + label: '设备名称', + }, + { + component: 'DatePicker', + fieldName: 'reportTime', + label: '预警时间', + componentProps: { + format: 'YYYY-MM-DD', + valueFormat: 'YYYY-MM-DD HH:mm:ss', + }, + }, + { + component: 'Input', + fieldName: 'alarmType', + label: '预警类型', + }, + { + component: 'Select', + componentProps: { + getPopupContainer, + options: getDictOptions(DictEnum.alarm_level, true), + }, + fieldName: 'level', + label: '预警级别', + }, +]; + +export const columns: VxeGridProps['columns'] = [ + { type: 'checkbox', width: 60 }, + { + title: '预警编号', + field: 'id', + }, + { + title: '预警时间', + field: 'reportTime', + }, + { + title: '设备IP', + field: 'deviceIp', + }, + { + title: '设备名称', + field: 'deviceName', + }, + { + title: '预警级别', + field: 'level', + slots: { + default: ({ row }: any) => { + const levelColors: Record = { + 1: 'blue', + 2: 'orange', + 3: 'red', + }; + return h( + 'span', + { + style: { + color: levelColors[row.level] || '#666', + fontWeight: 'bold', + }, + }, + row.levelName, + ); + }, + }, + }, + { + title: '预警类型', + field: 'alarmTypeName', + slots: { + default: ({ row }: any) => { + return h('span', row.bigTypeName + '-' + row.smallTypeName); + }, + }, + }, + { + title: '处理状态', + field: 'stateName', + }, + { + title: '创建时间', + field: 'createTime', + }, + { + field: 'action', + fixed: 'right', + slots: { default: 'action' }, + title: '操作', + width: 380, + }, +]; + +export const modalSchema: FormSchemaGetter = () => [ + { + label: '主键', + fieldName: 'id', + component: 'Input', + dependencies: { + show: () => false, + triggerFields: [''], + }, + }, + { + label: '预警编号', + fieldName: 'id', + component: 'Input', + rules: 'required', + disabled: true, + }, + { + label: '预警时间', + fieldName: 'reportTime', + component: 'DatePicker', + componentProps: { + format: 'YYYY.MM.DD HH:mm', + valueFormat: 'YYYY.MM.DD HH:mm', + showTime: true, + }, + disabled: true, + rules: 'required', + }, + { + label: '预警类型', + fieldName: 'alarmType', + component: 'Input', + rules: 'required', + disabled: true, + }, + { + label: '设备IP', + fieldName: 'deviceIp', + component: 'Input', + disabled: true, + rules: 'required', + }, + { + label: '设备名称', + fieldName: 'deviceName', + disabled: true, + component: 'Input', + rules: 'required', + }, + { + label: '预警级别', + fieldName: 'level', + component: 'Select', + disabled: true, + componentProps: { + getPopupContainer, + options: getDictOptions(DictEnum.alarm_level, true), + }, + rules: 'selectRequired', + }, + { + label: '创建时间', + fieldName: 'createTime', + component: 'DatePicker', + disabled: true, + componentProps: { + format: 'YYYY.MM.DD HH:mm', + valueFormat: 'YYYY.MM.DD HH:mm', + showTime: true, + }, + }, + { + label: '处理状态', + component: 'Select', + disabled: true, + componentProps: { + getPopupContainer, + options: getDictOptions(DictEnum.alarm_state, true), + }, + fieldName: 'state', + rules: 'selectRequired', + }, + { + label: '预警描述', + disabled: true, + fieldName: 'description', + component: 'Textarea', + formItemClass: 'col-span-2', + componentProps: { + rows: 3, + }, + }, + // 插入分割线 + { + component: 'Divider', + fieldName: '_divider', + formItemClass: 'col-span-2', + hideLabel: true, + renderComponentContent: () => { + return { + default: () => h('div', '处理'), + }; + }, + }, + + { + label: '处理人', + fieldName: 'solveId', + component: 'Select', + }, + + { + label: '联系电话', + fieldName: 'phonenumber', + component: 'Input', + }, + + { + label: '邮箱', + fieldName: 'email', + component: 'Input', + }, + + { + label: '所在部门', + fieldName: 'deptName', + component: 'Input', + disabled: true, + }, + + { + label: '备注', + fieldName: 'remark', + component: 'Textarea', + formItemClass: 'col-span-2', + componentProps: { + rows: 3, + }, + }, +]; diff --git a/apps/web-antd/src/views/videoSystem/videoWarning/videoWarningNotAssigned/index.vue b/apps/web-antd/src/views/videoSystem/videoWarning/videoWarningNotAssigned/index.vue new file mode 100644 index 00000000..eafa865d --- /dev/null +++ b/apps/web-antd/src/views/videoSystem/videoWarning/videoWarningNotAssigned/index.vue @@ -0,0 +1,186 @@ + + + diff --git a/apps/web-antd/src/views/videoSystem/videoWarning/videoWarningNotAssigned/warning-detail.vue b/apps/web-antd/src/views/videoSystem/videoWarning/videoWarningNotAssigned/warning-detail.vue new file mode 100644 index 00000000..35f172f7 --- /dev/null +++ b/apps/web-antd/src/views/videoSystem/videoWarning/videoWarningNotAssigned/warning-detail.vue @@ -0,0 +1,148 @@ + + + + + diff --git a/apps/web-antd/src/views/videoSystem/videoWarning/videoWarningNotAssigned/warning-modal.vue b/apps/web-antd/src/views/videoSystem/videoWarning/videoWarningNotAssigned/warning-modal.vue new file mode 100644 index 00000000..fac64195 --- /dev/null +++ b/apps/web-antd/src/views/videoSystem/videoWarning/videoWarningNotAssigned/warning-modal.vue @@ -0,0 +1,159 @@ + + + +