CN-965 知识库Preview:1.一条一条删除数据,直到删除完毕,列表未显示nodata;2.列表没有数据时,不弹出对话框;3.删除最后一条记录时报错;4.导入数据中,此时点击报错按钮,报错;
This commit is contained in:
@@ -431,8 +431,7 @@ export default {
|
||||
if (this.fileList.length > 0 && this.fileList[0].status === 'success') {
|
||||
this.fileListBack = this.fileList[0]
|
||||
}
|
||||
const file = fileList.slice(-1)
|
||||
this.fileList = file
|
||||
this.fileList = fileList.slice(-1)
|
||||
},
|
||||
uploadError () {
|
||||
this.uploadLoading = false
|
||||
@@ -481,6 +480,7 @@ export default {
|
||||
this.editTagErrorTip = ''
|
||||
this.editIndex = -1
|
||||
this.isPreviewChange = true
|
||||
this.importedDataNoData = true
|
||||
}
|
||||
if (this.fileListBack !== undefined && this.fileListBack.status === 'success' &&
|
||||
this.importedData.length > 0) {
|
||||
@@ -491,6 +491,7 @@ export default {
|
||||
if (!this.isShowUploadTips) {
|
||||
this.isShowUploadTips = true
|
||||
const self = this
|
||||
if (this.importedData.length > 0) {
|
||||
this.$confirm(this.$t('tip.uploadFile'), {
|
||||
confirmButtonText: this.$t('tip.confirm'),
|
||||
cancelButtonText: this.$t('overall.cancel'),
|
||||
@@ -505,6 +506,11 @@ export default {
|
||||
}).catch(e => {}).finally(() => {
|
||||
this.isShowUploadTips = false
|
||||
})
|
||||
} else {
|
||||
this.isClick = true
|
||||
this.isShowUploadTips = false
|
||||
self.$refs.upload.$refs.uploadRef.handleClick()
|
||||
}
|
||||
}
|
||||
},
|
||||
promiseState (p) {
|
||||
@@ -525,6 +531,7 @@ export default {
|
||||
reject(new Error(this.$t('validate.fileSizeLimit', { size: unitConvert(this.uploadFileSizeLimit, unitTypes.byte).join('') })))
|
||||
} else {
|
||||
if (!this.isClick) {
|
||||
if (this.importedData.length > 0) {
|
||||
this.$confirm(this.$t('tip.uploadFile'), {
|
||||
confirmButtonText: this.$t('tip.confirm'),
|
||||
cancelButtonText: this.$t('overall.cancel'),
|
||||
@@ -541,6 +548,9 @@ export default {
|
||||
} else {
|
||||
resolve()
|
||||
}
|
||||
} else {
|
||||
resolve()
|
||||
}
|
||||
}
|
||||
})
|
||||
return promise
|
||||
@@ -575,7 +585,7 @@ export default {
|
||||
// 删除内容为空的新增记录
|
||||
const lastIndex = this.importedData.length - 1
|
||||
const lastData = this.importedData[lastIndex]
|
||||
if (lastData.tagItem === '' && lastData.tagValue === '') {
|
||||
if (lastData !== undefined && lastData.tagItem === '' && lastData.tagValue === '') {
|
||||
this.importedData.pop()
|
||||
}
|
||||
this.importedPageObj.total = this.importedData.length
|
||||
@@ -639,10 +649,14 @@ export default {
|
||||
this.previewErrorTip = ''
|
||||
}
|
||||
if (valid) {
|
||||
if (this.$refs.editForm) {
|
||||
this.$refs.editForm.validate((validImportData) => {
|
||||
if (validImportData) {
|
||||
// 校验通过后组织数据、请求接口
|
||||
if (valid && !this.uploadErrorTip && !this.previewErrorTip) {
|
||||
if (this.importedData.length === 1 && this.importedData[0].tagItem === '') {
|
||||
// this.blockOperation.save = false
|
||||
} else {
|
||||
const postData = {
|
||||
tagName: this.editObject.tagName,
|
||||
tagType: this.editObject.tagType,
|
||||
@@ -714,6 +728,7 @@ export default {
|
||||
this.blockOperation.save = false
|
||||
})
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.blockOperation.save = false
|
||||
}
|
||||
@@ -724,6 +739,9 @@ export default {
|
||||
} else {
|
||||
this.blockOperation.save = false
|
||||
}
|
||||
} else {
|
||||
this.blockOperation.save = false
|
||||
}
|
||||
})
|
||||
},
|
||||
hasErrorImportedData () {
|
||||
@@ -806,11 +824,13 @@ export default {
|
||||
if (total > 0 && total < 10) {
|
||||
this.importedData.push({ tagItem: '', tagValue: '', status: 1 })
|
||||
this.showImportedData.push({ tagItem: '', tagValue: '', status: 1 })
|
||||
this.importedDataNoData = false
|
||||
} else {
|
||||
const lastPageSize = Math.ceil((total + 1) / 10)
|
||||
this.pageNo(lastPageSize)
|
||||
this.importedData.push({ tagItem: '', tagValue: '', status: 1 })
|
||||
this.showImportedData.push({ tagItem: '', tagValue: '', status: 1 })
|
||||
this.importedDataNoData = false
|
||||
}
|
||||
this.importedPageObj.total = this.importedData.length
|
||||
this.timer = setTimeout(() => {
|
||||
|
||||
Reference in New Issue
Block a user