Skip to content

Commit

Permalink
fix: 优化代码解决异常报错
Browse files Browse the repository at this point in the history
  • Loading branch information
yangyy committed May 25, 2023
1 parent 7c7f6ba commit 43512fc
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 23 deletions.
5 changes: 4 additions & 1 deletion src/ui/src/components/model-manage/field-group/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1088,8 +1088,11 @@
},
handleColumnsConfigSliderBeforeClose() {
const refColumns = this.$refs.cmdbColumnsConfig
if (!refColumns) {
return
}
const { columnsChangedValues } = refColumns
if (columnsChangedValues()) {
if (columnsChangedValues?.()) {
refColumns.setChanged(true)
return refColumns.beforeClose(() => {
this.configProperty.show = false
Expand Down
2 changes: 0 additions & 2 deletions src/ui/src/components/ui/form/organization.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
{
'is-focus': focused,
'is-disabled': disabled,
'is-readonly': readonly,
'is-unselected': unselected
}
]">
Expand Down Expand Up @@ -92,7 +91,6 @@
})
const focused = ref(false)
const readonly = ref(true)
const unselected = ref(false)
const tree = ref(null)
Expand Down
5 changes: 4 additions & 1 deletion src/ui/src/views/business/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -728,8 +728,11 @@
},
handleColumnsConfigSliderBeforeClose() {
const refColumns = this.$refs.cmdbColumnsConfig
if (!refColumns) {
return
}
const { columnsChangedValues } = refColumns
if (columnsChangedValues()) {
if (columnsChangedValues?.()) {
refColumns.setChanged(true)
return refColumns.beforeClose(() => {
this.columnsConfig.show = false
Expand Down
5 changes: 4 additions & 1 deletion src/ui/src/views/general-model/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -981,8 +981,11 @@
},
handleColumnsConfigSliderBeforeClose() {
const refColumns = this.$refs.cmdbColumnsConfig
if (!refColumns) {
return
}
const { columnsChangedValues } = refColumns
if (columnsChangedValues()) {
if (columnsChangedValues?.()) {
refColumns.setChanged(true)
return refColumns.beforeClose(() => {
this.columnsConfig.show = false
Expand Down
38 changes: 21 additions & 17 deletions src/ui/src/views/model-manage/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -954,25 +954,29 @@
this.$http.cancelRequest(prevIndex)
}
const result = await this.$store.dispatch(
'objectCommonInst/searchInstanceCount',
{
params: {
condition: { obj_ids: [modelId] },
},
config: {
requestId,
globalError: false,
},
}
)
try {
const result = await this.$store.dispatch(
'objectCommonInst/searchInstanceCount',
{
params: {
condition: { obj_ids: [modelId] },
},
config: {
requestId,
globalError: false,
},
}
)
const [data] = result
const [data] = result
this.$set(this.modelStatisticsSet, data.bk_obj_id, {
error: data.error,
inst_count: data.inst_count,
})
this.$set(this.modelStatisticsSet, data.bk_obj_id, {
error: data.error,
inst_count: data.inst_count,
})
} catch (err) {
console.error(err)
}
},
async saveGroup() {
try {
Expand Down
5 changes: 4 additions & 1 deletion src/ui/src/views/project/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -595,8 +595,11 @@
},
handleColumnsConfigSliderBeforeClose() {
const refColumns = this.$refs.cmdbColumnsConfig
if (!refColumns) {
return
}
const { columnsChangedValues } = refColumns
if (columnsChangedValues()) {
if (columnsChangedValues?.()) {
refColumns.setChanged(true)
return refColumns.beforeClose(() => {
this.columnsConfig.show = false
Expand Down

0 comments on commit 43512fc

Please sign in to comment.