mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-01 06:18:49 +01:00
This commit is contained in:
parent
591e451c3e
commit
df17081df5
2 changed files with 24 additions and 4 deletions
|
|
@ -56,9 +56,9 @@ export const avRender = (element: Element) => {
|
|||
// }]
|
||||
// };
|
||||
fetchPost("/api/av/renderAttributeView", {id: e.getAttribute("data-node-id")}, (response) => {
|
||||
const data = response.data
|
||||
const data = response.data.av;
|
||||
let tableHTML = '<div class="av__row av__row--header" style="background-color: var(--b3-theme-background)"><div class="av__firstcol"><input style="margin-top: 14px" type="checkbox"></div>';
|
||||
data.columns.forEach((column) => {
|
||||
data.columns.forEach((column: IAVColumn) => {
|
||||
tableHTML += `
|
||||
<div class="av__cell" style="width: ${column.width}px;">${column.name}</div>`
|
||||
});
|
||||
|
|
@ -68,10 +68,10 @@ export const avRender = (element: Element) => {
|
|||
<div class="block__icon block__icon--show"><svg><use xlink:href="#iconMore"></use></svg></div>
|
||||
</div>
|
||||
</div>`;
|
||||
data.rows.forEach((row) => {
|
||||
data.rows.forEach((row: IAVRow) => {
|
||||
tableHTML += `<div class="av__row" data-id="${row.id}"><div class="av__firstcol"><input type="checkbox"></div>`;
|
||||
row.cells.forEach((cell, index) => {
|
||||
tableHTML += `<div class="av__cell" style="width: ${data.columns[index].width}px;background-color: ${cell.bgColor||""};color: ${cell.color||""}">${cell.value}</div>`
|
||||
tableHTML += `<div class="av__cell" style="width: ${data.columns[index].width}px;background-color: ${cell.bgColor || ""};color: ${cell.color || ""}">${cell.value}</div>`
|
||||
});
|
||||
tableHTML += `<div></div></div>`;
|
||||
});
|
||||
|
|
|
|||
20
app/src/types/index.d.ts
vendored
20
app/src/types/index.d.ts
vendored
|
|
@ -799,3 +799,23 @@ interface IBazaarItem {
|
|||
hUpdated: string
|
||||
preferredFunding: string
|
||||
}
|
||||
|
||||
interface IAVColumn {
|
||||
width: number,
|
||||
icon: string,
|
||||
id: string,
|
||||
name: string,
|
||||
wrap: boolean,
|
||||
type: string,
|
||||
}
|
||||
|
||||
interface IAVRow {
|
||||
id: string,
|
||||
cells: IAVCell[]
|
||||
}
|
||||
|
||||
interface IAVCell {
|
||||
color: string,
|
||||
bgColor: string,
|
||||
value: string,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue