Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:sparkles: https://github.com/siyuan-note/siyuan/issues/12091

Vanessa8e853fe66f01
diff --git a/app/src/protyle/render/av/col.ts b/app/src/protyle/render/av/col.ts
index ae6adbd93e..411912e907 100644
--- a/app/src/protyle/render/av/col.ts
+++ b/app/src/protyle/render/av/col.ts
@@ -193,7 +193,7 @@ export const getEditHTML = (options: {
<label class="b3-menu__item">
<span class="fn__flex-center">${window.siyuan.languages.includeTime}</span>
<span class="fn__space fn__flex-1"></span>
- <input data-type="includeTime" type="checkbox" class="b3-switch b3-switch--menu" ${colData.date?.includeTime ? "checked" : ""}>
+ <input data-type="includeTime" type="checkbox" class="b3-switch b3-switch--menu" ${colData[colData.type as "updated"].includeTime ? "checked" : ""}>
</label>`;
}
html += `<button class="b3-menu__separator" data-id="separator_3"></button>
@@ -376,17 +376,17 @@ export const bindEditEvent = (options: {
if (includeTimeElement) {
includeTimeElement.addEventListener("change", () => {
transaction(options.protyle, [{
- action: "setAttrViewUpdatedIncludeTime",
+ action: colData.type === "updated" ? "setAttrViewUpdatedIncludeTime" : "setAttrViewCreatedIncludeTime",
id: colId,
avID,
data: includeTimeElement.checked,
}], [{
- action: "setAttrViewUpdatedIncludeTime",
+ action: colData.type === "updated" ? "setAttrViewUpdatedIncludeTime" : "setAttrViewCreatedIncludeTime",
id: colId,
avID,
data: !includeTimeElement.checked,
}]);
- colData.includeTime = includeTimeElement.checked;
+ colData[colData.type as "updated"].includeTime = includeTimeElement.checked;
});
}
diff --git a/app/src/protyle/wysiwyg/transaction.ts b/app/src/protyle/wysiwyg/transaction.ts
index 6cdf4e35e7..6ee7ed9475 100644
--- a/app/src/protyle/wysiwyg/transaction.ts
+++ b/app/src/protyle/wysiwyg/transaction.ts
@@ -878,7 +878,8 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, isUndo:
"setAttrViewBlockView", "setAttrViewCardSize", "setAttrViewCardAspectRatio", "hideAttrViewName", "setAttrViewShowIcon",
"setAttrViewWrapField", "setAttrViewGroup", "removeAttrViewGroup", "hideAttrViewGroup", "sortAttrViewGroup",
"foldAttrViewGroup", "hideAttrViewAllGroups", "setAttrViewFitImage", "setAttrViewDisplayFieldName",
- "insertAttrViewBlock", "setAttrViewColDateFillSpecificTime", "setAttrViewFillColBackgroundColor"].includes(operation.action)) {
+ "insertAttrViewBlock", "setAttrViewColDateFillSpecificTime", "setAttrViewFillColBackgroundColor", "setAttrViewUpdatedIncludeTime",
+ "setAttrViewCreatedIncludeTime"].includes(operation.action)) {
// 撤销 transaction 会进行推送,需使用推送来进行刷新最新数据 https://github.com/siyuan-note/siyuan/issues/13607
if (!isUndo) {
refreshAV(protyle, operation);
diff --git a/app/src/types/index.d.ts b/app/src/types/index.d.ts
index 7062f6189a..f42ff385b3 100644
--- a/app/src/types/index.d.ts
+++ b/app/src/types/index.d.ts
@@ -72,6 +72,8 @@ type TOperation =
| "foldAttrViewGroup"
| "setAttrViewDisplayFieldName"
| "setAttrViewFillColBackgroundColor"
+ | "setAttrViewUpdatedIncludeTime"
+ | "setAttrViewCreatedIncludeTime"
type TBazaarType = "templates" | "icons" | "widgets" | "themes" | "plugins"
type TCardType = "doc" | "notebook" | "all"
type TEventBus = "ws-main" | "sync-start" | "sync-end" | "sync-fail" |
@@ -969,6 +971,12 @@ interface IAVColumn {
numberFormat: string,
template: string,
calc: IAVCalc,
+ updated?: {
+ includeTime: boolean
+ }
+ created?: {
+ includeTime: boolean
+ }
date?: {
autoFillNow: boolean,
fillSpecificTime: boolean,