This commit is contained in:
Daniel 2024-11-17 17:43:52 +08:00
parent 23c6f278f1
commit 09d6b5a8b8
No known key found for this signature in database
GPG Key ID: 86211BA83DF03017

View File

@ -3465,6 +3465,18 @@ func updateAttributeViewColumnOption(operation *Operation) (err error) {
newName := data["newName"].(string)
newColor := data["newColor"].(string)
found := false
if oldName != newName {
for _, opt := range key.Options {
if newName == opt.Name { // 如果选项名已经存在则直接使用
found = true
newColor = opt.Color
break
}
}
}
if !found {
for i, opt := range key.Options {
if oldName == opt.Name {
key.Options[i].Name = newName
@ -3472,6 +3484,7 @@ func updateAttributeViewColumnOption(operation *Operation) (err error) {
break
}
}
}
// 如果存在选项对应的值,需要更新值中的选项
for _, keyValues := range attrView.KeyValues {