1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- import {defHttp} from '/@/utils/http/axios';
- import { useMessage } from "/@/hooks/web/useMessage";
- const { createConfirm } = useMessage();
- enum Api {
- list = '/cuspCode/cuspCustomerProfile/list',
- save='/cuspCode/cuspCustomerProfile/add',
- edit='/cuspCode/cuspCustomerProfile/edit',
- deleteOne = '/cuspCode/cuspCustomerProfile/delete',
- deleteBatch = '/cuspCode/cuspCustomerProfile/deleteBatch',
- importExcel = '/cuspCode/cuspCustomerProfile/importExcel',
- exportXls = '/cuspCode/cuspCustomerProfile/exportXls',
- cuspCustomerProfileManList = '/cuspCode/cuspCustomerProfile/queryCuspCustomerProfileManByMainId',
- }
- export const getExportUrl = Api.exportXls;
- export const getImportUrl = Api.importExcel;
- export const cuspCustomerProfileManList = Api.cuspCustomerProfileManList;
- 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(() => {
- 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();
- });
- }
- });
- }
- export const saveOrUpdate = (params, isUpdate) => {
- let url = isUpdate ? Api.edit : Api.save;
- return defHttp.post({url: url, params});
- }
|