mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-02-28 05:32:52 +00:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@@ -801,6 +801,9 @@ func updateAttributeViewColRelation(operation *Operation) (err error) {
|
||||
}
|
||||
|
||||
isSameAv := srcAv.ID == destAv.ID
|
||||
if isSameAv {
|
||||
destAv = srcAv
|
||||
}
|
||||
|
||||
for _, keyValues := range srcAv.KeyValues {
|
||||
if keyValues.Key.ID == operation.KeyID {
|
||||
@@ -849,14 +852,23 @@ func updateAttributeViewColRelation(operation *Operation) (err error) {
|
||||
}
|
||||
|
||||
if !destAdded {
|
||||
destAv.KeyValues = append(destAv.KeyValues, &av.KeyValues{
|
||||
Key: &av.Key{
|
||||
ID: operation.BackRelationKeyID,
|
||||
Name: operation.Name,
|
||||
Type: av.KeyTypeRelation,
|
||||
Relation: &av.Relation{AvID: operation.AvID, IsTwoWay: operation.IsTwoWay, BackKeyID: operation.KeyID},
|
||||
},
|
||||
})
|
||||
if operation.IsTwoWay {
|
||||
destAv.KeyValues = append(destAv.KeyValues, &av.KeyValues{
|
||||
Key: &av.Key{
|
||||
ID: operation.BackRelationKeyID,
|
||||
Name: operation.Name,
|
||||
Type: av.KeyTypeRelation,
|
||||
Relation: &av.Relation{AvID: operation.AvID, IsTwoWay: operation.IsTwoWay, BackKeyID: operation.KeyID},
|
||||
},
|
||||
})
|
||||
|
||||
for _, v := range destAv.Views {
|
||||
switch v.LayoutType {
|
||||
case av.LayoutTypeTable:
|
||||
v.Table.Columns = append(v.Table.Columns, &av.ViewTableColumn{ID: operation.BackRelationKeyID})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
err = av.SaveAttributeView(srcAv)
|
||||
|
||||
@@ -600,10 +600,9 @@ func renderAttributeViewTable(attrView *av.AttributeView, view *av.View) (ret *a
|
||||
|
||||
// 组装列
|
||||
for _, col := range view.Table.Columns {
|
||||
key, getErr := attrView.GetKey(col.ID)
|
||||
if nil != getErr {
|
||||
err = getErr
|
||||
return
|
||||
key, _ := attrView.GetKey(col.ID)
|
||||
if nil == key {
|
||||
continue
|
||||
}
|
||||
|
||||
ret.Columns = append(ret.Columns, &av.TableColumn{
|
||||
|
||||
Reference in New Issue
Block a user