数据模板导入、数据导出
This commit is contained in:
@@ -15,7 +15,7 @@ import directive from './directive' // directive
|
||||
|
||||
// 注册指令
|
||||
import plugins from './plugins' // plugins
|
||||
import { download } from '@/utils/request'
|
||||
import { download } from '@/utils/ruoyi.js'
|
||||
|
||||
// svg图标
|
||||
import 'virtual:svg-icons-register'
|
||||
|
||||
@@ -249,4 +249,11 @@ export async function blobValidate(data) {
|
||||
} catch (error) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// 通用下载方法
|
||||
export function download(url) {
|
||||
// window.location.href = baseURL + "/common/download?fileName=" + encodeURI(fileName) + "&delete=" + true;
|
||||
// window.open(baseURL + "/common/download?fileName=" + encodeURI(fileName) + "&delete=" + true)
|
||||
window.open(import.meta.env.VITE_APP_BASE_API + url)
|
||||
}
|
||||
@@ -370,9 +370,7 @@ function handleDelete(row) {
|
||||
};
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download("system/user/export", {
|
||||
...queryParams.value,
|
||||
}, `user_${new Date().getTime()}.xlsx`);
|
||||
proxy.download("user/export");
|
||||
};
|
||||
/** 用户状态修改 */
|
||||
function handleStatusChange(row) {
|
||||
@@ -430,8 +428,7 @@ function handleImport() {
|
||||
};
|
||||
/** 下载模板操作 */
|
||||
function importTemplate() {
|
||||
proxy.download("system/user/importTemplate", {
|
||||
}, `user_template_${new Date().getTime()}.xlsx`);
|
||||
proxy.download("user/template");
|
||||
};
|
||||
/**文件上传中处理 */
|
||||
const handleFileUploadProgress = (event, file, fileList) => {
|
||||
|
||||
Reference in New Issue
Block a user