Vanessa 2024-05-20 10:56:25 +08:00
parent b148f646ca
commit 5d7c699390
2 changed files with 5 additions and 5 deletions

View file

@ -61,7 +61,7 @@ export const getAssetHTML = (cellElements: HTMLElement[]) => {
<img style="max-height: 180px;max-width: 360px;border-radius: var(--b3-border-radius);margin: 4px 0;" src="${item.content}"/>
</span>`;
} else {
contentHTML = `<span data-type="openAssetItem" class="fn__ellipsis b3-menu__label ariaLabel" aria-label="${item.content}" style="max-width: 360px">${item.name}</span>`;
contentHTML = `<span data-type="openAssetItem" class="fn__ellipsis b3-menu__label ariaLabel" aria-label="${item.content}" style="max-width: 360px">${item.name || item.content}</span>`;
}
html += `<button class="b3-menu__item" draggable="true" data-index="${index}" data-name="${item.name}" data-type="${item.type}" data-content="${item.content}">
@ -178,14 +178,14 @@ export const updateAssetCell = (options: {
export const editAssetItem = (options: {
protyle: IProtyle,
cellElements: HTMLElement[],
blockElement: Element ,
blockElement: Element,
content: string,
type: "image" | "file",
name: string,
index: number,
rect: DOMRect
}) => {
const linkAddress =options.content;
const linkAddress = options.content;
const type = options.type as "image" | "file";
const menu = new Menu("av-asset-edit", () => {
if (!textElements[0].value ||

View file

@ -119,7 +119,7 @@ export const genCellValueByElement = (colType: TAVCol, cellElement: HTMLElement)
mAsset.push({
type: isImg ? "image" : "file",
content: isImg ? item.getAttribute("src") : item.getAttribute("data-url"),
name: isImg ? "" : item.textContent
name: isImg ? "" : item.getAttribute("data-name")
});
});
cellValue.mAsset = mAsset;
@ -713,7 +713,7 @@ export const renderCell = (cellValue: IAVCellValue, rowIndex = 0) => {
if (item.type === "image") {
text += `<img class="av__cellassetimg ariaLabel" aria-label="${item.content}" src="${item.content}">`;
} else {
text += `<span class="b3-chip av__celltext--url ariaLabel" aria-label="${item.content}" data-url="${item.content}">${item.name}</span>`;
text += `<span class="b3-chip av__celltext--url ariaLabel" aria-label="${item.content}" data-name="${item.name}" data-url="${item.content}">${item.name || item.content}</span>`;
}
});
} else if (cellValue.type === "checkbox") {