mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-14 09:38:13 +08:00
fix(sth): 优化样式
This commit is contained in:
@@ -16,17 +16,17 @@
|
|||||||
</template>
|
</template>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
<!-- 菜单项 -->
|
<!-- 菜单项 -->
|
||||||
<v-list-item value="home" title="首页" @click="toPage('home')">
|
<v-list-item value="home" title="首页" link href="/">
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<img src="/source/UI/paimon.webp" alt="homeIcon" class="sideIcon" />
|
<img src="/source/UI/paimon.webp" alt="homeIcon" class="sideIcon" />
|
||||||
</template>
|
</template>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
<v-list-item title="咨讯" value="news" @click="toPage('news')">
|
<v-list-item title="咨讯" value="news" link href="/news">
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<img src="../assets/icons/board.svg" alt="newsIcon" class="sideIcon" />
|
<img src="../assets/icons/board.svg" alt="newsIcon" class="sideIcon" />
|
||||||
</template>
|
</template>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
<v-list-item title="成就" value="achievements" @click="toPage('achievements')">
|
<v-list-item title="成就" value="achievements" link href="/achievements">
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<img src="../assets/icons/achievements.svg" alt="achievementsIcon" class="sideIcon" />
|
<img src="../assets/icons/achievements.svg" alt="achievementsIcon" class="sideIcon" />
|
||||||
</template>
|
</template>
|
||||||
@@ -34,20 +34,20 @@
|
|||||||
<v-divider></v-divider>
|
<v-divider></v-divider>
|
||||||
<v-list-group value="database" fluid>
|
<v-list-group value="database" fluid>
|
||||||
<template v-slot:activator="{ props }">
|
<template v-slot:activator="{ props }">
|
||||||
<v-list-item title="数据库" v-bind="props">
|
<v-list-item title="数据库" v-bind="props" @click="submenu('database')">
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<v-icon color="rgb(205, 182, 145)">mdi-database</v-icon>
|
<v-icon color="rgb(205, 182, 145)">mdi-database</v-icon>
|
||||||
</template>
|
</template>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
</template>
|
</template>
|
||||||
<v-list-item title="GCG" value="GCG" @click="toPage('GCG')">
|
<v-list-item title="GCG" value="GCG" link href="/GCG">
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<img src="../assets/icons/GCG.svg" alt="gcgIcon" class="sideIcon" />
|
<img src="../assets/icons/GCG.svg" alt="gcgIcon" class="sideIcon" />
|
||||||
</template>
|
</template>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
</v-list-group>
|
</v-list-group>
|
||||||
<v-divider></v-divider>
|
<v-divider></v-divider>
|
||||||
<v-list-item title="设置" value="config" @click="toPage('config')">
|
<v-list-item title="设置" value="config" link href="/config">
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<img src="../assets/icons/setting.svg" alt="setting" class="sideIcon" />
|
<img src="../assets/icons/setting.svg" alt="setting" class="sideIcon" />
|
||||||
</template>
|
</template>
|
||||||
@@ -58,22 +58,22 @@
|
|||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
import { useRouter } from "vue-router";
|
|
||||||
import useAppStore from "../store/modules/app";
|
import useAppStore from "../store/modules/app";
|
||||||
|
|
||||||
const router = useRouter();
|
|
||||||
const appStore = useAppStore();
|
const appStore = useAppStore();
|
||||||
|
|
||||||
const rail = ref(appStore.sidebar);
|
const rail = ref(appStore.sidebar.collapse);
|
||||||
const open = ref(["database"]);
|
const open = ref(appStore.getSubmenu());
|
||||||
|
|
||||||
function collapse() {
|
function collapse() {
|
||||||
rail.value = !rail.value;
|
rail.value = !rail.value;
|
||||||
appStore.sidebar = rail.value;
|
appStore.sidebar.collapse = rail.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
function toPage(link: string) {
|
function submenu(value: string) {
|
||||||
router.push(link);
|
if (value === "database") {
|
||||||
|
appStore.sidebar.submenu.database = open.value.includes(value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -266,7 +266,14 @@ async function importJson() {
|
|||||||
const localTime = localData.completed_time;
|
const localTime = localData.completed_time;
|
||||||
// 如果本地数据不存在,或者本地数据的 timeStamp 小于远程数据的 timeStamp,更新数据
|
// 如果本地数据不存在,或者本地数据的 timeStamp 小于远程数据的 timeStamp,更新数据
|
||||||
if (data.timestamp !== 0) {
|
if (data.timestamp !== 0) {
|
||||||
const fin_time = new Date(data.timestamp * 1000).toLocaleString();
|
const fin_time = new Date(data.timestamp * 1000).toLocaleString("zh", {
|
||||||
|
year: "numeric",
|
||||||
|
month: "2-digit",
|
||||||
|
day: "2-digit",
|
||||||
|
hour: "2-digit",
|
||||||
|
minute: "2-digit",
|
||||||
|
second: "2-digit",
|
||||||
|
});
|
||||||
if (fin_time !== localTime || localData.progress !== data.current) {
|
if (fin_time !== localTime || localData.progress !== data.current) {
|
||||||
localData.completed_time = fin_time;
|
localData.completed_time = fin_time;
|
||||||
localData.progress = data.current;
|
localData.progress = data.current;
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ async function loadData() {
|
|||||||
}
|
}
|
||||||
function toOuter(card_name: string, card_id: number) {
|
function toOuter(card_name: string, card_id: number) {
|
||||||
const url = MysContent.replace("content_id", card_id.toString());
|
const url = MysContent.replace("content_id", card_id.toString());
|
||||||
createTGWindow(url, "GCG", card_name, 1600, 900, true);
|
createTGWindow(url, "GCG", card_name, 1200, 800, true);
|
||||||
}
|
}
|
||||||
async function searchCard() {
|
async function searchCard() {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
@@ -128,6 +128,7 @@ async function searchCard() {
|
|||||||
const res: BaseCard[] = [];
|
const res: BaseCard[] = [];
|
||||||
const allCardsInfo = await ReadAllTGData("GCG");
|
const allCardsInfo = await ReadAllTGData("GCG");
|
||||||
allCardsInfo.map(item => (item.name.includes(search.value) ? res.push(item) : null));
|
allCardsInfo.map(item => (item.name.includes(search.value) ? res.push(item) : null));
|
||||||
|
res.sort((a, b) => a.name.localeCompare(b.name));
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
if (res.length == 0) {
|
if (res.length == 0) {
|
||||||
await dialog.message("未找到相关卡牌");
|
await dialog.message("未找到相关卡牌");
|
||||||
|
|||||||
@@ -251,7 +251,7 @@ async function toPost(post_id: string) {
|
|||||||
|
|
||||||
.Home-pool-clock {
|
.Home-pool-clock {
|
||||||
width: auto;
|
width: auto;
|
||||||
margin-left: 120px;
|
margin-left: 40px;
|
||||||
float: right;
|
float: right;
|
||||||
font-size: small;
|
font-size: small;
|
||||||
height: 80px;
|
height: 80px;
|
||||||
|
|||||||
@@ -22,7 +22,14 @@ const useAppStore = defineStore({
|
|||||||
// 是否加载数据
|
// 是否加载数据
|
||||||
loading: false,
|
loading: false,
|
||||||
// 侧边栏设置
|
// 侧边栏设置
|
||||||
sidebar: true,
|
sidebar: {
|
||||||
|
// 是否折叠
|
||||||
|
collapse: false,
|
||||||
|
// 是否显示
|
||||||
|
submenu: {
|
||||||
|
database: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
// 咨讯页渲染模式
|
// 咨讯页渲染模式
|
||||||
structureRender: true, // 是否采用结构化渲染,否则采用 raw 渲染
|
structureRender: true, // 是否采用结构化渲染,否则采用 raw 渲染
|
||||||
// 数据路径
|
// 数据路径
|
||||||
@@ -44,11 +51,22 @@ const useAppStore = defineStore({
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
|
// 获取折叠
|
||||||
|
getSubmenu() {
|
||||||
|
let open = [];
|
||||||
|
if (this.sidebar.submenu.database) open.push("database");
|
||||||
|
return open;
|
||||||
|
},
|
||||||
// 初始化配置
|
// 初始化配置
|
||||||
async init() {
|
async init() {
|
||||||
// 防止数据清空
|
// 防止数据清空
|
||||||
if (this.sidebar === undefined) {
|
if (this.sidebar === undefined) {
|
||||||
this.sidebar = true;
|
this.sidebar = {
|
||||||
|
collapse: false,
|
||||||
|
submenu: {
|
||||||
|
database: false,
|
||||||
|
},
|
||||||
|
};
|
||||||
}
|
}
|
||||||
// 初始化加载状态
|
// 初始化加载状态
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user