mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-19 08:00:13 +01:00
This commit is contained in:
parent
6c6f7d8ce2
commit
8e853fe66f
3 changed files with 14 additions and 5 deletions
|
|
@ -193,7 +193,7 @@ export const getEditHTML = (options: {
|
||||||
<label class="b3-menu__item">
|
<label class="b3-menu__item">
|
||||||
<span class="fn__flex-center">${window.siyuan.languages.includeTime}</span>
|
<span class="fn__flex-center">${window.siyuan.languages.includeTime}</span>
|
||||||
<span class="fn__space fn__flex-1"></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>`;
|
</label>`;
|
||||||
}
|
}
|
||||||
html += `<button class="b3-menu__separator" data-id="separator_3"></button>
|
html += `<button class="b3-menu__separator" data-id="separator_3"></button>
|
||||||
|
|
@ -376,17 +376,17 @@ export const bindEditEvent = (options: {
|
||||||
if (includeTimeElement) {
|
if (includeTimeElement) {
|
||||||
includeTimeElement.addEventListener("change", () => {
|
includeTimeElement.addEventListener("change", () => {
|
||||||
transaction(options.protyle, [{
|
transaction(options.protyle, [{
|
||||||
action: "setAttrViewUpdatedIncludeTime",
|
action: colData.type === "updated" ? "setAttrViewUpdatedIncludeTime" : "setAttrViewCreatedIncludeTime",
|
||||||
id: colId,
|
id: colId,
|
||||||
avID,
|
avID,
|
||||||
data: includeTimeElement.checked,
|
data: includeTimeElement.checked,
|
||||||
}], [{
|
}], [{
|
||||||
action: "setAttrViewUpdatedIncludeTime",
|
action: colData.type === "updated" ? "setAttrViewUpdatedIncludeTime" : "setAttrViewCreatedIncludeTime",
|
||||||
id: colId,
|
id: colId,
|
||||||
avID,
|
avID,
|
||||||
data: !includeTimeElement.checked,
|
data: !includeTimeElement.checked,
|
||||||
}]);
|
}]);
|
||||||
colData.includeTime = includeTimeElement.checked;
|
colData[colData.type as "updated"].includeTime = includeTimeElement.checked;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -878,7 +878,8 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, isUndo:
|
||||||
"setAttrViewBlockView", "setAttrViewCardSize", "setAttrViewCardAspectRatio", "hideAttrViewName", "setAttrViewShowIcon",
|
"setAttrViewBlockView", "setAttrViewCardSize", "setAttrViewCardAspectRatio", "hideAttrViewName", "setAttrViewShowIcon",
|
||||||
"setAttrViewWrapField", "setAttrViewGroup", "removeAttrViewGroup", "hideAttrViewGroup", "sortAttrViewGroup",
|
"setAttrViewWrapField", "setAttrViewGroup", "removeAttrViewGroup", "hideAttrViewGroup", "sortAttrViewGroup",
|
||||||
"foldAttrViewGroup", "hideAttrViewAllGroups", "setAttrViewFitImage", "setAttrViewDisplayFieldName",
|
"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
|
// 撤销 transaction 会进行推送,需使用推送来进行刷新最新数据 https://github.com/siyuan-note/siyuan/issues/13607
|
||||||
if (!isUndo) {
|
if (!isUndo) {
|
||||||
refreshAV(protyle, operation);
|
refreshAV(protyle, operation);
|
||||||
|
|
|
||||||
8
app/src/types/index.d.ts
vendored
8
app/src/types/index.d.ts
vendored
|
|
@ -72,6 +72,8 @@ type TOperation =
|
||||||
| "foldAttrViewGroup"
|
| "foldAttrViewGroup"
|
||||||
| "setAttrViewDisplayFieldName"
|
| "setAttrViewDisplayFieldName"
|
||||||
| "setAttrViewFillColBackgroundColor"
|
| "setAttrViewFillColBackgroundColor"
|
||||||
|
| "setAttrViewUpdatedIncludeTime"
|
||||||
|
| "setAttrViewCreatedIncludeTime"
|
||||||
type TBazaarType = "templates" | "icons" | "widgets" | "themes" | "plugins"
|
type TBazaarType = "templates" | "icons" | "widgets" | "themes" | "plugins"
|
||||||
type TCardType = "doc" | "notebook" | "all"
|
type TCardType = "doc" | "notebook" | "all"
|
||||||
type TEventBus = "ws-main" | "sync-start" | "sync-end" | "sync-fail" |
|
type TEventBus = "ws-main" | "sync-start" | "sync-end" | "sync-fail" |
|
||||||
|
|
@ -969,6 +971,12 @@ interface IAVColumn {
|
||||||
numberFormat: string,
|
numberFormat: string,
|
||||||
template: string,
|
template: string,
|
||||||
calc: IAVCalc,
|
calc: IAVCalc,
|
||||||
|
updated?: {
|
||||||
|
includeTime: boolean
|
||||||
|
}
|
||||||
|
created?: {
|
||||||
|
includeTime: boolean
|
||||||
|
}
|
||||||
date?: {
|
date?: {
|
||||||
autoFillNow: boolean,
|
autoFillNow: boolean,
|
||||||
fillSpecificTime: boolean,
|
fillSpecificTime: boolean,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue