CN-1733 fix: 1、修复Entity Setting页面的mapping和relation被删空能被上传的问题;2、添加source列表上传文件按设置的格式上传。

This commit is contained in:
刘洪洪
2024-11-18 20:25:32 +08:00
parent b8aa493d6f
commit c9cedc3fb6
3 changed files with 13 additions and 9 deletions

View File

@@ -196,6 +196,7 @@ export default {
clickOption (item) {
this.sourceId = item.id
this.dialogVisible = true
this.fileTypeLimit = `.${item.dataFormat}`
},
// 禁止勾选buildIn为1的项即禁止修改、删除admin的账号
checkSelectable (row) {
@@ -256,7 +257,7 @@ export default {
beforeUpload (file) {
return new Promise((resolve, reject) => {
// 判断后缀,仅支持.csv
if (!_.endsWith(file.name, '.csv')) {
if (!_.endsWith(file.name, this.fileTypeLimit)) {
this.$message.error(this.$t('validate.fileTypeLimit', { types: this.fileTypeLimit }))
this.fileList = []
reject(new Error(this.$t('validate.fileTypeLimit', { types: this.fileTypeLimit })))
@@ -303,9 +304,6 @@ export default {
}
this.uploadLoading = false
this.$message.error(this.$t('tip.uploadFailed', { msg: errorMsg }))
},
downloadTemplate () {
window.open('/assets/tagTemplate.csv', '_blank')
}
},
setup () {