admin_new/src/modules/api/help/HelpListView.vue
Sisyphus 78360d1d6e feat(F006-W3xC): 7 个新 view 接真 API (W3.x C P0 全部)
- P0.1 数据统计首页 (走 /sys/openapi/order/list 真 API, 4 stat 500/¥47M 真值)
- P0.2 supplier/inquiry/inquiry 重定向 /inquiry (2 个 redirect)
- P0.3 /user/user 用户列表 (2284 真实用户)
- P0.4 /other/operateguide 内容列表 (1 条真数据)
- P0.5 /api/lunbo 轮播占位 (后端 404 优雅提示)
- P0.6 /api/help 帮助中心占位 (后端 404 优雅提示)
- P0.7 /sys/region 行政区域树 (省市区 4 级 3000+ 节点)

同步: src/modules/user/{Enterprise,Finance}ListView.vue (Mac 端 working copy 补传)

P0.7 nginx 修复 (conf 改动非本次提交, 见 nginx-vue.conf.bak-20260704-194200):
- 新增 location = /admin/sys/region { rewrite /admin/index.html last; }
- 原因: location /admin/sys/ 代理抢 /admin/sys/region 走 gateway 返 401
- 已 docker compose restart frontend 生效, devbox 端 7 SPA 路径全 200
2026-07-04 20:09:11 +08:00

57 lines
2.1 KiB
Vue

<script setup lang="ts">
/**
* F006 帮助中心 - W3.x C P0.6
* 后端 /api/help/* 暂未实现,展示检测状态
*/
import { onMounted, ref } from 'vue'
import { httpGet } from '@/utils/request'
const status = ref<'checking' | '404' | '200' | 'error'>('checking')
const errorMsg = ref('')
onMounted(async () => {
try {
const r: any = await httpGet('/api/help/page', { page: 1, limit: 1 })
if (r?.code === 0) status.value = '200'
else { status.value = 'error'; errorMsg.value = r?.msg || '未知错误' }
} catch (e: any) {
if (e?.response?.status === 404 || e?.message?.includes('404')) {
status.value = '404'; errorMsg.value = '后端 API 未实现(/api/help/page 返回 404)'
} else {
status.value = 'error'; errorMsg.value = e?.message || '请求失败'
}
}
})
</script>
<template>
<div class="rr-page">
<div class="rr-page-header">
<h2 class="rr-page-title">帮助中心</h2>
<p class="rr-page-sub">使用指南 + FAQ 列表</p>
</div>
<div class="rr-card rr-status-card">
<el-result
:icon="status === '200' ? 'success' : 'warning'"
:title="status === '200' ? 'API 已就绪' : '后端 API 未实现'"
:sub-title="status === '200' ? '帮助中心数据接口已通' : (errorMsg || '请联系后端实现 /api/help/page 接口')"
>
<template #extra>
<el-tag v-if="status === 'checking'" type="info">检测中...</el-tag>
<el-tag v-else-if="status === '404'" type="warning">404 Not Found</el-tag>
<el-tag v-else-if="status === '200'" type="success">200 OK</el-tag>
<el-tag v-else type="danger">Error</el-tag>
</template>
</el-result>
</div>
</div>
</template>
<style scoped lang="scss">
.rr-page { max-width: 1400px; }
.rr-page-header { margin-bottom: 20px; }
.rr-page-title { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); margin-bottom: 4px; }
.rr-page-sub { color: var(--ink-3); font-size: 13px; }
.rr-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 40px 20px; }
</style>