fix: CN-817 下钻table的error交互实施:错误图标显示后消失问题修正

This commit is contained in:
hyx
2022-12-02 15:50:21 +08:00
parent a934fd2635
commit 7ec4ab62ff

View File

@@ -337,14 +337,14 @@ export default {
this.initData() this.initData()
} else { } else {
this.showError = true this.showError = true
this.errorMsg = response.message this.errorMsg = response.msg || response.message || 'Unknown'
this.isNoData = true this.isNoData = true
this.toggleLoading(false) this.toggleLoading(false)
} }
}).catch(e => { }).catch(e => {
console.error(e) console.error(e)
this.showError = true this.showError = true
this.errorMsg = e.message this.errorMsg = e.msg || e.message || 'Unknown'
}).finally(() => { }).finally(() => {
this.changeUrlTabState() this.changeUrlTabState()
this.toggleLoading(false) this.toggleLoading(false)
@@ -694,12 +694,12 @@ export default {
}) })
}else { }else {
tableColumn.showError = true tableColumn.showError = true
tableColumn.errorMsg = response.message tableColumn.errorMsg = response.msg || response.message || 'Unknown'
} }
}).catch(e => { }).catch(e => {
console.log(e) console.log(e)
tableColumn.showError = true tableColumn.showError = true
tableColumn.errorMsg = e.message tableColumn.errorMsg = e.msg || e.message || 'Unknown'
}).finally(e => { }).finally(e => {
this.tableData = tableDataTmp this.tableData = tableDataTmp
this.tableDataBackup = tableDataTmp this.tableDataBackup = tableDataTmp
@@ -712,8 +712,10 @@ export default {
if (tableColumn.columnType === tableColumnType.chainRatio && !tableColumn.isInMainUrl) { if (tableColumn.columnType === tableColumnType.chainRatio && !tableColumn.isInMainUrl) {
get(self.gerColumnUrl(tableColumn), queryParams).then(response => { get(self.gerColumnUrl(tableColumn), queryParams).then(response => {
if (response.code === 200) { if (response.code === 200) {
tableColumn.showError = false if(!tableColumn.showError){
tableColumn.errorMsg = '' tableColumn.showError = false
tableColumn.errorMsg = ''
}
const columnList = response.data.result const columnList = response.data.result
self.tableData.forEach((item, i) => { self.tableData.forEach((item, i) => {
const data = columnList.find(i => i[curTab.prop] === item.tab) const data = columnList.find(i => i[curTab.prop] === item.tab)
@@ -735,12 +737,12 @@ export default {
}) })
}else { }else {
tableColumn.showError = true tableColumn.showError = true
tableColumn.errorMsg = tableColumn.errorMsg ? (tableColumn.errorMsg + ',' + response.message) : response.message tableColumn.errorMsg = response.msg || response.message || 'Unknown'
} }
}).catch(e => { }).catch(e => {
console.log(e) console.log(e)
tableColumn.showError = true tableColumn.showError = true
tableColumn.errorMsg = tableColumn.errorMsg ? (tableColumn.errorMsg + ',' + e.message) : e.message tableColumn.errorMsg = e.msg || e.message || 'Unknown'
}).finally(e => { }).finally(e => {
// 查询需要单独查询的,且需要展示环比图标,列的前一周期的数据 // 查询需要单独查询的,且需要展示环比图标,列的前一周期的数据
if (tableColumn.cycle && self.tableData && self.tableData.length > 0) { if (tableColumn.cycle && self.tableData && self.tableData.length > 0) {
@@ -750,8 +752,10 @@ export default {
} }
get(self.gerColumnUrl(tableColumn), queryCycleParams).then(response => { get(self.gerColumnUrl(tableColumn), queryCycleParams).then(response => {
if (response.code === 200) { if (response.code === 200) {
tableColumn.showError = false if(!tableColumn.showError){
tableColumn.errorMsg = '' tableColumn.showError = false
tableColumn.errorMsg = ''
}
cycleTotalList = response.data.result cycleTotalList = response.data.result
self.tableData.forEach(item => { self.tableData.forEach(item => {
const cycle = cycleTotalList.find(i => i[curTab.prop] === item.tab) const cycle = cycleTotalList.find(i => i[curTab.prop] === item.tab)
@@ -801,12 +805,12 @@ export default {
}) })
}else { }else {
tableColumn.showError = true tableColumn.showError = true
tableColumn.errorMsg = tableColumn.errorMsg ? (tableColumn.errorMsg + ',' + response.message) : response.message tableColumn.errorMsg = response.msg || response.message || 'Unknown'
} }
}).catch(e => { }).catch(e => {
console.log(e) console.log(e)
tableColumn.showError = true tableColumn.showError = true
tableColumn.errorMsg = tableColumn.errorMsg ? (tableColumn.errorMsg + ',' + e.message) : e.message tableColumn.errorMsg = e.msg || e.message || 'Unknown'
}) })
} }
}) })