feat: 完成设备类型
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run

This commit is contained in:
fyy
2025-07-16 16:44:54 +08:00
parent a6cc9b783e
commit 37324d04e6
11 changed files with 1361 additions and 0 deletions

View File

@@ -0,0 +1,68 @@
import type { MachineTypeVO, MachineTypeForm, MachineTypeQuery,MachineTypeTree } from './model';
import type { ID, IDS } from '#/api/common';
import type { PageResult } from '#/api/common';
import { commonExport } from '#/api/helper';
import { requestClient } from '#/api/request';
/**
* 查询设备类型列表
* @param params
* @returns 设备类型列表
*/
export function machineTypeList(params?: MachineTypeQuery) {
return requestClient.get<PageResult<MachineTypeVO>>('/property/machineType/list', { params });
}
/**
* 查询设备类型树
* @param params
* @returns 设备类型树
*/
export function getMachineTypeTree() {
return requestClient.get<MachineTypeTree[]>('/property/machineType/typeTree');
}
/**
* 导出设备类型列表
* @param params
* @returns 设备类型列表
*/
export function machineTypeExport(params?: MachineTypeQuery) {
return commonExport('/property/machineType/export', params ?? {});
}
/**
* 查询设备类型详情
* @param id id
* @returns 设备类型详情
*/
export function machineTypeInfo(id: ID) {
return requestClient.get<MachineTypeVO>(`/property/machineType/${id}`);
}
/**
* 新增设备类型
* @param data
* @returns void
*/
export function machineTypeAdd(data: MachineTypeForm) {
return requestClient.postWithMsg<void>('/property/machineType', data);
}
/**
* 更新设备类型
* @param data
* @returns void
*/
export function machineTypeUpdate(data: MachineTypeForm) {
return requestClient.putWithMsg<void>('/property/machineType', data);
}
/**
* 删除设备类型
* @param id id
* @returns void
*/
export function machineTypeRemove(id: ID | IDS) {
return requestClient.deleteWithMsg<void>(`/property/machineType/${id}`);
}

View File

@@ -0,0 +1,130 @@
import type { PageQuery, BaseEntity } from '#/api/common';
export interface MachineTypeVO {
/**
* 主键
*/
id: string | number;
/**
* 类型名称
*/
machineTypeName: string;
/**
* 类型编号
*/
machineTypeCode: string;
/**
* 上级类型
*/
parentTypeId: string | number;
/**
* 是否启用
*/
isEnable: string;
/**
* 备注
*/
remark: string;
/**
* 搜索值
*/
searchValue: string;
}
export interface MachineTypeForm extends BaseEntity {
/**
* 主键
*/
id?: string | number;
/**
* 类型名称
*/
machineTypeName?: string;
/**
* 类型编号
*/
machineTypeCode?: string;
/**
* 上级类型
*/
parentTypeId?: string | number;
/**
* 是否启用
*/
isEnable?: string;
/**
* 备注
*/
remark?: string;
/**
* 搜索值
*/
searchValue?: string;
}
export interface MachineTypeQuery extends PageQuery {
/**
* 类型名称
*/
machineTypeName?: string;
/**
* 类型编号
*/
machineTypeCode?: string;
/**
* 上级类型
*/
parentTypeId?: string | number;
/**
* 是否启用
*/
isEnable?: string;
/**
* 搜索值
*/
searchValue?: string;
/**
* 日期范围参数
*/
params?: any;
}
/**
* @description: 设备类型树
*/
export interface MachineTypeTree {
id: number;
/**
* antd组件必须要这个属性 实际是没有这个属性的
*/
key: string;
parentId: number;
label: string;
weight: number;
children?: MachineTypeTree[];
}
export interface MachineTypeTreeData {
id: number;
label: string;
children?: MachineTypeTreeData[];
}

View File

@@ -0,0 +1,61 @@
import type { MaintainTaskDetailVO, MaintainTaskDetailForm, MaintainTaskDetailQuery } from './model';
import type { ID, IDS } from '#/api/common';
import type { PageResult } from '#/api/common';
import { commonExport } from '#/api/helper';
import { requestClient } from '#/api/request';
/**
* 查询保养明细列表
* @param params
* @returns 保养明细列表
*/
export function maintainTaskDetailList(params?: MaintainTaskDetailQuery) {
return requestClient.get<PageResult<MaintainTaskDetailVO>>('/property/maintainTaskDetail/list', { params });
}
/**
* 导出保养明细列表
* @param params
* @returns 保养明细列表
*/
export function maintainTaskDetailExport(params?: MaintainTaskDetailQuery) {
return commonExport('/property/maintainTaskDetail/export', params ?? {});
}
/**
* 查询保养明细详情
* @param id id
* @returns 保养明细详情
*/
export function maintainTaskDetailInfo(id: ID) {
return requestClient.get<MaintainTaskDetailVO>(`/property/maintainTaskDetail/${id}`);
}
/**
* 新增保养明细
* @param data
* @returns void
*/
export function maintainTaskDetailAdd(data: MaintainTaskDetailForm) {
return requestClient.postWithMsg<void>('/property/maintainTaskDetail', data);
}
/**
* 更新保养明细
* @param data
* @returns void
*/
export function maintainTaskDetailUpdate(data: MaintainTaskDetailForm) {
return requestClient.putWithMsg<void>('/property/maintainTaskDetail', data);
}
/**
* 删除保养明细
* @param id id
* @returns void
*/
export function maintainTaskDetailRemove(id: ID | IDS) {
return requestClient.deleteWithMsg<void>(`/property/maintainTaskDetail/${id}`);
}

View File

@@ -0,0 +1,114 @@
import type { PageQuery, BaseEntity } from '#/api/common';
export interface MaintainTaskDetailVO {
/**
* 主键
*/
id: string | number;
/**
* 任务id
*/
taskId: string | number;
/**
* 位置编号
*/
machineId: string | number;
/**
* 保养情况
*/
sendFlag: string;
/**
* 排序
*/
sortNumber: number;
/**
* 状态(0未开始,1已完成)
*/
state: string;
/**
* 搜索值
*/
searchValue: string;
}
export interface MaintainTaskDetailForm extends BaseEntity {
/**
* 主键
*/
id?: string | number;
/**
* 任务id
*/
taskId?: string | number;
/**
* 位置编号
*/
machineId?: string | number;
/**
* 保养情况
*/
sendFlag?: string;
/**
* 排序
*/
sortNumber?: number;
/**
* 状态(0未开始,1已完成)
*/
state?: string;
/**
* 搜索值
*/
searchValue?: string;
}
export interface MaintainTaskDetailQuery extends PageQuery {
/**
* 任务id
*/
taskId?: string | number;
/**
* 位置编号
*/
machineId?: string | number;
/**
* 保养情况
*/
sendFlag?: string;
/**
* 排序
*/
sortNumber?: number;
/**
* 状态(0未开始,1已完成)
*/
state?: string;
/**
* 搜索值
*/
searchValue?: string;
/**
* 日期范围参数
*/
params?: any;
}