mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 08:30:42 +02:00
This commit is contained in:
parent
4744429550
commit
c287dd080b
3 changed files with 17 additions and 5 deletions
|
@ -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") {
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue