完善桌面端交互体验与发布检查

This commit is contained in:
Cheng Zhou
2026-06-30 22:26:34 +08:00
parent 628ff8828b
commit c923f887a0
30 changed files with 2507 additions and 141 deletions
+11 -1
View File
@@ -164,7 +164,7 @@
</template>
<script setup lang="ts">
import { onMounted, reactive, ref, computed, watch } from "vue";
import { computed, onBeforeUnmount, onMounted, reactive, ref, watch } from "vue";
import { useRoute, useRouter } from "vue-router";
import { ElMessage, ElMessageBox, FormInstance, FormRules } from "element-plus";
import { Plus } from "@element-plus/icons-vue";
@@ -178,6 +178,7 @@ import type { DocumentSummary } from "../../types/documents";
import type { Site } from "../../types/api";
import { displayDateTime, displayEnum, displayText } from "../../utils/display";
import { TEXT } from "../../locales";
import { onDesktopRefreshCurrentView } from "../../composables/useDesktopRefresh";
const route = useRoute();
const router = useRouter();
@@ -191,6 +192,7 @@ const editorVisible = ref(false);
const saving = ref(false);
const editingDocumentId = ref("");
const editorFormRef = ref<FormInstance>();
let desktopRefreshCleanup: (() => void) | undefined;
const trialId = computed(() => (route.params.trialId as string) || "");
@@ -436,6 +438,14 @@ onMounted(() => {
ensureTrialRoute();
load();
loadSites();
desktopRefreshCleanup = onDesktopRefreshCurrentView(() => {
load();
loadSites();
});
});
onBeforeUnmount(() => {
desktopRefreshCleanup?.();
});
watch(