- backend: 25 张表 schema/seed,config 指向 127.0.0.1:15432 opc 库 - docs: 尚数网七维融合方案、行业老炮切入方案、竞品分析等 - db/0824/opc_0824.sql(.gz): pg_dump 全量备份(25 表,含数据)
145 lines
6.9 KiB
Vue
145 lines
6.9 KiB
Vue
<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>
|