fix:CN-1546 知识库导入空csv,接口报错界面未提示
This commit is contained in:
@@ -570,46 +570,46 @@ export default {
|
|||||||
return originalImportedData
|
return originalImportedData
|
||||||
},
|
},
|
||||||
uploadSuccess (response) {
|
uploadSuccess (response) {
|
||||||
this.uploaded = true
|
if (response.code === 200) {
|
||||||
// if (response.code === 200) {
|
this.uploaded = true
|
||||||
// 上传成功后去掉upload和preview的错误提示
|
// 上传成功后去掉upload和preview的错误提示
|
||||||
this.uploadErrorTip = ''
|
this.uploadErrorTip = ''
|
||||||
this.previewErrorTip = ''
|
this.previewErrorTip = ''
|
||||||
this.importedType = this.editObject.source
|
this.importedType = this.editObject.source
|
||||||
const originalImportedData = _.cloneDeep(response.data.data)
|
const originalImportedData = _.cloneDeep(response.data.data)
|
||||||
this.importedDataNoData = originalImportedData.length === 0
|
this.importedDataNoData = originalImportedData.length === 0
|
||||||
if (originalImportedData.length > 0) {
|
if (originalImportedData.length > 0) {
|
||||||
originalImportedData.forEach(data => {
|
originalImportedData.forEach(data => {
|
||||||
if (data.isValid === 1) {
|
if (data.isValid === 1) {
|
||||||
data.msg = this.$t('overall.success')
|
data.msg = this.$t('overall.success')
|
||||||
} else if (data.isValid === 0) {
|
} else if (data.isValid === 0) {
|
||||||
data.msg = this.$t('validate.wrongFormat')
|
data.msg = this.$t('validate.wrongFormat')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
this.originalImportInfo = {
|
this.originalImportInfo = {
|
||||||
total: originalImportedData.length,
|
total: originalImportedData.length,
|
||||||
succeeded: originalImportedData.filter(d => d.isValid === 1).length,
|
succeeded: originalImportedData.filter(d => d.isValid === 1).length,
|
||||||
failed: originalImportedData.filter(d => d.isValid !== 1).length
|
failed: originalImportedData.filter(d => d.isValid !== 1).length
|
||||||
}
|
}
|
||||||
this.isLoad = false
|
this.isLoad = false
|
||||||
originalImportedData.sort((a, b) => b.isValid - a.isValid)
|
originalImportedData.sort((a, b) => b.isValid - a.isValid)
|
||||||
this.importedData = this.handleSpeticalTypeData(originalImportedData)
|
this.importedData = this.handleSpeticalTypeData(originalImportedData)
|
||||||
this.addItemList = _.cloneDeep(this.importedData).filter(item => { return item.isValid === 1 })
|
this.addItemList = _.cloneDeep(this.importedData).filter(item => { return item.isValid === 1 })
|
||||||
this.updateItemList = []
|
this.updateItemList = []
|
||||||
this.deleteItemIds = this.oldItemIds
|
this.deleteItemIds = this.oldItemIds
|
||||||
|
|
||||||
this.handleShowImportedData()
|
this.handleShowImportedData()
|
||||||
this.addEditFlag = false
|
this.addEditFlag = false
|
||||||
this.editTagErrorTip = ''
|
this.editTagErrorTip = ''
|
||||||
this.editIndex = -1
|
this.editIndex = -1
|
||||||
this.isPreviewChange = true
|
this.isPreviewChange = true
|
||||||
this.stepHeights[2] = itemListHeight.hasData
|
this.stepHeights[2] = itemListHeight.hasData
|
||||||
this.stepHeightConstant.third = itemListHeight.hasData
|
this.stepHeightConstant.third = itemListHeight.hasData
|
||||||
/* } else {
|
} else {
|
||||||
this.uploadLoading = false
|
this.uploadLoading = false
|
||||||
this.$message.error(this.$t('tip.uploadFailed', { msg: response.message }))
|
this.$message.error(this.$t('tip.uploadFailed', { msg: response.message }))
|
||||||
} */
|
}
|
||||||
},
|
},
|
||||||
onRemove (files) {
|
onRemove (files) {
|
||||||
if (files && files.status === 'success') {
|
if (files && files.status === 'success') {
|
||||||
|
|||||||
Reference in New Issue
Block a user