This commit is contained in:
Vanessa 2024-03-08 12:37:54 +08:00
parent 1c4718fcb9
commit 67f095c522
7 changed files with 26 additions and 26 deletions

View file

@ -237,11 +237,11 @@ const filterItem = (menuElement: Element, cellElement: HTMLElement, keyword: str
const cells = response.data.rows.values as IAVCellValue[] || [];
let html = "";
let selectHTML = "";
const hasIds: string[] = []
const hasIds: string[] = [];
cellElement.querySelectorAll("span").forEach((item) => {
hasIds.push(item.dataset.id);
selectHTML += `<button data-id="${item.dataset.id}" data-type="setRelationCell" class="b3-menu__item${item.textContent.indexOf(keyword) > -1 ? "" : " fn__none"}" draggable="true">${genSelectItemHTML("selected", item.dataset.id, !item.classList.contains("av__celltext--ref"), item.textContent || "Untitled")}</button>`;
})
});
cells.forEach((item) => {
if (!hasIds.includes(item.block.id)) {
html += genSelectItemHTML("unselect", item.block.id, item.isDetached, item.block.content || "Untitled");
@ -267,11 +267,11 @@ export const bindRelationEvent = (options: {
const cells = response.data.rows.values as IAVCellValue[] || [];
let html = "";
let selectHTML = "";
const hasIds: string[] = []
const hasIds: string[] = [];
options.cellElements[0].querySelectorAll("span").forEach((item) => {
hasIds.push(item.dataset.id);
selectHTML += `<button data-id="${item.dataset.id}" data-type="setRelationCell" class="b3-menu__item" draggable="true">${genSelectItemHTML("selected", item.dataset.id, !item.classList.contains("av__celltext--ref"), item.textContent || "Untitled")}</button>`;
})
});
cells.forEach((item) => {
if (!hasIds.includes(item.block.id)) {
html += genSelectItemHTML("unselect", item.block.id, item.isDetached, item.block.content || "Untitled");