Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/dev' into dev

Vanessa 7 mesi fa
parent
commit
81ef5d0244
3 ha cambiato i file con 28 aggiunte e 6 eliminazioni
  1. 1 0
      kernel/api/av.go
  2. 25 5
      kernel/model/attribute_view.go
  3. 2 1
      kernel/model/export.go

+ 1 - 0
kernel/api/av.go

@@ -569,6 +569,7 @@ func renderAttributeView(c *gin.Context) {
 			"id":               v.ID,
 			"id":               v.ID,
 			"icon":             v.Icon,
 			"icon":             v.Icon,
 			"name":             v.Name,
 			"name":             v.Name,
+			"desc":             v.Desc,
 			"hideAttrViewName": v.HideAttrViewName,
 			"hideAttrViewName": v.HideAttrViewName,
 			"type":             v.LayoutType,
 			"type":             v.LayoutType,
 			"pageSize":         pSize,
 			"pageSize":         pSize,

+ 25 - 5
kernel/model/attribute_view.go

@@ -3468,7 +3468,7 @@ func updateAttributeViewColumnOption(operation *Operation) (err error) {
 	found := false
 	found := false
 	if oldName != newName {
 	if oldName != newName {
 		for _, opt := range key.Options {
 		for _, opt := range key.Options {
-			if newName == opt.Name { // 如果选项已经存在则直接使用
+			if newName == opt.Name { // 如果选项已经存在则直接使用
 				found = true
 				found = true
 				newColor = opt.Color
 				newColor = opt.Color
 				break
 				break
@@ -3497,13 +3497,33 @@ func updateAttributeViewColumnOption(operation *Operation) (err error) {
 				continue
 				continue
 			}
 			}
 
 
-			for i, opt := range value.MSelect {
-				if oldName == opt.Content {
-					value.MSelect[i].Content = newName
-					value.MSelect[i].Color = newColor
+			found = false
+			for _, opt := range value.MSelect {
+				if newName == opt.Content {
+					found = true
 					break
 					break
 				}
 				}
 			}
 			}
+			if found {
+				idx := -1
+				for i, opt := range value.MSelect {
+					if oldName == opt.Content {
+						idx = i
+						break
+					}
+				}
+				if 0 <= idx {
+					value.MSelect = util.RemoveElem(value.MSelect, idx)
+				}
+			} else {
+				for i, opt := range value.MSelect {
+					if oldName == opt.Content {
+						value.MSelect[i].Content = newName
+						value.MSelect[i].Color = newColor
+						break
+					}
+				}
+			}
 		}
 		}
 		break
 		break
 	}
 	}

+ 2 - 1
kernel/model/export.go

@@ -1389,10 +1389,11 @@ func BatchExportPandocConvertZip(ids []string, pandocTo, ext string) (name, zipP
 	if "." == baseFolderName {
 	if "." == baseFolderName {
 		baseFolderName = path.Base(block.Path)
 		baseFolderName = path.Base(block.Path)
 	}
 	}
-	var docPaths []string
 
 
+	var docPaths []string
 	bts := treenode.GetBlockTrees(ids)
 	bts := treenode.GetBlockTrees(ids)
 	for _, bt := range bts {
 	for _, bt := range bts {
+		docPaths = append(docPaths, bt.Path)
 		docFiles := box.ListFiles(strings.TrimSuffix(bt.Path, ".sy"))
 		docFiles := box.ListFiles(strings.TrimSuffix(bt.Path, ".sy"))
 		for _, docFile := range docFiles {
 		for _, docFile := range docFiles {
 			docPaths = append(docPaths, docFile.path)
 			docPaths = append(docPaths, docFile.path)