This commit is contained in:
Vanessa 2024-03-04 21:52:29 +08:00
parent 220e0b137f
commit 30db8f4eb0
4 changed files with 5 additions and 5 deletions

View file

@ -65,7 +65,7 @@ export const setFilter = async (options: {
if (rectTarget.height === 0) { if (rectTarget.height === 0) {
rectTarget = options.protyle.wysiwyg.element.querySelector(`[data-col-id="${options.target.dataset.colId}"]`).getBoundingClientRect(); rectTarget = options.protyle.wysiwyg.element.querySelector(`[data-col-id="${options.target.dataset.colId}"]`).getBoundingClientRect();
} }
const blockID = options.blockElement.getAttribute("data-node-id") const blockID = options.blockElement.getAttribute("data-node-id");
const menu = new Menu("set-filter-" + options.filter.column, () => { const menu = new Menu("set-filter-" + options.filter.column, () => {
const oldFilters = JSON.parse(JSON.stringify(options.data.view.filters)); const oldFilters = JSON.parse(JSON.stringify(options.data.view.filters));
const selectElement = menu.element.querySelector(".b3-select") as HTMLSelectElement; const selectElement = menu.element.querySelector(".b3-select") as HTMLSelectElement;
@ -510,7 +510,7 @@ export const addFilter = (options: {
operator: getDefaultOperatorByType(column.type), operator: getDefaultOperatorByType(column.type),
value: cellValue, value: cellValue,
type: column.type type: column.type
} };
options.data.view.filters.push(filter); options.data.view.filters.push(filter);
options.menuElement.innerHTML = getFiltersHTML(options.data.view); options.menuElement.innerHTML = getFiltersHTML(options.data.view);
setPosition(options.menuElement, options.tabRect.right - options.menuElement.clientWidth, options.tabRect.bottom, options.tabRect.height); setPosition(options.menuElement, options.tabRect.right - options.menuElement.clientWidth, options.tabRect.bottom, options.tabRect.height);

View file

@ -715,7 +715,7 @@ export const openMenuPanel = (options: {
id, id,
blockID blockID
}]); }]);
options.blockElement.setAttribute(Constants.CUSTOM_SY_AV_VIEW, id) options.blockElement.setAttribute(Constants.CUSTOM_SY_AV_VIEW, id);
avPanelElement.remove(); avPanelElement.remove();
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();

View file

@ -169,7 +169,7 @@ const updatePageSize = (options: {
return; return;
} }
options.nodeElement.setAttribute("data-page-size", options.newPageSize); options.nodeElement.setAttribute("data-page-size", options.newPageSize);
const blockID = options.nodeElement.getAttribute("data-node-id") const blockID = options.nodeElement.getAttribute("data-node-id");
transaction(options.protyle, [{ transaction(options.protyle, [{
action: "setAttrViewPageSize", action: "setAttrViewPageSize",
avID: options.avID, avID: options.avID,

View file

@ -57,7 +57,7 @@ export const openViewMenu = (options: { protyle: IProtyle, blockElement: HTMLEle
id, id,
blockID: options.blockElement.dataset.nodeId blockID: options.blockElement.dataset.nodeId
}]); }]);
options.blockElement.setAttribute(Constants.CUSTOM_SY_AV_VIEW, id) options.blockElement.setAttribute(Constants.CUSTOM_SY_AV_VIEW, id);
} }
}); });
menu.addItem({ menu.addItem({