添加release字段,调整WIKI角色页面排序

close #180
This commit is contained in:
BTMuli
2025-12-14 14:50:42 +08:00
parent 7544fa1489
commit a1befe8eff
4 changed files with 143 additions and 43 deletions

View File

@@ -36,11 +36,10 @@ import { useRoute } from "vue-router";
import { AppCharacterData } from "@/data/index.js";
// 先按star降序再按元素排序再按id降序
const appCData = AppCharacterData.sort((a, b) => {
if (a.star !== b.star) return b.star - a.star;
if (a.element !== b.element) return a.element.localeCompare(b.element);
return b.id - a.id;
});
const appCData = AppCharacterData.sort(
(a, b) =>
b.star - a.star || new Date(b.release).getTime() - new Date(a.release).getTime() || b.id - a.id,
);
const id = useRoute().params.id.toString() ?? "0";
const showSelect = ref<boolean>(false);
@@ -55,6 +54,7 @@ const curItem = shallowRef<TGApp.App.Character.WikiBriefInfo>({
birthday: [0, 0],
star: 0,
element: "",
release: "",
weapon: "",
nameCard: "",
});