feat(ECR-040): ExploreConfig ScaleDefinition 只读投影并 Closed
复用 scales 表只读投影;admin-h5 /catalogs 聚合 026–040 目录;Loop 队列 STOP。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -457,6 +457,10 @@ export const adminApi = {
|
||||
request<{ items: Array<Record<string, unknown>> }>('GET', '/content-safety/cases'),
|
||||
case: (id: string) =>
|
||||
request<Record<string, unknown>>('GET', `/content-safety/cases/${id}`),
|
||||
events: () =>
|
||||
request<{ items: Array<Record<string, unknown>> }>('GET', '/crisis/events'),
|
||||
event: (id: string) =>
|
||||
request<Record<string, unknown>>('GET', `/crisis/events/${id}`),
|
||||
interventions: () =>
|
||||
request<{ items: Array<Record<string, unknown>> }>('GET', '/crisis/interventions'),
|
||||
intervention: (id: string) =>
|
||||
@@ -467,7 +471,7 @@ export const adminApi = {
|
||||
request<Record<string, unknown>>('GET', `/ask/handoffs/${id}`),
|
||||
requests: () =>
|
||||
request<{ items: Array<Record<string, unknown>> }>('GET', '/privacy/requests'),
|
||||
request: (id: string) =>
|
||||
privacyRequest: (id: string) =>
|
||||
request<Record<string, unknown>>('GET', `/privacy/requests/${id}`),
|
||||
starConfigs: () =>
|
||||
request<{ items: Array<Record<string, unknown>> }>('GET', '/explore/star-configs'),
|
||||
@@ -489,6 +493,10 @@ export const adminApi = {
|
||||
request<{ items: Array<Record<string, unknown>> }>('GET', '/analytics/funnel-definitions'),
|
||||
funnelDefinition: (id: string) =>
|
||||
request<Record<string, unknown>>('GET', `/analytics/funnel-definitions/${id}`),
|
||||
exploreScales: () =>
|
||||
request<{ items: Array<Record<string, unknown>> }>('GET', '/explore/scales'),
|
||||
exploreScale: (id: string) =>
|
||||
request<Record<string, unknown>>('GET', `/explore/scales/${id}`),
|
||||
orders: () =>
|
||||
request<{
|
||||
items: Array<{
|
||||
|
||||
@@ -35,6 +35,7 @@ async function onLogout() {
|
||||
<RouterLink to="/ai">AI</RouterLink>
|
||||
<RouterLink to="/crisis">危机</RouterLink>
|
||||
<RouterLink to="/cms">CMS</RouterLink>
|
||||
<RouterLink to="/catalogs">目录仓</RouterLink>
|
||||
<RouterLink to="/orders">订单</RouterLink>
|
||||
<RouterLink to="/audit">审计</RouterLink>
|
||||
</nav>
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { adminApi } from '@/api/client'
|
||||
|
||||
type Row = { id: string; code?: string; slug?: string; title?: string; status?: string }
|
||||
|
||||
const catalogs = [
|
||||
{ key: 'publications', label: '定时发布', load: () => adminApi.publications() },
|
||||
{ key: 'knowledgeChunks', label: '知识块', load: () => adminApi.knowledgeChunks() },
|
||||
{ key: 'tools', label: '工具定义', load: () => adminApi.tools() },
|
||||
{ key: 'blockPolicies', label: '拦截策略', load: () => adminApi.blockPolicies() },
|
||||
{ key: 'cases', label: '审核案', load: () => adminApi.cases() },
|
||||
{ key: 'events', label: '危机事件', load: () => adminApi.events() },
|
||||
{ key: 'interventions', label: '干预结果', load: () => adminApi.interventions() },
|
||||
{ key: 'handoffs', label: '转接案', load: () => adminApi.handoffs() },
|
||||
{ key: 'privacy', label: '隐私请求', load: () => adminApi.requests() },
|
||||
{ key: 'star', label: '星座配置', load: () => adminApi.starConfigs() },
|
||||
{ key: 'rhythm', label: '节律配置', load: () => adminApi.rhythmConfigs() },
|
||||
{ key: 'decks', label: '意象牌组', load: () => adminApi.imageCardDecks() },
|
||||
{ key: 'templates', label: '报告模板', load: () => adminApi.reportTemplates() },
|
||||
{ key: 'funnels', label: '漏斗定义', load: () => adminApi.funnelDefinitions() },
|
||||
{ key: 'scales', label: '量表定义', load: () => adminApi.exploreScales() },
|
||||
] as const
|
||||
|
||||
const active = ref(0)
|
||||
const loading = ref(false)
|
||||
const error = ref('')
|
||||
const items = ref<Row[]>([])
|
||||
|
||||
async function load(idx = active.value) {
|
||||
active.value = idx
|
||||
loading.value = true
|
||||
error.value = ''
|
||||
try {
|
||||
const res = (await catalogs[idx].load()) as { items?: Row[] }
|
||||
items.value = (res.items || []) as Row[]
|
||||
} catch (e) {
|
||||
error.value = e instanceof Error ? e.message : '加载失败'
|
||||
items.value = []
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
void load(0)
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section>
|
||||
<h1>目录只读仓</h1>
|
||||
<p class="muted">ECR-026…040 运营只读目录聚合(不可写发布)</p>
|
||||
<div class="tabs">
|
||||
<button
|
||||
v-for="(c, i) in catalogs"
|
||||
:key="c.key"
|
||||
class="btn"
|
||||
:class="{ on: i === active }"
|
||||
type="button"
|
||||
@click="load(i)"
|
||||
>
|
||||
{{ c.label }}
|
||||
</button>
|
||||
</div>
|
||||
<p v-if="loading" class="muted">加载中…</p>
|
||||
<p v-else-if="error" class="err">{{ error }}</p>
|
||||
<div v-else class="card">
|
||||
<p v-if="!items.length" class="muted">暂无</p>
|
||||
<table v-else>
|
||||
<thead>
|
||||
<tr><th>标识</th><th>标题</th><th>状态</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="it in items" :key="it.id">
|
||||
<td><code>{{ it.code || it.slug || it.id.slice(0, 8) }}</code></td>
|
||||
<td>{{ it.title || '—' }}</td>
|
||||
<td>{{ it.status || '—' }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
h1 { margin: 0 0 0.35rem; font-size: 1.35rem; }
|
||||
.tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1rem 0; }
|
||||
.btn.on { background: #ffe4e0; color: var(--accent); font-weight: 700; }
|
||||
code { font-size: 0.8rem; }
|
||||
</style>
|
||||
@@ -22,6 +22,7 @@ const router = createRouter({
|
||||
{ path: 'ai', name: 'ai', component: () => import('@/pages/AIConfigPage.vue') },
|
||||
{ path: 'crisis', name: 'crisis', component: () => import('@/pages/CrisisPage.vue') },
|
||||
{ path: 'cms', name: 'cms', component: () => import('@/pages/CMSPage.vue') },
|
||||
{ path: 'catalogs', name: 'catalogs', component: () => import('@/pages/CatalogHubPage.vue') },
|
||||
{ path: 'audit', name: 'audit', component: () => import('@/pages/AuditPage.vue') },
|
||||
],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user