🐛 数据库加载更多后的操作

This commit is contained in:
Vanessa 2023-12-19 17:02:10 +08:00
parent c9eed7c86d
commit c301a4ac0a

View File

@ -13,7 +13,7 @@ import {previewImage} from "../../preview/image";
import {genAVValueHTML} from "./blockAttr";
import {hideMessage, showMessage} from "../../../dialog/message";
import {fetchPost} from "../../../util/fetch";
import {hasClosestByClassName} from "../../util/hasClosest";
import {hasClosestBlock, hasClosestByClassName} from "../../util/hasClosest";
export const bindAssetEvent = (options: {
protyle: IProtyle,
@ -334,6 +334,8 @@ export const dragUpload = (files: string[], protyle: IProtyle, cellElement: HTML
isUpload: true,
id: protyle.block.rootID
}, (response) => {
const blockElement = hasClosestBlock(cellElement);
if (blockElement) {
hideMessage(msgId);
const addUpdateValue: IAVCellAssetValue[] = [];
Object.keys(response.data.succMap).forEach(key => {
@ -355,6 +357,7 @@ export const dragUpload = (files: string[], protyle: IProtyle, cellElement: HTML
});
fetchPost("/api/av/renderAttributeView", {
id: avID,
pageSize: parseInt(blockElement.getAttribute("data-page-size")) || undefined,
}, (response) => {
updateAssetCell({
protyle,
@ -364,5 +367,6 @@ export const dragUpload = (files: string[], protyle: IProtyle, cellElement: HTML
addUpdateValue
});
});
}
});
};