Skip to content

Commit d57b3a7

Browse files
author
pobu168
committed
fix: empty diff variable display
1 parent e6b8d07 commit d57b3a7

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

artifacts-ui/src/components/pkg-diff-variable.vue

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -392,10 +392,10 @@ export default {
392392
},
393393
initVariableTableData (index) {
394394
this.currentFileIndex = index
395-
if (this.currentDiffConfigTab === 'DB') {
395+
if (this.currentDiffConfigTab === 'DB' && this.packageDetail.db_diff_conf_file.length > 0) {
396396
this.typeChange(this.packageDetail.db_diff_conf_file[index].configKeyInfos || [])
397397
}
398-
if (this.currentDiffConfigTab === 'APP') {
398+
if (this.currentDiffConfigTab === 'APP' && this.packageDetail.diff_conf_file.length > 0) {
399399
this.typeChange(this.packageDetail.diff_conf_file[index].configKeyInfos || [])
400400
}
401401
},
@@ -411,12 +411,15 @@ export default {
411411
this.prefixType = ''
412412
this.$nextTick(() => {
413413
const tmp = this.currentDiffConfigTab === this.constPackageOptions.db ? 'db_diff_conf_file' : 'diff_conf_file'
414-
const tmpData = this.packageDetail[tmp].find(item => item.filename === this.activeTab).configKeyInfos || []
415-
for (let i = 0; i < this.variablePrefixType.length; i++) {
416-
const res = this.getNum(tmpData, this.variablePrefixType[i].filterKey)
417-
if (res > 0) {
418-
this.prefixType = this.variablePrefixType[i].key
419-
break
414+
const find = this.packageDetail[tmp].find(item => item.filename === this.activeTab)
415+
if (find) {
416+
const tmpData = find.configKeyInfos || []
417+
for (let i = 0; i < this.variablePrefixType.length; i++) {
418+
const res = this.getNum(tmpData, this.variablePrefixType[i].filterKey)
419+
if (res > 0) {
420+
this.prefixType = this.variablePrefixType[i].key
421+
break
422+
}
420423
}
421424
}
422425
})

0 commit comments

Comments
 (0)