mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 16:40:13 +01:00
🚨
This commit is contained in:
parent
46e395189d
commit
ecb413660f
3 changed files with 8 additions and 9 deletions
|
|
@ -5,13 +5,13 @@ import {Menu} from "../../../plugin/Menu";
|
|||
|
||||
export const getCalcValue = (column: IAVColumn) => {
|
||||
if (!column.calc || !column.calc.result) {
|
||||
return ""
|
||||
return "";
|
||||
}
|
||||
const resultCalc = column.calc.result.number
|
||||
const resultCalc = column.calc.result.number;
|
||||
let value = "";
|
||||
switch (column.calc.operator) {
|
||||
case "Count all":
|
||||
value = `<span>${resultCalc.content}</span>${window.siyuan.languages.calcResultCountAll}`
|
||||
value = `<span>${resultCalc.content}</span>${window.siyuan.languages.calcResultCountAll}`;
|
||||
break;
|
||||
case "Count values":
|
||||
value = `<span>${resultCalc.content}</span>${window.siyuan.languages.calcResultCountValues}`;
|
||||
|
|
@ -51,7 +51,7 @@ export const getCalcValue = (column: IAVColumn) => {
|
|||
break;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
};
|
||||
|
||||
export const genCellValue = (colType: TAVCol, value: string | {
|
||||
content: string,
|
||||
|
|
@ -132,7 +132,7 @@ const calcItem = (options: {
|
|||
}]);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
export const openCalcMenu = (protyle: IProtyle, calcElement: HTMLElement) => {
|
||||
const blockElement = hasClosestBlock(calcElement);
|
||||
if (!blockElement) {
|
||||
|
|
@ -279,7 +279,7 @@ export const openCalcMenu = (protyle: IProtyle, calcElement: HTMLElement) => {
|
|||
}
|
||||
const calcRect = calcElement.getBoundingClientRect();
|
||||
menu.open({x: calcRect.left, y: calcRect.bottom, h: calcRect.height});
|
||||
}
|
||||
};
|
||||
|
||||
export const popTextCell = (protyle: IProtyle, cellElement: HTMLElement) => {
|
||||
const type = cellElement.parentElement.parentElement.firstElementChild.querySelector(`[data-col-id="${cellElement.getAttribute("data-col-id")}"]`).getAttribute("data-dtype") as TAVCol;
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ export const avRender = (element: Element, cb?: () => void) => {
|
|||
const data = response.data.view as IAVTable;
|
||||
// header
|
||||
let tableHTML = '<div class="av__row av__row--header"><div class="av__firstcol"><svg style="height: 32px"><use xlink:href="#iconUncheck"></use></svg></div>';
|
||||
let calcHTML = ''
|
||||
let calcHTML = "";
|
||||
data.columns.forEach((column: IAVColumn) => {
|
||||
if (column.hidden) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ import {transaction} from "../../wysiwyg/transaction";
|
|||
import {hasClosestByClassName} from "../../util/hasClosest";
|
||||
import {confirmDialog} from "../../../dialog/confirmDialog";
|
||||
import {upDownHint} from "../../../util/upDownHint";
|
||||
import {genCellValue} from "./cell";
|
||||
|
||||
const filterSelectHTML = (key: string, options: { name: string, color: string }[]) => {
|
||||
let html = "";
|
||||
|
|
@ -361,7 +360,7 @@ export const addSelectColAndCell = (protyle: IProtyle, data: IAV, options: {
|
|||
cellIndex = index;
|
||||
return true;
|
||||
}
|
||||
})
|
||||
});
|
||||
let colData: IAVColumn;
|
||||
data.view.columns.find((item: IAVColumn) => {
|
||||
if (item.id === colId) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue