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: database
Vanessa01298253356f
diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.tsindex 4f03f19216..60f268b69b 100644--- a/app/src/protyle/render/av/cell.ts+++ b/app/src/protyle/render/av/cell.ts@@ -66,7 +66,7 @@ export const getCalcValue = (column: IAVColumn) => {export const genCellValue = (colType: TAVCol, value: string | {content: string,color: string-}[] | { content?: number, content2?: number, hasEndDate?: boolean }) => {+}[] | IAVCellDateValue) => {let cellValue: IAVCellValue;if (typeof value === "string") {if (colType === "number") {@@ -106,7 +106,9 @@ export const genCellValue = (colType: TAVCol, value: string | {type: colType,date: {content: null,+ isNotEmpty: false,content2: null,+ isNotEmpty2: false,hasEndDate: false,}};@@ -123,7 +125,7 @@ export const genCellValue = (colType: TAVCol, value: string | {} else if (colType === "date") {cellValue = {type: colType,- date: value as { content?: number, content2?: number, hasEndDate?: boolean }+ date: value as IAVCellDateValue};}}diff --git a/app/src/protyle/render/av/date.ts b/app/src/protyle/render/av/date.tsindex 79107e21ab..a36ef6c3d4 100644--- a/app/src/protyle/render/av/date.ts+++ b/app/src/protyle/render/av/date.ts@@ -3,7 +3,7 @@ import * as dayjs from "dayjs";export const getDateHTML = (data: IAVTable, cellElements: HTMLElement[]) => {let hasEndDate = true;- let cellValue:IAVCell;+ let cellValue: IAVCell;cellElements.forEach((cellElement) => {data.rows.find(row => {if (cellElement.parentElement.dataset.id === row.id) {@@ -24,11 +24,11 @@ export const getDateHTML = (data: IAVTable, cellElements: HTMLElement[]) => {hasEndDate = false;}let value = "";- if (cellValue?.value?.date?.content) {+ if (cellValue?.value?.date?.isNotEmpty) {value = dayjs(cellValue.value.date.content).format("YYYY-MM-DDTHH:mm");}let value2 = "";- if (cellValue?.value?.date?.content2) {+ if (cellValue?.value?.date?.isNotEmpty2) {value2 = dayjs(cellValue.value.date.content2).format("YYYY-MM-DDTHH:mm");}return `<div class="b3-menu__items">@@ -128,7 +128,10 @@ export const setDateValue = (options: {cellData.value = {};}oldValue = Object.assign({}, cellData.value.date);- cellData.value.date = Object.assign(cellData.value.date || {}, options.value);+ cellData.value.date = Object.assign(cellData.value.date || {+ isNotEmpty2: false,+ isNotEmpty: false+ }, options.value);return true;}});diff --git a/app/src/protyle/render/av/filter.ts b/app/src/protyle/render/av/filter.tsindex 373f361a25..3cd93d8582 100644--- a/app/src/protyle/render/av/filter.ts+++ b/app/src/protyle/render/av/filter.ts@@ -61,6 +61,8 @@ export const setFilter = (options: {if (textElements.length > 0) {if (colData.type === "date") {cellValue = genCellValue(colData.type, {+ isNotEmpty2: textElements[1].value !== "",+ isNotEmpty: textElements[0].value !== "",content: new Date(textElements[0].value).getTime(),content2: new Date(textElements[1].value).getTime(),hasEndDate: operator === "Is between"@@ -219,11 +221,11 @@ export const setFilter = (options: {} else if (colData.type === "date") {menu.addItem({iconHTML: "",- label: `<input style="margin: 4px 0" value="${options.filter.value?.date.content ? dayjs(options.filter.value.date.content).format("YYYY-MM-DDTHH:mm") : ""}" type="datetime-local" class="b3-text-field fn__size200">`+ label: `<input style="margin: 4px 0" value="${options.filter.value?.date.isNotEmpty ? dayjs(options.filter.value.date.content).format("YYYY-MM-DDTHH:mm") : ""}" type="datetime-local" class="b3-text-field fn__size200">`});menu.addItem({iconHTML: "",- label: `<input style="margin: 4px 0" value="${options.filter.value?.date.content2 ? dayjs(options.filter.value.date.content2).format("YYYY-MM-DDTHH:mm") : ""}" type="datetime-local" class="b3-text-field fn__size200">`+ label: `<input style="margin: 4px 0" value="${options.filter.value?.date.isNotEmpty2 ? dayjs(options.filter.value.date.content2).format("YYYY-MM-DDTHH:mm") : ""}" type="datetime-local" class="b3-text-field fn__size200">`});}menu.addItem({diff --git a/app/src/protyle/render/av/render.ts b/app/src/protyle/render/av/render.tsindex 909f77a74f..7548d0b08c 100644--- a/app/src/protyle/render/av/render.ts+++ b/app/src/protyle/render/av/render.ts@@ -91,10 +91,10 @@ style="width: ${column.width || "200px"}">${getCalcValue(column) || '<svg><use x}} else if (cell.valueType === "date") {text = '<span class="av__celltext">';- if (cell.value?.date.content) {+ if (cell.value?.date.isNotEmpty) {text += dayjs(cell.value.date.content).format("YYYY-MM-DD HH:mm");}- if (cell.value?.date.hasEndDate && cell.value?.date.content && cell.value?.date.content2) {+ if (cell.value?.date.hasEndDate && cell.value?.date.isNotEmpty && cell.value?.date.isNotEmpty2) {text += `<svg style="margin-left: 5px"><use xlink:href="#iconForward"></use></svg>${dayjs(cell.value.date.content2).format("YYYY-MM-DD HH:mm")}`;}text += "</span>";@@ -223,10 +223,10 @@ const genAVValueHTML = (value: IAVCellValue) => {});break;case "date":- if (value.date.content) {+ if (value.date.isNotEmpty) {html = `<span data-content="${value.date.content}">${dayjs(value.date.content).format("YYYY-MM-DD HH:mm")}</span>`;}- if (value.date.hasEndDate && value.date.content && value.date.content2) {+ if (value.date.hasEndDate && value.date.isNotEmpty2 && value.date.isNotEmpty) {html += `<svg class="custom-attr__avarrow"><use xlink:href="#iconForward"></use></svg><span data-content="${value.date.content2}">${dayjs(value.date.content2).format("YYYY-MM-DD HH:mm")}</span>`;}break;@@ -285,6 +285,8 @@ class="fn__flex-1 fn__flex${["url", "text", "number"].includes(item.values[0].tycellID: dateElement.dataset.id,value: {date: {+ isNotEmpty: textElements[0].value !== "",+ isNotEmpty2: textElements[1].value !== "",content: new Date(textElements[0].value).getTime(),content2: new Date(textElements[1].value).getTime(),hasEndDate@@ -292,10 +294,10 @@ class="fn__flex-1 fn__flex${["url", "text", "number"].includes(item.values[0].ty}});let dataHTML = "";- if (textElements[0].value) {+ if (textElements[0].value !== "") {dataHTML = `<span data-content="${new Date(textElements[0].value).getTime()}">${dayjs(textElements[0].value).format("YYYY-MM-DD HH:mm")}</span>`;}- if (hasEndDate && textElements[0].value && textElements[1].value) {+ if (hasEndDate && textElements[0].value !== "" && textElements[1].value !== "") {dataHTML += `<svg class="custom-attr__avarrow"><use xlink:href="#iconForward"></use></svg><span data-content="${new Date(textElements[1].value).getTime()}">${dayjs(textElements[1].value).format("YYYY-MM-DD HH:mm")}</span>`;}dateElement.innerHTML = dataHTML;diff --git a/app/src/types/index.d.ts b/app/src/types/index.d.tsindex 4cc0242370..c14f1062f2 100644--- a/app/src/types/index.d.ts+++ b/app/src/types/index.d.ts@@ -932,5 +932,13 @@ interface IAVCellValue {mSelect?: { content: string, color: string }[]block?: { content: string, id: string }url?: { content: string }- date?: { content?: number, content2?: number, hasEndDate?: boolean }+ date?: IAVCellDateValue+}++interface IAVCellDateValue {+ content?: number,+ isNotEmpty: boolean+ content2?: number,+ isNotEmpty2: boolean+ hasEndDate?: boolean}