Vanessa 2023-12-18 12:06:01 +08:00
parent 9e14e24efb
commit 81db6b2a63
4 changed files with 8 additions and 6 deletions

View file

@ -115,7 +115,6 @@
} }
&:hover { &:hover {
[data-type="block-ref"],
[data-type="block-more"] { [data-type="block-more"] {
display: block; display: block;
} }
@ -250,7 +249,6 @@
cursor: pointer; cursor: pointer;
// display: flex; 不需要使用否则 av__celltext 会占满单元格导致链接列点击空白无法进行编辑 // display: flex; 不需要使用否则 av__celltext 会占满单元格导致链接列点击空白无法进行编辑
[data-type="block-ref"],
[data-type="block-more"] { [data-type="block-more"] {
display: none; display: none;
position: absolute; position: absolute;

View file

@ -229,7 +229,7 @@
background-color: var(--b3-theme-secondary); background-color: var(--b3-theme-secondary);
} }
span[data-type~="block-ref"], span[data-type~="block-ref"]:not(.av__celltext),
span[data-type~="file-annotation-ref"] { span[data-type~="file-annotation-ref"] {
color: var(--b3-protyle-inline-blockref-color); color: var(--b3-protyle-inline-blockref-color);
opacity: .86; opacity: .86;

View file

@ -153,6 +153,9 @@ export const genCellValue = (colType: TAVCol, value: string | any) => {
}; };
} }
} }
if (colType === "block") {
cellValue.isDetached = true;
}
return cellValue; return cellValue;
}; };

View file

@ -148,11 +148,12 @@ style="width: ${column.width || "200px"}">${getCalcValue(column) || '<svg><use x
} }
text = `<span class="av__celltext av__celltext--url" data-type="${cell.valueType}"${urlAttr}>${urlContent}</span>`; text = `<span class="av__celltext av__celltext--url" data-type="${cell.valueType}"${urlAttr}>${urlContent}</span>`;
} else if (cell.valueType === "block") { } else if (cell.valueType === "block") {
text = `<span class="av__celltext${cell.value?.isDetached ? "" : " av__celltext--ref"}">${cell.value.block.content || ""}</span>`;
if (cell.value?.isDetached) { if (cell.value?.isDetached) {
text += `<span class="b3-chip b3-chip--info b3-chip--small" data-type="block-more" >${window.siyuan.languages.more}</span>`; text = `<span class="av__celltext${cell.value?.isDetached ? "" : " av__celltext--ref"}">${cell.value.block.content || ""}</span>
<span class="b3-chip b3-chip--info b3-chip--small" data-type="block-more">${window.siyuan.languages.more}</span>`;
} else { } else {
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>`; text = `<span data-type="block-ref" data-id="${cell.value.block.id}" data-subtype="s" class="av__celltext${cell.value?.isDetached ? "" : " av__celltext--ref"}">${cell.value.block.content || ""}</span>
<span class="b3-chip b3-chip--info b3-chip--small" data-type="block-more">${window.siyuan.languages.update}</span>`;
} }
} else if (cell.valueType === "number") { } else if (cell.valueType === "number") {
text = `<span style="float: right;${data.columns[index].wrap ? "word-break: break-word;" : ""}" class="av__celltext" data-content="${cell.value?.number.isNotEmpty ? cell.value?.number.content : ""}">${cell.value?.number.formattedContent || ""}</span>`; text = `<span style="float: right;${data.columns[index].wrap ? "word-break: break-word;" : ""}" class="av__celltext" data-content="${cell.value?.number.isNotEmpty ? cell.value?.number.content : ""}">${cell.value?.number.formattedContent || ""}</span>`;