perf: Optimize file audit download prompt

This commit is contained in:
feng
2024-09-29 16:09:51 +08:00
committed by feng626
parent 8e6ca146e1
commit dac5dfcd1c

View File

@@ -5,6 +5,7 @@
<script>
import GenericListPage from '@/layout/components/GenericListPage'
import { download } from '@/utils/common'
import store from '@/store'
export default {
components: {
@@ -36,7 +37,24 @@ export default {
return row.has_file
},
tip: ({ row }) => {
return row.has_file ? this.$t('Download') : this.$t('DownloadFTPFileTip')
const ftpFileMaxStore = store.getters.publicSettings['FTP_FILE_MAX_STORE']
const downloadTip = this.$t('Download')
const fileNotStoredTip = this.$t('FTPFileNotStored')
const storageNotEnabledTip = this.$t('FTPStorageNotEnabled')
const unknownStorageStateTip = this.$t('FTPUnknownStorageState')
if (row.has_file) {
return downloadTip
}
if (ftpFileMaxStore === 0) {
return storageNotEnabledTip
} else if (ftpFileMaxStore > 0) {
return fileNotStoredTip
} else {
return unknownStorageStateTip
}
},
callback: function({ row }) {
// 跳转下载页面