Skip to content

Commit 22d1245

Browse files
ywywZhouluofann
authored andcommitted
fix: ip选择器接口调用自测问题修复 #7543
# Reviewed, transaction id: 16831
1 parent 0effa54 commit 22d1245

File tree

1 file changed

+29
-25
lines changed

1 file changed

+29
-25
lines changed

frontend/desktop/src/components/common/RenderForm/tags/TagIpSelector.vue

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -194,33 +194,37 @@
194194
Promise.all(requestList).then(values => {
195195
let hasDiff = false
196196
const { ip, group } = this.value
197-
values.forEach((v) => {
198-
switch (selectorInfo.id) {
199-
case 'ip':
200-
this.staticIpList = v.data
201-
if (!this.hook) { // 表单没有被勾选
202-
ip.forEach(value => {
203-
// 拿到新的静态ip列表后替换对应的已保存ip属性,如果已保存ip在新列表中不存在,则提示用户手动更新
204-
hasDiff = this.staticIpList.every(item => item.bk_host_id !== value.bk_host_id)
197+
values.forEach((v, index) => {
198+
if (index === 0) {
199+
switch (selectorInfo.id) {
200+
case 'ip':
201+
this.staticIpList = v.data
202+
if (!this.hook) { // 表单没有被勾选
203+
ip.forEach(value => {
204+
// 拿到新的静态ip列表后替换对应的已保存ip属性,如果已保存ip在新列表中不存在,则提示用户手动更新
205+
hasDiff = this.staticIpList.every(item => item.bk_host_id !== value.bk_host_id)
206+
this.$set(value, 'diff', hasDiff)
207+
})
208+
}
209+
break
210+
case 'topo':
211+
this.dynamicIpList = v.data
212+
break
213+
case 'group':
214+
this.dynamicGroupList = v.data.info
215+
// 判断动态分组数据与最新的CMDB动态分组配置是否存在差异
216+
const dynamicGroups = group || []
217+
dynamicGroups.some(value => {
218+
hasDiff = this.dynamicGroupList.every(item => item.id !== value.id)
205219
this.$set(value, 'diff', hasDiff)
206220
})
207-
}
208-
break
209-
case 'topo':
210-
this.dynamicIpList = v.data
211-
break
212-
case 'group':
213-
this.dynamicGroupList = v.data.info
214-
// 判断动态分组数据与最新的CMDB动态分组配置是否存在差异
215-
const dynamicGroups = group || []
216-
dynamicGroups.some(value => {
217-
hasDiff = this.dynamicGroupList.every(item => item.id !== value.id)
218-
this.$set(value, 'diff', hasDiff)
219-
})
220-
break
221-
default:
222-
this.topoModelList = v.data
223-
break
221+
break
222+
default:
223+
this.topoModelList = v.data
224+
break
225+
}
226+
} else {
227+
this.topoModelList = v.data
224228
}
225229
})
226230
this.loading = false

0 commit comments

Comments
 (0)