feat(admin): 成就管理标题显示条数
有下架的成就时一并显示下架条数——列表里只有"上架:否"那一列能看出来, 扫一眼容易漏。数据未加载完时退回纯标题,避免闪一下"0 条"。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -23,6 +23,15 @@ const RARITY_LABEL: Record<string, string> = {
|
||||
platinum: "白金",
|
||||
}
|
||||
|
||||
// 下架的只在有的时候才提,全部上架时标题不啰嗦
|
||||
const title = computed(() => {
|
||||
if (!list.value.length) return "成就管理"
|
||||
const offline = list.value.filter((a) => !a.visible).length
|
||||
return offline
|
||||
? `成就管理(${list.value.length} 条,${offline} 条下架)`
|
||||
: `成就管理(${list.value.length} 条)`
|
||||
})
|
||||
|
||||
async function load() {
|
||||
loading.value = true
|
||||
try {
|
||||
@@ -115,7 +124,7 @@ onMounted(load)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-card title="成就管理">
|
||||
<n-card :title="title">
|
||||
<template #header-extra>
|
||||
<n-button type="primary" @click="create">新建成就</n-button>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user