diff --git a/src/views/Achievement/AchievementSidebar.vue b/src/views/Achievement/AchievementSidebar.vue index 4bd2d1e..534a9e9 100644 --- a/src/views/Achievement/AchievementSidebar.vue +++ b/src/views/Achievement/AchievementSidebar.vue @@ -7,11 +7,11 @@ v-if="!hideFinished || (achievementFinStat[i.id || 0]?.count || 0) < i.achievements.length" :to="{ params: { - cat: i.key === 'wonders_of_the_world' ? '' : i.key, + cat: i.key === 'wonders-of-the-world' ? '' : i.key, }, }" - :active-class="i.key === 'wonders_of_the_world' ? '' : 'router-link-active'" - :exact-active-class="i.key === 'wonders_of_the_world' ? 'router-link-active' : ''" + :active-class="i.key === 'wonders-of-the-world' ? '' : 'router-link-active'" + :exact-active-class="i.key === 'wonders-of-the-world' ? 'router-link-active' : ''" >
{{ amos[i.name] }} diff --git a/src/views/Achievement/Index.vue b/src/views/Achievement/Index.vue index 5bfc6ea..cc52d82 100644 --- a/src/views/Achievement/Index.vue +++ b/src/views/Achievement/Index.vue @@ -125,6 +125,7 @@ v-model="statusVersion" class="status-version" multiple + clearable collapse-tags collapse-tags-tooltip placeholder="所有版本" @@ -148,6 +149,7 @@ { - return route.params.cat || DEFAULTCAT + return route.params.cat || ALLCAT }) const currentCat = computed(() => { - const v = achievementCat.value.find((i) => i.key === currentCatId.value) || achievementCat.value[0] + let v: AchievementCategory + if (currentCatId.value === ALLCAT) { + v = { achievements: [], key: ALLCAT, id: 0, name: 0, order: 0, totalReward: 0 } + // 整合所有成就便于做整体的搜索 + for (let i = 0; i < achievementCat.value.length; i++) { + v.achievements.push(...achievementCat.value[i].achievements) + } + } else { + v = achievementCat.value.find((i) => i.key === currentCatId.value) || achievementCat.value[0] + } const q = {} as Record v.achievements.forEach((e) => { if (e.trigger.task && e.trigger.task.length > 0) { q[e.id] = e.trigger.task[0].type + } else if (e.trigger.type && badgeTypeMap[e.trigger.type]) { + q[e.id] = badgeTypeMap[e.trigger.type] } }) return { @@ -611,7 +626,7 @@ export default defineComponent({ } return data }) - const checkIfAllCat = computed(() => currentCatId.value === DEFAULTCAT) + const checkIfAllCat = computed(() => currentCatId.value === DEFAULTCAT || currentCatId.value === ALLCAT) const checkAllCat = (checked: boolean) => { const data = currentCat.value.achievements.concat([]) if (checked) {