Skip to content

Commit

Permalink
fix: ip选择器接口调用自测问题修复 TencentBlueKing#7543
Browse files Browse the repository at this point in the history
# Reviewed, transaction id: 16829
  • Loading branch information
ywywZhou committed Aug 29, 2024
1 parent 16cec25 commit f2f6828
Showing 1 changed file with 29 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,33 +194,37 @@
Promise.all(requestList).then(values => {
let hasDiff = false
const { ip, group } = this.value
values.forEach((v) => {
switch (selectorInfo.id) {
case 'ip':
this.staticIpList = v.data
if (!this.hook) { // 表单没有被勾选
ip.forEach(value => {
// 拿到新的静态ip列表后替换对应的已保存ip属性,如果已保存ip在新列表中不存在,则提示用户手动更新
hasDiff = this.staticIpList.every(item => item.bk_host_id !== value.bk_host_id)
values.forEach((v, index) => {
if (index === 0) {
switch (selectorInfo.id) {
case 'ip':
this.staticIpList = v.data
if (!this.hook) { // 表单没有被勾选
ip.forEach(value => {
// 拿到新的静态ip列表后替换对应的已保存ip属性,如果已保存ip在新列表中不存在,则提示用户手动更新
hasDiff = this.staticIpList.every(item => item.bk_host_id !== value.bk_host_id)
this.$set(value, 'diff', hasDiff)
})
}
break
case 'topo':
this.dynamicIpList = v.data
break
case 'group':
this.dynamicGroupList = v.data.info
// 判断动态分组数据与最新的CMDB动态分组配置是否存在差异
const dynamicGroups = group || []
dynamicGroups.some(value => {
hasDiff = this.dynamicGroupList.every(item => item.id !== value.id)
this.$set(value, 'diff', hasDiff)
})
}
break
case 'topo':
this.dynamicIpList = v.data
break
case 'group':
this.dynamicGroupList = v.data.info
// 判断动态分组数据与最新的CMDB动态分组配置是否存在差异
const dynamicGroups = group || []
dynamicGroups.some(value => {
hasDiff = this.dynamicGroupList.every(item => item.id !== value.id)
this.$set(value, 'diff', hasDiff)
})
break
default:
this.topoModelList = v.data
break
break
default:
this.topoModelList = v.data
break
}
} else {
this.topoModelList = v.data
}
})
this.loading = false
Expand Down

0 comments on commit f2f6828

Please sign in to comment.