|
@@ -1,11 +1,13 @@
|
|
|
import { defHttp } from '/@/utils/http/axios';
|
|
|
import { Modal } from 'ant-design-vue';
|
|
|
-
|
|
|
+import { useMessage } from "/@/hooks/web/useMessage";
|
|
|
+const { createConfirm } = useMessage();
|
|
|
enum Api {
|
|
|
list = '/baseCode/baseProductClass/list',
|
|
|
save = '/baseCode/baseProductClass/add',
|
|
|
edit = '/baseCode/baseProductClass/edit',
|
|
|
deleteDict = '/baseCode/baseProductClass/delete',
|
|
|
+ deleteBatch = 'baseCode/baseProductClass/deleteBatch',
|
|
|
}
|
|
|
|
|
|
export const list = (params) => defHttp.get({ url: Api.list, params });
|
|
@@ -28,4 +30,23 @@ export const deleteDict = (params, handleSuccess) => {
|
|
|
return defHttp.delete({ url: Api.deleteDict, params }, { joinParamsToUrl: true }).then(() => {
|
|
|
handleSuccess();
|
|
|
});
|
|
|
-};
|
|
|
+};
|
|
|
+
|
|
|
+/**
|
|
|
+ * 批量删除
|
|
|
+ * @param params
|
|
|
+ */
|
|
|
+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();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|