批量分配教室
This commit is contained in:
parent
04b8fa5cbc
commit
e58fe6f13f
|
@ -1,12 +1,12 @@
|
|||
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 = '/cet/classRoom/list',
|
||||
save='/cet/classRoom/add',
|
||||
edit='/cet/classRoom/edit',
|
||||
save = '/cet/classRoom/add',
|
||||
edit = '/cet/classRoom/edit',
|
||||
deleteOne = '/cet/classRoom/delete',
|
||||
deleteBatch = '/cet/classRoom/deleteBatch',
|
||||
importExcel = '/cet/classRoom/importExcel',
|
||||
|
@ -25,17 +25,16 @@ 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 });
|
||||
|
||||
/**
|
||||
* 删除单个
|
||||
*/
|
||||
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 +47,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 });
|
||||
};
|
||||
|
|
|
@ -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 = '/cet/cetGroup/list',
|
||||
save='/cet/cetGroup/add',
|
||||
edit='/cet/cetGroup/edit',
|
||||
save = '/cet/cetGroup/add',
|
||||
edit = '/cet/cetGroup/edit',
|
||||
deleteOne = '/cet/cetGroup/delete',
|
||||
deleteBatch = '/cet/cetGroup/deleteBatch',
|
||||
importExcel = '/cet/cetGroup/importExcel',
|
||||
exportXls = '/cet/cetGroup/exportXls',
|
||||
batchHandleClassRooms = '/cet/cetGroup/batchHandleClassRoom',
|
||||
}
|
||||
/**
|
||||
* 导出api
|
||||
|
@ -25,17 +26,16 @@ 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 });
|
||||
|
||||
/**
|
||||
* 删除单个
|
||||
*/
|
||||
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 +48,35 @@ 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 batchHandleClassRoom = (params, handleSuccess) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '确认分配教室',
|
||||
content: '是否对选中数据进行分配教室',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
return defHttp.post({ url: Api.batchHandleClassRooms, 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 });
|
||||
};
|
||||
|
|
|
@ -10,6 +10,10 @@
|
|||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item key="1" @click="batchHandleClassRooms">
|
||||
<Icon icon="ant-design:delete-outlined" />
|
||||
批量分配教室
|
||||
</a-menu-item>
|
||||
<a-menu-item key="1" @click="batchHandleDelete">
|
||||
<Icon icon="ant-design:delete-outlined" />
|
||||
删除
|
||||
|
@ -43,7 +47,7 @@
|
|||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import CetGroupModal from './components/CetGroupModal.vue';
|
||||
import { columns, searchFormSchema, superQuerySchema } from './CetGroup.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './CetGroup.api';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, batchHandleClassRoom } from './CetGroup.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
const queryParam = reactive<any>({});
|
||||
|
@ -140,6 +144,12 @@
|
|||
async function batchHandleDelete() {
|
||||
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
|
||||
}
|
||||
/**
|
||||
* 批量分配教室事件
|
||||
*/
|
||||
async function batchHandleClassRooms() {
|
||||
await batchHandleClassRoom({ ids: selectedRowKeys.value }, handleSuccess);
|
||||
}
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
|
|
|
@ -10,14 +10,14 @@
|
|||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item key="1" @click="batchHandleDelete">
|
||||
<Icon icon="ant-design:delete-outlined" />
|
||||
删除
|
||||
</a-menu-item>
|
||||
<a-menu-item key="1" @click="batchHandleGroup">
|
||||
<Icon icon="ant-design:delete-outlined" />
|
||||
批量分组
|
||||
</a-menu-item>
|
||||
<a-menu-item key="1" @click="batchHandleDelete">
|
||||
<Icon icon="ant-design:delete-outlined" />
|
||||
删除
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button
|
||||
|
|
Loading…
Reference in New Issue