fix:修复bool默认无效 --bug=150687052 【CMDB】[前端]业务拓扑中自定义字段bool字段默认值无效#8600
Open
elizabevil wants to merge 1 commit intoTencentBlueKing:v3.14.xfrom
Open
fix:修复bool默认无效 --bug=150687052 【CMDB】[前端]业务拓扑中自定义字段bool字段默认值无效#8600elizabevil wants to merge 1 commit intoTencentBlueKing:v3.14.xfrom
elizabevil wants to merge 1 commit intoTencentBlueKing:v3.14.xfrom
Conversation
e05371f to
1be0ad9
Compare
Anna-shine
reviewed
Jan 26, 2026
| } | ||
| field.Default = field.Option | ||
| } | ||
| field.Option = field.Default |
Collaborator
There was a problem hiding this comment.
这里option为什么要改成default?
Contributor
Author
There was a problem hiding this comment.
前端使用option存储默认值,而非default
后端适配兼容使用option与default(目的是保持一致)
| } | ||
| field.Default = field.Option | ||
| } | ||
| field.Option = field.Default |
Collaborator
There was a problem hiding this comment.
这里是给实例加默认值的,在这里改field数据没有用
Contributor
Author
There was a problem hiding this comment.
这里只是适配兼容使用option与default
并不修改数据库实际值(新增/修改 去真正修改)
Collaborator
There was a problem hiding this comment.
我知道你这里在做什么,我的意思是这个没用,真正需要处理的是属性的数据,不然还是会出现用户设置了default=true,前端看到默认值为false,结果创建实例的时候又是true的情况
Contributor
Author
There was a problem hiding this comment.
大佬 有合适的方案吗?最好兼容已有历史数据(当前仅修改前端option->default只能解决新增数据)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修复的问题:
修复方案[后端]: