mirror of
http://git.xinwangdao.com/cnnc-embedded-parts-detect/detect-embeded.git
synced 2025-06-24 05:24:12 +08:00
init
This commit is contained in:
parent
0b1166c718
commit
323384575f
@ -1,82 +0,0 @@
|
||||
/**
|
||||
* 项目:视频监控平台
|
||||
* @Author: xiongwei
|
||||
* @Date: 2024-09-26 11:50:00
|
||||
*/
|
||||
|
||||
import { defHttp } from '@/utils/http/axios';
|
||||
import {
|
||||
DetectTask,
|
||||
DetectTaskParams,
|
||||
DetectTaskPageResult,
|
||||
} from '../model/detectTask';
|
||||
|
||||
const baseApi = '/v1/data/detect-task';
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
export const add = (entity: DetectTask) =>
|
||||
defHttp.post<DetectTask>({ url: `${baseApi}/`, data: entity });
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*/
|
||||
export const update = (entity: DetectTask, updateAllFields = false) =>
|
||||
defHttp.put<DetectTask>({ url: `${baseApi}/`, data: entity, params: { updateAllFields } });
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
export const remove = (id: any) =>
|
||||
defHttp.delete<number>({ url: `${baseApi}/${id}` });
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
export const search = (params?: DetectTaskParams) =>
|
||||
defHttp.get<DetectTaskPageResult>({ url: `${baseApi}/search`, params });
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*/
|
||||
export const all = (params?: DetectTaskParams) =>
|
||||
defHttp.get<DetectTask[]>({ url: `${baseApi}/all`, params });
|
||||
|
||||
/**
|
||||
* 通过主键查询
|
||||
*/
|
||||
export const getById = (id: any) =>
|
||||
defHttp.get<DetectTask>({ url: `${baseApi}/${id}` });
|
||||
|
||||
/**
|
||||
* 单个查询
|
||||
*/
|
||||
export const getOne = (params?: DetectTaskParams) =>
|
||||
defHttp.get<DetectTask>({ url: `${baseApi}/one`, params });
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
export const batchRemove = (idList: Array<any>) =>
|
||||
defHttp.post<boolean>({ url: `${baseApi}/batch-delete`, data: idList });
|
||||
|
||||
/**
|
||||
* 批量新增
|
||||
*/
|
||||
export const batchAdd = (entityList: Array<DetectTask>) =>
|
||||
defHttp.post<boolean>({ url: `${baseApi}/batch-save`, data: entityList });
|
||||
|
||||
/**
|
||||
* 批量更新
|
||||
*/
|
||||
export const batchUpdate = (entityList: Array<DetectTask>) =>
|
||||
defHttp.post<boolean>({ url: `${baseApi}/batch-update`, data: entityList });
|
||||
|
||||
/**
|
||||
* 查询数量
|
||||
*/
|
||||
export const count = (params?: DetectTaskParams) =>
|
||||
defHttp.get<number>({ url: `${baseApi}/count`, params });
|
||||
|
||||
|
@ -1,82 +0,0 @@
|
||||
/**
|
||||
* 项目:视频监控平台
|
||||
* @Author: xiongwei
|
||||
* @Date: 2024-09-26 11:50:00
|
||||
*/
|
||||
|
||||
import { defHttp } from '@/utils/http/axios';
|
||||
import {
|
||||
DetectTaskItem,
|
||||
DetectTaskItemParams,
|
||||
DetectTaskItemPageResult,
|
||||
} from '../model/detectTaskItem';
|
||||
|
||||
const baseApi = '/v1/data/detect-task-item';
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
export const add = (entity: DetectTaskItem) =>
|
||||
defHttp.post<DetectTaskItem>({ url: `${baseApi}/`, data: entity });
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*/
|
||||
export const update = (entity: DetectTaskItem, updateAllFields = false) =>
|
||||
defHttp.put<DetectTaskItem>({ url: `${baseApi}/`, data: entity, params: { updateAllFields } });
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
export const remove = (id: any) =>
|
||||
defHttp.delete<number>({ url: `${baseApi}/${id}` });
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
export const search = (params?: DetectTaskItemParams) =>
|
||||
defHttp.get<DetectTaskItemPageResult>({ url: `${baseApi}/search`, params });
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*/
|
||||
export const all = (params?: DetectTaskItemParams) =>
|
||||
defHttp.get<DetectTaskItem[]>({ url: `${baseApi}/all`, params });
|
||||
|
||||
/**
|
||||
* 通过主键查询
|
||||
*/
|
||||
export const getById = (id: any) =>
|
||||
defHttp.get<DetectTaskItem>({ url: `${baseApi}/${id}` });
|
||||
|
||||
/**
|
||||
* 单个查询
|
||||
*/
|
||||
export const getOne = (params?: DetectTaskItemParams) =>
|
||||
defHttp.get<DetectTaskItem>({ url: `${baseApi}/one`, params });
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
export const batchRemove = (idList: Array<any>) =>
|
||||
defHttp.post<boolean>({ url: `${baseApi}/batch-delete`, data: idList });
|
||||
|
||||
/**
|
||||
* 批量新增
|
||||
*/
|
||||
export const batchAdd = (entityList: Array<DetectTaskItem>) =>
|
||||
defHttp.post<boolean>({ url: `${baseApi}/batch-save`, data: entityList });
|
||||
|
||||
/**
|
||||
* 批量更新
|
||||
*/
|
||||
export const batchUpdate = (entityList: Array<DetectTaskItem>) =>
|
||||
defHttp.post<boolean>({ url: `${baseApi}/batch-update`, data: entityList });
|
||||
|
||||
/**
|
||||
* 查询数量
|
||||
*/
|
||||
export const count = (params?: DetectTaskItemParams) =>
|
||||
defHttp.get<number>({ url: `${baseApi}/count`, params });
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* 项目:视频监控平台
|
||||
* 项目:中核预埋件检测
|
||||
* @Author: xiongwei
|
||||
* @Date: 2024-09-26 11:50:00
|
||||
* @Date: 2024-11-15 11:50:00
|
||||
*/
|
||||
|
||||
import { defHttp } from '@/utils/http/axios';
|
||||
@ -11,7 +11,7 @@ import {
|
||||
DevicePageResult,
|
||||
} from '../model/device';
|
||||
|
||||
const baseApi = '/v1/system/device';
|
||||
const baseApi = '/v1/data/device';
|
||||
|
||||
/**
|
||||
* 新增
|
@ -1,82 +0,0 @@
|
||||
/**
|
||||
* 项目:视频监控平台
|
||||
* @Author: xiongwei
|
||||
* @Date: 2024-09-26 11:50:00
|
||||
*/
|
||||
|
||||
import { defHttp } from '@/utils/http/axios';
|
||||
import {
|
||||
Event,
|
||||
EventParams,
|
||||
EventPageResult,
|
||||
} from '../model/event';
|
||||
|
||||
const baseApi = '/v1/data/event';
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
export const add = (entity: Event) =>
|
||||
defHttp.post<Event>({ url: `${baseApi}/`, data: entity });
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*/
|
||||
export const update = (entity: Event, updateAllFields = false) =>
|
||||
defHttp.put<Event>({ url: `${baseApi}/`, data: entity, params: { updateAllFields } });
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
export const remove = (id: any) =>
|
||||
defHttp.delete<number>({ url: `${baseApi}/${id}` });
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
export const search = (params?: EventParams) =>
|
||||
defHttp.get<EventPageResult>({ url: `${baseApi}/search`, params });
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*/
|
||||
export const all = (params?: EventParams) =>
|
||||
defHttp.get<Event[]>({ url: `${baseApi}/all`, params });
|
||||
|
||||
/**
|
||||
* 通过主键查询
|
||||
*/
|
||||
export const getById = (id: any) =>
|
||||
defHttp.get<Event>({ url: `${baseApi}/${id}` });
|
||||
|
||||
/**
|
||||
* 单个查询
|
||||
*/
|
||||
export const getOne = (params?: EventParams) =>
|
||||
defHttp.get<Event>({ url: `${baseApi}/one`, params });
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
export const batchRemove = (idList: Array<any>) =>
|
||||
defHttp.post<boolean>({ url: `${baseApi}/batch-delete`, data: idList });
|
||||
|
||||
/**
|
||||
* 批量新增
|
||||
*/
|
||||
export const batchAdd = (entityList: Array<Event>) =>
|
||||
defHttp.post<boolean>({ url: `${baseApi}/batch-save`, data: entityList });
|
||||
|
||||
/**
|
||||
* 批量更新
|
||||
*/
|
||||
export const batchUpdate = (entityList: Array<Event>) =>
|
||||
defHttp.post<boolean>({ url: `${baseApi}/batch-update`, data: entityList });
|
||||
|
||||
/**
|
||||
* 查询数量
|
||||
*/
|
||||
export const count = (params?: EventParams) =>
|
||||
defHttp.get<number>({ url: `${baseApi}/count`, params });
|
||||
|
||||
|
82
src/api/data/taskApi.ts
Normal file
82
src/api/data/taskApi.ts
Normal file
@ -0,0 +1,82 @@
|
||||
/**
|
||||
* 项目:中核预埋件检测
|
||||
* @Author: xiongwei
|
||||
* @Date: 2024-11-15 11:50:00
|
||||
*/
|
||||
|
||||
import { defHttp } from '@/utils/http/axios';
|
||||
import {
|
||||
Task,
|
||||
TaskParams,
|
||||
TaskPageResult,
|
||||
} from '../model/task';
|
||||
|
||||
const baseApi = '/v1/data/task';
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
export const add = (entity: Task) =>
|
||||
defHttp.post<Task>({ url: `${baseApi}/`, data: entity });
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*/
|
||||
export const update = (entity: Task, updateAllFields = false) =>
|
||||
defHttp.put<Task>({ url: `${baseApi}/`, data: entity, params: { updateAllFields } });
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
export const remove = (id: any) =>
|
||||
defHttp.delete<number>({ url: `${baseApi}/${id}` });
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
export const search = (params?: TaskParams) =>
|
||||
defHttp.get<TaskPageResult>({ url: `${baseApi}/search`, params });
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*/
|
||||
export const all = (params?: TaskParams) =>
|
||||
defHttp.get<Task[]>({ url: `${baseApi}/all`, params });
|
||||
|
||||
/**
|
||||
* 通过主键查询
|
||||
*/
|
||||
export const getById = (id: any) =>
|
||||
defHttp.get<Task>({ url: `${baseApi}/${id}` });
|
||||
|
||||
/**
|
||||
* 单个查询
|
||||
*/
|
||||
export const getOne = (params?: TaskParams) =>
|
||||
defHttp.get<Task>({ url: `${baseApi}/one`, params });
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
export const batchRemove = (idList: Array<any>) =>
|
||||
defHttp.post<boolean>({ url: `${baseApi}/batch-delete`, data: idList });
|
||||
|
||||
/**
|
||||
* 批量新增
|
||||
*/
|
||||
export const batchAdd = (entityList: Array<Task>) =>
|
||||
defHttp.post<boolean>({ url: `${baseApi}/batch-save`, data: entityList });
|
||||
|
||||
/**
|
||||
* 批量更新
|
||||
*/
|
||||
export const batchUpdate = (entityList: Array<Task>) =>
|
||||
defHttp.post<boolean>({ url: `${baseApi}/batch-update`, data: entityList });
|
||||
|
||||
/**
|
||||
* 查询数量
|
||||
*/
|
||||
export const count = (params?: TaskParams) =>
|
||||
defHttp.get<number>({ url: `${baseApi}/count`, params });
|
||||
|
||||
|
82
src/api/data/taskLogApi.ts
Normal file
82
src/api/data/taskLogApi.ts
Normal file
@ -0,0 +1,82 @@
|
||||
/**
|
||||
* 项目:中核预埋件检测
|
||||
* @Author: xiongwei
|
||||
* @Date: 2024-11-15 11:50:00
|
||||
*/
|
||||
|
||||
import { defHttp } from '@/utils/http/axios';
|
||||
import {
|
||||
TaskLog,
|
||||
TaskLogParams,
|
||||
TaskLogPageResult,
|
||||
} from '../model/taskLog';
|
||||
|
||||
const baseApi = '/v1/data/task-log';
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
export const add = (entity: TaskLog) =>
|
||||
defHttp.post<TaskLog>({ url: `${baseApi}/`, data: entity });
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*/
|
||||
export const update = (entity: TaskLog, updateAllFields = false) =>
|
||||
defHttp.put<TaskLog>({ url: `${baseApi}/`, data: entity, params: { updateAllFields } });
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
export const remove = (id: any) =>
|
||||
defHttp.delete<number>({ url: `${baseApi}/${id}` });
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
export const search = (params?: TaskLogParams) =>
|
||||
defHttp.get<TaskLogPageResult>({ url: `${baseApi}/search`, params });
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*/
|
||||
export const all = (params?: TaskLogParams) =>
|
||||
defHttp.get<TaskLog[]>({ url: `${baseApi}/all`, params });
|
||||
|
||||
/**
|
||||
* 通过主键查询
|
||||
*/
|
||||
export const getById = (id: any) =>
|
||||
defHttp.get<TaskLog>({ url: `${baseApi}/${id}` });
|
||||
|
||||
/**
|
||||
* 单个查询
|
||||
*/
|
||||
export const getOne = (params?: TaskLogParams) =>
|
||||
defHttp.get<TaskLog>({ url: `${baseApi}/one`, params });
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
export const batchRemove = (idList: Array<any>) =>
|
||||
defHttp.post<boolean>({ url: `${baseApi}/batch-delete`, data: idList });
|
||||
|
||||
/**
|
||||
* 批量新增
|
||||
*/
|
||||
export const batchAdd = (entityList: Array<TaskLog>) =>
|
||||
defHttp.post<boolean>({ url: `${baseApi}/batch-save`, data: entityList });
|
||||
|
||||
/**
|
||||
* 批量更新
|
||||
*/
|
||||
export const batchUpdate = (entityList: Array<TaskLog>) =>
|
||||
defHttp.post<boolean>({ url: `${baseApi}/batch-update`, data: entityList });
|
||||
|
||||
/**
|
||||
* 查询数量
|
||||
*/
|
||||
export const count = (params?: TaskLogParams) =>
|
||||
defHttp.get<number>({ url: `${baseApi}/count`, params });
|
||||
|
||||
|
82
src/api/data/taskProgressApi.ts
Normal file
82
src/api/data/taskProgressApi.ts
Normal file
@ -0,0 +1,82 @@
|
||||
/**
|
||||
* 项目:中核预埋件检测
|
||||
* @Author: xiongwei
|
||||
* @Date: 2024-11-15 11:50:00
|
||||
*/
|
||||
|
||||
import { defHttp } from '@/utils/http/axios';
|
||||
import {
|
||||
TaskProgress,
|
||||
TaskProgressParams,
|
||||
TaskProgressPageResult,
|
||||
} from '../model/taskProgress';
|
||||
|
||||
const baseApi = '/v1/data/task-progress';
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
export const add = (entity: TaskProgress) =>
|
||||
defHttp.post<TaskProgress>({ url: `${baseApi}/`, data: entity });
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*/
|
||||
export const update = (entity: TaskProgress, updateAllFields = false) =>
|
||||
defHttp.put<TaskProgress>({ url: `${baseApi}/`, data: entity, params: { updateAllFields } });
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
export const remove = (id: any) =>
|
||||
defHttp.delete<number>({ url: `${baseApi}/${id}` });
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
export const search = (params?: TaskProgressParams) =>
|
||||
defHttp.get<TaskProgressPageResult>({ url: `${baseApi}/search`, params });
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*/
|
||||
export const all = (params?: TaskProgressParams) =>
|
||||
defHttp.get<TaskProgress[]>({ url: `${baseApi}/all`, params });
|
||||
|
||||
/**
|
||||
* 通过主键查询
|
||||
*/
|
||||
export const getById = (id: any) =>
|
||||
defHttp.get<TaskProgress>({ url: `${baseApi}/${id}` });
|
||||
|
||||
/**
|
||||
* 单个查询
|
||||
*/
|
||||
export const getOne = (params?: TaskProgressParams) =>
|
||||
defHttp.get<TaskProgress>({ url: `${baseApi}/one`, params });
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
export const batchRemove = (idList: Array<any>) =>
|
||||
defHttp.post<boolean>({ url: `${baseApi}/batch-delete`, data: idList });
|
||||
|
||||
/**
|
||||
* 批量新增
|
||||
*/
|
||||
export const batchAdd = (entityList: Array<TaskProgress>) =>
|
||||
defHttp.post<boolean>({ url: `${baseApi}/batch-save`, data: entityList });
|
||||
|
||||
/**
|
||||
* 批量更新
|
||||
*/
|
||||
export const batchUpdate = (entityList: Array<TaskProgress>) =>
|
||||
defHttp.post<boolean>({ url: `${baseApi}/batch-update`, data: entityList });
|
||||
|
||||
/**
|
||||
* 查询数量
|
||||
*/
|
||||
export const count = (params?: TaskProgressParams) =>
|
||||
defHttp.get<number>({ url: `${baseApi}/count`, params });
|
||||
|
||||
|
@ -1,151 +0,0 @@
|
||||
/**
|
||||
* 项目:视频监控平台
|
||||
* @Author: xiongwei
|
||||
* @Date: 2024-09-26 11:50:00
|
||||
*/
|
||||
|
||||
import { BasePageParams, PageResult, ApiResponse } from './baseModel';
|
||||
|
||||
export interface AlgoParams extends BasePageParams {
|
||||
/**
|
||||
* ID系统自动生成
|
||||
*/
|
||||
id?: number;
|
||||
/**
|
||||
* ID系统自动生成 IN值List
|
||||
*/
|
||||
idList?: Array<number>;
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
code?: string;
|
||||
/**
|
||||
* 算法名称
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* 告警等级
|
||||
*/
|
||||
alarmLevel?: string;
|
||||
/**
|
||||
* 参数配置
|
||||
*/
|
||||
paramJson?: string;
|
||||
/**
|
||||
* 边缘灯光
|
||||
*/
|
||||
edgeFlashing?: number;
|
||||
/**
|
||||
* 边缘蜂鸣
|
||||
*/
|
||||
edgeBuzzing?: number;
|
||||
/**
|
||||
* 边缘语音
|
||||
*/
|
||||
edgeVoice?: number;
|
||||
/**
|
||||
* 边缘语音内容
|
||||
*/
|
||||
edgeVoiceContent?: string;
|
||||
/**
|
||||
* PC推送
|
||||
*/
|
||||
pcPush?: number;
|
||||
/**
|
||||
* PC推送内容
|
||||
*/
|
||||
pcPushContent?: string;
|
||||
/**
|
||||
* create_time
|
||||
*/
|
||||
createTime?: Date;
|
||||
/**
|
||||
* 下限值(大于等于)
|
||||
*/
|
||||
createTimeFrom?: Date;
|
||||
/**
|
||||
* 上限值(小于)
|
||||
*/
|
||||
createTimeTo?: Date;
|
||||
/**
|
||||
* update_time
|
||||
*/
|
||||
updateTime?: Date;
|
||||
/**
|
||||
* 下限值(大于等于)
|
||||
*/
|
||||
updateTimeFrom?: Date;
|
||||
/**
|
||||
* 上限值(小于)
|
||||
*/
|
||||
updateTimeTo?: Date;
|
||||
/**
|
||||
* 其他参数
|
||||
*/
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export interface Algo {
|
||||
/**
|
||||
* ID系统自动生成
|
||||
*/
|
||||
id?: number;
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
code?: string;
|
||||
/**
|
||||
* 算法名称
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* 告警等级
|
||||
*/
|
||||
alarmLevel?: string;
|
||||
/**
|
||||
* 参数配置
|
||||
*/
|
||||
paramJson?: string;
|
||||
/**
|
||||
* 边缘灯光
|
||||
*/
|
||||
edgeFlashing?: number;
|
||||
/**
|
||||
* 边缘蜂鸣
|
||||
*/
|
||||
edgeBuzzing?: number;
|
||||
/**
|
||||
* 边缘语音
|
||||
*/
|
||||
edgeVoice?: number;
|
||||
/**
|
||||
* 边缘语音内容
|
||||
*/
|
||||
edgeVoiceContent?: string;
|
||||
/**
|
||||
* PC推送
|
||||
*/
|
||||
pcPush?: number;
|
||||
/**
|
||||
* PC推送内容
|
||||
*/
|
||||
pcPushContent?: string;
|
||||
/**
|
||||
* create_time
|
||||
*/
|
||||
createTime?: Date;
|
||||
/**
|
||||
* update_time
|
||||
*/
|
||||
updateTime?: Date;
|
||||
/**
|
||||
* 其他参数
|
||||
*/
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export type AlgoPageResult = PageResult<Algo>;
|
||||
|
||||
export type AlgoPageResponse = ApiResponse<AlgoPageResult>;
|
||||
|
||||
export type AlgoResponse = ApiResponse<Algo>;
|
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* 项目:视频监控平台
|
||||
* 项目:中核预埋件检测
|
||||
* @Author: xiongwei
|
||||
* @Date: 2024-09-26 11:50:00
|
||||
* @Date: 2024-11-15 11:50:00
|
||||
*/
|
||||
|
||||
import { BasePageParams, PageResult, ApiResponse } from './baseModel';
|
||||
|
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* 项目:视频监控平台
|
||||
* 项目:中核预埋件检测
|
||||
* @Author: xiongwei
|
||||
* @Date: 2024-09-26 11:50:00
|
||||
* @Date: 2024-11-15 11:50:00
|
||||
*/
|
||||
|
||||
export interface BasePageParams {
|
||||
|
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* 项目:视频监控平台
|
||||
* 项目:中核预埋件检测
|
||||
* @Author: xiongwei
|
||||
* @Date: 2024-09-26 11:50:00
|
||||
* @Date: 2024-11-15 11:50:00
|
||||
*/
|
||||
|
||||
import { BasePageParams, PageResult, ApiResponse } from './baseModel';
|
||||
|
@ -1,71 +0,0 @@
|
||||
/**
|
||||
* 项目:视频监控平台
|
||||
* @Author: xiongwei
|
||||
* @Date: 2024-09-26 11:50:00
|
||||
*/
|
||||
|
||||
import { BasePageParams, PageResult, ApiResponse } from './baseModel';
|
||||
|
||||
export interface DetectTaskItemParams extends BasePageParams {
|
||||
/**
|
||||
* ID系统自动生成
|
||||
*/
|
||||
id?: number;
|
||||
/**
|
||||
* ID系统自动生成 IN值List
|
||||
*/
|
||||
idList?: Array<number>;
|
||||
/**
|
||||
* dat_detect_task.id
|
||||
*/
|
||||
detectTaskId?: number;
|
||||
/**
|
||||
* sys_algo.id
|
||||
*/
|
||||
algoId?: number;
|
||||
/**
|
||||
* 参数配置
|
||||
*/
|
||||
paramJson?: string;
|
||||
/**
|
||||
* ROI区域设置
|
||||
*/
|
||||
roiJson?: string;
|
||||
/**
|
||||
* 其他参数
|
||||
*/
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export interface DetectTaskItem {
|
||||
/**
|
||||
* ID系统自动生成
|
||||
*/
|
||||
id?: number;
|
||||
/**
|
||||
* dat_detect_task.id
|
||||
*/
|
||||
detectTaskId?: number;
|
||||
/**
|
||||
* sys_algo.id
|
||||
*/
|
||||
algoId?: number;
|
||||
/**
|
||||
* 参数配置
|
||||
*/
|
||||
paramJson?: string;
|
||||
/**
|
||||
* ROI区域设置
|
||||
*/
|
||||
roiJson?: string;
|
||||
/**
|
||||
* 其他参数
|
||||
*/
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export type DetectTaskItemPageResult = PageResult<DetectTaskItem>;
|
||||
|
||||
export type DetectTaskItemPageResponse = ApiResponse<DetectTaskItemPageResult>;
|
||||
|
||||
export type DetectTaskItemResponse = ApiResponse<DetectTaskItem>;
|
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* 项目:视频监控平台
|
||||
* 项目:中核预埋件检测
|
||||
* @Author: xiongwei
|
||||
* @Date: 2024-09-26 11:50:00
|
||||
* @Date: 2024-11-15 11:50:00
|
||||
*/
|
||||
|
||||
import { BasePageParams, PageResult, ApiResponse } from './baseModel';
|
||||
@ -15,10 +15,6 @@ export interface DeviceParams extends BasePageParams {
|
||||
* ID系统自动生成 IN值List
|
||||
*/
|
||||
idList?: Array<number>;
|
||||
/**
|
||||
* sys_region.id
|
||||
*/
|
||||
regionId?: number;
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
@ -27,22 +23,6 @@ export interface DeviceParams extends BasePageParams {
|
||||
* 设备IP地址
|
||||
*/
|
||||
deviceIp?: string;
|
||||
/**
|
||||
* 设备端口
|
||||
*/
|
||||
devicePort?: String;
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
deviceUsername?: String;
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
devicePassword?: String;
|
||||
/**
|
||||
* 设备类型
|
||||
*/
|
||||
deviceType?: String;
|
||||
/**
|
||||
* 软件版本
|
||||
*/
|
||||
@ -59,22 +39,6 @@ export interface DeviceParams extends BasePageParams {
|
||||
* 模型版本
|
||||
*/
|
||||
modelVersion?: String;
|
||||
/**
|
||||
* 相机IP地址
|
||||
*/
|
||||
cameraIp?: string;
|
||||
/**
|
||||
* 相机用户名
|
||||
*/
|
||||
cameraUsername?: String;
|
||||
/**
|
||||
* 相机密码
|
||||
*/
|
||||
cameraPassword?: String;
|
||||
/**
|
||||
* 相机rtsp完整地址
|
||||
*/
|
||||
cameraRtsp?: String;
|
||||
/**
|
||||
* create_time
|
||||
*/
|
||||
@ -110,10 +74,6 @@ export interface Device {
|
||||
* ID系统自动生成
|
||||
*/
|
||||
id?: number;
|
||||
/**
|
||||
* sys_region.id
|
||||
*/
|
||||
regionId?: number;
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
@ -122,22 +82,6 @@ export interface Device {
|
||||
* 设备IP地址
|
||||
*/
|
||||
deviceIp?: string;
|
||||
/**
|
||||
* 设备端口
|
||||
*/
|
||||
devicePort?: String;
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
deviceUsername?: String;
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
devicePassword?: String;
|
||||
/**
|
||||
* 设备类型
|
||||
*/
|
||||
deviceType?: String;
|
||||
/**
|
||||
* 软件版本
|
||||
*/
|
||||
@ -154,22 +98,6 @@ export interface Device {
|
||||
* 模型版本
|
||||
*/
|
||||
modelVersion?: String;
|
||||
/**
|
||||
* 相机IP地址
|
||||
*/
|
||||
cameraIp?: string;
|
||||
/**
|
||||
* 相机用户名
|
||||
*/
|
||||
cameraUsername?: String;
|
||||
/**
|
||||
* 相机密码
|
||||
*/
|
||||
cameraPassword?: String;
|
||||
/**
|
||||
* 相机rtsp完整地址
|
||||
*/
|
||||
cameraRtsp?: String;
|
||||
/**
|
||||
* create_time
|
||||
*/
|
||||
|
@ -1,111 +0,0 @@
|
||||
/**
|
||||
* 项目:视频监控平台
|
||||
* @Author: xiongwei
|
||||
* @Date: 2024-09-26 11:50:00
|
||||
*/
|
||||
|
||||
import { BasePageParams, PageResult, ApiResponse } from './baseModel';
|
||||
|
||||
export interface EventParams extends BasePageParams {
|
||||
/**
|
||||
* ID系统自动生成
|
||||
*/
|
||||
id?: number;
|
||||
/**
|
||||
* ID系统自动生成 IN值List
|
||||
*/
|
||||
idList?: Array<number>;
|
||||
/**
|
||||
* sys_region.id
|
||||
*/
|
||||
regionId?: number;
|
||||
/**
|
||||
* sys_device.id
|
||||
*/
|
||||
deviceId?: number;
|
||||
/**
|
||||
* 算法code sys_algo.code
|
||||
*/
|
||||
algoCode?: string;
|
||||
/**
|
||||
* 告警等级
|
||||
*/
|
||||
alarmLevel?: string;
|
||||
/**
|
||||
* 图片
|
||||
*/
|
||||
imageUrl?: string;
|
||||
/**
|
||||
* 视频
|
||||
*/
|
||||
videoUrl?: string;
|
||||
/**
|
||||
* 处理信息
|
||||
*/
|
||||
content?: string;
|
||||
/**
|
||||
* 发生时间
|
||||
*/
|
||||
eventTime?: Date;
|
||||
/**
|
||||
* 发生时间 下限值(大于等于)
|
||||
*/
|
||||
eventTimeFrom?: Date;
|
||||
/**
|
||||
* 发生时间 上限值(小于)
|
||||
*/
|
||||
eventTimeTo?: Date;
|
||||
/**
|
||||
* 其他参数
|
||||
*/
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export interface Event {
|
||||
/**
|
||||
* ID系统自动生成
|
||||
*/
|
||||
id?: number;
|
||||
/**
|
||||
* sys_region.id
|
||||
*/
|
||||
regionId?: number;
|
||||
/**
|
||||
* sys_device.id
|
||||
*/
|
||||
deviceId?: number;
|
||||
/**
|
||||
* 算法code sys_algo.code
|
||||
*/
|
||||
algoCode?: string;
|
||||
/**
|
||||
* 告警等级
|
||||
*/
|
||||
alarmLevel?: string;
|
||||
/**
|
||||
* 图片
|
||||
*/
|
||||
imageUrl?: string;
|
||||
/**
|
||||
* 视频
|
||||
*/
|
||||
videoUrl?: string;
|
||||
/**
|
||||
* 处理信息
|
||||
*/
|
||||
content?: string;
|
||||
/**
|
||||
* 发生时间
|
||||
*/
|
||||
eventTime?: Date;
|
||||
/**
|
||||
* 其他参数
|
||||
*/
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export type EventPageResult = PageResult<Event>;
|
||||
|
||||
export type EventPageResponse = ApiResponse<EventPageResult>;
|
||||
|
||||
export type EventResponse = ApiResponse<Event>;
|
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* 项目:视频监控平台
|
||||
* 项目:中核预埋件检测
|
||||
* @Author: xiongwei
|
||||
* @Date: 2024-09-26 11:50:00
|
||||
* @Date: 2024-11-15 11:50:00
|
||||
*/
|
||||
|
||||
import { BasePageParams, PageResult, ApiResponse } from './baseModel';
|
||||
|
@ -1,151 +0,0 @@
|
||||
/**
|
||||
* 项目:视频监控平台
|
||||
* @Author: xiongwei
|
||||
* @Date: 2024-09-26 11:50:00
|
||||
*/
|
||||
|
||||
import { BasePageParams, PageResult, ApiResponse } from './baseModel';
|
||||
|
||||
export interface StoragePlanParams extends BasePageParams {
|
||||
/**
|
||||
* ID系统自动生成
|
||||
*/
|
||||
id?: number;
|
||||
/**
|
||||
* ID系统自动生成 IN值List
|
||||
*/
|
||||
idList?: Array<number>;
|
||||
/**
|
||||
* sys_region.id
|
||||
*/
|
||||
regionId?: number;
|
||||
/**
|
||||
* sys_device.id
|
||||
*/
|
||||
deviceId?: number;
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
startTime?: Date;
|
||||
/**
|
||||
* 开始时间 下限值(大于等于)
|
||||
*/
|
||||
startTimeFrom?: Date;
|
||||
/**
|
||||
* 开始时间 上限值(小于)
|
||||
*/
|
||||
startTimeTo?: Date;
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
endTime?: Date;
|
||||
/**
|
||||
* 结束时间 下限值(大于等于)
|
||||
*/
|
||||
endTimeFrom?: Date;
|
||||
/**
|
||||
* 结束时间 上限值(小于)
|
||||
*/
|
||||
endTimeTo?: Date;
|
||||
/**
|
||||
* 是否录像
|
||||
*/
|
||||
isVideo?: number;
|
||||
/**
|
||||
* 是否抓图
|
||||
*/
|
||||
isCapture?: number;
|
||||
/**
|
||||
* 录像时长
|
||||
*/
|
||||
videoDuration?: number;
|
||||
/**
|
||||
* 抓图间隔
|
||||
*/
|
||||
captureInterval?: number;
|
||||
/**
|
||||
* create_time
|
||||
*/
|
||||
createTime?: Date;
|
||||
/**
|
||||
* 下限值(大于等于)
|
||||
*/
|
||||
createTimeFrom?: Date;
|
||||
/**
|
||||
* 上限值(小于)
|
||||
*/
|
||||
createTimeTo?: Date;
|
||||
/**
|
||||
* update_time
|
||||
*/
|
||||
updateTime?: Date;
|
||||
/**
|
||||
* 下限值(大于等于)
|
||||
*/
|
||||
updateTimeFrom?: Date;
|
||||
/**
|
||||
* 上限值(小于)
|
||||
*/
|
||||
updateTimeTo?: Date;
|
||||
/**
|
||||
* 其他参数
|
||||
*/
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export interface StoragePlan {
|
||||
/**
|
||||
* ID系统自动生成
|
||||
*/
|
||||
id?: number;
|
||||
/**
|
||||
* sys_region.id
|
||||
*/
|
||||
regionId?: number;
|
||||
/**
|
||||
* sys_device.id
|
||||
*/
|
||||
deviceId?: number;
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
startTime?: Date;
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
endTime?: Date;
|
||||
/**
|
||||
* 是否录像
|
||||
*/
|
||||
isVideo?: number;
|
||||
/**
|
||||
* 是否抓图
|
||||
*/
|
||||
isCapture?: number;
|
||||
/**
|
||||
* 录像时长
|
||||
*/
|
||||
videoDuration?: number;
|
||||
/**
|
||||
* 抓图间隔
|
||||
*/
|
||||
captureInterval?: number;
|
||||
/**
|
||||
* create_time
|
||||
*/
|
||||
createTime?: Date;
|
||||
/**
|
||||
* update_time
|
||||
*/
|
||||
updateTime?: Date;
|
||||
/**
|
||||
* 其他参数
|
||||
*/
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export type StoragePlanPageResult = PageResult<StoragePlan>;
|
||||
|
||||
export type StoragePlanPageResponse = ApiResponse<StoragePlanPageResult>;
|
||||
|
||||
export type StoragePlanResponse = ApiResponse<StoragePlan>;
|
@ -1,12 +1,12 @@
|
||||
/**
|
||||
* 项目:视频监控平台
|
||||
* 项目:中核预埋件检测
|
||||
* @Author: xiongwei
|
||||
* @Date: 2024-09-26 11:50:00
|
||||
* @Date: 2024-11-15 11:50:00
|
||||
*/
|
||||
|
||||
import { BasePageParams, PageResult, ApiResponse } from './baseModel';
|
||||
|
||||
export interface DetectTaskParams extends BasePageParams {
|
||||
export interface TaskParams extends BasePageParams {
|
||||
/**
|
||||
* ID系统自动生成
|
||||
*/
|
||||
@ -19,6 +19,18 @@ export interface DetectTaskParams extends BasePageParams {
|
||||
* 名称
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* 设备序列号
|
||||
*/
|
||||
deviceSn?: string;
|
||||
/**
|
||||
* 任务参数
|
||||
*/
|
||||
paramJson?: string;
|
||||
/**
|
||||
* 任务结果
|
||||
*/
|
||||
resultJson?: string;
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@ -77,7 +89,7 @@ export interface DetectTaskParams extends BasePageParams {
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export interface DetectTask {
|
||||
export interface Task {
|
||||
/**
|
||||
* ID系统自动生成
|
||||
*/
|
||||
@ -86,6 +98,18 @@ export interface DetectTask {
|
||||
* 名称
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* 设备序列号
|
||||
*/
|
||||
deviceSn?: string;
|
||||
/**
|
||||
* 任务参数
|
||||
*/
|
||||
paramJson?: string;
|
||||
/**
|
||||
* 任务结果
|
||||
*/
|
||||
resultJson?: string;
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@ -112,8 +136,8 @@ export interface DetectTask {
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export type DetectTaskPageResult = PageResult<DetectTask>;
|
||||
export type TaskPageResult = PageResult<Task>;
|
||||
|
||||
export type DetectTaskPageResponse = ApiResponse<DetectTaskPageResult>;
|
||||
export type TaskPageResponse = ApiResponse<TaskPageResult>;
|
||||
|
||||
export type DetectTaskResponse = ApiResponse<DetectTask>;
|
||||
export type TaskResponse = ApiResponse<Task>;
|
@ -1,12 +1,12 @@
|
||||
/**
|
||||
* 项目:视频监控平台
|
||||
* 项目:中核预埋件检测
|
||||
* @Author: xiongwei
|
||||
* @Date: 2024-09-26 11:50:00
|
||||
* @Date: 2024-11-15 11:50:00
|
||||
*/
|
||||
|
||||
import { BasePageParams, PageResult, ApiResponse } from './baseModel';
|
||||
|
||||
export interface RegionParams extends BasePageParams {
|
||||
export interface TaskLogParams extends BasePageParams {
|
||||
/**
|
||||
* ID系统自动生成
|
||||
*/
|
||||
@ -16,13 +16,17 @@ export interface RegionParams extends BasePageParams {
|
||||
*/
|
||||
idList?: Array<number>;
|
||||
/**
|
||||
* 名称
|
||||
* dat_detect_task.id
|
||||
*/
|
||||
name?: string;
|
||||
taskId?: number;
|
||||
/**
|
||||
* 编号
|
||||
* 设备序列号
|
||||
*/
|
||||
code?: string;
|
||||
deviceSn?: string;
|
||||
/**
|
||||
* 处理信息
|
||||
*/
|
||||
content?: string;
|
||||
/**
|
||||
* create_time
|
||||
*/
|
||||
@ -53,19 +57,23 @@ export interface RegionParams extends BasePageParams {
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export interface Region {
|
||||
export interface TaskLog {
|
||||
/**
|
||||
* ID系统自动生成
|
||||
*/
|
||||
id?: number;
|
||||
/**
|
||||
* 名称
|
||||
* dat_detect_task.id
|
||||
*/
|
||||
name?: string;
|
||||
taskId?: number;
|
||||
/**
|
||||
* 编号
|
||||
* 设备序列号
|
||||
*/
|
||||
code?: string;
|
||||
deviceSn?: string;
|
||||
/**
|
||||
* 处理信息
|
||||
*/
|
||||
content?: string;
|
||||
/**
|
||||
* create_time
|
||||
*/
|
||||
@ -80,8 +88,8 @@ export interface Region {
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export type RegionPageResult = PageResult<Region>;
|
||||
export type TaskLogPageResult = PageResult<TaskLog>;
|
||||
|
||||
export type RegionPageResponse = ApiResponse<RegionPageResult>;
|
||||
export type TaskLogPageResponse = ApiResponse<TaskLogPageResult>;
|
||||
|
||||
export type RegionResponse = ApiResponse<Region>;
|
||||
export type TaskLogResponse = ApiResponse<TaskLog>;
|
95
src/api/model/taskProgress.ts
Normal file
95
src/api/model/taskProgress.ts
Normal file
@ -0,0 +1,95 @@
|
||||
/**
|
||||
* 项目:中核预埋件检测
|
||||
* @Author: xiongwei
|
||||
* @Date: 2024-11-15 11:50:00
|
||||
*/
|
||||
|
||||
import { BasePageParams, PageResult, ApiResponse } from './baseModel';
|
||||
|
||||
export interface TaskProgressParams extends BasePageParams {
|
||||
/**
|
||||
* ID系统自动生成
|
||||
*/
|
||||
id?: number;
|
||||
/**
|
||||
* ID系统自动生成 IN值List
|
||||
*/
|
||||
idList?: Array<number>;
|
||||
/**
|
||||
* dat_detect_task.id
|
||||
*/
|
||||
taskId?: number;
|
||||
/**
|
||||
* 设备序列号
|
||||
*/
|
||||
deviceSn?: string;
|
||||
/**
|
||||
* 参数配置
|
||||
*/
|
||||
taskDataJson?: string;
|
||||
/**
|
||||
* create_time
|
||||
*/
|
||||
createTime?: Date;
|
||||
/**
|
||||
* 下限值(大于等于)
|
||||
*/
|
||||
createTimeFrom?: Date;
|
||||
/**
|
||||
* 上限值(小于)
|
||||
*/
|
||||
createTimeTo?: Date;
|
||||
/**
|
||||
* update_time
|
||||
*/
|
||||
updateTime?: Date;
|
||||
/**
|
||||
* 下限值(大于等于)
|
||||
*/
|
||||
updateTimeFrom?: Date;
|
||||
/**
|
||||
* 上限值(小于)
|
||||
*/
|
||||
updateTimeTo?: Date;
|
||||
/**
|
||||
* 其他参数
|
||||
*/
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export interface TaskProgress {
|
||||
/**
|
||||
* ID系统自动生成
|
||||
*/
|
||||
id?: number;
|
||||
/**
|
||||
* dat_detect_task.id
|
||||
*/
|
||||
taskId?: number;
|
||||
/**
|
||||
* 设备序列号
|
||||
*/
|
||||
deviceSn?: string;
|
||||
/**
|
||||
* 参数配置
|
||||
*/
|
||||
taskDataJson?: string;
|
||||
/**
|
||||
* create_time
|
||||
*/
|
||||
createTime?: Date;
|
||||
/**
|
||||
* update_time
|
||||
*/
|
||||
updateTime?: Date;
|
||||
/**
|
||||
* 其他参数
|
||||
*/
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export type TaskProgressPageResult = PageResult<TaskProgress>;
|
||||
|
||||
export type TaskProgressPageResponse = ApiResponse<TaskProgressPageResult>;
|
||||
|
||||
export type TaskProgressResponse = ApiResponse<TaskProgress>;
|
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* 项目:视频监控平台
|
||||
* 项目:中核预埋件检测
|
||||
* @Author: xiongwei
|
||||
* @Date: 2024-09-26 11:50:00
|
||||
* @Date: 2024-11-15 11:50:00
|
||||
*/
|
||||
|
||||
import { BasePageParams, PageResult, ApiResponse } from './baseModel';
|
||||
|
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* 项目:视频监控平台
|
||||
* 项目:中核预埋件检测
|
||||
* @Author: xiongwei
|
||||
* @Date: 2024-09-26 11:50:00
|
||||
* @Date: 2024-11-15 11:50:00
|
||||
*/
|
||||
|
||||
import { BasePageParams, PageResult, ApiResponse } from './baseModel';
|
||||
|
@ -1,82 +0,0 @@
|
||||
/**
|
||||
* 项目:视频监控平台
|
||||
* @Author: xiongwei
|
||||
* @Date: 2024-09-26 11:50:00
|
||||
*/
|
||||
|
||||
import { defHttp } from '@/utils/http/axios';
|
||||
import {
|
||||
Algo,
|
||||
AlgoParams,
|
||||
AlgoPageResult,
|
||||
} from '../model/algo';
|
||||
|
||||
const baseApi = '/v1/system/algo';
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
export const add = (entity: Algo) =>
|
||||
defHttp.post<Algo>({ url: `${baseApi}/`, data: entity });
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*/
|
||||
export const update = (entity: Algo, updateAllFields = false) =>
|
||||
defHttp.put<Algo>({ url: `${baseApi}/`, data: entity, params: { updateAllFields } });
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
export const remove = (id: any) =>
|
||||
defHttp.delete<number>({ url: `${baseApi}/${id}` });
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
export const search = (params?: AlgoParams) =>
|
||||
defHttp.get<AlgoPageResult>({ url: `${baseApi}/search`, params });
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*/
|
||||
export const all = (params?: AlgoParams) =>
|
||||
defHttp.get<Algo[]>({ url: `${baseApi}/all`, params });
|
||||
|
||||
/**
|
||||
* 通过主键查询
|
||||
*/
|
||||
export const getById = (id: any) =>
|
||||
defHttp.get<Algo>({ url: `${baseApi}/${id}` });
|
||||
|
||||
/**
|
||||
* 单个查询
|
||||
*/
|
||||
export const getOne = (params?: AlgoParams) =>
|
||||
defHttp.get<Algo>({ url: `${baseApi}/one`, params });
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
export const batchRemove = (idList: Array<any>) =>
|
||||
defHttp.post<boolean>({ url: `${baseApi}/batch-delete`, data: idList });
|
||||
|
||||
/**
|
||||
* 批量新增
|
||||
*/
|
||||
export const batchAdd = (entityList: Array<Algo>) =>
|
||||
defHttp.post<boolean>({ url: `${baseApi}/batch-save`, data: entityList });
|
||||
|
||||
/**
|
||||
* 批量更新
|
||||
*/
|
||||
export const batchUpdate = (entityList: Array<Algo>) =>
|
||||
defHttp.post<boolean>({ url: `${baseApi}/batch-update`, data: entityList });
|
||||
|
||||
/**
|
||||
* 查询数量
|
||||
*/
|
||||
export const count = (params?: AlgoParams) =>
|
||||
defHttp.get<number>({ url: `${baseApi}/count`, params });
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* 项目:视频监控平台
|
||||
* 项目:中核预埋件检测
|
||||
* @Author: xiongwei
|
||||
* @Date: 2024-09-26 11:50:00
|
||||
* @Date: 2024-11-15 11:50:00
|
||||
*/
|
||||
|
||||
import { defHttp } from '@/utils/http/axios';
|
||||
|
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* 项目:视频监控平台
|
||||
* 项目:中核预埋件检测
|
||||
* @Author: xiongwei
|
||||
* @Date: 2024-09-26 11:50:00
|
||||
* @Date: 2024-11-15 11:50:00
|
||||
*/
|
||||
|
||||
import { defHttp } from '@/utils/http/axios';
|
||||
|
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* 项目:视频监控平台
|
||||
* 项目:中核预埋件检测
|
||||
* @Author: xiongwei
|
||||
* @Date: 2024-09-26 11:50:00
|
||||
* @Date: 2024-11-15 11:50:00
|
||||
*/
|
||||
|
||||
import { defHttp } from '@/utils/http/axios';
|
||||
|
@ -1,82 +0,0 @@
|
||||
/**
|
||||
* 项目:视频监控平台
|
||||
* @Author: xiongwei
|
||||
* @Date: 2024-09-26 11:50:00
|
||||
*/
|
||||
|
||||
import { defHttp } from '@/utils/http/axios';
|
||||
import {
|
||||
Region,
|
||||
RegionParams,
|
||||
RegionPageResult,
|
||||
} from '../model/region';
|
||||
|
||||
const baseApi = '/v1/system/region';
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
export const add = (entity: Region) =>
|
||||
defHttp.post<Region>({ url: `${baseApi}/`, data: entity });
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*/
|
||||
export const update = (entity: Region, updateAllFields = false) =>
|
||||
defHttp.put<Region>({ url: `${baseApi}/`, data: entity, params: { updateAllFields } });
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
export const remove = (id: any) =>
|
||||
defHttp.delete<number>({ url: `${baseApi}/${id}` });
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
export const search = (params?: RegionParams) =>
|
||||
defHttp.get<RegionPageResult>({ url: `${baseApi}/search`, params });
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*/
|
||||
export const all = (params?: RegionParams) =>
|
||||
defHttp.get<Region[]>({ url: `${baseApi}/all`, params });
|
||||
|
||||
/**
|
||||
* 通过主键查询
|
||||
*/
|
||||
export const getById = (id: any) =>
|
||||
defHttp.get<Region>({ url: `${baseApi}/${id}` });
|
||||
|
||||
/**
|
||||
* 单个查询
|
||||
*/
|
||||
export const getOne = (params?: RegionParams) =>
|
||||
defHttp.get<Region>({ url: `${baseApi}/one`, params });
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
export const batchRemove = (idList: Array<any>) =>
|
||||
defHttp.post<boolean>({ url: `${baseApi}/batch-delete`, data: idList });
|
||||
|
||||
/**
|
||||
* 批量新增
|
||||
*/
|
||||
export const batchAdd = (entityList: Array<Region>) =>
|
||||
defHttp.post<boolean>({ url: `${baseApi}/batch-save`, data: entityList });
|
||||
|
||||
/**
|
||||
* 批量更新
|
||||
*/
|
||||
export const batchUpdate = (entityList: Array<Region>) =>
|
||||
defHttp.post<boolean>({ url: `${baseApi}/batch-update`, data: entityList });
|
||||
|
||||
/**
|
||||
* 查询数量
|
||||
*/
|
||||
export const count = (params?: RegionParams) =>
|
||||
defHttp.get<number>({ url: `${baseApi}/count`, params });
|
||||
|
||||
|
@ -1,82 +0,0 @@
|
||||
/**
|
||||
* 项目:视频监控平台
|
||||
* @Author: xiongwei
|
||||
* @Date: 2024-09-26 11:50:00
|
||||
*/
|
||||
|
||||
import { defHttp } from '@/utils/http/axios';
|
||||
import {
|
||||
StoragePlan,
|
||||
StoragePlanParams,
|
||||
StoragePlanPageResult,
|
||||
} from '../model/storagePlan';
|
||||
|
||||
const baseApi = '/v1/system/storage-plan';
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
export const add = (entity: StoragePlan) =>
|
||||
defHttp.post<StoragePlan>({ url: `${baseApi}/`, data: entity });
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*/
|
||||
export const update = (entity: StoragePlan, updateAllFields = false) =>
|
||||
defHttp.put<StoragePlan>({ url: `${baseApi}/`, data: entity, params: { updateAllFields } });
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
export const remove = (id: any) =>
|
||||
defHttp.delete<number>({ url: `${baseApi}/${id}` });
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
export const search = (params?: StoragePlanParams) =>
|
||||
defHttp.get<StoragePlanPageResult>({ url: `${baseApi}/search`, params });
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*/
|
||||
export const all = (params?: StoragePlanParams) =>
|
||||
defHttp.get<StoragePlan[]>({ url: `${baseApi}/all`, params });
|
||||
|
||||
/**
|
||||
* 通过主键查询
|
||||
*/
|
||||
export const getById = (id: any) =>
|
||||
defHttp.get<StoragePlan>({ url: `${baseApi}/${id}` });
|
||||
|
||||
/**
|
||||
* 单个查询
|
||||
*/
|
||||
export const getOne = (params?: StoragePlanParams) =>
|
||||
defHttp.get<StoragePlan>({ url: `${baseApi}/one`, params });
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
export const batchRemove = (idList: Array<any>) =>
|
||||
defHttp.post<boolean>({ url: `${baseApi}/batch-delete`, data: idList });
|
||||
|
||||
/**
|
||||
* 批量新增
|
||||
*/
|
||||
export const batchAdd = (entityList: Array<StoragePlan>) =>
|
||||
defHttp.post<boolean>({ url: `${baseApi}/batch-save`, data: entityList });
|
||||
|
||||
/**
|
||||
* 批量更新
|
||||
*/
|
||||
export const batchUpdate = (entityList: Array<StoragePlan>) =>
|
||||
defHttp.post<boolean>({ url: `${baseApi}/batch-update`, data: entityList });
|
||||
|
||||
/**
|
||||
* 查询数量
|
||||
*/
|
||||
export const count = (params?: StoragePlanParams) =>
|
||||
defHttp.get<number>({ url: `${baseApi}/count`, params });
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* 项目:视频监控平台
|
||||
* 项目:中核预埋件检测
|
||||
* @Author: xiongwei
|
||||
* @Date: 2024-09-26 11:50:00
|
||||
* @Date: 2024-11-15 11:50:00
|
||||
*/
|
||||
|
||||
import { defHttp } from '@/utils/http/axios';
|
||||
@ -17,19 +17,19 @@ const baseApi = '/v1/system/user';
|
||||
* 新增
|
||||
*/
|
||||
export const add = (entity: User) =>
|
||||
defHttp.post<User>({ url: `${baseApi}/add`, data: entity });
|
||||
defHttp.post<User>({ url: `${baseApi}/`, data: entity });
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*/
|
||||
export const update = (entity: User, updateAllFields = false) =>
|
||||
defHttp.post<User>({ url: `${baseApi}/update`, data: entity, params: { updateAllFields } });
|
||||
defHttp.put<User>({ url: `${baseApi}/`, data: entity, params: { updateAllFields } });
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
export const remove = (id: any) =>
|
||||
defHttp.get<number>({ url: `${baseApi}/delete`, params: { id } });
|
||||
defHttp.delete<number>({ url: `${baseApi}/${id}` });
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
|
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* 项目:视频监控平台
|
||||
* 项目:中核预埋件检测
|
||||
* @Author: xiongwei
|
||||
* @Date: 2024-09-26 11:50:00
|
||||
* @Date: 2024-11-15 11:50:00
|
||||
*/
|
||||
|
||||
import { defHttp } from '@/utils/http/axios';
|
||||
|
@ -19,11 +19,7 @@
|
||||
margin: 10px 20px 2px 10px;
|
||||
}
|
||||
|
||||
:deep(.ant-form-item-label) {
|
||||
width: 10px;
|
||||
}
|
||||
|
||||
:deep(.ant-form-item-label > label) {
|
||||
:deep(.ant-form-item-label > label.ant-form-item-no-colon) {
|
||||
font-family: "Noto Sans SC", serif;
|
||||
font-size: 14px;
|
||||
color: white;
|
@ -7,26 +7,26 @@ const data: AppRouteModule = {
|
||||
name: 'Data',
|
||||
component: EMBEDDED_LAYOUT,
|
||||
meta: {
|
||||
title: "数据管理",
|
||||
title: '数据管理',
|
||||
orderNo: 100000,
|
||||
ignoreAuth: true,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'task',
|
||||
name: 'TaskPage',
|
||||
component: () => import('/@/views/data/detect-task/index.vue'),
|
||||
path: 'device',
|
||||
name: 'DevicePage',
|
||||
component: () => import('/@/views/data/device/index.vue'),
|
||||
meta: {
|
||||
title: '任务',
|
||||
title: '设备管理',
|
||||
ignoreAuth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'event',
|
||||
name: 'EventPage',
|
||||
component: () => import('/@/views/data/event/index.vue'),
|
||||
path: 'task',
|
||||
name: 'TaskPage',
|
||||
component: () => import('/@/views/data/task/index.vue'),
|
||||
meta: {
|
||||
title: '事件',
|
||||
title: '任务',
|
||||
ignoreAuth: true,
|
||||
},
|
||||
},
|
||||
|
@ -7,26 +7,17 @@ const system: AppRouteModule = {
|
||||
name: 'System',
|
||||
component: EMBEDDED_LAYOUT,
|
||||
meta: {
|
||||
title: "系统设置",
|
||||
title: '系统设置',
|
||||
orderNo: 100001,
|
||||
ignoreAuth: true,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'detect-task',
|
||||
name: 'DetectTaskPage',
|
||||
component: () => import('/@/views/system/detect-task/index.vue'),
|
||||
path: 'constant',
|
||||
name: 'ConstantPage',
|
||||
component: () => import('/@/views/system/constant/index.vue'),
|
||||
meta: {
|
||||
title: '任务管理',
|
||||
ignoreAuth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'device',
|
||||
name: 'DevicePage',
|
||||
component: () => import('/@/views/system/device/index.vue'),
|
||||
meta: {
|
||||
title: '设备管理',
|
||||
title: '常量管理',
|
||||
ignoreAuth: true,
|
||||
},
|
||||
},
|
||||
|
@ -1,74 +0,0 @@
|
||||
<template>
|
||||
<Card :bordered="false" :loading="isLoading">
|
||||
<PageHeader
|
||||
:title="title"
|
||||
@back="() => $router.go(-1)"
|
||||
>
|
||||
<template #extra>
|
||||
<a-button type="primary" @click="$router.go(-1)">返回上一页面</a-button>
|
||||
</template>
|
||||
</PageHeader>
|
||||
<Descriptions bordered :column="3">
|
||||
<Descriptions.Item
|
||||
v-for="p in displayProps"
|
||||
:key="p.key"
|
||||
:label="p.title"
|
||||
:span="['avatar'].includes(p.key) ? 3 : 1"
|
||||
>
|
||||
<span v-if="p.key === 'avatar'">
|
||||
<Image style="width: 100px" :src="p.value"/>
|
||||
</span>
|
||||
<template v-else>
|
||||
{{ p.value }}
|
||||
</template>
|
||||
</Descriptions.Item>
|
||||
</Descriptions>
|
||||
</Card>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, computed, ref, Ref } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useAsyncState } from '@vueuse/core';
|
||||
import { PageHeader, Descriptions, Card } from 'ant-design-vue';
|
||||
import { descriptionColumns } from './schema';
|
||||
import * as DetectTaskItemApi from '@/api/data/detectTaskItemApi';
|
||||
import { DetectTaskItem } from '@/api/model/detectTaskItem';
|
||||
|
||||
const route = useRoute();
|
||||
const id = ref(route.params?.id);
|
||||
const title = route.meta.title
|
||||
|
||||
// id 查询
|
||||
const {
|
||||
state: detail,
|
||||
isReady: isDetailReady,
|
||||
isLoading,
|
||||
execute,
|
||||
} = useAsyncState(
|
||||
DetectTaskItemApi.getById(id.value).then((res: DetectTaskItem) => res),
|
||||
null,
|
||||
{
|
||||
immediate: false,
|
||||
},
|
||||
);
|
||||
|
||||
onMounted(() => {
|
||||
execute();
|
||||
});
|
||||
|
||||
const displayProps: Ref<Array<any>> = computed(() => {
|
||||
if (!isDetailReady.value) return {};
|
||||
const display: any = descriptionColumns.map(({ title, dataIndex = '', customRender }) => ({
|
||||
key: dataIndex,
|
||||
title,
|
||||
value: customRender ? customRender({ text: detail.value[dataIndex], record: detail.value }) : detail.value[dataIndex],
|
||||
}));
|
||||
return display;
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
::v-deep(.ant-card-body){
|
||||
padding-top: 0;
|
||||
}
|
||||
</style>
|
@ -31,7 +31,7 @@
|
||||
import { useAsyncState } from '@vueuse/core';
|
||||
import { PageHeader, Descriptions, Card } from 'ant-design-vue';
|
||||
import { descriptionColumns } from './schema';
|
||||
import * as DeviceApi from '@/api/system/deviceApi';
|
||||
import * as DeviceApi from '@/api/data/deviceApi';
|
||||
import { Device } from '@/api/model/device';
|
||||
|
||||
const route = useRoute();
|
@ -8,11 +8,11 @@
|
||||
import { BasicForm, useForm } from '@/components/Form/index';
|
||||
import { formSchema } from './schema';
|
||||
import { BasicDrawer, useDrawerInner } from '@/components/Drawer';
|
||||
import * as DetectTaskApi from '@/api/data/detectTaskApi';
|
||||
import * as DeviceApi from '@/api/data/deviceApi';
|
||||
|
||||
const emit = defineEmits(['success', 'register']);
|
||||
const isUpdate = ref(true);
|
||||
const entity = ref();
|
||||
const entity = ref();
|
||||
|
||||
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({
|
||||
labelWidth: 120,
|
||||
@ -42,7 +42,7 @@
|
||||
const {
|
||||
...rest
|
||||
} = values;
|
||||
const action = !unref(isUpdate) ? DetectTaskApi.add : DetectTaskApi.update;
|
||||
const action = !unref(isUpdate) ? DeviceApi.add : DeviceApi.update;
|
||||
const data = !unref(isUpdate)
|
||||
? {
|
||||
...rest,
|
156
src/views/data/device/index.vue
Normal file
156
src/views/data/device/index.vue
Normal file
@ -0,0 +1,156 @@
|
||||
<template>
|
||||
<div>
|
||||
<BasicTable @register="registerTable">
|
||||
<template #toolbar>
|
||||
<a-button type="primary" @click="handleCreate"> 新增</a-button>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.dataIndex === 'action'">
|
||||
<TableAction
|
||||
:actions="[
|
||||
{
|
||||
label: '编辑',
|
||||
icon: 'clarity:note-edit-line',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
divider: true,
|
||||
},
|
||||
{
|
||||
label: '详情',
|
||||
icon: 'ant-design:eye-outlined',
|
||||
onClick: handleView.bind(null, record),
|
||||
divider: true,
|
||||
},
|
||||
]"
|
||||
:dropDownActions="[
|
||||
{
|
||||
label: '删除',
|
||||
icon: 'ant-design:delete-outlined',
|
||||
color: 'error',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
placement: 'topRight',
|
||||
},
|
||||
},
|
||||
]"
|
||||
/>
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<DeviceDrawer @register="registerDrawer" @success="handleSuccess" />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { useGo } from '@/hooks/web/usePage';
|
||||
import { usePermission } from '@/hooks/web/usePermission';
|
||||
import { BasicTable, useTable, TableAction } from '@/components/Table';
|
||||
import { isObject } from '@/utils/is';
|
||||
import dayjs from 'dayjs';
|
||||
import * as DeviceApi from '@/api/data/deviceApi';
|
||||
import { useDrawer } from '@/components/Drawer';
|
||||
import DeviceDrawer from './drawer.vue';
|
||||
import { columns, searchFormSchema } from './schema';
|
||||
import { useMessage } from '@/hooks/web/useMessage';
|
||||
|
||||
defineOptions({
|
||||
name: 'AUTHDATADEVICE',
|
||||
});
|
||||
|
||||
const { createMessage } = useMessage();
|
||||
const { hasPermission } = usePermission();
|
||||
const go = useGo();
|
||||
|
||||
const [registerDrawer, { openDrawer }] = useDrawer();
|
||||
const [registerTable, { reload, setSelectedRowKeys }] = useTable({
|
||||
title: '设备表',
|
||||
api: (params) => DeviceApi.search(handleParams(params)),
|
||||
columns,
|
||||
formConfig: {
|
||||
labelWidth: 120,
|
||||
schemas: searchFormSchema,
|
||||
showAdvancedButton: false,
|
||||
},
|
||||
useSearchForm: true,
|
||||
showTableSetting: false,
|
||||
bordered: false,
|
||||
showIndexColumn: false,
|
||||
canResize: false,
|
||||
rowKey: (record: any) => record.id,
|
||||
actionColumn: {
|
||||
width: 170,
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
fixed: 'right',
|
||||
},
|
||||
});
|
||||
|
||||
const handleParams = (params) => {
|
||||
const { pageNum, pageSize, field = 'id', order = 'descend', ...rest } = params;
|
||||
const handledParams: any = {
|
||||
pageNum,
|
||||
pageSize,
|
||||
orderByClause: `${field} ${order === 'descend' ? 'desc' : 'asc'}`,
|
||||
};
|
||||
Object.keys(rest).forEach((key) => {
|
||||
const schema = searchFormSchema.find((item) => item.field === key);
|
||||
const value = params[key];
|
||||
const paramKey = key;
|
||||
if (schema) {
|
||||
if (value !== undefined && value !== '') {
|
||||
if (schema.component === 'Input') {
|
||||
handledParams[paramKey] = `%${value.trim()}%`;
|
||||
} else if (['Select', 'ApiSelect', 'ApiTreeSelect'].includes(schema.component)) {
|
||||
handledParams[paramKey] = isObject(value) ? value.value : value;
|
||||
} else if (schema.component === 'RangePicker') {
|
||||
handledParams[`${paramKey}From`] = dayjs(value[0])
|
||||
.startOf('d')
|
||||
.format('YYYY-MM-DD HH:mm:ss');
|
||||
handledParams[`${paramKey}To`] = dayjs(value[1])
|
||||
.endOf('d')
|
||||
.format('YYYY-MM-DD HH:mm:ss');
|
||||
} else if (schema.component === 'DatePicker') {
|
||||
handledParams[paramKey] = dayjs(value).format(
|
||||
(schema.componentProps as any).format || 'YYYY-MM-DD',
|
||||
);
|
||||
} else {
|
||||
handledParams[paramKey] = value;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
handledParams[paramKey] = value;
|
||||
}
|
||||
});
|
||||
return handledParams;
|
||||
};
|
||||
|
||||
const handleCreate = () => {
|
||||
openDrawer(true, {
|
||||
isUpdate: false,
|
||||
});
|
||||
};
|
||||
|
||||
const handleEdit = (record: Recordable) => {
|
||||
openDrawer(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
});
|
||||
};
|
||||
|
||||
const handleDelete = (record: Recordable) => {
|
||||
DeviceApi.remove(record.id).then((_) => {
|
||||
reload();
|
||||
});
|
||||
};
|
||||
|
||||
const handleSuccess = () => {
|
||||
reload();
|
||||
};
|
||||
|
||||
const handleView = (record) => {
|
||||
go('/data/device/detail/' + record.id);
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@use '@/assets/custom.scss';
|
||||
</style>
|
197
src/views/data/device/schema.ts
Normal file
197
src/views/data/device/schema.ts
Normal file
@ -0,0 +1,197 @@
|
||||
/**
|
||||
* 项目:中核预埋件检测
|
||||
* 模型分组:数据管理
|
||||
* 模型名称:设备表
|
||||
* @Author: xiongwei
|
||||
* @Date: 2024-11-15 11:50:00
|
||||
*/
|
||||
|
||||
import { BasicColumn } from '@/components/Table';
|
||||
import { FormSchema } from '@/components/Table';
|
||||
|
||||
|
||||
|
||||
|
||||
const colProps = { xs: { span: 24 }, sm: { span: 24 }, lg: { span: 8 } };
|
||||
const colPropsInDrawer = { span: 24 };
|
||||
|
||||
export const schema = {
|
||||
model: 'Device',
|
||||
viewInPage: false,
|
||||
properties: [
|
||||
{
|
||||
field: 'id',
|
||||
label: 'ID系统自动生成',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
componentProps: {
|
||||
allowClear: false,
|
||||
placeholder: 'ID系统自动生成',
|
||||
},
|
||||
colProps,
|
||||
component: 'InputNumber',
|
||||
rules: [{ required: true, message: '请输入ID系统自动生成!' }],
|
||||
},
|
||||
table: {
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'name',
|
||||
label: '设备名称',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
componentProps: {
|
||||
allowClear: false,
|
||||
placeholder: '设备名称',
|
||||
},
|
||||
colProps,
|
||||
component: 'Input',
|
||||
rules: [{ required: true, message: '请输入设备名称!' }],
|
||||
},
|
||||
table: {
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'deviceSn',
|
||||
label: '设备序列号',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '设备序列号',
|
||||
},
|
||||
colProps,
|
||||
component: 'Input',
|
||||
},
|
||||
table: {
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'deviceIp',
|
||||
label: '设备IP地址',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '设备IP地址',
|
||||
},
|
||||
colProps,
|
||||
component: 'Input',
|
||||
},
|
||||
table: {
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
label: 'CreateTime',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
colProps,
|
||||
componentProps: {
|
||||
allowClear: false,
|
||||
placeholder: ['开始时间', '结束时间'],
|
||||
format: 'YYYY-MM-DD',
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
showTime: false,
|
||||
},
|
||||
component: 'RangePicker',
|
||||
rules: [{ required: true, message: '请输入CreateTime!' }],
|
||||
},
|
||||
table: {
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'updateTime',
|
||||
label: 'UpdateTime',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
colProps,
|
||||
componentProps: {
|
||||
allowClear: false,
|
||||
placeholder: ['开始时间', '结束时间'],
|
||||
format: 'YYYY-MM-DD',
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
showTime: false,
|
||||
},
|
||||
component: 'RangePicker',
|
||||
rules: [{ required: true, message: '请输入UpdateTime!' }],
|
||||
},
|
||||
table: {
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const queryFields = ['name','deviceSn','deviceIp'];
|
||||
const editFields = ['name','deviceSn','deviceIp'];
|
||||
const tableFields = ['name','deviceSn','deviceIp','createTime','updateTime'];
|
||||
const descriptionFields = ['name','deviceSn','deviceIp','createTime','updateTime'];
|
||||
|
||||
const queryFieldsIndexMap = new Map(queryFields.map((field, index) => [field, index]));
|
||||
export const searchFormSchema: FormSchema[] = schema.properties.filter(item => queryFields.includes(item.field))
|
||||
.map(
|
||||
({ field, label, form: { ...formProps } }) =>
|
||||
({
|
||||
field,
|
||||
label,
|
||||
defaultValue: undefined,
|
||||
...formProps,
|
||||
required: false,
|
||||
rules: [{ required: false }],
|
||||
} as FormSchema),
|
||||
)
|
||||
.sort((a, b) => {
|
||||
const indexA = queryFieldsIndexMap.get(a.field) as number;
|
||||
const indexB = queryFieldsIndexMap.get(b.field) as number;
|
||||
return indexA - indexB;
|
||||
});
|
||||
|
||||
const editFieldsIndexMap = new Map(editFields.map((field, index) => [field, index]));
|
||||
export const formSchema: FormSchema[] = schema.properties.filter(item => editFields.includes(item.field))
|
||||
.map(
|
||||
({ field, label, defaultValue, form }) =>
|
||||
({
|
||||
field,
|
||||
label,
|
||||
defaultValue,
|
||||
...form,
|
||||
colProps: colPropsInDrawer,
|
||||
} as FormSchema),
|
||||
)
|
||||
.sort((a, b) => {
|
||||
const indexA = editFieldsIndexMap.get(a.field) as number;
|
||||
const indexB = editFieldsIndexMap.get(b.field) as number;
|
||||
return indexA - indexB;
|
||||
});
|
||||
|
||||
const tableFieldsIndexMap = new Map(tableFields.map((field, index) => [field, index]));
|
||||
export const columns: BasicColumn[] = schema.properties.filter(item => tableFields.includes(item.field))
|
||||
.map(
|
||||
({ field, label, table }) =>
|
||||
({
|
||||
dataIndex: field,
|
||||
title: label,
|
||||
...table,
|
||||
} as BasicColumn)
|
||||
)
|
||||
.sort((a, b) => {
|
||||
const indexA = tableFieldsIndexMap.get(a.dataIndex as string) as number;
|
||||
const indexB = tableFieldsIndexMap.get(b.dataIndex as string) as number;
|
||||
return indexA - indexB;
|
||||
});
|
||||
|
||||
const descriptionFieldsIndexMap = new Map(descriptionFields.map((field, index) => [field, index]));
|
||||
export const descriptionColumns: BasicColumn[] = schema.properties.filter(item => descriptionFields.includes(item.field))
|
||||
.map(
|
||||
({ field, label, table }) =>
|
||||
({
|
||||
dataIndex: field,
|
||||
title: label,
|
||||
...table,
|
||||
} as BasicColumn),
|
||||
)
|
||||
.sort((a, b) => {
|
||||
const indexA = descriptionFieldsIndexMap.get(a.dataIndex as string) as number;
|
||||
const indexB = descriptionFieldsIndexMap.get(b.dataIndex as string) as number;
|
||||
return indexA - indexB;
|
||||
});
|
@ -31,8 +31,8 @@
|
||||
import { useAsyncState } from '@vueuse/core';
|
||||
import { PageHeader, Descriptions, Card } from 'ant-design-vue';
|
||||
import { descriptionColumns } from './schema';
|
||||
import * as RegionApi from '@/api/system/regionApi';
|
||||
import { Region } from '@/api/model/region';
|
||||
import * as TaskLogApi from '@/api/data/taskLogApi';
|
||||
import { TaskLog } from '@/api/model/taskLog';
|
||||
|
||||
const route = useRoute();
|
||||
const id = ref(route.params?.id);
|
||||
@ -45,7 +45,7 @@
|
||||
isLoading,
|
||||
execute,
|
||||
} = useAsyncState(
|
||||
RegionApi.getById(id.value).then((res: Region) => res),
|
||||
TaskLogApi.getById(id.value).then((res: TaskLog) => res),
|
||||
null,
|
||||
{
|
||||
immediate: false,
|
@ -8,11 +8,11 @@
|
||||
import { BasicForm, useForm } from '@/components/Form/index';
|
||||
import { formSchema } from './schema';
|
||||
import { BasicDrawer, useDrawerInner } from '@/components/Drawer';
|
||||
import * as DetectTaskItemApi from '@/api/data/detectTaskItemApi';
|
||||
import * as TaskLogApi from '@/api/data/taskLogApi';
|
||||
|
||||
const emit = defineEmits(['success', 'register']);
|
||||
const isUpdate = ref(true);
|
||||
const entity = ref();
|
||||
const entity = ref();
|
||||
|
||||
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({
|
||||
labelWidth: 120,
|
||||
@ -42,7 +42,7 @@
|
||||
const {
|
||||
...rest
|
||||
} = values;
|
||||
const action = !unref(isUpdate) ? DetectTaskItemApi.add : DetectTaskItemApi.update;
|
||||
const action = !unref(isUpdate) ? TaskLogApi.add : TaskLogApi.update;
|
||||
const data = !unref(isUpdate)
|
||||
? {
|
||||
...rest,
|
@ -8,7 +8,7 @@
|
||||
<span>已选中{{ checkedKeys.length }}条记录</span>
|
||||
<a-button type="link" @click="setSelectedRowKeys([])" size="small">清空</a-button>
|
||||
<Popconfirm
|
||||
v-if="hasPermission('AUTH_DATA_EVENT:DELETE')"
|
||||
v-if="hasPermission('AUTH_DATA_TASK_LOG:DELETE')"
|
||||
class="ml-4"
|
||||
title="确定要全部删除吗?"
|
||||
ok-text="是"
|
||||
@ -25,7 +25,7 @@
|
||||
</Alert>
|
||||
</template>
|
||||
<template #toolbar>
|
||||
<a-button v-auth="'AUTH_DATA_EVENT:ADD'" type="primary" @click="handleCreate"> 新增</a-button>
|
||||
<a-button v-auth="'AUTH_DATA_TASK_LOG:ADD'" type="primary" @click="handleCreate"> 新增</a-button>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.dataIndex === 'action'">
|
||||
@ -35,7 +35,7 @@
|
||||
label: '编辑',
|
||||
icon: 'clarity:note-edit-line',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
ifShow: hasPermission('AUTH_DATA_EVENT:EDIT'),
|
||||
ifShow: hasPermission('AUTH_DATA_TASK_LOG:EDIT'),
|
||||
divider:true
|
||||
},
|
||||
{
|
||||
@ -55,14 +55,14 @@
|
||||
confirm: handleDelete.bind(null, record),
|
||||
placement: 'topRight',
|
||||
},
|
||||
ifShow: hasPermission('AUTH_DATA_EVENT:DELETE'),
|
||||
ifShow: hasPermission('AUTH_DATA_TASK_LOG:DELETE'),
|
||||
},
|
||||
]"
|
||||
/>
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<EventDrawer @register="registerDrawer" @success="handleSuccess" />
|
||||
<TaskLogDrawer @register="registerDrawer" @success="handleSuccess" />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
@ -73,14 +73,14 @@
|
||||
import { BasicTable, useTable, TableAction } from '@/components/Table';
|
||||
import { isObject } from '@/utils/is';
|
||||
import dayjs from 'dayjs';
|
||||
import * as EventApi from '@/api/data/eventApi';
|
||||
import * as TaskLogApi from '@/api/data/taskLogApi';
|
||||
import { useDrawer } from '@/components/Drawer';
|
||||
import EventDrawer from './drawer.vue';
|
||||
import TaskLogDrawer from './drawer.vue';
|
||||
import { columns, searchFormSchema } from './schema';
|
||||
import { useMessage } from "@/hooks/web/useMessage";
|
||||
|
||||
defineOptions({
|
||||
name: 'AUTH_DATA_EVENT'
|
||||
name: 'AUTH_DATA_TASK_LOG'
|
||||
})
|
||||
|
||||
const { createMessage } = useMessage();
|
||||
@ -94,8 +94,8 @@
|
||||
|
||||
const [registerDrawer, { openDrawer }] = useDrawer();
|
||||
const [registerTable, { reload, setSelectedRowKeys }] = useTable({
|
||||
title: '事件明细表',
|
||||
api: (params) => EventApi.search(handleParams(params)),
|
||||
title: '任务检测日志表',
|
||||
api: (params) => TaskLogApi.search(handleParams(params)),
|
||||
columns,
|
||||
formConfig: {
|
||||
labelWidth: 120,
|
||||
@ -108,7 +108,7 @@
|
||||
},
|
||||
useSearchForm: true,
|
||||
showTableSetting: false,
|
||||
bordered: true,
|
||||
bordered: false,
|
||||
showIndexColumn: false,
|
||||
canResize: false,
|
||||
rowKey: (record: any) => record.id,
|
||||
@ -163,7 +163,7 @@
|
||||
};
|
||||
|
||||
const handleDelete = (record: Recordable) => {
|
||||
EventApi.remove(record.id).then((_) => {
|
||||
TaskLogApi.remove(record.id).then((_) => {
|
||||
reload();
|
||||
setSelectedRowKeys([])
|
||||
});
|
||||
@ -174,7 +174,7 @@
|
||||
createMessage.error('当前未选中任何项目!');
|
||||
return;
|
||||
}
|
||||
EventApi.batchRemove(checkedKeys.value).then((_) => {
|
||||
TaskLogApi.batchRemove(checkedKeys.value).then((_) => {
|
||||
reload();
|
||||
setSelectedRowKeys([])
|
||||
});
|
||||
@ -185,7 +185,7 @@
|
||||
};
|
||||
|
||||
const handleView = (record) => {
|
||||
go('/data/event/detail/' + record.id);
|
||||
go('/data/task-log/detail/' + record.id);
|
||||
};
|
||||
</script>
|
||||
<style lang="less" scoped></style>
|
@ -1,14 +1,14 @@
|
||||
/**
|
||||
* 项目:视频监控平台
|
||||
* 项目:中核预埋件检测
|
||||
* 模型分组:数据管理
|
||||
* 模型名称:事件明细表
|
||||
* 模型名称:任务检测日志表
|
||||
* @Author: xiongwei
|
||||
* @Date: 2024-09-26 11:50:00
|
||||
* @Date: 2024-11-15 11:50:00
|
||||
*/
|
||||
|
||||
import { BasicColumn } from '@/components/Table';
|
||||
import { FormSchema } from '@/components/Table';
|
||||
import { uploadApi } from "@/api/sys/upload";
|
||||
|
||||
|
||||
|
||||
|
||||
@ -16,8 +16,8 @@ const colProps = { xs: { span: 24 }, sm: { span: 24 }, lg: { span: 8 } };
|
||||
const colPropsInDrawer = { span: 24 };
|
||||
|
||||
export const schema = {
|
||||
model: 'Event',
|
||||
viewInPage: true,
|
||||
model: 'TaskLog',
|
||||
viewInPage: false,
|
||||
properties: [
|
||||
{
|
||||
field: 'id',
|
||||
@ -36,100 +36,32 @@ export const schema = {
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'regionId',
|
||||
label: 'sys_region.id',
|
||||
field: 'taskId',
|
||||
label: 'dat_detect_task.id',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
componentProps: {
|
||||
allowClear: false,
|
||||
placeholder: 'sys_region.id',
|
||||
placeholder: 'dat_detect_task.id',
|
||||
},
|
||||
colProps,
|
||||
component: 'InputNumber',
|
||||
rules: [{ required: true, message: '请输入sys_region.id!' }],
|
||||
rules: [{ required: true, message: '请输入dat_detect_task.id!' }],
|
||||
},
|
||||
table: {
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'deviceId',
|
||||
label: 'sys_device.id',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
componentProps: {
|
||||
allowClear: false,
|
||||
placeholder: 'sys_device.id',
|
||||
},
|
||||
colProps,
|
||||
component: 'InputNumber',
|
||||
rules: [{ required: true, message: '请输入sys_device.id!' }],
|
||||
},
|
||||
table: {
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'algoCode',
|
||||
label: '算法code',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
componentProps: {
|
||||
allowClear: false,
|
||||
placeholder: '算法code',
|
||||
},
|
||||
colProps,
|
||||
component: 'Input',
|
||||
rules: [{ required: true, message: '请输入算法code!' }],
|
||||
},
|
||||
table: {
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'alarmLevel',
|
||||
label: '告警等级',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
componentProps: {
|
||||
allowClear: false,
|
||||
placeholder: '告警等级',
|
||||
},
|
||||
colProps,
|
||||
component: 'Input',
|
||||
rules: [{ required: true, message: '请输入告警等级!' }],
|
||||
},
|
||||
table: {
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'imageUrl',
|
||||
label: '图片',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
componentProps: {
|
||||
api: uploadApi,
|
||||
maxSize: 5,
|
||||
maxNumber: 1,
|
||||
multiple: false,
|
||||
accept: ['png', 'jpg', 'jpeg', 'bmp', 'webp'],
|
||||
allowClear: true,
|
||||
placeholder: '图片',
|
||||
},
|
||||
colProps,
|
||||
component: 'Upload',
|
||||
},
|
||||
table: {
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'videoUrl',
|
||||
label: '视频',
|
||||
field: 'deviceSn',
|
||||
label: '设备序列号',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '视频',
|
||||
placeholder: '设备序列号',
|
||||
},
|
||||
colProps,
|
||||
component: 'Upload',
|
||||
component: 'Input',
|
||||
},
|
||||
table: {
|
||||
},
|
||||
@ -150,20 +82,39 @@ export const schema = {
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'eventTime',
|
||||
label: '发生时间',
|
||||
field: 'createTime',
|
||||
label: 'CreateTime',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
colProps,
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
allowClear: false,
|
||||
placeholder: '发生时间',
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
showTime: true,
|
||||
placeholder: ['开始时间', '结束时间'],
|
||||
format: 'YYYY-MM-DD',
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
showTime: false,
|
||||
},
|
||||
rules: [{ required: true, message: '请输入发生时间!' }],
|
||||
component: 'RangePicker',
|
||||
rules: [{ required: true, message: '请输入CreateTime!' }],
|
||||
},
|
||||
table: {
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'updateTime',
|
||||
label: 'UpdateTime',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
colProps,
|
||||
componentProps: {
|
||||
allowClear: false,
|
||||
placeholder: ['开始时间', '结束时间'],
|
||||
format: 'YYYY-MM-DD',
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
showTime: false,
|
||||
},
|
||||
component: 'RangePicker',
|
||||
rules: [{ required: true, message: '请输入UpdateTime!' }],
|
||||
},
|
||||
table: {
|
||||
},
|
||||
@ -171,10 +122,10 @@ export const schema = {
|
||||
],
|
||||
};
|
||||
|
||||
const queryFields = ['id','regionId','deviceId','algoCode','alarmLevel','videoUrl','content','eventTime'];
|
||||
const editFields = ['regionId','deviceId','algoCode','alarmLevel','imageUrl','videoUrl','content','eventTime'];
|
||||
const tableFields = ['regionId','deviceId','algoCode','alarmLevel','imageUrl','videoUrl','content','eventTime'];
|
||||
const descriptionFields = ['regionId','deviceId','algoCode','alarmLevel','imageUrl','videoUrl','content','eventTime'];
|
||||
const queryFields = ['id','taskId','deviceSn','content','createTime','updateTime'];
|
||||
const editFields = ['taskId','deviceSn','content'];
|
||||
const tableFields = ['taskId','deviceSn','content','createTime','updateTime'];
|
||||
const descriptionFields = ['taskId','deviceSn','content','createTime','updateTime'];
|
||||
|
||||
const queryFieldsIndexMap = new Map(queryFields.map((field, index) => [field, index]));
|
||||
export const searchFormSchema: FormSchema[] = schema.properties.filter(item => queryFields.includes(item.field))
|
74
src/views/data/task-progress/detail.vue
Normal file
74
src/views/data/task-progress/detail.vue
Normal file
@ -0,0 +1,74 @@
|
||||
<template>
|
||||
<Card :bordered="false" :loading="isLoading">
|
||||
<PageHeader
|
||||
:title="title"
|
||||
@back="() => $router.go(-1)"
|
||||
>
|
||||
<template #extra>
|
||||
<a-button type="primary" @click="$router.go(-1)">返回上一页面</a-button>
|
||||
</template>
|
||||
</PageHeader>
|
||||
<Descriptions bordered :column="3">
|
||||
<Descriptions.Item
|
||||
v-for="p in displayProps"
|
||||
:key="p.key"
|
||||
:label="p.title"
|
||||
:span="['avatar'].includes(p.key) ? 3 : 1"
|
||||
>
|
||||
<span v-if="p.key === 'avatar'">
|
||||
<Image style="width: 100px" :src="p.value"/>
|
||||
</span>
|
||||
<template v-else>
|
||||
{{ p.value }}
|
||||
</template>
|
||||
</Descriptions.Item>
|
||||
</Descriptions>
|
||||
</Card>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, computed, ref, Ref } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useAsyncState } from '@vueuse/core';
|
||||
import { PageHeader, Descriptions, Card } from 'ant-design-vue';
|
||||
import { descriptionColumns } from './schema';
|
||||
import * as TaskProgressApi from '@/api/data/taskProgressApi';
|
||||
import { TaskProgress } from '@/api/model/taskProgress';
|
||||
|
||||
const route = useRoute();
|
||||
const id = ref(route.params?.id);
|
||||
const title = route.meta.title
|
||||
|
||||
// id 查询
|
||||
const {
|
||||
state: detail,
|
||||
isReady: isDetailReady,
|
||||
isLoading,
|
||||
execute,
|
||||
} = useAsyncState(
|
||||
TaskProgressApi.getById(id.value).then((res: TaskProgress) => res),
|
||||
null,
|
||||
{
|
||||
immediate: false,
|
||||
},
|
||||
);
|
||||
|
||||
onMounted(() => {
|
||||
execute();
|
||||
});
|
||||
|
||||
const displayProps: Ref<Array<any>> = computed(() => {
|
||||
if (!isDetailReady.value) return {};
|
||||
const display: any = descriptionColumns.map(({ title, dataIndex = '', customRender }) => ({
|
||||
key: dataIndex,
|
||||
title,
|
||||
value: customRender ? customRender({ text: detail.value[dataIndex], record: detail.value }) : detail.value[dataIndex],
|
||||
}));
|
||||
return display;
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
::v-deep(.ant-card-body){
|
||||
padding-top: 0;
|
||||
}
|
||||
</style>
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<BasicDrawer v-bind="$attrs" @register="registerDrawer" showFooter :title="getTitle" width="600px" @ok="handleSubmit">
|
||||
<BasicForm @register="registerForm" name="EditForm"/>
|
||||
<BasicForm @register="registerForm" />
|
||||
</BasicDrawer>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
@ -8,15 +8,14 @@
|
||||
import { BasicForm, useForm } from '@/components/Form/index';
|
||||
import { formSchema } from './schema';
|
||||
import { BasicDrawer, useDrawerInner } from '@/components/Drawer';
|
||||
import * as RegionApi from '@/api/system/regionApi';
|
||||
import dayjs from "dayjs";
|
||||
import * as TaskProgressApi from '@/api/data/taskProgressApi';
|
||||
|
||||
const emit = defineEmits(['success', 'register']);
|
||||
const isUpdate = ref(true);
|
||||
const entity = ref();
|
||||
const entity = ref();
|
||||
|
||||
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({
|
||||
labelWidth: 60,
|
||||
labelWidth: 120,
|
||||
schemas: formSchema,
|
||||
showActionButtonGroup: false,
|
||||
});
|
||||
@ -43,7 +42,7 @@
|
||||
const {
|
||||
...rest
|
||||
} = values;
|
||||
const action = !unref(isUpdate) ? RegionApi.add : RegionApi.update;
|
||||
const action = !unref(isUpdate) ? TaskProgressApi.add : TaskProgressApi.update;
|
||||
const data = !unref(isUpdate)
|
||||
? {
|
||||
...rest,
|
||||
@ -52,7 +51,6 @@
|
||||
{
|
||||
...unref(entity),
|
||||
...rest,
|
||||
updateTime: dayjs().format('YYYY-MM-DD HH:mm:ss')
|
||||
},
|
||||
);
|
||||
await action(data);
|
||||
@ -63,5 +61,3 @@
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped src="@/assets/custom.css" />
|
@ -8,7 +8,7 @@
|
||||
<span>已选中{{ checkedKeys.length }}条记录</span>
|
||||
<a-button type="link" @click="setSelectedRowKeys([])" size="small">清空</a-button>
|
||||
<Popconfirm
|
||||
v-if="hasPermission('AUTH_DATA_DETECT_TASK:DELETE')"
|
||||
v-if="hasPermission('AUTH_DATA_TASK_PROGRESS:DELETE')"
|
||||
class="ml-4"
|
||||
title="确定要全部删除吗?"
|
||||
ok-text="是"
|
||||
@ -25,7 +25,7 @@
|
||||
</Alert>
|
||||
</template>
|
||||
<template #toolbar>
|
||||
<a-button v-auth="'AUTH_DATA_DETECT_TASK:ADD'" type="primary" @click="handleCreate"> 新增</a-button>
|
||||
<a-button v-auth="'AUTH_DATA_TASK_PROGRESS:ADD'" type="primary" @click="handleCreate"> 新增</a-button>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.dataIndex === 'action'">
|
||||
@ -35,7 +35,7 @@
|
||||
label: '编辑',
|
||||
icon: 'clarity:note-edit-line',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
ifShow: hasPermission('AUTH_DATA_DETECT_TASK:EDIT'),
|
||||
ifShow: hasPermission('AUTH_DATA_TASK_PROGRESS:EDIT'),
|
||||
divider:true
|
||||
},
|
||||
{
|
||||
@ -55,14 +55,14 @@
|
||||
confirm: handleDelete.bind(null, record),
|
||||
placement: 'topRight',
|
||||
},
|
||||
ifShow: hasPermission('AUTH_DATA_DETECT_TASK:DELETE'),
|
||||
ifShow: hasPermission('AUTH_DATA_TASK_PROGRESS:DELETE'),
|
||||
},
|
||||
]"
|
||||
/>
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<DetectTaskDrawer @register="registerDrawer" @success="handleSuccess" />
|
||||
<TaskProgressDrawer @register="registerDrawer" @success="handleSuccess" />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
@ -73,14 +73,14 @@
|
||||
import { BasicTable, useTable, TableAction } from '@/components/Table';
|
||||
import { isObject } from '@/utils/is';
|
||||
import dayjs from 'dayjs';
|
||||
import * as DetectTaskApi from '@/api/data/detectTaskApi';
|
||||
import * as TaskProgressApi from '@/api/data/taskProgressApi';
|
||||
import { useDrawer } from '@/components/Drawer';
|
||||
import DetectTaskDrawer from './drawer.vue';
|
||||
import TaskProgressDrawer from './drawer.vue';
|
||||
import { columns, searchFormSchema } from './schema';
|
||||
import { useMessage } from "@/hooks/web/useMessage";
|
||||
|
||||
defineOptions({
|
||||
name: 'AUTH_DATA_DETECT_TASK'
|
||||
name: 'AUTH_DATA_TASK_PROGRESS'
|
||||
})
|
||||
|
||||
const { createMessage } = useMessage();
|
||||
@ -94,8 +94,8 @@
|
||||
|
||||
const [registerDrawer, { openDrawer }] = useDrawer();
|
||||
const [registerTable, { reload, setSelectedRowKeys }] = useTable({
|
||||
title: '检测任务表',
|
||||
api: (params) => DetectTaskApi.search(handleParams(params)),
|
||||
title: '任务检测过程数据表',
|
||||
api: (params) => TaskProgressApi.search(handleParams(params)),
|
||||
columns,
|
||||
formConfig: {
|
||||
labelWidth: 120,
|
||||
@ -108,7 +108,7 @@
|
||||
},
|
||||
useSearchForm: true,
|
||||
showTableSetting: false,
|
||||
bordered: true,
|
||||
bordered: false,
|
||||
showIndexColumn: false,
|
||||
canResize: false,
|
||||
rowKey: (record: any) => record.id,
|
||||
@ -163,7 +163,7 @@
|
||||
};
|
||||
|
||||
const handleDelete = (record: Recordable) => {
|
||||
DetectTaskApi.remove(record.id).then((_) => {
|
||||
TaskProgressApi.remove(record.id).then((_) => {
|
||||
reload();
|
||||
setSelectedRowKeys([])
|
||||
});
|
||||
@ -174,7 +174,7 @@
|
||||
createMessage.error('当前未选中任何项目!');
|
||||
return;
|
||||
}
|
||||
DetectTaskApi.batchRemove(checkedKeys.value).then((_) => {
|
||||
TaskProgressApi.batchRemove(checkedKeys.value).then((_) => {
|
||||
reload();
|
||||
setSelectedRowKeys([])
|
||||
});
|
||||
@ -185,7 +185,7 @@
|
||||
};
|
||||
|
||||
const handleView = (record) => {
|
||||
go('/data/detect-task/detail/' + record.id);
|
||||
go('/data/task-progress/detail/' + record.id);
|
||||
};
|
||||
</script>
|
||||
<style lang="less" scoped></style>
|
@ -1,9 +1,9 @@
|
||||
/**
|
||||
* 项目:视频监控平台
|
||||
* 项目:中核预埋件检测
|
||||
* 模型分组:数据管理
|
||||
* 模型名称:任务检测项表
|
||||
* 模型名称:任务检测过程数据表
|
||||
* @Author: xiongwei
|
||||
* @Date: 2024-09-26 11:50:00
|
||||
* @Date: 2024-11-15 11:50:00
|
||||
*/
|
||||
|
||||
import { BasicColumn } from '@/components/Table';
|
||||
@ -16,7 +16,7 @@ const colProps = { xs: { span: 24 }, sm: { span: 24 }, lg: { span: 8 } };
|
||||
const colPropsInDrawer = { span: 24 };
|
||||
|
||||
export const schema = {
|
||||
model: 'DetectTaskItem',
|
||||
model: 'TaskProgress',
|
||||
viewInPage: false,
|
||||
properties: [
|
||||
{
|
||||
@ -36,7 +36,7 @@ export const schema = {
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'detectTaskId',
|
||||
field: 'taskId',
|
||||
label: 'dat_detect_task.id',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
@ -52,23 +52,22 @@ export const schema = {
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'algoId',
|
||||
label: 'sys_algo.id',
|
||||
field: 'deviceSn',
|
||||
label: '设备序列号',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
componentProps: {
|
||||
allowClear: false,
|
||||
placeholder: 'sys_algo.id',
|
||||
allowClear: true,
|
||||
placeholder: '设备序列号',
|
||||
},
|
||||
colProps,
|
||||
component: 'InputNumber',
|
||||
rules: [{ required: true, message: '请输入sys_algo.id!' }],
|
||||
component: 'Input',
|
||||
},
|
||||
table: {
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'paramJson',
|
||||
field: 'taskDataJson',
|
||||
label: '参数配置',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
@ -83,16 +82,39 @@ export const schema = {
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'roiJson',
|
||||
label: 'ROI区域设置',
|
||||
field: 'createTime',
|
||||
label: 'CreateTime',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
colProps,
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: 'ROI区域设置',
|
||||
allowClear: false,
|
||||
placeholder: ['开始时间', '结束时间'],
|
||||
format: 'YYYY-MM-DD',
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
showTime: false,
|
||||
},
|
||||
component: 'InputTextArea',
|
||||
colProps: { span: 24 },
|
||||
component: 'RangePicker',
|
||||
rules: [{ required: true, message: '请输入CreateTime!' }],
|
||||
},
|
||||
table: {
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'updateTime',
|
||||
label: 'UpdateTime',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
colProps,
|
||||
componentProps: {
|
||||
allowClear: false,
|
||||
placeholder: ['开始时间', '结束时间'],
|
||||
format: 'YYYY-MM-DD',
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
showTime: false,
|
||||
},
|
||||
component: 'RangePicker',
|
||||
rules: [{ required: true, message: '请输入UpdateTime!' }],
|
||||
},
|
||||
table: {
|
||||
},
|
||||
@ -100,10 +122,10 @@ export const schema = {
|
||||
],
|
||||
};
|
||||
|
||||
const queryFields = ['id','detectTaskId','algoId'];
|
||||
const editFields = ['detectTaskId','algoId','paramJson','roiJson'];
|
||||
const tableFields = ['detectTaskId','algoId','paramJson','roiJson'];
|
||||
const descriptionFields = ['detectTaskId','algoId','paramJson','roiJson'];
|
||||
const queryFields = ['id','taskId','deviceSn','createTime','updateTime'];
|
||||
const editFields = ['taskId','deviceSn','taskDataJson'];
|
||||
const tableFields = ['taskId','deviceSn','taskDataJson','createTime','updateTime'];
|
||||
const descriptionFields = ['taskId','deviceSn','taskDataJson','createTime','updateTime'];
|
||||
|
||||
const queryFieldsIndexMap = new Map(queryFields.map((field, index) => [field, index]));
|
||||
export const searchFormSchema: FormSchema[] = schema.properties.filter(item => queryFields.includes(item.field))
|
@ -31,8 +31,8 @@
|
||||
import { useAsyncState } from '@vueuse/core';
|
||||
import { PageHeader, Descriptions, Card } from 'ant-design-vue';
|
||||
import { descriptionColumns } from './schema';
|
||||
import * as EventApi from '@/api/data/eventApi';
|
||||
import { Event } from '@/api/model/event';
|
||||
import * as TaskApi from '@/api/data/taskApi';
|
||||
import { Task } from '@/api/model/task';
|
||||
|
||||
const route = useRoute();
|
||||
const id = ref(route.params?.id);
|
||||
@ -45,7 +45,7 @@
|
||||
isLoading,
|
||||
execute,
|
||||
} = useAsyncState(
|
||||
EventApi.getById(id.value).then((res: Event) => res),
|
||||
TaskApi.getById(id.value).then((res: Task) => res),
|
||||
null,
|
||||
{
|
||||
immediate: false,
|
@ -8,11 +8,11 @@
|
||||
import { BasicForm, useForm } from '@/components/Form/index';
|
||||
import { formSchema } from './schema';
|
||||
import { BasicDrawer, useDrawerInner } from '@/components/Drawer';
|
||||
import * as EventApi from '@/api/data/eventApi';
|
||||
import * as TaskApi from '@/api/data/taskApi';
|
||||
|
||||
const emit = defineEmits(['success', 'register']);
|
||||
const isUpdate = ref(true);
|
||||
const entity = ref();
|
||||
const entity = ref();
|
||||
|
||||
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({
|
||||
labelWidth: 120,
|
||||
@ -42,7 +42,7 @@
|
||||
const {
|
||||
...rest
|
||||
} = values;
|
||||
const action = !unref(isUpdate) ? EventApi.add : EventApi.update;
|
||||
const action = !unref(isUpdate) ? TaskApi.add : TaskApi.update;
|
||||
const data = !unref(isUpdate)
|
||||
? {
|
||||
...rest,
|
@ -1,12 +1,8 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="header">
|
||||
<SvgIcon size="19" name="list" />
|
||||
<div class="title">区域列表</div>
|
||||
</div>
|
||||
<BasicTable @register="registerTable">
|
||||
<template #toolbar>
|
||||
<a-button type="primary" @click="handleCreate" :icon="h(PlusOutlined)">新增</a-button>
|
||||
<a-button type="primary" @click="handleCreate"> 新增</a-button>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.dataIndex === 'action'">
|
||||
@ -16,8 +12,16 @@
|
||||
label: '编辑',
|
||||
icon: 'clarity:note-edit-line',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
divider:true
|
||||
divider: true,
|
||||
},
|
||||
{
|
||||
label: '详情',
|
||||
icon: 'ant-design:eye-outlined',
|
||||
onClick: handleView.bind(null, record),
|
||||
divider: true
|
||||
},
|
||||
]"
|
||||
:dropDownActions="[
|
||||
{
|
||||
label: '删除',
|
||||
icon: 'ant-design:delete-outlined',
|
||||
@ -27,32 +31,32 @@
|
||||
confirm: handleDelete.bind(null, record),
|
||||
placement: 'topRight',
|
||||
},
|
||||
ifShow: hasPermission('AUTH_DATA_TASK:DELETE'),
|
||||
},
|
||||
]"
|
||||
/>
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<RegionDrawer @register="registerDrawer" @success="handleSuccess" />
|
||||
<TaskDrawer @register="registerDrawer" @success="handleSuccess" />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { useGo } from '@/hooks/web/usePage';
|
||||
import { ref } from 'vue';
|
||||
import { Alert,Popconfirm } from 'ant-design-vue';
|
||||
import { useGo } from '@/hooks/web/usePage';
|
||||
import { usePermission } from '@/hooks/web/usePermission';
|
||||
import { BasicTable, useTable, TableAction } from '@/components/Table';
|
||||
import { isObject } from '@/utils/is';
|
||||
import dayjs from 'dayjs';
|
||||
import * as RegionApi from '@/api/system/regionApi';
|
||||
import * as TaskApi from '@/api/data/taskApi';
|
||||
import { useDrawer } from '@/components/Drawer';
|
||||
import RegionDrawer from './drawer.vue';
|
||||
import TaskDrawer from './drawer.vue';
|
||||
import { columns, searchFormSchema } from './schema';
|
||||
import { useMessage } from "@/hooks/web/useMessage";
|
||||
import {SvgIcon} from "@/components/Icon";
|
||||
import {PlusOutlined} from "@ant-design/icons-vue";
|
||||
import {h} from "vue";
|
||||
|
||||
defineOptions({
|
||||
name: 'RegionPage'
|
||||
name: 'AUTH_DATA_TASK'
|
||||
})
|
||||
|
||||
const { createMessage } = useMessage();
|
||||
@ -61,16 +65,17 @@ import {h} from "vue";
|
||||
|
||||
const [registerDrawer, { openDrawer }] = useDrawer();
|
||||
const [registerTable, { reload, setSelectedRowKeys }] = useTable({
|
||||
api: (params) => RegionApi.search(handleParams(params)),
|
||||
title: '检测任务表',
|
||||
api: (params) => TaskApi.search(handleParams(params)),
|
||||
columns,
|
||||
formConfig: {
|
||||
labelWidth: 0,
|
||||
labelWidth: 120,
|
||||
schemas: searchFormSchema,
|
||||
showAdvancedButton: false,
|
||||
},
|
||||
useSearchForm: true,
|
||||
showTableSetting: false,
|
||||
bordered: true,
|
||||
bordered: false,
|
||||
showIndexColumn: false,
|
||||
canResize: false,
|
||||
rowKey: (record: any) => record.id,
|
||||
@ -82,7 +87,7 @@ import {h} from "vue";
|
||||
},
|
||||
});
|
||||
|
||||
const handleParams = (params, embedded = true) => {
|
||||
const handleParams = (params) => {
|
||||
const { pageNum, pageSize, field = 'id', order = 'descend', ...rest } = params;
|
||||
const handledParams: any = { pageNum, pageSize, orderByClause: `${field} ${order === 'descend' ? 'desc' : 'asc'}` };
|
||||
Object.keys(rest).forEach((key) => {
|
||||
@ -92,8 +97,7 @@ import {h} from "vue";
|
||||
if (schema) {
|
||||
if (value !== undefined && value !== '') {
|
||||
if (schema.component === 'Input') {
|
||||
const wildStr = embedded ? "" : "%"
|
||||
handledParams[paramKey] = `${wildStr}${value.trim()}${wildStr}`;
|
||||
handledParams[paramKey] = `%${value.trim()}%`;
|
||||
} else if (['Select', 'ApiSelect', 'ApiTreeSelect'].includes(schema.component)) {
|
||||
handledParams[paramKey] = isObject(value) ? value.value : value;
|
||||
} else if (schema.component === 'RangePicker') {
|
||||
@ -126,20 +130,8 @@ import {h} from "vue";
|
||||
};
|
||||
|
||||
const handleDelete = (record: Recordable) => {
|
||||
RegionApi.remove(record.id).then((_) => {
|
||||
TaskApi.remove(record.id).then((_) => {
|
||||
reload();
|
||||
setSelectedRowKeys([])
|
||||
});
|
||||
};
|
||||
|
||||
const handleBatchDelete = () => {
|
||||
if (checkedKeys.value.length === 0) {
|
||||
createMessage.error('当前未选中任何项目!');
|
||||
return;
|
||||
}
|
||||
RegionApi.batchRemove(checkedKeys.value).then((_) => {
|
||||
reload();
|
||||
setSelectedRowKeys([])
|
||||
});
|
||||
};
|
||||
|
||||
@ -148,8 +140,9 @@ import {h} from "vue";
|
||||
};
|
||||
|
||||
const handleView = (record) => {
|
||||
go('/system/region/detail/' + record.id);
|
||||
go('/data/task/detail/' + record.id);
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped src="@/assets/custom.css" />
|
||||
<style lang="scss" scoped>
|
||||
@use '@/assets/custom.scss';
|
||||
</style>
|
@ -1,9 +1,9 @@
|
||||
/**
|
||||
* 项目:视频监控平台
|
||||
* 项目:中核预埋件检测
|
||||
* 模型分组:数据管理
|
||||
* 模型名称:检测任务表
|
||||
* @Author: xiongwei
|
||||
* @Date: 2024-09-26 11:50:00
|
||||
* @Date: 2024-11-15 11:50:00
|
||||
*/
|
||||
|
||||
import { BasicColumn } from '@/components/Table';
|
||||
@ -16,8 +16,8 @@ const colProps = { xs: { span: 24 }, sm: { span: 24 }, lg: { span: 8 } };
|
||||
const colPropsInDrawer = { span: 24 };
|
||||
|
||||
export const schema = {
|
||||
model: 'DetectTask',
|
||||
viewInPage: false,
|
||||
model: 'Task',
|
||||
viewInPage: true,
|
||||
properties: [
|
||||
{
|
||||
field: 'id',
|
||||
@ -51,19 +51,64 @@ export const schema = {
|
||||
table: {
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'deviceSn',
|
||||
label: '设备序列号',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '设备序列号',
|
||||
},
|
||||
colProps,
|
||||
component: 'Input',
|
||||
},
|
||||
table: {
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'paramJson',
|
||||
label: '任务参数',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '任务参数',
|
||||
},
|
||||
component: 'InputTextArea',
|
||||
colProps: { span: 24 },
|
||||
},
|
||||
table: {
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'resultJson',
|
||||
label: '任务结果',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '任务结果',
|
||||
},
|
||||
component: 'InputTextArea',
|
||||
colProps: { span: 24 },
|
||||
},
|
||||
table: {
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'startTime',
|
||||
label: '开始时间',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
colProps,
|
||||
component: 'DatePicker',
|
||||
component: 'RangePicker',
|
||||
componentProps: {
|
||||
allowClear: false,
|
||||
placeholder: '开始时间',
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD',
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
showTime: false,
|
||||
},
|
||||
rules: [{ required: true, message: '请输入开始时间!' }],
|
||||
},
|
||||
@ -91,16 +136,16 @@ export const schema = {
|
||||
},
|
||||
{
|
||||
field: 'state',
|
||||
label: '状态(0.未开始',
|
||||
label: '状态',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
componentProps: {
|
||||
allowClear: false,
|
||||
placeholder: '状态(0.未开始',
|
||||
placeholder: '状态',
|
||||
},
|
||||
colProps,
|
||||
component: 'InputNumber',
|
||||
rules: [{ required: true, message: '请输入状态(0.未开始!' }],
|
||||
rules: [{ required: true, message: '请输入状态!' }],
|
||||
},
|
||||
table: {
|
||||
},
|
||||
@ -146,10 +191,10 @@ export const schema = {
|
||||
],
|
||||
};
|
||||
|
||||
const queryFields = ['id','name','startTime','endTime','state','createTime','updateTime'];
|
||||
const editFields = ['name','startTime','endTime','state'];
|
||||
const tableFields = ['name','startTime','endTime','state','createTime','updateTime'];
|
||||
const descriptionFields = ['name','startTime','endTime','state','createTime','updateTime'];
|
||||
const queryFields = ['name','deviceSn','startTime','state'];
|
||||
const editFields = ['name','deviceSn','paramJson','resultJson','startTime','endTime','state'];
|
||||
const tableFields = ['name','deviceSn','startTime','endTime','state','createTime','updateTime'];
|
||||
const descriptionFields = ['name','deviceSn','paramJson','resultJson','startTime','endTime','state','createTime','updateTime'];
|
||||
|
||||
const queryFieldsIndexMap = new Map(queryFields.map((field, index) => [field, index]));
|
||||
export const searchFormSchema: FormSchema[] = schema.properties.filter(item => queryFields.includes(item.field))
|
@ -1,31 +1,8 @@
|
||||
<template>
|
||||
<div>
|
||||
<BasicTable @register="registerTable">
|
||||
<template #headerTop>
|
||||
<Alert type="info" show-icon>
|
||||
<template #message>
|
||||
<template v-if="checkedKeys.length > 0">
|
||||
<span>已选中{{ checkedKeys.length }}条记录</span>
|
||||
<a-button type="link" @click="setSelectedRowKeys([])" size="small">清空</a-button>
|
||||
<Popconfirm
|
||||
v-if="hasPermission('AUTH_SYSTEM_AUTHORITY:DELETE')"
|
||||
class="ml-4"
|
||||
title="确定要全部删除吗?"
|
||||
ok-text="是"
|
||||
cancel-text="否"
|
||||
@confirm="handleBatchDelete"
|
||||
>
|
||||
<a href="#" class="text-red-500">删除</a>
|
||||
</Popconfirm>
|
||||
</template>
|
||||
<template v-else>
|
||||
<span>未选中任何项目</span>
|
||||
</template>
|
||||
</template>
|
||||
</Alert>
|
||||
</template>
|
||||
<template #toolbar>
|
||||
<a-button v-auth="'AUTH_SYSTEM_AUTHORITY:ADD'" type="primary" @click="handleCreate"> 新增</a-button>
|
||||
<a-button type="primary" @click="handleCreate"> 新增</a-button>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.dataIndex === 'action'">
|
||||
@ -35,14 +12,13 @@
|
||||
label: '编辑',
|
||||
icon: 'clarity:note-edit-line',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
ifShow: hasPermission('AUTH_SYSTEM_AUTHORITY:EDIT'),
|
||||
divider:true
|
||||
divider: true
|
||||
},
|
||||
{
|
||||
label: '详情',
|
||||
icon: 'ant-design:eye-outlined',
|
||||
onClick: handleView.bind(null, record),
|
||||
divider:true
|
||||
divider: true
|
||||
},
|
||||
]"
|
||||
:dropDownActions="[
|
||||
@ -55,7 +31,6 @@
|
||||
confirm: handleDelete.bind(null, record),
|
||||
placement: 'topRight',
|
||||
},
|
||||
ifShow: hasPermission('AUTH_SYSTEM_AUTHORITY:DELETE'),
|
||||
},
|
||||
]"
|
||||
/>
|
||||
@ -87,11 +62,6 @@
|
||||
const { hasPermission } = usePermission();
|
||||
const go = useGo();
|
||||
|
||||
const checkedKeys = ref<Array<string | number>>([]);
|
||||
const onSelectChange = (selectedRowKeys: (string | number)[]) => {
|
||||
checkedKeys.value = selectedRowKeys.filter(k => typeof k !== 'undefined');
|
||||
}
|
||||
|
||||
const [registerDrawer, { openDrawer }] = useDrawer();
|
||||
const [registerTable, { reload, setSelectedRowKeys }] = useTable({
|
||||
title: '权限表',
|
||||
@ -102,10 +72,6 @@
|
||||
schemas: searchFormSchema,
|
||||
showAdvancedButton: false,
|
||||
},
|
||||
rowSelection: {
|
||||
type: 'checkbox',
|
||||
onChange: onSelectChange,
|
||||
},
|
||||
useSearchForm: true,
|
||||
showTableSetting: false,
|
||||
bordered: true,
|
||||
@ -165,18 +131,6 @@
|
||||
const handleDelete = (record: Recordable) => {
|
||||
AuthorityApi.remove(record.id).then((_) => {
|
||||
reload();
|
||||
setSelectedRowKeys([])
|
||||
});
|
||||
};
|
||||
|
||||
const handleBatchDelete = () => {
|
||||
if (checkedKeys.value.length === 0) {
|
||||
createMessage.error('当前未选中任何项目!');
|
||||
return;
|
||||
}
|
||||
AuthorityApi.batchRemove(checkedKeys.value).then((_) => {
|
||||
reload();
|
||||
setSelectedRowKeys([])
|
||||
});
|
||||
};
|
||||
|
||||
@ -188,4 +142,6 @@
|
||||
go('/system/authority/detail/' + record.id);
|
||||
};
|
||||
</script>
|
||||
<style lang="less" scoped></style>
|
||||
<style lang="scss" scoped>
|
||||
@use '@/assets/custom.scss';
|
||||
</style>
|
||||
|
@ -108,9 +108,9 @@ export const schema = {
|
||||
],
|
||||
};
|
||||
|
||||
const queryFields = ['id','parentId','name','createTime','updateTime'];
|
||||
const queryFields = ['name'];
|
||||
const editFields = ['parentId','name'];
|
||||
const tableFields = ['parentId','name','createTime','updateTime'];
|
||||
const tableFields = ['name','createTime','updateTime'];
|
||||
const descriptionFields = ['parentId','name','createTime','updateTime'];
|
||||
|
||||
const queryFieldsIndexMap = new Map(queryFields.map((field, index) => [field, index]));
|
||||
|
@ -31,8 +31,8 @@
|
||||
import { useAsyncState } from '@vueuse/core';
|
||||
import { PageHeader, Descriptions, Card } from 'ant-design-vue';
|
||||
import { descriptionColumns } from './schema';
|
||||
import * as DetectTaskApi from '@/api/data/detectTaskApi';
|
||||
import { DetectTask } from '@/api/model/detectTask';
|
||||
import * as ConstantApi from '@/api/system/constantApi';
|
||||
import { Constant } from '@/api/model/constant';
|
||||
|
||||
const route = useRoute();
|
||||
const id = ref(route.params?.id);
|
||||
@ -45,7 +45,7 @@
|
||||
isLoading,
|
||||
execute,
|
||||
} = useAsyncState(
|
||||
DetectTaskApi.getById(id.value).then((res: DetectTask) => res),
|
||||
ConstantApi.getById(id.value).then((res: Constant) => res),
|
||||
null,
|
||||
{
|
||||
immediate: false,
|
63
src/views/system/constant/drawer.vue
Normal file
63
src/views/system/constant/drawer.vue
Normal file
@ -0,0 +1,63 @@
|
||||
<template>
|
||||
<BasicDrawer v-bind="$attrs" @register="registerDrawer" showFooter :title="getTitle" width="600px" @ok="handleSubmit">
|
||||
<BasicForm @register="registerForm" />
|
||||
</BasicDrawer>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { defineEmits, ref, computed, unref } from 'vue';
|
||||
import { BasicForm, useForm } from '@/components/Form/index';
|
||||
import { formSchema } from './schema';
|
||||
import { BasicDrawer, useDrawerInner } from '@/components/Drawer';
|
||||
import * as ConstantApi from '@/api/system/constantApi';
|
||||
|
||||
const emit = defineEmits(['success', 'register']);
|
||||
const isUpdate = ref(true);
|
||||
const entity = ref();
|
||||
|
||||
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({
|
||||
labelWidth: 120,
|
||||
schemas: formSchema,
|
||||
showActionButtonGroup: false,
|
||||
});
|
||||
|
||||
const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
|
||||
await resetFields();
|
||||
setDrawerProps({ confirmLoading: false });
|
||||
isUpdate.value = !!data?.isUpdate;
|
||||
entity.value = data?.record;
|
||||
|
||||
if (unref(isUpdate)) {
|
||||
await setFieldsValue({
|
||||
...data.record,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
const getTitle = computed(() => (!unref(isUpdate) ? '新增' : '编辑'));
|
||||
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
const values = await validate();
|
||||
setDrawerProps({ confirmLoading: true });
|
||||
const {
|
||||
...rest
|
||||
} = values;
|
||||
const action = !unref(isUpdate) ? ConstantApi.add : ConstantApi.update;
|
||||
const data = !unref(isUpdate)
|
||||
? {
|
||||
...rest,
|
||||
}
|
||||
: Object.assign({},
|
||||
{
|
||||
...unref(entity),
|
||||
...rest,
|
||||
},
|
||||
);
|
||||
await action(data);
|
||||
closeDrawer();
|
||||
emit('success');
|
||||
} finally {
|
||||
setDrawerProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
</script>
|
@ -1,31 +1,8 @@
|
||||
<template>
|
||||
<div>
|
||||
<BasicTable @register="registerTable">
|
||||
<template #headerTop>
|
||||
<Alert type="info" show-icon>
|
||||
<template #message>
|
||||
<template v-if="checkedKeys.length > 0">
|
||||
<span>已选中{{ checkedKeys.length }}条记录</span>
|
||||
<a-button type="link" @click="setSelectedRowKeys([])" size="small">清空</a-button>
|
||||
<Popconfirm
|
||||
v-if="hasPermission('AUTH_DATA_DETECT_TASK_ITEM:DELETE')"
|
||||
class="ml-4"
|
||||
title="确定要全部删除吗?"
|
||||
ok-text="是"
|
||||
cancel-text="否"
|
||||
@confirm="handleBatchDelete"
|
||||
>
|
||||
<a href="#" class="text-red-500">删除</a>
|
||||
</Popconfirm>
|
||||
</template>
|
||||
<template v-else>
|
||||
<span>未选中任何项目</span>
|
||||
</template>
|
||||
</template>
|
||||
</Alert>
|
||||
</template>
|
||||
<template #toolbar>
|
||||
<a-button v-auth="'AUTH_DATA_DETECT_TASK_ITEM:ADD'" type="primary" @click="handleCreate"> 新增</a-button>
|
||||
<a-button type="primary" @click="handleCreate"> 新增</a-button>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.dataIndex === 'action'">
|
||||
@ -35,14 +12,13 @@
|
||||
label: '编辑',
|
||||
icon: 'clarity:note-edit-line',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
ifShow: hasPermission('AUTH_DATA_DETECT_TASK_ITEM:EDIT'),
|
||||
divider:true
|
||||
divider: true
|
||||
},
|
||||
{
|
||||
label: '详情',
|
||||
icon: 'ant-design:eye-outlined',
|
||||
onClick: handleView.bind(null, record),
|
||||
divider:true
|
||||
divider: true
|
||||
},
|
||||
]"
|
||||
:dropDownActions="[
|
||||
@ -55,14 +31,13 @@
|
||||
confirm: handleDelete.bind(null, record),
|
||||
placement: 'topRight',
|
||||
},
|
||||
ifShow: hasPermission('AUTH_DATA_DETECT_TASK_ITEM:DELETE'),
|
||||
},
|
||||
]"
|
||||
/>
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<DetectTaskItemDrawer @register="registerDrawer" @success="handleSuccess" />
|
||||
<ConstantDrawer @register="registerDrawer" @success="handleSuccess" />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
@ -73,42 +48,33 @@
|
||||
import { BasicTable, useTable, TableAction } from '@/components/Table';
|
||||
import { isObject } from '@/utils/is';
|
||||
import dayjs from 'dayjs';
|
||||
import * as DetectTaskItemApi from '@/api/data/detectTaskItemApi';
|
||||
import * as ConstantApi from '@/api/system/constantApi';
|
||||
import { useDrawer } from '@/components/Drawer';
|
||||
import DetectTaskItemDrawer from './drawer.vue';
|
||||
import ConstantDrawer from './drawer.vue';
|
||||
import { columns, searchFormSchema } from './schema';
|
||||
import { useMessage } from "@/hooks/web/useMessage";
|
||||
|
||||
defineOptions({
|
||||
name: 'AUTH_DATA_DETECT_TASK_ITEM'
|
||||
name: 'AUTH_SYSTEM_CONSTANT'
|
||||
})
|
||||
|
||||
const { createMessage } = useMessage();
|
||||
const { hasPermission } = usePermission();
|
||||
const go = useGo();
|
||||
|
||||
const checkedKeys = ref<Array<string | number>>([]);
|
||||
const onSelectChange = (selectedRowKeys: (string | number)[]) => {
|
||||
checkedKeys.value = selectedRowKeys.filter(k => typeof k !== 'undefined');
|
||||
}
|
||||
|
||||
const [registerDrawer, { openDrawer }] = useDrawer();
|
||||
const [registerTable, { reload, setSelectedRowKeys }] = useTable({
|
||||
title: '任务检测项表',
|
||||
api: (params) => DetectTaskItemApi.search(handleParams(params)),
|
||||
title: '常量表',
|
||||
api: (params) => ConstantApi.search(handleParams(params)),
|
||||
columns,
|
||||
formConfig: {
|
||||
labelWidth: 120,
|
||||
schemas: searchFormSchema,
|
||||
showAdvancedButton: false,
|
||||
},
|
||||
rowSelection: {
|
||||
type: 'checkbox',
|
||||
onChange: onSelectChange,
|
||||
},
|
||||
useSearchForm: true,
|
||||
showTableSetting: false,
|
||||
bordered: true,
|
||||
bordered: false,
|
||||
showIndexColumn: false,
|
||||
canResize: false,
|
||||
rowKey: (record: any) => record.id,
|
||||
@ -163,20 +129,8 @@
|
||||
};
|
||||
|
||||
const handleDelete = (record: Recordable) => {
|
||||
DetectTaskItemApi.remove(record.id).then((_) => {
|
||||
ConstantApi.remove(record.id).then((_) => {
|
||||
reload();
|
||||
setSelectedRowKeys([])
|
||||
});
|
||||
};
|
||||
|
||||
const handleBatchDelete = () => {
|
||||
if (checkedKeys.value.length === 0) {
|
||||
createMessage.error('当前未选中任何项目!');
|
||||
return;
|
||||
}
|
||||
DetectTaskItemApi.batchRemove(checkedKeys.value).then((_) => {
|
||||
reload();
|
||||
setSelectedRowKeys([])
|
||||
});
|
||||
};
|
||||
|
||||
@ -185,7 +139,9 @@
|
||||
};
|
||||
|
||||
const handleView = (record) => {
|
||||
go('/data/detect-task-item/detail/' + record.id);
|
||||
go('/system/constant/detail/' + record.id);
|
||||
};
|
||||
</script>
|
||||
<style lang="less" scoped></style>
|
||||
<style lang="scss" scoped>
|
||||
@use '@/assets/custom.scss';
|
||||
</style>
|
@ -1,19 +1,22 @@
|
||||
/**
|
||||
* 项目:视频监控平台
|
||||
* 项目:中核预埋件检测
|
||||
* 模型分组:用户管理
|
||||
* 模型名称:区域表
|
||||
* 模型名称:常量表
|
||||
* @Author: xiongwei
|
||||
* @Date: 2024-09-26 11:50:00
|
||||
* @Date: 2024-11-15 11:50:00
|
||||
*/
|
||||
|
||||
import { BasicColumn } from '@/components/Table';
|
||||
import { FormSchema } from '@/components/Table';
|
||||
|
||||
const colProps = { xs: { span: 12 }, sm: { span: 12 }, lg: { span: 6 } };
|
||||
|
||||
|
||||
|
||||
const colProps = { xs: { span: 24 }, sm: { span: 24 }, lg: { span: 8 } };
|
||||
const colPropsInDrawer = { span: 24 };
|
||||
|
||||
export const schema = {
|
||||
model: 'Region',
|
||||
model: 'Constant',
|
||||
viewInPage: false,
|
||||
properties: [
|
||||
{
|
||||
@ -34,16 +37,16 @@ export const schema = {
|
||||
},
|
||||
{
|
||||
field: 'code',
|
||||
label: '编号',
|
||||
label: '编码',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '编号',
|
||||
allowClear: false,
|
||||
placeholder: '编码',
|
||||
},
|
||||
colProps,
|
||||
component: 'Input',
|
||||
rules: [{ required: true, message: '请输入编号!' }],
|
||||
rules: [{ required: true, message: '请输入编码!' }],
|
||||
},
|
||||
table: {
|
||||
},
|
||||
@ -54,7 +57,7 @@ export const schema = {
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
allowClear: false,
|
||||
placeholder: '名称',
|
||||
},
|
||||
colProps,
|
||||
@ -64,9 +67,25 @@ export const schema = {
|
||||
table: {
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'description',
|
||||
label: '描述',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
componentProps: {
|
||||
allowClear: false,
|
||||
placeholder: '描述',
|
||||
},
|
||||
component: 'InputTextArea',
|
||||
colProps: { span: 24 },
|
||||
rules: [{ required: true, message: '请输入描述!' }],
|
||||
},
|
||||
table: {
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
label: '创建时间',
|
||||
label: 'CreateTime',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
colProps,
|
||||
@ -85,7 +104,7 @@ export const schema = {
|
||||
},
|
||||
{
|
||||
field: 'updateTime',
|
||||
label: '更新时间',
|
||||
label: 'UpdateTime',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
colProps,
|
||||
@ -105,10 +124,10 @@ export const schema = {
|
||||
],
|
||||
};
|
||||
|
||||
const queryFields = ['name','code'];
|
||||
const editFields = ['name','code'];
|
||||
const tableFields = ['name','code','createTime','updateTime'];
|
||||
const descriptionFields = ['name','code','createTime','updateTime'];
|
||||
const queryFields = ['code','name',];
|
||||
const editFields = ['code','name','description'];
|
||||
const tableFields = ['code','name','description','createTime','updateTime'];
|
||||
const descriptionFields = ['code','name','description','createTime','updateTime'];
|
||||
|
||||
const queryFieldsIndexMap = new Map(queryFields.map((field, index) => [field, index]));
|
||||
export const searchFormSchema: FormSchema[] = schema.properties.filter(item => queryFields.includes(item.field))
|
||||
@ -121,7 +140,6 @@ export const searchFormSchema: FormSchema[] = schema.properties.filter(item => q
|
||||
...formProps,
|
||||
required: false,
|
||||
rules: [{ required: false }],
|
||||
// resetButtonOptions: { disabled: true },
|
||||
} as FormSchema),
|
||||
)
|
||||
.sort((a, b) => {
|
@ -1,173 +0,0 @@
|
||||
<template>
|
||||
<BasicDrawer v-bind="$attrs" @register="registerDrawer" showFooter :title="getTitle" width="600px" @ok="handleSubmit">
|
||||
<BasicForm @register="registerForm" name="EditForm"/>
|
||||
</BasicDrawer>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { defineEmits, ref, computed, unref } from 'vue';
|
||||
import { BasicForm, useForm } from '@/components/Form/index';
|
||||
import { formSchema } from './schema';
|
||||
import { BasicDrawer, useDrawerInner } from '@/components/Drawer';
|
||||
import * as DeviceApi from '@/api/system/deviceApi';
|
||||
import dayjs from "dayjs";
|
||||
|
||||
const emit = defineEmits(['success', 'register']);
|
||||
const isUpdate = ref(true);
|
||||
const entity = ref();
|
||||
|
||||
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({
|
||||
labelWidth: 120,
|
||||
schemas: formSchema,
|
||||
showActionButtonGroup: false,
|
||||
});
|
||||
|
||||
const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
|
||||
await resetFields();
|
||||
setDrawerProps({ confirmLoading: false });
|
||||
isUpdate.value = !!data?.isUpdate;
|
||||
entity.value = data?.record;
|
||||
|
||||
if (unref(isUpdate)) {
|
||||
await setFieldsValue({
|
||||
...data.record,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
const getTitle = computed(() => (!unref(isUpdate) ? '新增' : '编辑'));
|
||||
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
const values = await validate();
|
||||
setDrawerProps({ confirmLoading: true });
|
||||
const {
|
||||
...rest
|
||||
} = values;
|
||||
const action = !unref(isUpdate) ? DeviceApi.add : DeviceApi.update;
|
||||
const data = !unref(isUpdate)
|
||||
? {
|
||||
...rest,
|
||||
}
|
||||
: Object.assign({},
|
||||
{
|
||||
...unref(entity),
|
||||
...rest,
|
||||
updateTime: dayjs().format('YYYY-MM-DD HH:mm:ss')
|
||||
},
|
||||
);
|
||||
await action(data);
|
||||
closeDrawer();
|
||||
emit('success');
|
||||
} finally {
|
||||
setDrawerProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
:deep(.ant-form-item-label) {
|
||||
width: 10px;
|
||||
}
|
||||
|
||||
:deep(.ant-form-item-label > label) {
|
||||
font-family: "Noto Sans SC", serif;
|
||||
font-size: 14px;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
:deep(.ant-input-affix-wrapper) {
|
||||
height: 36px;
|
||||
border-radius: 6px;
|
||||
background-color: rgba(45,119,243,0.2);
|
||||
border: 1px solid rgba(45,119,243,0.3);
|
||||
}
|
||||
|
||||
:deep(.ant-input-affix-wrapper:hover),
|
||||
:deep(.ant-input-affix-wrapper:focus) {
|
||||
background-color: rgba(45,119,243,0.3);
|
||||
border: 1px solid rgba(45,119,243,0.4);
|
||||
}
|
||||
|
||||
:deep(.ant-input) {
|
||||
font-family: "Noto Sans SC", serif;
|
||||
font-size: 14px;
|
||||
color: #FFFFFF;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
:deep(.ant-input::placeholder) {
|
||||
font-family: "Noto Sans SC", serif;
|
||||
font-size: 14px;
|
||||
color: #AAAAAA;
|
||||
}
|
||||
|
||||
:deep(.ant-input-clear-icon) {
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
:deep(.ant-input-password-icon) {
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
:deep(.ant-select-selector) {
|
||||
border: 1px solid rgba(45,119,243,0.3) !important;
|
||||
background-color: rgba(45,119,243,0.2) !important;
|
||||
height: 36px !important;
|
||||
}
|
||||
|
||||
:deep(.ant-select-single.ant-select-sm:not(.ant-select-customize-input) .ant-select-selector) {
|
||||
width: 100%;
|
||||
height: 36px;
|
||||
padding: 1px 11px 0 11px;
|
||||
}
|
||||
|
||||
:deep(.ant-select .ant-select-selection-placeholder) {
|
||||
font-family: "Noto Sans SC", serif;
|
||||
font-size: 14px;
|
||||
color: #aaaaaa;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
:deep(.ant-select-selector .ant-select-selection-item) {
|
||||
font-family: "Noto Sans SC", serif;
|
||||
font-size: 14px;
|
||||
color: #ffffff;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
:deep(.ant-select-selection-item) {
|
||||
font-family: "Noto Sans SC", serif;
|
||||
font-size: 14px;
|
||||
color: #ffffff;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
:deep(.ant-select-open .ant-select-selection-item) {
|
||||
color: #aaaaaa;
|
||||
}
|
||||
|
||||
:deep(.ant-select .ant-select-arrow) {
|
||||
padding-top: 2px;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
:deep(.ant-select-dropdown) {
|
||||
border-radius: 6px !important;
|
||||
border: 1px solid #183171 !important;
|
||||
background-color: #13265a !important;
|
||||
}
|
||||
|
||||
:deep(.ant-select-item-option-content) {
|
||||
font-family: "Noto Sans SC", serif;
|
||||
font-size: 14px;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
:deep(.ant-select-item-option-active) {
|
||||
background-color: rgba(146,214,237,0.3) !important;
|
||||
}
|
||||
|
||||
:deep(.ant-select-item-option-selected) {
|
||||
font-weight: normal !important;
|
||||
background-color: rgba(146,214,237,0.4) !important;
|
||||
}
|
||||
</style>
|
@ -1,497 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="header">
|
||||
<SvgIcon size="19" name="list" />
|
||||
<div class="title">区域列表</div>
|
||||
</div>
|
||||
<BasicTable @register="registerTable">
|
||||
<template #toolbar>
|
||||
<a-button type="primary" @click="handleCreate" :icon="h(PlusOutlined)">新增</a-button>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.dataIndex === 'action'">
|
||||
<TableAction
|
||||
:actions="[
|
||||
{
|
||||
label: '编辑',
|
||||
icon: 'clarity:note-edit-line',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
divider:true
|
||||
},
|
||||
{
|
||||
label: '详情',
|
||||
icon: 'ant-design:eye-outlined',
|
||||
onClick: handleView.bind(null, record),
|
||||
divider:true
|
||||
},
|
||||
{
|
||||
label: '删除',
|
||||
icon: 'ant-design:delete-outlined',
|
||||
color: 'error',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
placement: 'topRight',
|
||||
},
|
||||
}
|
||||
]"
|
||||
/>
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<DeviceDrawer @register="registerDrawer" @success="handleSuccess" />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import {h, ref} from 'vue';
|
||||
import { Alert,Popconfirm } from 'ant-design-vue';
|
||||
import { useGo } from '@/hooks/web/usePage';
|
||||
import { usePermission } from '@/hooks/web/usePermission';
|
||||
import { BasicTable, useTable, TableAction } from '@/components/Table';
|
||||
import { isObject } from '@/utils/is';
|
||||
import dayjs from 'dayjs';
|
||||
import * as DeviceApi from '@/api/system/deviceApi';
|
||||
import { useDrawer } from '@/components/Drawer';
|
||||
import DeviceDrawer from './drawer.vue';
|
||||
import { columns, searchFormSchema } from './schema';
|
||||
import { useMessage } from "@/hooks/web/useMessage";
|
||||
import {SvgIcon} from "@/components/Icon";
|
||||
import {PlusOutlined} from "@ant-design/icons-vue";
|
||||
|
||||
defineOptions({
|
||||
name: 'DevicePage'
|
||||
})
|
||||
|
||||
const { createMessage } = useMessage();
|
||||
const { hasPermission } = usePermission();
|
||||
const go = useGo();
|
||||
|
||||
const [registerDrawer, { openDrawer }] = useDrawer();
|
||||
const [registerTable, { reload, setSelectedRowKeys }] = useTable({
|
||||
api: (params) => DeviceApi.search(handleParams(params)),
|
||||
columns,
|
||||
formConfig: {
|
||||
labelWidth: 0,
|
||||
schemas: searchFormSchema,
|
||||
showAdvancedButton: false,
|
||||
},
|
||||
useSearchForm: true,
|
||||
showTableSetting: false,
|
||||
bordered: true,
|
||||
showIndexColumn: false,
|
||||
canResize: false,
|
||||
rowKey: (record: any) => record.id,
|
||||
actionColumn: {
|
||||
width: 240,
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
fixed: 'right',
|
||||
},
|
||||
});
|
||||
|
||||
const handleParams = (params, embedded = true) => {
|
||||
const { pageNum, pageSize, field = 'id', order = 'descend', ...rest } = params;
|
||||
const handledParams: any = { pageNum, pageSize, orderByClause: `${field} ${order === 'descend' ? 'desc' : 'asc'}` };
|
||||
Object.keys(rest).forEach((key) => {
|
||||
const schema = searchFormSchema.find((item) => item.field === key);
|
||||
const value = params[key];
|
||||
const paramKey = key;
|
||||
if (schema) {
|
||||
if (value !== undefined && value !== '') {
|
||||
if (schema.component === 'Input') {
|
||||
const wildStr = embedded ? "" : "%"
|
||||
handledParams[paramKey] = `${wildStr}${value.trim()}${wildStr}`;
|
||||
} else if (['Select', 'ApiSelect', 'ApiTreeSelect'].includes(schema.component)) {
|
||||
handledParams[paramKey] = isObject(value) ? value.value : value;
|
||||
} else if (schema.component === 'RangePicker') {
|
||||
handledParams[`${paramKey}From`] = dayjs(value[0]).startOf('d').format('YYYY-MM-DD HH:mm:ss');
|
||||
handledParams[`${paramKey}To`] = dayjs(value[1]).endOf('d').format('YYYY-MM-DD HH:mm:ss');
|
||||
} else if (schema.component === 'DatePicker') {
|
||||
handledParams[paramKey] = dayjs(value).format((schema.componentProps as any).format || 'YYYY-MM-DD');
|
||||
} else {
|
||||
handledParams[paramKey] = value;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
handledParams[paramKey] = value;
|
||||
}
|
||||
});
|
||||
return handledParams;
|
||||
};
|
||||
|
||||
const handleCreate = () => {
|
||||
openDrawer(true, {
|
||||
isUpdate: false,
|
||||
});
|
||||
};
|
||||
|
||||
const handleEdit = (record: Recordable) => {
|
||||
openDrawer(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
});
|
||||
};
|
||||
|
||||
const handleDelete = (record: Recordable) => {
|
||||
DeviceApi.remove(record.id).then((_) => {
|
||||
reload();
|
||||
setSelectedRowKeys([])
|
||||
});
|
||||
};
|
||||
|
||||
const handleBatchDelete = () => {
|
||||
if (checkedKeys.value.length === 0) {
|
||||
createMessage.error('当前未选中任何项目!');
|
||||
return;
|
||||
}
|
||||
DeviceApi.batchRemove(checkedKeys.value).then((_) => {
|
||||
reload();
|
||||
setSelectedRowKeys([])
|
||||
});
|
||||
};
|
||||
|
||||
const handleSuccess = () => {
|
||||
reload();
|
||||
};
|
||||
|
||||
const handleView = (record) => {
|
||||
go('/system/device/detail/' + record.id);
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.header {
|
||||
padding: 5px 20px;
|
||||
height: 50px;
|
||||
display: flex;
|
||||
background-color: rgba(45, 119, 243, 0.2);
|
||||
align-items: center;
|
||||
|
||||
.title {
|
||||
font-family: "Noto Sans SC", serif;
|
||||
font-size: 14px;
|
||||
color: #FFFFFF;
|
||||
padding-left: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.ant-form) {
|
||||
background-color: transparent;
|
||||
padding: 0;
|
||||
margin: 10px 20px 2px 10px;
|
||||
}
|
||||
|
||||
:deep(.ant-form-item-label) {
|
||||
width: 10px;
|
||||
}
|
||||
|
||||
:deep(.ant-form-item-label > label) {
|
||||
font-family: "Noto Sans SC", serif;
|
||||
font-size: 14px;
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
:deep(.ant-input-affix-wrapper) {
|
||||
height: 36px;
|
||||
border-radius: 6px;
|
||||
background-color: rgba(45,119,243,0.2);
|
||||
border: 1px solid rgba(45,119,243,0.3);
|
||||
}
|
||||
|
||||
:deep(.ant-input-affix-wrapper:hover),
|
||||
:deep(.ant-input-affix-wrapper:focus) {
|
||||
background-color: rgba(45,119,243,0.3);
|
||||
border: 1px solid rgba(45,119,243,0.4);
|
||||
}
|
||||
|
||||
:deep(.ant-input) {
|
||||
font-family: "Noto Sans SC", serif;
|
||||
font-size: 14px;
|
||||
color: #FFFFFF;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
:deep(.ant-input::placeholder) {
|
||||
font-family: "Noto Sans SC", serif;
|
||||
font-size: 14px;
|
||||
color: #AAAAAA;
|
||||
}
|
||||
|
||||
:deep(.ant-btn-default) {
|
||||
font-family: "Noto Sans SC", serif;
|
||||
font-size: 14px;
|
||||
color: #FFFFFF;
|
||||
background-color: rgba(58,98,203,0.8);
|
||||
box-shadow: inset 0 0 20px 2px #3A62CB;
|
||||
height: 36px;
|
||||
border-radius: 6px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
:deep(.ant-btn-default:hover) {
|
||||
font-family: "Noto Sans SC", serif;
|
||||
font-size: 14px;
|
||||
color: #FFFFFF;
|
||||
background-color: rgba(58,98,203,0.8);
|
||||
box-shadow: inset 0 0 20px 2px #006CC6;
|
||||
height: 36px;
|
||||
border-radius: 6px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
:deep(.ant-btn-primary) {
|
||||
font-family: "Noto Sans SC", serif;
|
||||
font-size: 14px;
|
||||
color: #FFFFFF;
|
||||
background-color: #3793d4;
|
||||
box-shadow: inset 0 0 20px 2px #006CC6;
|
||||
height: 36px;
|
||||
border-radius: 6px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
:deep(.ant-btn-primary:hover) {
|
||||
font-family: "Noto Sans SC", serif;
|
||||
font-size: 14px;
|
||||
color: #FFFFFF;
|
||||
background-color: rgba(69,175,223,0.8);
|
||||
box-shadow: inset 0 0 20px 2px #006CC6;
|
||||
height: 36px;
|
||||
border-radius: 6px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
:deep(.vben-basic-table .ant-table-wrapper) {
|
||||
background-color: transparent;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
:deep(.ant-spin-container) {
|
||||
margin: 0 5px;
|
||||
}
|
||||
|
||||
:deep(.ant-table.ant-table-middle) {
|
||||
border-radius: 0;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
:deep(.vben-basic-table .ant-table-wrapper .ant-table.ant-table-bordered .ant-table-title) {
|
||||
padding-top: 8px !important;
|
||||
border-radius: 0;
|
||||
background-color: rgba(45,119,243,0.2);
|
||||
}
|
||||
|
||||
:deep(.ant-table-wrapper .ant-table.ant-table-bordered >.ant-table-container) {
|
||||
border-inline-start: 1px solid rgba(45,119,243,0.3) !important;
|
||||
}
|
||||
|
||||
:deep(.ant-table-wrapper .ant-table.ant-table-bordered >.ant-table-container >.ant-table-content >table),
|
||||
:deep(.ant-table-wrapper .ant-table.ant-table-bordered >.ant-table-container >.ant-table-header >table) {
|
||||
border-top: 1px solid rgba(45,119,243,0.3) !important;
|
||||
}
|
||||
|
||||
:deep(.ant-table-cell) {
|
||||
background-color: #0d1540;
|
||||
}
|
||||
|
||||
:deep(.ant-table-wrapper .ant-table.ant-table-bordered >.ant-table-container >.ant-table-content >table >thead>tr>th),
|
||||
:deep(.ant-table-wrapper .ant-table.ant-table-bordered >.ant-table-container >.ant-table-header >table >thead>tr>th),
|
||||
:deep(.ant-table-wrapper .ant-table.ant-table-bordered >.ant-table-container >.ant-table-body >table >thead>tr>th),
|
||||
:deep(.ant-table-wrapper .ant-table.ant-table-bordered >.ant-table-container >.ant-table-summary >table >thead>tr>th),
|
||||
:deep(.ant-table-wrapper .ant-table.ant-table-bordered >.ant-table-container >.ant-table-content >table >tbody>tr>td),
|
||||
:deep(.ant-table-wrapper .ant-table.ant-table-bordered >.ant-table-container >.ant-table-header >table >tbody>tr>td),
|
||||
:deep(.ant-table-wrapper .ant-table.ant-table-bordered >.ant-table-container >.ant-table-body >table >tbody>tr>td),
|
||||
:deep(.ant-table-wrapper .ant-table.ant-table-bordered >.ant-table-container >.ant-table-summary >table >tbody>tr>td),
|
||||
:deep(.ant-table-wrapper .ant-table.ant-table-bordered >.ant-table-container >.ant-table-content >table >tfoot>tr>th),
|
||||
:deep(.ant-table-wrapper .ant-table.ant-table-bordered >.ant-table-container >.ant-table-header >table >tfoot>tr>th),
|
||||
:deep(.ant-table-wrapper .ant-table.ant-table-bordered >.ant-table-container >.ant-table-body >table >tfoot>tr>th),
|
||||
:deep(.ant-table-wrapper .ant-table.ant-table-bordered >.ant-table-container >.ant-table-summary >table >tfoot>tr>th),
|
||||
:deep(.ant-table-wrapper .ant-table.ant-table-bordered >.ant-table-container >.ant-table-content >table >tfoot>tr>td),
|
||||
:deep(.ant-table-wrapper .ant-table.ant-table-bordered >.ant-table-container >.ant-table-header >table >tfoot>tr>td),
|
||||
:deep(.ant-table-wrapper .ant-table.ant-table-bordered >.ant-table-container >.ant-table-body >table >tfoot>tr>td),
|
||||
:deep(.ant-table-wrapper .ant-table.ant-table-bordered >.ant-table-container >.ant-table-summary >table >tfoot>tr>td) {
|
||||
border-inline-end: 1px solid rgba(45,119,243,0.3) !important;
|
||||
}
|
||||
|
||||
:deep(.ant-table-wrapper .ant-table-tbody >tr.ant-table-row:hover>td),
|
||||
:deep(.ant-table-wrapper .ant-table-tbody >tr >td.ant-table-cell-row-hover) {
|
||||
background: #273c62 !important;
|
||||
}
|
||||
|
||||
:deep(.ant-table-wrapper .ant-table.ant-table-bordered >.ant-table-container >.ant-table-content >table >thead>tr>th),
|
||||
:deep(.ant-table-wrapper .ant-table.ant-table-bordered >.ant-table-container >.ant-table-body >table >thead>tr>th) {
|
||||
font-family: "Noto Sans SC", serif;
|
||||
font-size: 14px;
|
||||
font-weight: normal;
|
||||
color: #ffffff;
|
||||
border-bottom: none;
|
||||
background: #13265a !important;
|
||||
}
|
||||
|
||||
:deep(.ant-table-wrapper .ant-table-cell-ellipsis.ant-table-cell-fix-right-first) {
|
||||
overflow: hidden !important;
|
||||
border-left: 1px solid rgba(45,119,243,0.3);
|
||||
}
|
||||
|
||||
:deep(.ant-table-tbody >tr >td) {
|
||||
font-family: "Noto Sans SC", serif;
|
||||
font-size: 14px;
|
||||
color: #ffffff;
|
||||
border-bottom: 1px solid rgba(45,119,243,0.3) !important;
|
||||
}
|
||||
|
||||
:deep(.ant-pagination-total-text) {
|
||||
font-family: "Noto Sans SC", serif;
|
||||
font-size: 14px;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
:deep(.ant-pagination.ant-pagination-mini .ant-pagination-item) {
|
||||
min-width: 28px;
|
||||
height: 28px;
|
||||
margin: 0;
|
||||
line-height: 26px;
|
||||
}
|
||||
|
||||
:deep(.ant-pagination .ant-pagination-item-active:hover) {
|
||||
border-color: rgba(45,119,243,0.3) !important;
|
||||
background: rgba(45,119,243,0.2) !important;
|
||||
}
|
||||
|
||||
:deep(.ant-pagination .ant-pagination-item-active) {
|
||||
font-weight: bold;
|
||||
border-color: rgba(45,119,243,0.4) !important;
|
||||
background: rgba(45,119,243,0.3) !important;
|
||||
}
|
||||
|
||||
:deep(.ant-pagination .ant-pagination-item a) {
|
||||
font-family: "Noto Sans SC", serif;
|
||||
font-size: 14px;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
:deep(.ant-pagination.ant-pagination-mini .ant-pagination-prev),
|
||||
:deep(.ant-pagination.ant-pagination-mini .ant-pagination-next) {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
padding-top: 2px;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
:deep(.ant-pagination.ant-pagination-mini .ant-pagination-options-quick-jumper) {
|
||||
height: 28px;
|
||||
line-height: 28px;
|
||||
font-family: "Noto Sans SC", serif;
|
||||
font-size: 14px;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
:deep(.ant-select-selector) {
|
||||
border: 1px solid rgba(45,119,243,0.3) !important;
|
||||
background-color: rgba(45,119,243,0.2) !important;
|
||||
height: 36px !important;
|
||||
}
|
||||
|
||||
:deep(.ant-pagination-options .ant-select-selector) {
|
||||
height: 28px !important;
|
||||
}
|
||||
|
||||
:deep(.ant-select:not(.ant-select-disabled):not(.ant-select-customize-input):not(.ant-pagination-size-changer):hover .ant-select-selector) {
|
||||
border: 1px solid rgba(45,119,243,0.4) !important;
|
||||
background-color: rgba(45,119,243,0.3) !important;
|
||||
}
|
||||
|
||||
:deep(.ant-select-single.ant-select-sm:not(.ant-select-customize-input) .ant-select-selector) {
|
||||
width: 100%;
|
||||
height: 36px;
|
||||
padding: 1px 11px 0 11px;
|
||||
}
|
||||
|
||||
:deep(.ant-select .ant-select-selection-placeholder) {
|
||||
font-family: "Noto Sans SC", serif;
|
||||
font-size: 14px;
|
||||
color: #aaaaaa;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
:deep(.ant-select-selector .ant-select-selection-item) {
|
||||
font-family: "Noto Sans SC", serif;
|
||||
font-size: 14px;
|
||||
color: #ffffff;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
:deep(.ant-select-selection-item) {
|
||||
font-family: "Noto Sans SC", serif;
|
||||
font-size: 14px;
|
||||
color: #ffffff;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
:deep(.ant-select-open .ant-select-selection-item) {
|
||||
color: #aaaaaa;
|
||||
}
|
||||
|
||||
:deep(.ant-select .ant-select-arrow) {
|
||||
padding-top: 2px;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
:deep(.ant-select-dropdown) {
|
||||
border-radius: 6px !important;
|
||||
border: 1px solid #183171 !important;
|
||||
background-color: #13265a !important;
|
||||
}
|
||||
|
||||
:deep(.ant-select-item-option-content) {
|
||||
font-family: "Noto Sans SC", serif;
|
||||
font-size: 14px;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
:deep(.ant-select-item-option-active) {
|
||||
background-color: rgba(146,214,237,0.3) !important;
|
||||
}
|
||||
|
||||
:deep(.ant-select-item-option-selected) {
|
||||
font-weight: normal !important;
|
||||
background-color: rgba(146,214,237,0.4) !important;
|
||||
}
|
||||
|
||||
:deep(.ant-empty-description) {
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
:deep(.ant-pagination-options-quick-jumper) {
|
||||
& > input {
|
||||
font-family: "Noto Sans SC", serif;
|
||||
font-size: 14px;
|
||||
color: #FFFFFF;
|
||||
height: 26px !important;
|
||||
line-height: 26px;
|
||||
background-color: rgba(45, 119, 243, 0.2);
|
||||
border: 1px solid rgba(45, 119, 243, 0.3);
|
||||
}
|
||||
|
||||
& > input:hover,
|
||||
& > input:focus {
|
||||
background-color: rgba(45, 119, 243, 0.3);
|
||||
border: 1px solid rgba(45, 119, 243, 0.4);
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.ant-input-clear-icon) {
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
:deep(.ant-input-password-icon) {
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
:deep(.ant-select-clear) {
|
||||
color: white !important;
|
||||
background: transparent !important;
|
||||
}
|
||||
//.ant-select-clear-icon {
|
||||
//}
|
||||
</style>
|
@ -1,380 +0,0 @@
|
||||
/**
|
||||
* 项目:视频监控平台
|
||||
* 模型分组:用户管理
|
||||
* 模型名称:设备表
|
||||
* @Author: xiongwei
|
||||
* @Date: 2024-09-26 11:50:00
|
||||
*/
|
||||
|
||||
import { BasicColumn } from '@/components/Table';
|
||||
import { FormSchema } from '@/components/Table';
|
||||
import * as RegionApi from "@/api/system/regionApi";
|
||||
|
||||
const colProps = { xs: { span: 24 }, sm: { span: 24 }, lg: { span: 6 } };
|
||||
const colPropsInDrawer = { span: 24 };
|
||||
|
||||
export const schema = {
|
||||
model: 'Device',
|
||||
viewInPage: true,
|
||||
properties: [
|
||||
{
|
||||
field: 'id',
|
||||
label: 'ID系统自动生成',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
componentProps: {
|
||||
allowClear: false,
|
||||
placeholder: 'ID系统自动生成',
|
||||
},
|
||||
colProps,
|
||||
component: 'InputNumber',
|
||||
rules: [{ required: true, message: '请输入ID系统自动生成!' }],
|
||||
},
|
||||
table: {
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'regionId',
|
||||
label: '区域',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
colProps,
|
||||
component: 'ApiSelect',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '请选择区域',
|
||||
api: (_) => RegionApi.all(),
|
||||
labelField: 'name',
|
||||
valueField: 'id',
|
||||
},
|
||||
rules: [{ required: true, message: '请选择区域!' }],
|
||||
},
|
||||
table: {
|
||||
customRender: ({ text, record }) => record.region ? record.region.name : text,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'name',
|
||||
label: '设备名称',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '设备名称',
|
||||
},
|
||||
colProps,
|
||||
component: 'Input',
|
||||
rules: [{ required: true, message: '请输入设备名称!' }],
|
||||
},
|
||||
table: {
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'deviceIp',
|
||||
label: '设备IP',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '设备IP地址',
|
||||
},
|
||||
colProps,
|
||||
component: 'Input',
|
||||
},
|
||||
table: {
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'devicePort',
|
||||
label: '设备端口',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '设备端口',
|
||||
},
|
||||
colProps,
|
||||
component: 'Input',
|
||||
},
|
||||
table: {
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'deviceUsername',
|
||||
label: '用户名',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '用户名',
|
||||
},
|
||||
colProps,
|
||||
component: 'Input',
|
||||
},
|
||||
table: {
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'devicePassword',
|
||||
label: '密码',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '密码',
|
||||
},
|
||||
colProps,
|
||||
component: 'InputPassword',
|
||||
},
|
||||
table: {
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'deviceType',
|
||||
label: '设备类型',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '设备类型',
|
||||
},
|
||||
colProps,
|
||||
component: 'Input',
|
||||
},
|
||||
table: {
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'softwareVersion',
|
||||
label: '软件版本',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '软件版本',
|
||||
},
|
||||
colProps,
|
||||
component: 'Input',
|
||||
},
|
||||
table: {
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'firmwareVersion',
|
||||
label: '固件版本',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '固件版本',
|
||||
},
|
||||
colProps,
|
||||
component: 'Input',
|
||||
},
|
||||
table: {
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'algorithmVersion',
|
||||
label: '算法版本',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '算法版本',
|
||||
},
|
||||
colProps,
|
||||
component: 'Input',
|
||||
},
|
||||
table: {
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'modelVersion',
|
||||
label: '模型版本',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '模型版本',
|
||||
},
|
||||
colProps,
|
||||
component: 'Input',
|
||||
},
|
||||
table: {
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'cameraIp',
|
||||
label: '相机IP地址',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '相机IP地址',
|
||||
},
|
||||
colProps,
|
||||
component: 'Input',
|
||||
},
|
||||
table: {
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'cameraUsername',
|
||||
label: '相机用户名',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '相机用户名',
|
||||
},
|
||||
colProps,
|
||||
component: 'Input',
|
||||
},
|
||||
table: {
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'cameraPassword',
|
||||
label: '相机密码',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '相机密码',
|
||||
},
|
||||
colProps,
|
||||
component: 'InputPassword',
|
||||
},
|
||||
table: {
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'cameraRtsp',
|
||||
label: '相机rtsp完整地址',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '相机rtsp完整地址',
|
||||
},
|
||||
colProps,
|
||||
component: 'Input',
|
||||
},
|
||||
table: {
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
label: '创建时间',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
colProps,
|
||||
componentProps: {
|
||||
allowClear: false,
|
||||
placeholder: ['开始时间', '结束时间'],
|
||||
format: 'YYYY-MM-DD',
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
showTime: false,
|
||||
},
|
||||
component: 'RangePicker',
|
||||
rules: [{ required: true, message: '请输入CreateTime!' }],
|
||||
},
|
||||
table: {
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'updateTime',
|
||||
label: '更新时间',
|
||||
defaultValue: undefined,
|
||||
form: {
|
||||
colProps,
|
||||
componentProps: {
|
||||
allowClear: false,
|
||||
placeholder: ['开始时间', '结束时间'],
|
||||
format: 'YYYY-MM-DD',
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
showTime: false,
|
||||
},
|
||||
component: 'RangePicker',
|
||||
rules: [{ required: true, message: '请输入UpdateTime!' }],
|
||||
},
|
||||
table: {
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const queryFields = ['regionId','name','deviceIp'];
|
||||
const editFields = ['regionId','name','deviceIp','devicePort','deviceUsername','devicePassword','deviceType','softwareVersion','firmwareVersion','algorithmVersion','modelVersion','cameraIp','cameraUsername','cameraPassword','cameraRtsp'];
|
||||
const tableFields = ['regionId','name','deviceIp','devicePort','deviceUsername','devicePassword','deviceType','softwareVersion','firmwareVersion','algorithmVersion','modelVersion','cameraIp','cameraUsername','cameraPassword','cameraRtsp','createTime','updateTime'];
|
||||
const descriptionFields = ['regionId','name','deviceIp','devicePort','deviceUsername','devicePassword','deviceType','softwareVersion','firmwareVersion','algorithmVersion','modelVersion','cameraIp','cameraUsername','cameraPassword','cameraRtsp','createTime','updateTime'];
|
||||
|
||||
const queryFieldsIndexMap = new Map(queryFields.map((field, index) => [field, index]));
|
||||
export const searchFormSchema: FormSchema[] = schema.properties.filter(item => queryFields.includes(item.field))
|
||||
.map(
|
||||
({ field, label, form: { ...formProps } }) =>
|
||||
({
|
||||
field,
|
||||
label,
|
||||
defaultValue: undefined,
|
||||
...formProps,
|
||||
required: false,
|
||||
rules: [{ required: false }],
|
||||
} as FormSchema),
|
||||
)
|
||||
.sort((a, b) => {
|
||||
const indexA = queryFieldsIndexMap.get(a.field) as number;
|
||||
const indexB = queryFieldsIndexMap.get(b.field) as number;
|
||||
return indexA - indexB;
|
||||
});
|
||||
|
||||
const editFieldsIndexMap = new Map(editFields.map((field, index) => [field, index]));
|
||||
export const formSchema: FormSchema[] = schema.properties.filter(item => editFields.includes(item.field))
|
||||
.map(
|
||||
({ field, label, defaultValue, form }) =>
|
||||
({
|
||||
field,
|
||||
label,
|
||||
defaultValue,
|
||||
...form,
|
||||
colProps: colPropsInDrawer,
|
||||
} as FormSchema),
|
||||
)
|
||||
.sort((a, b) => {
|
||||
const indexA = editFieldsIndexMap.get(a.field) as number;
|
||||
const indexB = editFieldsIndexMap.get(b.field) as number;
|
||||
return indexA - indexB;
|
||||
});
|
||||
|
||||
const tableFieldsIndexMap = new Map(tableFields.map((field, index) => [field, index]));
|
||||
export const columns: BasicColumn[] = schema.properties.filter(item => tableFields.includes(item.field))
|
||||
.map(
|
||||
({ field, label, table }) =>
|
||||
({
|
||||
dataIndex: field,
|
||||
title: label,
|
||||
...table,
|
||||
} as BasicColumn)
|
||||
)
|
||||
.sort((a, b) => {
|
||||
const indexA = tableFieldsIndexMap.get(a.dataIndex as string) as number;
|
||||
const indexB = tableFieldsIndexMap.get(b.dataIndex as string) as number;
|
||||
return indexA - indexB;
|
||||
});
|
||||
|
||||
const descriptionFieldsIndexMap = new Map(descriptionFields.map((field, index) => [field, index]));
|
||||
export const descriptionColumns: BasicColumn[] = schema.properties.filter(item => descriptionFields.includes(item.field))
|
||||
.map(
|
||||
({ field, label, table }) =>
|
||||
({
|
||||
dataIndex: field,
|
||||
title: label,
|
||||
...table,
|
||||
} as BasicColumn),
|
||||
)
|
||||
.sort((a, b) => {
|
||||
const indexA = descriptionFieldsIndexMap.get(a.dataIndex as string) as number;
|
||||
const indexB = descriptionFieldsIndexMap.get(b.dataIndex as string) as number;
|
||||
return indexA - indexB;
|
||||
});
|
@ -8,7 +8,7 @@
|
||||
{
|
||||
label: '详情',
|
||||
icon: 'ant-design:eye-outlined',
|
||||
divider:true
|
||||
divider: true,
|
||||
},
|
||||
{
|
||||
label: '删除',
|
||||
@ -119,18 +119,6 @@
|
||||
const handleDelete = (record: Recordable) => {
|
||||
LogApi.remove(record.id).then((_) => {
|
||||
reload();
|
||||
setSelectedRowKeys([])
|
||||
});
|
||||
};
|
||||
|
||||
const handleBatchDelete = () => {
|
||||
if (checkedKeys.value.length === 0) {
|
||||
createMessage.error('当前未选中任何项目!');
|
||||
return;
|
||||
}
|
||||
LogApi.batchRemove(checkedKeys.value).then((_) => {
|
||||
reload();
|
||||
setSelectedRowKeys([])
|
||||
});
|
||||
};
|
||||
|
||||
@ -142,4 +130,6 @@
|
||||
go('/system/log/detail/' + record.id);
|
||||
};
|
||||
</script>
|
||||
<style lang="less" scoped></style>
|
||||
<style lang="scss" scoped>
|
||||
@use '@/assets/custom.scss';
|
||||
</style>
|
||||
|
@ -119,7 +119,7 @@ export const schema = {
|
||||
],
|
||||
};
|
||||
|
||||
const queryFields = ['userId','description','createTime'];
|
||||
const queryFields = ['createTime'];
|
||||
const editFields = ['description','userId','remark'];
|
||||
const tableFields = ['username','description','remark','createTime'];
|
||||
const descriptionFields = ['description','userId','username','remark','createTime'];
|
||||
|
@ -1,31 +1,8 @@
|
||||
<template>
|
||||
<div>
|
||||
<BasicTable @register="registerTable">
|
||||
<template #headerTop>
|
||||
<Alert type="info" show-icon>
|
||||
<template #message>
|
||||
<template v-if="checkedKeys.length > 0">
|
||||
<span>已选中{{ checkedKeys.length }}条记录</span>
|
||||
<a-button type="link" @click="setSelectedRowKeys([])" size="small">清空</a-button>
|
||||
<Popconfirm
|
||||
v-if="hasPermission('AUTH_SYSTEM_USER_AUTHORITY:DELETE')"
|
||||
class="ml-4"
|
||||
title="确定要全部删除吗?"
|
||||
ok-text="是"
|
||||
cancel-text="否"
|
||||
@confirm="handleBatchDelete"
|
||||
>
|
||||
<a href="#" class="text-red-500">删除</a>
|
||||
</Popconfirm>
|
||||
</template>
|
||||
<template v-else>
|
||||
<span>未选中任何项目</span>
|
||||
</template>
|
||||
</template>
|
||||
</Alert>
|
||||
</template>
|
||||
<template #toolbar>
|
||||
<a-button v-auth="'AUTH_SYSTEM_USER_AUTHORITY:ADD'" type="primary" @click="handleCreate"> 新增</a-button>
|
||||
<a-button type="primary" @click="handleCreate"> 新增</a-button>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.dataIndex === 'action'">
|
||||
@ -35,14 +12,13 @@
|
||||
label: '编辑',
|
||||
icon: 'clarity:note-edit-line',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
ifShow: hasPermission('AUTH_SYSTEM_USER_AUTHORITY:EDIT'),
|
||||
divider:true
|
||||
divider: true,
|
||||
},
|
||||
{
|
||||
label: '详情',
|
||||
icon: 'ant-design:eye-outlined',
|
||||
onClick: handleView.bind(null, record),
|
||||
divider:true
|
||||
divider: true,
|
||||
},
|
||||
]"
|
||||
:dropDownActions="[
|
||||
@ -55,7 +31,6 @@
|
||||
confirm: handleDelete.bind(null, record),
|
||||
placement: 'topRight',
|
||||
},
|
||||
ifShow: hasPermission('AUTH_SYSTEM_USER_AUTHORITY:DELETE'),
|
||||
},
|
||||
]"
|
||||
/>
|
||||
@ -87,11 +62,6 @@
|
||||
const { hasPermission } = usePermission();
|
||||
const go = useGo();
|
||||
|
||||
const checkedKeys = ref<Array<string | number>>([]);
|
||||
const onSelectChange = (selectedRowKeys: (string | number)[]) => {
|
||||
checkedKeys.value = selectedRowKeys.filter(k => typeof k !== 'undefined');
|
||||
}
|
||||
|
||||
const [registerDrawer, { openDrawer }] = useDrawer();
|
||||
const [registerTable, { reload, setSelectedRowKeys }] = useTable({
|
||||
title: '用户权限对应表',
|
||||
@ -102,10 +72,6 @@
|
||||
schemas: searchFormSchema,
|
||||
showAdvancedButton: false,
|
||||
},
|
||||
rowSelection: {
|
||||
type: 'checkbox',
|
||||
onChange: onSelectChange,
|
||||
},
|
||||
useSearchForm: true,
|
||||
showTableSetting: false,
|
||||
bordered: true,
|
||||
@ -165,18 +131,6 @@
|
||||
const handleDelete = (record: Recordable) => {
|
||||
UserAuthorityApi.remove(record.id).then((_) => {
|
||||
reload();
|
||||
setSelectedRowKeys([])
|
||||
});
|
||||
};
|
||||
|
||||
const handleBatchDelete = () => {
|
||||
if (checkedKeys.value.length === 0) {
|
||||
createMessage.error('当前未选中任何项目!');
|
||||
return;
|
||||
}
|
||||
UserAuthorityApi.batchRemove(checkedKeys.value).then((_) => {
|
||||
reload();
|
||||
setSelectedRowKeys([])
|
||||
});
|
||||
};
|
||||
|
||||
@ -188,4 +142,6 @@
|
||||
go('/system/user-authority/detail/' + record.id);
|
||||
};
|
||||
</script>
|
||||
<style lang="less" scoped></style>
|
||||
<style lang="scss" scoped>
|
||||
@use '@/assets/custom.scss';
|
||||
</style>
|
||||
|
@ -121,4 +121,4 @@ async function handleSubmit() {
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped src="@/assets/custom.css" />
|
||||
<style lang="scss" scoped src="@/assets/custom.scss" />
|
||||
|
@ -16,7 +16,7 @@
|
||||
label: '编辑',
|
||||
icon: 'clarity:note-edit-line',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
divider:true,
|
||||
divider: true,
|
||||
disabled: record.username === 'admin'
|
||||
},
|
||||
{
|
||||
@ -121,4 +121,6 @@ import {PlusOutlined} from "@ant-design/icons-vue";
|
||||
},
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped src="@/assets/custom.css" />
|
||||
<style lang="scss" scoped>
|
||||
@use '@/assets/custom.scss';
|
||||
</style>
|
||||
|
2
types/index.d.ts
vendored
2
types/index.d.ts
vendored
@ -27,3 +27,5 @@ declare type ComponentRef<T extends HTMLElement = HTMLDivElement> = ComponentElR
|
||||
declare type ElRef<T extends HTMLElement = HTMLDivElement> = Nullable<T>;
|
||||
|
||||
declare let AMap: any;
|
||||
|
||||
declare interface DeviceClientService {}
|
||||
|
Loading…
Reference in New Issue
Block a user