🎨 子窗口缩减为两个label Sub_window 和 Dev_JSON

This commit is contained in:
BTMuli
2023-09-16 14:29:05 +08:00
parent d3eb5b7ab0
commit 0a9f3d2483
11 changed files with 54 additions and 26 deletions

View File

@@ -1,4 +1,5 @@
<!-- eslint-disable vue/no-v-html -->
<!-- todo 优化显示样式 -->
<template>
<TSwitchTheme />
<TShareBtn
@@ -66,14 +67,14 @@ onMounted(async () => {
loadingTitle.value = "正在渲染数据...";
annoHtml.value = await TGUtils.Anno.parseContent(annoData.value.content);
if (annoData.value.banner !== "") annoBanner.value = await saveImgLocal(annoData.value.banner);
annoTitle.value = `【公告】${annoId}-${annoData.value.title}`;
await appWindow.setTitle(annoTitle.value);
annoTitle.value = `Anno_${annoId}`;
await appWindow.setTitle(`Anno_${annoId} ${annoData.value.title}`);
annoRef.value = <HTMLElement>document.querySelector(".anno-body");
} catch (error) {
console.error(error);
loadingEmpty.value = true;
loadingTitle.value = "公告不存在或解析失败";
await appWindow.setTitle(`【公告】${annoId}-公告不存在或解析失败`);
await appWindow.setTitle(`Anno_${annoId} Parsing Error`);
return;
}
setTimeout(() => {

View File

@@ -406,7 +406,7 @@ async function toPost(item: TGApp.Plugins.Mys.News.RenderCard | string): Promise
post_id: item,
},
}).href;
createTGWindow(path, "帖子-Dev", item, 960, 720, false, false);
createTGWindow(path, "Sub_window", `Post_${item}`, 960, 720, false, false);
} else {
const path = router.resolve({
name: "帖子详情",
@@ -414,7 +414,7 @@ async function toPost(item: TGApp.Plugins.Mys.News.RenderCard | string): Promise
post_id: item.postId.toString(),
},
}).href;
createTGWindow(path, "帖子", item.title, 960, 720, false, false);
createTGWindow(path, "Sub_window", `Post_${item.postId} ${item.title}`, 960, 720, false, false);
}
}
@@ -426,7 +426,7 @@ async function toJson(item: TGApp.Plugins.Mys.News.RenderCard | string): Promise
post_id: item,
},
}).href;
createTGWindow(path, "帖子-JSON-Dev", `${item}-JSON`, 960, 720, false, false);
createTGWindow(path, "Dev_JSON", `Post_${item}_JSON`, 960, 720, false, false);
} else {
const path = router.resolve({
name: "帖子详情JSON",
@@ -434,7 +434,15 @@ async function toJson(item: TGApp.Plugins.Mys.News.RenderCard | string): Promise
post_id: item.postId.toString(),
},
}).href;
createTGWindow(path, "帖子-JSON", `${item.title}-JSON`, 960, 720, false, false);
createTGWindow(
path,
"Dev_JSON",
`Post_${item.postId}_JSON ${item.title}`,
960,
720,
false,
false,
);
}
}

View File

@@ -1,4 +1,5 @@
<!-- eslint-disable vue/no-v-html -->
<!-- todo 添加更多信息 -->
<template>
<TSwitchTheme />
<TShareBtn
@@ -71,15 +72,15 @@ onMounted(async () => {
created: new Date(postData.post.created_at * 1000).toLocaleString().replace(/\//g, "-"),
updated: new Date(postData.post.updated_at * 1000).toLocaleString().replace(/\//g, "-"),
};
shareTitle.value = `【帖子】${postId}-${postData.post.subject}`;
shareTitle.value = `Post_${postId}`;
postRef.value = <HTMLElement>document.querySelector(".mys-post-body");
await appWindow.setTitle(shareTitle.value);
await appWindow.setTitle(`Post_${postId} ${postData.post.subject}`);
} catch (error) {
console.error(error);
loadingEmpty.value = true;
loadingTitle.value = "帖子不存在或解析失败";
loadingSub.value = error instanceof Error ? error.message : <string>error;
await appWindow.setTitle(`【帖子】${postId}-解析失败`);
await appWindow.setTitle(`Post_${postId} Parsing Error`);
return;
}
setTimeout(() => {