mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 17:40:13 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
9ee922794e
2 changed files with 8 additions and 8 deletions
|
|
@ -372,13 +372,13 @@ func addAttributeViewBlock(blockID string, operation *Operation, tree *parse.Tre
|
||||||
attrs := parse.IAL2Map(node.KramdownIAL)
|
attrs := parse.IAL2Map(node.KramdownIAL)
|
||||||
attrs[NodeAttrNamePrefixAvKey+operation.AvID+"-"+blockValues.Key.ID] = "" // 将列作为属性添加到块中
|
attrs[NodeAttrNamePrefixAvKey+operation.AvID+"-"+blockValues.Key.ID] = "" // 将列作为属性添加到块中
|
||||||
|
|
||||||
if "" == attrs[NodeAttrNameAVs] {
|
if "" == attrs[NodeAttrNameAvs] {
|
||||||
attrs[NodeAttrNameAVs] = operation.AvID
|
attrs[NodeAttrNameAvs] = operation.AvID
|
||||||
} else {
|
} else {
|
||||||
avIDs := strings.Split(attrs[NodeAttrNameAVs], ",")
|
avIDs := strings.Split(attrs[NodeAttrNameAvs], ",")
|
||||||
avIDs = append(avIDs, operation.AvID)
|
avIDs = append(avIDs, operation.AvID)
|
||||||
avIDs = gulu.Str.RemoveDuplicatedElem(avIDs)
|
avIDs = gulu.Str.RemoveDuplicatedElem(avIDs)
|
||||||
attrs[NodeAttrNameAVs] = strings.Join(avIDs, ",")
|
attrs[NodeAttrNameAvs] = strings.Join(avIDs, ",")
|
||||||
}
|
}
|
||||||
|
|
||||||
if err = setNodeAttrsWithTx(tx, node, tree, attrs); nil != err {
|
if err = setNodeAttrsWithTx(tx, node, tree, attrs); nil != err {
|
||||||
|
|
@ -946,6 +946,6 @@ func updateAttributeViewColumnOption(operation *Operation) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
NodeAttrNameAVs = "custom-avs"
|
NodeAttrNameAvs = "custom-avs" // 用于标记块所属的属性视图,逗号分隔 av id
|
||||||
NodeAttrNamePrefixAvKey = "custom-av-key-"
|
NodeAttrNamePrefixAvKey = "custom-av-key-" // 用于标记列
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -728,7 +728,7 @@ func (tx *Transaction) doDelete(operation *Operation) (ret *TxErr) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func syncDelete2AttributeView(node *ast.Node) {
|
func syncDelete2AttributeView(node *ast.Node) {
|
||||||
avs := node.IALAttr(NodeAttrNameAVs)
|
avs := node.IALAttr(NodeAttrNameAvs)
|
||||||
if "" == avs {
|
if "" == avs {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
@ -1240,7 +1240,7 @@ func refreshDynamicRefTexts(updatedDefNodes map[string]*ast.Node, updatedTrees m
|
||||||
|
|
||||||
// 2. 更新属性视图主键内容
|
// 2. 更新属性视图主键内容
|
||||||
for _, updatedDefNode := range updatedDefNodes {
|
for _, updatedDefNode := range updatedDefNodes {
|
||||||
avs := updatedDefNode.IALAttr(NodeAttrNameAVs)
|
avs := updatedDefNode.IALAttr(NodeAttrNameAvs)
|
||||||
if "" == avs {
|
if "" == avs {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue