feat: OPC 平台初版(Go+PG backend / Vue frontend)+ 尚数网融合方案 + db/0824 数据库备份
- backend: 25 张表 schema/seed,config 指向 127.0.0.1:15432 opc 库 - docs: 尚数网七维融合方案、行业老炮切入方案、竞品分析等 - db/0824/opc_0824.sql(.gz): pg_dump 全量备份(25 表,含数据)
This commit is contained in:
commit
a5692bfd7d
56 files changed
+11841
No files matched your search
@@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/png" href="https://shangshuwang.cn/images/logo-white-data.png" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>尚数网 AI-DATA-OPC 创业孵化合作平台</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Generated
+1846
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "opc-frontend",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"@element-plus/icons-vue": "^2.3.1",
|
||||
"axios": "^1.7.7",
|
||||
"echarts": "^5.5.1",
|
||||
"element-plus": "^2.8.7",
|
||||
"pinia": "^2.2.6",
|
||||
"vue": "^3.5.13",
|
||||
"vue-router": "^4.4.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vitejs/plugin-vue": "^5.2.0",
|
||||
"vite": "^5.4.11"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<template>
|
||||
<router-view />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
</script>
|
||||
@@ -0,0 +1,47 @@
|
||||
import axios from 'axios'
|
||||
|
||||
const api = axios.create({
|
||||
baseURL: '/api/v1',
|
||||
timeout: 15000
|
||||
})
|
||||
|
||||
api.interceptors.response.use(
|
||||
res => res.data?.data ?? res.data,
|
||||
err => {
|
||||
console.error('API ERROR:', err?.response?.data || err?.message)
|
||||
return Promise.reject(err)
|
||||
}
|
||||
)
|
||||
|
||||
export default {
|
||||
getProfile: () => api.get('/profile'),
|
||||
getDashboard: () => api.get('/dashboard'),
|
||||
|
||||
listProjects: (params) => api.get('/projects', { params }),
|
||||
getProject: (id) => api.get(`/projects/${id}`),
|
||||
getStages: () => api.get('/projects/stages'),
|
||||
getDirections: () => api.get('/projects/directions'),
|
||||
|
||||
listSpaces: () => api.get('/spaces'),
|
||||
listDataResources: (params) => api.get('/data-resources', { params }),
|
||||
listTools: (params) => api.get('/tools', { params }),
|
||||
getTool: (id) => api.get(`/tools/${id}`),
|
||||
runTool: (id, input) => api.post(`/tools/${id}/run`, input),
|
||||
listToolRuns: (params) => api.get('/tool-runs', { params }),
|
||||
listCohorts: () => api.get('/cohorts'),
|
||||
listTrainings: (params) => api.get('/trainings', { params }),
|
||||
listScenarios: () => api.get('/scenarios'),
|
||||
listScenarioMappings: () => api.get('/scenario-mappings'),
|
||||
listProducts: (params) => api.get('/products', { params }),
|
||||
listEvents: () => api.get('/events'),
|
||||
listPolicies: () => api.get('/policies'),
|
||||
listPolicyApplications: () => api.get('/policy-applications'),
|
||||
listMentors: () => api.get('/mentors'),
|
||||
listPartners: () => api.get('/partners'),
|
||||
getPartner: (id) => api.get(`/partners/${id}`),
|
||||
listNews: () => api.get('/news'),
|
||||
listAnnouncements: () => api.get('/announcements'),
|
||||
listComplianceLogs: () => api.get('/compliance-logs'),
|
||||
listKPIs: () => api.get('/kpis'),
|
||||
listMilestones: (params) => api.get('/milestones', { params })
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
<template>
|
||||
<div class="app-shell">
|
||||
<aside class="app-side">
|
||||
<div class="brand">
|
||||
<div class="brand-logo">
|
||||
<img :src="logoUrl" alt="logo" />
|
||||
</div>
|
||||
<div class="brand-text">
|
||||
尚数网 OPC 平台
|
||||
<small>AI-DATA-OPC 创业孵化</small>
|
||||
</div>
|
||||
</div>
|
||||
<nav class="menu" style="padding: 8px 0;">
|
||||
<div class="menu-group">
|
||||
<div class="menu-group-title">驾驶舱</div>
|
||||
<router-link to="/dashboard" class="menu-link" :class="{ active: $route.path === '/dashboard' }">
|
||||
<el-icon><DataAnalysis /></el-icon> 总览驾驶舱
|
||||
</router-link>
|
||||
</div>
|
||||
<div class="menu-group">
|
||||
<div class="menu-group-title">基础支撑</div>
|
||||
<router-link to="/spaces" class="menu-link" :class="{ active: $route.path === '/spaces' }">
|
||||
<el-icon><OfficeBuilding /></el-icon> 孵化空间
|
||||
</router-link>
|
||||
<router-link to="/data-resources" class="menu-link" :class="{ active: $route.path === '/data-resources' }">
|
||||
<el-icon><Coin /></el-icon> 数据资源
|
||||
</router-link>
|
||||
<router-link to="/tools" class="menu-link" :class="{ active: $route.path === '/tools' }">
|
||||
<el-icon><Cpu /></el-icon> AI 工具底座
|
||||
</router-link>
|
||||
<router-link to="/toolkit" class="menu-link" :class="{ active: $route.path === '/toolkit' }">
|
||||
<el-icon><Tools /></el-icon> OPC 工具箱
|
||||
</router-link>
|
||||
<router-link to="/tool-runs" class="menu-link" :class="{ active: $route.path === '/tool-runs' }">
|
||||
<el-icon><Histogram /></el-icon> 工具运行
|
||||
</router-link>
|
||||
<router-link to="/activity" class="menu-link" :class="{ active: $route.path === '/activity' }">
|
||||
<el-icon><Notification /></el-icon> 实时动态
|
||||
</router-link>
|
||||
</div>
|
||||
<div class="menu-group">
|
||||
<div class="menu-group-title">孵化服务</div>
|
||||
<router-link to="/projects" class="menu-link" :class="{ active: $route.path.startsWith('/projects') }">
|
||||
<el-icon><Folder /></el-icon> 项目库
|
||||
</router-link>
|
||||
<router-link to="/cohorts" class="menu-link" :class="{ active: $route.path === '/cohorts' }">
|
||||
<el-icon><Calendar /></el-icon> 训练营
|
||||
</router-link>
|
||||
<router-link to="/mentors" class="menu-link" :class="{ active: $route.path === '/mentors' }">
|
||||
<el-icon><User /></el-icon> 导师库
|
||||
</router-link>
|
||||
<router-link to="/partners" class="menu-link" :class="{ active: $route.path === '/partners' }">
|
||||
<el-icon><Connection /></el-icon> 合作伙伴
|
||||
</router-link>
|
||||
</div>
|
||||
<div class="menu-group">
|
||||
<div class="menu-group-title">成果转化</div>
|
||||
<router-link to="/scenarios" class="menu-link" :class="{ active: $route.path === '/scenarios' }">
|
||||
<el-icon><Connection /></el-icon> 应用场景
|
||||
</router-link>
|
||||
<router-link to="/products" class="menu-link" :class="{ active: $route.path === '/products' }">
|
||||
<el-icon><Box /></el-icon> 产品库
|
||||
</router-link>
|
||||
<router-link to="/events" class="menu-link" :class="{ active: $route.path === '/events' }">
|
||||
<el-icon><Microphone /></el-icon> 供需对接
|
||||
</router-link>
|
||||
<router-link to="/policies" class="menu-link" :class="{ active: $route.path === '/policies' }">
|
||||
<el-icon><Document /></el-icon> 政策扶持
|
||||
</router-link>
|
||||
</div>
|
||||
<div class="menu-group">
|
||||
<div class="menu-group-title">运营</div>
|
||||
<router-link to="/compliance" class="menu-link" :class="{ active: $route.path === '/compliance' }">
|
||||
<el-icon><Lock /></el-icon> 合规审计
|
||||
</router-link>
|
||||
<router-link to="/news" class="menu-link" :class="{ active: $route.path === '/news' }">
|
||||
<el-icon><Bell /></el-icon> 资讯动态
|
||||
</router-link>
|
||||
</div>
|
||||
</nav>
|
||||
<div style="margin-top: auto; padding: 16px 20px; border-top: 1px solid var(--border); font-size: 11px; color: var(--text-muted);">
|
||||
<div>尚数网 · <a href="https://shangshuwang.cn" target="_blank" style="color: var(--primary-light)">shangshuwang.cn</a></div>
|
||||
<div style="margin-top: 4px;">数据流通:<a href="https://shuangshuwang.cn" target="_blank" style="color: var(--accent)">shuangshuwang.cn</a></div>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<main class="app-main">
|
||||
<header class="app-top">
|
||||
<div class="top-title">{{ $route.meta.title || '尚数网 OPC 平台' }}</div>
|
||||
<div class="top-actions">
|
||||
<span class="top-tag">试点版 · v0.1.0</span>
|
||||
<span class="top-tag" style="background: rgba(34,197,94,0.15); color: #4ade80;">● 平台运行中</span>
|
||||
<a href="https://shangshuwang.cn" target="_blank" class="btn btn-ghost">
|
||||
<el-icon><Link /></el-icon> 尚数网
|
||||
</a>
|
||||
</div>
|
||||
</header>
|
||||
<section class="app-content">
|
||||
<router-view />
|
||||
</section>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
const logoUrl = 'https://shangshuwang.cn/images/logo-white-data.png'
|
||||
</script>
|
||||
@@ -0,0 +1,20 @@
|
||||
import { createApp } from 'vue'
|
||||
import { createPinia } from 'pinia'
|
||||
import ElementPlus from 'element-plus'
|
||||
import 'element-plus/dist/index.css'
|
||||
import * as ElIcons from '@element-plus/icons-vue'
|
||||
import router from './router'
|
||||
import App from './App.vue'
|
||||
import './styles/global.css'
|
||||
|
||||
const app = createApp(App)
|
||||
|
||||
// Inline all Element Plus icons globally
|
||||
for (const [name, comp] of Object.entries(ElIcons)) {
|
||||
app.component(name, comp)
|
||||
}
|
||||
|
||||
app.use(createPinia())
|
||||
app.use(router)
|
||||
app.use(ElementPlus)
|
||||
app.mount('#app')
|
||||
@@ -0,0 +1,35 @@
|
||||
import { createRouter, createWebHashHistory } from 'vue-router'
|
||||
import Layout from '../layouts/Layout.vue'
|
||||
|
||||
const routes = [
|
||||
{
|
||||
path: '/',
|
||||
component: Layout,
|
||||
children: [
|
||||
{ path: '', redirect: '/dashboard' },
|
||||
{ path: 'dashboard', name: 'dashboard', component: () => import('../views/DashboardView.vue'), meta: { title: '总览驾驶舱' } },
|
||||
{ path: 'projects', name: 'projects', component: () => import('../views/ProjectsView.vue'), meta: { title: '项目库' } },
|
||||
{ path: 'projects/:id', name: 'project-detail', component: () => import('../views/ProjectDetailView.vue'), meta: { title: '项目详情' } },
|
||||
{ path: 'spaces', name: 'spaces', component: () => import('../views/SpaceView.vue'), meta: { title: '孵化空间' } },
|
||||
{ path: 'data-resources', name: 'data-resources', component: () => import('../views/DataResourcesView.vue'), meta: { title: '数据资源' } },
|
||||
{ path: 'tools', name: 'tools', component: () => import('../views/ToolsView.vue'), meta: { title: 'AI 工具底座' } },
|
||||
{ path: 'toolkit', name: 'toolkit', component: () => import('../views/ToolkitView.vue'), meta: { title: 'OPC 工具箱' } },
|
||||
{ path: 'tool-runs', name: 'tool-runs', component: () => import('../views/ToolRunsView.vue'), meta: { title: '工具运行记录' } },
|
||||
{ path: 'activity', name: 'activity', component: () => import('../views/ActivityView.vue'), meta: { title: '实时动态' } },
|
||||
{ path: 'cohorts', name: 'cohorts', component: () => import('../views/CohortsView.vue'), meta: { title: '训练营' } },
|
||||
{ path: 'scenarios', name: 'scenarios', component: () => import('../views/ScenariosView.vue'), meta: { title: '应用场景' } },
|
||||
{ path: 'products', name: 'products', component: () => import('../views/ProductsView.vue'), meta: { title: '产品库' } },
|
||||
{ path: 'events', name: 'events', component: () => import('../views/EventsView.vue'), meta: { title: '供需对接' } },
|
||||
{ path: 'policies', name: 'policies', component: () => import('../views/PoliciesView.vue'), meta: { title: '政策扶持' } },
|
||||
{ path: 'mentors', name: 'mentors', component: () => import('../views/MentorsView.vue'), meta: { title: '导师库' } },
|
||||
{ path: 'partners', name: 'partners', component: () => import('../views/PartnersView.vue'), meta: { title: '合作伙伴' } },
|
||||
{ path: 'compliance', name: 'compliance', component: () => import('../views/ComplianceView.vue'), meta: { title: '合规审计' } },
|
||||
{ path: 'news', name: 'news', component: () => import('../views/NewsView.vue'), meta: { title: '资讯动态' } }
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
export default createRouter({
|
||||
history: createWebHashHistory(),
|
||||
routes
|
||||
})
|
||||
@@ -0,0 +1,183 @@
|
||||
:root {
|
||||
--primary: #0d4ed8;
|
||||
--primary-dark: #0938a3;
|
||||
--primary-light: #5286ff;
|
||||
--accent: #06b6d4;
|
||||
--bg: #0b1220;
|
||||
--bg-soft: #131b2e;
|
||||
--bg-card: #18223a;
|
||||
--bg-card-2: #1f2a44;
|
||||
--text: #e7ecf3;
|
||||
--text-muted: #97a2b8;
|
||||
--border: #283450;
|
||||
--success: #22c55e;
|
||||
--warning: #f59e0b;
|
||||
--danger: #ef4444;
|
||||
}
|
||||
|
||||
* { box-sizing: border-box; }
|
||||
html, body, #app { margin: 0; padding: 0; height: 100%; background: var(--bg); color: var(--text); font-family: -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; }
|
||||
a { color: inherit; text-decoration: none; }
|
||||
|
||||
/* 整体布局 */
|
||||
.app-shell { display: flex; min-height: 100vh; }
|
||||
.app-side { width: 232px; background: linear-gradient(180deg, #0a1730 0%, #0d2042 100%); border-right: 1px solid var(--border); display: flex; flex-direction: column; }
|
||||
.app-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
|
||||
.app-top { height: 64px; background: var(--bg-soft); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 24px; gap: 24px; }
|
||||
.app-content { padding: 24px; flex: 1; overflow-y: auto; background: var(--bg); }
|
||||
|
||||
/* 品牌 */
|
||||
.brand { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
|
||||
.brand-logo { width: 36px; height: 36px; border-radius: 8px; background: #fff; display: flex; align-items: center; justify-content: center; }
|
||||
.brand-logo img { width: 100%; height: 100%; object-fit: contain; }
|
||||
.brand-text { font-weight: 700; font-size: 14px; line-height: 1.4; }
|
||||
.brand-text small { display: block; color: var(--text-muted); font-weight: 400; font-size: 11px; }
|
||||
|
||||
/* 菜单 */
|
||||
.menu-group { padding: 8px 14px; }
|
||||
.menu-group-title { color: var(--text-muted); font-size: 11px; letter-spacing: 1px; padding: 12px 8px 6px; text-transform: uppercase; }
|
||||
.menu-link { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--text-muted); font-size: 13px; cursor: pointer; transition: all 0.18s; }
|
||||
.menu-link:hover { background: rgba(82, 134, 255, 0.12); color: var(--text); }
|
||||
.menu-link.active { background: linear-gradient(90deg, rgba(13,78,216,0.32), rgba(6,182,212,0.16)); color: #fff; box-shadow: inset 3px 0 0 var(--primary-light); }
|
||||
|
||||
/* 顶栏 */
|
||||
.top-title { font-size: 16px; font-weight: 600; }
|
||||
.top-actions { padding-left: auto; display: flex; align-items: center; gap: 12px; }
|
||||
.top-tag { padding: 4px 10px; background: rgba(82,134,255,0.15); color: var(--primary-light); border-radius: 12px; font-size: 12px; }
|
||||
|
||||
/* 卡片 */
|
||||
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
|
||||
.card-title { font-size: 14px; font-weight: 600; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; }
|
||||
.card-title small { color: var(--text-muted); font-weight: 400; font-size: 12px; }
|
||||
|
||||
/* 概览数字 */
|
||||
.stat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 20px; }
|
||||
.stat-card { background: linear-gradient(135deg, var(--bg-card), var(--bg-card-2)); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; position: relative; overflow: hidden; }
|
||||
.stat-card::before { content: ""; position: absolute; right: -20px; top: -20px; width: 80px; height: 80px; border-radius: 50%; background: rgba(82,134,255,0.08); }
|
||||
.stat-label { color: var(--text-muted); font-size: 12px; }
|
||||
.stat-value { font-size: 28px; font-weight: 700; margin-top: 6px; color: #fff; }
|
||||
.stat-extra { color: var(--text-muted); font-size: 11px; margin-top: 4px; }
|
||||
|
||||
/* Tooltip */
|
||||
.el-popper { background: #1d273f !important; color: var(--text) !important; border: 1px solid var(--border) !important; }
|
||||
|
||||
/* 表格 */
|
||||
.el-table { background: transparent !important; color: var(--text) !important; }
|
||||
.el-table tr, .el-table th.el-table__cell { background: transparent !important; }
|
||||
.el-table td.el-table__cell, .el-table th.el-table__cell { border-bottom: 1px solid var(--border) !important; }
|
||||
.el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell { background: rgba(82,134,255,0.06) !important; }
|
||||
.el-table__empty-block { background: transparent !important; }
|
||||
.el-table__empty-text { color: var(--text-muted) !important; }
|
||||
|
||||
/* 标签 */
|
||||
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 500; }
|
||||
.tag-blue { background: rgba(13,78,216,0.2); color: #6ea7ff; }
|
||||
.tag-green { background: rgba(34,197,94,0.2); color: #4ade80; }
|
||||
.tag-orange { background: rgba(245,158,11,0.2); color: #fbbf24; }
|
||||
.tag-purple { background: rgba(139,92,246,0.2); color: #c4b5fd; }
|
||||
.tag-red { background: rgba(239,68,68,0.2); color: #f87171; }
|
||||
.tag-cyan { background: rgba(6,182,212,0.2); color: #67e8f9; }
|
||||
.tag-gray { background: rgba(148,163,184,0.2); color: #cbd5e1; }
|
||||
|
||||
/* 进度条 */
|
||||
.progress-bar { background: rgba(255,255,255,0.08); border-radius: 4px; height: 6px; overflow: hidden; }
|
||||
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 4px; }
|
||||
|
||||
/* 阶段 timeline */
|
||||
.stage-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 4px; font-size: 12px; font-weight: 500; background: rgba(82,134,255,0.15); color: var(--primary-light); }
|
||||
|
||||
/* KPI 卡片 */
|
||||
.kpi-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
|
||||
.kpi-name { font-size: 13px; color: var(--text-muted); }
|
||||
.kpi-value { font-size: 28px; font-weight: 700; margin-top: 8px; }
|
||||
.kpi-value small { font-size: 13px; color: var(--text-muted); font-weight: 500; margin-left: 4px; }
|
||||
.kpi-target { color: var(--text-muted); font-size: 11px; margin-top: 6px; }
|
||||
.kpi-bar { margin-top: 10px; height: 5px; background: rgba(255,255,255,0.08); border-radius: 4px; overflow: hidden; }
|
||||
.kpi-bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 4px; }
|
||||
|
||||
/* 表格行 */
|
||||
.row-stages { display: flex; gap: 6px; flex-wrap: wrap; }
|
||||
|
||||
/* 数据表卡片 */
|
||||
.table-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
|
||||
.table-card-header { padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); }
|
||||
.table-card-header h3 { margin: 0; font-size: 14px; font-weight: 600; }
|
||||
|
||||
/* 滚动条 */
|
||||
::-webkit-scrollbar { width: 8px; height: 8px; }
|
||||
::-webkit-scrollbar-track { background: transparent; }
|
||||
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }
|
||||
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
|
||||
|
||||
/* Element Plus dark overrides */
|
||||
.el-button--primary { background: var(--primary) !important; border-color: var(--primary) !important; }
|
||||
.el-button--primary:hover { background: var(--primary-light) !important; border-color: var(--primary-light) !important; }
|
||||
.el-input__wrapper, .el-select__wrapper { background: rgba(255,255,255,0.06) !important; box-shadow: none !important; border: 1px solid var(--border) !important; }
|
||||
.el-input__inner, .el-textarea__inner { color: var(--text) !important; }
|
||||
.el-input__inner::placeholder { color: var(--text-muted) !important; }
|
||||
.el-tag { border: none !important; }
|
||||
.el-card { background: var(--bg-card) !important; border-color: var(--border) !important; color: var(--text) !important; }
|
||||
|
||||
/* Hero Banner */
|
||||
.hero-banner { background: linear-gradient(135deg, #0d4ed8 0%, #06b6d4 100%); border-radius: 14px; padding: 26px 28px; margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; position: relative; overflow: hidden; }
|
||||
.hero-banner::before { content: ""; position: absolute; right: -40px; top: -40px; width: 240px; height: 240px; border-radius: 50%; background: rgba(255,255,255,0.08); }
|
||||
.hero-banner::after { content: ""; position: absolute; right: 80px; bottom: -60px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,0.06); }
|
||||
.hero-text h1 { margin: 0; font-size: 22px; font-weight: 700; }
|
||||
.hero-text p { margin: 6px 0 0; color: rgba(255,255,255,0.85); font-size: 13px; }
|
||||
.hero-actions { display: flex; gap: 12px; z-index: 1; }
|
||||
|
||||
/* Section */
|
||||
.page-section { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; margin-bottom: 18px; }
|
||||
.col-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
|
||||
.col-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
|
||||
.row-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
|
||||
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
|
||||
.row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
|
||||
|
||||
/* 项目详情 */
|
||||
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
|
||||
.detail-grid-full { grid-column: 1 / -1; }
|
||||
.detail-row { display: flex; padding: 8px 0; border-bottom: 1px solid var(--border); }
|
||||
.detail-row .label { width: 100px; color: var(--text-muted); font-size: 13px; }
|
||||
.detail-row .value { flex: 1; font-size: 13px; }
|
||||
|
||||
/* 场景卡片 */
|
||||
.resource-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 16px; cursor: pointer; transition: all 0.2s; }
|
||||
.resource-card:hover { border-color: var(--primary-light); transform: translateY(-2px); }
|
||||
.resource-card h4 { margin: 0 0 8px; font-size: 14px; }
|
||||
.resource-card .meta { color: var(--text-muted); font-size: 11px; margin-bottom: 8px; }
|
||||
.resource-card .desc { font-size: 12px; color: var(--text-muted); line-height: 1.6; }
|
||||
|
||||
/* 训练营时间线 */
|
||||
.cohort-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
|
||||
.cohort-card h3 { margin: 0 0 8px; font-size: 15px; }
|
||||
.cohort-meta { color: var(--text-muted); font-size: 12px; margin-top: 6px; }
|
||||
|
||||
/* 简单按钮 */
|
||||
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 6px; font-size: 13px; cursor: pointer; border: 1px solid var(--border); background: rgba(255,255,255,0.05); color: var(--text); transition: all 0.18s; }
|
||||
.btn:hover { background: rgba(82,134,255,0.15); border-color: var(--primary-light); }
|
||||
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
|
||||
.btn-primary:hover { background: var(--primary-light); border-color: var(--primary-light); }
|
||||
.btn-ghost { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); }
|
||||
|
||||
/* 表单 */
|
||||
.form-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
|
||||
.form-row label { width: 88px; color: var(--text-muted); font-size: 13px; }
|
||||
.form-row .el-select, .form-row .el-input { flex: 1; }
|
||||
|
||||
/* 项目名链接 */
|
||||
.project-name { color: var(--primary-light); cursor: pointer; font-weight: 500; }
|
||||
.project-name:hover { text-decoration: underline; }
|
||||
|
||||
/* 空状态 */
|
||||
.empty { padding: 40px 20px; text-align: center; color: var(--text-muted); font-size: 13px; }
|
||||
|
||||
/* 移动端 */
|
||||
@media (max-width: 1200px) {
|
||||
.stat-grid { grid-template-columns: repeat(3, 1fr); }
|
||||
.page-section, .col-2 { grid-template-columns: 1fr; }
|
||||
}
|
||||
@media (max-width: 768px) {
|
||||
.app-side { display: none; }
|
||||
.stat-grid { grid-template-columns: repeat(2, 1fr); }
|
||||
}
|
||||
@@ -0,0 +1,239 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="hero-banner" style="background: linear-gradient(135deg, #15803d 0%, #0e7490 50%, #6d28d9 100%);">
|
||||
<div class="hero-text">
|
||||
<h1>实时动态</h1>
|
||||
<p>聚合项目 / 工具 / 政策 / 合规 / 活动最近 7 天动态</p>
|
||||
</div>
|
||||
<div class="hero-actions">
|
||||
<span class="top-tag" style="background: rgba(255,255,255,0.2); color: #fff;">{{ feed.length }} 条动态</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 概览 -->
|
||||
<div class="row-4" style="margin-bottom: 18px;">
|
||||
<div class="stat-card">
|
||||
<div class="stat-label">本周新签</div>
|
||||
<div class="stat-value" style="color: #4ade80;">{{ weekStats.policyGranted }}</div>
|
||||
<div class="stat-extra">政策申报成功</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div class="stat-label">本周新工具调用</div>
|
||||
<div class="stat-value" style="color: #67e8f9;">{{ weekStats.toolRuns }}</div>
|
||||
<div class="stat-extra">OPC 工具箱</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div class="stat-label">本周里程碑</div>
|
||||
<div class="stat-value" style="color: #c4b5fd;">{{ weekStats.milestones }}</div>
|
||||
<div class="stat-extra">项目进展</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div class="stat-label">本周合规审计</div>
|
||||
<div class="stat-value" style="color: #fbbf24;">{{ weekStats.compliance }}</div>
|
||||
<div class="stat-extra">留痕记录</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 时间线 -->
|
||||
<div class="row-2">
|
||||
<div class="card">
|
||||
<div class="card-title">最新动态流</div>
|
||||
<div v-for="item in feed" :key="item.id" style="display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border);">
|
||||
<div :style="`width: 36px; height: 36px; border-radius: 50%; background: ${activityColor(item.type)}; display: flex; align-items: center; justify-content: center; flex-shrink: 0;`">
|
||||
<el-icon style="color: #fff;">
|
||||
<component :is="activityIcon(item.type)" />
|
||||
</el-icon>
|
||||
</div>
|
||||
<div style="flex: 1; min-width: 0;">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center;">
|
||||
<span style="font-weight: 500; font-size: 13px;">{{ item.title }}</span>
|
||||
<span class="tag" :class="item.tagCls">{{ item.tag }}</span>
|
||||
</div>
|
||||
<div style="color: var(--text-muted); font-size: 12px; margin-top: 4px;">
|
||||
{{ item.subtitle }}
|
||||
</div>
|
||||
<div style="color: var(--text-muted); font-size: 11px; margin-top: 4px;">
|
||||
{{ formatTimeAgo(item.time) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div class="card" style="margin-bottom: 18px;">
|
||||
<div class="card-title">最近合规审计</div>
|
||||
<div v-for="l in recentCompliance" :key="l.id" style="padding: 10px 0; border-bottom: 1px solid var(--border);">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center;">
|
||||
<span style="font-weight: 500; font-size: 13px;">{{ l.action }}</span>
|
||||
<span class="tag" :class="l.result === 'pass' ? 'tag-green' : l.result === 'risk' ? 'tag-orange' : 'tag-red'">
|
||||
{{ l.result === 'pass' ? '通过' : l.result === 'risk' ? '风险' : '阻断' }}
|
||||
</span>
|
||||
</div>
|
||||
<div style="color: var(--text-muted); font-size: 12px; margin-top: 4px;">
|
||||
{{ l.operator }} · {{ formatTimeAgo(l.created_at) }}
|
||||
</div>
|
||||
<div style="font-size: 12px; margin-top: 4px;">{{ l.notes }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-title">最近工具运行</div>
|
||||
<div v-for="r in recentToolRuns" :key="r.id" style="padding: 10px 0; border-bottom: 1px solid var(--border);">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center;">
|
||||
<span style="font-weight: 500; font-size: 13px;">{{ toolName(r.tool_id) }}</span>
|
||||
<span class="tag" :class="scoreTag(r.score)">{{ r.score?.toFixed(1) }}</span>
|
||||
</div>
|
||||
<div style="color: var(--text-muted); font-size: 12px; margin-top: 4px;">
|
||||
{{ r.user_name }} · {{ formatTimeAgo(r.created_at) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
import * as ElIcons from '@element-plus/icons-vue'
|
||||
import api from '../api'
|
||||
|
||||
const toolRuns = ref([])
|
||||
const complianceLogs = ref([])
|
||||
const milestones = ref([])
|
||||
const policyApps = ref([])
|
||||
const projects = ref([])
|
||||
const tools = ref([])
|
||||
const feed = ref([])
|
||||
|
||||
function toolName(id) {
|
||||
const t = tools.value.find(x => x.id === id)
|
||||
return t ? t.name : `工具 #${id}`
|
||||
}
|
||||
|
||||
function scoreTag(s) {
|
||||
if (s >= 85) return 'tag-green'
|
||||
if (s >= 70) return 'tag-cyan'
|
||||
if (s >= 50) return 'tag-orange'
|
||||
return 'tag-red'
|
||||
}
|
||||
|
||||
function projectName(id) {
|
||||
const p = projects.value.find(x => x.id === id)
|
||||
return p ? p.name : `#${id}`
|
||||
}
|
||||
|
||||
function formatTimeAgo(d) {
|
||||
if (!d) return ''
|
||||
const dt = new Date(d)
|
||||
const now = new Date()
|
||||
const diff = (now - dt) / 1000
|
||||
if (diff < 60) return '刚刚'
|
||||
if (diff < 3600) return Math.floor(diff / 60) + ' 分钟前'
|
||||
if (diff < 86400) return Math.floor(diff / 3600) + ' 小时前'
|
||||
if (diff < 604800) return Math.floor(diff / 86400) + ' 天前'
|
||||
return dt.toLocaleDateString('zh-CN')
|
||||
}
|
||||
|
||||
function activityColor(type) {
|
||||
return {
|
||||
project: 'linear-gradient(135deg, #0d4ed8, #06b6d4)',
|
||||
milestone: 'linear-gradient(135deg, #c4b5fd, #8b5cf6)',
|
||||
policy: 'linear-gradient(135deg, #4ade80, #10b981)',
|
||||
coaching: 'linear-gradient(135deg, #fbbf24, #f59e0b)',
|
||||
compliance: 'linear-gradient(135deg, #f87171, #dc2626)',
|
||||
tool: 'linear-gradient(135deg, #67e8f9, #0891b2)',
|
||||
news: 'linear-gradient(135deg, #a78bfa, #7c3aed)',
|
||||
event: 'linear-gradient(135deg, #f97316, #ea580c)'
|
||||
}[type] || 'linear-gradient(135deg, #97a2b8, #64748b)'
|
||||
}
|
||||
|
||||
function activityIcon(type) {
|
||||
return {
|
||||
project: 'Folder',
|
||||
milestone: 'Flag',
|
||||
policy: 'Document',
|
||||
coaching: 'User',
|
||||
compliance: 'Lock',
|
||||
tool: 'Cpu',
|
||||
news: 'Bell',
|
||||
event: 'Microphone'
|
||||
}[type] || 'InfoFilled'
|
||||
}
|
||||
|
||||
const recentCompliance = computed(() => complianceLogs.value.slice(0, 8))
|
||||
const recentToolRuns = computed(() => toolRuns.value.slice(0, 8))
|
||||
|
||||
const weekStats = computed(() => {
|
||||
const now = new Date()
|
||||
const weekAgo = new Date(now.getTime() - 7 * 86400 * 1000)
|
||||
const isWeek = (d) => new Date(d) >= weekAgo
|
||||
return {
|
||||
policyGranted: policyApps.value.filter(a => a.status === 'granted' && a.granted_at && isWeek(a.granted_at)).length,
|
||||
toolRuns: toolRuns.value.filter(r => isWeek(r.created_at)).length,
|
||||
milestones: milestones.value.filter(m => isWeek(m.happened_at)).length,
|
||||
compliance: complianceLogs.value.filter(l => isWeek(l.created_at)).length
|
||||
}
|
||||
})
|
||||
|
||||
onMounted(async () => {
|
||||
const [runs, comps, mi, pa, ps, ts] = await Promise.all([
|
||||
api.listToolRuns(),
|
||||
api.listComplianceLogs(),
|
||||
api.listMilestones(),
|
||||
api.listPolicyApplications(),
|
||||
api.listProjects(),
|
||||
api.listTools()
|
||||
])
|
||||
toolRuns.value = runs
|
||||
complianceLogs.value = comps
|
||||
milestones.value = mi
|
||||
policyApps.value = pa
|
||||
projects.value = ps
|
||||
tools.value = ts
|
||||
|
||||
// 聚合动态流
|
||||
const items = []
|
||||
for (const m of mi.slice(0, 10)) {
|
||||
items.push({
|
||||
id: 'm' + m.id, type: 'milestone',
|
||||
title: projectName(m.project_id) + ' · ' + m.title,
|
||||
subtitle: m.evidence || '',
|
||||
time: m.happened_at,
|
||||
tag: m.stage, tagCls: 'tag-purple'
|
||||
})
|
||||
}
|
||||
for (const p of pa.slice(0, 8)) {
|
||||
items.push({
|
||||
id: 'p' + p.id, type: 'policy',
|
||||
title: projectName(p.project_id) + ' 政策申报',
|
||||
subtitle: p.notes,
|
||||
time: p.granted_at || p.submitted_at,
|
||||
tag: p.status === 'granted' ? '已获批' : '审核中',
|
||||
tagCls: p.status === 'granted' ? 'tag-green' : 'tag-blue'
|
||||
})
|
||||
}
|
||||
for (const r of runs.slice(0, 8)) {
|
||||
items.push({
|
||||
id: 'r' + r.id, type: 'tool',
|
||||
title: toolName(r.tool_id) + ' 运行',
|
||||
subtitle: '用户 ' + r.user_name,
|
||||
time: r.created_at,
|
||||
tag: '评分 ' + (r.score?.toFixed(0) || '-'),
|
||||
tagCls: 'tag-cyan'
|
||||
})
|
||||
}
|
||||
for (const c of comps.slice(0, 6)) {
|
||||
items.push({
|
||||
id: 'c' + c.id, type: 'compliance',
|
||||
title: c.action + ' - ' + c.operator,
|
||||
subtitle: c.notes,
|
||||
time: c.created_at,
|
||||
tag: c.result === 'pass' ? '通过' : c.result === 'risk' ? '风险' : '阻断',
|
||||
tagCls: c.result === 'pass' ? 'tag-green' : c.result === 'risk' ? 'tag-orange' : 'tag-red'
|
||||
})
|
||||
}
|
||||
|
||||
feed.value = items.sort((a, b) => new Date(b.time) - new Date(a.time)).slice(0, 30)
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,74 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="hero-banner" style="background: linear-gradient(135deg, #d97706 0%, #db2777 100%);">
|
||||
<div class="hero-text">
|
||||
<h1>创业训练营</h1>
|
||||
<p>围绕数据合规 / 模型训练 / 产品设计 / 商业模式 / 场景适配定期开营</p>
|
||||
</div>
|
||||
<div class="hero-actions">
|
||||
<span class="top-tag" style="background: rgba(255,255,255,0.2); color: #fff;">{{ cohorts.length }} 期训练营</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="page-section">
|
||||
<div class="card">
|
||||
<div class="card-title">训练营列表</div>
|
||||
<div v-for="c in cohorts" :key="c.id" class="cohort-card" style="margin-bottom: 12px;">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center;">
|
||||
<h3 style="margin: 0;">{{ c.name }}</h3>
|
||||
<span class="tag" :class="c.status === 'ongoing' ? 'tag-green' : c.status === 'recruiting' ? 'tag-orange' : 'tag-gray'">{{ cohortStatus(c.status) }}</span>
|
||||
</div>
|
||||
<div class="cohort-meta">📅 {{ formatDate(c.start_date) }} → {{ formatDate(c.end_date) }} · {{ c.theme }}</div>
|
||||
<div class="desc" style="font-size: 12px; margin-top: 6px; color: var(--text-muted);">{{ c.description }}</div>
|
||||
<div style="margin-top: 10px;">
|
||||
<div style="display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted);">
|
||||
<span>报名 {{ c.enrolled }} / {{ c.capacity }} 人</span>
|
||||
<span>{{ Math.round(c.enrolled / c.capacity * 100) }}%</span>
|
||||
</div>
|
||||
<div class="progress-bar" style="margin-top: 4px;">
|
||||
<div class="progress-fill" :style="{ width: Math.round(c.enrolled / c.capacity * 100) + '%' }"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-title">培训活动 · {{ trainings.length }} 场</div>
|
||||
<div v-for="t in trainings" :key="t.id" style="padding: 10px 0; border-bottom: 1px solid var(--border);">
|
||||
<div style="display: flex; justify-content: space-between;">
|
||||
<div style="font-weight: 500;">{{ t.title }}</div>
|
||||
<span class="tag tag-blue">{{ t.topic }}</span>
|
||||
</div>
|
||||
<div style="font-size: 12px; color: var(--text-muted); margin-top: 4px;">
|
||||
🗓 {{ formatDate(t.train_date) }} · {{ t.location }} · {{ t.format === 'online' ? '线上' : t.format === 'offline' ? '线下' : '线上+线下' }}
|
||||
</div>
|
||||
<div style="font-size: 12px; margin-top: 4px;">讲师:{{ t.speaker }}({{ t.speaker_org }})</div>
|
||||
<div style="font-size: 12px; color: var(--text-muted); margin-top: 2px;">{{ t.summary }}</div>
|
||||
<div style="font-size: 11px; color: var(--text-muted); margin-top: 4px;">参会 {{ t.attendees }} 人</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import api from '../api'
|
||||
|
||||
const cohorts = ref([])
|
||||
const trainings = ref([])
|
||||
|
||||
function formatDate(d) {
|
||||
if (!d) return ''
|
||||
return new Date(d).toLocaleDateString('zh-CN')
|
||||
}
|
||||
|
||||
function cohortStatus(s) {
|
||||
return { planning: '规划中', recruiting: '招募中', ongoing: '进行中', finished: '已结束' }[s] || s
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
cohorts.value = await api.listCohorts()
|
||||
trainings.value = await api.listTrainings()
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,69 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="hero-banner" style="background: linear-gradient(135deg, #b91c1c 0%, #7c2d12 100%);">
|
||||
<div class="hero-text">
|
||||
<h1>合规审计</h1>
|
||||
<p>数据资源准入 / 授权审核 / 使用留痕 / 权限管理 / 安全审查</p>
|
||||
</div>
|
||||
<div class="hero-actions">
|
||||
<span class="top-tag" style="background: rgba(255,255,255,0.2); color: #fff;">{{ logs.length }} 条记录</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="table-card">
|
||||
<div class="table-card-header">
|
||||
<h3>合规审计日志</h3>
|
||||
<div>
|
||||
<span class="tag tag-green">通过 {{ countBy('pass') }}</span>
|
||||
<span class="tag tag-orange" style="margin-left: 6px;">风险 {{ countBy('risk') }}</span>
|
||||
<span class="tag tag-red" style="margin-left: 6px;">阻断 {{ countBy('blocked') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<el-table :data="logs" stripe>
|
||||
<el-table-column label="时间" width="170">
|
||||
<template #default="{ row }">{{ formatDate(row.created_at) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="action" label="动作" width="100" />
|
||||
<el-table-column prop="operator" label="操作人" width="120" />
|
||||
<el-table-column label="项目" width="160">
|
||||
<template #default="{ row }">
|
||||
<router-link v-if="row.project_id" :to="`/projects/${row.project_id}`" class="project-name">{{ projectName(row.project_id) }}</router-link>
|
||||
<span v-else style="color: var(--text-muted)">—</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数据资源" width="180">
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.resource_id">{{ resourceName(row.resource_id) }}</span>
|
||||
<span v-else style="color: var(--text-muted)">—</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="结果" width="100">
|
||||
<template #default="{ row }">
|
||||
<span class="tag" :class="row.result === 'pass' ? 'tag-green' : row.result === 'risk' ? 'tag-orange' : 'tag-red'">{{ row.result === 'pass' ? '通过' : row.result === 'risk' ? '风险' : '阻断' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="notes" label="备注" />
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import api from '../api'
|
||||
|
||||
const logs = ref([])
|
||||
const projects = ref([])
|
||||
const resources = ref([])
|
||||
|
||||
function formatDate(d) { if (!d) return ''; return new Date(d).toLocaleString('zh-CN', { hour12: false }) }
|
||||
function countBy(r) { return logs.value.filter(l => l.result === r).length }
|
||||
function projectName(id) { const p = projects.value.find(x => x.id === id); return p ? p.name : `#${id}` }
|
||||
function resourceName(id) { const r = resources.value.find(x => x.id === id); return r ? r.title : `#${id}` }
|
||||
|
||||
onMounted(async () => {
|
||||
logs.value = await api.listComplianceLogs()
|
||||
projects.value = await api.listProjects()
|
||||
resources.value = await api.listDataResources()
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,269 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="hero-banner">
|
||||
<div class="hero-text">
|
||||
<h1>尚数网 AI-DATA-OPC 创业孵化合作平台</h1>
|
||||
<p>数据要素 × AI × OPC 创业 — 让一人公司也能做出好产品</p>
|
||||
</div>
|
||||
<div class="hero-actions">
|
||||
<router-link to="/projects" class="btn btn-ghost" style="background: rgba(255,255,255,0.2); color: #fff; border-color: rgba(255,255,255,0.3);">
|
||||
<el-icon><Folder /></el-icon> 进入项目库
|
||||
</router-link>
|
||||
<router-link to="/cohorts" class="btn btn-ghost" style="background: rgba(255,255,255,0.2); color: #fff; border-color: rgba(255,255,255,0.3);">
|
||||
<el-icon><Calendar /></el-icon> 查看训练营
|
||||
</router-link>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 概览数字 -->
|
||||
<div class="stat-grid">
|
||||
<div class="stat-card">
|
||||
<div class="stat-label">项目总数</div>
|
||||
<div class="stat-value">{{ stats.projects || 0 }}</div>
|
||||
<div class="stat-extra">在册 OPC 团队</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div class="stat-label">招募中</div>
|
||||
<div class="stat-value" style="color: #fbbf24;">{{ stats.recruit || 0 }}</div>
|
||||
<div class="stat-extra">待入驻项目</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div class="stat-label">孵化中</div>
|
||||
<div class="stat-value" style="color: #6ea7ff;">{{ stats.incubating || 0 }}</div>
|
||||
<div class="stat-extra">一对一辅导中</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div class="stat-label">原型阶段</div>
|
||||
<div class="stat-value" style="color: #67e8f9;">{{ stats.prototype || 0 }}</div>
|
||||
<div class="stat-extra">产品原型搭建</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div class="stat-label">场景试点</div>
|
||||
<div class="stat-value" style="color: #c4b5fd;">{{ stats.pilot || 0 }}</div>
|
||||
<div class="stat-extra">场景对接验证</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div class="stat-label">市场推广</div>
|
||||
<div class="stat-value" style="color: #4ade80;">{{ stats.market || 0 }}</div>
|
||||
<div class="stat-extra">已签约客户</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="stat-grid" style="grid-template-columns: repeat(6, 1fr); margin-top: 0;">
|
||||
<div class="stat-card">
|
||||
<div class="stat-label">数据资源</div>
|
||||
<div class="stat-value">{{ stats.data_sets || 0 }}</div>
|
||||
<div class="stat-extra">合规数据集</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div class="stat-label">AI 工具</div>
|
||||
<div class="stat-value">{{ stats.tools || 0 }}</div>
|
||||
<div class="stat-extra">可用底座</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div class="stat-label">应用场景</div>
|
||||
<div class="stat-value">{{ stats.scenarios || 0 }}</div>
|
||||
<div class="stat-extra">对外开放</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div class="stat-label">孵化产品</div>
|
||||
<div class="stat-value">{{ stats.products || 0 }}</div>
|
||||
<div class="stat-extra">产品总数</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div class="stat-label">活动次数</div>
|
||||
<div class="stat-value">{{ stats.events || 0 }}</div>
|
||||
<div class="stat-extra">路演/对接</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div class="stat-label">合规审计</div>
|
||||
<div class="stat-value">{{ stats.compliance_logs || 0 }}</div>
|
||||
<div class="stat-extra">留痕记录</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- KPI 三大模块 -->
|
||||
<div class="row-3" style="margin-top: 20px;">
|
||||
<div class="card">
|
||||
<div class="card-title">项目孵化指标 <small>Incubation</small></div>
|
||||
<div v-for="k in incubateKpis" :key="k.id" class="kpi-card" style="margin-bottom: 10px; padding: 12px 14px;">
|
||||
<div class="kpi-name" style="font-size: 12px;">{{ k.metric_name }}</div>
|
||||
<div class="kpi-value" style="font-size: 22px;">{{ k.value }} <small>{{ k.unit }}</small></div>
|
||||
<div class="kpi-target">目标 {{ k.target }} {{ k.unit }}</div>
|
||||
<div class="kpi-bar">
|
||||
<div class="kpi-bar-fill" :style="{ width: percent(k) + '%' }"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-title">服务实施指标 <small>Service</small></div>
|
||||
<div v-for="k in serviceKpis" :key="k.id" class="kpi-card" style="margin-bottom: 10px; padding: 12px 14px;">
|
||||
<div class="kpi-name" style="font-size: 12px;">{{ k.metric_name }}</div>
|
||||
<div class="kpi-value" style="font-size: 22px;">{{ k.value }} <small>{{ k.unit }}</small></div>
|
||||
<div class="kpi-target">目标 {{ k.target }} {{ k.unit }}</div>
|
||||
<div class="kpi-bar">
|
||||
<div class="kpi-bar-fill" :style="{ width: percent(k) + '%' }"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-title">转化成效指标 <small>Conversion</small></div>
|
||||
<div v-for="k in conversionKpis" :key="k.id" class="kpi-card" style="margin-bottom: 10px; padding: 12px 14px;">
|
||||
<div class="kpi-name" style="font-size: 12px;">{{ k.metric_name }}</div>
|
||||
<div class="kpi-value" style="font-size: 22px;">{{ k.value }} <small>{{ k.unit }}</small></div>
|
||||
<div class="kpi-target">目标 {{ k.target }} {{ k.unit }}</div>
|
||||
<div class="kpi-bar">
|
||||
<div class="kpi-bar-fill" :style="{ width: percent(k) + '%' }"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 图表 -->
|
||||
<div class="page-section" style="margin-top: 20px;">
|
||||
<div class="card">
|
||||
<div class="card-title">项目阶段分布 <small>Stage Distribution</small></div>
|
||||
<div ref="stageChart" style="height: 280px;"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-title">项目方向分布 <small>Direction Distribution</small></div>
|
||||
<div ref="dirChart" style="height: 280px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="page-section">
|
||||
<div class="card">
|
||||
<div class="card-title">里程碑月度趋势 <small>Monthly Milestones</small></div>
|
||||
<div ref="monthlyChart" style="height: 280px;"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-title">平台公告 <small>Announcements</small></div>
|
||||
<div v-for="a in announcements" :key="a.id" style="padding: 12px 0; border-bottom: 1px solid var(--border);">
|
||||
<div style="display: flex; align-items: center; gap: 6px;">
|
||||
<span v-if="a.pinned" class="tag tag-red">置顶</span>
|
||||
<span style="font-weight: 500; font-size: 13px;">{{ a.title }}</span>
|
||||
</div>
|
||||
<div style="color: var(--text-muted); font-size: 11px; margin-top: 4px;">
|
||||
{{ formatDate(a.published_at) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, computed, nextTick } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import api from '../api'
|
||||
|
||||
const stats = ref({})
|
||||
const kpis = ref([])
|
||||
const stages = ref([])
|
||||
const dirs = ref([])
|
||||
const monthly = ref([])
|
||||
const announcements = ref([])
|
||||
|
||||
const stageChart = ref()
|
||||
const dirChart = ref()
|
||||
const monthlyChart = ref()
|
||||
let chart1, chart2, chart3
|
||||
|
||||
const incubateKpis = computed(() => kpis.value.filter(k => k.category === 'incubate'))
|
||||
const serviceKpis = computed(() => kpis.value.filter(k => k.category === 'service'))
|
||||
const conversionKpis = computed(() => kpis.value.filter(k => k.category === 'conversion'))
|
||||
|
||||
function percent(k) {
|
||||
if (!k.target) return 0
|
||||
return Math.min(100, Math.round((k.value / k.target) * 100))
|
||||
}
|
||||
|
||||
function formatDate(d) {
|
||||
if (!d) return ''
|
||||
return new Date(d).toLocaleString('zh-CN', { hour12: false })
|
||||
}
|
||||
|
||||
const stageLabelMap = {
|
||||
recruit: '招募中', incubating: '孵化中', prototype: '原型阶段',
|
||||
pilot: '场景试点', market: '市场推广', scaled: '规模化', exited: '已退出'
|
||||
}
|
||||
|
||||
function renderCharts() {
|
||||
if (chart1) chart1.dispose()
|
||||
chart1 = echarts.init(stageChart.value)
|
||||
chart1.setOption({
|
||||
backgroundColor: 'transparent',
|
||||
tooltip: { trigger: 'item' },
|
||||
legend: { bottom: 0, textStyle: { color: '#97a2b8' } },
|
||||
series: [{
|
||||
type: 'pie',
|
||||
radius: ['45%', '70%'],
|
||||
center: ['50%', '45%'],
|
||||
avoidLabelOverlap: true,
|
||||
label: { color: '#e7ecf3' },
|
||||
data: stages.value.map(s => ({
|
||||
name: stageLabelMap[s.stage] || s.stage,
|
||||
value: s.count
|
||||
})),
|
||||
itemStyle: { borderRadius: 4, borderColor: '#18223a', borderWidth: 2 }
|
||||
}],
|
||||
color: ['#fbbf24', '#6ea7ff', '#67e8f9', '#c4b5fd', '#4ade80', '#5286ff', '#f87171']
|
||||
})
|
||||
|
||||
if (chart2) chart2.dispose()
|
||||
chart2 = echarts.init(dirChart.value)
|
||||
chart2.setOption({
|
||||
backgroundColor: 'transparent',
|
||||
tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' } },
|
||||
grid: { top: 12, left: 60, right: 24, bottom: 30 },
|
||||
xAxis: { type: 'category', data: dirs.value.map(d => d.stage), axisLabel: { color: '#97a2b8', interval: 0 }, axisLine: { lineStyle: { color: '#283450' } } },
|
||||
yAxis: { type: 'value', axisLabel: { color: '#97a2b8' }, axisLine: { lineStyle: { color: '#283450' } }, splitLine: { lineStyle: { color: '#283450' } } },
|
||||
series: [{
|
||||
type: 'bar',
|
||||
data: dirs.value.map(d => d.count),
|
||||
barWidth: 22,
|
||||
itemStyle: {
|
||||
color: { type: 'linear', x: 0, y: 0, x2: 0, y2: 1, colorStops: [{ offset: 0, color: '#0d4ed8' }, { offset: 1, color: '#06b6d4' }] },
|
||||
borderRadius: [4, 4, 0, 0]
|
||||
}
|
||||
}]
|
||||
})
|
||||
|
||||
if (chart3) chart3.dispose()
|
||||
chart3 = echarts.init(monthlyChart.value)
|
||||
chart3.setOption({
|
||||
backgroundColor: 'transparent',
|
||||
tooltip: { trigger: 'axis' },
|
||||
grid: { top: 12, left: 40, right: 24, bottom: 30 },
|
||||
xAxis: { type: 'category', data: monthly.value.map(m => m.month), axisLabel: { color: '#97a2b8' }, axisLine: { lineStyle: { color: '#283450' } } },
|
||||
yAxis: { type: 'value', axisLabel: { color: '#97a2b8' }, axisLine: { lineStyle: { color: '#283450' } }, splitLine: { lineStyle: { color: '#283450' } } },
|
||||
series: [{
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
data: monthly.value.map(m => m.count),
|
||||
symbol: 'circle',
|
||||
symbolSize: 8,
|
||||
itemStyle: { color: '#06b6d4' },
|
||||
lineStyle: { color: '#06b6d4', width: 2 },
|
||||
areaStyle: { color: { type: 'linear', x: 0, y: 0, x2: 0, y2: 1, colorStops: [{ offset: 0, color: 'rgba(6,182,212,0.3)' }, { offset: 1, color: 'rgba(6,182,212,0.0)' }] } }
|
||||
}]
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
const dash = await api.getDashboard()
|
||||
// axios 拦截器返回 res.data,所以这里是 {code, data: {stats, kpis, ...}}
|
||||
const d = dash.data || dash
|
||||
stats.value = d.stats || {}
|
||||
kpis.value = d.kpis || []
|
||||
stages.value = d.stages || []
|
||||
dirs.value = d.dirs || []
|
||||
monthly.value = d.monthly || []
|
||||
announcements.value = await api.listAnnouncements() || []
|
||||
await nextTick()
|
||||
renderCharts()
|
||||
window.addEventListener('resize', () => { chart1?.resize(); chart2?.resize(); chart3?.resize() })
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,57 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="hero-banner" style="background: linear-gradient(135deg, #6d28d9 0%, #06b6d4 100%);">
|
||||
<div class="hero-text">
|
||||
<h1>合规数据资源目录</h1>
|
||||
<p>面向 OPC 团队开放:文本 / 图像 / 语音 / 视频 / 标注 / 行业专题</p>
|
||||
</div>
|
||||
<div class="hero-actions">
|
||||
<span class="top-tag" style="background: rgba(255,255,255,0.2); color: #fff;">数据资源 {{ resources.length }} 项</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row" style="margin-bottom: 16px;">
|
||||
<label>类型</label>
|
||||
<el-select v-model="filters.category" placeholder="全部类型" clearable @change="load">
|
||||
<el-option v-for="c in categories" :key="c" :label="c" :value="c" />
|
||||
</el-select>
|
||||
<label>领域</label>
|
||||
<el-select v-model="filters.domain" placeholder="全部领域" clearable @change="load">
|
||||
<el-option v-for="d in domains" :key="d" :label="d" :value="d" />
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<div class="row-3">
|
||||
<div v-for="r in resources" :key="r.id" class="resource-card">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center;">
|
||||
<span class="tag tag-blue">{{ r.category }}</span>
|
||||
<span class="tag tag-green">{{ r.license }}</span>
|
||||
</div>
|
||||
<h4 style="margin-top: 8px;">{{ r.title }}</h4>
|
||||
<div class="meta">🏷 {{ r.domain }}</div>
|
||||
<div class="desc">{{ r.description }}</div>
|
||||
<div style="margin-top: 10px; display: flex; gap: 12px; font-size: 12px; color: var(--text-muted);">
|
||||
<span>💾 {{ r.size_gb }} GB</span>
|
||||
<span>📊 {{ r.rows_count.toLocaleString() }} 条</span>
|
||||
<span>📥 已申请 {{ r.apply_count }} 次</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, computed } from 'vue'
|
||||
import api from '../api'
|
||||
|
||||
const resources = ref([])
|
||||
const filters = ref({ category: '', domain: '' })
|
||||
|
||||
const categories = computed(() => [...new Set(resources.value.map(r => r.category))])
|
||||
const domains = computed(() => [...new Set(resources.value.map(r => r.domain))])
|
||||
|
||||
async function load() {
|
||||
resources.value = await api.listDataResources(filters.value)
|
||||
}
|
||||
onMounted(load)
|
||||
</script>
|
||||
@@ -0,0 +1,43 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="hero-banner" style="background: linear-gradient(135deg, #1e40af 0%, #be185d 100%);">
|
||||
<div class="hero-text">
|
||||
<h1>供需对接 / 路演 / 活动</h1>
|
||||
<p>Demo Day / 供需对接会 / 创业者开放日 / 数据合规专题</p>
|
||||
</div>
|
||||
<div class="hero-actions">
|
||||
<span class="top-tag" style="background: rgba(255,255,255,0.2); color: #fff;">{{ events.length }} 场活动</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row-2">
|
||||
<div v-for="e in events" :key="e.id" class="resource-card">
|
||||
<div style="display: flex; justify-content: space-between;">
|
||||
<span class="tag" :class="eventColor(e.type)">{{ eventTypeLabel(e.type) }}</span>
|
||||
<span style="font-size: 11px; color: var(--text-muted);">{{ formatDate(e.event_date) }}</span>
|
||||
</div>
|
||||
<h4 style="margin-top: 8px;">{{ e.title }}</h4>
|
||||
<div class="meta">📍 {{ e.location }} · 主办:{{ e.host }}</div>
|
||||
<div class="desc">{{ e.summary }}</div>
|
||||
<div style="margin-top: 10px; display: flex; gap: 14px; font-size: 12px;">
|
||||
<span>📦 项目 {{ e.projects }} 个</span>
|
||||
<span>📞 线索 {{ e.leads }} 条</span>
|
||||
<span>🤝 签约 {{ e.deals }} 项</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import api from '../api'
|
||||
|
||||
const events = ref([])
|
||||
function formatDate(d) { if (!d) return ''; return new Date(d).toLocaleDateString('zh-CN') }
|
||||
function eventTypeLabel(t) { return { pitching: '路演', match: '供需对接', launch: '发布', compliance: '合规培训' }[t] || t }
|
||||
function eventColor(t) {
|
||||
return { pitching: 'tag-purple', match: 'tag-blue', launch: 'tag-cyan', compliance: 'tag-orange' }[t] || 'tag-gray'
|
||||
}
|
||||
onMounted(async () => { events.value = await api.listEvents() })
|
||||
</script>
|
||||
@@ -0,0 +1,43 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="hero-banner" style="background: linear-gradient(135deg, #5b21b6 0%, #1d4ed8 100%);">
|
||||
<div class="hero-text">
|
||||
<h1>导师库</h1>
|
||||
<p>技术 / 合规 / 产品 / 商业 / 投资 — 一对一辅导 OPC 团队</p>
|
||||
</div>
|
||||
<div class="hero-actions">
|
||||
<span class="top-tag" style="background: rgba(255,255,255,0.2); color: #fff;">{{ mentors.length }} 位导师</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row-3">
|
||||
<div v-for="m in mentors" :key="m.id" class="resource-card">
|
||||
<div style="display: flex; gap: 12px; align-items: center;">
|
||||
<div style="width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, #0d4ed8, #06b6d4); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 600;">
|
||||
{{ m.name[0] }}
|
||||
</div>
|
||||
<div style="flex: 1;">
|
||||
<h4 style="margin: 0;">{{ m.name }}</h4>
|
||||
<div class="meta">{{ m.title }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap;">
|
||||
<span class="tag tag-purple">{{ m.domain }}</span>
|
||||
<span class="tag tag-blue">{{ m.years_exp }} 年经验</span>
|
||||
<span class="tag tag-green">★ {{ m.rating }}</span>
|
||||
<span class="tag tag-orange">{{ m.cases }} 案例</span>
|
||||
</div>
|
||||
<div class="desc" style="margin-top: 10px;">{{ m.bio }}</div>
|
||||
<div style="font-size: 12px; color: var(--text-muted); margin-top: 8px;">🏢 {{ m.org }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import api from '../api'
|
||||
|
||||
const mentors = ref([])
|
||||
onMounted(async () => { mentors.value = await api.listMentors() })
|
||||
</script>
|
||||
@@ -0,0 +1,38 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="hero-banner" style="background: linear-gradient(135deg, #0e7490 0%, #6d28d9 100%);">
|
||||
<div class="hero-text">
|
||||
<h1>资讯动态</h1>
|
||||
<p>政策 / 行业 / 活动 / 平台 — 把握 AI-DATA-OPC 生态脉搏</p>
|
||||
</div>
|
||||
<div class="hero-actions">
|
||||
<span class="top-tag" style="background: rgba(255,255,255,0.2); color: #fff;">{{ news.length }} 条资讯</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row-2">
|
||||
<div v-for="n in news" :key="n.id" class="resource-card">
|
||||
<div style="display: flex; justify-content: space-between;">
|
||||
<span class="tag" :class="newsColor(n.category)">{{ n.category }}</span>
|
||||
<span style="font-size: 11px; color: var(--text-muted);">{{ formatDate(n.published_at) }}</span>
|
||||
</div>
|
||||
<h4 style="margin-top: 8px;">{{ n.title }}</h4>
|
||||
<div class="desc">{{ n.summary }}</div>
|
||||
<div style="font-size: 12px; color: var(--text-muted); margin-top: 8px; display: flex; justify-content: space-between;">
|
||||
<span>✍ {{ n.author }}</span>
|
||||
<span>👁 {{ n.views }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import api from '../api'
|
||||
|
||||
const news = ref([])
|
||||
function formatDate(d) { if (!d) return ''; return new Date(d).toLocaleDateString('zh-CN') }
|
||||
function newsColor(c) { return { 政策: 'tag-green', 行业: 'tag-blue', 活动: 'tag-orange', 平台: 'tag-purple' }[c] || 'tag-gray' }
|
||||
onMounted(async () => { news.value = await api.listNews() })
|
||||
</script>
|
||||
@@ -0,0 +1,144 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="hero-banner" style="background: linear-gradient(135deg, #1e3a8a 0%, #be185d 50%, #ea580c 100%);">
|
||||
<div class="hero-text">
|
||||
<h1>合作伙伴生态</h1>
|
||||
<p>数据采集与超级自动化双引擎 — 让每一位 OPC 创业者都能借力大厂能力</p>
|
||||
</div>
|
||||
<div class="hero-actions">
|
||||
<span class="top-tag" style="background: rgba(255,255,255,0.2); color: #fff;">{{ partners.length }} 家优质合作伙伴</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 焦点推荐 -->
|
||||
<div v-for="p in featuredPartners" :key="p.id" class="resource-card" style="background: linear-gradient(135deg, var(--bg-card), var(--bg-card-2)); margin-bottom: 18px; padding: 24px;">
|
||||
<div style="display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap;">
|
||||
<div style="width: 80px; height: 80px; border-radius: 16px; background: white; display: flex; align-items: center; justify-content: center; padding: 10px; flex-shrink: 0;">
|
||||
<img :src="p.logo" :alt="p.short_name" style="width: 100%; height: 100%; object-fit: contain;" @error="onImgError($event, p.short_name)" />
|
||||
</div>
|
||||
<div style="flex: 1; min-width: 280px;">
|
||||
<div style="display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 8px;">
|
||||
<div>
|
||||
<h2 style="margin: 0; font-size: 20px;">{{ p.short_name }}</h2>
|
||||
<div style="color: var(--text-muted); font-size: 12px; margin-top: 4px;">{{ p.name }}</div>
|
||||
</div>
|
||||
<a :href="p.homepage" target="_blank" class="btn btn-ghost">
|
||||
<el-icon><Link /></el-icon> 访问官网
|
||||
</a>
|
||||
</div>
|
||||
<p style="margin-top: 12px; line-height: 1.7; font-size: 13px;">{{ p.description }}</p>
|
||||
<div style="margin-top: 14px;">
|
||||
<div style="font-size: 12px; color: var(--text-muted); margin-bottom: 6px;">核心能力</div>
|
||||
<div style="display: flex; flex-wrap: wrap; gap: 6px;">
|
||||
<span v-for="(cap, idx) in p.capabilities_list" :key="idx" class="tag tag-blue">{{ cap }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-top: 14px;">
|
||||
<div style="font-size: 12px; color: var(--text-muted); margin-bottom: 6px;">适用场景</div>
|
||||
<div style="display: flex; flex-wrap: wrap; gap: 6px;">
|
||||
<span v-for="(s, idx) in p.scenarios_list" :key="idx" class="tag tag-purple">{{ s }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="p.contact" style="margin-top: 14px; font-size: 12px; color: var(--text-muted);">
|
||||
📮 联系方式:{{ p.contact }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 接入案例 -->
|
||||
<div v-if="relatedProjects.length > 0" style="margin-top: 20px; border-top: 1px solid var(--border); padding-top: 16px;">
|
||||
<div style="font-size: 13px; font-weight: 600; margin-bottom: 12px;">🎯 平台接入案例</div>
|
||||
<div class="row-3">
|
||||
<div v-for="proj in relatedProjects" :key="proj.id" class="resource-card" style="padding: 14px;">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center;">
|
||||
<router-link :to="`/projects/${proj.id}`" class="project-name" style="font-size: 14px;">{{ proj.name }}</router-link>
|
||||
<span class="stage-pill" style="font-size: 11px;">{{ stageLabel(proj.stage) }}</span>
|
||||
</div>
|
||||
<div style="font-size: 11px; color: var(--text-muted); margin-top: 4px;">{{ proj.founder }} · {{ proj.direction }}</div>
|
||||
<div style="font-size: 12px; margin-top: 8px; line-height: 1.5;">{{ proj.intro.slice(0, 80) }}…</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 全部伙伴 -->
|
||||
<div class="row-3">
|
||||
<div v-for="p in partners" :key="p.id" class="resource-card">
|
||||
<div style="display: flex; align-items: center; gap: 10px; margin-bottom: 10px;">
|
||||
<div style="width: 48px; height: 48px; border-radius: 10px; background: white; display: flex; align-items: center; justify-content: center; padding: 6px;">
|
||||
<img :src="p.logo" :alt="p.short_name" style="width: 100%; height: 100%; object-fit: contain;" @error="onImgError($event, p.short_name)" />
|
||||
</div>
|
||||
<div>
|
||||
<h4 style="margin: 0;">{{ p.short_name }}</h4>
|
||||
<span class="tag" :class="typeColor(p.type)">{{ typeLabel(p.type) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="desc" style="min-height: 60px;">{{ p.description.slice(0, 80) }}…</div>
|
||||
<div style="margin-top: 10px; display: flex; flex-wrap: wrap; gap: 4px;">
|
||||
<span v-for="(cap, idx) in p.capabilities_list.slice(0, 3)" :key="idx" class="tag tag-blue" style="font-size: 11px;">{{ cap }}</span>
|
||||
</div>
|
||||
<div style="margin-top: 10px; text-align: right;">
|
||||
<a :href="p.homepage" target="_blank" class="btn" style="font-size: 12px;">官网 →</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
import api from '../api'
|
||||
|
||||
const partners = ref([])
|
||||
const projects = ref([])
|
||||
|
||||
const featuredPartners = computed(() => partners.value.filter(p => p.featured))
|
||||
|
||||
const relatedProjects = computed(() => {
|
||||
// 取 featured 伙伴相关项目
|
||||
const fp = featuredPartners.value
|
||||
if (fp.length === 0) return []
|
||||
const ids = new Set()
|
||||
for (const p of fp) {
|
||||
for (const pid of (p.id ? [p.id] : [])) ids.add(pid)
|
||||
}
|
||||
// 实际:从 projects 找 partners 包含 1 或 2 的
|
||||
return projects.value.filter(p => p.partners && (p.partners.includes('1') || p.partners.includes('2'))).slice(0, 6)
|
||||
})
|
||||
|
||||
function typeLabel(t) {
|
||||
return { 'data-source': '数据源', 'ai-provider': 'AI 服务', 'cloud-service': '云服务', 'compliance': '合规', 'agent-platform': '智能体' }[t] || t
|
||||
}
|
||||
function typeColor(t) {
|
||||
return { 'data-source': 'tag-cyan', 'ai-provider': 'tag-purple', 'cloud-service': 'tag-blue', 'compliance': 'tag-red', 'agent-platform': 'tag-orange' }[t] || 'tag-gray'
|
||||
}
|
||||
function stageLabel(s) {
|
||||
return { recruit: '招募中', incubating: '孵化中', prototype: '原型阶段', pilot: '场景试点', market: '市场推广', scaled: '规模化', exited: '已退出' }[s] || s
|
||||
}
|
||||
|
||||
function onImgError(e, name) {
|
||||
// 用 SVG 文字 fallback
|
||||
const t = e.target
|
||||
t.style.display = 'none'
|
||||
const parent = t.parentNode
|
||||
parent.innerHTML = `<div style="font-size:24px;font-weight:700;color:#0d4ed8;">${name.slice(0, 2)}</div>`
|
||||
parent.style.background = '#f0f5ff'
|
||||
}
|
||||
|
||||
function unwrapList(j) {
|
||||
if (!j) return []
|
||||
if (Array.isArray(j)) return j
|
||||
if (j._ && Array.isArray(j._)) return j._
|
||||
return []
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
const [ps, prs] = await Promise.all([api.listPartners(), api.listProjects()])
|
||||
partners.value = ps.map(p => ({
|
||||
...p,
|
||||
capabilities_list: unwrapList(p.capabilities),
|
||||
scenarios_list: unwrapList(p.scenarios)
|
||||
}))
|
||||
projects.value = prs
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,36 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="hero-banner" style="background: linear-gradient(135deg, #15803d 0%, #0891b2 100%);">
|
||||
<div class="hero-text">
|
||||
<h1>政策扶持申报</h1>
|
||||
<p>创业补贴 / 租金减免 / 研发支持 / 人才扶持 — 一键对接</p>
|
||||
</div>
|
||||
<div class="hero-actions">
|
||||
<span class="top-tag" style="background: rgba(255,255,255,0.2); color: #fff;">{{ policies.length }} 项政策</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row-3">
|
||||
<div v-for="p in policies" :key="p.id" class="resource-card">
|
||||
<div style="display: flex; justify-content: space-between;">
|
||||
<span class="tag tag-green">{{ p.region }}</span>
|
||||
<span class="tag tag-cyan">{{ p.category }}</span>
|
||||
</div>
|
||||
<h4 style="margin-top: 8px;">{{ p.title }}</h4>
|
||||
<div class="meta">💰 最高 ¥{{ p.amount_max.toLocaleString() }}</div>
|
||||
<div class="desc">{{ p.intro }}</div>
|
||||
<div v-if="p.apply_url" style="margin-top: 8px;">
|
||||
<a :href="p.apply_url" target="_blank" style="color: var(--primary-light); font-size: 12px;">立即申请 →</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import api from '../api'
|
||||
|
||||
const policies = ref([])
|
||||
onMounted(async () => { policies.value = await api.listPolicies() })
|
||||
</script>
|
||||
@@ -0,0 +1,39 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="hero-banner" style="background: linear-gradient(135deg, #be185d 0%, #6d28d9 100%);">
|
||||
<div class="hero-text">
|
||||
<h1>孵化产品库</h1>
|
||||
<p>从原型打磨到合规认证、市场推广、资产化辅导</p>
|
||||
</div>
|
||||
<div class="hero-actions">
|
||||
<span class="top-tag" style="background: rgba(255,255,255,0.2); color: #fff;">{{ products.length }} 个产品</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row-3">
|
||||
<div v-for="p in products" :key="p.id" class="resource-card">
|
||||
<div style="display: flex; justify-content: space-between;">
|
||||
<span class="tag tag-blue">{{ p.category }}</span>
|
||||
<span class="tag" :class="p.status === 'certified' ? 'tag-green' : p.status === 'listed' ? 'tag-cyan' : p.status === 'assetized' ? 'tag-purple' : 'tag-gray'">{{ statusLabel(p.status) }}</span>
|
||||
</div>
|
||||
<h4 style="margin-top: 8px;">{{ p.name }}</h4>
|
||||
<div class="desc">{{ p.tagline }}</div>
|
||||
<div style="margin-top: 10px; display: flex; gap: 8px;">
|
||||
<span class="tag" :class="p.compliance === 'passed' ? 'tag-green' : 'tag-orange'">{{ p.compliance === 'passed' ? '✓ 合规' : '审查中' }}</span>
|
||||
</div>
|
||||
<div v-if="p.demo_url" style="margin-top: 8px; font-size: 12px;">
|
||||
<a :href="p.demo_url" target="_blank" style="color: var(--primary-light)">查看 Demo →</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import api from '../api'
|
||||
|
||||
const products = ref([])
|
||||
function statusLabel(s) { return { prototyping: '原型', listed: '已上架', certified: '已认证', assetized: '已资产化' }[s] || s }
|
||||
onMounted(async () => { products.value = await api.listProducts() })
|
||||
</script>
|
||||
@@ -0,0 +1,206 @@
|
||||
<template>
|
||||
<div v-if="project">
|
||||
<div class="card" style="margin-bottom: 16px;">
|
||||
<div style="display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start;">
|
||||
<div style="flex: 1; min-width: 280px;">
|
||||
<div style="display: flex; align-items: center; gap: 12px;">
|
||||
<h2 style="margin: 0; font-size: 22px;">{{ project.name }}</h2>
|
||||
<span class="stage-pill" :style="{ background: stageColor(project.stage).bg, color: stageColor(project.stage).color }">{{ stageLabel(project.stage) }}</span>
|
||||
<span class="tag" :class="project.package === 'custom' ? 'tag-purple' : project.package === 'advanced' ? 'tag-blue' : 'tag-gray'">{{ pkgLabel(project.package) }}</span>
|
||||
</div>
|
||||
<div style="color: var(--text-muted); margin-top: 6px; font-size: 13px;">
|
||||
{{ project.direction }} · {{ teamLabel(project.team_type) }} · 创始人 {{ project.founder }}
|
||||
</div>
|
||||
<div style="margin-top: 14px; line-height: 1.8; font-size: 13px;">
|
||||
{{ project.intro }}
|
||||
</div>
|
||||
</div>
|
||||
<div style="width: 240px;">
|
||||
<div style="font-size: 12px; color: var(--text-muted); margin-bottom: 6px;">项目进度</div>
|
||||
<div class="progress-bar" style="height: 10px;">
|
||||
<div class="progress-fill" :style="{ width: project.progress + '%' }"></div>
|
||||
</div>
|
||||
<div style="font-size: 20px; font-weight: 700; margin-top: 6px;">{{ project.progress }}%</div>
|
||||
<div style="display: flex; gap: 8px; margin-top: 12px;">
|
||||
<span class="tag tag-blue">已入驻空间</span>
|
||||
<span v-if="project.space" style="font-size: 11px;">{{ project.space.name }}</span>
|
||||
</div>
|
||||
<div style="display: flex; gap: 8px; margin-top: 8px;">
|
||||
<span class="tag tag-orange">所在训练营</span>
|
||||
<span v-if="project.cohort" style="font-size: 11px;">{{ project.cohort.name }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="page-section">
|
||||
<div class="card">
|
||||
<div class="card-title">项目里程碑</div>
|
||||
<div v-for="m in milestones" :key="m.id" style="display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border);">
|
||||
<div style="width: 80px; color: var(--text-muted); font-size: 12px;">{{ formatDate(m.happened_at) }}</div>
|
||||
<div style="flex: 1;">
|
||||
<div style="font-weight: 500;">{{ m.title }}</div>
|
||||
<div style="color: var(--text-muted); font-size: 12px; margin-top: 2px;">{{ m.evidence }}</div>
|
||||
</div>
|
||||
<span class="stage-pill">{{ stageLabel(m.stage) }}</span>
|
||||
</div>
|
||||
<div v-if="milestones.length === 0" class="empty">暂无里程碑</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-title">团队成员</div>
|
||||
<div v-for="m in project.members" :key="m.id" style="display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border);">
|
||||
<div style="width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #0d4ed8, #06b6d4); display: flex; align-items: center; justify-content: center; font-weight: 600;">
|
||||
{{ m.name[0] }}
|
||||
</div>
|
||||
<div style="flex: 1;">
|
||||
<div style="font-weight: 500;">{{ m.name }}</div>
|
||||
<div style="font-size: 12px; color: var(--text-muted);">{{ m.role }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="!project.members?.length" class="empty">暂无团队成员</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="page-section">
|
||||
<div class="card">
|
||||
<div class="card-title">场景对接</div>
|
||||
<div v-for="m in mappings" :key="m.id" style="padding: 12px 0; border-bottom: 1px solid var(--border);">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center;">
|
||||
<div style="font-weight: 500;">{{ scenarioName(m.scenario_id) }}</div>
|
||||
<span class="tag" :class="m.status === 'passed' ? 'tag-green' : m.status === 'testing' ? 'tag-blue' : 'tag-gray'">{{ mapStatusLabel(m.status) }}</span>
|
||||
</div>
|
||||
<div style="color: var(--text-muted); font-size: 12px; margin-top: 4px;">
|
||||
{{ m.started_at ? formatDate(m.started_at) : '未启动' }} → {{ m.closed_at ? formatDate(m.closed_at) : '进行中' }}
|
||||
</div>
|
||||
<div style="font-size: 12px; margin-top: 4px;">{{ m.feedback }}</div>
|
||||
</div>
|
||||
<div v-if="mappings.length === 0" class="empty">暂无场景对接</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-title">一对一辅导</div>
|
||||
<div v-for="c in coachings" :key="c.id" style="padding: 10px 0; border-bottom: 1px solid var(--border);">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center;">
|
||||
<div style="font-weight: 500;">{{ c.mentor_name }} <small style="color: var(--text-muted);">{{ c.mentor_org }}</small></div>
|
||||
<span class="tag" :class="c.status === 'done' ? 'tag-green' : 'tag-blue'">{{ c.status === 'done' ? '已完成' : '已安排' }}</span>
|
||||
</div>
|
||||
<div style="color: var(--text-muted); font-size: 12px; margin-top: 4px;">主题:{{ c.topic }} · {{ formatDate(c.scheduled_at) }} · {{ c.duration_min }} min</div>
|
||||
<div v-if="c.notes" style="font-size: 12px; margin-top: 4px;">{{ c.notes }}</div>
|
||||
</div>
|
||||
<div v-if="coachings.length === 0" class="empty">暂无辅导记录</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="page-section">
|
||||
<div class="card">
|
||||
<div class="card-title">合规审计 (引用项目)</div>
|
||||
<div v-for="l in complianceLogs" :key="l.id" style="padding: 10px 0; border-bottom: 1px solid var(--border);">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center;">
|
||||
<span style="font-weight: 500;">{{ l.action }} <small style="color: var(--text-muted); font-weight: 400;">· {{ l.operator }}</small></span>
|
||||
<span class="tag" :class="l.result === 'pass' ? 'tag-green' : l.result === 'risk' ? 'tag-orange' : 'tag-red'">{{ l.result === 'pass' ? '通过' : l.result === 'risk' ? '风险' : '阻断' }}</span>
|
||||
</div>
|
||||
<div style="color: var(--text-muted); font-size: 12px; margin-top: 4px;">{{ formatDate(l.created_at) }} · {{ l.notes }}</div>
|
||||
</div>
|
||||
<div v-if="complianceLogs.length === 0" class="empty">暂无合规记录</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-title">政策申报</div>
|
||||
<div v-for="(a, idx) in policyApps" :key="a.id" style="padding: 10px 0; border-bottom: 1px solid var(--border);">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center;">
|
||||
<div style="font-weight: 500;">{{ policyName(a.policy_id) }}</div>
|
||||
<span class="tag" :class="a.status === 'granted' ? 'tag-green' : a.status === 'reviewing' ? 'tag-blue' : 'tag-gray'">{{ a.status === 'granted' ? '已通过' : a.status === 'reviewing' ? '审核中' : '已提交' }}</span>
|
||||
</div>
|
||||
<div style="color: var(--text-muted); font-size: 12px; margin-top: 4px;">
|
||||
申报 {{ a.submitted_at ? formatDate(a.submitted_at) : '—' }} {{ a.amount ? '· 获批 ¥' + a.amount : '' }}
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="policyApps.length === 0" class="empty">暂无政策申报</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card" style="margin-top: 18px;">
|
||||
<div class="card-title">产品列表</div>
|
||||
<div class="row-4">
|
||||
<div v-for="p in project.products" :key="p.id" class="resource-card">
|
||||
<h4>{{ p.name }}</h4>
|
||||
<div class="meta">{{ p.category }}</div>
|
||||
<div class="desc">{{ p.tagline }}</div>
|
||||
<div style="margin-top: 8px;">
|
||||
<span class="tag" :class="p.status === 'certified' ? 'tag-green' : p.status === 'listed' ? 'tag-blue' : 'tag-gray'">{{ p.status === 'certified' ? '已认证' : p.status === 'listed' ? '已上架' : '原型' }}</span>
|
||||
<span class="tag" :class="p.compliance === 'passed' ? 'tag-green' : 'tag-orange'" style="margin-left: 4px;">{{ p.compliance === 'passed' ? '合规' : '审查中' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="!project.products?.length" class="empty">暂无产品</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, computed } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import api from '../api'
|
||||
|
||||
const route = useRoute()
|
||||
const project = ref(null)
|
||||
const milestones = ref([])
|
||||
const coachings = ref([])
|
||||
const scenarios = ref([])
|
||||
const mappings = ref([])
|
||||
const policyApps = ref([])
|
||||
const policies = ref([])
|
||||
const complianceLogs = ref([])
|
||||
|
||||
const stageLabelMap = {
|
||||
recruit: '招募中', incubating: '孵化中', prototype: '原型阶段',
|
||||
pilot: '场景试点', market: '市场推广', scaled: '规模化', exited: '已退出'
|
||||
}
|
||||
function stageLabel(s) { return stageLabelMap[s] || s }
|
||||
function pkgLabel(p) { return { basic: '基础权益', advanced: '进阶孵化', custom: '定制服务' }[p] || p }
|
||||
function teamLabel(t) { return { oneperson: '一人公司', microteam: '微型团队', earlyteam: '早期团队' }[t] || t }
|
||||
function stageColor(s) {
|
||||
return {
|
||||
recruit: { bg: 'rgba(245,158,11,0.2)', color: '#fbbf24' },
|
||||
incubating: { bg: 'rgba(110,167,255,0.2)', color: '#6ea7ff' },
|
||||
prototype: { bg: 'rgba(103,232,249,0.2)', color: '#67e8f9' },
|
||||
pilot: { bg: 'rgba(196,181,253,0.2)', color: '#c4b5fd' },
|
||||
market: { bg: 'rgba(74,222,128,0.2)', color: '#4ade80' },
|
||||
scaled: { bg: 'rgba(82,134,255,0.2)', color: '#5286ff' }
|
||||
}[s] || { bg: 'rgba(148,163,184,0.2)', color: '#cbd5e1' }
|
||||
}
|
||||
|
||||
function mapStatusLabel(s) {
|
||||
return { pending: '待启动', testing: '测试中', passed: '已通过', failed: '未通过' }[s] || s
|
||||
}
|
||||
|
||||
function formatDate(d) {
|
||||
if (!d) return ''
|
||||
return new Date(d).toLocaleDateString('zh-CN')
|
||||
}
|
||||
|
||||
function scenarioName(id) {
|
||||
const s = scenarios.value.find(x => x.id === id)
|
||||
return s ? s.name : `#${id}`
|
||||
}
|
||||
function policyName(id) {
|
||||
const p = policies.value.find(x => x.id === id)
|
||||
return p ? p.title : `#${id}`
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
const id = route.params.id
|
||||
const data = await api.getProject(id)
|
||||
project.value = data.project
|
||||
milestones.value = data.milestones || []
|
||||
coachings.value = data.coachings || []
|
||||
scenarios.value = data.scenarios || []
|
||||
mappings.value = data.mappings || []
|
||||
policyApps.value = data.policy_apps || []
|
||||
policies.value = data.policies || []
|
||||
// 拉该项目的合规日志
|
||||
const allLogs = await api.listComplianceLogs()
|
||||
complianceLogs.value = allLogs.filter(l => l.project_id === Number(id))
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,121 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="card" style="margin-bottom: 16px;">
|
||||
<div class="form-row">
|
||||
<label>关键词</label>
|
||||
<el-input v-model="filters.kw" placeholder="搜索项目名 / 创始人" clearable />
|
||||
<label>阶段</label>
|
||||
<el-select v-model="filters.stage" placeholder="全部阶段" clearable>
|
||||
<el-option v-for="s in stages" :key="s.value" :label="s.label" :value="s.value" />
|
||||
</el-select>
|
||||
<label>方向</label>
|
||||
<el-select v-model="filters.direction" placeholder="全部方向" clearable>
|
||||
<el-option v-for="d in directions" :key="d.value" :label="d.label" :value="d.value" />
|
||||
</el-select>
|
||||
<button class="btn" @click="load">查询</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="table-card">
|
||||
<div class="table-card-header">
|
||||
<h3>项目库 · {{ projects.length }} 个 OPC 项目</h3>
|
||||
<div>
|
||||
<span class="tag tag-blue">招募中 {{ countByStage('recruit') }}</span>
|
||||
<span class="tag tag-orange" style="margin-left:6px;">孵化中 {{ countByStage('incubating') }}</span>
|
||||
<span class="tag tag-cyan" style="margin-left:6px;">原型 {{ countByStage('prototype') }}</span>
|
||||
<span class="tag tag-purple" style="margin-left:6px;">试点 {{ countByStage('pilot') }}</span>
|
||||
<span class="tag tag-green" style="margin-left:6px;">市场 {{ countByStage('market') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<el-table :data="projects" stripe>
|
||||
<el-table-column prop="name" label="项目名" width="180">
|
||||
<template #default="{ row }">
|
||||
<router-link :to="`/projects/${row.id}`" class="project-name">{{ row.name }}</router-link>
|
||||
<div style="font-size: 11px; color: var(--text-muted); margin-top: 2px;">{{ row.founder }} · {{ row.team_type === 'oneperson' ? '一人公司' : row.team_type === 'microteam' ? '微型团队' : '早期团队' }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="direction" label="方向" width="100" />
|
||||
<el-table-column label="阶段" width="120">
|
||||
<template #default="{ row }">
|
||||
<span class="stage-pill" :style="{ background: stageColor(row.stage).bg, color: stageColor(row.stage).color }">{{ stageLabel(row.stage) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="孵化空间" min-width="180">
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.space">{{ row.space.name }}</span>
|
||||
<span v-else style="color: var(--text-muted)">未入驻</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="训练营" min-width="180">
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.cohort">{{ row.cohort.name }}</span>
|
||||
<span v-else style="color: var(--text-muted)">—</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="服务包" width="100">
|
||||
<template #default="{ row }">
|
||||
<span class="tag" :class="row.package === 'custom' ? 'tag-purple' : row.package === 'advanced' ? 'tag-blue' : 'tag-gray'">{{ pkgLabel(row.package) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="进度" width="160">
|
||||
<template #default="{ row }">
|
||||
<div class="progress-bar">
|
||||
<div class="progress-fill" :style="{ width: row.progress + '%' }"></div>
|
||||
</div>
|
||||
<div style="font-size: 11px; color: var(--text-muted); margin-top: 4px;">{{ row.progress }}%</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100">
|
||||
<template #default="{ row }">
|
||||
<router-link :to="`/projects/${row.id}`" class="btn" style="font-size: 12px;">查看</router-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import api from '../api'
|
||||
|
||||
const projects = ref([])
|
||||
const stages = ref([])
|
||||
const directions = ref([])
|
||||
const filters = ref({ kw: '', stage: '', direction: '' })
|
||||
|
||||
const stageLabelMap = {
|
||||
recruit: '招募中', incubating: '孵化中', prototype: '原型阶段',
|
||||
pilot: '场景试点', market: '市场推广', scaled: '规模化', exited: '已退出'
|
||||
}
|
||||
|
||||
function stageLabel(s) { return stageLabelMap[s] || s }
|
||||
function pkgLabel(p) {
|
||||
return { basic: '基础权益', advanced: '进阶孵化', custom: '定制服务' }[p] || p
|
||||
}
|
||||
function countByStage(s) {
|
||||
return projects.value.filter(p => p.stage === s).length
|
||||
}
|
||||
function stageColor(s) {
|
||||
return {
|
||||
recruit: { bg: 'rgba(245,158,11,0.2)', color: '#fbbf24' },
|
||||
incubating: { bg: 'rgba(110,167,255,0.2)', color: '#6ea7ff' },
|
||||
prototype: { bg: 'rgba(103,232,249,0.2)', color: '#67e8f9' },
|
||||
pilot: { bg: 'rgba(196,181,253,0.2)', color: '#c4b5fd' },
|
||||
market: { bg: 'rgba(74,222,128,0.2)', color: '#4ade80' },
|
||||
scaled: { bg: 'rgba(82,134,255,0.2)', color: '#5286ff' },
|
||||
exited: { bg: 'rgba(148,163,184,0.2)', color: '#cbd5e1' }
|
||||
}[s] || { bg: 'rgba(148,163,184,0.2)', color: '#cbd5e1' }
|
||||
}
|
||||
|
||||
async function load() {
|
||||
const data = await api.listProjects(filters.value)
|
||||
projects.value = data
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
stages.value = await api.getStages()
|
||||
directions.value = await api.getDirections()
|
||||
await load()
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,68 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="hero-banner" style="background: linear-gradient(135deg, #0f766e 0%, #0d4ed8 100%);">
|
||||
<div class="hero-text">
|
||||
<h1>应用场景对接</h1>
|
||||
<p>公共服务 / 城市治理 / 产业协同 / 企业服务 — 从原型到试点验证</p>
|
||||
</div>
|
||||
<div class="hero-actions">
|
||||
<span class="top-tag" style="background: rgba(255,255,255,0.2); color: #fff;">{{ scenarios.length }} 个场景</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="page-section">
|
||||
<div class="card">
|
||||
<div class="card-title">应用场景</div>
|
||||
<div class="row-2">
|
||||
<div v-for="s in scenarios" :key="s.id" class="resource-card">
|
||||
<div style="display: flex; justify-content: space-between;">
|
||||
<span class="tag tag-purple">{{ s.domain }}</span>
|
||||
<span class="tag" :class="s.status === 'open' ? 'tag-green' : s.status === 'pilot' ? 'tag-orange' : 'tag-gray'">{{ s.status === 'open' ? '开放中' : s.status === 'pilot' ? '试点中' : '已关闭' }}</span>
|
||||
</div>
|
||||
<h4 style="margin-top: 8px;">{{ s.name }}</h4>
|
||||
<div class="meta">🏛 {{ s.publisher }} · {{ s.partner_org }}</div>
|
||||
<div class="desc">{{ s.intro }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-title">项目 × 场景对接</div>
|
||||
<div v-for="m in mappings" :key="m.id" style="padding: 10px 0; border-bottom: 1px solid var(--border);">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center;">
|
||||
<div>
|
||||
<span style="font-weight: 500;">{{ projectName(m.project_id) }}</span>
|
||||
<span style="color: var(--text-muted); margin: 0 6px;">→</span>
|
||||
<span style="font-weight: 500;">{{ scenarioName(m.scenario_id) }}</span>
|
||||
</div>
|
||||
<span class="tag" :class="m.status === 'passed' ? 'tag-green' : m.status === 'testing' ? 'tag-blue' : m.status === 'failed' ? 'tag-red' : 'tag-gray'">{{ mapStatusLabel(m.status) }}</span>
|
||||
</div>
|
||||
<div style="font-size: 12px; color: var(--text-muted); margin-top: 4px;">
|
||||
{{ m.started_at ? formatDate(m.started_at) : '未启动' }} → {{ m.closed_at ? formatDate(m.closed_at) : '进行中' }}
|
||||
</div>
|
||||
<div style="font-size: 12px; margin-top: 4px;">{{ m.feedback }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import api from '../api'
|
||||
|
||||
const scenarios = ref([])
|
||||
const mappings = ref([])
|
||||
const projects = ref([])
|
||||
|
||||
function formatDate(d) { if (!d) return ''; return new Date(d).toLocaleDateString('zh-CN') }
|
||||
function mapStatusLabel(s) { return { pending: '待启动', testing: '测试中', passed: '已通过', failed: '未通过' }[s] || s }
|
||||
function projectName(id) { const p = projects.value.find(x => x.id === id); return p ? p.name : `#${id}` }
|
||||
function scenarioName(id) { const s = scenarios.value.find(x => x.id === id); return s ? s.name : `#${id}` }
|
||||
|
||||
onMounted(async () => {
|
||||
scenarios.value = await api.listScenarios()
|
||||
mappings.value = await api.listScenarioMappings()
|
||||
projects.value = await api.listProjects()
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,41 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="hero-banner" style="background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);">
|
||||
<div class="hero-text">
|
||||
<h1>AI-DATA-OPC 创业服务空间</h1>
|
||||
<p>线下空间 + 线上入口协同服务 — 共享办公 / 路演 / 测试 / 数据沙盒</p>
|
||||
</div>
|
||||
<div class="hero-actions">
|
||||
<span class="top-tag" style="background: rgba(255,255,255,0.2); color: #fff;">共建空间 {{ spaces.length }} 个</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row-2">
|
||||
<div v-for="s in spaces" :key="s.id" class="resource-card">
|
||||
<div style="display: flex; justify-content: space-between; align-items: flex-start;">
|
||||
<h4>{{ s.name }}</h4>
|
||||
<span class="tag" :class="s.type === 'online' ? 'tag-cyan' : s.type === 'hybrid' ? 'tag-purple' : 'tag-blue'">{{ s.type === 'online' ? '线上虚拟' : s.type === 'hybrid' ? '线上线下' : '线下空间' }}</span>
|
||||
</div>
|
||||
<div class="meta">📍 {{ s.location }}</div>
|
||||
<div class="desc">{{ s.features }}</div>
|
||||
<div style="margin-top: 12px;">
|
||||
<div style="display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted);">
|
||||
<span>入驻:{{ s.occupied }} / {{ s.capacity }}</span>
|
||||
<span>{{ Math.round(s.occupied / s.capacity * 100) }}%</span>
|
||||
</div>
|
||||
<div class="progress-bar" style="margin-top: 4px;">
|
||||
<div class="progress-fill" :style="{ width: Math.round(s.occupied / s.capacity * 100) + '%' }"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import api from '../api'
|
||||
|
||||
const spaces = ref([])
|
||||
onMounted(async () => { spaces.value = await api.listSpaces() })
|
||||
</script>
|
||||
@@ -0,0 +1,190 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="hero-banner" style="background: linear-gradient(135deg, #1e3a8a 0%, #be185d 100%);">
|
||||
<div class="hero-text">
|
||||
<h1>工具运行记录</h1>
|
||||
<p>追踪 15 件 OPC 工具的调用历史 — 输入 / 输出 / 评分 / 耗时</p>
|
||||
</div>
|
||||
<div class="hero-actions">
|
||||
<span class="top-tag" style="background: rgba(255,255,255,0.2); color: #fff;">运行 {{ runs.length }} 次</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 概览 -->
|
||||
<div class="row-4" style="margin-bottom: 18px;">
|
||||
<div class="stat-card">
|
||||
<div class="stat-label">总运行次数</div>
|
||||
<div class="stat-value">{{ runs.length }}</div>
|
||||
<div class="stat-extra">近 30 天</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div class="stat-label">独立用户</div>
|
||||
<div class="stat-value">{{ uniqueUsers }}</div>
|
||||
<div class="stat-extra">活跃用户</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div class="stat-label">平均评分</div>
|
||||
<div class="stat-value">{{ avgScore }}</div>
|
||||
<div class="stat-extra">合规评分 / 100</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div class="stat-label">平均耗时</div>
|
||||
<div class="stat-value">{{ avgDuration }} <small style="font-size: 14px;">ms</small></div>
|
||||
<div class="stat-extra">单次运行</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 工具排行 -->
|
||||
<div class="page-section">
|
||||
<div class="card">
|
||||
<div class="card-title">工具调用排行</div>
|
||||
<div v-for="(t, idx) in toolRanking" :key="t.tool_id" style="display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); align-items: center;">
|
||||
<div style="display: flex; align-items: center; gap: 10px;">
|
||||
<span class="tag" :class="idx < 3 ? 'tag-green' : 'tag-gray'">#{{ idx + 1 }}</span>
|
||||
<span style="font-weight: 500;">{{ toolName(t.tool_id) }}</span>
|
||||
</div>
|
||||
<div style="display: flex; align-items: center; gap: 16px;">
|
||||
<div class="progress-bar" style="width: 120px;">
|
||||
<div class="progress-fill" :style="{ width: t.count * 100 / (toolRanking[0]?.count || 1) + '%' }"></div>
|
||||
</div>
|
||||
<span style="font-size: 12px; color: var(--text-muted); width: 50px;">{{ t.count }} 次</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-title">用户使用排行</div>
|
||||
<div v-for="(u, idx) in userRanking" :key="u.user" style="display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border);">
|
||||
<div style="display: flex; align-items: center; gap: 10px;">
|
||||
<span class="tag" :class="idx < 3 ? 'tag-blue' : 'tag-gray'">#{{ idx + 1 }}</span>
|
||||
<span style="font-weight: 500;">{{ u.user }}</span>
|
||||
</div>
|
||||
<span style="color: var(--primary-light); font-weight: 600;">{{ u.count }} 次</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 运行历史 -->
|
||||
<div class="table-card">
|
||||
<div class="table-card-header">
|
||||
<h3>最新运行记录</h3>
|
||||
<div>
|
||||
<span class="tag tag-blue">共 {{ runs.length }} 条</span>
|
||||
</div>
|
||||
</div>
|
||||
<el-table :data="runs" stripe>
|
||||
<el-table-column label="时间" width="160">
|
||||
<template #default="{ row }">{{ formatDate(row.created_at) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工具" width="220">
|
||||
<template #default="{ row }">
|
||||
<span style="font-weight: 500;">{{ toolName(row.tool_id) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="用户" width="120">
|
||||
<template #default="{ row }">{{ row.user_name }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="评分" width="120">
|
||||
<template #default="{ row }">
|
||||
<span class="tag" :class="scoreTag(row.score)">{{ row.score?.toFixed(1) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="耗时" width="100">
|
||||
<template #default="{ row }">{{ row.duration_ms }} ms</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="输入与输出">
|
||||
<template #default="{ row }">
|
||||
<div style="font-size: 12px; color: var(--text-muted);">
|
||||
<div style="margin-bottom: 4px;">{{ summarizeInput(row.input) }}</div>
|
||||
<div style="color: var(--primary-light);">{{ summarizeOutput(row.output) }}</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
import api from '../api'
|
||||
|
||||
const runs = ref([])
|
||||
const tools = ref([])
|
||||
|
||||
const uniqueUsers = computed(() => {
|
||||
const set = new Set(runs.value.map(r => r.user_name))
|
||||
return set.size
|
||||
})
|
||||
|
||||
const avgScore = computed(() => {
|
||||
const valid = runs.value.filter(r => r.score != null)
|
||||
if (valid.length === 0) return '0.0'
|
||||
return (valid.reduce((sum, r) => sum + r.score, 0) / valid.length).toFixed(1)
|
||||
})
|
||||
|
||||
const avgDuration = computed(() => {
|
||||
if (runs.value.length === 0) return 0
|
||||
return Math.round(runs.value.reduce((sum, r) => sum + (r.duration_ms || 0), 0) / runs.value.length)
|
||||
})
|
||||
|
||||
const toolRanking = computed(() => {
|
||||
const map = {}
|
||||
for (const r of runs.value) {
|
||||
map[r.tool_id] = (map[r.tool_id] || 0) + 1
|
||||
}
|
||||
return Object.entries(map).map(([tool_id, count]) => ({ tool_id: Number(tool_id), count }))
|
||||
.sort((a, b) => b.count - a.count)
|
||||
})
|
||||
|
||||
const userRanking = computed(() => {
|
||||
const map = {}
|
||||
for (const r of runs.value) {
|
||||
map[r.user_name] = (map[r.user_name] || 0) + 1
|
||||
}
|
||||
return Object.entries(map).map(([user, count]) => ({ user, count }))
|
||||
.sort((a, b) => b.count - a.count)
|
||||
})
|
||||
|
||||
function toolName(id) {
|
||||
const t = tools.value.find(x => x.id === id)
|
||||
return t ? t.name : `工具 #${id}`
|
||||
}
|
||||
|
||||
function scoreTag(s) {
|
||||
if (s >= 85) return 'tag-green'
|
||||
if (s >= 70) return 'tag-cyan'
|
||||
if (s >= 50) return 'tag-orange'
|
||||
return 'tag-red'
|
||||
}
|
||||
|
||||
function formatDate(d) {
|
||||
if (!d) return ''
|
||||
return new Date(d).toLocaleString('zh-CN', { hour12: false })
|
||||
}
|
||||
|
||||
function summarizeInput(inp) {
|
||||
if (!inp) return ''
|
||||
const items = Object.entries(inp).slice(0, 3)
|
||||
return items.map(([k, v]) => {
|
||||
const val = typeof v === 'object' ? JSON.stringify(v) : String(v).slice(0, 30)
|
||||
return `${k}: ${val}`
|
||||
}).join(' | ')
|
||||
}
|
||||
|
||||
function summarizeOutput(out) {
|
||||
if (!out) return ''
|
||||
if (out.path) return `→ ${out.path} (${out.score})`
|
||||
if (out.document) return `→ 文档 ${out.word_count || '已生成'}`
|
||||
if (out.slogans) return `→ ${out.slogans[0]}`
|
||||
if (out.level) return `→ ${out.level} (${out.score})`
|
||||
if (out.overall) return `→ ${out.overall}`
|
||||
if (out.score) return `→ 评分 ${out.score}`
|
||||
return '→ 完成'
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
runs.value = await api.listToolRuns()
|
||||
tools.value = await api.listTools()
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,244 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="hero-banner" style="background: linear-gradient(135deg, #4338ca 0%, #db2777 100%);">
|
||||
<div class="hero-text">
|
||||
<h1>OPC 工具箱 · 即用即得</h1>
|
||||
<p>面向数据 / 跨境 / 法律 / 设计背景的 OPC 创业者 — 一键生成合规文件、品牌方案、商业画布</p>
|
||||
</div>
|
||||
<div class="hero-actions">
|
||||
<span class="top-tag" style="background: rgba(255,255,255,0.2); color: #fff;">15 件工具</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 分类 Tabs -->
|
||||
<div class="card" style="margin-bottom: 16px;">
|
||||
<div style="display: flex; gap: 8px; flex-wrap: wrap;">
|
||||
<button
|
||||
v-for="d in domains"
|
||||
:key="d.value"
|
||||
class="btn"
|
||||
:class="{ 'btn-primary': activeDomain === d.value }"
|
||||
@click="activeDomain = d.value"
|
||||
>
|
||||
<el-icon><component :is="d.icon" /></el-icon>
|
||||
{{ d.label }} <span style="opacity: 0.6; margin-left: 4px;">{{ d.count }}</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 工具卡片 -->
|
||||
<div class="row-3">
|
||||
<div v-for="tool in filteredTools" :key="tool.id" class="resource-card" @click="openTool(tool)">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center;">
|
||||
<span class="tag" :class="domainColor(tool.domain)">{{ domainLabel(tool.domain) }}</span>
|
||||
<span class="tag" :class="tool.status === 'available' ? 'tag-green' : tool.status === 'beta' ? 'tag-orange' : 'tag-gray'">{{ tool.status === 'available' ? '可用' : tool.status === 'beta' ? '内测' : '即将上线' }}</span>
|
||||
</div>
|
||||
<h4 style="margin-top: 8px;">{{ tool.name }}</h4>
|
||||
<div class="desc" style="min-height: 60px;">{{ tool.description }}</div>
|
||||
<div style="margin-top: 10px; display: flex; justify-content: space-between; align-items: center;">
|
||||
<span class="tag tag-cyan">v{{ tool.version }}</span>
|
||||
<span style="font-size: 12px; color: var(--text-muted);">🎁 {{ tool.free_quota }}</span>
|
||||
</div>
|
||||
<div style="margin-top: 12px; display: flex; justify-content: flex-end;">
|
||||
<button class="btn btn-primary" style="font-size: 12px;">
|
||||
<el-icon><Promotion /></el-icon> 立即使用
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="filteredTools.length === 0" class="empty">该分类暂无工具</div>
|
||||
|
||||
<!-- 工具运行抽屉 -->
|
||||
<el-drawer v-model="drawerOpen" :title="currentTool?.name" size="640px" :close-on-click-modal="false">
|
||||
<div v-if="currentTool">
|
||||
<div style="margin-bottom: 16px; padding: 12px 14px; background: rgba(82,134,255,0.1); border-radius: 8px; color: var(--text-muted); font-size: 12px;">
|
||||
{{ currentTool.description }}
|
||||
</div>
|
||||
|
||||
<div v-if="!result">
|
||||
<div v-for="f in fields" :key="f.key" style="margin-bottom: 14px;">
|
||||
<div style="font-size: 13px; margin-bottom: 6px; color: var(--text-muted);">
|
||||
{{ f.label }} <span v-if="f.required" style="color: var(--danger);">*</span>
|
||||
</div>
|
||||
<el-input
|
||||
v-if="f.type === 'text'"
|
||||
v-model="form[f.key]"
|
||||
:placeholder="f.placeholder || ''"
|
||||
/>
|
||||
<el-input
|
||||
v-else-if="f.type === 'textarea'"
|
||||
v-model="form[f.key]"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
:placeholder="f.placeholder || ''"
|
||||
/>
|
||||
<el-input-number
|
||||
v-else-if="f.type === 'number'"
|
||||
v-model="form[f.key]"
|
||||
style="width: 100%;"
|
||||
/>
|
||||
<el-select v-else-if="f.type === 'select'" v-model="form[f.key]" :placeholder="f.placeholder || '请选择'" style="width: 100%;">
|
||||
<el-option v-for="opt in f.options" :key="opt" :label="opt" :value="opt" />
|
||||
</el-select>
|
||||
<el-select v-else-if="f.type === 'multiselect'" v-model="form[f.key]" multiple :placeholder="f.placeholder || '可多选'" style="width: 100%;">
|
||||
<el-option v-for="opt in f.options" :key="opt" :label="opt" :value="opt" />
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<div style="margin-top: 20px; display: flex; gap: 8px; justify-content: flex-end;">
|
||||
<button class="btn" @click="drawerOpen = false">取消</button>
|
||||
<button class="btn btn-primary" :disabled="running" @click="runTool">
|
||||
<el-icon><Promotion /></el-icon>
|
||||
{{ running ? '运行中...' : '运行工具' }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 结果 -->
|
||||
<div v-else>
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px;">
|
||||
<div>
|
||||
<span class="tag tag-green">运行成功</span>
|
||||
<span style="margin-left: 8px; font-size: 12px; color: var(--text-muted);">耗时 {{ result.duration_ms }} ms</span>
|
||||
</div>
|
||||
<div style="display: flex; gap: 8px;">
|
||||
<button class="btn" @click="result = null">重新运行</button>
|
||||
<button class="btn" @click="copyResult">
|
||||
<el-icon><CopyDocument /></el-icon> 复制结果
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 评分卡 -->
|
||||
<div v-if="result.score !== undefined" class="card" style="margin-bottom: 16px; background: linear-gradient(135deg, var(--bg-card), var(--bg-card-2));">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center;">
|
||||
<div>
|
||||
<div style="font-size: 12px; color: var(--text-muted);">综合评分</div>
|
||||
<div style="font-size: 36px; font-weight: 700; color: var(--primary-light);">{{ result.score.toFixed(1) }}</div>
|
||||
</div>
|
||||
<div style="text-align: right;">
|
||||
<div style="font-size: 12px; color: var(--text-muted);">判定</div>
|
||||
<div :class="['tag', 'tag-' + scoreTag(result.score)]" style="font-size: 14px; padding: 4px 10px;">
|
||||
{{ scoreLabel(result.score) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 各个引擎的结果渲染 -->
|
||||
<component :is="resultRenderer" :output="result.output" />
|
||||
</div>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, onMounted, h, markRaw } from 'vue'
|
||||
import api from '../api'
|
||||
import * as ElIcons from '@element-plus/icons-vue'
|
||||
import { renderResult } from './toolkit/resultRenderers.jsx'
|
||||
|
||||
const tools = ref([])
|
||||
const activeDomain = ref('all')
|
||||
const drawerOpen = ref(false)
|
||||
const currentTool = ref(null)
|
||||
const form = ref({})
|
||||
const running = ref(false)
|
||||
const result = ref(null)
|
||||
|
||||
const domains = computed(() => {
|
||||
const dm = { 'all': { label: '全部工具', icon: 'Menu', count: tools.value.length } }
|
||||
const grouped = {}
|
||||
for (const t of tools.value) {
|
||||
const d = t.domain || 'platform'
|
||||
grouped[d] = (grouped[d] || 0) + 1
|
||||
}
|
||||
for (const [k, v] of Object.entries(grouped)) {
|
||||
dm[k] = { label: domainLabel(k), icon: domainIcon(k), count: v }
|
||||
}
|
||||
return dm
|
||||
})
|
||||
|
||||
const filteredTools = computed(() => {
|
||||
if (activeDomain.value === 'all') return tools.value
|
||||
return tools.value.filter(t => (t.domain || 'platform') === activeDomain.value)
|
||||
})
|
||||
|
||||
const fields = computed(() => {
|
||||
if (!currentTool.value?.template?.fields) return []
|
||||
return currentTool.value.template.fields
|
||||
})
|
||||
|
||||
const resultRenderer = computed(() => {
|
||||
if (!result.value) return null
|
||||
return markRaw({ render() { return renderResult(result.value.output, currentTool.value?.template?.engine) } })
|
||||
})
|
||||
|
||||
function domainLabel(d) {
|
||||
return { 'cross-border': '跨境数据', 'legal': '法律合规', 'design': '设计生成', 'general': '通用战略', 'platform': '平台工具' }[d] || d
|
||||
}
|
||||
function domainColor(d) {
|
||||
return { 'cross-border': 'tag-purple', 'legal': 'tag-red', 'design': 'tag-cyan', 'general': 'tag-blue', 'platform': 'tag-orange' }[d] || 'tag-gray'
|
||||
}
|
||||
function domainIcon(d) {
|
||||
return { 'cross-border': 'Promotion', 'legal': 'Lock', 'design': 'Brush', 'general': 'Compass', 'platform': 'Cpu' }[d] || 'Tools'
|
||||
}
|
||||
function scoreTag(s) {
|
||||
if (s >= 85) return 'green'
|
||||
if (s >= 70) return 'cyan'
|
||||
if (s >= 50) return 'orange'
|
||||
return 'red'
|
||||
}
|
||||
function scoreLabel(s) {
|
||||
if (s >= 85) return '优秀'
|
||||
if (s >= 70) return '良好'
|
||||
if (s >= 50) return '需改进'
|
||||
return '高风险'
|
||||
}
|
||||
|
||||
function openTool(tool) {
|
||||
currentTool.value = tool
|
||||
form.value = {}
|
||||
result.value = null
|
||||
// 预填默认值
|
||||
for (const f of (tool.template?.fields || [])) {
|
||||
if (f.type === 'multiselect') form.value[f.key] = []
|
||||
else if (f.type === 'number') form.value[f.key] = null
|
||||
else form.value[f.key] = ''
|
||||
}
|
||||
drawerOpen.value = true
|
||||
}
|
||||
|
||||
async function runTool() {
|
||||
running.value = true
|
||||
try {
|
||||
const data = await api.runTool(currentTool.value.id, form.value)
|
||||
result.value = data
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
} finally {
|
||||
running.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function copyResult() {
|
||||
const text = JSON.stringify(result.value.output, null, 2)
|
||||
try {
|
||||
await navigator.clipboard.writeText(text)
|
||||
alert('结果已复制到剪贴板')
|
||||
} catch (e) {
|
||||
alert('复制失败:' + e.message)
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
tools.value = await api.listTools()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.resource-card { cursor: pointer; transition: all 0.2s; }
|
||||
.resource-card:hover { transform: translateY(-2px); border-color: var(--primary-light); }
|
||||
</style>
|
||||
@@ -0,0 +1,37 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="hero-banner" style="background: linear-gradient(135deg, #059669 0%, #0891b2 100%);">
|
||||
<div class="hero-text">
|
||||
<h1>AI 工具与技术底座</h1>
|
||||
<p>低代码 / 模型微调 / 数据沙盒 / 合规审查 — 全开即用</p>
|
||||
</div>
|
||||
<div class="hero-actions">
|
||||
<span class="top-tag" style="background: rgba(255,255,255,0.2); color: #fff;">可用工具 {{ tools.length }} 项</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row-3">
|
||||
<div v-for="t in tools" :key="t.id" class="resource-card">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center;">
|
||||
<span class="tag tag-purple">{{ t.category }}</span>
|
||||
<span class="tag" :class="t.status === 'available' ? 'tag-green' : t.status === 'beta' ? 'tag-orange' : 'tag-gray'">{{ t.status === 'available' ? '可用' : t.status === 'beta' ? '内测' : '即将上线' }}</span>
|
||||
</div>
|
||||
<h4 style="margin-top: 8px;">{{ t.name }}</h4>
|
||||
<div class="meta">v{{ t.version }}</div>
|
||||
<div class="desc">{{ t.description }}</div>
|
||||
<div style="margin-top: 10px; display: flex; justify-content: space-between; align-items: center; font-size: 12px;">
|
||||
<span class="tag tag-cyan">🎁 {{ t.free_quota }}</span>
|
||||
<a v-if="t.homepage" :href="t.homepage" target="_blank" style="color: var(--primary-light)">访问 →</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import api from '../api'
|
||||
|
||||
const tools = ref([])
|
||||
onMounted(async () => { tools.value = await api.listTools() })
|
||||
</script>
|
||||
@@ -0,0 +1,218 @@
|
||||
// 工具结果渲染器 - 每个 engine 用对应的渲染器
|
||||
import { h } from 'vue'
|
||||
|
||||
const Section = (title, content) => h('div', { class: 'card', style: 'margin-bottom: 14px; padding: 14px;' }, [
|
||||
h('div', { style: 'font-size: 13px; font-weight: 600; margin-bottom: 10px; color: var(--primary-light);' }, title),
|
||||
content
|
||||
])
|
||||
|
||||
const List = (items) => h('div', items.map(it => h('div', { style: 'padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: 13px;' }, it)))
|
||||
|
||||
const Tag = (text, type = 'blue') => h('span', { class: `tag tag-${type}`, style: 'margin-right: 6px;' }, text)
|
||||
|
||||
const TagList = (items, type = 'blue') => h('div', { style: 'display: flex; flex-wrap: wrap; gap: 6px;' },
|
||||
items.map(it => Tag(it, type))
|
||||
)
|
||||
|
||||
// ============== 跨境数据自检 ==============
|
||||
const renderCrossBorderCheck = (o) => h('div', [
|
||||
Section('出境路径', h('div', [
|
||||
h('div', { style: 'font-size: 22px; font-weight: 700; color: var(--primary-light);' }, o.path),
|
||||
h('div', { style: 'font-size: 12px; color: var(--text-muted); margin-top: 4px;' }, '风险值 ' + o.risk + '%')
|
||||
])),
|
||||
Section('判定依据', List(o.reasons || [])),
|
||||
Section('执行步骤', List([
|
||||
...((o.steps || []).map((s, i) => `${i + 1}. ${s}`))
|
||||
])),
|
||||
Section('适用法规', TagList(o.laws || [], 'purple'))
|
||||
])
|
||||
|
||||
// ============== 数据分类分级 ==============
|
||||
const renderDataClassify = (o) => h('div', [
|
||||
Section('敏感级别', h('div', [
|
||||
h('div', { style: 'font-size: 22px; font-weight: 700; color: var(--primary-light);' }, o.level),
|
||||
h('div', { style: 'margin-top: 8px;' }, TagList(o.tags || [], 'cyan'))
|
||||
])),
|
||||
Section('分类分级清单', List(o.checklist || [])),
|
||||
Section('适用标准', TagList(o.standards || [], 'purple')),
|
||||
Section('管理建议', h('div', { style: 'font-size: 13px; line-height: 1.6;' }, o.advice)),
|
||||
Section('保护措施', TagList(o.measure || [], 'blue'))
|
||||
])
|
||||
|
||||
// ============== 数据资产估值 ==============
|
||||
const renderDataValuation = (o) => h('div', [
|
||||
Section('估值区间', h('div', [
|
||||
h('div', { style: 'font-size: 22px; font-weight: 700; color: var(--primary-light);' }, o.valuation_avg),
|
||||
h('div', { style: 'font-size: 12px; color: var(--text-muted); margin-top: 4px;' }, `范围 ${o.valuation_low} - ${o.valuation_high}`)
|
||||
])),
|
||||
Section('三种估值方法', h('div', [
|
||||
h('div', { style: 'padding: 8px 0; border-bottom: 1px solid var(--border);' }, [h('span', { style: 'color: var(--text-muted); margin-right: 8px;' }, '成本法'), o.cost_method]),
|
||||
h('div', { style: 'padding: 8px 0; border-bottom: 1px solid var(--border);' }, [h('span', { style: 'color: var(--text-muted); margin-right: 8px;' }, '市场法'), o.market_method]),
|
||||
h('div', { style: 'padding: 8px 0;' }, [h('span', { style: 'color: var(--text-muted); margin-right: 8px;' }, '收益法'), o.income_method])
|
||||
])),
|
||||
Section('建议', List(o.advice || [])),
|
||||
Section('登记路径', TagList(o.registration || [], 'green'))
|
||||
])
|
||||
|
||||
// ============== AIGC 审查 ==============
|
||||
const renderAIGCCheck = (o) => h('div', [
|
||||
Section('总体评估', h('div', [
|
||||
h('div', { style: 'font-size: 22px; font-weight: 700; color: var(--primary-light);' }, o.overall),
|
||||
h('div', { style: 'margin-top: 8px;' }, TagList(o.compliance || [], 'purple'))
|
||||
])),
|
||||
Section('风险清单', h('div', (o.risks || []).map(r =>
|
||||
h('div', { style: 'padding: 10px 0; border-bottom: 1px solid var(--border);' }, [
|
||||
h('div', { style: 'display: flex; justify-content: space-between; align-items: center;' }, [
|
||||
h('span', { style: 'font-weight: 500;' }, r.category),
|
||||
Tag(r.level === '高' ? '高风险' : r.level === '中' ? '中风险' : '低风险', r.level === '高' ? 'red' : 'orange')
|
||||
]),
|
||||
h('div', { style: 'font-size: 12px; color: var(--text-muted); margin-top: 4px;' }, r.note)
|
||||
])
|
||||
))),
|
||||
Section('合规清单', List(o.checklist || []))
|
||||
])
|
||||
|
||||
// ============== 隐私政策生成 ==============
|
||||
const renderPrivacyGenerator = (o) => h('div', [
|
||||
Section('生成的隐私政策', h('div', [
|
||||
h('pre', { style: 'white-space: pre-wrap; font-family: inherit; font-size: 12px; line-height: 1.7; padding: 12px; background: rgba(0,0,0,0.2); border-radius: 6px; max-height: 400px; overflow-y: auto;' }, o.document),
|
||||
])),
|
||||
Section('章节覆盖', TagList(o.sections || [], 'blue')),
|
||||
Section('后续步骤', List(o.next_steps || []))
|
||||
])
|
||||
|
||||
// ============== 授权链路 ==============
|
||||
const renderLicenseChain = (o) => h('div', [
|
||||
Section('授权链路文件', h('pre', { style: 'white-space: pre-wrap; font-family: inherit; font-size: 12px; line-height: 1.7; padding: 12px; background: rgba(0,0,0,0.2); border-radius: 6px; max-height: 400px; overflow-y: auto;' }, o.document)),
|
||||
Section('链上路径', h('div', [
|
||||
h('div', { style: 'font-size: 12px; color: var(--text-muted);' }, '链路长度 ' + o.chain_length + ' 步'),
|
||||
h('div', { style: 'font-size: 11px; word-break: break-all; padding: 6px; background: rgba(0,0,0,0.2); border-radius: 4px; margin-top: 4px;' }, 'Hash: ' + o.hash)
|
||||
])),
|
||||
Section('建议', List(o.advice || []))
|
||||
])
|
||||
|
||||
// ============== 商业模式画布 ==============
|
||||
const renderBMC = (o) => h('div', [
|
||||
Section('项目', h('div', { style: 'font-size: 18px; font-weight: 600;' }, o.project)),
|
||||
Section('画布 (' + o.filled + '/' + o.total + ' 完成)', h('div', { style: 'display: grid; grid-template-columns: 1fr 1fr; gap: 8px;' },
|
||||
(o.canvas || []).map(c => h('div', { style: 'background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: 6px; padding: 10px;' }, [
|
||||
h('div', { style: 'font-size: 12px; color: var(--primary-light); margin-bottom: 4px;' }, c.name),
|
||||
h('div', { style: 'font-size: 12px; color: var(--text);' }, c.value || '— 未填写 —')
|
||||
]))
|
||||
)),
|
||||
Section('建议', List(o.advice || []))
|
||||
])
|
||||
|
||||
// ============== BP 生成 ==============
|
||||
const renderBPGenerator = (o) => h('div', [
|
||||
Section('商业计划书大纲', h('pre', { style: 'white-space: pre-wrap; font-family: inherit; font-size: 12px; line-height: 1.7; padding: 12px; background: rgba(0,0,0,0.2); border-radius: 6px; max-height: 400px; overflow-y: auto;' }, o.document)),
|
||||
Section('后续步骤', List(o.next_steps || []))
|
||||
])
|
||||
|
||||
// ============== OPC 自检 ==============
|
||||
const renderOPCCheck = (o) => h('div', [
|
||||
Section('OPC 成熟度', h('div', [
|
||||
h('div', { style: 'font-size: 22px; font-weight: 700; color: var(--primary-light);' }, o.level),
|
||||
h('div', { style: 'margin-top: 10px; height: 8px; background: rgba(255,255,255,0.08); border-radius: 4px; overflow: hidden;' }, [
|
||||
h('div', { style: `width: ${o.score}%; height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent));` })
|
||||
])
|
||||
])),
|
||||
Section('明细', h('div', (o.details || []).map(d =>
|
||||
h('div', { style: 'display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); align-items: center;' }, [
|
||||
h('span', { style: 'font-size: 13px;' }, [
|
||||
h('span', { style: 'color: ' + (d.passed ? 'var(--success)' : 'var(--danger)') + '; margin-right: 6px; font-weight: 600;' }, d.passed ? '✓' : '✗'),
|
||||
d.question
|
||||
]),
|
||||
h('span', { style: 'color: var(--text-muted); font-size: 12px;' }, `权重 ${d.weight}`)
|
||||
])
|
||||
))),
|
||||
Section('改进建议', List(o.advice || []))
|
||||
])
|
||||
|
||||
// ============== QA 顾问 ==============
|
||||
const renderQA = (o) => h('div', [
|
||||
Section('AI 顾问回答', h('div', { style: 'font-size: 13px; line-height: 1.8; white-space: pre-wrap; padding: 12px; background: rgba(82,134,255,0.08); border-radius: 6px; border-left: 3px solid var(--primary-light);' }, o.answer)),
|
||||
Section('参考依据', TagList(o.refs || [], 'purple')),
|
||||
Section('提示', h('div', { style: 'font-size: 12px; color: var(--text-muted);' }, o.tip))
|
||||
])
|
||||
|
||||
// ============== 品牌生成 ==============
|
||||
const renderBrandGenerator = (o) => h('div', [
|
||||
Section('产品名', h('div', { style: 'font-size: 22px; font-weight: 700; color: var(--primary-light);' }, o.product)),
|
||||
Section('Slogan 候选', h('div', (o.slogans || []).map(s =>
|
||||
h('div', { style: 'padding: 10px 12px; background: rgba(82,134,255,0.08); border-radius: 6px; margin-bottom: 6px; font-size: 14px; font-weight: 500; color: var(--text);' }, `「${s}」`)
|
||||
))),
|
||||
Section('配色方案', h('div', { style: 'display: flex; gap: 8px; align-items: center;' },
|
||||
['primary', 'secondary', 'accent'].map(k =>
|
||||
h('div', { style: 'text-align: center;' }, [
|
||||
h('div', { style: `width: 60px; height: 60px; border-radius: 8px; background: ${o.colors[k]}; border: 1px solid var(--border);` }),
|
||||
h('div', { style: 'font-size: 11px; color: var(--text-muted); margin-top: 4px; font-family: monospace;' }, o.colors[k])
|
||||
])
|
||||
)
|
||||
)),
|
||||
Section('字体推荐', h('div', { style: 'font-size: 14px; font-weight: 500;' }, o.fonts)),
|
||||
Section('品牌调性', h('div', { style: 'font-size: 13px; line-height: 1.6;' }, o.tone_desc)),
|
||||
Section('Logo 设计思路', List(o.logo_concept || [])),
|
||||
Section('应用场景', List(o.applications || []))
|
||||
])
|
||||
|
||||
// ============== 数据可视化模板 ==============
|
||||
const renderChartTemplate = (o) => h('div', [
|
||||
Section('场景', h('div', { style: 'font-size: 16px; font-weight: 600;' }, o.scenario)),
|
||||
Section('推荐图表', h('div', (o.recommendations || []).map(r =>
|
||||
h('div', { style: 'padding: 10px 0; border-bottom: 1px solid var(--border);' }, [
|
||||
h('div', { style: 'display: flex; justify-content: space-between; align-items: center;' }, [
|
||||
h('span', { style: 'font-weight: 500; color: var(--primary-light);' }, r.type),
|
||||
Tag('复杂度 ' + r.complexity, 'cyan')
|
||||
]),
|
||||
h('div', { style: 'font-size: 12px; color: var(--text-muted); margin-top: 4px;' }, r.purpose)
|
||||
])
|
||||
))),
|
||||
Section('配色方案', h('div', { style: 'display: flex; gap: 8px;' },
|
||||
(o.color_scheme || []).map(c =>
|
||||
h('div', { style: `width: 40px; height: 40px; border-radius: 6px; background: ${c};` })
|
||||
)
|
||||
)),
|
||||
Section('技术栈', h('div', { style: 'font-size: 13px;' }, o.tech)),
|
||||
Section('导出格式', TagList(o.export || [], 'blue'))
|
||||
])
|
||||
|
||||
// ============== 封面生成 ==============
|
||||
const renderCoverGenerator = (o) => h('div', [
|
||||
// 封面试图
|
||||
h('div', { style: `width: 100%; aspect-ratio: 16/9; background: linear-gradient(135deg, ${o.colors.bg}, ${o.colors.primary}); border-radius: 8px; padding: 50px 40px; display: flex; flex-direction: column; justify-content: center; align-items: center; color: #fff; margin-bottom: 14px;` }, [
|
||||
h('div', { style: 'font-size: 14px; opacity: 0.7; color: ' + o.colors.accent + '; letter-spacing: 4px; margin-bottom: 12px;' }, '尚数网 OPC 平台'),
|
||||
h('div', { style: 'font-size: 42px; font-weight: 700; text-align: center; margin-bottom: 8px;' }, o.title),
|
||||
h('div', { style: 'font-size: 16px; opacity: 0.85; text-align: center;' }, o.subtitle),
|
||||
h('div', { style: 'margin-top: 24px; height: 3px; width: 80px; background: ' + o.colors.secondary + ';' })
|
||||
]),
|
||||
Section('规格', h('div', [
|
||||
h('div', { style: 'padding: 6px 0;' }, [h('span', { style: 'color: var(--text-muted); margin-right: 8px;' }, '尺寸'), o.dimension]),
|
||||
h('div', { style: 'padding: 6px 0;' }, [h('span', { style: 'color: var(--text-muted); margin-right: 8px;' }, '配色'), o.colors.primary + ' / ' + o.colors.secondary + ' / ' + o.colors.bg])
|
||||
])),
|
||||
Section('版式建议', List(o.layout || [])),
|
||||
Section('可选模板', TagList(o.templates || [], 'cyan'))
|
||||
])
|
||||
|
||||
// ============== 路由 ==============
|
||||
const renderers = {
|
||||
cross_border_check: renderCrossBorderCheck,
|
||||
data_classify: renderDataClassify,
|
||||
data_valuation: renderDataValuation,
|
||||
aigc_check: renderAIGCCheck,
|
||||
privacy_generator: renderPrivacyGenerator,
|
||||
license_chain: renderLicenseChain,
|
||||
bmc: renderBMC,
|
||||
bp_generator: renderBPGenerator,
|
||||
opc_check: renderOPCCheck,
|
||||
qa_advisor: renderQA,
|
||||
brand_generator: renderBrandGenerator,
|
||||
chart_template: renderChartTemplate,
|
||||
cover_generator: renderCoverGenerator
|
||||
}
|
||||
|
||||
export function renderResult(output, engine) {
|
||||
const renderer = renderers[engine]
|
||||
if (renderer) return renderer(output)
|
||||
return h('pre', { style: 'white-space: pre-wrap; font-size: 12px;' }, JSON.stringify(output, null, 2))
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [vue()],
|
||||
server: {
|
||||
host: '127.0.0.1',
|
||||
port: 15173,
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://127.0.0.1:18080',
|
||||
changeOrigin: true
|
||||
}
|
||||
}
|
||||
},
|
||||
build: {
|
||||
outDir: 'dist',
|
||||
sourcemap: false
|
||||
}
|
||||
})
|
||||
Reference in new issue
Block a user