From 568b0b5db7e85999df98bd967c4dd9d134585fc7 Mon Sep 17 00:00:00 2001 From: BTMuli Date: Wed, 20 Dec 2023 00:47:26 +0800 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20=E5=85=AC=E5=91=8A?= =?UTF-8?q?=E9=A1=B5=E7=9A=84=E7=AA=97=E5=8F=A3=E5=88=9B=E5=BB=BA=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E4=B9=9F=E9=A1=BA=E4=BE=BF=E6=94=B9=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/common/Announcements.vue | 8 +++++++- src/utils/TGWindow.ts | 22 +--------------------- src/views/t-anno.vue | 14 +++++++++++++- src/views/t-post.vue | 4 ++-- 4 files changed, 23 insertions(+), 25 deletions(-) diff --git a/src/pages/common/Announcements.vue b/src/pages/common/Announcements.vue index fedb6875..94331907 100644 --- a/src/pages/common/Announcements.vue +++ b/src/pages/common/Announcements.vue @@ -44,7 +44,7 @@ import { nextTick, onMounted, ref } from "vue"; import { useRouter } from "vue-router"; import ToLoading from "../../components/overlay/to-loading.vue"; -import { createAnno } from "../../utils/TGWindow"; +import { createTGWindow } from "../../utils/TGWindow"; import TGRequest from "../../web/request/TGRequest"; import TGUtils from "../../web/utils/TGUtils"; @@ -100,6 +100,12 @@ function parseTitle(title: string): string { async function switchNews(): Promise { await router.push("/news/2"); } + +function createAnno(item: TGApp.App.Announcement.ListCard): void { + const annoPath = `/anno_detail/${item.id}`; + const annoTitle = `Anno_${item.id} ${item.title}`; + createTGWindow(annoPath, "Sub_window", annoTitle, 960, 720, false, false); +} diff --git a/src/views/t-post.vue b/src/views/t-post.vue index a4a2e689..b37ef7dc 100644 --- a/src/views/t-post.vue +++ b/src/views/t-post.vue @@ -166,7 +166,7 @@ onMounted(async () => { // 打开 json const isDev = useAppStore().devMode ?? false; if (isDev) { - createPostJson(postId.toString()); + createPostJson(postId); } await nextTick(() => { loading.value = false; @@ -236,7 +236,7 @@ function parseContent(content: string): string { return JSON.stringify(result); } -function createPostJson(postId: string): void { +function createPostJson(postId: number): void { const jsonPath = `/post_detail_json/${postId}`; const jsonTitle = `Post_${postId}_JSON`; createTGWindow(jsonPath, "Dev_JSON", jsonTitle, 960, 720, false, false);