1、完善客商模块
2、完善基础数据模块 3、完善规范
This commit is contained in:
@@ -1,17 +1,37 @@
|
||||
import request from '@/axios';
|
||||
import { ElLoading, ElMessage } from 'element-plus';
|
||||
|
||||
/**
|
||||
* 文件流返回
|
||||
* @param url 接口地址
|
||||
* @param params 接口参数
|
||||
*/
|
||||
export const exportBlob = (url, params) => {
|
||||
export const exportBlob = (url, params, options = {}) => {
|
||||
const { feedback = false, loadingText = '导出中', successText = '导出完成' } = options;
|
||||
const loading = feedback
|
||||
? ElLoading.service({
|
||||
lock: true,
|
||||
text: loadingText,
|
||||
background: 'rgba(255, 255, 255, 0.7)',
|
||||
})
|
||||
: null;
|
||||
return request({
|
||||
url: url,
|
||||
params: params,
|
||||
method: 'get',
|
||||
responseType: 'blob',
|
||||
});
|
||||
})
|
||||
.then(res => {
|
||||
if (feedback) {
|
||||
ElMessage.success(successText);
|
||||
}
|
||||
return res;
|
||||
})
|
||||
.finally(() => {
|
||||
if (loading) {
|
||||
loading.close();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
export const importBlob = (url, file) => {
|
||||
|
||||
Reference in New Issue
Block a user