dev-tmp1
tangjie 2026-08-26 15:49:45 +08:00
parent 5f9674de7b
commit c116b4aed8
1 changed files with 15 additions and 9 deletions

View File

@ -74,6 +74,10 @@ const App = (props) => {
throw new Error(res?.errMessage || res?.message || "上传失败"); throw new Error(res?.errMessage || res?.message || "上传失败");
} }
setFileId(newFileId); setFileId(newFileId);
props.queryMyOrCreateDoc({
docxUrl: "",
projectId:router.query.id,
});
message.success("Word 文件上传成功,已在编辑器中打开"); message.success("Word 文件上传成功,已在编辑器中打开");
}) })
.catch((e) => { .catch((e) => {
@ -157,12 +161,12 @@ const App = (props) => {
}, },
...(readOnly ...(readOnly
? { ? {
commonOptions: { commonOptions: {
isBrowserViewMode: true, isBrowserViewMode: true,
// 只读模式下隐藏 WPS 顶部区域(头部和工具栏),页面已有自己的标题栏 // 只读模式下隐藏 WPS 顶部区域(头部和工具栏),页面已有自己的标题栏
isShowTopArea: false, isShowTopArea: false,
}, },
} }
: {}), : {}),
}); });
await instance.ready(); await instance.ready();
@ -349,9 +353,11 @@ const App = (props) => {
size="small" size="small"
onClick={() => { onClick={() => {
props props
.createWpsDoc({ data:{ .createWpsDoc({
docxUrl: url, projectId: router.query.id data: {
}}) docxUrl: url, projectId: router.query.id
}
})
.then((res) => { .then((res) => {
const fileId = res?.data?.fileId; const fileId = res?.data?.fileId;
if (!fileId) { if (!fileId) {