|
|
@ -1,16 +1,17 @@ |
|
|
|
import {defHttp} from '/@/utils/http/axios'; |
|
|
|
import { useMessage } from "/@/hooks/web/useMessage"; |
|
|
|
import { defHttp } from '/@/utils/http/axios'; |
|
|
|
import { useMessage } from '/@/hooks/web/useMessage'; |
|
|
|
|
|
|
|
const { createConfirm } = useMessage(); |
|
|
|
|
|
|
|
enum Api { |
|
|
|
list = '/productCategory/appCategory/list', |
|
|
|
save='/productCategory/appCategory/add', |
|
|
|
edit='/productCategory/appCategory/edit', |
|
|
|
save = '/productCategory/appCategory/add', |
|
|
|
edit = '/productCategory/appCategory/edit', |
|
|
|
deleteOne = '/productCategory/appCategory/delete', |
|
|
|
deleteBatch = '/productCategory/appCategory/deleteBatch', |
|
|
|
importExcel = '/productCategory/appCategory/importExcel', |
|
|
|
exportXls = '/productCategory/appCategory/exportXls', |
|
|
|
allProductCagegoryList = '/productCategory/appCategory/queryList', |
|
|
|
} |
|
|
|
/** |
|
|
|
* 导出api |
|
|
@ -25,17 +26,22 @@ export const getImportUrl = Api.importExcel; |
|
|
|
* 列表接口 |
|
|
|
* @param params |
|
|
|
*/ |
|
|
|
export const list = (params) => |
|
|
|
defHttp.get({url: Api.list, params}); |
|
|
|
export const list = (params) => defHttp.get({ url: Api.list, params }); |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询产品分类列表 |
|
|
|
* @param params |
|
|
|
*/ |
|
|
|
export const allProductCagegoryList = (params) => defHttp.get({ url: Api.allProductCagegoryList, params }); |
|
|
|
|
|
|
|
/** |
|
|
|
* 删除单个 |
|
|
|
*/ |
|
|
|
export const deleteOne = (params,handleSuccess) => { |
|
|
|
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { |
|
|
|
export const deleteOne = (params, handleSuccess) => { |
|
|
|
return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => { |
|
|
|
handleSuccess(); |
|
|
|
}); |
|
|
|
} |
|
|
|
}; |
|
|
|
/** |
|
|
|
* 批量删除 |
|
|
|
* @param params |
|
|
@ -48,17 +54,17 @@ export const batchDelete = (params, handleSuccess) => { |
|
|
|
okText: '确认', |
|
|
|
cancelText: '取消', |
|
|
|
onOk: () => { |
|
|
|
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { |
|
|
|
return defHttp.delete({ url: Api.deleteBatch, data: params }, { joinParamsToUrl: true }).then(() => { |
|
|
|
handleSuccess(); |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
}); |
|
|
|
} |
|
|
|
}; |
|
|
|
/** |
|
|
|
* 保存或者更新 |
|
|
|
* @param params |
|
|
|
*/ |
|
|
|
export const saveOrUpdate = (params, isUpdate) => { |
|
|
|
let url = isUpdate ? Api.edit : Api.save; |
|
|
|
return defHttp.post({url: url, params}); |
|
|
|
} |
|
|
|
const url = isUpdate ? Api.edit : Api.save; |
|
|
|
return defHttp.post({ url: url, params }); |
|
|
|
}; |