feat(@vben/web-antd): 新增巡检模板管理模块
- 新增巡检检查项模板 API(CRUD + 批量排序) - 左侧功能类型分类面板 + 右侧检查项表格 - 支持拖拽排序检查项顺序 - 支持启用/停用状态切换(带确认弹窗) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
79
apps/web-antd/src/api/ops/inspection-template/index.ts
Normal file
79
apps/web-antd/src/api/ops/inspection-template/index.ts
Normal file
@@ -0,0 +1,79 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
import type { FunctionType } from '#/api/ops/area';
|
||||
|
||||
export namespace InspectionTemplateApi {
|
||||
/** 巡检检查项模板 */
|
||||
export interface Template {
|
||||
id?: number;
|
||||
/** 功能类型 */
|
||||
functionType: FunctionType;
|
||||
/** 检查项标题 */
|
||||
itemTitle: string;
|
||||
/** 检查项描述 */
|
||||
itemDescription?: string;
|
||||
/** 排序号 */
|
||||
sortOrder?: number;
|
||||
/** 启用状态 */
|
||||
isActive?: boolean;
|
||||
/** 创建时间 */
|
||||
createTime?: string;
|
||||
/** 更新时间 */
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/** 分页查询参数 */
|
||||
export interface TemplatePageQuery {
|
||||
functionType?: FunctionType;
|
||||
itemTitle?: string;
|
||||
enabled?: boolean;
|
||||
pageNo?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
/** 分页结果 */
|
||||
export interface PageResult {
|
||||
list: Template[];
|
||||
total: number;
|
||||
}
|
||||
}
|
||||
|
||||
// ========== 巡检检查项模板 API ==========
|
||||
|
||||
/** 获取模板分页 */
|
||||
export function getTemplatePage(params: InspectionTemplateApi.TemplatePageQuery) {
|
||||
return requestClient.get<InspectionTemplateApi.PageResult>(
|
||||
'/ops/inspection/template/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取模板详情 */
|
||||
export function getTemplate(id: number) {
|
||||
return requestClient.get<InspectionTemplateApi.Template>(
|
||||
'/ops/inspection/template/get',
|
||||
{ params: { id } },
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增模板 */
|
||||
export function createTemplate(data: InspectionTemplateApi.Template) {
|
||||
return requestClient.post<number>('/ops/inspection/template/create', data);
|
||||
}
|
||||
|
||||
/** 更新模板 */
|
||||
export function updateTemplate(data: InspectionTemplateApi.Template) {
|
||||
return requestClient.put('/ops/inspection/template/update', data);
|
||||
}
|
||||
|
||||
/** 删除模板 */
|
||||
export function deleteTemplate(id: number) {
|
||||
return requestClient.delete<boolean>('/ops/inspection/template/delete', {
|
||||
params: { id },
|
||||
});
|
||||
}
|
||||
|
||||
/** 批量更新排序 */
|
||||
export function updateTemplateSortBatch(ids: number[]) {
|
||||
return requestClient.put('/ops/inspection/template/update-sort-batch', ids);
|
||||
}
|
||||
Reference in New Issue
Block a user