mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-05 04:10:16 +01:00
Add database lineNumber field type (#11008)
* 🎨 add database lineNumber type * 🎨 fix https://github.com/siyuan-note/siyuan/issues/10896 * 🎨 Improve mobile app appearance language https://github.com/siyuan-note/siyuan/issues/11009 * 🎨 Improve database template field calc https://github.com/siyuan-note/siyuan/issues/11011 * ⬆️ Upgrade kernel deps * ⬆️ Upgrade kernel deps * 🎨 fix https://github.com/siyuan-note/siyuan/issues/10896 * 🎨 fix https://github.com/siyuan-note/siyuan/issues/10896 * 🐛 https://github.com/siyuan-note/siyuan/issues/11015 * 🐛 https://github.com/siyuan-note/siyuan/issues/11018 * 🐛 https://github.com/siyuan-note/siyuan/issues/11018 * 🎨 刚创建时无 id,更新需和 oldValue 保持一致 * 🐛 Database date field between filter calculation error Fix https://github.com/siyuan-note/siyuan/issues/10979 * 🐛 Primary key value unexpectedly updated when database adds row https://github.com/siyuan-note/siyuan/issues/11018 * 🎨 https://github.com/siyuan-note/siyuan/issues/11013 * 🎨 搜索可汇总字段时排除行号类型字段 https://github.com/siyuan-note/siyuan/pull/11008 * 🎨 lineNumber no need to join the calc op and remove useless todo tag --------- Co-authored-by: Vanessa <lly219@gmail.com> Co-authored-by: Daniel <845765@qq.com>
This commit is contained in:
parent
afeea6a80e
commit
8a354da50a
16 changed files with 224 additions and 108 deletions
|
|
@ -644,7 +644,7 @@ export const renderCellAttr = (cellElement: Element, value: IAVCellValue) => {
|
|||
}
|
||||
};
|
||||
|
||||
export const renderCell = (cellValue: IAVCellValue) => {
|
||||
export const renderCell = (cellValue: IAVCellValue, rowIndex = 0) => {
|
||||
let text = "";
|
||||
if (["text", "template"].includes(cellValue.type)) {
|
||||
text = `<span class="av__celltext">${cellValue ? (cellValue[cellValue.type as "text"].content || "") : ""}</span>`;
|
||||
|
|
@ -683,6 +683,9 @@ export const renderCell = (cellValue: IAVCellValue) => {
|
|||
text += dayjs(dataValue.content).format("YYYY-MM-DD HH:mm");
|
||||
}
|
||||
text += "</span>";
|
||||
} else if (["lineNumber"].includes(cellValue.type)) {
|
||||
// 渲染行号
|
||||
text = `<span class="av__celltext" data-value='${rowIndex + 1}'>${rowIndex + 1}</span>`;
|
||||
} else if (cellValue.type === "mAsset") {
|
||||
cellValue?.mAsset?.forEach((item) => {
|
||||
if (item.type === "image") {
|
||||
|
|
@ -713,8 +716,9 @@ export const renderCell = (cellValue: IAVCellValue) => {
|
|||
text = text.substring(0, text.length - 2);
|
||||
}
|
||||
}
|
||||
if (["text", "template", "url", "email", "phone", "number", "date", "created", "updated"].includes(cellValue.type) &&
|
||||
cellValue && cellValue[cellValue.type as "url"].content) {
|
||||
|
||||
if (["text", "template", "url", "email", "phone", "number", "date", "created", "updated", "lineNumber"].includes(cellValue.type) &&
|
||||
( cellValue.type === "lineNumber" || (cellValue && cellValue[cellValue.type as "url"].content))) {
|
||||
text += `<span ${cellValue.type !== "number" ? "" : 'style="right:auto;left:5px"'} data-type="copy" class="block__icon"><svg><use xlink:href="#iconCopy"></use></svg></span>`;
|
||||
}
|
||||
return text;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue