|
@@ -1,14 +1,14 @@
|
|
|
import { defHttp } from '/@/utils/http/axios';
|
|
|
-import { useMessage } from "/@/hooks/web/useMessage";
|
|
|
+import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
|
|
|
const { createConfirm } = useMessage();
|
|
|
|
|
|
enum Api {
|
|
|
list = '/adweb/adwebEnquiry/list',
|
|
|
- save='/adweb/adwebEnquiry/add',
|
|
|
- edit='/adweb/adwebEnquiry/edit',
|
|
|
+ save = '/adweb/adwebEnquiry/add',
|
|
|
+ edit = '/adweb/adwebEnquiry/edit',
|
|
|
deleteOne = '/adweb/adwebEnquiry/delete',
|
|
|
- deleteBatch = '/adweb/adwebEnquiry/deleteBatch',
|
|
|
+ deleteBatch = '/adweb/adwebEnquiry/delBatch',
|
|
|
importExcel = '/adweb/adwebEnquiry/importExcel',
|
|
|
exportXls = '/adweb/adwebEnquiry/exportXls',
|
|
|
}
|
|
@@ -35,11 +35,11 @@ export const list = (params) => defHttp.get({ url: Api.list, params });
|
|
|
* @param params
|
|
|
* @param handleSuccess
|
|
|
*/
|
|
|
-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();
|
|
|
});
|
|
|
-}
|
|
|
+};
|
|
|
|
|
|
/**
|
|
|
* 批量删除
|
|
@@ -54,12 +54,12 @@ export const batchDelete = (params, handleSuccess) => {
|
|
|
okText: '确认',
|
|
|
cancelText: '取消',
|
|
|
onOk: () => {
|
|
|
- return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
|
|
|
+ return defHttp.get({ url: Api.deleteBatch, params }).then(() => {
|
|
|
handleSuccess();
|
|
|
});
|
|
|
- }
|
|
|
+ },
|
|
|
});
|
|
|
-}
|
|
|
+};
|
|
|
|
|
|
/**
|
|
|
* 保存或者更新
|
|
@@ -67,6 +67,6 @@ export const batchDelete = (params, handleSuccess) => {
|
|
|
* @param isUpdate
|
|
|
*/
|
|
|
export const saveOrUpdate = (params, isUpdate) => {
|
|
|
- let url = isUpdate ? Api.edit : Api.save;
|
|
|
+ const url = isUpdate ? Api.edit : Api.save;
|
|
|
return defHttp.post({ url: url, params }, { isTransformResponse: false });
|
|
|
-}
|
|
|
+};
|