| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- import { request } from '../utils/axios';
- export interface PadLockTypeVO {
- lockTypeId?: number;
- parentTypeId?: number;
- lockTypeCode: string;
- lockTypeName: string;
- enableFlag?: string;
- remark?: string;
- createBy?: string;
- createTime?: Date;
- updateBy?: string;
- updateTime?: Date;
- }
- export interface PageParam {
- pageNo: number;
- pageSize: number;
- lockTypeCode?: string;
- lockTypeName?: string;
- enableFlag?: string;
- }
- // 分页响应类型
- export interface PageResponse<T> {
- list: T[];
- total: number;
- }
- // 挂锁类型管理 API
- export const padLockTypeApi = {
- // 查询挂锁类型-列表
- listPadLockType: async (params: PageParam): Promise<PageResponse<PadLockTypeVO>> => {
- const response = await request.get({
- url: '/iscs/lock-type/getLockTypePage',
- params
- });
-
- // 处理响应数据格式
- if (response && typeof response === 'object') {
- if ('data' in response && response.data) {
- return response.data;
- } else if ('list' in response || 'records' in response) {
- return {
- list: response.list || response.records || [],
- total: response.total || 0,
- };
- }
- }
- return response;
- },
- // 获取挂锁类型详细信息
- getPadLockTypeInfo: async (id: number): Promise<PadLockTypeVO> => {
- const response = await request.get({
- url: '/iscs/lock-type/selectLockTypeById',
- params: { id }
- });
- return response?.data || response;
- },
- // 新增挂锁类型
- addPadLockType: async (data: PadLockTypeVO): Promise<void> => {
- return await request.post({
- url: '/iscs/lock-type/insertLockType',
- data
- });
- },
- // 修改挂锁类型信息
- updatePadLockType: async (data: PadLockTypeVO): Promise<void> => {
- return await request.put({
- url: '/iscs/lock-type/updateLockType',
- data
- });
- },
- // 删除挂锁类型信息
- delPadLockType: async (ids: number | number[]): Promise<void> => {
- const idsParam = Array.isArray(ids) ? ids.join(',') : ids;
- return await request.delete({
- url: `/iscs/lock-type/deleteLockTypeList?ids=${idsParam}`,
- });
- },
- };
|