Files
ndm-web-platform/src/pages/system/changelog/changelog-page.vue
T
yangsy d53e107ebc feat: 新增平台更新记录页面
- 添加 changelog 类型定义和导出
- 新增更新记录页面组件,支持从 JSON 文件加载并展示版本变更信息
- 在路由中添加更新记录页面路径
- 在设置抽屉中为版本信息添加点击跳转功能,可查看完整更新记录
- 添加包含历史版本变更的 changelogs.json 数据文件
2026-03-02 15:10:31 +08:00

59 lines
1.7 KiB
Vue

<script setup lang="ts">
import type { Changelog } from '@/apis';
import { useQuery } from '@tanstack/vue-query';
import axios from 'axios';
import { NH1, NH2, NH3, NLi, NP, NScrollbar, NText, NUl } from 'naive-ui';
import { computed } from 'vue';
const CHENGELOGS_QUERY_KEY = 'changelogs-query';
const { data: changelogs = [] } = useQuery({
queryKey: computed(() => [CHENGELOGS_QUERY_KEY]),
queryFn: async ({ signal }) => {
const response = await axios.get<Changelog[]>(`changelogs.json?t=${Date.now()}`, { signal });
return response.data;
},
});
</script>
<template>
<NScrollbar content-style="padding: 32px 24px 56px 56px" style="width: 100%; height: 100%">
<NH1>平台更新记录</NH1>
<template v-for="{ version, date, changes } in changelogs" :key="version">
<NH2>{{ version }}</NH2>
<NP>
<NText code>{{ date }}</NText>
</NP>
<template v-if="(changes.breaks?.length ?? 0) > 0">
<NH3>重大变更</NH3>
<template v-for="({ content }, index) in changes.breaks" :key="index">
<NUl>
<NLi>{{ content }}</NLi>
</NUl>
</template>
</template>
<template v-if="(changes.fixes?.length ?? 0) > 0">
<NH3>修复</NH3>
<template v-for="({ content }, index) in changes.fixes" :key="index">
<NUl>
<NLi>{{ content }}</NLi>
</NUl>
</template>
</template>
<template v-if="(changes.feats?.length ?? 0) > 0">
<NH3>新增</NH3>
<template v-for="({ content }, index) in changes.feats" :key="index">
<NUl>
<NLi>{{ content }}</NLi>
</NUl>
</template>
</template>
</template>
</NScrollbar>
</template>
<style scoped></style>