mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-19 08:00:13 +01:00
This commit is contained in:
parent
6f741b53cf
commit
8b35e7f8bf
2 changed files with 18 additions and 6 deletions
|
|
@ -643,7 +643,10 @@
|
||||||
|
|
||||||
.av {
|
.av {
|
||||||
.b3-chip[data-type="block-more"],
|
.b3-chip[data-type="block-more"],
|
||||||
.av__row--util,
|
.av__row--util:not(.av__readonly--show),
|
||||||
|
.av__row--footer:not(.av__readonly--show),
|
||||||
|
.av__row--util .b3-button[data-type="av-add-bottom"],
|
||||||
|
.av__row--util svg[data-type="set-page-size"],
|
||||||
.av__row--header > .block__icons,
|
.av__row--header > .block__icons,
|
||||||
.av__views .fn__space,
|
.av__views .fn__space,
|
||||||
.av__views .block__icon:not([data-type="av-search-icon"]),
|
.av__views .block__icon:not([data-type="av-search-icon"]),
|
||||||
|
|
@ -651,7 +654,7 @@
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.av__row--footer {
|
.av__row--util:not(.av__readonly--show) + .av__row--footer.av__readonly--show {
|
||||||
border-top-color: transparent;
|
border-top-color: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -662,5 +665,10 @@
|
||||||
.av__row--footer:hover .av__calc:not(.av__calc--ashow) {
|
.av__row--footer:hover .av__calc:not(.av__calc--ashow) {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.av__row--footer .av__calc:hover,
|
||||||
|
.av__cell--header:hover {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -114,6 +114,7 @@ export const avRender = (element: Element, protyle: IProtyle, cb?: () => void, v
|
||||||
tableHTML = '<div class="av__row av__row--header"><div class="av__colsticky"><div class="av__firstcol"><svg><use xlink:href="#iconUncheck"></use></svg></div>';
|
tableHTML = '<div class="av__row av__row--header"><div class="av__colsticky"><div class="av__firstcol"><svg><use xlink:href="#iconUncheck"></use></svg></div>';
|
||||||
calcHTML = '<div class="av__colsticky">';
|
calcHTML = '<div class="av__colsticky">';
|
||||||
}
|
}
|
||||||
|
let hasCalc = false;
|
||||||
data.columns.forEach((column: IAVColumn, index: number) => {
|
data.columns.forEach((column: IAVColumn, index: number) => {
|
||||||
if (column.hidden) {
|
if (column.hidden) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -130,13 +131,16 @@ style="width: ${column.width || "200px"};">
|
||||||
tableHTML += "</div>";
|
tableHTML += "</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
// lineNumber type 不参与计算操作
|
|
||||||
if (column.type === "lineNumber") {
|
if (column.type === "lineNumber") {
|
||||||
calcHTML += `<div data-col-id="${column.id}" data-dtype="${column.type}" style="display: flex; width: ${column.width || "200px"}"> </div>`;
|
// lineNumber type 不参与计算操作
|
||||||
|
calcHTML += `<div data-col-id="${column.id}" data-dtype="${column.type}" style="width: ${column.width || "200px"}"> </div>`;
|
||||||
} else {
|
} else {
|
||||||
calcHTML += `<div class="av__calc${column.calc && column.calc.operator !== "" ? " av__calc--ashow" : ""}" data-col-id="${column.id}" data-dtype="${column.type}" data-operator="${column.calc?.operator || ""}"
|
calcHTML += `<div class="av__calc${column.calc && column.calc.operator !== "" ? " av__calc--ashow" : ""}" data-col-id="${column.id}" data-dtype="${column.type}" data-operator="${column.calc?.operator || ""}"
|
||||||
style="width: ${column.width || "200px"}">${getCalcValue(column) || '<svg><use xlink:href="#iconDown"></use></svg>' + window.siyuan.languages.calc}</div>`;
|
style="width: ${column.width || "200px"}">${getCalcValue(column) || '<svg><use xlink:href="#iconDown"></use></svg>' + window.siyuan.languages.calc}</div>`;
|
||||||
}
|
}
|
||||||
|
if (column.calc && column.calc.operator !== "") {
|
||||||
|
hasCalc = true
|
||||||
|
}
|
||||||
|
|
||||||
if (pinIndex === index) {
|
if (pinIndex === index) {
|
||||||
calcHTML += "</div>";
|
calcHTML += "</div>";
|
||||||
|
|
@ -247,7 +251,7 @@ ${cell.color ? `color:${cell.color};` : ""}">${renderCell(cell.value, rowIndex)}
|
||||||
<div class="av__scroll">
|
<div class="av__scroll">
|
||||||
<div class="av__body">
|
<div class="av__body">
|
||||||
${tableHTML}
|
${tableHTML}
|
||||||
<div class="av__row--util">
|
<div class="av__row--util${data.rowCount > data.rows.length ? " av__readonly--show" : ""}">
|
||||||
<div class="av__colsticky">
|
<div class="av__colsticky">
|
||||||
<button class="b3-button" data-type="av-add-bottom">
|
<button class="b3-button" data-type="av-add-bottom">
|
||||||
<svg><use xlink:href="#iconAdd"></use></svg>
|
<svg><use xlink:href="#iconAdd"></use></svg>
|
||||||
|
|
@ -263,7 +267,7 @@ ${cell.color ? `color:${cell.color};` : ""}">${renderCell(cell.value, rowIndex)}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="av__row--footer">${calcHTML}</div>
|
<div class="av__row--footer${hasCalc?" av__readonly--show":""}">${calcHTML}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="av__cursor" contenteditable="true">${Constants.ZWSP}</div>
|
<div class="av__cursor" contenteditable="true">${Constants.ZWSP}</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue