Vanessa 2023-08-03 23:23:28 +08:00
parent 2baa74fb39
commit eb7548962f
11 changed files with 36 additions and 4 deletions

View file

@ -79,7 +79,7 @@ style="width: ${column.width || "200px"}">${getCalcValue(column) || '<svg><use x
text += `<span class="b3-chip b3-chip--info b3-chip--small" data-type="block-ref" data-id="${cell.value.block.id}" data-subtype="s">${window.siyuan.languages.openBy}</span>`;
}
} else if (cell.valueType === "number") {
text = `<span class="av__celltext">${cell.value?.number.content || ""}</span>`;
text = `<span class="av__celltext" data-content="${cell.value?.number.content || ""}">${cell.value?.number.formattedContent || ""}</span>`;
} else if (cell.valueType === "mSelect" || cell.valueType === "select") {
cell.value?.mSelect?.forEach((item: { content: string, color: string }) => {
text += `<span class="b3-chip b3-chip--middle" style="background-color:var(--b3-font-background${item.color});color:var(--b3-font-color${item.color})">${item.content}</span>`;
@ -90,12 +90,12 @@ style="width: ${column.width || "200px"}">${getCalcValue(column) || '<svg><use x
text = `<span class="av__celltext">${text}</span>`;
}
} else if (cell.valueType === "date") {
text = '<span class="av__celltext">';
text = '<span class="av__celltext av__celltext--date">';
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.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 += `<svg><use xlink:href="#iconForward"></use></svg>${dayjs(cell.value.date.content2).format("YYYY-MM-DD HH:mm")}`;
}
text += "</span>";
}
@ -104,6 +104,7 @@ ${cell.valueType === "block" ? 'data-block-id="' + (cell.value.block.id || "") +
style="width: ${data.columns[index].width || "200px"};
${cell.bgColor ? `background-color:${cell.bgColor};` : ""}
${data.columns[index].wrap ? "" : "white-space: nowrap;"}
${cell.valueType !== "number" ? "" : "flex-direction: row-reverse;"}
${cell.color ? `color:${cell.color};` : ""}">${text}</div>`;
});
tableHTML += "<div></div></div>";