Files
guoju0808/ry-vue3/src/views/portal/Home.vue
T
郭庆泰 ea2024d083 feat: 会议ID应用赋值 + 会议表单/详情优化 + admin工作台统计与用户管理
- meetingId 由 DB 自增改为应用赋值 10 位数字 (yyMMdd + 4 位序列, Redis 按日期计数)
- 会议开始时间不能晚于结束时间校验; 参会人表单身份证附件/角色单独一行
- 会议详情左右列比例 7:3 -> 8:2 (材料审核列收窄)
- admin/workbench 用户总数/角色类型数/各角色分布统计修复 (改用 listByRole 按 role_type 过滤)
- 新增 admin 用户管理接口 + 门户页脚 + H5 签到/上传优化
2026-08-25 23:33:14 +08:00

608 lines
18 KiB
Vue

<template>
<div class="home-page">
<header class="top-nav" :class="topNavClass">
<a class="logo" title="返回首页" @click.prevent="onHome">
<div class="logo-icon"><img src="/logo.png" alt="logo" /></div>
<div class="logo-text">
<span class="logo-title">北京整合医学学会</span>
<span class="logo-subtitle">Beijing Association of Holistic Integrative Medicine</span>
</div>
</a>
<ul class="nav-list">
<li class="nav-item"><span class="nav-link active">年度项目规划</span></li>
<li class="nav-item"><a class="nav-link" @click.prevent="goPublicity">项目公示</a></li>
</ul>
<div class="top-tools">
<template v-if="!loggedIn">
<span class="login-btn" @click="goLogin">登录</span>
</template>
<template v-else>
<el-dropdown trigger="click" @command="onUserCmd">
<a class="user-link" @click.prevent>
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/>
<circle cx="12" cy="7" r="4"/>
</svg>
<span>{{ userName }}</span>
</a>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item command="account">我的主页</el-dropdown-item>
<el-dropdown-item command="logout" divided>退出登录</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</template>
</div>
</header>
<div class="container">
<section class="hero">
<div>
<span class="hero-tag">2025-2030</span>
<h1 class="hero-title">年度项目规划</h1>
<p class="hero-subtitle"> </p>
<p class="hero-desc">
围绕健康中国战略,聚焦医学整合创新,系统推进七大专项计划,<br>
全面构建覆盖诊疗科研人才管理公益政学协作与组织建设的协同发展体系
</p>
</div>
<div class="hero-cta">
<span v-if="canPropose" class="cta-btn" @click="onSubmit">项目提案</span>
</div>
</section>
<section class="overview-section">
<div class="section-title">年度项目规划概述</div>
<p class="overview-text">
依托国家战略层面"健康中国2030"规划纲要和健康中国行动的统领力量,切合全民健康素养提升三年行动方案(2024-2027)的契机,践行学会的公益性服务的责任和使命,全方位全领域体系性系统性持续性地开展健康科普活动,通过征集全国范围300个病种的健康科普短视频科普讲座科普文章,进行整个医疗系统的健康科普总动员,以科普内容征集促进科普活动走近走深走实
</p>
<div class="plan-image" v-html="planSvg"></div>
</section>
</div>
<section class="specialty-section">
<div class="specialty-inner">
<div class="section-title">七大专项计划</div>
<div class="specialty-list">
<div v-for="(p, i) in specialPlans" :key="p.id" class="specialty-card" @click="openPlan(p.id)">
<div class="specialty-no">{{ String(i + 1).padStart(2, '0') }}</div>
<div class="specialty-body">
<h3 class="specialty-title">{{ p.title }}</h3>
<div class="specialty-action">
<span class="specialty-link">查看详情</span>
</div>
</div>
</div>
<div v-if="!specialPlans.length" class="specialty-empty">暂无专项计划</div>
</div>
</div>
</section>
<PortalFooter />
</div>
</template>
<script setup>
import { ref, computed, onMounted, onBeforeUnmount } from 'vue'
import { useRouter } from 'vue-router'
import { ElMessage } from 'element-plus'
import { useUserStore } from '@/store/user'
import { logout as logoutApi } from '@/api/auth'
import request from '@/utils/request'
import PortalFooter from '@/components/PortalFooter.vue'
const router = useRouter()
const userStore = useUserStore()
const isScrolled = ref(false)
const specialPlans = ref([])
async function loadSpecialPlans() {
try {
const r = await request({ url: '/business/public/specialPlan/list', method: 'get' })
specialPlans.value = (r.data && r.data.data) || r.data || []
} catch (e) {
specialPlans.value = []
}
}
function openPlan(id) {
window.open(`${import.meta.env.BASE_URL}#/special-plan/${id}`, '_blank')
}
const topNavClass = computed(() => isScrolled.value ? 'is-scrolled' : '')
const loggedIn = computed(() => !!userStore.token)
const userName = computed(() => userStore.user?.userName || '用户')
// 投稿角色: admin/manager 不开放投稿 → 隐藏「项目提案」按钮; 未登录 user 为 null → 显示(点击引导登录)
const canPropose = computed(() => {
const r = userStore.user?.role || ''
return r !== 'admin' && r !== 'manager'
})
const planSvg = `<svg viewBox="0 150 1200 370" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="2025-2030年项目规划">
<defs>
<linearGradient id="arcGrad" x1="0%" y1="0%" x2="100%" y2="0%">
<stop offset="0%" stop-color="#c7d2fe" stop-opacity="0.3"/>
<stop offset="50%" stop-color="#a5b4fc" stop-opacity="0.7"/>
<stop offset="100%" stop-color="#c7d2fe" stop-opacity="0.3"/>
</linearGradient>
<linearGradient id="hexGrad" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" stop-color="var(--brand-primary-deep)"/>
<stop offset="100%" stop-color="var(--brand-primary)"/>
</linearGradient>
<radialGradient id="centerGrad" cx="50%" cy="50%" r="50%">
<stop offset="0%" stop-color="var(--brand-primary)"/>
<stop offset="100%" stop-color="var(--brand-primary-deep)"/>
</radialGradient>
<radialGradient id="bgGlow" cx="600" cy="470" r="700" gradientUnits="userSpaceOnUse">
<stop offset="0%" stop-color="#e0e7ff" stop-opacity="0.85"/>
<stop offset="55%" stop-color="#eef2ff" stop-opacity="0.4"/>
<stop offset="100%" stop-color="#eef2ff" stop-opacity="0"/>
</radialGradient>
<filter id="hexShadow" x="-50%" y="-50%" width="200%" height="200%">
<feDropShadow dx="0" dy="2" stdDeviation="3" flood-opacity="0.18"/>
</filter>
</defs>
<circle cx="600" cy="470" r="700" fill="url(#bgGlow)"/>
<path d="M 213 470 A 440.6 440.6 0 0 1 987 470" stroke="#c7d2fe" stroke-width="22" fill="none" opacity="0.35"/>
<path d="M 213 470 A 440.6 440.6 0 0 1 987 470" stroke="url(#arcGrad)" stroke-width="3" fill="none"/>
<path d="M 253 470 A 400 400 0 0 1 947 470" stroke="#c7d2fe" stroke-width="1" fill="none" stroke-dasharray="3,4"/>
<g>
<circle cx="213" cy="470" r="6" fill="#fff" stroke="var(--brand-primary)" stroke-width="2"/>
<circle cx="987" cy="470" r="6" fill="#fff" stroke="var(--brand-primary)" stroke-width="2"/>
</g>
<g filter="url(#hexShadow)" font-family="Arial, sans-serif" font-weight="bold" fill="#fff" text-anchor="middle">
<g transform="translate(213 470)"><polygon points="-34,0 -17,-29 17,-29 34,0 17,29 -17,29" fill="url(#hexGrad)"/><text y="7" font-size="22">01</text></g>
<g transform="translate(294 363)"><polygon points="-30,0 -15,-26 15,-26 30,0 15,26 -15,26" fill="url(#hexGrad)"/><text y="6" font-size="19">02</text></g>
<g transform="translate(403 286)"><polygon points="-28,0 -14,-24 14,-24 28,0 14,24 -14,24" fill="var(--brand-primary)"/><text y="6" font-size="18">03</text></g>
<g transform="translate(532 245)"><polygon points="-28,0 -14,-24 14,-24 28,0 14,24 -14,24" fill="var(--brand-primary)"/><text y="6" font-size="18">04</text></g>
<g transform="translate(666 245)"><polygon points="-28,0 -14,-24 14,-24 28,0 14,24 -14,24" fill="var(--brand-primary)"/><text y="6" font-size="18">05</text></g>
<g transform="translate(794 285)"><polygon points="-28,0 -14,-24 14,-24 28,0 14,24 -14,24" fill="var(--brand-primary)"/><text y="6" font-size="18">06</text></g>
<g transform="translate(904 362)"><polygon points="-30,0 -15,-26 15,-26 30,0 15,26 -15,26" fill="url(#hexGrad)"/><text y="6" font-size="19">07</text></g>
<g transform="translate(986 468)"><polygon points="-34,0 -17,-29 17,-29 34,0 17,29 -17,29" fill="url(#hexGrad)"/><text y="7" font-size="22">08</text></g>
</g>
<text x="600" y="430" fill="var(--brand-primary)" text-anchor="middle" font-family="Microsoft YaHei, sans-serif" font-size="32" font-weight="bold" letter-spacing="6">2025-2030年</text>
<line x1="540" y1="447" x2="600" y2="447" stroke="var(--brand-primary)" stroke-width="1.5" opacity="0.4"/>
<line x1="600" y1="447" x2="660" y2="447" stroke="var(--brand-primary)" stroke-width="1.5" opacity="0.4"/>
<g fill="#374151" font-family="Microsoft YaHei, sans-serif" font-size="14" font-weight="500" letter-spacing="0.5">
<text x="170" y="411" text-anchor="end"><tspan x="170" dy="0">触达100万+家</tspan><tspan x="170" dy="20">医疗卫生服务机构</tspan></text>
<text x="252" y="307" text-anchor="end"><tspan x="252" dy="0">300万+专业医护</tspan><tspan x="252" dy="20">人员广泛参与</tspan></text>
<text x="362" y="232" text-anchor="end"><tspan x="362" dy="0">培训100万+名</tspan><tspan x="362" dy="20">健康科普创作志愿者</tspan></text>
<text x="532" y="195" text-anchor="middle"><tspan x="532" dy="0">赋能10万+名</tspan><tspan x="532" dy="20">健康科普传播志愿者</tspan></text>
<text x="666" y="195" text-anchor="middle"><tspan x="666" dy="0">知识普及10亿+</tspan><tspan x="666" dy="20">人次人民群众</tspan></text>
<text x="835" y="231" text-anchor="start"><tspan x="835" dy="0">覆盖4万+个</tspan><tspan x="835" dy="20">乡镇、街道</tspan></text>
<text x="946" y="306" text-anchor="start"><tspan x="946" dy="0">1000万个流量平台</tspan><tspan x="946" dy="20">(用户数10万+)</tspan></text>
<text x="1029" y="409" text-anchor="start"><tspan x="1029" dy="0">建设1万个</tspan><tspan x="1029" dy="20">健康小屋</tspan></text>
</g>
</svg>`
function handleScroll() {
isScrolled.value = window.scrollY > 10
}
onMounted(() => {
window.addEventListener('scroll', handleScroll, { passive: true })
loadSpecialPlans()
})
onBeforeUnmount(() => window.removeEventListener('scroll', handleScroll))
function onHome() { isScrolled.value = false }
function goLogin() { router.push('/login') }
function goUser() { /* placeholder */ }
async function goLogout() { try { await logoutApi() } catch {}; userStore.logout(); router.replace('/login') }
async function onUserCmd(cmd) {
if (cmd === 'logout') return goLogout()
if (cmd === 'account') {
const r = (userStore.user?.role || '')
const map = { admin: '/admin/workbench', manager: '/manager/workbench', doctor: '/doctor/home', executor: '/executor/meetings', sponsor: '/sponsor/home' }
router.push(map[r] || '/admin/workbench')
}
}
function goPublicity() { router.push('/publicity') }
function onSubmit() {
if (!loggedIn.value) {
ElMessage.warning('请先登录系统')
router.push('/login')
return
}
const role = userStore.user?.role
const map = { doctor: '/doctor/submissions', executor: '/executor/submissions', sponsor: '/sponsor/submissions' }
router.push(map[role] || '/doctor/submissions')
}
</script>
<style scoped>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
color: #1f2937;
background: #ffffff;
min-width: 1354px;
line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
/* ========== 顶部导航 ========== */
.top-nav {
position: sticky;
top: 0;
z-index: 1000;
height: 72px;
padding: 0 60px;
background: var(--brand-primary);
border-bottom: 1px solid rgba(255, 255, 255, 0.08);
display: flex;
align-items: center;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
transition: box-shadow 0.3s;
}
.top-nav.is-scrolled {
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}
.logo {
display: flex;
align-items: center;
gap: 12px;
}
.logo-icon {
width: 36px;
height: 36px;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
flex-shrink: 0;
}
.logo-icon img { width: 100%; height: 100%; object-fit: contain; display: block; }
.logo-text {
display: flex;
flex-direction: column;
line-height: 1.2;
}
.logo-title {
font-size: 16px;
font-weight: 600;
color: #fff;
letter-spacing: 0.5px;
}
.logo-subtitle {
font-size: 11px;
color: rgba(255, 255, 255, 0.6);
margin-top: 2px;
letter-spacing: 0.3px;
}
.nav-list {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
gap: 36px;
list-style: none;
}
.nav-item {
position: relative;
height: 72px;
display: flex;
align-items: center;
}
.nav-link {
font-size: 15px;
font-weight: 500;
color: rgba(255, 255, 255, 0.85);
cursor: pointer;
transition: color 0.25s;
position: relative;
height: 72px;
display: flex;
align-items: center;
}
.nav-link::after {
content: '';
position: absolute;
left: 50%;
bottom: 0;
width: 0;
height: 2px;
background: #fff;
transform: translateX(-50%);
transition: width 0.3s ease;
}
.nav-item:hover .nav-link,
.nav-link.active {
color: #fff;
}
.nav-item:hover .nav-link::after,
.nav-link.active::after {
width: 100%;
}
/* 顶部工具栏 */
.top-tools {
display: flex;
align-items: center;
gap: 16px;
}
.login-btn {
padding: 7px 20px;
background: #fff;
color: var(--brand-primary);
font-size: 13px;
font-weight: 500;
cursor: pointer;
transition: background 0.2s;
letter-spacing: 1px;
}
.login-btn:hover {
background: #f3f4f6;
}
.user-link {
display: flex;
align-items: center;
gap: 6px;
padding: 6px 10px;
color: rgba(255, 255, 255, 0.85);
font-size: 13px;
cursor: pointer;
transition: background 0.2s, color 0.2s;
}
.user-link:hover {
background: rgba(255, 255, 255, 0.1);
color: #fff;
}
/* ========== 主体容器 ========== */
.container {
max-width: 1354px;
margin: 0 auto;
padding: 0 60px;
}
/* ========== 区块标题 ========== */
.section-title {
font-size: 20px;
font-weight: 600;
color: #1f2937;
margin-bottom: 22px;
position: relative;
padding-left: 12px;
letter-spacing: 0.5px;
}
.section-title::before {
content: '';
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 3px;
height: 18px;
background: var(--brand-primary);
}
/* ========== Hero ========== */
.hero {
margin-top: 30px;
background: var(--brand-primary);
color: #fff;
height: 280px;
padding: 0 60px;
display: flex;
align-items: center;
position: relative;
overflow: hidden;
}
.hero-tag {
display: inline-block;
padding: 4px 12px;
border: 1px solid rgba(255, 255, 255, 0.4);
font-size: 12px;
letter-spacing: 2px;
margin-bottom: 16px;
}
.hero-title {
font-size: 38px;
font-weight: 600;
margin-bottom: 12px;
letter-spacing: 2px;
}
.hero-subtitle {
font-size: 16px;
font-weight: 400;
color: rgba(255, 255, 255, 0.85);
letter-spacing: 4px;
margin-bottom: 24px;
}
.hero-desc {
font-size: 14px;
line-height: 1.9;
color: rgba(255, 255, 255, 0.85);
max-width: 100%;
padding-bottom: 50px;
}
.hero-cta {
position: absolute;
right: 60px;
top: 50%;
transform: translateY(-50%);
display: flex;
flex-direction: column;
gap: 12px;
}
.hero-cta .cta-btn {
display: inline-block;
padding: 12px 40px;
background: #fff;
color: var(--brand-primary);
font-size: 14px;
font-weight: 500;
letter-spacing: 2px;
cursor: pointer;
transition: background 0.2s;
}
.hero-cta .cta-btn:hover {
background: #f3f4f6;
}
/* ========== 总述 ========== */
.overview-section {
padding: 50px 0 30px;
}
.overview-text {
font-size: 14px;
color: #4b5563;
line-height: 1.9;
background: #fff;
padding: 24px 28px;
border: 1px solid #e5e7eb;
margin-bottom: 30px;
}
.plan-image {
background: #fff;
border: 1px solid #e5e7eb;
padding: 24px;
}
.plan-image svg {
width: 100%;
height: auto;
display: block;
}
/* ========== 七大专项 ========== */
.specialty-section {
background: #f5f6f8;
width: 100vw;
margin-left: calc(-50vw + 50%);
padding: 50px 0 40px;
position: relative;
}
.specialty-inner {
max-width: 1354px;
margin: 0 auto;
padding: 0 60px;
}
.specialty-list {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 20px;
}
.specialty-card {
background: #fff;
border: 1px solid #e5e7eb;
display: flex;
cursor: pointer;
transition: border-color 0.2s, transform 0.2s;
}
.specialty-empty {
grid-column: 1 / -1;
text-align: center;
color: #9ca3af;
padding: 60px 0;
font-size: 14px;
}
.specialty-card:hover {
border-color: var(--brand-primary);
transform: translateY(-2px);
}
.specialty-no {
flex-shrink: 0;
width: 80px;
background: var(--brand-primary);
color: #fff;
display: flex;
align-items: center;
justify-content: center;
font-size: 32px;
font-weight: 300;
font-family: ui-monospace, "Courier New", monospace;
letter-spacing: 2px;
}
.specialty-body {
flex: 1;
padding: 20px 24px;
display: flex;
flex-direction: column;
}
.specialty-title {
font-size: 16px;
font-weight: 600;
color: #1f2937;
margin-bottom: 10px;
line-height: 1.5;
}
.specialty-desc {
font-size: 13px;
color: #6b7280;
line-height: 1.7;
flex: 1;
margin-bottom: 14px;
}
.specialty-action {
display: flex;
gap: 12px;
padding-top: 14px;
border-top: 1px solid #f3f4f6;
}
.specialty-link {
font-size: 13px;
color: var(--brand-primary);
cursor: pointer;
transition: color 0.2s;
}
.specialty-link:hover {
text-decoration: underline;
}
.specialty-link.disabled {
color: #9ca3af;
cursor: not-allowed;
text-decoration: none;
}
</style>