dbsd_kczx/src/views/zy/zyInfoStudent/ZyInfoStudent.api.ts

108 lines
2.8 KiB
TypeScript
Raw Normal View History

2024-05-06 19:41:47 +08:00
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/zyInfoStudent/zyInfoStudent/list',
2024-05-24 15:31:26 +08:00
cdxxlist = '/zyInfoStudent/zyInfoStudent/cdxxlist',
2024-05-06 19:41:47 +08:00
save='/zyInfoStudent/zyInfoStudent/add',
edit='/zyInfoStudent/zyInfoStudent/edit',
2024-05-17 22:15:18 +08:00
zyscStu='/zyInfoStudent/zyInfoStudent/zyscStu',
2024-05-24 15:31:26 +08:00
editCdlx='/zyInfoStudent/zyInfoStudent/editCdlx',
2024-05-06 19:41:47 +08:00
deleteOne = '/zyInfoStudent/zyInfoStudent/delete',
deleteBatch = '/zyInfoStudent/zyInfoStudent/deleteBatch',
2024-06-04 08:47:27 +08:00
fabuBatch = '/zyInfoStudent/zyInfoStudent/fabuBatch',
2024-05-06 19:41:47 +08:00
importExcel = '/zyInfoStudent/zyInfoStudent/importExcel',
exportXls = '/zyInfoStudent/zyInfoStudent/exportXls',
2024-05-29 10:59:42 +08:00
getQuaList = '/zyCcjg/zyCcjg/getQuaList',
2024-05-06 19:41:47 +08:00
}
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* api
*/
export const getImportUrl = Api.importExcel;
/**
*
* @param params
*/
export const list = (params) => defHttp.get({ url: Api.list, params });
2024-05-24 15:31:26 +08:00
export const cdxxlist = (params) => defHttp.get({ url: Api.cdxxlist, params });
2024-05-29 10:59:42 +08:00
export const getQuaList = (params) => defHttp.get({ url: Api.getQuaList, params });
2024-05-06 19:41:47 +08:00
/**
*
* @param params
* @param handleSuccess
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
* @param 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();
});
}
});
}
2024-06-04 08:47:27 +08:00
export const batchFabu = (params, handleSuccess) => {
createConfirm({
iconType: 'warning',
title: '确认发布',
content: '是否发布选中数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.post({url: Api.fabuBatch, data: params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
});
}
2024-05-06 19:41:47 +08:00
/**
*
* @param params
* @param isUpdate
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({ url: url, params }, { isTransformResponse: false });
}
2024-05-17 22:15:18 +08:00
export const zyscStu = (params, isUpdate) => {
let url = Api.zyscStu;
return defHttp.post({ url: url, params }, { isTransformResponse: false });
}
2024-05-24 15:31:26 +08:00
export const editCdlx = (params, isUpdate) => {
let url = Api.editCdlx;
return defHttp.post({ url: url, params }, { isTransformResponse: false });
}