mirror of
https://gitee.com/dapppp/ruoyi-plus-vben5.git
synced 2026-03-18 17:38:49 +08:00
重构项目中所有使用requestClient的API调用,替换为alovaInstance 移除已废弃的旧版上传组件及相关代码 调整上传组件类型定义以适配antdv-next更新 优化上传逻辑,移除不必要的进度事件和取消信号 更新类型定义文件,迁移axios配置到alova类型
76 lines
1.6 KiB
TypeScript
76 lines
1.6 KiB
TypeScript
import type { Client } from './model';
|
|
|
|
import type { ID, IDS, PageQuery, PageResult } from '#/api/common';
|
|
|
|
import { commonExport } from '#/api/helper';
|
|
import { alovaInstance } from '#/utils/http';
|
|
|
|
enum Api {
|
|
clientChangeStatus = '/system/client/changeStatus',
|
|
clientExport = '/system/client/export',
|
|
clientList = '/system/client/list',
|
|
root = '/system/client',
|
|
}
|
|
|
|
/**
|
|
* 查询客户端分页列表
|
|
* @param params 请求参数
|
|
* @returns 列表
|
|
*/
|
|
export function clientList(params?: PageQuery) {
|
|
return alovaInstance.get<PageResult<Client>>(Api.clientList, { params });
|
|
}
|
|
|
|
/**
|
|
* 导出客户端excel
|
|
* @param data 请求参数
|
|
*/
|
|
export function clientExport(data: Partial<Client>) {
|
|
return commonExport(Api.clientExport, data);
|
|
}
|
|
|
|
/**
|
|
* 客户端详情
|
|
* @param id id
|
|
* @returns 详情
|
|
*/
|
|
export function clientInfo(id: ID) {
|
|
return alovaInstance.get<Client>(`${Api.root}/${id}`);
|
|
}
|
|
|
|
/**
|
|
* 客户端新增
|
|
* @param data 参数
|
|
*/
|
|
export function clientAdd(data: Partial<Client>) {
|
|
return alovaInstance.postWithMsg<void>(Api.root, data);
|
|
}
|
|
|
|
/**
|
|
* 客户端修改
|
|
* @param data 参数
|
|
*/
|
|
export function clientUpdate(data: Partial<Client>) {
|
|
return alovaInstance.putWithMsg<void>(Api.root, data);
|
|
}
|
|
|
|
/**
|
|
* 客户端状态修改
|
|
* @param data 状态
|
|
*/
|
|
export function clientChangeStatus(data: any) {
|
|
const requestData = {
|
|
clientId: data.clientId,
|
|
status: data.status,
|
|
};
|
|
return alovaInstance.putWithMsg<void>(Api.clientChangeStatus, requestData);
|
|
}
|
|
|
|
/**
|
|
* 客户端删除
|
|
* @param ids id集合
|
|
*/
|
|
export function clientRemove(ids: IDS) {
|
|
return alovaInstance.deleteWithMsg<void>(`${Api.root}/${ids}`);
|
|
}
|