Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ip选择器接口调用自测问题修复 #7543 #7548

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading