This commit is contained in:
Vanessa 2023-02-07 11:58:24 +08:00
parent ee721e8e94
commit 42065d6daa
11 changed files with 77 additions and 53 deletions

View file

@ -5,6 +5,8 @@ import {ipcRenderer} from "electron";
import {Constants} from "../constants";
import {Tab} from "../layout/Tab";
import {fetchPost} from "../util/fetch";
import {lockFile} from "../dialog/processSystem";
import {showMessage} from "../dialog/message";
export const openNewWindow = (tab: Tab) => {
const json = {};
@ -17,6 +19,15 @@ export const openNewWindow = (tab: Tab) => {
export const openNewWindowById = (id: string) => {
fetchPost("api/block/getBlockInfo", {id}, (response) => {
if (response.code === 2) {
// 文件被锁定
lockFile(response.data);
return false;
}
if (response.code === 3) {
showMessage(response.msg);
return;
}
const json: any = {
title: response.data.rootTitle,
docIcon: response.data.rootIcon,