admin_new/src/modules/other/operateguide/OperateguideListView.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

63 lines
2.0 KiB
Vue

<script setup lang="ts">
/**
* F006 操作指南 - W3.x C P0.4
* 走 /other/operateguide/page
*/
import { onMounted, ref, reactive } from 'vue'
import { httpGet } from '@/utils/request'
import DataTable from '@/components/DataTable/DataTable.vue'
interface Guide {
id: string
title: string
content: string
viewSum: number | null
createTime: string
images: string | null
raw: any
}
const list = ref<Guide[]>([])
const total = ref(0)
const loading = ref(false)
const query = reactive({ page: 1, limit: 20 })
const columns = [
{ prop: 'id', label: 'ID', width: 80 },
{ prop: 'title', label: '标题', minWidth: 240 },
{ prop: 'viewSum', label: '浏览数', width: 100, formatter: (r: Guide) => String(r.viewSum ?? 0) },
{ prop: 'createTime', label: '创建时间', width: 180 }
]
async function load() {
loading.value = true
try {
const resp: any = await httpGet('/other/operateguide/page', { page: query.page, limit: query.limit })
list.value = resp?.list || []
total.value = Number(resp?.total || 0)
} catch { list.value = []; total.value = 0 } finally { loading.value = false }
}
function onPageChange(p: number) { query.page = p; load() }
onMounted(load)
</script>
<template>
<div class="rr-page">
<div class="rr-page-header">
<h2 class="rr-page-title">内容列表</h2>
<p class="rr-page-sub">操作指南内容(共 {{ total }} 条)</p>
</div>
<div class="rr-card">
<DataTable :columns="columns" :data="list" :loading="loading" :total="total" :page="query.page" :limit="query.limit" :show-pagination="true" row-key="id" empty-text="暂无内容" @page-change="onPageChange" />
</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); overflow: hidden; }
</style>