An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: https://github.com/siyuan-note/siyuan/issues/10964
Vanessac339d1b9bc1d
diff --git a/app/src/protyle/render/av/groups.ts b/app/src/protyle/render/av/groups.tsindex 05421fa1e9..6db5a549ba 100644--- a/app/src/protyle/render/av/groups.ts+++ b/app/src/protyle/render/av/groups.ts@@ -1,20 +1,20 @@import {unicode2Emoji} from "../../../emoji";import {getColIconByType} from "./col";import {escapeHtml} from "../../../util/escape";-import {transaction} from "../../wysiwyg/transaction";import {setPosition} from "../../../util/setPosition";import {getFieldsByData} from "./view";+import {fetchSyncPost} from "../../../util/fetch";-export const setGroupMethod = (options: {+export const setGroupMethod = async (options: {protyle: IProtyle;fieldId: string;data: IAV;menuElement: HTMLElement,blockElement: Element,}) => {- const blockID = options.blockElement.getAttribute("data-block-id");+ const blockID = options.blockElement.getAttribute("data-node-id");const column: IAVColumn = getFieldsByData(options.data).find(item => item.id === options.fieldId);- const data = {+ const data = column ? {field: options.fieldId,method: column.type === "number" ? 1 : (["date", "updated", "created"].includes(column.type) ? 2 : 0),order: 0,@@ -23,24 +23,13 @@ export const setGroupMethod = (options: {numEnd: 1000,numStep: 100,} : null- };- transaction(options.protyle, [{- action: "setAttrViewGroup",- avID: options.data.id,+ } : {field: null, method: null, order: null, range: null};+ const response = await fetchSyncPost("/api/av/setAttrViewGroup", {blockID,- data- }], [{- action: "setAttrViewGroup",- avID: options.data.id,- blockID,- data: {- field: options.data.view.group?.field || "",- method: options.data.view.group?.method || "",- order: options.data.view.group?.order || "",- range: options.data.view.group?.range || ""- }- }]);- options.data.view.group = data;+ avID: options.blockElement.getAttribute("data-av-id"),+ group: data+ });+ options.data.view = response.data.view;options.menuElement.innerHTML = getGroupsHTML(getFieldsByData(options.data), options.data.view);// bindGroupsEvent(options.protyle, options.menuElement, options.data, blockID);const tabRect = options.blockElement.querySelector(".av__views").getBoundingClientRect();@@ -141,7 +130,7 @@ export const getGroupsHTML = (columns: IAVColumn[], view: IAVView) => {<button class="b3-menu__item"><span class="fn__flex-center">${window.siyuan.languages.hideEmptyGroup}</span><span class="fn__space fn__flex-1"></span>- <input type="checkbox" class="b3-switch b3-switch--menu">+ <input type="checkbox" class="b3-switch b3-switch--menu"${view.group.hideEmpty ? " checked" : ""}></button>${groupHTML}<button class="b3-menu__separator"></button>diff --git a/app/src/protyle/render/av/openMenuPanel.ts b/app/src/protyle/render/av/openMenuPanel.tsindex 1daceb1637..4df71d97f7 100644--- a/app/src/protyle/render/av/openMenuPanel.ts+++ b/app/src/protyle/render/av/openMenuPanel.ts@@ -1441,7 +1441,7 @@ export const openMenuPanel = (options: {target,protyle: options.protyle,nodeElement: options.blockElement,- data: data+ data});fields = getFieldsByData(data);event.preventDefault();diff --git a/app/src/types/index.d.ts b/app/src/types/index.d.tsindex f0b90af694..478dbee9e5 100644--- a/app/src/types/index.d.ts+++ b/app/src/types/index.d.ts@@ -898,6 +898,7 @@ interface IAVGroup {numEnd: number // 数字范围结束值 1000numStep: number // 数字范围步长 100}+ hideEmpty?: booleanorder?: number // 升序: 0(默认), 降序: 1, 手动排序: 2}