Files
admin-vben5/apps/web-antd/src/views/videoSystem/videoWarning/videoWarningProcessing/data.ts

224 lines
4.5 KiB
TypeScript
Raw Normal View History

import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
import { h } from 'vue';
2025-08-15 14:08:35 +08:00
import { getPopupContainer } from '@vben/utils';
import { getDictOptions } from '#/utils/dict';
import { DictEnum } from '@vben/constants';
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'alarmType',
label: '视频预警类型',
},
{
component: 'Select',
componentProps: {
2025-08-15 14:08:35 +08:00
getPopupContainer,
options: getDictOptions(DictEnum.alarm_level),
},
fieldName: 'level',
label: '级别',
},
{
component: 'Select',
componentProps: {
2025-08-15 14:08:35 +08:00
getPopupContainer,
options: getDictOptions(DictEnum.alarm_state),
},
2025-08-15 14:08:35 +08:00
fieldName: 'state',
label: '处理状态',
},
];
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '预警编号',
2025-08-15 14:08:35 +08:00
field: 'id',
},
{
title: '预警时间',
2025-08-15 14:08:35 +08:00
field: 'reportTime',
},
2025-08-12 13:51:35 +08:00
{
title: '设备名称',
field: 'deviceName',
},
{
title: '级别',
field: 'level',
slots: {
default: ({ row }: any) => {
const levelColors: Record<string, string> = {
2025-08-15 14:08:35 +08:00
1: 'red',
2: 'orange',
3: 'blue',
};
return h(
'span',
{
style: {
color: levelColors[row.level] || '#666',
fontWeight: 'bold',
},
},
2025-08-15 14:08:35 +08:00
row.levelName,
);
},
},
},
{
title: '预警类型',
2025-08-15 14:08:35 +08:00
field: 'alarmTypeName',
slots: {
default: ({ row }: any) => {
2025-08-15 14:08:35 +08:00
return h('span', row.bigTypeName + '-' + row.smallTypeName);
},
},
},
{
2025-08-15 14:08:35 +08:00
title: '处理状态',
field: 'stateName',
},
2025-08-12 13:51:35 +08:00
{
title: '预期处理时间',
2025-08-15 14:08:35 +08:00
field: 'processSt',
2025-08-12 13:51:35 +08:00
},
{
title: '处理时间',
2025-08-15 14:08:35 +08:00
field: 'processEt',
},
{
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: 'alarmId',
component: 'Input',
rules: 'required',
2025-08-12 13:51:35 +08:00
disabled: true,
},
{
label: '预警时间',
fieldName: 'alarmTime',
component: 'DatePicker',
componentProps: {
format: 'YYYY.MM.DD HH:mm',
valueFormat: 'YYYY.MM.DD HH:mm',
showTime: true,
},
rules: 'required',
2025-08-12 13:51:35 +08:00
disabled: true,
},
{
label: '预警类型',
fieldName: 'alarmType',
component: 'Input',
rules: 'required',
2025-08-12 13:51:35 +08:00
disabled: true,
},
{
label: '描述',
fieldName: 'description',
2025-08-12 13:51:35 +08:00
component: 'Input',
formItemClass: 'col-span-2',
disabled: true,
},
{
label: '所在位置',
fieldName: 'location',
component: 'Input',
rules: 'required',
disabled: true,
},
{
label: '设备名称',
fieldName: 'deviceName',
component: 'Input',
rules: 'required',
disabled: true,
},
{
label: '处理情况',
fieldName: 'processingDetails',
component: 'Input',
componentProps: {
rows: 3,
},
formItemClass: 'col-span-2',
2025-08-12 13:51:35 +08:00
disabled: true,
},
{
2025-08-12 13:51:35 +08:00
label: '处理时间',
fieldName: 'processingTime',
component: 'DatePicker',
componentProps: {
format: 'YYYY.MM.DD HH:mm',
valueFormat: 'YYYY.MM.DD HH:mm',
showTime: true,
},
disabled: true,
},
{
label: '处理图片',
fieldName: 'imgUrl',
component: 'Input',
rules: 'required',
2025-08-12 13:51:35 +08:00
disabled: true,
},
{
label: '级别',
fieldName: 'level',
component: 'Select',
componentProps: {
options: [
{ label: '特大', value: '特大' },
{ label: '重要', value: '重要' },
{ label: '一般', value: '一般' },
],
},
rules: 'selectRequired',
},
{
label: '处理状态',
fieldName: 'processingStatus',
component: 'Select',
componentProps: {
options: [
{ label: '待分配', value: '待分配' },
{ label: '处理中', value: '处理中' },
{ label: '已完成', value: '已完成' },
],
},
rules: 'selectRequired',
},
{
2025-08-12 13:51:35 +08:00
label: '预期处理时间',
fieldName: 'expectedProcessingTime',
component: 'DatePicker',
componentProps: {
format: 'YYYY.MM.DD HH:mm',
valueFormat: 'YYYY.MM.DD HH:mm',
showTime: true,
},
2025-08-12 13:51:35 +08:00
rules: 'required',
},
];