提交 db364b7c authored 作者: yujiejie's avatar yujiejie

备份

上级 938b60e6
$root = 'd:\codebuddyfile\1008cs3.0\1008studyweb_Prototype_v2.0'
$stamp = Get-Date -Format 'yyyyMMdd_HHmmss'
$dest = Join-Path $root ('_backup\step2_question-bank_' + $stamp)
$dest = Join-Path $root ('_backup\step3_projects_' + $stamp)
New-Item -ItemType Directory -Path $dest -Force | Out-Null
Copy-Item (Join-Path $root 'index.html') $dest -Force
Copy-Item (Join-Path $root 'pages\admin\question-bank.js') $dest -Force
Copy-Item (Join-Path $root 'pages\admin\knowledge-tags.js') $dest -Force
Copy-Item (Join-Path $root 'pages\admin\projects.js') $dest -Force
Write-Output ("BACKUP -> " + $dest)
Get-ChildItem $dest | Select-Object Name, Length | Format-Table -AutoSize | Out-String -Width 120
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>实习生培训平台 - 产品原型</title>
<link href="vendor/plus-jakarta-sans.css" rel="stylesheet">
<script src="vendor/tailwind.js"></script>
<script src="vendor/lucide.js"></script>
<script src="vendor/echarts.min.js"></script>
<style>
/* ==========================================
Arco Design Pro 风格全局视觉规范
========================================== */
* {
font-family: 'Inter', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
:root {
/* 1. 核心色彩 (Arco 科技蓝) */
--primary: #165DFF;
--primary-hover: #4080FF;
--primary-active: #0E42D2;
--primary-bg: #E8F3FF; /* 极浅蓝背景,用于选中态/标签 */
/* 2. 背景与边框 (严谨的 B 端灰度) */
--bg-page: #F2F3F5; /* 页面大背景 */
--bg-container: #FFFFFF; /* 卡片/容器纯白背景 */
--border: #E5E6EB; /* 极浅灰边框 */
/* 3. 文本层级 (Arco 严格规范) */
--text-1: #1D2129; /* 标题 / 重要文字 */
--text-2: #4E5969; /* 正文内容 */
--text-3: #86909C; /* 辅助说明 / 占位符 */
--text-4: #C9CDD4; /* 禁用状态 / 极弱文字 */
/* 4. 状态色 */
--success: #00B42A;
--warning: #FF7D00;
--danger: #F53F3F;
/* 5. 圆角 (Arco 偏严谨,不使用大圆角) */
--radius-sm: 2px;
--radius-md: 4px;
--radius-lg: 8px;
/* 6. Arco 标志性柔和阴影 (高级感来源) */
--shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.03), 0 1px 6px -1px rgba(0, 0, 0, 0.02);
--shadow-md: 0 4px 10px 0 rgba(0, 0, 0, 0.05), 0 2px 4px 0 rgba(0, 0, 0, 0.03);
--shadow-hover: 0 4px 10px 0 rgba(0, 0, 0, 0.08), 0 2px 4px 0 rgba(0, 0, 0, 0.05);
}
/* 全局基础设定 */
body {
background-color: var(--bg-page);
color: var(--text-2);
}
/* 侧边栏 (调整为 Arco 深色模式风格) */
.sidebar {
width: 240px;
min-height: 100vh;
background: linear-gradient(180deg, #1D2129 0%, #2E2F33 100%);
}
.sidebar .nav-item {
display: flex; align-items: center; gap: 12px; padding: 10px 16px; margin: 2px 12px;
border-radius: var(--radius-md); cursor: pointer; color: var(--text-3);
transition: all 0.2s; font-size: 14px;
}
.sidebar .nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar .nav-item.active {
background: var(--primary); color: #fff;
box-shadow: 0 4px 10px rgba(22, 93, 255, 0.3);
}
/* 顶部角色切换 Tab */
.role-tab {
padding: 6px 16px; border-radius: var(--radius-md); cursor: pointer;
transition: all 0.2s; font-weight: 500; font-size: 14px;
}
.role-tab.active {
background: var(--primary); color: white; box-shadow: 0 2px 6px rgba(22, 93, 255, 0.25);
}
.role-tab:not(.active) { color: var(--text-3); }
.role-tab:not(.active):hover { background: var(--primary-bg); color: var(--primary); }
/* 卡片组件 (统一 Arco 质感) */
.stat-card, .feature-card {
background: var(--bg-container);
border-radius: var(--radius-md);
border: 1px solid var(--border);
box-shadow: var(--shadow-sm);
transition: all 0.2s;
}
.stat-card:hover, .feature-card:hover {
box-shadow: var(--shadow-hover);
border-color: var(--primary-bg);
transform: translateY(-1px);
}
/* 标签与徽章 */
.badge {
display: inline-flex; align-items: center; padding: 2px 10px;
border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;
}
.tag {
display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px;
border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;
background: var(--primary-bg); color: var(--primary);
}
/* 按钮组件 */
.btn-primary {
background: var(--primary); color: white; padding: 8px 20px;
border-radius: var(--radius-md); font-weight: 500; font-size: 14px;
cursor: pointer; transition: all 0.2s; border: none;
}
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 2px 6px rgba(22, 93, 255, 0.3); }
.btn-primary:active { background: var(--primary-active); }
.btn-outline {
border: 1px solid var(--border); color: var(--text-2); padding: 8px 20px;
border-radius: var(--radius-md); font-weight: 500; font-size: 14px;
cursor: pointer; transition: all 0.2s; background: var(--bg-container);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }
.btn-ghost {
background: transparent; color: var(--text-3); padding: 8px 20px;
border-radius: var(--radius-md); font-weight: 500; font-size: 14px;
cursor: pointer; transition: all 0.2s; border: none;
}
.btn-ghost:hover { background: var(--primary-bg); color: var(--primary); }
/* 表单组件 */
.input-field {
border: 1px solid var(--border); border-radius: var(--radius-md);
padding: 8px 12px; font-size: 14px; width: 100%; outline: none;
transition: all 0.2s; background: var(--bg-container); color: var(--text-1);
}
.input-field:focus {
border-color: var(--primary);
box-shadow: 0 0 0 2px rgba(22, 93, 255, 0.1);
}
.input-field::placeholder { color: var(--text-4); }
/* 进度条 */
.progress-bar { height: 6px; border-radius: 999px; background: var(--border); overflow: hidden; }
.progress-bar .fill { height: 100%; border-radius: 999px; background: var(--primary); transition: width 0.5s ease-out; }
/* 表格基础样式 */
.table-base { width: 100%; border-collapse: collapse; }
.table-base th {
text-align: left; padding: 12px 16px; font-size: 12px; font-weight: 600;
color: var(--text-3); background: #F7F8FA; border-bottom: 1px solid var(--border);
}
.table-base td {
padding: 14px 16px; font-size: 14px; color: var(--text-2);
border-bottom: 1px solid var(--border);
}
.table-base tr:hover td { background: var(--primary-bg); }
/* 登录页特定样式优化 */
.input-wrapper input {
padding-left: 44px !important; padding-right: 40px !important; height: 44px;
font-size: 14px; border: 1px solid var(--border); border-radius: var(--radius-md);
width: 100%; outline: none; transition: all 0.2s; background: var(--bg-container);
}
.input-wrapper input:focus {
border-color: var(--primary); box-shadow: 0 0 0 2px rgba(22, 93, 255, 0.1);
}
/* 下拉菜单 */
.avatar-menu, .notif-menu {
position: absolute; right: 0; top: calc(100% + 8px);
background: var(--bg-container); border: 1px solid var(--border);
border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
z-index: 50; overflow: hidden; display: none;
}
.avatar-menu { width: 200px; }
.notif-menu { width: 320px; max-height: 400px; overflow-y: auto; }
.avatar-menu a, .notif-item {
display: flex; align-items: center; gap: 10px; padding: 10px 16px;
font-size: 14px; color: var(--text-2); cursor: pointer; transition: all 0.15s;
}
.avatar-menu a:hover, .notif-item:hover { background: var(--primary-bg); color: var(--primary); }
.avatar-menu .divider { height: 1px; background: var(--border); margin: 4px 0; }
.notif-item { flex-direction: column; align-items: flex-start; border-bottom: 1px solid var(--border); }
.notif-item .title { font-size: 13px; font-weight: 500; color: var(--text-1); }
.notif-item .desc { font-size: 12px; color: var(--text-3); margin-top: 4px; line-height: 1.4; }
.notif-item .time { font-size: 11px; color: var(--text-4); margin-top: 6px; }
/* 顶部导航 */
.top-nav-wrap { display: flex; align-items: center; gap: 4px; }
.top-nav-item {
padding: 6px 16px; border-radius: var(--radius-md); cursor: pointer;
font-size: 14px; color: var(--text-3); transition: all 0.15s; white-space: nowrap;
}
.top-nav-item:hover { background: var(--primary-bg); color: var(--primary); }
.top-nav-item.active { background: var(--primary); color: white; box-shadow: 0 2px 6px rgba(22, 93, 255, 0.25); }
/* 学生端头部 */
.student-header {
display: flex; align-items: center; justify-content: space-between;
padding: 0 24px; height: 56px; background: var(--bg-container);
border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10;
}
/* Arco 风格流式输出动画 (为你之前的需求准备) */
@keyframes arco-fade-in-up {
from { opacity: 0; transform: translateY(8px); }
to { opacity: 1; transform: translateY(0); }
}
.animate-arco-fade-in {
animation: arco-fade-in-up 0.35s cubic-bezier(0.34, 0.69, 0.1, 1) forwards;
}
/* 行业卡片选中样式 */
.industry-card.selected {
border-color: #165DFF;
background: linear-gradient(135deg, rgba(22, 93, 255, 0.05), rgba(64, 128, 255, 0.1));
}
/* 模块淡入动画 */
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* AutoDL Web IDE(code-server 原型模拟) */
@keyframes ide-cursor-blink {
0%, 49% { opacity: 1; }
50%, 100% { opacity: 0; }
}
.ide-cursor {
display: inline-block;
width: 7px;
height: 14px;
background: #ffffff;
margin-left: 2px;
vertical-align: text-bottom;
animation: ide-cursor-blink 1s step-end infinite;
}
.ide-fullscreen {
position: fixed !important;
inset: 16px !important;
z-index: 70 !important;
height: calc(100vh - 32px) !important;
max-height: none !important;
border-radius: 8px !important;
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35) !important;
}
.ide-fullscreen-backdrop {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.45);
z-index: 65;
}
</style>
</head>
<body class="bg-[#F8FAFC]">
<div id="loginPage" style="display:flex"><div id="loginContainer" class="w-full"></div></div>
<div id="appShell" style="display:none">
<!-- 通用弹窗:未选择项目提示 -->
<div id="noProjectModal" class="fixed inset-0 z-50 hidden">
<div class="absolute inset-0 bg-black/50" onclick="closeNoProjectModal()"></div>
<div class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-full max-w-md">
<div class="bg-white rounded-xl shadow-2xl overflow-hidden">
<div class="p-6 text-center">
<div class="w-16 h-16 mx-auto mb-4 rounded-full bg-[#FFF7E6] flex items-center justify-center">
<svg class="w-8 h-8 text-[#FF9A2E]" data-lucide="alert-circle"></svg>
</div>
<h3 class="text-xl font-bold text-[#1D2129] mb-2">请先选择实训项目</h3>
<p class="text-[#86909C] mb-6">您需要先选择实训项目,才能进入知识点预习环节</p>
<div class="flex flex-col gap-3">
<button class="btn-primary py-3 px-6" onclick="closeNoProjectModal();switchPage('student-projects')">
<span class="flex items-center justify-center gap-2">
<svg class="w-5 h-5" data-lucide="sparkles"></svg>
前往选择项目
</span>
</button>
<button class="btn-outline py-3 px-6" onclick="closeNoProjectModal()">稍后再说</button>
</div>
</div>
</div>
</div>
</div>
<script>
function showNoProjectModal(targetPage) {
document.getElementById('noProjectModal').classList.remove('hidden');
if (window.lucide) lucide.createIcons();
}
function closeNoProjectModal() {
document.getElementById('noProjectModal').classList.add('hidden');
}
</script>
<!-- Student immersive layout -->
<div id="studentLayout" class="flex flex-col h-screen" style="display:none">
<div class="student-header">
<div class="flex items-center gap-3"><div class="w-8 h-8 rounded-lg bg-gradient-to-br from-indigo-500 to-violet-600 flex items-center justify-center text-white text-xs font-bold">T</div><span class="font-bold text-sm">实习生训练平台</span></div>
<div class="flex items-center gap-4">
<div class="relative" id="stuNtfMenu">
<button class="relative p-1.5 rounded-lg hover:bg-black/5 transition-colors" onclick="toggleStudentNotifications()">
<svg class="w-5 h-5 text-gray-500" data-lucide="bell"></svg>
<span id="stuNtfBadge" class="absolute -top-0.5 -right-0.5 w-4 h-4 bg-red-500 text-white text-[9px] rounded-full items-center justify-center font-medium hidden">0</span>
</button>
<div class="notif-menu" id="stuNtfList" onclick="event.stopPropagation()"></div>
</div>
<div class="relative" id="stuAvatarMenu"><div class="w-8 h-8 rounded-full bg-indigo-100 text-indigo-600 flex items-center justify-center font-bold text-sm cursor-pointer" onclick="toggleMenu('stuAvatarMenu')">张</div>
<div class="avatar-menu"><a onclick="switchPage('profile')">个人中心</a><div class="divider"></div><a onclick="doLogout()" style="color:#EF4444">退出登录</a></div></div>
</div>
</div>
<div class="flex-1 overflow-y-auto p-6" id="studentContent"></div>
</div>
<!-- Other roles top-nav layout -->
<div id="otherLayout" class="flex flex-col h-screen" style="display:none">
<div class="bg-white border-b px-6 py-2 flex items-center justify-between sticky top-0 z-10">
<div class="flex items-center gap-6"><div class="flex items-center gap-2 font-bold text-sm">实习生训练平台</div><div class="top-nav-wrap" id="topNav"></div></div>
<div class="flex items-center gap-4">
<div class="relative" id="ntfMenu"><button class="relative" onclick="toggleMenu('ntfMenu')"><svg class="w-5 h-5 text-gray-500" data-lucide="bell"></svg><span class="absolute -top-1.5 -right-1.5 w-3.5 h-3.5 bg-red-500 text-white text-[9px] rounded-full flex items-center justify-center font-medium">3</span></button>
<div class="notif-menu"><div class="p-3 border-b font-semibold text-sm">通知</div>
<div class="notif-item"><div class="title">学员提交答辩申请</div><div class="desc">张三已提交实操报告,请评审</div><div class="time">10 分钟前</div></div>
<div class="notif-item"><div class="title">体系待审批</div><div class="desc">教育标注培训体系等待您的终审</div><div class="time">1 小时前</div></div>
<div class="notif-item"><div class="title">进度滞后预警</div><div class="desc">3名学员实训任务逾期</div><div class="time">2 小时前</div></div></div></div>
<div class="relative" id="avMenu"><div class="w-8 h-8 rounded-full bg-indigo-100 text-indigo-600 flex items-center justify-center font-bold text-sm cursor-pointer" onclick="toggleMenu('avMenu')">管</div>
<div class="avatar-menu"><a onclick="switchPage('profile')">个人中心</a><div class="divider"></div><a onclick="doLogout()" style="color:#EF4444">退出登录</a></div></div>
</div>
</div>
<div class="flex-1 overflow-y-auto p-6" id="otherContent"></div>
</div>
</div>
<!-- Page renderer module - must be defined before loading page modules -->
<script>
var pageRenderers = {};
window.pageRenderers = pageRenderers;
function renderContent() {
var renderer = pageRenderers[currentPage];
var content = renderer ? renderer() : '<div class="text-center py-10 text-gray-500">页面加载中...</div>';
if (currentRole === 'student') {
document.getElementById('studentContent').innerHTML = content;
} else {
document.getElementById('otherContent').innerHTML = content;
}
// Re-initialize Lucide icons for new content
if (window.lucide) lucide.createIcons();
// 更新学生通知铃铛角标
if (typeof updateStudentNotificationBadge === 'function') updateStudentNotificationBadge();
// 初始化雷达图
setTimeout(initRadarChart, 150);
}
function initRadarChart() {
var chartDom = document.getElementById('abilityRadarChart');
if (chartDom && window.echarts) {
var radarChart = echarts.init(chartDom);
var radarOption = {
color: ['#165DFF', '#00B42A', '#FF7D00'],
tooltip: {
trigger: 'item',
backgroundColor: '#fff',
borderColor: '#E5E6EB',
borderWidth: 1,
textStyle: { color: '#4E5969' }
},
legend: {
data: ['当前能力', '目标能力'],
bottom: 0,
textStyle: { color: '#86909C', fontSize: 12 }
},
radar: {
indicator: [
{ name: '前端开发', max: 100 },
{ name: '后端开发', max: 100 },
{ name: '数据库设计', max: 100 },
{ name: '测试覆盖', max: 100 },
{ name: '架构设计', max: 100 },
{ name: '沟通协作', max: 100 }
],
shape: 'polygon',
splitNumber: 4,
axisName: { color: '#4E5969', fontSize: 12 },
splitLine: { lineStyle: { color: '#E5E6EB' } },
splitArea: { show: true, areaStyle: { color: ['#fff', '#F7F8FA'] } },
axisLine: { lineStyle: { color: '#E5E6EB' } }
},
series: [{
type: 'radar',
data: [
{
value: [85, 55, 50, 35, 40, 72],
name: '当前能力',
symbol: 'circle',
symbolSize: 6,
lineStyle: { color: '#165DFF', width: 2 },
areaStyle: { color: 'rgba(22, 93, 255, 0.15)' }
},
{
value: [70, 65, 60, 55, 50, 65],
name: '目标能力',
symbol: 'circle',
symbolSize: 6,
lineStyle: { color: '#00B42A', width: 2, type: 'dashed' },
areaStyle: { color: 'rgba(0, 180, 42, 0.1)' }
}
]
}]
};
radarChart.setOption(radarOption);
window.addEventListener('resize', function() { radarChart.resize(); });
}
}
</script>
<!-- Load page modules in order -->
<script src="pages/common/shared.js"></script>
<script src="pages/common/login.js"></script>
<script src="pages/common/register.js"></script>
<script src="pages/common/profile.js"></script>
<script src="pages/student/shared.js"></script>
<script src="pages/student/dashboard.js"></script>
<script src="pages/student/resume.js"></script>
<script src="pages/student/bridge-preview.js"></script>
<script src="pages/student/bridge-quiz.js"></script>
<script src="pages/student/bridge-quiz-result.js"></script>
<script src="pages/student/deploy-preview.js"></script>
<script src="pages/student/deploy-quiz.js"></script>
<script src="pages/student/deploy-quiz-result.js"></script>
<script src="pages/student/autodl.js"></script>
<script src="pages/student/deploy-submit.js"></script>
<script src="pages/student/deploy-result.js"></script>
<script src="pages/student/projects.js"></script>
<script src="pages/student/preview.js"></script>
<script src="pages/student/quiz.js"></script>
<script src="pages/student/quiz-result.js"></script>
<script src="pages/student/practice.js"></script>
<script src="pages/student/report.js"></script>
<script src="pages/student/defense.js"></script>
<script src="pages/student/entry.js"></script>
<script src="pages/student/advance.js"></script>
<script src="pages/student/archive.js"></script>
<script src="pages/mentor/shared.js"></script>
<script src="pages/mentor/dashboard.js"></script>
<script src="pages/mentor/students.js"></script>
<script src="pages/mentor/practice-review.js"></script>
<script src="pages/mentor/defense-review.js"></script>
<script src="pages/mentor/entry-review.js"></script>
<script src="pages/mentor/deploy-review.js"></script>
<script src="pages/mentor/deploy-acceptance.js"></script>
<script src="pages/admin/shared.js"></script>
<script src="pages/admin/dashboard.js"></script>
<script src="pages/admin/knowledge-tags.js"></script>
<script src="pages/admin/question-bank.js"></script>
<script src="pages/admin/exam-paper.js"></script>
<script src="pages/admin/training-flow.js"></script>
<script src="pages/admin/projects.js"></script>
<script src="pages/mentor/question-bank.js"></script>
<script src="pages/mentor/exam-paper.js"></script>
<script src="pages/mentor/training-flow.js"></script>
<script src="pages/admin/ai-config.js"></script>
<script src="pages/admin/corpus.js"></script>
<script src="pages/admin/category-review.js"></script>
<script src="pages/admin/users.js"></script>
<script src="pages/admin/roles.js"></script>
<script src="pages/admin/permissions.js"></script>
<script src="pages/admin/tickets.js"></script>
<script src="pages/enterprise/shared.js"></script>
<script src="pages/enterprise/dashboard.js"></script>
<script src="pages/enterprise/review.js"></script>
<script src="pages/enterprise/records.js"></script>
<script src="pages/enterprise/stats.js"></script>
<script src="pages/school/shared.js"></script>
<script src="pages/school/dashboard.js"></script>
<script src="pages/school/systems.js"></script>
<script src="pages/school/teaching.js"></script>
<script src="pages/school/students.js"></script>
<script src="pages/school/accounts.js"></script>
<script src="pages/school/business.js"></script>
<script>
const ROLES = {student:{name:'学生端',pages:[{id:'student-dashboard',label:'学习首页'},{id:'student-resume',label:'上传简历'},{id:'student-bridge-preview',label:'衔接预习'},{id:'student-bridge-quiz',label:'衔接测验'},{id:'student-deploy-preview',label:'部署知识点'},{id:'student-deploy-quiz',label:'部署小测'},{id:'student-autodl',label:'AutoDL'},{id:'student-deploy-submit',label:'提交部署产物'},{id:'student-deploy-result',label:'部署作业详情'},{id:'student-projects',label:'AI推荐项目'},{id:'student-preview',label:'知识点预习'},{id:'student-quiz',label:'预习小测'},{id:'student-practice',label:'实操工作台'},{id:'student-report',label:'实操报告'},{id:'student-defense',label:'答辩申请'},{id:'student-entry',label:'入项申请'},{id:'student-archive',label:'成长档案'}]},mentor:{name:'导师端',pages:[{id:'mentor-dashboard',label:'导师首页'},{id:'mentor-students',label:'学员管理'},{id:'mentor-question-bank',label:'我的题库'},{id:'mentor-exam-paper',label:'我的试卷'},{id:'mentor-training-flow',label:'培训流程配置'},{id:'mentor-practice-review',label:'实操评审'},{id:'mentor-deploy-review',label:'实操验收'},{id:'mentor-defense-review',label:'答辩评审'},{id:'mentor-entry-review',label:'入项审核'}]},admin:{name:'管理员端',pages:[{id:'admin-dashboard',label:'管理首页'},{id:'admin-knowledge-tags',label:'知识点标签管理'},{id:'admin-question-bank',label:'题库管理'},{id:'admin-exam-paper',label:'试卷管理'},{id:'admin-training-flow',label:'培训流程管理'},{id:'admin-projects',label:'实操任务库'},{id:'admin-corpus',label:'语料管理'},{id:'admin-category-review',label:'分类校对'},{id:'admin-users',label:'用户列表'},{id:'admin-roles',label:'角色管理'},{id:'admin-permissions',label:'权限配置'},{id:'admin-tickets',label:'工单处理'}]},enterprise:{name:'企业端',pages:[{id:'enterprise-dashboard',label:'总览首页'},{id:'enterprise-review',label:'学员审核台'},{id:'enterprise-records',label:'入项记录'},{id:'enterprise-stats',label:'统计报表'}]},school:{name:'院校教务端',pages:[{id:'school-dashboard',label:'工作台'},{id:'school-systems',label:'培训体系'},{id:'school-teaching',label:'实训进度'},{id:'school-students',label:'学生档案'},{id:'school-accounts',label:'账号管理'},{id:'school-business',label:'商业服务'}]}};
// Student state management
var studentState = {
selectedProject: null,
resumeKeywords: [],
uploadedResume: null,
resumeAnalyzed: false,
resumeAbilities: [],
resumeProjects: [],
resumeSuggestions: [],
quizPassed: false,
quizScore: 0,
// 阶段三~五共用预习/小测(与部署页同版式)
previewActiveId: '',
previewReadIds: [],
projectQuizIndex: 0,
projectAnswers: {},
projectLastWrong: [],
practiceSubmitted: false,
practiceRepoUrl: '',
// 报告相关状态
reportSubmitted: false,
reportReviewed: false,
reportPassed: false,
reportScore: 0,
reportComment: '',
reportHistory: [],
// 答辩相关状态
defenseApplied: false,
defenseCompleted: false,
defensePassed: false,
defenseScore: 0,
defenseComment: '',
defenseHistory: [],
// 入项申请相关状态
// 第一阶段:入项意向(导师审核)
intentSubmitted: false, // 是否已提交入项意向
intentReviewed: false, // 导师是否已审核
intentPassed: false, // 导师是否通过
intentRejectReason: '', // 导师驳回原因
// 第二阶段:入项申请(企业主管审核)
canFillEntryForm: false, // 导师通过后,学生可填写入项申请
entryFormFilled: false, // 学生是否已填写入项申请信息
entrySubmitted: false, // 是否已提交给企业主管
entryReviewed: false, // 企业主管是否已审核
entryPassed: false, // 企业主管是否通过
entryRejectReason: '', // 企业主管驳回原因
entryRecommendProject: null, // 企业主管推荐的进阶项目
entryFormData: { // 入项申请表单数据
reason: '', // 入项理由
expectedProject: '', // 期望项目方向
selfAssessment: '' // 自我评估
},
// 进阶学习相关
isAdvanceMode: false,
advanceReason: '',
// 四阶段学习相关(旧 L1–L4 循环,其他阶段旧页仍可能用到)
currentStage: 1, // PRD:1衔接 2模型部署 3RAG 4Agent 5微调 6入项
stageStatus: {
1: { completed: false, passed: false, projectName: '' },
2: { completed: false, passed: false, projectName: '' },
3: { completed: false, passed: false, projectName: '' },
4: { completed: false, passed: false, projectName: '' },
5: { completed: false, passed: false, projectName: '' },
6: { completed: false, passed: false, projectName: '' }
},
// PRD 模块一:阶段一衔接
bridgeQuizPassed: false,
bridgeQuizScore: 0,
bridgeReadIds: [],
bridgeQuizIndex: 0,
bridgeAnswers: {},
bridgeLastWrong: [],
// PRD 模块一:阶段二模型部署
deployReadIds: [],
deployQuizIndex: 0,
deployAnswers: {},
deployLastWrong: [],
deployQuizScore: 0,
deployQuizPassed: false,
deploySubmitted: false,
deployReviewed: false,
deployPassed: false,
deployReviewStatus: '待提交',
deployReviewComment: '',
deployReviewScore: null, // { api, deployment, logs, report, reflection, total }
deployReviewUpdatedAt: '', // 导师验收提交时间
deployReviewRound: 1, // 导师验收轮次
deployReviewNotifiedAt: '', // 导师验收通知时间
deployArtifactReviewStatus: '', // 产物分项验收状态:通过 | 驳回 | 待补充
deployReportReviewStatus: '', // 报告分项验收状态:通过 | 驳回 | 待补充
deployLogName: '',
deployLogContent: '',
deployApiUrl: '',
deployApiPath: '',
deployApiPort: '',
deployRejected: false,
notifications: [], // 通知列表(含部署验收通知),未读展示在学生端首页
deployArtifact: { fileName: '', apiUrl: '', apiPath: '', port: '', modelName: '', apiKey: '' },
deployArtifactSaved: false,
deployArtifactSubmitted: false,
deployReport: { taskName: '', process: '', issues: '', selfTest: '', summary: '' },
deployReportSaved: false,
deployReportSubmitted: false,
deployTaskId: 'text-model',
deployTaskType: 'text-model', // text-model | image-gen
autodlLeases: [], // 学生自主租赁记录列表
autodlCurrentLeaseId: '',
deploySsh: { authType: '密码', note: '' }, // SSH 认证方式与补充说明
deployConnectionStatus: 'idle', // idle | testing | success | fail
deployConnectionResult: null, // { time, target, ok, message, suggest }
// 入项申请权限
canApplyEntry: false
};
// 学生 / 导师共用 AutoDL mock(下发后学生端立刻可见)
var AUTODL_PRESETS = {
1: {
host: 'connect.west-a.autodl.com',
port: '22135',
username: 'root',
password: 'Adl#7bQwen',
gpu: 'RTX 4090 24GB',
region: '西北A区',
remark: 'Qwen2.5-7B 推理服务专用实例,请按端口登录,勿自行改 SSH 端口。'
},
3: {
host: 'connect.west-b.autodl.com',
port: '22380',
username: 'root',
password: 'Adl#Wang5',
gpu: 'RTX 4090 24GB',
region: '西北B区',
remark: '王五 · 模型部署实例。'
}
};
var autodlState = {
studentId: 1,
selectedMentorStudentId: 1,
nextTestResult: 'success',
testing: false,
lastTest: null,
copied: false,
draft: null,
configs: {}
};
function selectProject(projectId, projectName) {
var found = (typeof findLegacyProjectById === 'function') ? findLegacyProjectById(projectId) : null;
studentState.selectedProject = {
id: projectId,
name: projectName,
stage: studentState.currentStage,
tech: found ? found.tech : ''
};
// 记录项目到当前阶段
studentState.stageStatus[studentState.currentStage].projectName = projectName;
// 换项目时重置本阶段预习/小测进度
studentState.previewActiveId = '';
studentState.previewReadIds = [];
studentState.projectQuizIndex = 0;
studentState.projectAnswers = {};
studentState.projectLastWrong = [];
studentState.quizPassed = false;
studentState.quizScore = 0;
switchPage('student-preview');
}
// 获取阶段进度条 HTML(PRD 六段:衔接 → 模型部署 → RAG → Agent → 微调 → 入项)
function getStageProgressBar() {
var stages = (typeof PRD_STAGES !== 'undefined' && PRD_STAGES.length)
? PRD_STAGES
: [
{ id: 1, name: '衔接' },
{ id: 2, name: '模型部署' },
{ id: 3, name: 'RAG' },
{ id: 4, name: 'Agent' },
{ id: 5, name: '微调' },
{ id: 6, name: '入项' }
];
var bridgePassed = typeof isBridgePassed === 'function' ? isBridgePassed() : !!studentState.bridgeQuizPassed;
var currentStageId = typeof getPrdCurrentStageId === 'function'
? getPrdCurrentStageId()
: (bridgePassed ? Math.max(2, Number(studentState.currentStage) || 2) : 1);
var currentMeta = stages[currentStageId - 1] || stages[0];
var nodesHtml = '';
for (var i = 0; i < stages.length; i++) {
var stage = stages[i];
var isDone = false;
if (stage.id === 1) isDone = bridgePassed;
else if (stage.id === 2) isDone = !!studentState.deployPassed && currentStageId > 2;
else if (stage.id >= 3 && stage.id <= 5) {
var st = studentState.stageStatus && studentState.stageStatus[stage.id];
isDone = stage.id < currentStageId || !!(st && st.completed && st.passed);
} else if (stage.id === 6) {
isDone = !!(studentState.entryPassed || (studentState.stageStatus && studentState.stageStatus[6] && studentState.stageStatus[6].passed));
}
var isCurrent = stage.id === currentStageId;
var isLocked = stage.id > currentStageId || (stage.id === 2 && !bridgePassed);
var circleClass = isDone
? 'bg-emerald-100 text-emerald-600 border-emerald-300'
: (isCurrent ? 'bg-[#E8F3FF] text-[#165DFF] border-[#165DFF]' : 'bg-[#F2F3F5] text-[#C9CDD4] border-[#E5E6EB]');
var textColor = isDone ? 'text-emerald-600' : (isCurrent ? 'text-[#165DFF]' : 'text-[#C9CDD4]');
var statusText = isDone ? '已通过' : (isCurrent ? '进行中' : (isLocked ? '未开放' : ''));
var icon = isDone ? '<svg class="w-4 h-4" data-lucide="check"></svg>' : stage.id;
nodesHtml += `
<div class="flex flex-col items-center flex-1 min-w-0 cursor-pointer" onclick="typeof onPrdStageClick==='function'&&onPrdStageClick(` + stage.id + `)">
<div class="w-10 h-10 rounded-full border-2 flex items-center justify-center text-sm font-bold ` + circleClass + `">
` + icon + `
</div>
<div class="text-xs font-medium mt-1.5 ` + textColor + ` truncate max-w-full px-0.5">` + stage.name + `</div>
<div class="text-[10px] mt-0.5 ` + (isCurrent ? 'text-[#165DFF]' : 'text-[#86909C]') + `">` + statusText + `</div>
</div>`;
if (i < stages.length - 1) {
var lineDone = isDone;
nodesHtml += '<div class="flex-shrink-0 w-4 sm:w-6 h-0.5 mt-5 ' + (lineDone ? 'bg-emerald-300' : 'bg-[#E5E6EB]') + '"></div>';
}
}
return `
<div class="feature-card p-4 mb-6">
<div class="flex items-center justify-between mb-4 gap-3 flex-wrap">
<div class="flex items-center gap-2">
<svg class="w-5 h-5 text-[#165DFF]" data-lucide="layers"></svg>
<span class="font-bold text-sm text-[#1D2129]">学习阶段进度</span>
</div>
<div class="text-xs text-[#86909C]">
当前:阶段` + currentStageId + ` · ` + currentMeta.name + `
</div>
</div>
<div class="flex items-start justify-between">` + nodesHtml + `</div>
</div>`;
}
// 简化版阶段进度条(PRD 六段)
function getStageProgressMini() {
var bridgePassed = typeof isBridgePassed === 'function' ? isBridgePassed() : !!studentState.bridgeQuizPassed;
var currentStageId = typeof getPrdCurrentStageId === 'function'
? getPrdCurrentStageId()
: (bridgePassed ? Math.max(2, Number(studentState.currentStage) || 2) : 1);
var names = ['衔接', '模型部署', 'RAG', 'Agent', '微调', '入项'];
var dots = [];
for (var i = 1; i <= 6; i++) {
var isCompleted = i < currentStageId || (i === 1 && bridgePassed && currentStageId > 1);
var isCurrent = i === currentStageId;
var dotClass = isCompleted ? 'bg-emerald-500' : (isCurrent ? 'bg-[#165DFF]' : 'bg-[#C9CDD4]');
dots.push('<div class="w-2 h-2 rounded-full ' + dotClass + '" title="' + names[i - 1] + '"></div>');
}
return `
<div class="flex items-center gap-2 px-3 py-1 bg-[#F7F8FA] rounded-full border border-[#E5E6EB]">
<span class="text-xs text-[#86909C]">阶段</span>
` + dots.join('<div class="w-2 h-0.5 bg-[#E5E6EB]"></div>') + `
<span class="text-xs font-medium text-[#165DFF]">` + (names[currentStageId - 1] || '') + `</span>
</div>`;
}
// 答辩通过后进入下一阶段(PRD:2→3→4→5→6入项)
function advanceToNextStage() {
var currentStage = studentState.currentStage;
var stageNames = ['衔接', '模型部署', 'RAG', 'Agent', '微调', '入项'];
if (currentStage < 5) {
studentState.stageStatus[currentStage].completed = true;
studentState.stageStatus[currentStage].passed = true;
if (currentStage === 2) studentState.deployPassed = true;
studentState.currentStage = currentStage + 1;
studentState.selectedProject = null;
studentState.quizPassed = false;
studentState.quizScore = 0;
studentState.practiceSubmitted = false;
studentState.practiceRepoUrl = '';
studentState.reportSubmitted = false;
studentState.reportReviewed = false;
studentState.reportPassed = false;
studentState.defenseApplied = false;
studentState.defenseCompleted = false;
studentState.defensePassed = false;
studentState.isAdvanceMode = true;
studentState.advanceReason = '恭喜完成「' + (stageNames[currentStage - 1] || '') + '」!开始「' + (stageNames[currentStage] || '') + '」学习';
alert('恭喜完成「' + (stageNames[currentStage - 1] || '') + '」!\n\n即将进入「' + (stageNames[currentStage] || '') + '」...');
switchPage(currentStage + 1 >= 3 ? 'student-projects' : 'student-dashboard');
} else {
studentState.stageStatus[5].completed = true;
studentState.stageStatus[5].passed = true;
studentState.currentStage = 6;
studentState.canApplyEntry = true;
studentState.isAdvanceMode = false;
alert('恭喜完成阶段五「微调」答辩!\n\n请进入阶段六并提交入项意向。');
switchPage('student-entry');
}
}
// 检查是否满足入项申请条件
function checkEntryApplication() {
if (!studentState.canApplyEntry) {
var incompleteStages = [];
for (var i = 1; i <= 4; i++) {
if (!(studentState.stageStatus[i].completed && studentState.stageStatus[i].passed)) {
incompleteStages.push('第 ' + i + ' 阶段');
}
}
alert('入项申请条件不满足!\n\n请先完成以下阶段:\n' + incompleteStages.join('、'));
return false;
}
return true;
}
// 处理答辩后点击入项申请按钮
function handleEntryApplicationClick() {
if (studentState.canApplyEntry) {
switchPage('student-entry');
} else {
checkEntryApplication();
}
}
// 提交入项意向给导师(第一步)
function submitEntryIntent() {
studentState.intentSubmitted = true;
studentState.intentReviewed = false;
studentState.intentPassed = false;
alert('入项意向已提交给导师!\n\n请等待导师审核,审核结果将在入项申请模块显示。');
renderContent();
}
// 导师通过入项意向申请(第一步审核通过)
function approveEntryIntent() {
studentState.intentReviewed = true;
studentState.intentPassed = true;
studentState.canFillEntryForm = true; // 开放填写入项申请的权限
alert('入项意向审核已通过!\n\n恭喜您可以填写入项申请信息了!');
renderContent();
}
// 导师驳回入项意向申请(第一步审核驳回)
function rejectEntryIntent(reason) {
studentState.intentReviewed = true;
studentState.intentPassed = false;
studentState.intentRejectReason = reason || '导师未说明原因';
alert('入项意向审核未通过!\n\n原因:' + studentState.intentRejectReason);
renderContent();
}
// 填写入项申请表单(第二步)
function fillEntryForm() {
var reason = document.getElementById('entryReason').value;
var expectedProject = document.getElementById('entryExpectedProject').value;
var selfAssessment = document.getElementById('entrySelfAssessment').value;
if (!reason || !expectedProject) {
alert('请填写完整的入项申请信息!\n\n* 为必填项');
return;
}
studentState.entryFormData = {
reason: reason,
expectedProject: expectedProject,
selfAssessment: selfAssessment
};
studentState.entryFormFilled = true;
alert('入项申请信息已保存!\n\n请确认信息无误后提交给企业主管审核。');
renderContent();
}
// 提交入项申请给企业主管(第三步)
function submitEntryToEnterprise() {
if (!studentState.entryFormFilled) {
alert('请先填写入项申请信息!');
return;
}
studentState.entrySubmitted = true;
alert('入项申请已提交给企业主管!\n\n请等待企业主管审核。');
renderContent();
}
// 企业主管通过入项申请
function approveEntryByEnterprise() {
studentState.entryReviewed = true;
studentState.entryPassed = true;
alert('🎉 入项申请已通过!\n\n恭喜您正式入项成功!');
renderContent();
}
// 企业主管驳回入项申请
function rejectEntryByEnterprise(reason) {
studentState.entryReviewed = true;
studentState.entryPassed = false;
studentState.entryRejectReason = reason || '企业主管未说明原因';
studentState.entryRecommendProject = {
name: 'node-express-rest-api',
tech: 'Node.js + Express + PostgreSQL',
level: 'L3',
tags: ['后端 API', '数据库设计', '测试覆盖'],
reasons: [
'检测到您在【后端 API 设计】存在薄弱,此项目针对性覆盖 RESTful API 规范',
'同时覆盖【数据库设计】薄弱点,包含 PostgreSQL 表设计和索引优化'
]
};
alert('入项申请未通过!\n\n原因:' + studentState.entryRejectReason);
renderContent();
}
// 获取项目方向文本
function getProjectDirectionText(direction) {
var map = {
'frontend': '前端开发',
'backend': '后端开发',
'fullstack': '全栈开发',
'mobile': '移动端开发',
'devops': 'DevOps/运维'
};
return map[direction] || '未选择';
}
function submitQuiz(passed, score) {
studentState.quizPassed = passed;
studentState.quizScore = score;
switchPage('student-quiz-result');
}
let currentRole="student",currentPage="student-dashboard";
function switchRole(role){
currentRole=role;currentPage=ROLES[role].pages[0].id;
document.querySelectorAll(".role-tab").forEach(el=>el.classList.toggle("active",el.dataset.role===role));
if(role==="student"){
document.getElementById("studentLayout").style.display="flex";
document.getElementById("otherLayout").style.display="none";
}else{
document.getElementById("studentLayout").style.display="none";
document.getElementById("otherLayout").style.display="flex";
renderTopNav();
}
renderContent();
}
function switchPage(pageId){
var bridgeLocked = ['student-projects','student-preview','student-quiz','student-quiz-result','student-practice','student-report','student-defense'];
if (typeof isBridgePassed === 'function' && !isBridgePassed() && bridgeLocked.indexOf(pageId) !== -1) {
currentPage = 'student-dashboard';
renderContent();
if (typeof showBridgeLockModal === 'function') showBridgeLockModal();
return;
}
var deployQuizGate = ['student-autodl','student-deploy-submit'];
if (typeof isBridgePassed === 'function' && isBridgePassed() && !studentState.deployQuizPassed && deployQuizGate.indexOf(pageId) !== -1) {
currentPage = 'student-dashboard';
renderContent();
if (typeof showStudentFlowModal === 'function') showStudentFlowModal('请先通过部署小测','及格线 80 分。通过后才能进入 AutoDL 和提交部署产物。');
return;
}
currentPage=pageId;
renderContent();
if (currentRole !== 'student') renderTopNav();
}
function renderPage(pageId){if(pageId)currentPage=pageId;renderContent();}
function renderTopNav(){
const nav=document.getElementById("topNav"),pages=ROLES[currentRole].pages;
nav.innerHTML=pages.map(p=>'<div class="top-nav-item'+(p.id===currentPage?" active":"")+'" onclick="switchPage(\''+p.id+'\')">'+p.label+'</div>').join("");
}
function toggleMenu(id){document.getElementById(id).querySelector(".avatar-menu,.notif-menu").style.display=document.getElementById(id).querySelector(".avatar-menu,.notif-menu").style.display==="block"?"none":"block";}
function showLoginPage(){
document.getElementById("loginPage").style.display="flex";const lc=document.getElementById("loginContainer");
if(pageRenderers["login"])lc.innerHTML=pageRenderers["login"]();document.getElementById("appShell").style.display="none";
}
function doLogin(){document.getElementById("loginPage").style.display="none";document.getElementById("appShell").style.display="block";switchRole("student");}
function doLoginAs(role){document.getElementById("loginPage").style.display="none";document.getElementById("appShell").style.display="block";switchRole(role);}
function showRegister(){
document.getElementById("loginPage").style.display="flex";
const area=document.getElementById("loginContainer");
area.innerHTML=pageRenderers["register"]?pageRenderers["register"]():"<p>加载中</p>";
}
function doLogout(){document.getElementById("appShell").style.display="none";document.getElementById("studentLayout").style.display="none";document.getElementById("otherLayout").style.display="none";showLoginPage();}
// ===== 院校端 - 培训体系生成器 =====
let selectedIndustry = null;
let isGenerating = false;
let generatedModules = [];
const industryData = {
'医疗': {
icon: '🏥',
title: '医疗行业数据标注人才培训体系',
modules: [
{ icon: '📈', title: '晋升路径', content: '标注实习生 → 初级标注员 → 高级标注员 → 标注组长 → 标注主管', subtext: '预计周期:6-12个月' },
{ icon: '📋', title: '实训内容', items: ['医学影像标注(L1 · 40h)', '病历文本标注(L2 · 60h)', '基因序列标注(L3 · 80h)', '医疗质控标准(L4 · 40h)'] },
{ icon: '📚', title: '配套课程', items: ['医学基础知识(40学时)', '标注规范与工具(20学时)', '实操训练(80学时)', '质控流程管理(20学时)'] },
{ icon: '💼', title: '就业方向', items: ['医疗AI公司', '影像诊断企业', '科研机构数据部门', '健康管理系统服务商'] }
]
},
'金融': {
icon: '🏦',
title: '金融行业风控人才培训体系',
modules: [
{ icon: '📈', title: '晋升路径', content: '风控实习生 → 风控专员 → 高级风控师 → 风控主管 → 风控总监', subtext: '预计周期:8-14个月' },
{ icon: '📋', title: '实训内容', items: ['信贷风险评估(L1 · 50h)', '反欺诈分析(L2 · 60h)', '市场风险建模(L3 · 70h)', '合规审查(L4 · 40h)'] },
{ icon: '📚', title: '配套课程', items: ['金融基础知识(30学时)', '风控模型原理(40学时)', '数据分析工具(50学时)', '合规法规(20学时)'] },
{ icon: '💼', title: '就业方向', items: ['银行风控部门', '保险公司', '互联网金融', '投资机构'] }
]
},
'电商': {
icon: '🛒',
title: '电商行业运营人才培训体系',
modules: [
{ icon: '📈', title: '晋升路径', content: '运营助理 → 运营专员 → 运营主管 → 运营经理 → 运营总监', subtext: '预计周期:6-10个月' },
{ icon: '📋', title: '实训内容', items: ['商品上架管理(L1 · 40h)', '数据分析运营(L2 · 60h)', '营销活动策划(L3 · 50h)', '店铺整体运营(L4 · 60h)'] },
{ icon: '📚', title: '配套课程', items: ['电商平台规则(20学时)', '数据分析方法(40学时)', '营销策略(50学时)', '客户服务(30学时)'] },
{ icon: '💼', title: '就业方向', items: ['电商平台商家', '品牌电商部门', '跨境电商', '直播电商'] }
]
},
'教育': {
icon: '📚',
title: '教育行业课程设计人才培训体系',
modules: [
{ icon: '📈', title: '晋升路径', content: '课程助理 → 课程设计师 → 高级课程设计 → 课程主管 → 课程总监', subtext: '预计周期:8-12个月' },
{ icon: '📋', title: '实训内容', items: ['课程框架设计(L1 · 40h)', '教学内容开发(L2 · 60h)', '学习体验设计(L3 · 50h)', '评估体系构建(L4 · 40h)'] },
{ icon: '📚', title: '配套课程', items: ['教学设计理论(30学时)', '课程开发工具(40学时)', '用户研究方法(40学时)', '评估与迭代(30学时)'] },
{ icon: '💼', title: '就业方向', items: ['在线教育平台', '学校教务部门', '培训咨询机构', '企业内训部门'] }
]
},
'制造': {
icon: '🏭',
title: '制造行业质量检测人才培训体系',
modules: [
{ icon: '📈', title: '晋升路径', content: '质检员 → 质检工程师 → 高级质检师 → 质量主管 → 质量经理', subtext: '预计周期:6-12个月' },
{ icon: '📋', title: '实训内容', items: ['产品检测基础(L1 · 40h)', '质量标准应用(L2 · 50h)', '缺陷分析与改进(L3 · 60h)', '质量管理体系(L4 · 50h)'] },
{ icon: '📚', title: '配套课程', items: ['质量管理体系(30学时)', '检测技术(50学时)', '数据分析(40学时)', '精益生产(30学时)'] },
{ icon: '💼', title: '就业方向', items: ['制造业企业', '质量检测机构', '供应链管理', '智能制造'] }
]
}
};
function selectIndustry(element, industry) {
if (isGenerating) return;
// 清除之前的选中状态
document.querySelectorAll('.industry-card').forEach(card => {
card.classList.remove('selected');
});
// 设置新的选中状态
element.classList.add('selected');
selectedIndustry = industry;
// 隐藏初始提示,显示加载进度
document.getElementById('initialPrompt').classList.add('hidden');
document.getElementById('generatedContent').classList.add('hidden');
document.getElementById('loadingProgress').classList.remove('hidden');
// 重置进度步骤
document.getElementById('step1').textContent = '分析需求';
document.getElementById('step1').classList.add('opacity-40');
document.getElementById('step2').textContent = '构建课程';
document.getElementById('step2').classList.add('opacity-40');
document.getElementById('step3').textContent = '设计项目';
document.getElementById('step3').classList.add('opacity-40');
document.getElementById('step4').textContent = '生成方案';
document.getElementById('step4').classList.add('opacity-40');
// 开始模拟生成流程
startGeneration(industry);
}
function startGeneration(industry) {
isGenerating = true;
const progressBar = document.getElementById('progressBar');
const progressText = document.getElementById('progressText');
const steps = ['step1', 'step2', 'step3', 'step4'];
const progressLabels = ['分析行业需求...', '构建课程体系...', '设计实训项目...', '生成完整方案...'];
let currentStep = 0;
const interval = setInterval(() => {
if (currentStep > 0) {
document.getElementById(steps[currentStep - 1]).classList.remove('opacity-40');
}
progressBar.style.width = ((currentStep + 1) * 25) + '%';
progressText.textContent = progressLabels[currentStep];
currentStep++;
if (currentStep >= 4) {
clearInterval(interval);
setTimeout(() => {
document.getElementById('loadingProgress').classList.add('hidden');
showGeneratedContent(industry);
}, 500);
}
}, 800);
}
function showGeneratedContent(industry) {
const data = industryData[industry];
document.getElementById('resultIcon').innerHTML = '<span class="text-2xl">' + data.icon + '</span>';
document.getElementById('resultTitle').textContent = data.title;
document.getElementById('generatedContent').classList.remove('hidden');
// 清空模块容器
const container = document.getElementById('modulesContainer');
container.innerHTML = '';
generatedModules = data.modules;
// 逐模块显示,每隔0.5秒淡入一个模块
data.modules.forEach((module, index) => {
setTimeout(() => {
const moduleEl = createModuleElement(module);
container.appendChild(moduleEl);
// 触发动画
moduleEl.style.animation = 'fadeInUp 0.5s ease-out forwards';
}, index * 500);
});
// 启用按钮
setTimeout(() => {
document.getElementById('btnConfirm').disabled = false;
document.getElementById('btnModify').disabled = false;
document.getElementById('btnExport').disabled = false;
isGenerating = false;
// 自动添加到表格
addSystemToTable(data);
}, data.modules.length * 500 + 500);
}
function createModuleElement(module) {
const div = document.createElement('div');
div.style.opacity = '0';
let content = '';
if (module.items) {
content = '<div class="flex flex-wrap gap-2 mt-3">';
module.items.forEach(item => {
content += '<span class="px-3 py-1.5 bg-[#F7F8FA] rounded-lg text-sm text-[#4E5969]">' + item + '</span>';
});
content += '</div>';
} else {
content = '<p class="text-sm text-[#4E5969] mt-2">' + module.content + '</p>';
if (module.subtext) {
content += '<p class="text-xs text-[#86909C] mt-1">' + module.subtext + '</p>';
}
}
div.innerHTML = '<div class="flex items-center gap-3"><span class="text-xl">' + module.icon + '</span><span class="font-semibold text-[#1D2129]">' + module.title + '</span></div>' + content;
div.className = 'p-4 bg-white rounded-lg border border-[#E5E6EB]';
return div;
}
function addSystemToTable(data) {
const tbody = document.getElementById('systemsTableBody');
tbody.innerHTML = '';
const row = document.createElement('tr');
row.className = 'hover:bg-[#E8F3FF]/30 transition-colors';
row.innerHTML = '<td class="py-4 px-4"><div class="flex items-center gap-3"><div class="w-10 h-10 rounded-lg bg-indigo-100 flex items-center justify-center"><span class="text-lg">' + data.icon + '</span></div><span class="font-medium text-[#1D2129]">' + data.title + '</span></div></td><td class="py-4 px-4"><span class="px-2.5 py-1 bg-violet-100 text-violet-700 text-xs font-medium rounded-lg">' + selectedIndustry + '</span></td><td class="py-4 px-4 text-sm text-[#86909C]">' + new Date().toLocaleDateString('zh-CN') + '</td><td class="py-4 px-4"><span class="px-2.5 py-1 bg-amber-100 text-amber-700 text-sm font-medium rounded-lg">待确认</span></td><td class="py-4 px-4"><div class="flex gap-2"><button class="text-sm text-[#165DFF] hover:underline">查看</button><button class="text-sm text-[#165DFF] hover:underline">确认</button><button class="text-sm text-amber-600 hover:underline">提修改</button></div></td>';
tbody.appendChild(row);
}
function confirmSystem() {
alert('培训体系已确认接收!');
}
function showModifyDialog() {
document.getElementById('modifySuggestion').focus();
}
function exportPDF() {
alert('正在导出PDF,请稍候...');
}
function submitSuggestion() {
const suggestion = document.getElementById('modifySuggestion').value.trim();
if (!suggestion) {
alert('请输入修改建议');
return;
}
alert('建议已发送给管理员端');
document.getElementById('modifySuggestion').value = '';
}
showLoginPage();
</script>
</body></html>
// admin-projects page renderer.
// 通用化改造:从技术部专属项目库改为通用实操任务库
// Shared state and helpers remain in this end's shared.js.
pageRenderers["admin-projects"] = function() { return `
<div class="max-w-7xl mx-auto">
<!-- Page Header -->
<div class="flex items-center justify-between mb-6">
<div class="flex items-center gap-4">
<button class="btn-ghost p-2 rounded-lg hover:bg-[#F2F3F5]" onclick="switchPage('admin-dashboard')">
<svg class="w-5 h-5" data-lucide="arrow-left"></svg>
</button>
<div class="w-12 h-12 rounded-xl bg-gradient-to-br from-[#165DFF] to-[#4080FF] flex items-center justify-center shadow-lg shadow-[#165DFF]/20">
<svg class="w-6 h-6 text-white" data-lucide="briefcase"></svg>
</div>
<div>
<h2 class="text-xl font-bold text-[#1D2129]">实操任务库</h2>
<p class="text-sm text-[#86909C]">管理全行业通用的实操任务模板</p>
</div>
</div>
<div class="flex items-center gap-3">
<button class="btn-outline text-sm">
<svg class="w-4 h-4 mr-1.5" data-lucide="download"></svg>
导出列表
</button>
<button class="btn-primary text-sm">
<svg class="w-4 h-4 mr-1.5" data-lucide="plus"></svg>
新增任务
</button>
</div>
</div>
<!-- 行业统计卡片 -->
<div class="grid grid-cols-4 gap-4 mb-6">
<div class="feature-card p-4">
<div class="flex items-center gap-3">
<div class="w-10 h-10 rounded-lg bg-[#E8F3FF] flex items-center justify-center">
<svg class="w-5 h-5 text-[#165DFF]" data-lucide="database"></svg>
</div>
<div>
<div class="text-2xl font-bold text-[#1D2129]">24</div>
<div class="text-xs text-[#86909C]">数据标注行业</div>
</div>
</div>
</div>
<div class="feature-card p-4">
<div class="flex items-center gap-3">
<div class="w-10 h-10 rounded-lg bg-emerald-50 flex items-center justify-center">
<svg class="w-5 h-5 text-emerald-600" data-lucide="factory"></svg>
</div>
<div>
<div class="text-2xl font-bold text-[#1D2129]">18</div>
<div class="text-xs text-[#86909C]">智能制造行业</div>
</div>
</div>
</div>
<div class="feature-card p-4">
<div class="flex items-center gap-3">
<div class="w-10 h-10 rounded-lg bg-violet-50 flex items-center justify-center">
<svg class="w-5 h-5 text-violet-600" data-lucide="palette"></svg>
</div>
<div>
<div class="text-2xl font-bold text-[#1D2129]">15</div>
<div class="text-xs text-[#86909C]">设计创意行业</div>
</div>
</div>
</div>
<div class="feature-card p-4">
<div class="flex items-center gap-3">
<div class="w-10 h-10 rounded-lg bg-amber-50 flex items-center justify-center">
<svg class="w-5 h-5 text-amber-600" data-lucide="message-square"></svg>
</div>
<div>
<div class="text-2xl font-bold text-[#1D2129]">21</div>
<div class="text-xs text-[#86909C]">客户服务行业</div>
</div>
</div>
</div>
</div>
<!-- Filter Bar -->
<div class="flex items-center gap-3 mb-6">
<input class="input-field w-48 text-sm" placeholder="搜索任务名称...">
<select class="input-field w-36 text-sm">
<option>全部行业</option>
<option>数据标注</option>
<option>智能制造</option>
<option>软件开发</option>
<option>设计创意</option>
<option>客户服务</option>
<option>文案写作</option>
</select>
<select class="input-field w-32 text-sm">
<option>全部类型</option>
<option>实操练习</option>
<option>项目实战</option>
<option>案例分析</option>
<option>模拟操作</option>
</select>
<select class="input-field w-32 text-sm">
<option>全部难度</option>
<option>L1 入门</option>
<option>L2 进阶</option>
<option>L3 高级</option>
</select>
<select class="input-field w-32 text-sm">
<option>全部状态</option>
<option>已发布</option>
<option>草稿</option>
<option>已下架</option>
</select>
</div>
<!-- Tasks Grid -->
<div class="grid grid-cols-3 gap-5">
<!-- Task Card 1: 数据标注 -->
<div class="feature-card p-5 hover:shadow-lg transition-all">
<div class="flex items-start justify-between mb-4">
<div class="flex items-center gap-3">
<div class="w-10 h-10 rounded-lg bg-[#E8F3FF] flex items-center justify-center">
<svg class="w-5 h-5 text-[#165DFF]" data-lucide="scan"></svg>
</div>
<div>
<div class="font-semibold text-[#1D2129]">Bounding Box 标注基础</div>
<div class="text-xs text-[#86909C]">数据标注 · 图像标注</div>
</div>
</div>
<span class="px-2 py-0.5 bg-emerald-100 text-emerald-700 text-xs font-medium rounded">L1</span>
</div>
<div class="flex flex-wrap gap-1.5 mb-3">
<span class="px-2 py-0.5 bg-[#F7F8FA] text-[#86909C] text-xs rounded">实操练习</span>
<span class="px-2 py-0.5 bg-[#F7F8FA] text-[#86909C] text-xs rounded">文件提交</span>
</div>
<p class="text-xs text-[#86909C] mb-4 leading-relaxed">完成50张图片的目标框选标注,掌握Bounding Box标注规范和技巧。</p>
<div class="flex items-center justify-between pt-4 border-t border-[#E5E6EB]">
<div class="flex items-center gap-4 text-xs text-[#86909C]">
<span class="flex items-center gap-1">
<svg class="w-3 h-3" data-lucide="users"></svg>
45 人进行中
</span>
</div>
<div class="flex gap-2">
<button class="text-xs text-[#165DFF] hover:underline">编辑</button>
<button class="text-xs text-[#86909C] hover:text-red-500">下架</button>
</div>
</div>
</div>
<!-- Task Card 2: 智能制造 -->
<div class="feature-card p-5 hover:shadow-lg transition-all">
<div class="flex items-start justify-between mb-4">
<div class="flex items-center gap-3">
<div class="w-10 h-10 rounded-lg bg-emerald-50 flex items-center justify-center">
<svg class="w-5 h-5 text-emerald-600" data-lucide="cog"></svg>
</div>
<div>
<div class="font-semibold text-[#1D2129]">设备点检实操</div>
<div class="text-xs text-[#86909C]">智能制造 · 设备维护</div>
</div>
</div>
<span class="px-2 py-0.5 bg-[#165DFF] text-white text-xs font-medium rounded">L2</span>
</div>
<div class="flex flex-wrap gap-1.5 mb-3">
<span class="px-2 py-0.5 bg-[#F7F8FA] text-[#86909C] text-xs rounded">模拟操作</span>
<span class="px-2 py-0.5 bg-[#F7F8FA] text-[#86909C] text-xs rounded">表单提交</span>
</div>
<p class="text-xs text-[#86909C] mb-4 leading-relaxed">学习设备日常点检流程,填写点检表,识别常见设备异常。</p>
<div class="flex items-center justify-between pt-4 border-t border-[#E5E6EB]">
<div class="flex items-center gap-4 text-xs text-[#86909C]">
<span class="flex items-center gap-1">
<svg class="w-3 h-3" data-lucide="users"></svg>
32 人进行中
</span>
</div>
<div class="flex gap-2">
<button class="text-xs text-[#165DFF] hover:underline">编辑</button>
<button class="text-xs text-[#86909C] hover:text-red-500">下架</button>
</div>
</div>
</div>
<!-- Task Card 3: 软件开发 -->
<div class="feature-card p-5 hover:shadow-lg transition-all">
<div class="flex items-start justify-between mb-4">
<div class="flex items-center gap-3">
<div class="w-10 h-10 rounded-lg bg-violet-50 flex items-center justify-center">
<svg class="w-5 h-5 text-violet-600" data-lucide="code"></svg>
</div>
<div>
<div class="font-semibold text-[#1D2129]">模型部署实战</div>
<div class="text-xs text-[#86909C]">软件开发 · AI工程化</div>
</div>
</div>
<span class="px-2 py-0.5 bg-violet-100 text-violet-700 text-xs font-medium rounded">L3</span>
</div>
<div class="flex flex-wrap gap-1.5 mb-3">
<span class="px-2 py-0.5 bg-[#F7F8FA] text-[#86909C] text-xs rounded">项目实战</span>
<span class="px-2 py-0.5 bg-[#F7F8FA] text-[#86909C] text-xs rounded">链接+代码</span>
</div>
<p class="text-xs text-[#86909C] mb-4 leading-relaxed">完成AI模型的部署上线,提供API接口服务,编写技术文档。</p>
<div class="flex items-center justify-between pt-4 border-t border-[#E5E6EB]">
<div class="flex items-center gap-4 text-xs text-[#86909C]">
<span class="flex items-center gap-1">
<svg class="w-3 h-3" data-lucide="users"></svg>
18 人进行中
</span>
</div>
<div class="flex gap-2">
<button class="text-xs text-[#165DFF] hover:underline">编辑</button>
<button class="text-xs text-[#86909C] hover:text-red-500">下架</button>
</div>
</div>
</div>
<!-- Task Card 4: 设计创意 -->
<div class="feature-card p-5 hover:shadow-lg transition-all">
<div class="flex items-start justify-between mb-4">
<div class="flex items-center gap-3">
<div class="w-10 h-10 rounded-lg bg-amber-50 flex items-center justify-center">
<svg class="w-5 h-5 text-amber-600" data-lucide="palette"></svg>
</div>
<div>
<div class="font-semibold text-[#1D2129]">海报设计实操</div>
<div class="text-xs text-[#86909C]">设计创意 · 平面设计</div>
</div>
</div>
<span class="px-2 py-0.5 bg-amber-100 text-amber-700 text-xs font-medium rounded">L2</span>
</div>
<div class="flex flex-wrap gap-1.5 mb-3">
<span class="px-2 py-0.5 bg-[#F7F8FA] text-[#86909C] text-xs rounded">实操练习</span>
<span class="px-2 py-0.5 bg-[#F7F8FA] text-[#86909C] text-xs rounded">文件提交</span>
</div>
<p class="text-xs text-[#86909C] mb-4 leading-relaxed">根据主题要求,完成一张活动海报设计,输出高清设计稿。</p>
<div class="flex items-center justify-between pt-4 border-t border-[#E5E6EB]">
<div class="flex items-center gap-4 text-xs text-[#86909C]">
<span class="flex items-center gap-1">
<svg class="w-3 h-3" data-lucide="users"></svg>
28 人进行中
</span>
</div>
<div class="flex gap-2">
<button class="text-xs text-[#165DFF] hover:underline">编辑</button>
<button class="text-xs text-[#86909C] hover:text-red-500">下架</button>
</div>
</div>
</div>
<!-- Task Card 5: 客户服务 -->
<div class="feature-card p-5 hover:shadow-lg transition-all">
<div class="flex items-start justify-between mb-4">
<div class="flex items-center gap-3">
<div class="w-10 h-10 rounded-lg bg-rose-50 flex items-center justify-center">
<svg class="w-5 h-5 text-rose-600" data-lucide="headphones"></svg>
</div>
<div>
<div class="font-semibold text-[#1D2129]">客户沟通话术演练</div>
<div class="text-xs text-[#86909C]">客户服务 · 沟通技巧</div>
</div>
</div>
<span class="px-2 py-0.5 bg-rose-100 text-rose-700 text-xs font-medium rounded">L1</span>
</div>
<div class="flex flex-wrap gap-1.5 mb-3">
<span class="px-2 py-0.5 bg-[#F7F8FA] text-[#86909C] text-xs rounded">模拟操作</span>
<span class="px-2 py-0.5 bg-[#F7F8FA] text-[#86909C] text-xs rounded">文本提交</span>
</div>
<p class="text-xs text-[#86909C] mb-4 leading-relaxed">针对常见客户问题,撰写标准沟通话术和应对方案。</p>
<div class="flex items-center justify-between pt-4 border-t border-[#E5E6EB]">
<div class="flex items-center gap-4 text-xs text-[#86909C]">
<span class="flex items-center gap-1">
<svg class="w-3 h-3" data-lucide="users"></svg>
22 人进行中
</span>
</div>
<div class="flex gap-2">
<button class="text-xs text-[#165DFF] hover:underline">编辑</button>
<button class="text-xs text-[#86909C] hover:text-red-500">下架</button>
</div>
</div>
</div>
<!-- Task Card 6: 文案写作 -->
<div class="feature-card p-5 hover:shadow-lg transition-all">
<div class="flex items-start justify-between mb-4">
<div class="flex items-center gap-3">
<div class="w-10 h-10 rounded-lg bg-teal-50 flex items-center justify-center">
<svg class="w-5 h-5 text-teal-600" data-lucide="pen-tool"></svg>
</div>
<div>
<div class="font-semibold text-[#1D2129]">产品文案撰写</div>
<div class="text-xs text-[#86909C]">文案写作 · 内容创作</div>
</div>
</div>
<span class="px-2 py-0.5 bg-teal-100 text-teal-700 text-xs font-medium rounded">L2</span>
</div>
<div class="flex flex-wrap gap-1.5 mb-3">
<span class="px-2 py-0.5 bg-[#F7F8FA] text-[#86909C] text-xs rounded">项目实战</span>
<span class="px-2 py-0.5 bg-[#F7F8FA] text-[#86909C] text-xs rounded">文档提交</span>
</div>
<p class="text-xs text-[#86909C] mb-4 leading-relaxed">为指定产品撰写推广文案,包括标题、正文和卖点提炼。</p>
<div class="flex items-center justify-between pt-4 border-t border-[#E5E6EB]">
<div class="flex items-center gap-4 text-xs text-[#86909C]">
<span class="flex items-center gap-1">
<svg class="w-3 h-3" data-lucide="users"></svg>
15 人进行中
</span>
</div>
<div class="flex gap-2">
<button class="text-xs text-[#165DFF] hover:underline">编辑</button>
<button class="text-xs text-[#86909C] hover:text-red-500">下架</button>
</div>
</div>
</div>
<!-- Add New Card -->
<div class="feature-card p-5 border-2 border-dashed border-[#E5E6EB] hover:border-[#165DFF] transition-colors flex flex-col items-center justify-center min-h-[200px] cursor-pointer group">
<div class="w-12 h-12 rounded-xl bg-[#F7F8FA] group-hover:bg-[#E8F3FF] flex items-center justify-center mb-3 transition-colors">
<svg class="w-6 h-6 text-[#C9CDD4] group-hover:text-[#165DFF] transition-colors" data-lucide="plus"></svg>
</div>
<span class="text-sm text-[#86909C] group-hover:text-[#165DFF] transition-colors">新增实操任务</span>
</div>
</div>
</div>`; };
// admin-projects page renderer.
// 通用化改造:从技术部专属项目库改为通用实操任务库
// Shared state and helpers remain in this end's shared.js.
// 实操任务库:任务分类树 + 筛选检索 + 任务列表 + 任务信息(要求/交付产物/验收要求/附件)
// + 知识点标签挂载 + AI 任务难度校准(含人工校准与校准历史)+ 启用/停用/删除
// 知识点标签数据复用知识点标签管理页(adminKtTags)
pageRenderers["admin-projects"] = function() { return `
<div class="max-w-7xl mx-auto">
<!-- Page Header -->
var PT_LEVELS = [
{ level: 'L1', name: '入门', min: 0, max: 39, cls: 'bg-emerald-100 text-emerald-700' },
{ level: 'L2', name: '进阶', min: 40, max: 69, cls: 'bg-[#165DFF] text-white' },
{ level: 'L3', name: '高级', min: 70, max: 100, cls: 'bg-violet-100 text-violet-700' }
];
var adminProjCategories = [
{ id: 1, name: '数据标注行业' },
{ id: 2, name: '智能制造行业' },
{ id: 3, name: '软件开发行业' },
{ id: 4, name: '设计创意行业' },
{ id: 5, name: '客户服务行业' },
{ id: 6, name: '文案写作行业' }
];
var adminProjTasks = [
{
id: 1, name: 'Bounding Box 标注基础', categoryId: 1, difficultyValue: 25, level: 'L1',
status: '启用', tagIds: [], learners: 45,
requirements: '完成 50 张图片的目标框选标注,掌握 Bounding Box 标注规范和技巧。',
deliverables: ['标注结果 JSON 文件', '标注质检自查表'],
acceptance: ['目标框完全包裹目标且不含背景', '抽检准确率 ≥ 95%'],
attachments: ['标注规范说明.pdf'],
aiCalibrated: false,
calibrationHistory: []
},
{
id: 2, name: '设备点检实操', categoryId: 2, difficultyValue: 48, level: 'L2',
status: '启用', tagIds: [], learners: 32,
requirements: '学习设备日常点检流程,填写点检表,识别常见设备异常。',
deliverables: ['点检记录表', '异常项处置说明'],
acceptance: ['点检项覆盖完整', '异常识别准确率 ≥ 90%'],
attachments: [],
aiCalibrated: false, calibrationHistory: []
},
{
id: 3, name: '模型部署实战', categoryId: 3, difficultyValue: 82, level: 'L3',
status: '启用', tagIds: [106], learners: 18,
requirements: '完成 AI 模型的部署上线,提供 API 接口服务,编写技术文档。',
deliverables: ['可访问的 API 地址', '部署日志包', '技术文档'],
acceptance: ['API 健康检查通过', '并发 20 不报错', '文档包含复现步骤'],
attachments: ['部署任务书.pdf'],
aiCalibrated: true,
calibrationHistory: [
{ time: '2026-09-12 14:20', aiValue: 78, aiLevel: 'L3', manualValue: 82, manualLevel: 'L3', state: '已校准' },
{ time: '2026-08-05 09:40', aiValue: 65, aiLevel: 'L2', manualValue: 0, manualLevel: '-', state: '校准中' }
]
},
{
id: 4, name: '海报设计实操', categoryId: 4, difficultyValue: 52, level: 'L2',
status: '启用', tagIds: [], learners: 28,
requirements: '根据主题要求,完成一张活动海报设计,输出高清设计稿。',
deliverables: ['海报设计稿 PNG', '设计说明'],
acceptance: ['尺寸与主题符合 brief', '无版权风险素材'],
attachments: [], aiCalibrated: false, calibrationHistory: []
},
{
id: 5, name: '客户沟通话术演练', categoryId: 5, difficultyValue: 30, level: 'L1',
status: '禁用', tagIds: [], learners: 22,
requirements: '针对常见客户问题,撰写标准沟通话术和应对方案。',
deliverables: ['话术手册', '情景对话录音'],
acceptance: ['覆盖 8 类高频问题', '话术符合合规要求'],
attachments: [], aiCalibrated: false, calibrationHistory: []
},
{
id: 6, name: '产品文案撰写', categoryId: 6, difficultyValue: 55, level: 'L2',
status: '启用', tagIds: [], learners: 15,
requirements: '为指定产品撰写推广文案,包括标题、正文和卖点提炼。',
deliverables: ['推广文案文档', '卖点提炼表'],
acceptance: ['卖点 ≥ 3 条且有差异化', '无夸大宣传表述'],
attachments: [], aiCalibrated: false, calibrationHistory: []
}
];
var PT_CALIBRATION_MODULES = ['任务复杂度', '技术栈门槛', '交付要求严格度', '预计耗时'];
var ptState = {
selectedCategoryId: 0,
keyword: '',
levelFilter: 'all',
tagFilter: 0,
statusFilter: 'all',
drawer: null, // { mode: 'create'|'edit', id }
draft: null,
addingCategory: false,
newCategoryName: '',
renamingCategoryId: 0,
renameDraft: '',
calibration: null, // { suggestion, modules }
historyId: 0, // 查看校准历史的任务 id,0 = 关闭
detailId: 0,
newTagInline: ''
};
function ptEsc(s) {
return String(s === undefined || s === null ? '' : s)
.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;')
.replace(/"/g, '&quot;').replace(/'/g, '&#39;');
}
function ptTagList() { return (typeof adminKtTags !== 'undefined') ? adminKtTags : []; }
function ptTagName(id) {
var list = ptTagList();
for (var i = 0; i < list.length; i++) if (list[i].id === id) return list[i].name;
return '';
}
function ptCategoryName(id) {
for (var i = 0; i < adminProjCategories.length; i++) if (adminProjCategories[i].id === id) return adminProjCategories[i].name;
return '未分类';
}
function ptLevelOf(value) {
for (var i = 0; i < PT_LEVELS.length; i++) if (value >= PT_LEVELS[i].min && value <= PT_LEVELS[i].max) return PT_LEVELS[i];
return PT_LEVELS[0];
}
function ptLevelCls(level) {
for (var i = 0; i < PT_LEVELS.length; i++) if (PT_LEVELS[i].level === level) return PT_LEVELS[i].cls;
return 'bg-gray-100 text-gray-600';
}
function ptNextTaskId() {
var max = 0;
for (var i = 0; i < adminProjTasks.length; i++) if (adminProjTasks[i].id > max) max = adminProjTasks[i].id;
return max + 1;
}
function ptVisibleTasks() {
return adminProjTasks.filter(function(t) {
if (ptState.selectedCategoryId && t.categoryId !== ptState.selectedCategoryId) return false;
if (ptState.keyword && t.name.indexOf(ptState.keyword) === -1) return false;
if (ptState.levelFilter !== 'all' && t.level !== ptState.levelFilter) return false;
if (ptState.statusFilter !== 'all' && t.status !== ptState.statusFilter) return false;
if (ptState.tagFilter && (t.tagIds || []).indexOf(ptState.tagFilter) === -1) return false;
return true;
});
}
// ===== 任务分类 =====
function ptSelectCategory(id) { ptState.selectedCategoryId = id || 0; renderContent(); }
function ptToggleAddCategory() { ptState.addingCategory = !ptState.addingCategory; ptState.newCategoryName = ''; renderContent(); }
function ptSetNewCategoryName(v) { ptState.newCategoryName = v; }
function ptConfirmAddCategory() {
var name = (ptState.newCategoryName || '').trim();
if (!name) { alert('请输入任务分类名称'); return; }
var maxId = 0;
for (var i = 0; i < adminProjCategories.length; i++) if (adminProjCategories[i].id > maxId) maxId = adminProjCategories[i].id;
adminProjCategories.push({ id: maxId + 1, name: name });
ptState.addingCategory = false;
ptState.newCategoryName = '';
renderContent();
}
function ptStartRenameCategory(id) { ptState.renamingCategoryId = id; ptState.renameDraft = ptCategoryName(id); renderContent(); }
function ptSetRenameDraft(v) { ptState.renameDraft = v; }
function ptSaveRenameCategory(id) {
var name = (ptState.renameDraft || '').trim();
if (!name) { alert('分类名称不能为空'); return; }
adminProjCategories.forEach(function(c) { if (c.id === id) c.name = name; });
ptState.renamingCategoryId = 0;
renderContent();
}
function ptCancelRenameCategory() { ptState.renamingCategoryId = 0; renderContent(); }
function ptDeleteCategory(id) {
var used = adminProjTasks.filter(function(t) { return t.categoryId === id; }).length;
if (!confirm('确认删除该任务分类?该分类下有 ' + used + ' 个任务,删除后任务将归入「未分类」。')) return;
adminProjCategories = adminProjCategories.filter(function(c) { return c.id !== id; });
adminProjTasks.forEach(function(t) { if (t.categoryId === id) t.categoryId = 0; });
if (ptState.selectedCategoryId === id) ptState.selectedCategoryId = 0;
renderContent();
}
// ===== 筛选 =====
function ptSetKeyword(v) { ptState.keyword = v || ''; }
function ptSetLevelFilter(v) { ptState.levelFilter = v; renderContent(); }
function ptSetTagFilter(v) { ptState.tagFilter = Number(v) || 0; renderContent(); }
function ptSetStatusFilter(v) { ptState.statusFilter = v; renderContent(); }
function ptDoSearch() { renderContent(); }
function ptResetFilter() {
ptState.keyword = ''; ptState.levelFilter = 'all'; ptState.tagFilter = 0;
ptState.statusFilter = 'all'; ptState.selectedCategoryId = 0;
renderContent();
}
function ptRefresh() {
alert('已刷新任务列表数据(原型演示)');
renderContent();
}
// ===== 任务启停 / 删除 =====
function ptToggleStatus(id) {
adminProjTasks.forEach(function(t) {
if (t.id === id) t.status = (t.status === '启用') ? '禁用' : '启用';
});
renderContent();
}
function ptDeleteTask(id) {
if (!confirm('确认删除该实操任务?')) return;
adminProjTasks = adminProjTasks.filter(function(t) { return t.id !== id; });
if (ptState.detailId === id) ptState.detailId = 0;
renderContent();
}
// ===== 任务详情 =====
function ptOpenDetail(id) { ptState.detailId = id; renderContent(); }
function ptCloseDetail() { ptState.detailId = 0; renderContent(); }
// ===== 新建 / 编辑抽屉 =====
function ptOpenCreateDrawer() {
ptState.drawer = { mode: 'create', id: null };
ptState.draft = {
id: null, name: '', categoryId: ptState.selectedCategoryId || adminProjCategories[0].id,
difficultyValue: 40, status: '启用', tagIds: [],
requirements: '', deliverables: [''], acceptance: [''], attachments: []
};
ptState.calibration = null;
ptState.newTagInline = '';
renderContent();
}
function ptOpenEditDrawer(id) {
var t = null;
for (var i = 0; i < adminProjTasks.length; i++) if (adminProjTasks[i].id === id) t = adminProjTasks[i];
if (!t) return;
ptState.drawer = { mode: 'edit', id: id };
ptState.draft = {
id: t.id, name: t.name, categoryId: t.categoryId,
difficultyValue: t.difficultyValue, status: t.status,
tagIds: (t.tagIds || []).slice(),
requirements: t.requirements,
deliverables: (t.deliverables || []).slice(),
acceptance: (t.acceptance || []).slice(),
attachments: (t.attachments || []).slice()
};
ptState.calibration = null;
ptState.newTagInline = '';
renderContent();
}
function ptCloseDrawer() { ptState.drawer = null; ptState.draft = null; ptState.calibration = null; renderContent(); }
function ptSetDraft(field, v) { if (ptState.draft) ptState.draft[field] = v; if (field === 'difficultyValue') renderContent(); }
function ptSetDeliverable(i, v) { if (ptState.draft) ptState.draft.deliverables[i] = v; }
function ptAddDeliverable() { if (ptState.draft) ptState.draft.deliverables.push(''); renderContent(); }
function ptRemoveDeliverable(i) { if (ptState.draft) ptState.draft.deliverables.splice(i, 1); renderContent(); }
function ptSetAcceptance(i, v) { if (ptState.draft) ptState.draft.acceptance[i] = v; }
function ptAddAcceptance() { if (ptState.draft) ptState.draft.acceptance.push(''); renderContent(); }
function ptRemoveAcceptance(i) { if (ptState.draft) ptState.draft.acceptance.splice(i, 1); renderContent(); }
function ptAddAttachment() {
if (!ptState.draft) return;
ptState.draft.attachments.push('任务附件_' + (ptState.draft.attachments.length + 1) + '.pdf');
renderContent();
}
function ptRemoveAttachment(i) { if (ptState.draft) ptState.draft.attachments.splice(i, 1); renderContent(); }
function ptToggleDraftTag(tagId) {
if (!ptState.draft) return;
var arr = ptState.draft.tagIds;
var i = arr.indexOf(tagId);
if (i === -1) arr.push(tagId); else arr.splice(i, 1);
renderContent();
}
function ptSetNewTagInline(v) { ptState.newTagInline = v; }
function ptCreateTagInline() {
var name = (ptState.newTagInline || '').trim();
if (!name) { alert('请输入知识点标签名称'); return; }
if (typeof adminKtTags === 'undefined') { alert('知识点标签模块未加载'); return; }
var maxId = 0;
for (var i = 0; i < adminKtTags.length; i++) if (adminKtTags[i].id > maxId) maxId = adminKtTags[i].id;
var newId = maxId + 1;
adminKtTags.push({ id: newId, name: name, source: 'manual', questionCount: 0, taskCount: 0, status: '启用', categoryId: adminKtTags[0] ? adminKtTags[0].categoryId : 0, materials: [] });
ptState.draft.tagIds.push(newId);
ptState.newTagInline = '';
renderContent();
}
// ===== AI 任务难度校准 =====
function ptRunCalibration() {
if (!ptState.draft) return;
var base = Number(ptState.draft.difficultyValue) || 40;
var seed = (ptState.draft.requirements || '').length;
var value = Math.max(10, Math.min(95, Math.round((base * 0.6 + seed * 0.35 + 12) % 100)));
var modules = PT_CALIBRATION_MODULES.map(function(m, i) {
return { name: m, aiValue: Math.max(10, Math.min(100, Math.round(value * (0.85 + i * 0.08)))), manualValue: 0 };
});
ptState.calibration = { suggestion: { value: value, level: ptLevelOf(value).level }, modules: modules };
renderContent();
}
function ptSetModuleManual(i, v) {
if (!ptState.calibration) return;
ptState.calibration.modules[i].manualValue = Number(v) || 0;
}
function ptApplyCalibration() {
if (!ptState.calibration || !ptState.draft) return;
var ms = ptState.calibration.modules;
var manualAvg = 0, cnt = 0;
ms.forEach(function(m) { if (m.manualValue > 0) { manualAvg += m.manualValue; cnt++; } });
var finalValue = cnt ? Math.round(manualAvg / cnt) : ptState.calibration.suggestion.value;
ptState.draft.difficultyValue = finalValue;
ptState.calibration.applied = { value: finalValue, level: ptLevelOf(finalValue).level };
renderContent();
}
function ptSaveCalibrationToTask() {
if (!ptState.calibration || !ptState.drawer || ptState.drawer.mode !== 'edit') { alert('请先保存任务后再归档校准记录'); return; }
var t = null;
for (var i = 0; i < adminProjTasks.length; i++) if (adminProjTasks[i].id === ptState.drawer.id) t = adminProjTasks[i];
if (!t) return;
t.calibrationHistory = t.calibrationHistory || [];
t.calibrationHistory.unshift({
time: '2026-10-08 13:30',
aiValue: ptState.calibration.suggestion.value,
aiLevel: ptState.calibration.suggestion.level,
manualValue: t.difficultyValue,
manualLevel: ptLevelOf(t.difficultyValue).level,
state: '已校准'
});
t.aiCalibrated = true;
alert('校准记录已归档到该任务');
renderContent();
}
function ptOpenHistory(id) { ptState.historyId = id; renderContent(); }
function ptCloseHistory() { ptState.historyId = 0; renderContent(); }
function ptSaveTask() {
var d = ptState.draft;
if (!d) return;
if (!String(d.name || '').trim()) { alert('请填写任务名称'); return; }
if (!String(d.requirements || '').trim()) { alert('请填写任务要求'); return; }
var clean = function(arr) { return (arr || []).map(function(x) { return String(x || '').trim(); }).filter(function(x) { return !!x; }); };
var payload = {
id: d.id || ptNextTaskId(),
name: d.name.trim(),
categoryId: d.categoryId,
difficultyValue: Number(d.difficultyValue) || 40,
level: ptLevelOf(Number(d.difficultyValue) || 40).level,
status: d.status,
tagIds: d.tagIds.slice(),
requirements: d.requirements.trim(),
deliverables: clean(d.deliverables),
acceptance: clean(d.acceptance),
attachments: d.attachments.slice(),
learners: 0,
aiCalibrated: false,
calibrationHistory: []
};
if (ptState.drawer.mode === 'create') {
adminProjTasks.unshift(payload);
} else {
adminProjTasks.forEach(function(t) {
if (t.id === d.id) {
payload.learners = t.learners;
payload.aiCalibrated = t.aiCalibrated;
payload.calibrationHistory = t.calibrationHistory || [];
payload.level = ptLevelOf(payload.difficultyValue).level;
Object.keys(payload).forEach(function(k) { t[k] = payload[k]; });
}
});
}
ptCloseDrawer();
}
function ptExportList() { alert('已导出任务列表(原型演示)'); }
// ===== 片段构造 =====
function ptBuildCategoryTreeHtml() {
var rows = '<div class="px-3 py-2 rounded-lg cursor-pointer flex items-center justify-between text-sm ' + (ptState.selectedCategoryId === 0 ? 'bg-[#E8F3FF] text-[#165DFF]' : 'hover:bg-[#F7F8FA] text-[#4E5969]') + '" onclick="ptSelectCategory(0)">' +
'<div class="flex items-center gap-2"><svg class="w-4 h-4" data-lucide="layers"></svg><span class="font-medium">全部任务分类</span></div>' +
'<span class="text-xs text-[#86909C]">' + adminProjTasks.length + '</span></div>';
rows += adminProjCategories.map(function(c) {
var active = ptState.selectedCategoryId === c.id;
if (ptState.renamingCategoryId === c.id) {
return '<div class="px-3 py-2 rounded-lg bg-[#F7F8FA] flex items-center gap-1">' +
'<input class="input-field text-xs py-1" value="' + ptEsc(ptState.renameDraft) + '" oninput="ptSetRenameDraft(this.value)">' +
'<button class="p-1 text-emerald-600" onclick="ptSaveRenameCategory(' + c.id + ')"><svg class="w-4 h-4" data-lucide="check"></svg></button>' +
'<button class="p-1 text-[#86909C]" onclick="ptCancelRenameCategory()"><svg class="w-4 h-4" data-lucide="x"></svg></button></div>';
}
var count = adminProjTasks.filter(function(t) { return t.categoryId === c.id; }).length;
return '<div class="px-3 py-2 rounded-lg cursor-pointer group flex items-center justify-between text-sm ' + (active ? 'bg-[#E8F3FF] text-[#165DFF]' : 'hover:bg-[#F7F8FA] text-[#4E5969]') + '" onclick="ptSelectCategory(' + c.id + ')">' +
'<div class="flex items-center gap-2 min-w-0"><svg class="w-4 h-4 flex-shrink-0" data-lucide="folder"></svg><span class="truncate">' + ptEsc(c.name) + '</span></div>' +
'<div class="flex items-center gap-2 flex-shrink-0"><span class="text-xs ' + (active ? 'text-[#165DFF]' : 'text-[#86909C]') + '">' + count + '</span>' +
'<button class="hidden group-hover:block p-0.5 text-[#86909C] hover:text-[#165DFF]" onclick="event.stopPropagation();ptStartRenameCategory(' + c.id + ')"><svg class="w-3.5 h-3.5" data-lucide="pencil"></svg></button>' +
'<button class="hidden group-hover:block p-0.5 text-[#86909C] hover:text-[#F53F3F]" onclick="event.stopPropagation();ptDeleteCategory(' + c.id + ')"><svg class="w-3.5 h-3.5" data-lucide="trash-2"></svg></button></div></div>';
}).join('');
var addBox = ptState.addingCategory
? '<div class="mt-2 flex gap-1"><input class="input-field text-xs py-1.5" placeholder="分类名称" value="' + ptEsc(ptState.newCategoryName) + '" oninput="ptSetNewCategoryName(this.value)"><button class="btn-primary text-xs px-3 py-1.5" onclick="ptConfirmAddCategory()">确定</button><button class="btn-outline text-xs px-3 py-1.5" onclick="ptToggleAddCategory()">取消</button></div>'
: '<button class="mt-2 w-full flex items-center justify-center gap-1 py-2 text-xs text-[#165DFF] border border-dashed border-[#165DFF]/40 rounded-lg hover:bg-[#E8F3FF]" onclick="ptToggleAddCategory()"><svg class="w-3.5 h-3.5" data-lucide="plus"></svg>新增任务分类</button>';
return '<div class="feature-card p-3 h-fit"><div class="px-1 mb-3 text-xs font-semibold text-[#86909C]">任务分类</div>' +
'<div class="space-y-1">' + rows + '</div>' + addBox + '</div>';
}
function ptBuildFilterBarHtml() {
var tagOptions = '<option value="0"' + (ptState.tagFilter === 0 ? ' selected' : '') + '>全部知识点标签</option>' +
ptTagList().map(function(t) {
return '<option value="' + t.id + '"' + (ptState.tagFilter === t.id ? ' selected' : '') + '>' + ptEsc(t.name) + '</option>';
}).join('');
return '<div class="feature-card p-4 mb-4">' +
'<div class="flex items-center gap-3 flex-wrap">' +
'<div class="relative flex-1 min-w-[240px]">' +
'<svg class="w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2 text-[#C9CDD4]" data-lucide="search"></svg>' +
'<input class="input-field pl-9 text-sm" placeholder="搜索任务名称 / 核心知识点标签" value="' + ptEsc(ptState.keyword) + '" oninput="ptSetKeyword(this.value)">' +
'</div>' +
'<select class="input-field w-32 text-sm" onchange="ptSetLevelFilter(this.value)">' +
'<option value="all"' + (ptState.levelFilter === 'all' ? ' selected' : '') + '>全部难度</option>' +
PT_LEVELS.map(function(l) { return '<option value="' + l.level + '"' + (ptState.levelFilter === l.level ? ' selected' : '') + '>' + l.level + ' ' + l.name + '</option>'; }).join('') +
'</select>' +
'<select class="input-field w-44 text-sm" onchange="ptSetTagFilter(this.value)">' + tagOptions + '</select>' +
'<select class="input-field w-28 text-sm" onchange="ptSetStatusFilter(this.value)">' +
'<option value="all"' + (ptState.statusFilter === 'all' ? ' selected' : '') + '>全部状态</option>' +
'<option value="启用"' + (ptState.statusFilter === '启用' ? ' selected' : '') + '>启用</option>' +
'<option value="禁用"' + (ptState.statusFilter === '禁用' ? ' selected' : '') + '>禁用</option>' +
'</select>' +
'<button class="btn-primary text-sm" onclick="ptDoSearch()"><svg class="w-4 h-4 mr-1" data-lucide="search"></svg>检索</button>' +
'<button class="btn-outline text-sm" onclick="ptResetFilter()">重置</button>' +
'<button class="btn-outline text-sm" onclick="ptRefresh()"><svg class="w-4 h-4 mr-1" data-lucide="refresh-cw"></svg>刷新</button>' +
'<button class="btn-primary text-sm ml-auto" onclick="ptOpenCreateDrawer()"><svg class="w-4 h-4 mr-1.5" data-lucide="plus"></svg>创建任务</button>' +
'</div>' +
'</div>';
}
function ptBuildTableHtml() {
var list = ptVisibleTasks();
if (!list.length) {
return '<div class="feature-card p-12 text-center"><svg class="w-12 h-12 mx-auto mb-3 text-[#C9CDD4]" data-lucide="inbox"></svg><p class="text-[#86909C]">没有符合筛选条件的任务</p></div>';
}
var rows = list.map(function(t) {
var tags = (t.tagIds || []).map(function(id) {
return '<span class="inline-block px-2 py-0.5 bg-[#F2F3F5] text-[#4E5969] text-xs rounded mr-1 mb-1">' + ptEsc(ptTagName(id)) + '</span>';
}).join('') || '<span class="text-xs text-[#C9CDD4]">未挂载标签</span>';
var statusCls = t.status === '启用' ? 'bg-emerald-100 text-emerald-700' : 'bg-gray-100 text-gray-500';
return '<tr class="border-b border-[#E5E6EB] hover:bg-[#F7F8FA]">' +
'<td class="px-4 py-3"><div class="font-medium text-[#1D2129] cursor-pointer hover:text-[#165DFF]" onclick="ptOpenDetail(' + t.id + ')">' + ptEsc(t.name) + '</div>' +
'<div class="text-xs text-[#86909C] mt-0.5">' + ptEsc(ptCategoryName(t.categoryId)) + ' · ' + t.learners + ' 人进行中</div></td>' +
'<td class="px-4 py-3"><span class="px-2 py-0.5 ' + ptLevelCls(t.level) + ' text-xs rounded font-medium">' + t.level + '</span>' +
'<div class="text-xs text-[#86909C] mt-1">难度值 ' + t.difficultyValue + (t.aiCalibrated ? ' · <span class="text-violet-600">已校准</span>' : ' · <span class="text-amber-600">待校准</span>') + '</div></td>' +
'<td class="px-4 py-3 max-w-[220px]">' + tags + '</td>' +
'<td class="px-4 py-3"><span class="badge ' + statusCls + '">' + t.status + '</span></td>' +
'<td class="px-4 py-3 text-xs text-[#4E5969]">' +
'<div>交付产物 ' + (t.deliverables || []).length + ' 项 · 验收要求 ' + (t.acceptance || []).length + ' 条</div>' +
'<div class="text-[#86909C] mt-0.5">附件 ' + (t.attachments || []).length + ' 个</div></td>' +
'<td class="px-4 py-3"><div class="flex items-center gap-2 text-xs whitespace-nowrap">' +
'<button class="text-[#165DFF] hover:underline" onclick="ptOpenEditDrawer(' + t.id + ')">编辑</button>' +
'<button class="text-violet-600 hover:underline" onclick="ptOpenHistory(' + t.id + ')">校准历史</button>' +
'<button class="text-[#86909C] hover:text-[#165DFF]" onclick="ptToggleStatus(' + t.id + ')">' + (t.status === '启用' ? '禁用' : '启用') + '</button>' +
'<button class="text-[#F53F3F] hover:underline" onclick="ptDeleteTask(' + t.id + ')">删除</button>' +
'</div></td></tr>';
}).join('');
return '<div class="feature-card overflow-hidden">' +
'<table class="table-base"><thead><tr>' +
'<th>任务名称</th><th class="w-32">任务难度</th><th class="w-56">核心知识点标签</th><th class="w-20">状态</th><th class="w-40">任务信息概览</th><th class="w-64">操作</th>' +
'</tr></thead><tbody>' + rows + '</tbody></table>' +
'<div class="px-4 py-3 text-xs text-[#86909C]">共 ' + list.length + ' 个任务(点击任务名称查看完整任务信息)</div>' +
'</div>';
}
function ptBuildDetailHtml() {
if (!ptState.detailId) return '';
var t = null;
for (var i = 0; i < adminProjTasks.length; i++) if (adminProjTasks[i].id === ptState.detailId) t = adminProjTasks[i];
if (!t) return '';
var listBlock = function(title, arr) {
if (!arr || !arr.length) return '<div class="text-sm text-[#C9CDD4]">' + title + ':无</div>';
return '<div><div class="text-xs text-[#86909C] mb-1">' + title + '</div><ol class="list-decimal pl-5 space-y-1 text-sm text-[#1D2129]">' +
arr.map(function(x) { return '<li>' + ptEsc(x) + '</li>'; }).join('') + '</ol></div>';
};
var attach = (t.attachments || []).length
? t.attachments.map(function(a) { return '<div class="flex items-center gap-2 text-sm text-[#4E5969]"><svg class="w-4 h-4 text-[#86909C]" data-lucide="paperclip"></svg>' + ptEsc(a) + '</div>'; }).join('')
: '<div class="text-sm text-[#C9CDD4]">未上传附件(选填)</div>';
var tags = (t.tagIds || []).map(function(id) { return '<span class="inline-block px-2 py-1 bg-[#F2F3F5] text-[#4E5969] text-xs rounded mr-2">' + ptEsc(ptTagName(id)) + '</span>'; }).join('') || '未挂载';
return '<div class="fixed inset-0 z-50">' +
'<div class="absolute inset-0 bg-black/50" onclick="ptCloseDetail()"></div>' +
'<div class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-full max-w-2xl">' +
'<div class="bg-white rounded-xl shadow-2xl overflow-hidden">' +
'<div class="px-5 py-4 border-b border-[#E5E6EB] flex items-center justify-between">' +
'<div><h3 class="font-bold text-[#1D2129]">' + ptEsc(t.name) + '</h3>' +
'<p class="text-xs text-[#86909C] mt-1">' + ptEsc(ptCategoryName(t.categoryId)) + ' · <span class="px-1.5 py-0.5 ' + ptLevelCls(t.level) + ' rounded">' + t.level + '</span> · 难度值 ' + t.difficultyValue + '</p></div>' +
'<button onclick="ptCloseDetail()"><svg class="w-5 h-5 text-[#86909C]" data-lucide="x"></svg></button>' +
'</div>' +
'<div class="p-5 space-y-4">' +
'<div><div class="text-xs text-[#86909C] mb-1">任务要求</div><div class="text-sm text-[#1D2129] leading-relaxed">' + ptEsc(t.requirements) + '</div></div>' +
listBlock('交付产物清单', t.deliverables) +
listBlock('验收要求', t.acceptance) +
'<div><div class="text-xs text-[#86909C] mb-1">任务附件</div>' + attach + '</div>' +
'<div><div class="text-xs text-[#86909C] mb-1">知识点标签</div><div>' + tags + '</div></div>' +
'</div>' +
'<div class="px-5 py-4 border-t border-[#E5E6EB] flex items-center justify-end gap-3">' +
'<button class="btn-outline" onclick="ptCloseDetail()">关闭</button>' +
'<button class="btn-primary" onclick="ptCloseDetail();ptOpenEditDrawer(' + t.id + ')">编辑任务</button>' +
'</div>' +
'</div>' +
'</div>' +
'</div>';
}
function ptBuildCalibrationHtml() {
if (!ptState.draft) return '';
var d = ptState.draft;
var lv = ptLevelOf(Number(d.difficultyValue) || 0);
var cal = ptState.calibration;
var modules = '';
if (cal) {
modules = '<div class="mt-3 border border-[#E5E6EB] rounded-lg p-3 bg-white">' +
'<div class="flex items-center justify-between mb-2">' +
'<div class="text-sm text-[#1D2129]">AI 建议难度:<span class="font-semibold text-violet-600">' + cal.suggestion.level + ' · ' + cal.suggestion.value + ' 分</span></div>' +
'<button class="btn-primary text-xs px-3 py-1.5" onclick="ptApplyCalibration()">应用人工校准</button>' +
'</div>' +
'<div class="text-xs text-[#86909C] mb-2">分模块校准(可人工调整,留空则不参与计算)</div>' +
cal.modules.map(function(m, i) {
return '<div class="flex items-center gap-3 mb-2 text-sm">' +
'<span class="w-28 text-[#4E5969]">' + m.name + '</span>' +
'<span class="text-xs text-violet-600 w-16">AI ' + m.aiValue + '</span>' +
'<input type="number" class="input-field text-sm w-24" placeholder="人工值" value="' + (m.manualValue || '') + '" oninput="ptSetModuleManual(' + i + ', this.value)">' +
'</div>';
}).join('') +
(cal.applied ? '<div class="mt-2 text-xs text-emerald-600">已应用人工校准:' + cal.applied.level + ' · ' + cal.applied.value + ' 分</div>' : '') +
'<button class="btn-outline text-xs w-full mt-2" onclick="ptSaveCalibrationToTask()">归档为校准记录</button>' +
'</div>';
}
return '<div class="bg-white rounded-lg border border-[#E5E6EB] p-4">' +
'<div class="flex items-center justify-between mb-3">' +
'<div class="text-sm font-medium text-[#1D2129]">任务难度</div>' +
'<button class="btn-outline text-xs px-3 py-1.5" onclick="ptRunCalibration()"><svg class="w-3.5 h-3.5 mr-1" data-lucide="sparkles"></svg>AI 难度校准</button>' +
'</div>' +
'<div class="flex items-center gap-3">' +
'<span class="px-2 py-0.5 ' + lv.cls + ' text-xs rounded font-medium">' + lv.level + '</span>' +
'<input type="range" min="0" max="100" class="flex-1" value="' + d.difficultyValue + '" oninput="ptSetDraft(\'difficultyValue\', this.value)">' +
'<span class="text-sm text-[#4E5969] w-12 text-right">' + d.difficultyValue + '</span>' +
'</div>' +
'<div class="text-xs text-[#86909C] mt-2">可直接拖动人工定义难度值:L1(0-39)/L2(40-69)/L3(70-100)。AI 难度需人工校准后方可生效。</div>' +
modules +
'</div>';
}
function ptBuildDrawerHtml() {
if (!ptState.drawer || !ptState.draft) return '';
var d = ptState.draft;
var isEdit = ptState.drawer.mode === 'edit';
var tagBox = ptTagList().map(function(t) {
var on = d.tagIds.indexOf(t.id) !== -1;
return '<span class="inline-block px-2 py-1 text-xs rounded border cursor-pointer mr-2 mb-2 ' + (on ? 'bg-[#E8F3FF] text-[#165DFF] border-[#165DFF]/30' : 'bg-white text-[#4E5969] border-[#E5E6EB]') + '" onclick="ptToggleDraftTag(' + t.id + ')">' + ptEsc(t.name) + '</span>';
}).join('') || '<span class="text-xs text-[#C9CDD4]">暂无标签</span>';
var listEditor = function(title, arr, setter, adder, remover) {
return '<div class="mb-4"><div class="flex items-center justify-between mb-1">' +
'<label class="text-xs text-[#86909C]">' + title + '</label>' +
'<button class="text-xs text-[#165DFF] hover:underline" onclick="' + adder + '()">+ 添加一项</button></div>' +
arr.map(function(v, i) {
return '<div class="flex items-center gap-2 mb-2"><input class="input-field text-sm" value="' + ptEsc(v) + '" oninput="' + setter + '(' + i + ', this.value)">' +
'<button class="text-[#F53F3F] text-xs hover:underline" onclick="' + remover + '(' + i + ')">删除</button></div>';
}).join('') + '</div>';
};
return '<div class="fixed inset-0 z-50">' +
'<div class="absolute inset-0 bg-black/40" onclick="ptCloseDrawer()"></div>' +
'<div class="absolute right-0 top-0 h-full w-[620px] bg-[#F2F3F5] shadow-2xl flex flex-col">' +
'<div class="px-5 py-4 bg-white border-b border-[#E5E6EB] flex items-center justify-between">' +
'<h3 class="font-bold text-[#1D2129]">' + (isEdit ? '编辑任务' : '创建任务') + '</h3>' +
'<button onclick="ptCloseDrawer()"><svg class="w-5 h-5 text-[#86909C]" data-lucide="x"></svg></button>' +
'</div>' +
'<div class="flex-1 overflow-y-auto p-5 space-y-4">' +
'<div class="bg-white rounded-lg border border-[#E5E6EB] p-4">' +
'<label class="block text-xs text-[#86909C] mb-1">任务名称 <span class="text-[#F53F3F]">*</span></label>' +
'<input class="input-field mb-3" value="' + ptEsc(d.name) + '" placeholder="如:模型部署实战" oninput="ptSetDraft(\'name\', this.value)">' +
'<div class="grid grid-cols-2 gap-3">' +
'<div><label class="block text-xs text-[#86909C] mb-1">所属分类</label>' +
'<select class="input-field text-sm" onchange="ptSetDraft(\'categoryId\', Number(this.value))">' +
adminProjCategories.map(function(c) { return '<option value="' + c.id + '"' + (d.categoryId === c.id ? ' selected' : '') + '>' + ptEsc(c.name) + '</option>'; }).join('') +
'</select></div>' +
'<div><label class="block text-xs text-[#86909C] mb-1">状态</label>' +
'<select class="input-field text-sm" onchange="ptSetDraft(\'status\', this.value)">' +
'<option value="启用"' + (d.status === '启用' ? ' selected' : '') + '>启用</option>' +
'<option value="禁用"' + (d.status === '禁用' ? ' selected' : '') + '>禁用</option>' +
'</select></div>' +
'</div>' +
'</div>' +
'<div class="bg-white rounded-lg border border-[#E5E6EB] p-4">' +
'<div class="text-sm font-medium text-[#1D2129] mb-1">任务信息</div>' +
'<label class="block text-xs text-[#86909C] mb-1">任务要求 <span class="text-[#F53F3F]">*</span></label>' +
'<textarea class="input-field min-h-[80px] resize-none text-sm mb-3" placeholder="描述任务要做什么" oninput="ptSetDraft(\'requirements\', this.value)">' + ptEsc(d.requirements) + '</textarea>' +
listEditor('交付产物清单', d.deliverables, 'ptSetDeliverable', 'ptAddDeliverable', 'ptRemoveDeliverable') +
listEditor('验收要求', d.acceptance, 'ptSetAcceptance', 'ptAddAcceptance', 'ptRemoveAcceptance') +
'<div><div class="flex items-center justify-between mb-1">' +
'<label class="text-xs text-[#86909C]">上传任务附件(选填)</label>' +
'<button class="text-xs text-[#165DFF] hover:underline" onclick="ptAddAttachment()">+ 上传附件</button></div>' +
((d.attachments || []).length
? d.attachments.map(function(a, i) {
return '<div class="flex items-center justify-between px-3 py-2 border border-[#E5E6EB] rounded-lg mb-2 text-sm">' +
'<span class="flex items-center gap-2"><svg class="w-4 h-4 text-[#86909C]" data-lucide="paperclip"></svg>' + ptEsc(a) + '</span>' +
'<button class="text-[#F53F3F] text-xs hover:underline" onclick="ptRemoveAttachment(' + i + ')">删除</button></div>';
}).join('')
: '<div class="text-xs text-[#C9CDD4] px-3 py-2 border border-dashed border-[#E5E6EB] rounded-lg">暂无附件</div>') +
'</div>' +
'</div>' +
'<div class="bg-white rounded-lg border border-[#E5E6EB] p-4">' +
'<div class="flex items-center justify-between mb-2">' +
'<label class="text-sm font-medium text-[#1D2129]">该任务的知识点标签</label>' +
'<button class="text-xs text-[#165DFF] hover:underline" onclick="switchPage(\'admin-knowledge-tags\')">前往标签管理</button>' +
'</div>' +
'<div>' + tagBox + '</div>' +
'<div class="mt-3 p-3 bg-[#F7F8FA] rounded-lg">' +
'<div class="text-xs text-[#86909C] mb-2">未找到合适标签?可直接新建(也可从实操任务 AI 提取,见标签管理页)</div>' +
'<div class="flex gap-2"><input class="input-field text-sm flex-1" placeholder="输入新标签名称" value="' + ptEsc(ptState.newTagInline) + '" oninput="ptSetNewTagInline(this.value)">' +
'<button class="btn-primary text-sm" onclick="ptCreateTagInline()">新建并选中</button></div>' +
'</div>' +
'</div>' +
ptBuildCalibrationHtml() +
'</div>' +
'<div class="px-5 py-4 bg-white border-t border-[#E5E6EB] flex items-center justify-end gap-3">' +
'<button class="btn-outline" onclick="ptCloseDrawer()">取消</button>' +
'<button class="btn-primary" onclick="ptSaveTask()">' + (isEdit ? '保存修改' : '创建任务') + '</button>' +
'</div>' +
'</div>' +
'</div>';
}
function ptBuildHistoryHtml() {
if (!ptState.historyId) return '';
var t = null;
for (var i = 0; i < adminProjTasks.length; i++) if (adminProjTasks[i].id === ptState.historyId) t = adminProjTasks[i];
if (!t) return '';
var history = (t.calibrationHistory || []);
var rows = history.length ? history.map(function(h) {
var stateCls = h.state === '已校准' ? 'bg-emerald-100 text-emerald-700' : 'bg-amber-100 text-amber-700';
return '<tr class="border-b border-[#E5E6EB]">' +
'<td class="px-4 py-3 text-xs text-[#4E5969]">' + h.time + '</td>' +
'<td class="px-4 py-3 text-sm">' + h.aiLevel + ' · ' + h.aiValue + ' 分</td>' +
'<td class="px-4 py-3 text-sm">' + h.manualLevel + ' · ' + h.manualValue + ' 分</td>' +
'<td class="px-4 py-3"><span class="badge ' + stateCls + '">' + h.state + '</span></td></tr>';
}).join('') : '<tr><td colspan="4" class="px-4 py-8 text-center text-sm text-[#86909C]">暂无校准记录</td></tr>';
return '<div class="fixed inset-0 z-50">' +
'<div class="absolute inset-0 bg-black/50" onclick="ptCloseHistory()"></div>' +
'<div class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-full max-w-2xl">' +
'<div class="bg-white rounded-xl shadow-2xl overflow-hidden">' +
'<div class="px-5 py-4 border-b border-[#E5E6EB] flex items-center justify-between">' +
'<div><h3 class="font-bold text-[#1D2129]">难度校准历史</h3><p class="text-xs text-[#86909C] mt-1">' + ptEsc(t.name) + ' · 当前 ' + t.level + ' · ' + t.difficultyValue + ' 分</p></div>' +
'<button onclick="ptCloseHistory()"><svg class="w-5 h-5 text-[#86909C]" data-lucide="x"></svg></button>' +
'</div>' +
'<div class="max-h-[380px] overflow-y-auto">' +
'<table class="table-base"><thead><tr><th>校准时间</th><th>AI 建议难度</th><th>人工校准结果</th><th>状态</th></tr></thead><tbody>' + rows + '</tbody></table>' +
'</div>' +
'<div class="px-5 py-4 border-t border-[#E5E6EB] flex items-center justify-end gap-3">' +
'<button class="btn-outline" onclick="ptCloseHistory()">关闭</button>' +
'<button class="btn-primary" onclick="ptCloseHistory();ptOpenEditDrawer(' + t.id + ')">前往校准</button>' +
'</div>' +
'</div>' +
'</div>' +
'</div>';
}
pageRenderers["admin-projects"] = function() {
var total = adminProjTasks.length;
var enabled = adminProjTasks.filter(function(t) { return t.status === '启用'; }).length;
var calibrated = adminProjTasks.filter(function(t) { return t.aiCalibrated; }).length;
var noTag = adminProjTasks.filter(function(t) { return !(t.tagIds || []).length; }).length;
return `
<div class="max-w-[1500px] mx-auto">
<div class="flex items-center justify-between mb-6">
<div class="flex items-center gap-4">
<button class="btn-ghost p-2 rounded-lg hover:bg-[#F2F3F5]" onclick="switchPage('admin-dashboard')">
......@@ -15,308 +669,37 @@ pageRenderers["admin-projects"] = function() { return `
</div>
<div>
<h2 class="text-xl font-bold text-[#1D2129]">实操任务库</h2>
<p class="text-sm text-[#86909C]">管理全行业通用的实操任务模板</p>
<p class="text-sm text-[#86909C]">管理全行业通用的实操任务模板 · 任务难度支持 AI 建议 + 人工校准</p>
</div>
</div>
<div class="flex items-center gap-3">
<button class="btn-outline text-sm">
<button class="btn-outline text-sm" onclick="ptExportList()">
<svg class="w-4 h-4 mr-1.5" data-lucide="download"></svg>
导出列表
</button>
<button class="btn-primary text-sm">
<button class="btn-primary text-sm" onclick="ptOpenCreateDrawer()">
<svg class="w-4 h-4 mr-1.5" data-lucide="plus"></svg>
新增任务
</button>
</div>
</div>
<!-- 行业统计卡片 -->
<div class="grid grid-cols-4 gap-4 mb-6">
<div class="feature-card p-4">
<div class="flex items-center gap-3">
<div class="w-10 h-10 rounded-lg bg-[#E8F3FF] flex items-center justify-center">
<svg class="w-5 h-5 text-[#165DFF]" data-lucide="database"></svg>
</div>
<div>
<div class="text-2xl font-bold text-[#1D2129]">24</div>
<div class="text-xs text-[#86909C]">数据标注行业</div>
</div>
</div>
</div>
<div class="feature-card p-4">
<div class="flex items-center gap-3">
<div class="w-10 h-10 rounded-lg bg-emerald-50 flex items-center justify-center">
<svg class="w-5 h-5 text-emerald-600" data-lucide="factory"></svg>
</div>
<div>
<div class="text-2xl font-bold text-[#1D2129]">18</div>
<div class="text-xs text-[#86909C]">智能制造行业</div>
</div>
</div>
</div>
<div class="feature-card p-4">
<div class="flex items-center gap-3">
<div class="w-10 h-10 rounded-lg bg-violet-50 flex items-center justify-center">
<svg class="w-5 h-5 text-violet-600" data-lucide="palette"></svg>
</div>
<div>
<div class="text-2xl font-bold text-[#1D2129]">15</div>
<div class="text-xs text-[#86909C]">设计创意行业</div>
</div>
</div>
</div>
<div class="feature-card p-4">
<div class="flex items-center gap-3">
<div class="w-10 h-10 rounded-lg bg-amber-50 flex items-center justify-center">
<svg class="w-5 h-5 text-amber-600" data-lucide="message-square"></svg>
</div>
<div>
<div class="text-2xl font-bold text-[#1D2129]">21</div>
<div class="text-xs text-[#86909C]">客户服务行业</div>
</div>
</div>
</div>
<div class="feature-card p-4"><div class="flex items-center gap-3"><div class="w-10 h-10 rounded-lg bg-[#E8F3FF] flex items-center justify-center"><svg class="w-5 h-5 text-[#165DFF]" data-lucide="briefcase"></svg></div><div><div class="text-2xl font-bold text-[#1D2129]">${total}</div><div class="text-xs text-[#86909C]">任务总数</div></div></div></div>
<div class="feature-card p-4"><div class="flex items-center gap-3"><div class="w-10 h-10 rounded-lg bg-emerald-50 flex items-center justify-center"><svg class="w-5 h-5 text-emerald-600" data-lucide="check-circle"></svg></div><div><div class="text-2xl font-bold text-[#1D2129]">${enabled}</div><div class="text-xs text-[#86909C]">启用中任务</div></div></div></div>
<div class="feature-card p-4"><div class="flex items-center gap-3"><div class="w-10 h-10 rounded-lg bg-violet-50 flex items-center justify-center"><svg class="w-5 h-5 text-violet-600" data-lucide="sparkles"></svg></div><div><div class="text-2xl font-bold text-[#1D2129]">${calibrated}</div><div class="text-xs text-[#86909C]">已 AI 校准</div></div></div></div>
<div class="feature-card p-4"><div class="flex items-center gap-3"><div class="w-10 h-10 rounded-lg bg-amber-50 flex items-center justify-center"><svg class="w-5 h-5 text-amber-600" data-lucide="alert-circle"></svg></div><div><div class="text-2xl font-bold text-[#1D2129]">${noTag}</div><div class="text-xs text-[#86909C]">未挂载知识点标签</div></div></div></div>
</div>
<!-- Filter Bar -->
<div class="flex items-center gap-3 mb-6">
<input class="input-field w-48 text-sm" placeholder="搜索任务名称...">
<select class="input-field w-36 text-sm">
<option>全部行业</option>
<option>数据标注</option>
<option>智能制造</option>
<option>软件开发</option>
<option>设计创意</option>
<option>客户服务</option>
<option>文案写作</option>
</select>
<select class="input-field w-32 text-sm">
<option>全部类型</option>
<option>实操练习</option>
<option>项目实战</option>
<option>案例分析</option>
<option>模拟操作</option>
</select>
<select class="input-field w-32 text-sm">
<option>全部难度</option>
<option>L1 入门</option>
<option>L2 进阶</option>
<option>L3 高级</option>
</select>
<select class="input-field w-32 text-sm">
<option>全部状态</option>
<option>已发布</option>
<option>草稿</option>
<option>已下架</option>
</select>
</div>
<!-- Tasks Grid -->
<div class="grid grid-cols-3 gap-5">
<!-- Task Card 1: 数据标注 -->
<div class="feature-card p-5 hover:shadow-lg transition-all">
<div class="flex items-start justify-between mb-4">
<div class="flex items-center gap-3">
<div class="w-10 h-10 rounded-lg bg-[#E8F3FF] flex items-center justify-center">
<svg class="w-5 h-5 text-[#165DFF]" data-lucide="scan"></svg>
</div>
<div>
<div class="font-semibold text-[#1D2129]">Bounding Box 标注基础</div>
<div class="text-xs text-[#86909C]">数据标注 · 图像标注</div>
</div>
</div>
<span class="px-2 py-0.5 bg-emerald-100 text-emerald-700 text-xs font-medium rounded">L1</span>
</div>
<div class="flex flex-wrap gap-1.5 mb-3">
<span class="px-2 py-0.5 bg-[#F7F8FA] text-[#86909C] text-xs rounded">实操练习</span>
<span class="px-2 py-0.5 bg-[#F7F8FA] text-[#86909C] text-xs rounded">文件提交</span>
</div>
<p class="text-xs text-[#86909C] mb-4 leading-relaxed">完成50张图片的目标框选标注,掌握Bounding Box标注规范和技巧。</p>
<div class="flex items-center justify-between pt-4 border-t border-[#E5E6EB]">
<div class="flex items-center gap-4 text-xs text-[#86909C]">
<span class="flex items-center gap-1">
<svg class="w-3 h-3" data-lucide="users"></svg>
45 人进行中
</span>
</div>
<div class="flex gap-2">
<button class="text-xs text-[#165DFF] hover:underline">编辑</button>
<button class="text-xs text-[#86909C] hover:text-red-500">下架</button>
</div>
</div>
</div>
<!-- Task Card 2: 智能制造 -->
<div class="feature-card p-5 hover:shadow-lg transition-all">
<div class="flex items-start justify-between mb-4">
<div class="flex items-center gap-3">
<div class="w-10 h-10 rounded-lg bg-emerald-50 flex items-center justify-center">
<svg class="w-5 h-5 text-emerald-600" data-lucide="cog"></svg>
</div>
<div>
<div class="font-semibold text-[#1D2129]">设备点检实操</div>
<div class="text-xs text-[#86909C]">智能制造 · 设备维护</div>
</div>
</div>
<span class="px-2 py-0.5 bg-[#165DFF] text-white text-xs font-medium rounded">L2</span>
</div>
<div class="flex flex-wrap gap-1.5 mb-3">
<span class="px-2 py-0.5 bg-[#F7F8FA] text-[#86909C] text-xs rounded">模拟操作</span>
<span class="px-2 py-0.5 bg-[#F7F8FA] text-[#86909C] text-xs rounded">表单提交</span>
</div>
<p class="text-xs text-[#86909C] mb-4 leading-relaxed">学习设备日常点检流程,填写点检表,识别常见设备异常。</p>
<div class="flex items-center justify-between pt-4 border-t border-[#E5E6EB]">
<div class="flex items-center gap-4 text-xs text-[#86909C]">
<span class="flex items-center gap-1">
<svg class="w-3 h-3" data-lucide="users"></svg>
32 人进行中
</span>
</div>
<div class="flex gap-2">
<button class="text-xs text-[#165DFF] hover:underline">编辑</button>
<button class="text-xs text-[#86909C] hover:text-red-500">下架</button>
</div>
</div>
</div>
<!-- Task Card 3: 软件开发 -->
<div class="feature-card p-5 hover:shadow-lg transition-all">
<div class="flex items-start justify-between mb-4">
<div class="flex items-center gap-3">
<div class="w-10 h-10 rounded-lg bg-violet-50 flex items-center justify-center">
<svg class="w-5 h-5 text-violet-600" data-lucide="code"></svg>
</div>
<div>
<div class="font-semibold text-[#1D2129]">模型部署实战</div>
<div class="text-xs text-[#86909C]">软件开发 · AI工程化</div>
</div>
</div>
<span class="px-2 py-0.5 bg-violet-100 text-violet-700 text-xs font-medium rounded">L3</span>
</div>
<div class="flex flex-wrap gap-1.5 mb-3">
<span class="px-2 py-0.5 bg-[#F7F8FA] text-[#86909C] text-xs rounded">项目实战</span>
<span class="px-2 py-0.5 bg-[#F7F8FA] text-[#86909C] text-xs rounded">链接+代码</span>
</div>
<p class="text-xs text-[#86909C] mb-4 leading-relaxed">完成AI模型的部署上线,提供API接口服务,编写技术文档。</p>
<div class="flex items-center justify-between pt-4 border-t border-[#E5E6EB]">
<div class="flex items-center gap-4 text-xs text-[#86909C]">
<span class="flex items-center gap-1">
<svg class="w-3 h-3" data-lucide="users"></svg>
18 人进行中
</span>
</div>
<div class="flex gap-2">
<button class="text-xs text-[#165DFF] hover:underline">编辑</button>
<button class="text-xs text-[#86909C] hover:text-red-500">下架</button>
</div>
</div>
</div>
<!-- Task Card 4: 设计创意 -->
<div class="feature-card p-5 hover:shadow-lg transition-all">
<div class="flex items-start justify-between mb-4">
<div class="flex items-center gap-3">
<div class="w-10 h-10 rounded-lg bg-amber-50 flex items-center justify-center">
<svg class="w-5 h-5 text-amber-600" data-lucide="palette"></svg>
</div>
<div>
<div class="font-semibold text-[#1D2129]">海报设计实操</div>
<div class="text-xs text-[#86909C]">设计创意 · 平面设计</div>
</div>
</div>
<span class="px-2 py-0.5 bg-amber-100 text-amber-700 text-xs font-medium rounded">L2</span>
</div>
<div class="flex flex-wrap gap-1.5 mb-3">
<span class="px-2 py-0.5 bg-[#F7F8FA] text-[#86909C] text-xs rounded">实操练习</span>
<span class="px-2 py-0.5 bg-[#F7F8FA] text-[#86909C] text-xs rounded">文件提交</span>
</div>
<p class="text-xs text-[#86909C] mb-4 leading-relaxed">根据主题要求,完成一张活动海报设计,输出高清设计稿。</p>
<div class="flex items-center justify-between pt-4 border-t border-[#E5E6EB]">
<div class="flex items-center gap-4 text-xs text-[#86909C]">
<span class="flex items-center gap-1">
<svg class="w-3 h-3" data-lucide="users"></svg>
28 人进行中
</span>
</div>
<div class="flex gap-2">
<button class="text-xs text-[#165DFF] hover:underline">编辑</button>
<button class="text-xs text-[#86909C] hover:text-red-500">下架</button>
</div>
</div>
</div>
<!-- Task Card 5: 客户服务 -->
<div class="feature-card p-5 hover:shadow-lg transition-all">
<div class="flex items-start justify-between mb-4">
<div class="flex items-center gap-3">
<div class="w-10 h-10 rounded-lg bg-rose-50 flex items-center justify-center">
<svg class="w-5 h-5 text-rose-600" data-lucide="headphones"></svg>
</div>
<div>
<div class="font-semibold text-[#1D2129]">客户沟通话术演练</div>
<div class="text-xs text-[#86909C]">客户服务 · 沟通技巧</div>
</div>
</div>
<span class="px-2 py-0.5 bg-rose-100 text-rose-700 text-xs font-medium rounded">L1</span>
</div>
<div class="flex flex-wrap gap-1.5 mb-3">
<span class="px-2 py-0.5 bg-[#F7F8FA] text-[#86909C] text-xs rounded">模拟操作</span>
<span class="px-2 py-0.5 bg-[#F7F8FA] text-[#86909C] text-xs rounded">文本提交</span>
</div>
<p class="text-xs text-[#86909C] mb-4 leading-relaxed">针对常见客户问题,撰写标准沟通话术和应对方案。</p>
<div class="flex items-center justify-between pt-4 border-t border-[#E5E6EB]">
<div class="flex items-center gap-4 text-xs text-[#86909C]">
<span class="flex items-center gap-1">
<svg class="w-3 h-3" data-lucide="users"></svg>
22 人进行中
</span>
</div>
<div class="flex gap-2">
<button class="text-xs text-[#165DFF] hover:underline">编辑</button>
<button class="text-xs text-[#86909C] hover:text-red-500">下架</button>
</div>
</div>
</div>
<!-- Task Card 6: 文案写作 -->
<div class="feature-card p-5 hover:shadow-lg transition-all">
<div class="flex items-start justify-between mb-4">
<div class="flex items-center gap-3">
<div class="w-10 h-10 rounded-lg bg-teal-50 flex items-center justify-center">
<svg class="w-5 h-5 text-teal-600" data-lucide="pen-tool"></svg>
</div>
<div>
<div class="font-semibold text-[#1D2129]">产品文案撰写</div>
<div class="text-xs text-[#86909C]">文案写作 · 内容创作</div>
</div>
</div>
<span class="px-2 py-0.5 bg-teal-100 text-teal-700 text-xs font-medium rounded">L2</span>
</div>
<div class="flex flex-wrap gap-1.5 mb-3">
<span class="px-2 py-0.5 bg-[#F7F8FA] text-[#86909C] text-xs rounded">项目实战</span>
<span class="px-2 py-0.5 bg-[#F7F8FA] text-[#86909C] text-xs rounded">文档提交</span>
</div>
<p class="text-xs text-[#86909C] mb-4 leading-relaxed">为指定产品撰写推广文案,包括标题、正文和卖点提炼。</p>
<div class="flex items-center justify-between pt-4 border-t border-[#E5E6EB]">
<div class="flex items-center gap-4 text-xs text-[#86909C]">
<span class="flex items-center gap-1">
<svg class="w-3 h-3" data-lucide="users"></svg>
15 人进行中
</span>
</div>
<div class="flex gap-2">
<button class="text-xs text-[#165DFF] hover:underline">编辑</button>
<button class="text-xs text-[#86909C] hover:text-red-500">下架</button>
</div>
</div>
</div>
<!-- Add New Card -->
<div class="feature-card p-5 border-2 border-dashed border-[#E5E6EB] hover:border-[#165DFF] transition-colors flex flex-col items-center justify-center min-h-[200px] cursor-pointer group">
<div class="w-12 h-12 rounded-xl bg-[#F7F8FA] group-hover:bg-[#E8F3FF] flex items-center justify-center mb-3 transition-colors">
<svg class="w-6 h-6 text-[#C9CDD4] group-hover:text-[#165DFF] transition-colors" data-lucide="plus"></svg>
</div>
<span class="text-sm text-[#86909C] group-hover:text-[#165DFF] transition-colors">新增实操任务</span>
<div class="grid grid-cols-[260px_minmax(0,1fr)] gap-4">
${ptBuildCategoryTreeHtml()}
<div>
${ptBuildFilterBarHtml()}
${ptBuildTableHtml()}
</div>
</div>
</div>`; };
</div>
${ptBuildDrawerHtml()}
${ptBuildDetailHtml()}
${ptBuildHistoryHtml()}`;
};
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论