Daniel 2025-08-31 10:40:17 +08:00
parent 4744429550
commit c287dd080b
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
3 changed files with 17 additions and 5 deletions

View file

@ -440,7 +440,7 @@ class="fn__flex-1 fn__flex${["url", "text", "number", "email", "phone", "block"]
fetchPost("/api/av/setAttributeViewBlockAttr", {
avID: item.parentElement.dataset.avId,
keyID: item.parentElement.dataset.colId,
rowID: item.parentElement.dataset.rowId,
itemID: item.parentElement.dataset.rowId,
value
}, (setResponse) => {
if (type === "number") {

View file

@ -845,9 +845,15 @@ func setAttributeViewBlockAttr(c *gin.Context) {
avID := arg["avID"].(string)
keyID := arg["keyID"].(string)
rowID := arg["rowID"].(string) // 即 ItemID
var itemID string
if _, ok := arg["itemID"]; ok {
itemID = arg["itemID"].(string)
} else if _, ok := arg["rowID"]; ok {
// TODO 划于 2026 年 6 月 30 日后删除 https://github.com/siyuan-note/siyuan/issues/15308#issuecomment-3077675356
itemID = arg["rowID"].(string)
}
value := arg["value"].(interface{})
updatedVal, err := model.UpdateAttributeViewCell(nil, avID, keyID, rowID, value)
updatedVal, err := model.UpdateAttributeViewCell(nil, avID, keyID, itemID, value)
if err != nil {
ret.Code = -1
ret.Msg = err.Error()

View file

@ -4434,9 +4434,15 @@ func BatchUpdateAttributeViewCells(tx *Transaction, avID string, values []interf
for _, value := range values {
v := value.(map[string]interface{})
keyID := v["keyID"].(string)
rowID := v["rowID"].(string)
var itemID string
if _, ok := v["itemID"]; ok {
itemID = v["itemID"].(string)
} else if _, ok := v["rowID"]; ok {
// TODO 划于 2026 年 6 月 30 日后删除 https://github.com/siyuan-note/siyuan/issues/15308#issuecomment-3077675356
itemID = v["rowID"].(string)
}
valueData := v["value"]
_, err = updateAttributeViewValue(tx, attrView, keyID, rowID, valueData)
_, err = updateAttributeViewValue(tx, attrView, keyID, itemID, valueData)
if err != nil {
return
}