This commit is contained in:
@@ -1,12 +1,12 @@
|
|||||||
import type {
|
import type {
|
||||||
ArrangementVO,
|
|
||||||
ArrangementForm,
|
ArrangementForm,
|
||||||
ArrangementQuery,
|
ArrangementQuery,
|
||||||
|
ArrangementVO,
|
||||||
arrangmentListQuery,
|
arrangmentListQuery,
|
||||||
|
AttendanceUserGroup,
|
||||||
} from './model';
|
} from './model';
|
||||||
|
|
||||||
import type { ID, IDS } from '#/api/common';
|
import type { ID, IDS, PageResult } from '#/api/common';
|
||||||
import type { PageResult } from '#/api/common';
|
|
||||||
|
|
||||||
import { requestClient } from '#/api/request';
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
@@ -21,6 +21,7 @@ export function arrangementList(params?: ArrangementQuery) {
|
|||||||
{ params },
|
{ params },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据月份查询排班列表
|
* 根据月份查询排班列表
|
||||||
* @param params
|
* @param params
|
||||||
@@ -92,3 +93,14 @@ export function queryScheduleView(params?: arrangmentListQuery) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询某天排班人员详情列表
|
||||||
|
* @param params
|
||||||
|
* @returns 排班列表
|
||||||
|
*/
|
||||||
|
|
||||||
|
export function queryCurrentSchedu() {
|
||||||
|
return requestClient.get<AttendanceUserGroup[]>(
|
||||||
|
'/property/AttendanceUserGroup/query/currentDay',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
61
apps/web-antd/src/api/sis/alarmEventProcess/index.ts
Normal file
61
apps/web-antd/src/api/sis/alarmEventProcess/index.ts
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
import type { AlarmEventProcessVO, AlarmEventProcessForm, AlarmEventProcessQuery } from './model';
|
||||||
|
|
||||||
|
import type { ID, IDS } from '#/api/common';
|
||||||
|
import type { PageResult } from '#/api/common';
|
||||||
|
|
||||||
|
import { commonExport } from '#/api/helper';
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询告警信息处理流程记录列表
|
||||||
|
* @param params
|
||||||
|
* @returns 告警信息处理流程记录列表
|
||||||
|
*/
|
||||||
|
export function alarmEventProcessList(params?: AlarmEventProcessQuery) {
|
||||||
|
return requestClient.get<PageResult<AlarmEventProcessVO>>('/sis/alarmEventProcess/list', { params });
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出告警信息处理流程记录列表
|
||||||
|
* @param params
|
||||||
|
* @returns 告警信息处理流程记录列表
|
||||||
|
*/
|
||||||
|
export function alarmEventProcessExport(params?: AlarmEventProcessQuery) {
|
||||||
|
return commonExport('/sis/alarmEventProcess/export', params ?? {});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询告警信息处理流程记录详情
|
||||||
|
* @param id id
|
||||||
|
* @returns 告警信息处理流程记录详情
|
||||||
|
*/
|
||||||
|
export function alarmEventProcessInfo(id: ID) {
|
||||||
|
return requestClient.get<AlarmEventProcessVO>(`/sis/alarmEventProcess/${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增告警信息处理流程记录
|
||||||
|
* @param data
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
export function alarmEventProcessAdd(data: AlarmEventProcessForm) {
|
||||||
|
return requestClient.postWithMsg<void>('/sis/alarmEventProcess', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新告警信息处理流程记录
|
||||||
|
* @param data
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
export function alarmEventProcessUpdate(data: AlarmEventProcessForm) {
|
||||||
|
return requestClient.putWithMsg<void>('/sis/alarmEventProcess', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除告警信息处理流程记录
|
||||||
|
* @param id id
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
export function alarmEventProcessRemove(id: ID | IDS) {
|
||||||
|
return requestClient.deleteWithMsg<void>(`/sis/alarmEventProcess/${id}`);
|
||||||
|
}
|
147
apps/web-antd/src/api/sis/alarmEventProcess/model.d.ts
vendored
Normal file
147
apps/web-antd/src/api/sis/alarmEventProcess/model.d.ts
vendored
Normal file
@@ -0,0 +1,147 @@
|
|||||||
|
import type { PageQuery, BaseEntity } from '#/api/common';
|
||||||
|
|
||||||
|
export interface AlarmEventProcessVO {
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
id: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 告警记录主键id
|
||||||
|
*/
|
||||||
|
alarmId: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 指派人员id
|
||||||
|
*/
|
||||||
|
solveId: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 指派人员名称
|
||||||
|
*/
|
||||||
|
solveName: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单问题回复内容
|
||||||
|
*/
|
||||||
|
workReply: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理时间
|
||||||
|
*/
|
||||||
|
workReplyTime: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否已接受任务 0:未接收;1:已接收
|
||||||
|
*/
|
||||||
|
receiveTaskTag: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 10: 已上报待确认
|
||||||
|
20:已确认待处理
|
||||||
|
30: 处理中
|
||||||
|
31:升级-转工单
|
||||||
|
32:升级-协助
|
||||||
|
40:已解决
|
||||||
|
50:已关闭
|
||||||
|
*/
|
||||||
|
state: number;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AlarmEventProcessForm extends BaseEntity {
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
id?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 告警记录主键id
|
||||||
|
*/
|
||||||
|
alarmId?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 指派人员id
|
||||||
|
*/
|
||||||
|
solveId?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 指派人员名称
|
||||||
|
*/
|
||||||
|
solveName?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单问题回复内容
|
||||||
|
*/
|
||||||
|
workReply?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理时间
|
||||||
|
*/
|
||||||
|
workReplyTime?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否已接受任务 0:未接收;1:已接收
|
||||||
|
*/
|
||||||
|
receiveTaskTag?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 10: 已上报待确认
|
||||||
|
20:已确认待处理
|
||||||
|
30: 处理中
|
||||||
|
31:升级-转工单
|
||||||
|
32:升级-协助
|
||||||
|
40:已解决
|
||||||
|
50:已关闭
|
||||||
|
*/
|
||||||
|
state?: number;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AlarmEventProcessQuery extends PageQuery {
|
||||||
|
/**
|
||||||
|
* 告警记录主键id
|
||||||
|
*/
|
||||||
|
alarmId?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 指派人员id
|
||||||
|
*/
|
||||||
|
solveId?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 指派人员名称
|
||||||
|
*/
|
||||||
|
solveName?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单问题回复内容
|
||||||
|
*/
|
||||||
|
workReply?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理时间
|
||||||
|
*/
|
||||||
|
workReplyTime?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否已接受任务 0:未接收;1:已接收
|
||||||
|
*/
|
||||||
|
receiveTaskTag?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 10: 已上报待确认
|
||||||
|
20:已确认待处理
|
||||||
|
30: 处理中
|
||||||
|
31:升级-转工单
|
||||||
|
32:升级-协助
|
||||||
|
40:已解决
|
||||||
|
50:已关闭
|
||||||
|
*/
|
||||||
|
state?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日期范围参数
|
||||||
|
*/
|
||||||
|
params?: any;
|
||||||
|
}
|
@@ -1,18 +1,30 @@
|
|||||||
import type { AlarmEventsVO, AlarmEventsForm, AlarmEventsQuery } from './model';
|
import type { AlarmEventsForm, AlarmEventsQuery, AlarmEventsVO } from './model';
|
||||||
|
|
||||||
import type { ID, IDS } from '#/api/common';
|
import type { ID, IDS, PageResult } from '#/api/common';
|
||||||
import type { PageResult } from '#/api/common';
|
|
||||||
|
|
||||||
import { commonExport } from '#/api/helper';
|
import { commonExport } from '#/api/helper';
|
||||||
import { requestClient } from '#/api/request';
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询【请填写功能名称】列表
|
* 查询【请填写功能名称】列表
|
||||||
* @param params
|
* @param params
|
||||||
* @returns 【请填写功能名称】列表
|
* @returns 【请填写功能名称】列表
|
||||||
*/
|
*/
|
||||||
export function alarmEventsList(params?: AlarmEventsQuery) {
|
export function alarmEventsList(params?: AlarmEventsQuery) {
|
||||||
return requestClient.get<PageResult<AlarmEventsVO>>('/sis/alarmEvents/list', { params });
|
return requestClient.get<PageResult<AlarmEventsVO>>('/sis/alarmEvents/list', {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询【请填写功能名称】列表
|
||||||
|
* @param params
|
||||||
|
* @returns 【请填写功能名称】列表
|
||||||
|
*/
|
||||||
|
export function alarmEventsListCurr(params?: AlarmEventsQuery) {
|
||||||
|
return requestClient.get<PageResult<AlarmEventsVO>>('/sis/alarmEvents/list/curr', {
|
||||||
|
params,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -59,3 +71,25 @@ export function alarmEventsUpdate(data: AlarmEventsForm) {
|
|||||||
export function alarmEventsRemove(id: ID | IDS) {
|
export function alarmEventsRemove(id: ID | IDS) {
|
||||||
return requestClient.deleteWithMsg<void>(`/sis/alarmEvents/${id}`);
|
return requestClient.deleteWithMsg<void>(`/sis/alarmEvents/${id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 告警指派
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
export function taskAssignment(params: any) {
|
||||||
|
return requestClient.postWithMsg<void>(
|
||||||
|
`/sis/alarmEvents/assignment`,
|
||||||
|
params ?? {},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 告警处理完成
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
export function alarmEventComplete(params: any) {
|
||||||
|
return requestClient.postWithMsg<void>(
|
||||||
|
`/sis/alarmEvents/complete`,
|
||||||
|
params ?? {},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
@@ -5,8 +5,7 @@ import { DictEnum } from '@vben/constants';
|
|||||||
import { getPopupContainer } from '@vben/utils';
|
import { getPopupContainer } from '@vben/utils';
|
||||||
|
|
||||||
import { getDictOptions } from '#/utils/dict';
|
import { getDictOptions } from '#/utils/dict';
|
||||||
import { renderDict } from '#/utils/render'
|
import { renderDict } from '#/utils/render';
|
||||||
import { log } from 'console'
|
|
||||||
|
|
||||||
export const querySchema: FormSchemaGetter = () => [
|
export const querySchema: FormSchemaGetter = () => [
|
||||||
{
|
{
|
||||||
@@ -48,11 +47,11 @@ export const columns: VxeGridProps['columns'] = [
|
|||||||
{
|
{
|
||||||
title: '性别',
|
title: '性别',
|
||||||
field: 'sex',
|
field: 'sex',
|
||||||
slots:{
|
slots: {
|
||||||
default: ({row}) =>{
|
default: ({ row }) => {
|
||||||
return renderDict(row.sex, 'sys_user_sex')
|
return renderDict(row.sex, 'sys_user_sex');
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '邮箱',
|
title: '邮箱',
|
||||||
@@ -65,11 +64,11 @@ export const columns: VxeGridProps['columns'] = [
|
|||||||
{
|
{
|
||||||
title: '证件类型',
|
title: '证件类型',
|
||||||
field: 'certificateType',
|
field: 'certificateType',
|
||||||
slots:{
|
slots: {
|
||||||
default: ({row}) =>{
|
default: ({ row }) => {
|
||||||
return renderDict(row.certificateType, 'sys_certificate_type')
|
return renderDict(row.certificateType, 'sys_certificate_type');
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '证件号码',
|
title: '证件号码',
|
||||||
@@ -80,15 +79,15 @@ export const columns: VxeGridProps['columns'] = [
|
|||||||
field: 'birthDate',
|
field: 'birthDate',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '人员标签',
|
title: '人员标签',
|
||||||
field: 'rosterType',
|
field: 'rosterType',
|
||||||
slots: {
|
slots: {
|
||||||
default: ({ row }) => {
|
default: ({ row }) => {
|
||||||
return renderDict(row.rosterType, 'roster_type')
|
return renderDict(row.rosterType, 'roster_type');
|
||||||
},
|
|
||||||
},
|
},
|
||||||
width: 100,
|
|
||||||
},
|
},
|
||||||
|
width: 100,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
field: 'action',
|
field: 'action',
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
@@ -99,8 +98,8 @@ export const columns: VxeGridProps['columns'] = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
const test = getDictOptions('roster_type');
|
const test = getDictOptions('roster_type');
|
||||||
test.forEach(item => {
|
test.forEach((item) => {
|
||||||
console.log('item',item)
|
console.log('item', item);
|
||||||
});
|
});
|
||||||
|
|
||||||
export const modalSchema: FormSchemaGetter = () => [
|
export const modalSchema: FormSchemaGetter = () => [
|
||||||
|
@@ -1,8 +1,12 @@
|
|||||||
import type { FormSchemaGetter } from '#/adapter/form';
|
import type { FormSchemaGetter } from '#/adapter/form';
|
||||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||||
import { getDictOptions } from '#/utils/dict';
|
|
||||||
import { renderDict } from '#/utils/render';
|
|
||||||
import { h } from 'vue';
|
import { h } from 'vue';
|
||||||
|
import { getPopupContainer } from '@vben/utils';
|
||||||
|
import { getDictOptions } from '#/utils/dict';
|
||||||
|
import { DictEnum } from '@vben/constants';
|
||||||
|
|
||||||
|
export const fallImg =
|
||||||
|
'data:image/png;base64,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';
|
||||||
|
|
||||||
export const querySchema: FormSchemaGetter = () => [
|
export const querySchema: FormSchemaGetter = () => [
|
||||||
{
|
{
|
||||||
@@ -13,56 +17,50 @@ export const querySchema: FormSchemaGetter = () => [
|
|||||||
{
|
{
|
||||||
component: 'Select',
|
component: 'Select',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
options: [
|
getPopupContainer,
|
||||||
{ label: '特大', value: '特大' },
|
options: getDictOptions(DictEnum.alarm_level, true),
|
||||||
{ label: '重要', value: '重要' },
|
|
||||||
{ label: '一般', value: '一般' },
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
fieldName: 'level',
|
fieldName: 'level',
|
||||||
label: '级别',
|
label: '级别',
|
||||||
},
|
},
|
||||||
{
|
/*{
|
||||||
component: 'Select',
|
component: 'Select',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
options: [
|
getPopupContainer,
|
||||||
{ label: '待分配', value: '待分配' },
|
options: getDictOptions(DictEnum.alarm_state, true),
|
||||||
{ label: '处理中', value: '处理中' },
|
|
||||||
{ label: '已完成', value: '已完成' },
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
fieldName: 'processingStatus',
|
fieldName: 'state',
|
||||||
label: '处理状态',
|
label: '处理状态',
|
||||||
},
|
},*/
|
||||||
];
|
];
|
||||||
|
|
||||||
export const columns: VxeGridProps['columns'] = [
|
export const columns: VxeGridProps['columns'] = [
|
||||||
{ type: 'checkbox', width: 60 },
|
{ type: 'checkbox', width: 60 },
|
||||||
{
|
{
|
||||||
title: '预警编号',
|
title: '预警编号',
|
||||||
field: 'alarmId',
|
field: 'id',
|
||||||
width: 150,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '预警时间',
|
title: '预警时间',
|
||||||
field: 'alarmTime',
|
field: 'reportTime',
|
||||||
width: 150,
|
},
|
||||||
|
{
|
||||||
|
title: '设备ip',
|
||||||
|
field: 'deviceIp',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '设备名称',
|
title: '设备名称',
|
||||||
field: 'deviceName',
|
field: 'deviceName',
|
||||||
width: 150,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '级别',
|
title: '级别',
|
||||||
field: 'level',
|
field: 'level',
|
||||||
width: 100,
|
|
||||||
slots: {
|
slots: {
|
||||||
default: ({ row }: any) => {
|
default: ({ row }: any) => {
|
||||||
const levelColors: Record<string, string> = {
|
const levelColors: Record<string, string> = {
|
||||||
特大: 'red',
|
1: 'red',
|
||||||
重要: 'orange',
|
2: 'orange',
|
||||||
一般: 'blue',
|
3: 'blue',
|
||||||
};
|
};
|
||||||
return h(
|
return h(
|
||||||
'span',
|
'span',
|
||||||
@@ -72,64 +70,31 @@ export const columns: VxeGridProps['columns'] = [
|
|||||||
fontWeight: 'bold',
|
fontWeight: 'bold',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
row.level,
|
row.levelName,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '预警类型',
|
title: '预警类型',
|
||||||
field: 'alarmType',
|
field: 'alarmTypeName',
|
||||||
width: 120,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '描述',
|
|
||||||
field: 'description',
|
|
||||||
minWidth: 200,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '所在位置',
|
|
||||||
field: 'location',
|
|
||||||
width: 150,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '处理状态',
|
|
||||||
field: 'processingStatus',
|
|
||||||
width: 100,
|
|
||||||
slots: {
|
slots: {
|
||||||
default: ({ row }: any) => {
|
default: ({ row }: any) => {
|
||||||
const statusColors: Record<string, string> = {
|
return h('span', row.bigTypeName + '-' + row.smallTypeName);
|
||||||
待分配: 'red',
|
|
||||||
处理中: 'orange',
|
|
||||||
已完成: 'green',
|
|
||||||
};
|
|
||||||
return h(
|
|
||||||
'span',
|
|
||||||
{
|
|
||||||
style: {
|
|
||||||
color: statusColors[row.processingStatus] || '#666',
|
|
||||||
fontWeight: 'bold',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
row.processingStatus,
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '处理情况',
|
title: '处理状态',
|
||||||
field: 'processingDetails',
|
field: 'stateName',
|
||||||
width: 150,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '预期处理时间',
|
title: '创建时间',
|
||||||
field: 'expectedProcessingTime',
|
field: 'createTime',
|
||||||
width: 150,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '处理时间',
|
title: '创建人',
|
||||||
field: 'processingTime',
|
field: 'createBy',
|
||||||
width: 150,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'action',
|
field: 'action',
|
||||||
@@ -152,22 +117,22 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '预警编号',
|
label: '预警编号',
|
||||||
fieldName: 'alarmId',
|
fieldName: 'id',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
disabled: true,
|
disabled: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '预警时间',
|
label: '预警时间',
|
||||||
fieldName: 'alarmTime',
|
fieldName: 'reportTime',
|
||||||
component: 'DatePicker',
|
component: 'DatePicker',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
format: 'YYYY.MM.DD HH:mm',
|
format: 'YYYY.MM.DD HH:mm',
|
||||||
valueFormat: 'YYYY.MM.DD HH:mm',
|
valueFormat: 'YYYY.MM.DD HH:mm',
|
||||||
showTime: true,
|
showTime: true,
|
||||||
},
|
},
|
||||||
rules: 'required',
|
|
||||||
disabled: true,
|
disabled: true,
|
||||||
|
rules: 'required',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '预警类型',
|
label: '预警类型',
|
||||||
@@ -177,89 +142,107 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
disabled: true,
|
disabled: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '描述',
|
label: '设备名称',
|
||||||
fieldName: 'description',
|
fieldName: 'deviceIp',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
formItemClass: 'col-span-2',
|
|
||||||
disabled: true,
|
disabled: true,
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '所在位置',
|
|
||||||
fieldName: 'location',
|
|
||||||
component: 'Input',
|
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
disabled: true,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '设备名称',
|
label: '设备名称',
|
||||||
fieldName: 'deviceName',
|
fieldName: 'deviceName',
|
||||||
|
disabled: true,
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
disabled: true,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '处理情况',
|
label: '重要级别',
|
||||||
fieldName: 'processingDetails',
|
fieldName: 'level',
|
||||||
component: 'Input',
|
component: 'Select',
|
||||||
|
disabled: true,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
rows: 3,
|
getPopupContainer,
|
||||||
|
options: getDictOptions(DictEnum.alarm_level, true),
|
||||||
},
|
},
|
||||||
formItemClass: 'col-span-2',
|
rules: 'selectRequired',
|
||||||
disabled: true,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '处理时间',
|
label: '创建时间',
|
||||||
fieldName: 'processingTime',
|
fieldName: 'createTime',
|
||||||
component: 'DatePicker',
|
component: 'DatePicker',
|
||||||
|
disabled: true,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
format: 'YYYY.MM.DD HH:mm',
|
format: 'YYYY.MM.DD HH:mm',
|
||||||
valueFormat: 'YYYY.MM.DD HH:mm',
|
valueFormat: 'YYYY.MM.DD HH:mm',
|
||||||
showTime: true,
|
showTime: true,
|
||||||
},
|
},
|
||||||
disabled: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '处理图片',
|
|
||||||
fieldName: 'imgUrl',
|
|
||||||
component: 'Input',
|
|
||||||
rules: 'required',
|
|
||||||
disabled: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '级别',
|
|
||||||
fieldName: 'level',
|
|
||||||
component: 'Select',
|
|
||||||
componentProps: {
|
|
||||||
options: [
|
|
||||||
{ label: '特大', value: '特大' },
|
|
||||||
{ label: '重要', value: '重要' },
|
|
||||||
{ label: '一般', value: '一般' },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
rules: 'selectRequired',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '处理状态',
|
label: '处理状态',
|
||||||
fieldName: 'processingStatus',
|
|
||||||
component: 'Select',
|
component: 'Select',
|
||||||
|
disabled: true,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
options: [
|
getPopupContainer,
|
||||||
{ label: '待分配', value: '待分配' },
|
options: getDictOptions(DictEnum.alarm_state, true),
|
||||||
{ label: '处理中', value: '处理中' },
|
|
||||||
{ label: '已完成', value: '已完成' },
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
|
fieldName: 'state',
|
||||||
rules: 'selectRequired',
|
rules: 'selectRequired',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '预期处理时间',
|
label: '描述',
|
||||||
fieldName: 'expectedProcessingTime',
|
disabled: true,
|
||||||
component: 'DatePicker',
|
fieldName: 'description',
|
||||||
|
component: 'Textarea',
|
||||||
|
formItemClass: 'col-span-2',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
format: 'YYYY.MM.DD HH:mm',
|
rows: 3,
|
||||||
valueFormat: 'YYYY.MM.DD HH:mm',
|
},
|
||||||
showTime: true,
|
},
|
||||||
|
// 插入分割线
|
||||||
|
{
|
||||||
|
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,
|
||||||
},
|
},
|
||||||
rules: 'required',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
@@ -2,79 +2,20 @@
|
|||||||
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||||
import { getVxePopupContainer } from '@vben/utils';
|
import { getVxePopupContainer } from '@vben/utils';
|
||||||
|
|
||||||
import { Modal, Popconfirm, Space, Tag } from 'ant-design-vue';
|
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||||
import { ref, watch } from 'vue';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
useVbenVxeGrid,
|
useVbenVxeGrid,
|
||||||
vxeCheckboxChecked,
|
vxeCheckboxChecked,
|
||||||
type VxeGridProps,
|
type VxeGridProps,
|
||||||
} from '#/adapter/vxe-table';
|
} from '#/adapter/vxe-table';
|
||||||
|
|
||||||
import { commonDownloadExcel } from '#/utils/file/download';
|
|
||||||
import { renderDict } from '#/utils/render';
|
|
||||||
|
|
||||||
import { columns, querySchema } from './data';
|
import { columns, querySchema } from './data';
|
||||||
import warningModal from './warning-modal.vue';
|
import warningModal from './warning-modal.vue';
|
||||||
import warningDetail from './warning-detail.vue';
|
import warningDetail from './warning-detail.vue';
|
||||||
import LevelSettingModal from './level-setting-modal.vue';
|
import { alarmEventsList, alarmEventsRemove } from '#/api/sis/alarmEvents';
|
||||||
import imgPng from '../../../../assets/algorithmManagement/image.png';
|
import type { AlarmEventsForm } from '#/api/sis/alarmEvents/model';
|
||||||
|
|
||||||
// 假数据
|
|
||||||
const mockData = ref([
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
alarmId: 'JWD-3434234',
|
|
||||||
alarmTime: '2025.07.21 12:20',
|
|
||||||
level: '特大',
|
|
||||||
alarmType: '越界侦测',
|
|
||||||
description: '温度高于80度发生火宅',
|
|
||||||
location: '1栋3号电梯旁',
|
|
||||||
processingStatus: '已完成',
|
|
||||||
processingDetails: '',
|
|
||||||
processingTime: '',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
alarmId: 'JWD-3434235',
|
|
||||||
alarmTime: '2025.07.21 11:15',
|
|
||||||
level: '重要',
|
|
||||||
alarmType: '异常行为',
|
|
||||||
description: '人员异常聚集',
|
|
||||||
location: '2栋大厅',
|
|
||||||
processingStatus: '已完成',
|
|
||||||
processingDetails: '已派人员前往处理',
|
|
||||||
processingTime: '2025.07.21 11:30',
|
|
||||||
imgUrl: imgPng,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 3,
|
|
||||||
alarmId: 'JWD-3434236',
|
|
||||||
alarmTime: '2025.07.21 10:45',
|
|
||||||
level: '一般',
|
|
||||||
alarmType: '设备故障',
|
|
||||||
description: '摄像头离线',
|
|
||||||
location: '3栋走廊',
|
|
||||||
processingStatus: '已完成',
|
|
||||||
processingDetails: '已修复设备',
|
|
||||||
processingTime: '2025.07.21 11:00',
|
|
||||||
imgUrl: imgPng,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 4,
|
|
||||||
alarmId: 'JWD-3434236',
|
|
||||||
alarmTime: '2025.07.21 10:45',
|
|
||||||
level: '一般',
|
|
||||||
alarmType: '设备故障',
|
|
||||||
description: '摄像头离线',
|
|
||||||
location: '3栋走廊',
|
|
||||||
processingStatus: '已完成',
|
|
||||||
processingDetails: '已修复设备',
|
|
||||||
processingTime: '2025.07.21 11:00',
|
|
||||||
imgUrl: imgPng,
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
|
|
||||||
|
/* 搜索栏配置 */
|
||||||
const formOptions: VbenFormProps = {
|
const formOptions: VbenFormProps = {
|
||||||
commonConfig: {
|
commonConfig: {
|
||||||
labelWidth: 100,
|
labelWidth: 100,
|
||||||
@@ -86,14 +27,32 @@ const formOptions: VbenFormProps = {
|
|||||||
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3',
|
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* table栏配置 */
|
||||||
const gridOptions: VxeGridProps = {
|
const gridOptions: VxeGridProps = {
|
||||||
|
checkboxConfig: {
|
||||||
|
// 高亮
|
||||||
|
highlight: true,
|
||||||
|
// 翻页时保留选中状态
|
||||||
|
reserve: true,
|
||||||
|
// 点击行选中
|
||||||
|
// trigger: 'row',
|
||||||
|
},
|
||||||
|
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
||||||
|
// columns: columns(),
|
||||||
columns,
|
columns,
|
||||||
height: 'auto',
|
height: 'auto',
|
||||||
data: mockData.value,
|
pagerConfig: {},
|
||||||
pagerConfig: {
|
proxyConfig: {
|
||||||
currentPage: 1,
|
ajax: {
|
||||||
pageSize: 10,
|
query: async ({ page }, formValues = {}) => {
|
||||||
total: mockData.value.length,
|
return await alarmEventsList({
|
||||||
|
pageNum: page.currentPage,
|
||||||
|
pageSize: page.pageSize,
|
||||||
|
states: [40,50],
|
||||||
|
...formValues,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
rowConfig: {
|
rowConfig: {
|
||||||
keyField: 'id',
|
keyField: 'id',
|
||||||
@@ -107,14 +66,6 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
|
|||||||
});
|
});
|
||||||
|
|
||||||
// 监听数据变化,强制重新渲染表格
|
// 监听数据变化,强制重新渲染表格
|
||||||
const tableKey = ref(0);
|
|
||||||
watch(
|
|
||||||
mockData,
|
|
||||||
() => {
|
|
||||||
tableKey.value++;
|
|
||||||
},
|
|
||||||
{ deep: true },
|
|
||||||
);
|
|
||||||
|
|
||||||
const [WarningModal, modalApi] = useVbenModal({
|
const [WarningModal, modalApi] = useVbenModal({
|
||||||
connectedComponent: warningModal,
|
connectedComponent: warningModal,
|
||||||
@@ -124,51 +75,22 @@ const [WarningDetail, detailApi] = useVbenModal({
|
|||||||
connectedComponent: warningDetail,
|
connectedComponent: warningDetail,
|
||||||
});
|
});
|
||||||
|
|
||||||
const [LevelSettingModalComp, levelModalApi] = useVbenModal({
|
|
||||||
connectedComponent: LevelSettingModal,
|
|
||||||
});
|
|
||||||
|
|
||||||
// 级别设置
|
|
||||||
function handleLevelSetting(row: any) {
|
|
||||||
levelModalApi.setData({ id: row.id, level: row.level, data: mockData.value });
|
|
||||||
levelModalApi.open();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查看详情
|
// 查看详情
|
||||||
async function handleView(row: any) {
|
async function handleView(row: any) {
|
||||||
detailApi.setData({ id: row.id, data: mockData.value });
|
detailApi.setData({ id: row.id, data: row });
|
||||||
detailApi.open();
|
detailApi.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编辑
|
// 编辑
|
||||||
async function handleEdit(row: any) {
|
async function handleEdit(row: any) {
|
||||||
modalApi.setData({ id: row.id, data: mockData.value });
|
modalApi.setData({ id: row.id, data: row });
|
||||||
modalApi.open();
|
modalApi.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
// // 分配处理
|
|
||||||
// function handleAssign(row: any) {
|
|
||||||
// Modal.confirm({
|
|
||||||
// title: '分配处理',
|
|
||||||
// content: `确定要分配预警 ${row.alarmId} 给处理人员吗?`,
|
|
||||||
// onOk() {
|
|
||||||
// // 模拟分配处理
|
|
||||||
// const index = mockData.value.findIndex((item: any) => item.id === row.id);
|
|
||||||
// if (index !== -1) {
|
|
||||||
// mockData.value[index].processingStatus = '处理中';
|
|
||||||
// mockData.value[index].processingDetails = '已分配给处理人员';
|
|
||||||
// mockData.value[index].processingTime = new Date().toLocaleString();
|
|
||||||
// tableApi.query();
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
// 删除
|
// 删除
|
||||||
async function handleDelete(row: any) {
|
async function handleDelete(row: any) {
|
||||||
const index = mockData.value.findIndex((item: any) => item.id === row.id);
|
const index = row.id;
|
||||||
if (index !== -1) {
|
if (index !== -1) {
|
||||||
mockData.value.splice(index, 1);
|
|
||||||
await tableApi.query();
|
await tableApi.query();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -176,18 +98,13 @@ async function handleDelete(row: any) {
|
|||||||
// 批量删除
|
// 批量删除
|
||||||
function handleMultiDelete() {
|
function handleMultiDelete() {
|
||||||
const rows = tableApi.grid.getCheckboxRecords();
|
const rows = tableApi.grid.getCheckboxRecords();
|
||||||
const ids = rows.map((row: any) => row.id);
|
const ids = rows.map((row: Required<AlarmEventsForm>) => row.id);
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
okType: 'danger',
|
okType: 'danger',
|
||||||
content: `确认删除选中的${ids.length}条记录吗?`,
|
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||||
onOk: async () => {
|
onOk: async () => {
|
||||||
ids.forEach((id) => {
|
await alarmEventsRemove(ids);
|
||||||
const index = mockData.value.findIndex((item: any) => item.id === id);
|
|
||||||
if (index !== -1) {
|
|
||||||
mockData.value.splice(index, 1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
await tableApi.query();
|
await tableApi.query();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -195,11 +112,7 @@ function handleMultiDelete() {
|
|||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<Page :auto-content-height="true">
|
<Page :auto-content-height="true">
|
||||||
<BasicTable
|
<BasicTable class="flex-1 overflow-hidden" table-title="视频预警处理">
|
||||||
:key="tableKey"
|
|
||||||
class="flex-1 overflow-hidden"
|
|
||||||
table-title="视频预警处理"
|
|
||||||
>
|
|
||||||
<template #toolbar-tools>
|
<template #toolbar-tools>
|
||||||
<Space>
|
<Space>
|
||||||
<a-button
|
<a-button
|
||||||
@@ -227,19 +140,7 @@ function handleMultiDelete() {
|
|||||||
>
|
>
|
||||||
{{ $t('pages.common.info') }}
|
{{ $t('pages.common.info') }}
|
||||||
</ghost-button>
|
</ghost-button>
|
||||||
<ghost-button
|
|
||||||
v-access:code="['video:warning:edit']"
|
|
||||||
@click.stop="handleEdit(row)"
|
|
||||||
>
|
|
||||||
{{ $t('pages.common.edit') }}
|
|
||||||
</ghost-button>
|
|
||||||
<!-- <ghost-button
|
|
||||||
v-access:code="['video:warning:assign']"
|
|
||||||
@click.stop="handleAssign(row)"
|
|
||||||
:disabled="row.processingStatus === '已完成'"
|
|
||||||
>
|
|
||||||
分配处理
|
|
||||||
</ghost-button> -->
|
|
||||||
<Popconfirm
|
<Popconfirm
|
||||||
:get-popup-container="getVxePopupContainer"
|
:get-popup-container="getVxePopupContainer"
|
||||||
placement="left"
|
placement="left"
|
||||||
@@ -259,7 +160,6 @@ function handleMultiDelete() {
|
|||||||
</BasicTable>
|
</BasicTable>
|
||||||
<WarningModal @reload="tableApi.query()" />
|
<WarningModal @reload="tableApi.query()" />
|
||||||
<WarningDetail />
|
<WarningDetail />
|
||||||
<LevelSettingModalComp @reload="tableKey++" />
|
|
||||||
</Page>
|
</Page>
|
||||||
</template>
|
</template>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
@@ -1,45 +0,0 @@
|
|||||||
<template>
|
|
||||||
<BasicModal>
|
|
||||||
<RadioGroup v-model:value="selectedLevel">
|
|
||||||
<Radio value="特大">特大</Radio>
|
|
||||||
<Radio value="重要">重要</Radio>
|
|
||||||
<Radio value="一般">一般</Radio>
|
|
||||||
</RadioGroup>
|
|
||||||
</BasicModal>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup lang="ts">
|
|
||||||
import { ref } from 'vue';
|
|
||||||
import { useVbenModal } from '@vben/common-ui';
|
|
||||||
import { RadioGroup, Radio } from 'ant-design-vue';
|
|
||||||
|
|
||||||
const emit = defineEmits<{ reload: [] }>();
|
|
||||||
|
|
||||||
const selectedLevel = ref('一般');
|
|
||||||
|
|
||||||
const [BasicModal, modalApi] = useVbenModal({
|
|
||||||
class: 'w-[360px]',
|
|
||||||
title: '设置级别',
|
|
||||||
onOpenChange: async (isOpen) => {
|
|
||||||
if (!isOpen) return null;
|
|
||||||
const { level } = modalApi.getData() as { level?: string };
|
|
||||||
selectedLevel.value = level || '一般';
|
|
||||||
},
|
|
||||||
onConfirm: handleConfirm,
|
|
||||||
});
|
|
||||||
|
|
||||||
function handleConfirm() {
|
|
||||||
const { id, data } = modalApi.getData() as {
|
|
||||||
id: number | string;
|
|
||||||
data: any[];
|
|
||||||
};
|
|
||||||
if (id != null && data) {
|
|
||||||
const idx = data.findIndex((item: any) => item.id === id);
|
|
||||||
if (idx !== -1) {
|
|
||||||
data[idx].level = selectedLevel.value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
emit('reload');
|
|
||||||
modalApi.close();
|
|
||||||
}
|
|
||||||
</script>
|
|
@@ -1,22 +1,23 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { shallowRef } from 'vue';
|
import { ref, shallowRef } from 'vue';
|
||||||
import { useVbenModal } from '@vben/common-ui';
|
import { useVbenModal } from '@vben/common-ui';
|
||||||
import {
|
import { Descriptions, DescriptionsItem, Image, Tag } from 'ant-design-vue';
|
||||||
Descriptions,
|
import { queryAlarmEventAttachmentsList } from '#/api/sis/alarmEventAttachments';
|
||||||
DescriptionsItem,
|
import type { AlarmEventAttachmentsVO } from '#/api/sis/alarmEventAttachments/model';
|
||||||
Tag,
|
import { fallImg } from './data';
|
||||||
Timeline,
|
import { alarmEventProcessList } from '#/api/sis/alarmEventProcess';
|
||||||
TimelineItem,
|
import type { AlarmEventProcessVO } from '#/api/sis/alarmEventProcess/model';
|
||||||
} from 'ant-design-vue';
|
|
||||||
|
|
||||||
const [BasicModal, modalApi] = useVbenModal({
|
const [BasicModal, modalApi] = useVbenModal({
|
||||||
onOpenChange: handleOpenChange,
|
onOpenChange: handleOpenChange,
|
||||||
onClosed() {
|
onClosed() {
|
||||||
warningDetail.value = null;
|
// warningDetail.value = null;
|
||||||
|
modalApi.close();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const warningDetail = shallowRef<any>(null);
|
const warningDetail = shallowRef<any>(null);
|
||||||
|
const currFiles = ref<AlarmEventAttachmentsVO[]>([]);
|
||||||
|
|
||||||
async function handleOpenChange(open: boolean) {
|
async function handleOpenChange(open: boolean) {
|
||||||
if (!open) {
|
if (!open) {
|
||||||
@@ -27,15 +28,31 @@ async function handleOpenChange(open: boolean) {
|
|||||||
id: number | string;
|
id: number | string;
|
||||||
data: any[];
|
data: any[];
|
||||||
};
|
};
|
||||||
|
|
||||||
// 从传递的数据中查找对应的记录
|
// 从传递的数据中查找对应的记录
|
||||||
const record = data.find((item: any) => item.id === id);
|
if (data) {
|
||||||
if (record) {
|
warningDetail.value = data;
|
||||||
warningDetail.value = record;
|
|
||||||
}
|
}
|
||||||
|
// 加载事件附件信息
|
||||||
|
currFiles.value = await queryAlarmEventAttachmentsList(id);
|
||||||
|
// 加载处理流程
|
||||||
|
loadProcessList();
|
||||||
modalApi.modalLoading(false);
|
modalApi.modalLoading(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const process = ref<AlarmEventProcessVO[]>([]);
|
||||||
|
|
||||||
|
function loadProcessList() {
|
||||||
|
const data = modalApi.getData();
|
||||||
|
const params = {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 50,
|
||||||
|
alarmId: data.id,
|
||||||
|
};
|
||||||
|
alarmEventProcessList(params).then((res) => {
|
||||||
|
const { rows = [] } = res;
|
||||||
|
process.value = rows;
|
||||||
|
});
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -43,7 +60,7 @@ async function handleOpenChange(open: boolean) {
|
|||||||
:footer="false"
|
:footer="false"
|
||||||
:fullscreen-button="false"
|
:fullscreen-button="false"
|
||||||
title="预警详情"
|
title="预警详情"
|
||||||
class="w-[70%]"
|
class="w-[60%]"
|
||||||
>
|
>
|
||||||
<Descriptions
|
<Descriptions
|
||||||
v-if="warningDetail"
|
v-if="warningDetail"
|
||||||
@@ -54,11 +71,13 @@ async function handleOpenChange(open: boolean) {
|
|||||||
style="margin-bottom: 30px"
|
style="margin-bottom: 30px"
|
||||||
>
|
>
|
||||||
<DescriptionsItem label="预警编号">
|
<DescriptionsItem label="预警编号">
|
||||||
{{ warningDetail.alarmId }}
|
{{ warningDetail.id }}
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
|
|
||||||
<DescriptionsItem label="预警时间">
|
<DescriptionsItem label="预警时间">
|
||||||
{{ warningDetail.alarmTime }}
|
{{ warningDetail.reportTime }}
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
|
|
||||||
<DescriptionsItem label="级别">
|
<DescriptionsItem label="级别">
|
||||||
<Tag
|
<Tag
|
||||||
:color="
|
:color="
|
||||||
@@ -69,79 +88,66 @@ async function handleOpenChange(open: boolean) {
|
|||||||
: 'blue'
|
: 'blue'
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
{{ warningDetail.level }}
|
{{ warningDetail.levelName }}
|
||||||
</Tag>
|
</Tag>
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
|
|
||||||
<DescriptionsItem label="预警类型">
|
<DescriptionsItem label="预警类型">
|
||||||
{{ warningDetail.alarmType }}
|
{{ warningDetail.bigTypeName + ' - ' + warningDetail.smallTypeName }}
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
|
|
||||||
|
<DescriptionsItem label="设备ip"
|
||||||
|
>{{ warningDetail.deviceIp }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
|
||||||
|
<DescriptionsItem label="设备ip"
|
||||||
|
>{{ warningDetail.deviceName }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
|
||||||
<DescriptionsItem label="描述" :span="2">
|
<DescriptionsItem label="描述" :span="2">
|
||||||
{{ warningDetail.description }}
|
{{ warningDetail.description }}
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
|
|
||||||
<DescriptionsItem label="所在位置">
|
<DescriptionsItem label="所在位置">
|
||||||
{{ warningDetail.location }}
|
{{ warningDetail.deviceName }}
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
|
|
||||||
<DescriptionsItem label="处理状态">
|
<DescriptionsItem label="处理状态">
|
||||||
<Tag
|
<Tag>
|
||||||
:color="
|
{{ warningDetail.stateName }}
|
||||||
warningDetail.processingStatus === '待分配'
|
|
||||||
? 'red'
|
|
||||||
: warningDetail.processingStatus === '处理中'
|
|
||||||
? 'orange'
|
|
||||||
: 'green'
|
|
||||||
"
|
|
||||||
>
|
|
||||||
{{ warningDetail.processingStatus }}
|
|
||||||
</Tag>
|
</Tag>
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
|
|
||||||
<DescriptionsItem label="处理情况" :span="2">
|
<DescriptionsItem label="处理情况" :span="2">
|
||||||
{{ warningDetail.processingDetails || '-' }}
|
{{ warningDetail.processingDetails || '-' }}
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
<DescriptionsItem label="处理时间">
|
|
||||||
|
<DescriptionsItem label="处理时间" :span="2">
|
||||||
{{ warningDetail.processingTime || '-' }}
|
{{ warningDetail.processingTime || '-' }}
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
<DescriptionsItem label="设备名称">
|
|
||||||
{{ warningDetail.deviceName || '-' }}
|
<DescriptionsItem :span="1" label="附件信息">
|
||||||
</DescriptionsItem>
|
<div class="file-box">
|
||||||
<DescriptionsItem
|
<div class="img-box" v-for="item in currFiles">
|
||||||
label="预处理时间"
|
<Image
|
||||||
v-if="warningDetail.processingStatus === '处理中'"
|
style="width: 120px; height: 120px"
|
||||||
>
|
:src="item.imagePath"
|
||||||
{{ warningDetail.expectedProcessingTime || '-' }}
|
:fallback="fallImg"
|
||||||
</DescriptionsItem>
|
/>
|
||||||
<DescriptionsItem
|
</div>
|
||||||
label="处理图片"
|
</div>
|
||||||
v-if="warningDetail.processingStatus === '已完成'"
|
|
||||||
>
|
|
||||||
<img
|
|
||||||
:src="warningDetail.imgUrl"
|
|
||||||
alt="处理图片"
|
|
||||||
style="max-width: 200px; max-height: 150px"
|
|
||||||
/>
|
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
|
|
||||||
|
<DescriptionsItem :span="1" label="报警视频"></DescriptionsItem>
|
||||||
</Descriptions>
|
</Descriptions>
|
||||||
<Timeline>
|
|
||||||
<TimelineItem>
|
|
||||||
<p style="display: flex">类型:已完成</p>
|
|
||||||
<p>时间:2025-06-01 11:07:59</p>
|
|
||||||
<p>处理人:张三</p>
|
|
||||||
</TimelineItem>
|
|
||||||
<TimelineItem>
|
|
||||||
<p style="display: flex">类型:处理异常</p>
|
|
||||||
<p>时间:2025-06-01 11:07:59</p>
|
|
||||||
<p>处理人:张三</p>
|
|
||||||
<p>异常原因:时长不够</p>
|
|
||||||
</TimelineItem>
|
|
||||||
<TimelineItem>
|
|
||||||
<p style="display: flex">类型:处理中</p>
|
|
||||||
<p>时间:2025-06-01 11:07:59</p>
|
|
||||||
<p>处理人:张三</p>
|
|
||||||
</TimelineItem>
|
|
||||||
<TimelineItem>
|
|
||||||
<p style="display: flex">类型:创建预警</p>
|
|
||||||
<p>时间:2025-06-01 11:07:59</p>
|
|
||||||
<p>处理人:张三</p>
|
|
||||||
</TimelineItem>
|
|
||||||
</Timeline>
|
|
||||||
</BasicModal>
|
</BasicModal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.file-box {
|
||||||
|
.img-box {
|
||||||
|
float: left;
|
||||||
|
margin-left: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
@@ -1,21 +1,20 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
|
|
||||||
import { useVbenModal } from '@vben/common-ui';
|
import { useVbenModal } from '@vben/common-ui';
|
||||||
import { $t } from '@vben/locales';
|
|
||||||
import { cloneDeep } from '@vben/utils';
|
import { cloneDeep } from '@vben/utils';
|
||||||
|
|
||||||
import { useVbenForm } from '#/adapter/form';
|
import { useVbenForm } from '#/adapter/form';
|
||||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||||
|
|
||||||
import { modalSchema } from './data';
|
import { modalSchema } from './data';
|
||||||
|
import { queryCurrentSchedu } from '#/api/property/attendanceManagement/arrangement';
|
||||||
|
import type { AttendanceUserGroup } from '#/api/property/attendanceManagement/arrangement/model';
|
||||||
|
import { taskAssignment } from '#/api/sis/alarmEvents';
|
||||||
|
|
||||||
const emit = defineEmits<{ reload: [] }>();
|
const emit = defineEmits<{ reload: [] }>();
|
||||||
|
|
||||||
const isUpdate = ref(false);
|
const isUpdate = ref(false);
|
||||||
const title = computed(() => {
|
|
||||||
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
|
|
||||||
});
|
|
||||||
|
|
||||||
const [BasicForm, formApi] = useVbenForm({
|
const [BasicForm, formApi] = useVbenForm({
|
||||||
commonConfig: {
|
commonConfig: {
|
||||||
@@ -36,7 +35,7 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
|||||||
currentGetter: defaultFormValueGetter(formApi),
|
currentGetter: defaultFormValueGetter(formApi),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
let currentSelectData: any = null;
|
||||||
const [BasicModal, modalApi] = useVbenModal({
|
const [BasicModal, modalApi] = useVbenModal({
|
||||||
class: 'w-[70%]',
|
class: 'w-[70%]',
|
||||||
fullscreenButton: false,
|
fullscreenButton: false,
|
||||||
@@ -52,18 +51,55 @@ const [BasicModal, modalApi] = useVbenModal({
|
|||||||
isUpdate.value = !!id;
|
isUpdate.value = !!id;
|
||||||
|
|
||||||
if (isUpdate.value && id) {
|
if (isUpdate.value && id) {
|
||||||
|
// 更新表单属性
|
||||||
|
const userList: AttendanceUserGroup[] = await queryCurrentSchedu();
|
||||||
|
const arr = userList.map((item) => {
|
||||||
|
const { remoteUserVo, deptName } = item;
|
||||||
|
return {
|
||||||
|
label: remoteUserVo.nickName,
|
||||||
|
value: remoteUserVo.userId,
|
||||||
|
deptName: deptName,
|
||||||
|
phonenumber: remoteUserVo.phonenumber,
|
||||||
|
email: remoteUserVo.email,
|
||||||
|
userName: remoteUserVo.userName,
|
||||||
|
nickName: remoteUserVo.nickName,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
formApi.updateSchema([
|
||||||
|
{
|
||||||
|
componentProps: {
|
||||||
|
options: arr,
|
||||||
|
onChange: async (_value: any, data: any) => {
|
||||||
|
const {
|
||||||
|
deptName = '',
|
||||||
|
email = '',
|
||||||
|
phonenumber = '',
|
||||||
|
nickName = '',
|
||||||
|
} = data;
|
||||||
|
const formData = cloneDeep(await formApi.getValues());
|
||||||
|
formData.phonenumber = phonenumber;
|
||||||
|
formData.email = email;
|
||||||
|
formData.deptName = deptName;
|
||||||
|
currentSelectData = data;
|
||||||
|
formApi.setValues(formData);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
fieldName: 'solveId',
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
|
||||||
// 从传递的数据中查找对应的记录
|
// 从传递的数据中查找对应的记录
|
||||||
const { data } = modalApi.getData() as {
|
const { data } = modalApi.getData() as {
|
||||||
id: number | string;
|
id: number | string;
|
||||||
data: any[];
|
data: any;
|
||||||
};
|
};
|
||||||
const record = data.find((item: any) => item.id === id);
|
if (data) {
|
||||||
if (record) {
|
// 处理预警上报类型
|
||||||
await formApi.setValues(record);
|
data.alarmType = `${data.bigTypeName} - ${data.smallTypeName}`;
|
||||||
|
await formApi.setValues(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await markInitialized();
|
await markInitialized();
|
||||||
|
|
||||||
modalApi.modalLoading(false);
|
modalApi.modalLoading(false);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -75,16 +111,18 @@ async function handleConfirm() {
|
|||||||
if (!valid) {
|
if (!valid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// 表单数据
|
||||||
const formData = cloneDeep(await formApi.getValues());
|
const formData = cloneDeep(await formApi.getValues());
|
||||||
|
// 更新数据
|
||||||
// 更新表格数据
|
const params = {
|
||||||
const { data } = modalApi.getData() as { id: number | string; data: any[] };
|
alarmId: formData.id,
|
||||||
const index = data.findIndex((item: any) => item.id === formData.id);
|
solveId: currentSelectData.value,
|
||||||
if (index !== -1) {
|
solveName: `${currentSelectData.userName}(${currentSelectData.nickName})`,
|
||||||
// 更新数据
|
solvePhone: currentSelectData.phonenumber,
|
||||||
Object.assign(data[index], formData);
|
solveEmail: currentSelectData.email,
|
||||||
}
|
remark: formData.remark,
|
||||||
|
};
|
||||||
|
await taskAssignment(params);
|
||||||
resetInitialized();
|
resetInitialized();
|
||||||
emit('reload');
|
emit('reload');
|
||||||
modalApi.close();
|
modalApi.close();
|
||||||
@@ -102,11 +140,10 @@ async function handleClosed() {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<BasicModal :title="title">
|
<BasicModal title="处理">
|
||||||
<BasicForm />
|
<BasicForm></BasicForm>
|
||||||
</BasicModal>
|
</BasicModal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
/* 使用 :deep() 穿透 scoped 样式,影响子组件 */
|
/* 使用 :deep() 穿透 scoped 样式,影响子组件 */
|
||||||
:deep(.ant-input[disabled]),
|
:deep(.ant-input[disabled]),
|
||||||
|
@@ -23,7 +23,7 @@ export const querySchema: FormSchemaGetter = () => [
|
|||||||
fieldName: 'level',
|
fieldName: 'level',
|
||||||
label: '级别',
|
label: '级别',
|
||||||
},
|
},
|
||||||
{
|
/*{
|
||||||
component: 'Select',
|
component: 'Select',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
getPopupContainer,
|
getPopupContainer,
|
||||||
@@ -31,7 +31,7 @@ export const querySchema: FormSchemaGetter = () => [
|
|||||||
},
|
},
|
||||||
fieldName: 'state',
|
fieldName: 'state',
|
||||||
label: '处理状态',
|
label: '处理状态',
|
||||||
},
|
},*/
|
||||||
];
|
];
|
||||||
|
|
||||||
export const columns: VxeGridProps['columns'] = [
|
export const columns: VxeGridProps['columns'] = [
|
||||||
@@ -44,6 +44,10 @@ export const columns: VxeGridProps['columns'] = [
|
|||||||
title: '预警时间',
|
title: '预警时间',
|
||||||
field: 'reportTime',
|
field: 'reportTime',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '设备ip',
|
||||||
|
field: 'deviceIp',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '设备名称',
|
title: '设备名称',
|
||||||
field: 'deviceName',
|
field: 'deviceName',
|
||||||
@@ -85,12 +89,12 @@ export const columns: VxeGridProps['columns'] = [
|
|||||||
field: 'stateName',
|
field: 'stateName',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '预期处理时间',
|
title: '创建时间',
|
||||||
field: 'servBeginTime',
|
field: 'createTime',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '处理时间',
|
title: '创建人',
|
||||||
field: 'servEndTime',
|
field: 'createBy',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'action',
|
field: 'action',
|
||||||
@@ -127,78 +131,56 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
valueFormat: 'YYYY.MM.DD HH:mm',
|
valueFormat: 'YYYY.MM.DD HH:mm',
|
||||||
showTime: true,
|
showTime: true,
|
||||||
},
|
},
|
||||||
rules: 'required',
|
|
||||||
disabled: true,
|
disabled: true,
|
||||||
|
rules: 'required',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '预警类型',
|
label: '预警类型',
|
||||||
fieldName: 'bigTypeName',
|
fieldName: 'alarmType',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
disabled: true,
|
disabled: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '描述',
|
label: '设备名称',
|
||||||
fieldName: 'description',
|
fieldName: 'deviceIp',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
formItemClass: 'col-span-2',
|
|
||||||
disabled: true,
|
disabled: true,
|
||||||
},
|
|
||||||
/* {
|
|
||||||
label: '所在位置',
|
|
||||||
fieldName: 'location',
|
|
||||||
component: 'Input',
|
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
disabled: true,
|
},
|
||||||
},*/
|
|
||||||
{
|
{
|
||||||
label: '设备名称',
|
label: '设备名称',
|
||||||
fieldName: 'deviceName',
|
fieldName: 'deviceName',
|
||||||
|
disabled: true,
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
disabled: true,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '处理情况',
|
label: '重要级别',
|
||||||
fieldName: 'processingDetails',
|
|
||||||
component: 'Input',
|
|
||||||
componentProps: {
|
|
||||||
rows: 3,
|
|
||||||
},
|
|
||||||
formItemClass: 'col-span-2',
|
|
||||||
disabled: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
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',
|
|
||||||
disabled: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '级别',
|
|
||||||
fieldName: 'level',
|
fieldName: 'level',
|
||||||
component: 'Select',
|
component: 'Select',
|
||||||
|
disabled: true,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
getPopupContainer,
|
getPopupContainer,
|
||||||
options: getDictOptions(DictEnum.alarm_level, true),
|
options: getDictOptions(DictEnum.alarm_level, true),
|
||||||
},
|
},
|
||||||
rules: 'selectRequired',
|
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: '处理状态',
|
label: '处理状态',
|
||||||
component: 'Select',
|
component: 'Select',
|
||||||
|
disabled: true,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
getPopupContainer,
|
getPopupContainer,
|
||||||
options: getDictOptions(DictEnum.alarm_state, true),
|
options: getDictOptions(DictEnum.alarm_state, true),
|
||||||
@@ -206,16 +188,61 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
fieldName: 'state',
|
fieldName: 'state',
|
||||||
rules: 'selectRequired',
|
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: '预期处理时间',
|
label: '处理人',
|
||||||
fieldName: 'expectedProcessingTime',
|
fieldName: 'solveId',
|
||||||
component: 'DatePicker',
|
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: {
|
componentProps: {
|
||||||
format: 'YYYY.MM.DD HH:mm',
|
rows: 3,
|
||||||
valueFormat: 'YYYY.MM.DD HH:mm',
|
|
||||||
showTime: true,
|
|
||||||
},
|
},
|
||||||
rules: 'required',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
@@ -12,7 +12,6 @@ import {
|
|||||||
import { columns, querySchema } from './data';
|
import { columns, querySchema } from './data';
|
||||||
import warningModal from './warning-modal.vue';
|
import warningModal from './warning-modal.vue';
|
||||||
import warningDetail from './warning-detail.vue';
|
import warningDetail from './warning-detail.vue';
|
||||||
import LevelSettingModal from './level-setting-modal.vue';
|
|
||||||
import { alarmEventsList, alarmEventsRemove } from '#/api/sis/alarmEvents';
|
import { alarmEventsList, alarmEventsRemove } from '#/api/sis/alarmEvents';
|
||||||
import type { AlarmEventsForm } from '#/api/sis/alarmEvents/model';
|
import type { AlarmEventsForm } from '#/api/sis/alarmEvents/model';
|
||||||
|
|
||||||
@@ -49,6 +48,7 @@ const gridOptions: VxeGridProps = {
|
|||||||
return await alarmEventsList({
|
return await alarmEventsList({
|
||||||
pageNum: page.currentPage,
|
pageNum: page.currentPage,
|
||||||
pageSize: page.pageSize,
|
pageSize: page.pageSize,
|
||||||
|
state: 10,
|
||||||
...formValues,
|
...formValues,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -75,16 +75,6 @@ const [WarningDetail, detailApi] = useVbenModal({
|
|||||||
connectedComponent: warningDetail,
|
connectedComponent: warningDetail,
|
||||||
});
|
});
|
||||||
|
|
||||||
const [LevelSettingModalComp, levelModalApi] = useVbenModal({
|
|
||||||
connectedComponent: LevelSettingModal,
|
|
||||||
});
|
|
||||||
|
|
||||||
// 级别设置
|
|
||||||
function handleLevelSetting(row: any) {
|
|
||||||
levelModalApi.setData({ id: row.id, level: row.level, data: row });
|
|
||||||
levelModalApi.open();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查看详情
|
// 查看详情
|
||||||
async function handleView(row: any) {
|
async function handleView(row: any) {
|
||||||
detailApi.setData({ id: row.id, data: row });
|
detailApi.setData({ id: row.id, data: row });
|
||||||
@@ -97,17 +87,6 @@ async function handleEdit(row: any) {
|
|||||||
modalApi.open();
|
modalApi.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 分配处理
|
|
||||||
function handleAssign(row: any) {
|
|
||||||
Modal.confirm({
|
|
||||||
title: '分配处理',
|
|
||||||
content: `确定要分配预警 ${row.alarmId} 给处理人员吗?`,
|
|
||||||
onOk() {
|
|
||||||
//查询当前排班的人员信息
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 删除
|
// 删除
|
||||||
async function handleDelete(row: any) {
|
async function handleDelete(row: any) {
|
||||||
const index = row.id;
|
const index = row.id;
|
||||||
@@ -161,19 +140,14 @@ function handleMultiDelete() {
|
|||||||
>
|
>
|
||||||
{{ $t('pages.common.info') }}
|
{{ $t('pages.common.info') }}
|
||||||
</ghost-button>
|
</ghost-button>
|
||||||
|
|
||||||
<ghost-button
|
<ghost-button
|
||||||
v-access:code="['video:warning:edit']"
|
v-access:code="['video:warning:edit']"
|
||||||
@click.stop="handleEdit(row)"
|
@click.stop="handleEdit(row)"
|
||||||
>
|
>
|
||||||
{{ $t('pages.common.edit') }}
|
处理
|
||||||
</ghost-button>
|
|
||||||
<ghost-button
|
|
||||||
v-access:code="['video:warning:assign']"
|
|
||||||
@click.stop="handleAssign(row)"
|
|
||||||
:disabled="row.processingStatus === '已完成'"
|
|
||||||
>
|
|
||||||
分配处理
|
|
||||||
</ghost-button>
|
</ghost-button>
|
||||||
|
|
||||||
<Popconfirm
|
<Popconfirm
|
||||||
:get-popup-container="getVxePopupContainer"
|
:get-popup-container="getVxePopupContainer"
|
||||||
placement="left"
|
placement="left"
|
||||||
@@ -193,7 +167,6 @@ function handleMultiDelete() {
|
|||||||
</BasicTable>
|
</BasicTable>
|
||||||
<WarningModal @reload="tableApi.query()" />
|
<WarningModal @reload="tableApi.query()" />
|
||||||
<WarningDetail />
|
<WarningDetail />
|
||||||
<LevelSettingModalComp />
|
|
||||||
</Page>
|
</Page>
|
||||||
</template>
|
</template>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
@@ -1,45 +0,0 @@
|
|||||||
<template>
|
|
||||||
<BasicModal>
|
|
||||||
<RadioGroup v-model:value="selectedLevel">
|
|
||||||
<Radio value="特大">特大</Radio>
|
|
||||||
<Radio value="重要">重要</Radio>
|
|
||||||
<Radio value="一般">一般</Radio>
|
|
||||||
</RadioGroup>
|
|
||||||
</BasicModal>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup lang="ts">
|
|
||||||
import { ref } from 'vue';
|
|
||||||
import { useVbenModal } from '@vben/common-ui';
|
|
||||||
import { RadioGroup, Radio } from 'ant-design-vue';
|
|
||||||
|
|
||||||
const emit = defineEmits<{ reload: [] }>();
|
|
||||||
|
|
||||||
const selectedLevel = ref('一般');
|
|
||||||
|
|
||||||
const [BasicModal, modalApi] = useVbenModal({
|
|
||||||
class: 'w-[360px]',
|
|
||||||
title: '设置级别',
|
|
||||||
onOpenChange: async (isOpen) => {
|
|
||||||
if (!isOpen) return null;
|
|
||||||
const { level } = modalApi.getData() as { level?: string };
|
|
||||||
selectedLevel.value = level || '一般';
|
|
||||||
},
|
|
||||||
onConfirm: handleConfirm,
|
|
||||||
});
|
|
||||||
|
|
||||||
function handleConfirm() {
|
|
||||||
const { id, data } = modalApi.getData() as {
|
|
||||||
id: number | string;
|
|
||||||
data: any[];
|
|
||||||
};
|
|
||||||
if (id != null && data) {
|
|
||||||
const idx = data.findIndex((item: any) => item.id === id);
|
|
||||||
if (idx !== -1) {
|
|
||||||
data[idx].level = selectedLevel.value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
emit('reload');
|
|
||||||
modalApi.close();
|
|
||||||
}
|
|
||||||
</script>
|
|
@@ -1,17 +1,12 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, shallowRef } from 'vue';
|
import { ref, shallowRef } from 'vue';
|
||||||
import { useVbenModal } from '@vben/common-ui';
|
import { useVbenModal } from '@vben/common-ui';
|
||||||
import {
|
import { Descriptions, DescriptionsItem, Image, Tag } from 'ant-design-vue';
|
||||||
Descriptions,
|
|
||||||
DescriptionsItem,
|
|
||||||
Image,
|
|
||||||
Tag,
|
|
||||||
Timeline,
|
|
||||||
TimelineItem,
|
|
||||||
} from 'ant-design-vue';
|
|
||||||
import { queryAlarmEventAttachmentsList } from '#/api/sis/alarmEventAttachments';
|
import { queryAlarmEventAttachmentsList } from '#/api/sis/alarmEventAttachments';
|
||||||
import type { AlarmEventAttachmentsVO } from '#/api/sis/alarmEventAttachments/model';
|
import type { AlarmEventAttachmentsVO } from '#/api/sis/alarmEventAttachments/model';
|
||||||
import { fallImg } from './data';
|
import { fallImg } from './data';
|
||||||
|
import { alarmEventProcessList } from '#/api/sis/alarmEventProcess';
|
||||||
|
import type { AlarmEventProcessVO } from '#/api/sis/alarmEventProcess/model';
|
||||||
|
|
||||||
const [BasicModal, modalApi] = useVbenModal({
|
const [BasicModal, modalApi] = useVbenModal({
|
||||||
onOpenChange: handleOpenChange,
|
onOpenChange: handleOpenChange,
|
||||||
@@ -22,23 +17,6 @@ const [BasicModal, modalApi] = useVbenModal({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const warningDetail = shallowRef<any>(null);
|
const warningDetail = shallowRef<any>(null);
|
||||||
|
|
||||||
// 时间线显示条件配置
|
|
||||||
const timelineConfig = {
|
|
||||||
已完成: ['已完成'],
|
|
||||||
处理异常: ['已完成', '处理异常'],
|
|
||||||
处理中: ['已完成', '处理中', '处理异常'],
|
|
||||||
};
|
|
||||||
|
|
||||||
function showTimelineItem(type: string): boolean {
|
|
||||||
const currentStatus = warningDetail.value?.processingStatus;
|
|
||||||
return (
|
|
||||||
timelineConfig[type as keyof typeof timelineConfig]?.includes(
|
|
||||||
currentStatus,
|
|
||||||
) || false
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const currFiles = ref<AlarmEventAttachmentsVO[]>([]);
|
const currFiles = ref<AlarmEventAttachmentsVO[]>([]);
|
||||||
|
|
||||||
async function handleOpenChange(open: boolean) {
|
async function handleOpenChange(open: boolean) {
|
||||||
@@ -50,15 +28,31 @@ async function handleOpenChange(open: boolean) {
|
|||||||
id: number | string;
|
id: number | string;
|
||||||
data: any[];
|
data: any[];
|
||||||
};
|
};
|
||||||
|
|
||||||
// 从传递的数据中查找对应的记录
|
// 从传递的数据中查找对应的记录
|
||||||
if (data) {
|
if (data) {
|
||||||
warningDetail.value = data;
|
warningDetail.value = data;
|
||||||
}
|
}
|
||||||
// 加载事件附件信息
|
// 加载事件附件信息
|
||||||
currFiles.value = await queryAlarmEventAttachmentsList(id);
|
currFiles.value = await queryAlarmEventAttachmentsList(id);
|
||||||
|
// 加载处理流程
|
||||||
|
loadProcessList();
|
||||||
modalApi.modalLoading(false);
|
modalApi.modalLoading(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const process = ref<AlarmEventProcessVO[]>([]);
|
||||||
|
|
||||||
|
function loadProcessList() {
|
||||||
|
const data = modalApi.getData();
|
||||||
|
const params = {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 50,
|
||||||
|
alarmId: data.id,
|
||||||
|
};
|
||||||
|
alarmEventProcessList(params).then((res) => {
|
||||||
|
const { rows = [] } = res;
|
||||||
|
process.value = rows;
|
||||||
|
});
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -146,41 +140,6 @@ async function handleOpenChange(open: boolean) {
|
|||||||
|
|
||||||
<DescriptionsItem :span="1" label="报警视频"></DescriptionsItem>
|
<DescriptionsItem :span="1" label="报警视频"></DescriptionsItem>
|
||||||
</Descriptions>
|
</Descriptions>
|
||||||
|
|
||||||
<Timeline>
|
|
||||||
<TimelineItem v-if="warningDetail.processingStatus === '已完成'">
|
|
||||||
<p style="display: flex">类型:已完成</p>
|
|
||||||
<p>时间:2025-06-01 11:07:59</p>
|
|
||||||
<p>处理人:张三</p>
|
|
||||||
</TimelineItem>
|
|
||||||
<TimelineItem
|
|
||||||
v-if="
|
|
||||||
warningDetail.processingStatus === '已完成' ||
|
|
||||||
warningDetail.processingStatus === '处理异常'
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<p style="display: flex">类型:处理异常</p>
|
|
||||||
<p>时间:2025-06-01 11:07:59</p>
|
|
||||||
<p>处理人:张三</p>
|
|
||||||
<p>异常原因:时长不够</p>
|
|
||||||
</TimelineItem>
|
|
||||||
<TimelineItem
|
|
||||||
v-if="
|
|
||||||
warningDetail.processingStatus === '已完成' ||
|
|
||||||
warningDetail.processingStatus === '处理中' ||
|
|
||||||
warningDetail.processingStatus === '处理异常'
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<p style="display: flex">类型:处理中</p>
|
|
||||||
<p>时间:2025-06-01 11:07:59</p>
|
|
||||||
<p>处理人:张三</p>
|
|
||||||
</TimelineItem>
|
|
||||||
<TimelineItem>
|
|
||||||
<p style="display: flex">类型:创建预警</p>
|
|
||||||
<p>时间:2025-06-01 11:07:59</p>
|
|
||||||
<p>处理人:张三</p>
|
|
||||||
</TimelineItem>
|
|
||||||
</Timeline>
|
|
||||||
</BasicModal>
|
</BasicModal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@@ -1,21 +1,20 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
|
|
||||||
import { useVbenModal } from '@vben/common-ui';
|
import { useVbenModal } from '@vben/common-ui';
|
||||||
import { $t } from '@vben/locales';
|
|
||||||
import { cloneDeep } from '@vben/utils';
|
import { cloneDeep } from '@vben/utils';
|
||||||
|
|
||||||
import { useVbenForm } from '#/adapter/form';
|
import { useVbenForm } from '#/adapter/form';
|
||||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||||
|
|
||||||
import { modalSchema } from './data';
|
import { modalSchema } from './data';
|
||||||
|
import { queryCurrentSchedu } from '#/api/property/attendanceManagement/arrangement';
|
||||||
|
import type { AttendanceUserGroup } from '#/api/property/attendanceManagement/arrangement/model';
|
||||||
|
import { taskAssignment } from '#/api/sis/alarmEvents';
|
||||||
|
|
||||||
const emit = defineEmits<{ reload: [] }>();
|
const emit = defineEmits<{ reload: [] }>();
|
||||||
|
|
||||||
const isUpdate = ref(false);
|
const isUpdate = ref(false);
|
||||||
const title = computed(() => {
|
|
||||||
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
|
|
||||||
});
|
|
||||||
|
|
||||||
const [BasicForm, formApi] = useVbenForm({
|
const [BasicForm, formApi] = useVbenForm({
|
||||||
commonConfig: {
|
commonConfig: {
|
||||||
@@ -36,7 +35,7 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
|||||||
currentGetter: defaultFormValueGetter(formApi),
|
currentGetter: defaultFormValueGetter(formApi),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
let currentSelectData: any = null;
|
||||||
const [BasicModal, modalApi] = useVbenModal({
|
const [BasicModal, modalApi] = useVbenModal({
|
||||||
class: 'w-[70%]',
|
class: 'w-[70%]',
|
||||||
fullscreenButton: false,
|
fullscreenButton: false,
|
||||||
@@ -52,13 +51,51 @@ const [BasicModal, modalApi] = useVbenModal({
|
|||||||
isUpdate.value = !!id;
|
isUpdate.value = !!id;
|
||||||
|
|
||||||
if (isUpdate.value && id) {
|
if (isUpdate.value && id) {
|
||||||
|
// 更新表单属性
|
||||||
|
const userList: AttendanceUserGroup[] = await queryCurrentSchedu();
|
||||||
|
const arr = userList.map((item) => {
|
||||||
|
const { remoteUserVo, deptName } = item;
|
||||||
|
return {
|
||||||
|
label: remoteUserVo.nickName,
|
||||||
|
value: remoteUserVo.userId,
|
||||||
|
deptName: deptName,
|
||||||
|
phonenumber: remoteUserVo.phonenumber,
|
||||||
|
email: remoteUserVo.email,
|
||||||
|
userName: remoteUserVo.userName,
|
||||||
|
nickName: remoteUserVo.nickName,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
formApi.updateSchema([
|
||||||
|
{
|
||||||
|
componentProps: {
|
||||||
|
options: arr,
|
||||||
|
onChange: async (_value: any, data: any) => {
|
||||||
|
const {
|
||||||
|
deptName = '',
|
||||||
|
email = '',
|
||||||
|
phonenumber = '',
|
||||||
|
nickName = '',
|
||||||
|
} = data;
|
||||||
|
const formData = cloneDeep(await formApi.getValues());
|
||||||
|
formData.phonenumber = phonenumber;
|
||||||
|
formData.email = email;
|
||||||
|
formData.deptName = deptName;
|
||||||
|
currentSelectData = data;
|
||||||
|
formApi.setValues(formData);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
fieldName: 'solveId',
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
|
||||||
// 从传递的数据中查找对应的记录
|
// 从传递的数据中查找对应的记录
|
||||||
const { data } = modalApi.getData() as {
|
const { data } = modalApi.getData() as {
|
||||||
id: number | string;
|
id: number | string;
|
||||||
data: any[];
|
data: any;
|
||||||
};
|
};
|
||||||
if (data) {
|
if (data) {
|
||||||
console.log(data)
|
// 处理预警上报类型
|
||||||
|
data.alarmType = `${data.bigTypeName} - ${data.smallTypeName}`;
|
||||||
await formApi.setValues(data);
|
await formApi.setValues(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -74,16 +111,18 @@ async function handleConfirm() {
|
|||||||
if (!valid) {
|
if (!valid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// 表单数据
|
||||||
const formData = cloneDeep(await formApi.getValues());
|
const formData = cloneDeep(await formApi.getValues());
|
||||||
|
// 更新数据
|
||||||
// 更新表格数据
|
const params = {
|
||||||
const { data } = modalApi.getData() as { id: number | string; data: any[] };
|
alarmId: formData.id,
|
||||||
const index = data.findIndex((item: any) => item.id === formData.id);
|
solveId: currentSelectData.value,
|
||||||
if (index !== -1) {
|
solveName: `${currentSelectData.userName}(${currentSelectData.nickName})`,
|
||||||
// 更新数据
|
solvePhone: currentSelectData.phonenumber,
|
||||||
Object.assign(data[index], formData);
|
solveEmail: currentSelectData.email,
|
||||||
}
|
remark: formData.remark,
|
||||||
|
};
|
||||||
|
await taskAssignment(params);
|
||||||
resetInitialized();
|
resetInitialized();
|
||||||
emit('reload');
|
emit('reload');
|
||||||
modalApi.close();
|
modalApi.close();
|
||||||
@@ -101,8 +140,8 @@ async function handleClosed() {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<BasicModal :title="title">
|
<BasicModal title="处理">
|
||||||
<BasicForm />
|
<BasicForm></BasicForm>
|
||||||
</BasicModal>
|
</BasicModal>
|
||||||
</template>
|
</template>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
@@ -1,8 +1,13 @@
|
|||||||
import type { FormSchemaGetter } from '#/adapter/form';
|
import type { FormSchemaGetter } from '#/adapter/form';
|
||||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||||
import { getDictOptions } from '#/utils/dict';
|
|
||||||
import { renderDict } from '#/utils/render';
|
|
||||||
import { h } from 'vue';
|
import { h } from 'vue';
|
||||||
|
import { getPopupContainer } from '@vben/utils';
|
||||||
|
import { getDictOptions } from '#/utils/dict';
|
||||||
|
import { DictEnum } from '@vben/constants';
|
||||||
|
import { uploadApi } from '#/api';
|
||||||
|
|
||||||
|
export const fallImg =
|
||||||
|
'data:image/png;base64,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';
|
||||||
|
|
||||||
export const querySchema: FormSchemaGetter = () => [
|
export const querySchema: FormSchemaGetter = () => [
|
||||||
{
|
{
|
||||||
@@ -13,56 +18,50 @@ export const querySchema: FormSchemaGetter = () => [
|
|||||||
{
|
{
|
||||||
component: 'Select',
|
component: 'Select',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
options: [
|
getPopupContainer,
|
||||||
{ label: '特大', value: '特大' },
|
options: getDictOptions(DictEnum.alarm_level, true),
|
||||||
{ label: '重要', value: '重要' },
|
|
||||||
{ label: '一般', value: '一般' },
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
fieldName: 'level',
|
fieldName: 'level',
|
||||||
label: '级别',
|
label: '级别',
|
||||||
},
|
},
|
||||||
{
|
/*{
|
||||||
component: 'Select',
|
component: 'Select',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
options: [
|
getPopupContainer,
|
||||||
{ label: '待分配', value: '待分配' },
|
options: getDictOptions(DictEnum.alarm_state, true),
|
||||||
{ label: '处理中', value: '处理中' },
|
|
||||||
{ label: '已完成', value: '已完成' },
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
fieldName: 'processingStatus',
|
fieldName: 'state',
|
||||||
label: '处理状态',
|
label: '处理状态',
|
||||||
},
|
},*/
|
||||||
];
|
];
|
||||||
|
|
||||||
export const columns: VxeGridProps['columns'] = [
|
export const columns: VxeGridProps['columns'] = [
|
||||||
{ type: 'checkbox', width: 60 },
|
{ type: 'checkbox', width: 60 },
|
||||||
{
|
{
|
||||||
title: '预警编号',
|
title: '预警编号',
|
||||||
field: 'alarmId',
|
field: 'id',
|
||||||
width: 150,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '预警时间',
|
title: '预警时间',
|
||||||
field: 'alarmTime',
|
field: 'reportTime',
|
||||||
width: 150,
|
},
|
||||||
|
{
|
||||||
|
title: '设备ip',
|
||||||
|
field: 'deviceIp',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '设备名称',
|
title: '设备名称',
|
||||||
field: 'deviceName',
|
field: 'deviceName',
|
||||||
width: 150,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '级别',
|
title: '级别',
|
||||||
field: 'level',
|
field: 'level',
|
||||||
width: 100,
|
|
||||||
slots: {
|
slots: {
|
||||||
default: ({ row }: any) => {
|
default: ({ row }: any) => {
|
||||||
const levelColors: Record<string, string> = {
|
const levelColors: Record<string, string> = {
|
||||||
特大: 'red',
|
1: 'red',
|
||||||
重要: 'orange',
|
2: 'orange',
|
||||||
一般: 'blue',
|
3: 'blue',
|
||||||
};
|
};
|
||||||
return h(
|
return h(
|
||||||
'span',
|
'span',
|
||||||
@@ -72,64 +71,31 @@ export const columns: VxeGridProps['columns'] = [
|
|||||||
fontWeight: 'bold',
|
fontWeight: 'bold',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
row.level,
|
row.levelName,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '预警类型',
|
title: '预警类型',
|
||||||
field: 'alarmType',
|
field: 'alarmTypeName',
|
||||||
width: 120,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '描述',
|
|
||||||
field: 'description',
|
|
||||||
minWidth: 200,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '所在位置',
|
|
||||||
field: 'location',
|
|
||||||
width: 150,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '处理状态',
|
|
||||||
field: 'processingStatus',
|
|
||||||
width: 100,
|
|
||||||
slots: {
|
slots: {
|
||||||
default: ({ row }: any) => {
|
default: ({ row }: any) => {
|
||||||
const statusColors: Record<string, string> = {
|
return h('span', row.bigTypeName + '-' + row.smallTypeName);
|
||||||
待分配: 'red',
|
|
||||||
处理中: 'orange',
|
|
||||||
已完成: 'green',
|
|
||||||
};
|
|
||||||
return h(
|
|
||||||
'span',
|
|
||||||
{
|
|
||||||
style: {
|
|
||||||
color: statusColors[row.processingStatus] || '#666',
|
|
||||||
fontWeight: 'bold',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
row.processingStatus,
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '处理情况',
|
title: '处理状态',
|
||||||
field: 'processingDetails',
|
field: 'stateName',
|
||||||
width: 150,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '预期处理时间',
|
title: '创建时间',
|
||||||
field: 'expectedProcessingTime',
|
field: 'createTime',
|
||||||
width: 150,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '处理时间',
|
title: '处理人',
|
||||||
field: 'processingTime',
|
field: 'solveName',
|
||||||
width: 150,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'action',
|
field: 'action',
|
||||||
@@ -152,22 +118,22 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '预警编号',
|
label: '预警编号',
|
||||||
fieldName: 'alarmId',
|
fieldName: 'id',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
disabled: true,
|
disabled: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '预警时间',
|
label: '预警时间',
|
||||||
fieldName: 'alarmTime',
|
fieldName: 'reportTime',
|
||||||
component: 'DatePicker',
|
component: 'DatePicker',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
format: 'YYYY.MM.DD HH:mm',
|
format: 'YYYY.MM.DD HH:mm',
|
||||||
valueFormat: 'YYYY.MM.DD HH:mm',
|
valueFormat: 'YYYY.MM.DD HH:mm',
|
||||||
showTime: true,
|
showTime: true,
|
||||||
},
|
},
|
||||||
rules: 'required',
|
|
||||||
disabled: true,
|
disabled: true,
|
||||||
|
rules: 'required',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '预警类型',
|
label: '预警类型',
|
||||||
@@ -177,89 +143,146 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
disabled: true,
|
disabled: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '描述',
|
label: '设备名称',
|
||||||
fieldName: 'description',
|
fieldName: 'deviceIp',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
formItemClass: 'col-span-2',
|
|
||||||
disabled: true,
|
disabled: true,
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '所在位置',
|
|
||||||
fieldName: 'location',
|
|
||||||
component: 'Input',
|
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
disabled: true,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '设备名称',
|
label: '设备名称',
|
||||||
fieldName: 'deviceName',
|
fieldName: 'deviceName',
|
||||||
|
disabled: true,
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
disabled: true,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '处理情况',
|
label: '重要级别',
|
||||||
fieldName: 'processingDetails',
|
fieldName: 'level',
|
||||||
component: 'Input',
|
component: 'Select',
|
||||||
|
disabled: true,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
rows: 3,
|
getPopupContainer,
|
||||||
|
options: getDictOptions(DictEnum.alarm_level, true),
|
||||||
},
|
},
|
||||||
formItemClass: 'col-span-2',
|
rules: 'selectRequired',
|
||||||
disabled: true,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '处理时间',
|
label: '创建时间',
|
||||||
fieldName: 'processingTime',
|
fieldName: 'createTime',
|
||||||
component: 'DatePicker',
|
component: 'DatePicker',
|
||||||
|
disabled: true,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
format: 'YYYY.MM.DD HH:mm',
|
format: 'YYYY.MM.DD HH:mm',
|
||||||
valueFormat: 'YYYY.MM.DD HH:mm',
|
valueFormat: 'YYYY.MM.DD HH:mm',
|
||||||
showTime: true,
|
showTime: true,
|
||||||
},
|
},
|
||||||
disabled: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '处理图片',
|
|
||||||
fieldName: 'imgUrl',
|
|
||||||
component: 'Input',
|
|
||||||
rules: 'required',
|
|
||||||
disabled: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '级别',
|
|
||||||
fieldName: 'level',
|
|
||||||
component: 'Select',
|
|
||||||
componentProps: {
|
|
||||||
options: [
|
|
||||||
{ label: '特大', value: '特大' },
|
|
||||||
{ label: '重要', value: '重要' },
|
|
||||||
{ label: '一般', value: '一般' },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
rules: 'selectRequired',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '处理状态',
|
label: '处理状态',
|
||||||
fieldName: 'processingStatus',
|
|
||||||
component: 'Select',
|
component: 'Select',
|
||||||
|
disabled: true,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
options: [
|
getPopupContainer,
|
||||||
{ label: '待分配', value: '待分配' },
|
options: getDictOptions(DictEnum.alarm_state, true),
|
||||||
{ label: '处理中', value: '处理中' },
|
|
||||||
{ label: '已完成', value: '已完成' },
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
|
fieldName: 'state',
|
||||||
rules: 'selectRequired',
|
rules: 'selectRequired',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '预期处理时间',
|
label: '描述',
|
||||||
fieldName: 'expectedProcessingTime',
|
disabled: true,
|
||||||
component: 'DatePicker',
|
fieldName: 'description',
|
||||||
|
component: 'Textarea',
|
||||||
|
formItemClass: 'col-span-2',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
format: 'YYYY.MM.DD HH:mm',
|
rows: 3,
|
||||||
valueFormat: 'YYYY.MM.DD HH:mm',
|
},
|
||||||
showTime: true,
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
label: '处理人',
|
||||||
|
fieldName: 'solveName',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '处理人电话',
|
||||||
|
fieldName: 'solvePhone',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
label: '处理人邮箱',
|
||||||
|
fieldName: 'solveEmail',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
|
// 插入分割线
|
||||||
|
{
|
||||||
|
component: 'Divider',
|
||||||
|
fieldName: '_divider',
|
||||||
|
formItemClass: 'col-span-2',
|
||||||
|
hideLabel: true,
|
||||||
|
renderComponentContent: () => {
|
||||||
|
return {
|
||||||
|
default: () => h('div', '处理'),
|
||||||
|
};
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
label: '备注',
|
||||||
|
fieldName: 'remark',
|
||||||
|
component: 'Textarea',
|
||||||
|
formItemClass: 'col-span-2',
|
||||||
|
componentProps: {
|
||||||
|
rows: 2,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
component: 'Upload',
|
||||||
|
componentProps: {
|
||||||
|
// 更多属性见:https://ant.design/components/upload-cn
|
||||||
|
accept: '.png,.jpg,.jpeg',
|
||||||
|
// 自动携带认证信息
|
||||||
|
customRequest: upload_file,
|
||||||
|
disabled: false,
|
||||||
|
maxCount: 2,
|
||||||
|
multiple: false,
|
||||||
|
showUploadList: true,
|
||||||
|
// 上传列表的内建样式,支持四种基本样式 text, picture, picture-card 和 picture-circle
|
||||||
|
listType: 'picture-card',
|
||||||
|
},
|
||||||
|
fieldName: 'files',
|
||||||
|
label: '附件',
|
||||||
|
renderComponentContent: () => {
|
||||||
|
return {
|
||||||
|
default: () => '上传附件',
|
||||||
|
};
|
||||||
},
|
},
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
interface UploadFileParams {
|
||||||
|
file: File;
|
||||||
|
onError?: (error: Error) => void;
|
||||||
|
onProgress?: (progress: { percent: number }) => void;
|
||||||
|
onSuccess?: (data: any, file: File) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function upload_file({
|
||||||
|
file,
|
||||||
|
onError,
|
||||||
|
onProgress,
|
||||||
|
onSuccess,
|
||||||
|
}: UploadFileParams) {
|
||||||
|
try {
|
||||||
|
onProgress?.({ percent: 0 });
|
||||||
|
const data = await uploadApi(file);
|
||||||
|
onProgress?.({ percent: 100 });
|
||||||
|
onSuccess?.(data, file);
|
||||||
|
} catch (error) {
|
||||||
|
onError?.(error instanceof Error ? error : new Error(String(error)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -2,76 +2,20 @@
|
|||||||
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||||
import { getVxePopupContainer } from '@vben/utils';
|
import { getVxePopupContainer } from '@vben/utils';
|
||||||
|
|
||||||
import { Modal, Popconfirm, Space, Tag } from 'ant-design-vue';
|
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||||
import { ref, watch } from 'vue';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
useVbenVxeGrid,
|
useVbenVxeGrid,
|
||||||
vxeCheckboxChecked,
|
vxeCheckboxChecked,
|
||||||
type VxeGridProps,
|
type VxeGridProps,
|
||||||
} from '#/adapter/vxe-table';
|
} from '#/adapter/vxe-table';
|
||||||
|
|
||||||
import { commonDownloadExcel } from '#/utils/file/download';
|
|
||||||
import { renderDict } from '#/utils/render';
|
|
||||||
|
|
||||||
import { columns, querySchema } from './data';
|
import { columns, querySchema } from './data';
|
||||||
import warningModal from './warning-modal.vue';
|
import warningModal from './warning-modal.vue';
|
||||||
import warningDetail from './warning-detail.vue';
|
import warningDetail from './warning-detail.vue';
|
||||||
import LevelSettingModal from './level-setting-modal.vue';
|
import {alarmEventsList, alarmEventsListCurr, alarmEventsRemove} from '#/api/sis/alarmEvents';
|
||||||
import imgPng from '../../../../assets/algorithmManagement/image.png';
|
import type { AlarmEventsForm } from '#/api/sis/alarmEvents/model';
|
||||||
|
|
||||||
// 假数据
|
|
||||||
const mockData = ref([
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
alarmId: 'JWD-3434234',
|
|
||||||
alarmTime: '2025.07.21 12:20',
|
|
||||||
level: '特大',
|
|
||||||
alarmType: '越界侦测',
|
|
||||||
description: '温度高于80度发生火宅',
|
|
||||||
location: '1栋3号电梯旁',
|
|
||||||
processingStatus: '待分配',
|
|
||||||
processingDetails: '',
|
|
||||||
processingTime: '',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
alarmId: 'JWD-3434235',
|
|
||||||
alarmTime: '2025.07.21 11:15',
|
|
||||||
level: '重要',
|
|
||||||
alarmType: '异常行为',
|
|
||||||
description: '人员异常聚集',
|
|
||||||
location: '2栋大厅',
|
|
||||||
processingStatus: '待分配',
|
|
||||||
processingDetails: '已派人员前往处理',
|
|
||||||
processingTime: '2025.07.21 11:30',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 3,
|
|
||||||
alarmId: 'JWD-3434236',
|
|
||||||
alarmTime: '2025.07.21 10:45',
|
|
||||||
level: '一般',
|
|
||||||
alarmType: '设备故障',
|
|
||||||
description: '摄像头离线',
|
|
||||||
location: '3栋走廊',
|
|
||||||
processingStatus: '待分配',
|
|
||||||
processingDetails: '已修复设备',
|
|
||||||
processingTime: '2025.07.21 11:00',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 4,
|
|
||||||
alarmId: 'JWD-3434236',
|
|
||||||
alarmTime: '2025.07.21 10:45',
|
|
||||||
level: '一般',
|
|
||||||
alarmType: '设备故障',
|
|
||||||
description: '摄像头离线',
|
|
||||||
location: '3栋走廊',
|
|
||||||
processingStatus: '待分配',
|
|
||||||
processingDetails: '等待接受',
|
|
||||||
processingTime: '2025.07.21 11:00',
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
|
|
||||||
|
/* 搜索栏配置 */
|
||||||
const formOptions: VbenFormProps = {
|
const formOptions: VbenFormProps = {
|
||||||
commonConfig: {
|
commonConfig: {
|
||||||
labelWidth: 100,
|
labelWidth: 100,
|
||||||
@@ -83,14 +27,32 @@ const formOptions: VbenFormProps = {
|
|||||||
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3',
|
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* table栏配置 */
|
||||||
const gridOptions: VxeGridProps = {
|
const gridOptions: VxeGridProps = {
|
||||||
|
checkboxConfig: {
|
||||||
|
// 高亮
|
||||||
|
highlight: true,
|
||||||
|
// 翻页时保留选中状态
|
||||||
|
reserve: true,
|
||||||
|
// 点击行选中
|
||||||
|
// trigger: 'row',
|
||||||
|
},
|
||||||
|
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
||||||
|
// columns: columns(),
|
||||||
columns,
|
columns,
|
||||||
height: 'auto',
|
height: 'auto',
|
||||||
data: mockData.value,
|
pagerConfig: {},
|
||||||
pagerConfig: {
|
proxyConfig: {
|
||||||
currentPage: 1,
|
ajax: {
|
||||||
pageSize: 10,
|
query: async ({ page }, formValues = {}) => {
|
||||||
total: mockData.value.length,
|
return await alarmEventsListCurr({
|
||||||
|
pageNum: page.currentPage,
|
||||||
|
pageSize: page.pageSize,
|
||||||
|
states: [20, 30, 31, 32],
|
||||||
|
...formValues,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
rowConfig: {
|
rowConfig: {
|
||||||
keyField: 'id',
|
keyField: 'id',
|
||||||
@@ -104,14 +66,6 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
|
|||||||
});
|
});
|
||||||
|
|
||||||
// 监听数据变化,强制重新渲染表格
|
// 监听数据变化,强制重新渲染表格
|
||||||
const tableKey = ref(0);
|
|
||||||
watch(
|
|
||||||
mockData,
|
|
||||||
() => {
|
|
||||||
tableKey.value++;
|
|
||||||
},
|
|
||||||
{ deep: true },
|
|
||||||
);
|
|
||||||
|
|
||||||
const [WarningModal, modalApi] = useVbenModal({
|
const [WarningModal, modalApi] = useVbenModal({
|
||||||
connectedComponent: warningModal,
|
connectedComponent: warningModal,
|
||||||
@@ -121,51 +75,22 @@ const [WarningDetail, detailApi] = useVbenModal({
|
|||||||
connectedComponent: warningDetail,
|
connectedComponent: warningDetail,
|
||||||
});
|
});
|
||||||
|
|
||||||
const [LevelSettingModalComp, levelModalApi] = useVbenModal({
|
|
||||||
connectedComponent: LevelSettingModal,
|
|
||||||
});
|
|
||||||
|
|
||||||
// 级别设置
|
|
||||||
function handleLevelSetting(row: any) {
|
|
||||||
levelModalApi.setData({ id: row.id, level: row.level, data: mockData.value });
|
|
||||||
levelModalApi.open();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查看详情
|
// 查看详情
|
||||||
async function handleView(row: any) {
|
async function handleView(row: any) {
|
||||||
detailApi.setData({ id: row.id, data: mockData.value });
|
detailApi.setData({ id: row.id, data: row });
|
||||||
detailApi.open();
|
detailApi.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编辑
|
// 编辑
|
||||||
async function handleEdit(row: any) {
|
async function handleEdit(row: any) {
|
||||||
modalApi.setData({ id: row.id, data: mockData.value });
|
modalApi.setData({ id: row.id, data: row });
|
||||||
modalApi.open();
|
modalApi.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 分配处理
|
|
||||||
function handleAssign(row: any) {
|
|
||||||
Modal.confirm({
|
|
||||||
title: '分配处理',
|
|
||||||
content: `确定要分配预警 ${row.alarmId} 给处理人员吗?`,
|
|
||||||
onOk() {
|
|
||||||
// 模拟分配处理
|
|
||||||
const index = mockData.value.findIndex((item: any) => item.id === row.id);
|
|
||||||
if (index !== -1) {
|
|
||||||
// mockData.value[index].processingStatus = '处理中';
|
|
||||||
// mockData.value[index].processingDetails = '已分配给处理人员';
|
|
||||||
// mockData.value[index].processingTime = new Date().toLocaleString();
|
|
||||||
tableApi.query();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 删除
|
// 删除
|
||||||
async function handleDelete(row: any) {
|
async function handleDelete(row: any) {
|
||||||
const index = mockData.value.findIndex((item: any) => item.id === row.id);
|
const index = row.id;
|
||||||
if (index !== -1) {
|
if (index !== -1) {
|
||||||
mockData.value.splice(index, 1);
|
|
||||||
await tableApi.query();
|
await tableApi.query();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -173,18 +98,13 @@ async function handleDelete(row: any) {
|
|||||||
// 批量删除
|
// 批量删除
|
||||||
function handleMultiDelete() {
|
function handleMultiDelete() {
|
||||||
const rows = tableApi.grid.getCheckboxRecords();
|
const rows = tableApi.grid.getCheckboxRecords();
|
||||||
const ids = rows.map((row: any) => row.id);
|
const ids = rows.map((row: Required<AlarmEventsForm>) => row.id);
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
okType: 'danger',
|
okType: 'danger',
|
||||||
content: `确认删除选中的${ids.length}条记录吗?`,
|
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||||
onOk: async () => {
|
onOk: async () => {
|
||||||
ids.forEach((id) => {
|
await alarmEventsRemove(ids);
|
||||||
const index = mockData.value.findIndex((item: any) => item.id === id);
|
|
||||||
if (index !== -1) {
|
|
||||||
mockData.value.splice(index, 1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
await tableApi.query();
|
await tableApi.query();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -192,11 +112,7 @@ function handleMultiDelete() {
|
|||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<Page :auto-content-height="true">
|
<Page :auto-content-height="true">
|
||||||
<BasicTable
|
<BasicTable class="flex-1 overflow-hidden" table-title="视频预警处理">
|
||||||
:key="tableKey"
|
|
||||||
class="flex-1 overflow-hidden"
|
|
||||||
table-title="视频预警处理"
|
|
||||||
>
|
|
||||||
<template #toolbar-tools>
|
<template #toolbar-tools>
|
||||||
<Space>
|
<Space>
|
||||||
<a-button
|
<a-button
|
||||||
@@ -224,19 +140,14 @@ function handleMultiDelete() {
|
|||||||
>
|
>
|
||||||
{{ $t('pages.common.info') }}
|
{{ $t('pages.common.info') }}
|
||||||
</ghost-button>
|
</ghost-button>
|
||||||
|
|
||||||
<ghost-button
|
<ghost-button
|
||||||
v-access:code="['video:warning:edit']"
|
v-access:code="['video:warning:edit']"
|
||||||
@click.stop="handleEdit(row)"
|
@click.stop="handleEdit(row)"
|
||||||
>
|
>
|
||||||
{{ $t('pages.common.edit') }}
|
处理
|
||||||
</ghost-button>
|
|
||||||
<ghost-button
|
|
||||||
v-access:code="['video:warning:assign']"
|
|
||||||
@click.stop="handleAssign(row)"
|
|
||||||
:disabled="row.processingStatus === '已完成'"
|
|
||||||
>
|
|
||||||
分配处理
|
|
||||||
</ghost-button>
|
</ghost-button>
|
||||||
|
|
||||||
<Popconfirm
|
<Popconfirm
|
||||||
:get-popup-container="getVxePopupContainer"
|
:get-popup-container="getVxePopupContainer"
|
||||||
placement="left"
|
placement="left"
|
||||||
@@ -256,7 +167,6 @@ function handleMultiDelete() {
|
|||||||
</BasicTable>
|
</BasicTable>
|
||||||
<WarningModal @reload="tableApi.query()" />
|
<WarningModal @reload="tableApi.query()" />
|
||||||
<WarningDetail />
|
<WarningDetail />
|
||||||
<LevelSettingModalComp @reload="tableKey++" />
|
|
||||||
</Page>
|
</Page>
|
||||||
</template>
|
</template>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
@@ -1,45 +0,0 @@
|
|||||||
<template>
|
|
||||||
<BasicModal>
|
|
||||||
<RadioGroup v-model:value="selectedLevel">
|
|
||||||
<Radio value="特大">特大</Radio>
|
|
||||||
<Radio value="重要">重要</Radio>
|
|
||||||
<Radio value="一般">一般</Radio>
|
|
||||||
</RadioGroup>
|
|
||||||
</BasicModal>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup lang="ts">
|
|
||||||
import { ref } from 'vue';
|
|
||||||
import { useVbenModal } from '@vben/common-ui';
|
|
||||||
import { RadioGroup, Radio } from 'ant-design-vue';
|
|
||||||
|
|
||||||
const emit = defineEmits<{ reload: [] }>();
|
|
||||||
|
|
||||||
const selectedLevel = ref('一般');
|
|
||||||
|
|
||||||
const [BasicModal, modalApi] = useVbenModal({
|
|
||||||
class: 'w-[360px]',
|
|
||||||
title: '设置级别',
|
|
||||||
onOpenChange: async (isOpen) => {
|
|
||||||
if (!isOpen) return null;
|
|
||||||
const { level } = modalApi.getData() as { level?: string };
|
|
||||||
selectedLevel.value = level || '一般';
|
|
||||||
},
|
|
||||||
onConfirm: handleConfirm,
|
|
||||||
});
|
|
||||||
|
|
||||||
function handleConfirm() {
|
|
||||||
const { id, data } = modalApi.getData() as {
|
|
||||||
id: number | string;
|
|
||||||
data: any[];
|
|
||||||
};
|
|
||||||
if (id != null && data) {
|
|
||||||
const idx = data.findIndex((item: any) => item.id === id);
|
|
||||||
if (idx !== -1) {
|
|
||||||
data[idx].level = selectedLevel.value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
emit('reload');
|
|
||||||
modalApi.close();
|
|
||||||
}
|
|
||||||
</script>
|
|
@@ -1,22 +1,23 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { shallowRef } from 'vue';
|
import { ref, shallowRef } from 'vue';
|
||||||
import { useVbenModal } from '@vben/common-ui';
|
import { useVbenModal } from '@vben/common-ui';
|
||||||
import {
|
import { Descriptions, DescriptionsItem, Image, Tag } from 'ant-design-vue';
|
||||||
Descriptions,
|
import { queryAlarmEventAttachmentsList } from '#/api/sis/alarmEventAttachments';
|
||||||
DescriptionsItem,
|
import type { AlarmEventAttachmentsVO } from '#/api/sis/alarmEventAttachments/model';
|
||||||
Tag,
|
import { fallImg } from './data';
|
||||||
Timeline,
|
import { alarmEventProcessList } from '#/api/sis/alarmEventProcess';
|
||||||
TimelineItem,
|
import type { AlarmEventProcessVO } from '#/api/sis/alarmEventProcess/model';
|
||||||
} from 'ant-design-vue';
|
|
||||||
|
|
||||||
const [BasicModal, modalApi] = useVbenModal({
|
const [BasicModal, modalApi] = useVbenModal({
|
||||||
onOpenChange: handleOpenChange,
|
onOpenChange: handleOpenChange,
|
||||||
onClosed() {
|
onClosed() {
|
||||||
warningDetail.value = null;
|
// warningDetail.value = null;
|
||||||
|
modalApi.close();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const warningDetail = shallowRef<any>(null);
|
const warningDetail = shallowRef<any>(null);
|
||||||
|
const currFiles = ref<AlarmEventAttachmentsVO[]>([]);
|
||||||
|
|
||||||
async function handleOpenChange(open: boolean) {
|
async function handleOpenChange(open: boolean) {
|
||||||
if (!open) {
|
if (!open) {
|
||||||
@@ -27,15 +28,31 @@ async function handleOpenChange(open: boolean) {
|
|||||||
id: number | string;
|
id: number | string;
|
||||||
data: any[];
|
data: any[];
|
||||||
};
|
};
|
||||||
|
|
||||||
// 从传递的数据中查找对应的记录
|
// 从传递的数据中查找对应的记录
|
||||||
const record = data.find((item: any) => item.id === id);
|
if (data) {
|
||||||
if (record) {
|
warningDetail.value = data;
|
||||||
warningDetail.value = record;
|
|
||||||
}
|
}
|
||||||
|
// 加载事件附件信息
|
||||||
|
currFiles.value = await queryAlarmEventAttachmentsList(id);
|
||||||
|
// 加载处理流程
|
||||||
|
loadProcessList();
|
||||||
modalApi.modalLoading(false);
|
modalApi.modalLoading(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const process = ref<AlarmEventProcessVO[]>([]);
|
||||||
|
|
||||||
|
function loadProcessList() {
|
||||||
|
const data = modalApi.getData();
|
||||||
|
const params = {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 50,
|
||||||
|
alarmId: data.id,
|
||||||
|
};
|
||||||
|
alarmEventProcessList(params).then((res) => {
|
||||||
|
const { rows = [] } = res;
|
||||||
|
process.value = rows;
|
||||||
|
});
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -43,7 +60,7 @@ async function handleOpenChange(open: boolean) {
|
|||||||
:footer="false"
|
:footer="false"
|
||||||
:fullscreen-button="false"
|
:fullscreen-button="false"
|
||||||
title="预警详情"
|
title="预警详情"
|
||||||
class="w-[70%]"
|
class="w-[60%]"
|
||||||
>
|
>
|
||||||
<Descriptions
|
<Descriptions
|
||||||
v-if="warningDetail"
|
v-if="warningDetail"
|
||||||
@@ -54,11 +71,13 @@ async function handleOpenChange(open: boolean) {
|
|||||||
style="margin-bottom: 30px"
|
style="margin-bottom: 30px"
|
||||||
>
|
>
|
||||||
<DescriptionsItem label="预警编号">
|
<DescriptionsItem label="预警编号">
|
||||||
{{ warningDetail.alarmId }}
|
{{ warningDetail.id }}
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
|
|
||||||
<DescriptionsItem label="预警时间">
|
<DescriptionsItem label="预警时间">
|
||||||
{{ warningDetail.alarmTime }}
|
{{ warningDetail.reportTime }}
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
|
|
||||||
<DescriptionsItem label="级别">
|
<DescriptionsItem label="级别">
|
||||||
<Tag
|
<Tag
|
||||||
:color="
|
:color="
|
||||||
@@ -69,79 +88,66 @@ async function handleOpenChange(open: boolean) {
|
|||||||
: 'blue'
|
: 'blue'
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
{{ warningDetail.level }}
|
{{ warningDetail.levelName }}
|
||||||
</Tag>
|
</Tag>
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
|
|
||||||
<DescriptionsItem label="预警类型">
|
<DescriptionsItem label="预警类型">
|
||||||
{{ warningDetail.alarmType }}
|
{{ warningDetail.bigTypeName + ' - ' + warningDetail.smallTypeName }}
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
|
|
||||||
|
<DescriptionsItem label="设备ip"
|
||||||
|
>{{ warningDetail.deviceIp }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
|
||||||
|
<DescriptionsItem label="设备ip"
|
||||||
|
>{{ warningDetail.deviceName }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
|
||||||
<DescriptionsItem label="描述" :span="2">
|
<DescriptionsItem label="描述" :span="2">
|
||||||
{{ warningDetail.description }}
|
{{ warningDetail.description }}
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
|
|
||||||
<DescriptionsItem label="所在位置">
|
<DescriptionsItem label="所在位置">
|
||||||
{{ warningDetail.location }}
|
{{ warningDetail.deviceName }}
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
|
|
||||||
<DescriptionsItem label="处理状态">
|
<DescriptionsItem label="处理状态">
|
||||||
<Tag
|
<Tag>
|
||||||
:color="
|
{{ warningDetail.stateName }}
|
||||||
warningDetail.processingStatus === '待分配'
|
|
||||||
? 'red'
|
|
||||||
: warningDetail.processingStatus === '处理中'
|
|
||||||
? 'orange'
|
|
||||||
: 'green'
|
|
||||||
"
|
|
||||||
>
|
|
||||||
{{ warningDetail.processingStatus }}
|
|
||||||
</Tag>
|
</Tag>
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
|
|
||||||
<DescriptionsItem label="处理情况" :span="2">
|
<DescriptionsItem label="处理情况" :span="2">
|
||||||
{{ warningDetail.processingDetails || '-' }}
|
{{ warningDetail.processingDetails || '-' }}
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
<DescriptionsItem label="处理时间">
|
|
||||||
|
<DescriptionsItem label="处理时间" :span="2">
|
||||||
{{ warningDetail.processingTime || '-' }}
|
{{ warningDetail.processingTime || '-' }}
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
<DescriptionsItem label="设备名称">
|
|
||||||
{{ warningDetail.deviceName || '-' }}
|
<DescriptionsItem :span="1" label="附件信息">
|
||||||
</DescriptionsItem>
|
<div class="file-box">
|
||||||
<DescriptionsItem
|
<div class="img-box" v-for="item in currFiles">
|
||||||
label="预处理时间"
|
<Image
|
||||||
v-if="warningDetail.processingStatus === '处理中'"
|
style="width: 120px; height: 120px"
|
||||||
>
|
:src="item.imagePath"
|
||||||
{{ warningDetail.expectedProcessingTime || '-' }}
|
:fallback="fallImg"
|
||||||
</DescriptionsItem>
|
/>
|
||||||
<DescriptionsItem
|
</div>
|
||||||
label="处理图片"
|
</div>
|
||||||
v-if="warningDetail.processingStatus === '已完成'"
|
|
||||||
>
|
|
||||||
<img
|
|
||||||
:src="warningDetail.imgUrl"
|
|
||||||
alt="处理图片"
|
|
||||||
style="max-width: 200px; max-height: 150px"
|
|
||||||
/>
|
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
|
|
||||||
|
<DescriptionsItem :span="1" label="报警视频"></DescriptionsItem>
|
||||||
</Descriptions>
|
</Descriptions>
|
||||||
<Timeline>
|
|
||||||
<TimelineItem>
|
|
||||||
<p style="display: flex">类型:已完成</p>
|
|
||||||
<p>时间:2025-06-01 11:07:59</p>
|
|
||||||
<p>处理人:张三</p>
|
|
||||||
</TimelineItem>
|
|
||||||
<TimelineItem>
|
|
||||||
<p style="display: flex">类型:处理异常</p>
|
|
||||||
<p>时间:2025-06-01 11:07:59</p>
|
|
||||||
<p>处理人:张三</p>
|
|
||||||
<p>异常原因:时长不够</p>
|
|
||||||
</TimelineItem>
|
|
||||||
<TimelineItem>
|
|
||||||
<p style="display: flex">类型:处理中</p>
|
|
||||||
<p>时间:2025-06-01 11:07:59</p>
|
|
||||||
<p>处理人:张三</p>
|
|
||||||
</TimelineItem>
|
|
||||||
<TimelineItem>
|
|
||||||
<p style="display: flex">类型:创建预警</p>
|
|
||||||
<p>时间:2025-06-01 11:07:59</p>
|
|
||||||
<p>处理人:张三</p>
|
|
||||||
</TimelineItem>
|
|
||||||
</Timeline>
|
|
||||||
</BasicModal>
|
</BasicModal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.file-box {
|
||||||
|
.img-box {
|
||||||
|
float: left;
|
||||||
|
margin-left: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
@@ -1,22 +1,18 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
|
|
||||||
import { useVbenModal } from '@vben/common-ui';
|
import { useVbenModal } from '@vben/common-ui';
|
||||||
import { $t } from '@vben/locales';
|
|
||||||
import { cloneDeep } from '@vben/utils';
|
import { cloneDeep } from '@vben/utils';
|
||||||
|
|
||||||
import { useVbenForm } from '#/adapter/form';
|
import { useVbenForm } from '#/adapter/form';
|
||||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||||
|
|
||||||
import { modalSchema } from './data';
|
import { modalSchema } from './data';
|
||||||
|
import { alarmEventComplete } from '#/api/sis/alarmEvents';
|
||||||
|
|
||||||
const emit = defineEmits<{ reload: [] }>();
|
const emit = defineEmits<{ reload: [] }>();
|
||||||
|
|
||||||
const isUpdate = ref(false);
|
const isUpdate = ref(false);
|
||||||
const title = computed(() => {
|
|
||||||
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
|
|
||||||
});
|
|
||||||
|
|
||||||
const [BasicForm, formApi] = useVbenForm({
|
const [BasicForm, formApi] = useVbenForm({
|
||||||
commonConfig: {
|
commonConfig: {
|
||||||
formItemClass: 'col-span-1',
|
formItemClass: 'col-span-1',
|
||||||
@@ -36,7 +32,7 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
|||||||
currentGetter: defaultFormValueGetter(formApi),
|
currentGetter: defaultFormValueGetter(formApi),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
let currentSelectData: any = null;
|
||||||
const [BasicModal, modalApi] = useVbenModal({
|
const [BasicModal, modalApi] = useVbenModal({
|
||||||
class: 'w-[70%]',
|
class: 'w-[70%]',
|
||||||
fullscreenButton: false,
|
fullscreenButton: false,
|
||||||
@@ -55,15 +51,15 @@ const [BasicModal, modalApi] = useVbenModal({
|
|||||||
// 从传递的数据中查找对应的记录
|
// 从传递的数据中查找对应的记录
|
||||||
const { data } = modalApi.getData() as {
|
const { data } = modalApi.getData() as {
|
||||||
id: number | string;
|
id: number | string;
|
||||||
data: any[];
|
data: any;
|
||||||
};
|
};
|
||||||
const record = data.find((item: any) => item.id === id);
|
if (data) {
|
||||||
if (record) {
|
// 处理预警上报类型
|
||||||
await formApi.setValues(record);
|
data.alarmType = `${data.bigTypeName} - ${data.smallTypeName}`;
|
||||||
|
await formApi.setValues(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await markInitialized();
|
await markInitialized();
|
||||||
|
|
||||||
modalApi.modalLoading(false);
|
modalApi.modalLoading(false);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -75,16 +71,23 @@ async function handleConfirm() {
|
|||||||
if (!valid) {
|
if (!valid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// 表单数据
|
||||||
const formData = cloneDeep(await formApi.getValues());
|
const formData = cloneDeep(await formApi.getValues());
|
||||||
|
// 处理数据
|
||||||
|
console.log(formData);
|
||||||
|
const { files = [] } = formData;
|
||||||
|
const ossids: string[] = [];
|
||||||
|
files.forEach((file: any) => {
|
||||||
|
const ossId = file.response.ossId;
|
||||||
|
ossids.push(ossId);
|
||||||
|
});
|
||||||
|
|
||||||
// 更新表格数据
|
const params = {
|
||||||
const { data } = modalApi.getData() as { id: number | string; data: any[] };
|
alarmId: formData.id,
|
||||||
const index = data.findIndex((item: any) => item.id === formData.id);
|
remark: formData.remark,
|
||||||
if (index !== -1) {
|
attachments: ossids,
|
||||||
// 更新数据
|
};
|
||||||
Object.assign(data[index], formData);
|
await alarmEventComplete(params);
|
||||||
}
|
|
||||||
|
|
||||||
resetInitialized();
|
resetInitialized();
|
||||||
emit('reload');
|
emit('reload');
|
||||||
modalApi.close();
|
modalApi.close();
|
||||||
@@ -102,8 +105,8 @@ async function handleClosed() {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<BasicModal :title="title">
|
<BasicModal title="处理">
|
||||||
<BasicForm />
|
<BasicForm></BasicForm>
|
||||||
</BasicModal>
|
</BasicModal>
|
||||||
</template>
|
</template>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
@@ -27,8 +27,8 @@ export default defineConfig(async () => {
|
|||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
rewrite: (path) => path.replace(/^\/api/, ''),
|
rewrite: (path) => path.replace(/^\/api/, ''),
|
||||||
// mock代理目标地址
|
// mock代理目标地址
|
||||||
// target: 'http://127.0.0.1:8080',
|
target: 'http://127.0.0.1:8080',
|
||||||
target: 'http://183.230.235.66:11010/api',
|
// target: 'http://183.230.235.66:11010/api',
|
||||||
ws: true,
|
ws: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user