This commit is contained in:
张成
2025-10-09 23:50:03 +08:00
parent 0b78af46cd
commit 88cd8d6e72
37 changed files with 444 additions and 240 deletions

View File

@@ -12,6 +12,21 @@ import uiTool from './utils/uiTool'
import http from './utils/http'
import * as tools from './utils/tools'
// 文件下载工具
const funTool = {
downloadFile: (res, fileName) => {
const blob = new Blob([res.data || res])
const downloadElement = document.createElement('a')
const href = window.URL.createObjectURL(blob)
downloadElement.href = href
downloadElement.download = fileName || new Date().getTime() + '.csv'
document.body.appendChild(downloadElement)
downloadElement.click()
document.body.removeChild(downloadElement)
window.URL.revokeObjectURL(href)
}
}
import storeModules, { userModule, appModule } from './store'
import routerConfig, { createBaseRoutes, setupRouterGuards } from './router'
@@ -64,6 +79,7 @@ class AdminFramework {
this.tools = tools
this.uiTool = uiTool
this.http = http
this.funTool = funTool
this.storeModules = storeModules
this.userModule = userModule
@@ -316,6 +332,7 @@ export {
tools,
uiTool,
http,
funTool,
storeModules,
userModule,