♻️ 感觉差不多了,剩下的就靠测试了 #92

This commit is contained in:
目棃
2024-07-03 22:33:00 +08:00
parent 8a2c7d13c6
commit f4de7552e1
28 changed files with 249 additions and 399 deletions

View File

@@ -9,7 +9,7 @@
</div>
</template>
<script lang="ts" setup>
import { appWindow } from "@tauri-apps/api/window";
import { webviewWindow } from "@tauri-apps/api";
import { ref, onMounted, reactive } from "vue";
import JsonViewer from "vue-json-viewer";
import { useRoute } from "vue-router";
@@ -33,7 +33,7 @@ let jsonList = reactive({});
let jsonContent = reactive({});
onMounted(async () => {
await appWindow.show();
await webviewWindow.getCurrent().show();
// 检查数据
if (!annoId) {
loadingEmpty.value = true;

View File

@@ -9,7 +9,7 @@
</div>
</template>
<script lang="ts" setup>
import { appWindow } from "@tauri-apps/api/window";
import { webviewWindow } from "@tauri-apps/api";
import { onMounted, reactive, ref } from "vue";
import JsonViewer from "vue-json-viewer";
import { useRoute } from "vue-router";
@@ -30,7 +30,7 @@ let parseData = reactive<TGApp.Plugins.Mys.SctPost.Base[]>([]);
const isEmpty = ref<boolean>(false);
onMounted(async () => {
await appWindow.show();
await webviewWindow.getCurrent().show();
if (!postId) {
loadingEmpty.value = true;
loadingTitle.value = "错误的 POST ID";

View File

@@ -160,7 +160,7 @@ onMounted(async () => {
const isDev = useAppStore().devMode ?? false;
if (isDev) {
await TGLogger.Info(`[t-post][${postId}][onMounted] 打开 JSON 窗口`);
createPostJson(postId);
await createPostJson(postId);
}
await nextTick(() => {
shareTimeTimer.value = setInterval(() => {
@@ -253,10 +253,10 @@ function parseContent(content: string): string {
return JSON.stringify(result);
}
function createPostJson(postId: number): void {
async function createPostJson(postId: number): Promise<void> {
const jsonPath = `/post_detail_json/${postId}`;
const jsonTitle = `Post_${postId}_JSON`;
createTGWindow(jsonPath, "Dev_JSON", jsonTitle, 960, 720, false, false);
await createTGWindow(jsonPath, "Dev_JSON", jsonTitle, 960, 720, false, false);
}
async function toPost(): Promise<void> {