更新VSCode配置,启用Maven支持,设置Java 17环境,调整MybatisPlusSaasConfig以开启系统租户控制并添加新租户表。更新pom.xml以包含新模块jeecg-module-xslmes,优化Vue3环境配置以统一API路径,增强代理设置以支持完整的后端路径。修复useForm钩子中的字段重置逻辑,改进axios配置以处理相对URL的上下文路径问题。
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/xslmes/mesXslCustomer/list',
|
||||
queryById = '/xslmes/mesXslCustomer/queryById',
|
||||
save = '/xslmes/mesXslCustomer/add',
|
||||
edit = '/xslmes/mesXslCustomer/edit',
|
||||
updateStatus = '/xslmes/mesXslCustomer/updateStatus',
|
||||
deleteOne = '/xslmes/mesXslCustomer/delete',
|
||||
deleteBatch = '/xslmes/mesXslCustomer/deleteBatch',
|
||||
importExcel = '/xslmes/mesXslCustomer/importExcel',
|
||||
exportXls = '/xslmes/mesXslCustomer/exportXls',
|
||||
}
|
||||
|
||||
export const getExportUrl = Api.exportXls;
|
||||
export const getImportUrl = Api.importExcel;
|
||||
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
|
||||
export const queryById = (params: { id: string }) => defHttp.get({ url: Api.queryById, params });
|
||||
|
||||
export const deleteOne = (params, handleSuccess) => {
|
||||
return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
};
|
||||
|
||||
export const batchDelete = (params, handleSuccess) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
return defHttp.delete({ url: Api.deleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
export const saveOrUpdate = (params, isUpdate) => {
|
||||
const url = isUpdate ? Api.edit : Api.save;
|
||||
return defHttp.post({ url, params });
|
||||
};
|
||||
|
||||
/** 启用/停用:status 0 启用 1 停用(与供应商管理 MesXslSupplier.api.updateStatus 一致) */
|
||||
export const updateStatus = (params: { id: string; status: string }, handleSuccess?: () => void) => {
|
||||
return defHttp.post({ url: Api.updateStatus, params }, { joinParamsToUrl: true }).then(() => {
|
||||
handleSuccess?.();
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user