🚧 Optimize

This commit is contained in:
2025-09-30 00:28:15 +08:00
parent 4d6a4ff79f
commit cf8bf688bf
36 changed files with 1520 additions and 3896 deletions

View File

@@ -1,20 +1,24 @@
import {computed} from 'vue';
import {computed, ref} from 'vue';
import {defineStore} from 'pinia';
import {IsDocumentWindowOpen} from "@/../bindings/voidraft/internal/services/windowservice";
export const useWindowStore = defineStore('window', () => {
const DOCUMENT_ID_KEY = ref<string>('documentId');
// 判断是否为主窗口
const isMainWindow = computed(() => {
const urlParams = new URLSearchParams(window.location.search);
return !urlParams.has('documentId');
return !urlParams.has(DOCUMENT_ID_KEY.value);
});
// 获取当前窗口的documentId
const currentDocumentId = computed(() => {
const urlParams = new URLSearchParams(window.location.search);
return urlParams.get('documentId');
return urlParams.get(DOCUMENT_ID_KEY.value);
});
/**
* 判断文档窗口是否打开
* @param documentId 文档ID