This commit is contained in:
cwchen 2025-09-05 17:01:32 +08:00
parent 460f62dff2
commit 606fbe634e
12 changed files with 37 additions and 11 deletions

View File

@ -130,7 +130,7 @@ export function updateAuthRole(data) {
// 查询部门下拉树结构
export function deptTreeSelect() {
return request({
url: '/system/user/deptTree',
url: '/smartArchives/system/user/deptTree',
method: 'get'
})
}

26
src/utils/download.js Normal file
View File

@ -0,0 +1,26 @@
// 下载blob文件
export const downloadFile = ({ fileData, fileType, fileName }) => {
const blob = new Blob([fileData], {
type: fileType
})
const link = document.createElement('a')
link.href = URL.createObjectURL(blob)
link.download = fileName
link.style.display = 'none'
document.body.appendChild(link)
link.click()
URL.revokeObjectURL(link.href)
document.body.removeChild(link)
}
// 通用a链接下载
export const downloadFileByUrl = (url) => {
const link = document.createElement('a')
link.href = url
link.setAttribute('download', '')
link.style.display = 'none'
document.body.appendChild(link)
link.click()
URL.revokeObjectURL(link.href)
document.body.removeChild(link)
}

View File

@ -504,7 +504,7 @@ export default {
},
/** 导出按钮操作 */
handleExport() {
this.download('monitor/job/export', {
this.download('smartArchives/monitor/job/export', {
...this.queryParams
}, `job_${new Date().getTime()}.xlsx`)
}

View File

@ -286,7 +286,7 @@ export default {
},
/** 导出按钮操作 */
handleExport() {
this.download('/monitor/jobLog/export', {
this.download('/smartArchives//monitor/jobLog/export', {
...this.queryParams
}, `log_${new Date().getTime()}.xlsx`)
}

View File

@ -236,7 +236,7 @@ export default {
},
/** 导出按钮操作 */
handleExport() {
this.download('monitor/logininfor/export', {
this.download('smartArchives/monitor/logininfor/export', {
...this.queryParams
}, `logininfor_${new Date().getTime()}.xlsx`)
}

View File

@ -313,7 +313,7 @@ export default {
},
/** 导出按钮操作 */
handleExport() {
this.download('monitor/operlog/export', {
this.download('smartArchives/monitor/operlog/export', {
...this.queryParams
}, `operlog_${new Date().getTime()}.xlsx`)
}

View File

@ -328,7 +328,7 @@ export default {
},
/** 导出按钮操作 */
handleExport() {
this.download('system/config/export', {
this.download('smartArchives/system/config/export', {
...this.queryParams
}, `config_${new Date().getTime()}.xlsx`)
},

View File

@ -393,7 +393,7 @@ export default {
},
/** 导出按钮操作 */
handleExport() {
this.download('system/dict/data/export', {
this.download('smartArchives/system/dict/data/export', {
...this.queryParams
}, `data_${new Date().getTime()}.xlsx`)
}

View File

@ -331,7 +331,7 @@ export default {
},
/** 导出按钮操作 */
handleExport() {
this.download('system/dict/type/export', {
this.download('smartArchives/system/dict/type/export', {
...this.queryParams
}, `type_${new Date().getTime()}.xlsx`)
},

View File

@ -300,7 +300,7 @@ export default {
},
/** 导出按钮操作 */
handleExport() {
this.download('system/post/export', {
this.download('smartArchives/system/post/export', {
...this.queryParams
}, `post_${new Date().getTime()}.xlsx`)
}

View File

@ -596,7 +596,7 @@ export default {
},
/** 导出按钮操作 */
handleExport() {
this.download('system/role/export', {
this.download('smartArchives/system/role/export', {
...this.queryParams
}, `role_${new Date().getTime()}.xlsx`)
}

View File

@ -518,7 +518,7 @@ export default {
},
/** 导出按钮操作 */
handleExport() {
this.download('system/user/export', {
this.download('smartArchives/system/user/export', {
...this.queryParams
}, `user_${new Date().getTime()}.xlsx`)
},