@ -6,23 +6,23 @@
< svg class = "decoration-lines" viewBox = "0 0 400 60" preserveAspectRatio = "xMidYMid slice" >
< defs >
< linearGradient id = "headerGrad" x1 = "0%" y1 = "0%" x2 = "100%" y2 = "0%" >
< stop offset = "0%" style = "stop-color: #2563eb;stop-opacity:0" / >
< stop offset = "50%" style = "stop-color: #2563eb;stop-opacity:0.3" / >
< stop offset = "100%" style = "stop-color: #2ba471;stop-opacity:0" / >
< stop offset = "0%" style = "stop-color: #2563eb; stop-opacity: 0" / >
< stop offset = "50%" style = "stop-color: #2563eb; stop-opacity: 0.3" / >
< stop offset = "100%" style = "stop-color: #2ba471; stop-opacity: 0" / >
< / linearGradient >
< / defs >
< line x1 = "0" y1 = "58" x2 = "400" y2 = "58" stroke = "url(#headerGrad)" stroke -width = " 1 " / >
< circle cx = "50" cy = "30" r = "3" fill = "#2563eb" opacity = "0.2" / >
< circle cx = "150" cy = "20" r = "2" fill = "#2ba471" opacity = "0.2" / >
< circle cx = "250" cy = "40" r = "2.5" fill = "#2563eb" opacity = "0.15" / >
< circle cx = "350" cy = "25" r = "2" fill = "#2ba471" opacity = "0.2" / >
< line x1 = "0" y1 = "58" x2 = "400" y2 = "58" stroke = "url(#headerGrad)" stroke -width = " 1 " / >
< circle cx = "50" cy = "30" r = "3" fill = "#2563eb" opacity = "0.2" / >
< circle cx = "150" cy = "20" r = "2" fill = "#2ba471" opacity = "0.2" / >
< circle cx = "250" cy = "40" r = "2.5" fill = "#2563eb" opacity = "0.15" / >
< circle cx = "350" cy = "25" r = "2" fill = "#2ba471" opacity = "0.2" / >
< / svg >
< / div >
< div class = "header-content" >
< div class = "header-icon" >
< svg width = "32" height = "32" viewBox = "0 0 24 24" fill = "none" >
< path d = "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2" stroke = "#2563eb" stroke -width = " 1.5 " stroke -linecap = " round " / >
< path d = "M9 12h6M9 16h6" stroke = "#2563eb" stroke -width = " 1.5 " stroke -linecap = " round " / >
< path d = "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2" stroke = "#2563eb" stroke -width = " 1.5 " stroke -linecap = " round " / >
< path d = "M9 12h6M9 16h6" stroke = "#2563eb" stroke -width = " 1.5 " stroke -linecap = " round " / >
< / svg >
< / div >
< div class = "header-text" >
@ -48,22 +48,16 @@
< div class = "search-area" >
< div class = "search-box" >
< svg class = "search-icon" width = "16" height = "16" viewBox = "0 0 24 24" fill = "none" stroke = "currentColor" stroke -width = " 2 " >
< circle cx = "11" cy = "11" r = "8" / >
< path d = "M21 21l-4.35-4.35" / >
< circle cx = "11" cy = "11" r = "8" / >
< path d = "M21 21l-4.35-4.35" / >
< / svg >
< input
v - model . trim = "keyword"
type = "text"
placeholder = "输入实训任务名称搜索..."
class = "search-input"
@ keyup . enter = "queryTasks"
/ >
< input v -model .trim = " keyword " type = "text" placeholder = "输入实训任务名称搜索..." class = "search-input" @keyup.enter ="queryTasks" / >
< button v-if ="keyword" class="clear-btn" @click="keyword = ''" > × < / button >
< / div >
< el -button type = "primary" class = "search-btn" @click ="queryTasks" >
< svg width = "14" height = "14" viewBox = "0 0 24 24" fill = "none" stroke = "currentColor" stroke -width = " 2 " >
< circle cx = "11" cy = "11" r = "8" / >
< path d = "M21 21l-4.35-4.35" / >
< circle cx = "11" cy = "11" r = "8" / >
< path d = "M21 21l-4.35-4.35" / >
< / svg >
< span > 查询 < / span >
< / e l - b u t t o n >
@ -71,18 +65,18 @@
< div class = "toolbar-actions" >
< button class = "tool-btn" @click ="downloadTemplate" >
< svg width = "14" height = "14" viewBox = "0 0 24 24" fill = "none" stroke = "currentColor" stroke -width = " 2 " >
< path d = "M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4" / >
< polyline points = "7 10 12 15 17 10" / >
< line x1 = "12" y1 = "15" x2 = "12" y2 = "3" / >
< path d = "M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4" / >
< polyline points = "7 10 12 15 17 10" / >
< line x1 = "12" y1 = "15" x2 = "12" y2 = "3" / >
< / svg >
< span > 下载模板 < / span >
< / button >
< el -upload action = "#" :auto-upload ="false" :show-file-list ="false" :on-change ="handleImportChange" >
< button class = "tool-btn" >
< svg width = "14" height = "14" viewBox = "0 0 24 24" fill = "none" stroke = "currentColor" stroke -width = " 2 " >
< path d = "M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4" / >
< polyline points = "17 8 12 3 7 8" / >
< line x1 = "12" y1 = "3" x2 = "12" y2 = "15" / >
< path d = "M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4" / >
< polyline points = "17 8 12 3 7 8" / >
< line x1 = "12" y1 = "3" x2 = "12" y2 = "15" / >
< / svg >
< span > 导入配置 < / span >
< / button >
@ -93,33 +87,23 @@
< div class = "project-filter" >
< span class = "filter-label" >
< svg width = "14" height = "14" viewBox = "0 0 24 24" fill = "none" stroke = "currentColor" stroke -width = " 2 " >
< path d = "M22 19a2 2 0 01-2 2H4a2 2 0 01-2-2V5a2 2 0 012-2h5l2 3h9a2 2 0 012 2z" / >
< path d = "M22 19a2 2 0 01-2 2H4a2 2 0 01-2-2V5a2 2 0 012-2h5l2 3h9a2 2 0 012 2z" / >
< / svg >
所属项目 :
< / span >
< div class = "project-tabs" >
< button
type = "button"
: class = "['project-tab', { active: !activeProject }]"
@ click = "activeProject = ''"
>
< button type = "button" : class = "['project-tab', { active: !activeProject }]" @ click = "activeProject = ''" >
< span class = "tab-name" > 全部 < / span >
< span class = "tab-count" > { { tasks . length } } < / span >
< / button >
< button
v - for = "project in projectOptions"
: key = "project.name"
type = "button"
: class = "['project-tab', { active: activeProject === project.name }]"
@ click = "toggleProject(project.name)"
>
< button v-for ="project in projectOptions" :key="project.name" type="button" :class="['project-tab', { active: activeProject === project.name }]" @click="toggleProject(project.name)" >
< span class = "tab-name" > { { project . name } } < / span >
< span class = "tab-count" > { { project . count } } < / span >
< / button >
< / div >
< div class = "filter-result" >
< svg width = "12" height = "12" viewBox = "0 0 24 24" fill = "none" stroke = "currentColor" stroke -width = " 2 " >
< polyline points = "20 6 9 17 4 12" / >
< polyline points = "20 6 9 17 4 12" / >
< / svg >
< span > 显示 { { filteredTasks . length } } / { { tasks . length } } 条 < / span >
< / div >
@ -128,27 +112,19 @@
<!-- 任务网格 -- >
< section v-loading ="loading" class="task-grid" >
< article
v - for = "(task, index) in filteredTasks"
: key = "task.id || task.taskKey"
class = "task-card"
role = "button"
tabindex = "0"
@ click = "viewTask(task)"
@ keydown . enter . prevent = "viewTask(task)"
>
< article v-for ="(task, index) in filteredTasks" :key="task.id || task.taskKey" class="task-card" role="button" tabindex="0" @click="viewTask(task)" @keydown.enter.prevent="viewTask(task)" >
< div class = "card-decoration" >
< svg class = "corner-decoration top-left" width = "24" height = "24" viewBox = "0 0 24 24" >
< path d = "M2 8V2h6" stroke = "#2563eb" stroke -width = " 2 " fill = "none" opacity = "0.6" / >
< path d = "M2 8V2h6" stroke = "#2563eb" stroke -width = " 2 " fill = "none" opacity = "0.6" / >
< / svg >
< svg class = "corner-decoration top-right" width = "24" height = "24" viewBox = "0 0 24 24" >
< path d = "M22 8V2h-6" stroke = "#2563eb" stroke -width = " 2 " fill = "none" opacity = "0.6" / >
< path d = "M22 8V2h-6" stroke = "#2563eb" stroke -width = " 2 " fill = "none" opacity = "0.6" / >
< / svg >
< svg class = "corner-decoration bottom-left" width = "24" height = "24" viewBox = "0 0 24 24" >
< path d = "M2 16v6h6" stroke = "#2ba471" stroke -width = " 2 " fill = "none" opacity = "0.4" / >
< path d = "M2 16v6h6" stroke = "#2ba471" stroke -width = " 2 " fill = "none" opacity = "0.4" / >
< / svg >
< svg class = "corner-decoration bottom-right" width = "24" height = "24" viewBox = "0 0 24 24" >
< path d = "M22 16v6h-6" stroke = "#2ba471" stroke -width = " 2 " fill = "none" opacity = "0.4" / >
< path d = "M22 16v6h-6" stroke = "#2ba471" stroke -width = " 2 " fill = "none" opacity = "0.4" / >
< / svg >
< / div >
@ -158,12 +134,12 @@
< div class = "card-header" >
< span class = "task-project" >
< svg width = "12" height = "12" viewBox = "0 0 24 24" fill = "none" stroke = "currentColor" stroke -width = " 2 " >
< path d = "M22 19a2 2 0 01-2 2H4a2 2 0 01-2-2V5a2 2 0 012-2h5l2 3h9a2 2 0 012 2z" / >
< path d = "M22 19a2 2 0 01-2 2H4a2 2 0 01-2-2V5a2 2 0 012-2h5l2 3h9a2 2 0 012 2z" / >
< / svg >
{ { task . project || "默认实训任务" } }
< / span >
< span : class = "['task-status', { enabled: task.enabled }]" >
{ { task . enabled ? '启用' : '停用' } }
{ { task . enabled ? "启用" : "停用" } }
< / span >
< / div >
@ -172,15 +148,15 @@
< div class = "task-meta" >
< span class = "meta-item" >
< svg width = "12" height = "12" viewBox = "0 0 24 24" fill = "none" stroke = "currentColor" stroke -width = " 2 " >
< path d = "M9 11l3 3L22 4" / >
< path d = "M21 12v7a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h11" / >
< path d = "M9 11l3 3L22 4" / >
< path d = "M21 12v7a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h11" / >
< / svg >
{ { task . objectives ? . length || 0 } } 个目标
< / span >
< span class = "meta-item" >
< svg width = "12" height = "12" viewBox = "0 0 24 24" fill = "none" stroke = "currentColor" stroke -width = " 2 " >
< path d = "M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z" / >
< polyline points = "14 2 14 8 20 8" / >
< path d = "M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z" / >
< polyline points = "14 2 14 8 20 8" / >
< / svg >
{ { task . steps ? . length || 0 } } 个步骤
< / span >
@ -190,8 +166,8 @@
< div class = "card-actions" @ click.stop >
< el -button type = "primary" class = "edit-btn" @click ="editTask(task)" >
< svg width = "14" height = "14" viewBox = "0 0 24 24" fill = "none" stroke = "currentColor" stroke -width = " 2 " >
< path d = "M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7" / >
< path d = "M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z" / >
< path d = "M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7" / >
< path d = "M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z" / >
< / svg >
编辑任务
< / e l - b u t t o n >
@ -204,39 +180,32 @@
< el -empty v-if ="!filteredTasks.length && !loading" class="task-empty" description="暂无匹配的实训任务" >
< template # image >
< svg width = "80" height = "80" viewBox = "0 0 24 24" fill = "none" stroke = "#2563eb" stroke -width = " 1 " opacity = "0.3" >
< path d = "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2" / >
< rect x = "9" y = "3" width = "6" height = "4" rx = "1" / >
< path d = "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2" / >
< rect x = "9" y = "3" width = "6" height = "4" rx = "1" / >
< / svg >
< / template >
< / e l - e m p t y >
< / section >
<!-- 抽屉编辑 -- >
< el -drawer
v - model = "dialogVisible"
: size = "860"
class = "training-task-drawer"
append - to - body
destroy - on - close
: with - header = "false"
>
< el -drawer v-model ="dialogVisible" :size="860" class="training-task-drawer" append-to-body destroy-on-close :with-header="false" >
< div class = "drawer-shell" >
< header class = "drawer-header" >
< div class = "drawer-heading" >
< span class = "drawer-kicker" >
< svg width = "12" height = "12" viewBox = "0 0 24 24" fill = "none" stroke = "currentColor" stroke -width = " 2 " >
< circle cx = "12" cy = "12" r = "10" / >
< path d = "M12 8v4l3 3" / >
< circle cx = "12" cy = "12" r = "10" / >
< path d = "M12 8v4l3 3" / >
< / svg >
{ { dialogMode === "view" ? 'Training Task Preview' : 'Training Task Editor' } }
{ { dialogMode === "view" ? "Training Task Preview" : "Training Task Editor" } }
< / span >
< h3 > { { dialogMode === "view" ? "查看实训任务" : "编辑实训任务" } } < / h3 >
< p > 管理员维护系统默认实训配置 , 教学班未单独配置时学生端使用这里的实训背景 、 目标 、 要求和案例文档 。 < / p >
< / div >
< button class = "drawer-close-button" aria -label = " 关 闭 抽 屉 " @ click = "dialogVisible = false" >
< svg width = "18" height = "18" viewBox = "0 0 24 24" fill = "none" stroke = "currentColor" stroke -width = " 2 " >
< line x1 = "18" y1 = "6" x2 = "6" y2 = "18" / >
< line x1 = "6" y1 = "6" x2 = "18" y2 = "18" / >
< line x1 = "18" y1 = "6" x2 = "6" y2 = "18" / >
< line x1 = "6" y1 = "6" x2 = "18" y2 = "18" / >
< / svg >
< / button >
< / header >
@ -244,7 +213,7 @@
< div class = "drawer-identity" >
< div class = "identity-item" >
< svg width = "16" height = "16" viewBox = "0 0 24 24" fill = "none" stroke = "currentColor" stroke -width = " 2 " >
< path d = "M22 19a2 2 0 01-2 2H4a2 2 0 01-2-2V5a2 2 0 012-2h5l2 3h9a2 2 0 012 2z" / >
< path d = "M22 19a2 2 0 01-2 2H4a2 2 0 01-2-2V5a2 2 0 012-2h5l2 3h9a2 2 0 012 2z" / >
< / svg >
< div class = "identity-content" >
< span class = "identity-label" > 所属项目 < / span >
@ -253,8 +222,8 @@
< / div >
< div class = "identity-item" >
< svg width = "16" height = "16" viewBox = "0 0 24 24" fill = "none" stroke = "currentColor" stroke -width = " 2 " >
< path d = "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2" / >
< rect x = "9" y = "3" width = "6" height = "4" rx = "1" / >
< path d = "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2" / >
< rect x = "9" y = "3" width = "6" height = "4" rx = "1" / >
< / svg >
< div class = "identity-content" >
< span class = "identity-label" > 实训任务 < / span >
@ -263,8 +232,8 @@
< / div >
< div class = "identity-item status" >
< svg width = "16" height = "16" viewBox = "0 0 24 24" fill = "none" stroke = "currentColor" stroke -width = " 2 " >
< path d = "M22 11.08V12a10 10 0 11-5.93-9.14" / >
< polyline points = "22 4 12 14.01 9 11.01" / >
< path d = "M22 11.08V12a10 10 0 11-5.93-9.14" / >
< polyline points = "22 4 12 14.01 9 11.01" / >
< / svg >
< div class = "identity-content" >
< span class = "identity-label" > 任务状态 < / span >
@ -298,7 +267,7 @@
< el -form -item label = "任务状态:" >
< div class = "switch-wrapper" >
< el -switch v -model = " taskForm.enabled " / >
< span class = "switch-label" > { { taskForm . enabled ? '已启用' : '已停用' } } < / span >
< span class = "switch-label" > { { taskForm . enabled ? "已启用" : "已停用" } } < / span >
< / div >
< / e l - f o r m - i t e m >
< el -form -item label = "实训背景:" >
@ -319,23 +288,17 @@
< div v-for ="(objective, index) in taskForm.objectives" :key="index" class="objective-row" >
< div class = "objective-number" > { { index + 1 } } < / div >
< el -input v -model = " taskForm.objectives [ index ] " placeholder = "请输入实训目标" / >
< button
v - if = "!isReadonly"
type = "button"
class = "remove-btn"
: disabled = "taskForm.objectives.length <= 1"
@ click = "removeObjective(index)"
>
< button v-if ="!isReadonly" type="button" class="remove-btn" :disabled="taskForm.objectives.length <= 1" @click="removeObjective(index)" >
< svg width = "14" height = "14" viewBox = "0 0 24 24" fill = "none" stroke = "currentColor" stroke -width = " 2 " >
< line x1 = "18" y1 = "6" x2 = "6" y2 = "18" / >
< line x1 = "6" y1 = "6" x2 = "18" y2 = "18" / >
< line x1 = "18" y1 = "6" x2 = "6" y2 = "18" / >
< line x1 = "6" y1 = "6" x2 = "18" y2 = "18" / >
< / svg >
< / button >
< / div >
< button v-if ="!isReadonly" type="button" class="add-objective-button" @click="addObjective" >
< svg width = "14" height = "14" viewBox = "0 0 24 24" fill = "none" stroke = "currentColor" stroke -width = " 2 " >
< line x1 = "12" y1 = "5" x2 = "12" y2 = "19" / >
< line x1 = "5" y1 = "12" x2 = "19" y2 = "12" / >
< line x1 = "12" y1 = "5" x2 = "12" y2 = "19" / >
< line x1 = "5" y1 = "12" x2 = "19" y2 = "12" / >
< / svg >
新增目标
< / button >
@ -352,14 +315,14 @@
< span class = "section-number" > 03 < / span >
< div class = "section-info" >
< h4 > 资料与步骤 < / h4 >
< p > 上传案例资料 、 案例 视频 、 实训指导手册与AI排错指导手册 , 配置实训步骤 < / p >
< p > 上传案例资料 、 案例 数据 、 实训指导手册与AI排错指导手册 , 配置实训步骤 < / p >
< / div >
< / div >
< div v-for ="slot in materialSlots" :key="slot.key" class="material-row" >
< div class = "material-info" >
< svg width = "20" height = "20" viewBox = "0 0 24 24" fill = "none" stroke = "currentColor" stroke -width = " 2 " >
< path d = "M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z" / >
< polyline points = "14 2 14 8 20 8" / >
< path d = "M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z" / >
< polyline points = "14 2 14 8 20 8" / >
< / svg >
< div class = "material-text" >
< span class = "material-label" > { { slot . label } } < / span >
@ -368,29 +331,17 @@
< / div >
< / div >
< div class = "material-ops" >
< el -upload
v - if = "!isReadonly"
action = "#"
: auto - upload = "false"
: show - file - list = "false"
: on - change = "(file) => handleMaterialChange(slot.key, file)"
>
< el -upload v-if ="!isReadonly" action="#" :auto-upload="false" :show-file-list="false" :on-change="(file) => handleMaterialChange(slot.key, file)" >
< el -button type = "primary" : loading = "uploadingField === slot.key" class = "upload-btn" >
< svg width = "14" height = "14" viewBox = "0 0 24 24" fill = "none" stroke = "currentColor" stroke -width = " 2 " >
< path d = "M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4" / >
< polyline points = "17 8 12 3 7 8" / >
< line x1 = "12" y1 = "3" x2 = "12" y2 = "15" / >
< path d = "M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4" / >
< polyline points = "17 8 12 3 7 8" / >
< line x1 = "12" y1 = "3" x2 = "12" y2 = "15" / >
< / svg >
{ { uploadingField === slot . key ? '上传中...' : '上传' } }
{ { uploadingField === slot . key ? "上传中..." : "上传" } }
< / e l - b u t t o n >
< / e l - u p l o a d >
< el -button
v - if = "!isReadonly && hasMaterial(slot.key)"
type = "danger"
plain
class = "clear-material-btn"
@ click = "clearMaterial(slot.key)"
> 清除 < / e l - b u t t o n >
< el -button v-if ="!isReadonly && hasMaterial(slot.key)" type="danger" plain class="clear-material-btn" @click="clearMaterial(slot.key)" > 清 除 < / el -button >
< / div >
< / div >
@ -403,35 +354,28 @@
< div v-for ="(step, index) in taskForm.steps" :key="step.id" class="step-item" >
< div class = "step-connector" v-if ="index > 0" >
< svg width = "20" height = "12" viewBox = "0 0 20 12" >
< path d = "M0 6h16M12 1l4 5-4 5" stroke = "#2563eb" stroke -width = " 1.5 " fill = "none" opacity = "0.5" / >
< path d = "M0 6h16M12 1l4 5-4 5" stroke = "#2563eb" stroke -width = " 1.5 " fill = "none" opacity = "0.5" / >
< / svg >
< / div >
< div class = "step-content" >
< span class = "step-number" > { { index + 1 } } < / span >
< el -input v -model = " step.name " placeholder = "步骤名称" / >
< template v-if ="index === 0 && supportsStepOneChoice(taskForm.taskKey)" >
< el -button v-if ="!isReadonly" type="primary" class="step-question-btn" @click="choiceEditorVisible = true" >
编辑题目 { { stepOneQuestionCount ? ` ( ${ stepOneQuestionCount } 题) ` : "" } }
< / e l - b u t t o n >
< el -button v-if ="!isReadonly" type="primary" class="step-question-btn" @click="choiceEditorVisible = true" > 编 辑 题 目 {{ stepOneQuestionCount ? ` ( $ { stepOneQuestionCount } 题 ) ` : " " }} < / el -button >
< span v -else class = "step-question-tag" > 已配置 { { stepOneQuestionCount } } 道题 < / span >
< / template >
< button
v - if = "!isReadonly && taskForm.steps.length > 1"
type = "button"
class = "remove-btn"
@ click = "removeStep(index)"
>
< button v-if ="!isReadonly && taskForm.steps.length > 1" type="button" class="remove-btn" @click="removeStep(index)" >
< svg width = "14" height = "14" viewBox = "0 0 24 24" fill = "none" stroke = "currentColor" stroke -width = " 2 " >
< polyline points = "3 6 5 6 21 6" / >
< path d = "M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2" / >
< polyline points = "3 6 5 6 21 6" / >
< path d = "M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2" / >
< / svg >
< / button >
< / div >
< / div >
< button v-if ="!isReadonly" type="button" class="add-step-button" @click="addStep" >
< svg width = "14" height = "14" viewBox = "0 0 24 24" fill = "none" stroke = "currentColor" stroke -width = " 2 " >
< line x1 = "12" y1 = "5" x2 = "12" y2 = "19" / >
< line x1 = "5" y1 = "12" x2 = "19" y2 = "12" / >
< line x1 = "12" y1 = "5" x2 = "12" y2 = "19" / >
< line x1 = "5" y1 = "12" x2 = "19" y2 = "12" / >
< / svg >
新增步骤
< / button >
@ -442,13 +386,13 @@
< footer class = "drawer-footer" >
< el -button class = "cancel-btn" @ click = "dialogVisible = false" >
{ { isReadonly ? '关闭' : '取消' } }
{ { isReadonly ? "关闭" : "取消" } }
< / e l - b u t t o n >
< el -button v-if ="!isReadonly" type="primary" class="save-btn" :loading="saving" @click="submitTask" >
< svg width = "14" height = "14" viewBox = "0 0 24 24" fill = "none" stroke = "currentColor" stroke -width = " 2 " >
< path d = "M19 21H5a2 2 0 01-2-2V5a2 2 0 012-2h11l5 5v11a2 2 0 01-2 2z" / >
< polyline points = "17 21 17 13 7 13 7 21" / >
< polyline points = "7 3 7 8 15 8" / >
< path d = "M19 21H5a2 2 0 01-2-2V5a2 2 0 012-2h11l5 5v11a2 2 0 01-2 2z" / >
< polyline points = "17 21 17 13 7 13 7 21" / >
< polyline points = "7 3 7 8 15 8" / >
< / svg >
保存配置
< / e l - b u t t o n >
@ -459,13 +403,7 @@
< / template >
< script setup >
import {
downloadTrainingTaskTemplate ,
importTrainingTasks ,
listTrainingTasks ,
updateTrainingTask ,
uploadTrainingTaskMaterial ,
} from "@/api/trainingTask" ;
import { downloadTrainingTaskTemplate , importTrainingTasks , listTrainingTasks , updateTrainingTask , uploadTrainingTaskMaterial } from "@/api/trainingTask" ;
import StepOneChoiceQuestionEditor from "@/views/components/StepOneChoiceQuestionEditor.vue" ;
import StepOneQuestionBankPicker from "@/views/components/StepOneQuestionBankPicker.vue" ;
import { parseStepOneChoiceQuestions , supportsStepOneChoiceQuestions } from "@/utils/stepOneChoiceQuestions" ;
@ -483,9 +421,9 @@ const bankPickerVisible = ref(false);
/ / 四 类 资 料 槽 位 : k e y 对 应 t a s k F o r m 的 ` $ { k e y } N a m e ` / ` $ { k e y } U r l ` 字 段
const materialSlots = [
{ key : "material" , label : "案例资料" } ,
{ key : "trainingData" , label : "案例 视频 " } ,
{ key : "trainingData" , label : "案例 数据 " } ,
{ key : "guideManual" , label : "实训指导手册" } ,
{ key : "aiManual" , label : "AI 排错 指导手册" } ,
{ key : "aiManual" , label : "AI 辅助 指导手册" } ,
] ;
const tasks = ref ( [ ] ) ;
const dialogVisible = ref ( false ) ;
@ -495,7 +433,7 @@ const taskForm = reactive(createEmptyTask());
const isReadonly = computed ( ( ) => dialogMode . value === "view" ) ;
const stepOneQuestionCount = computed ( ( ) => taskForm . stepOneQuestions ? . length || 0 ) ;
const enabledCount = computed ( ( ) => tasks . value . filter ( t => t . enabled ) . length ) ;
const enabledCount = computed ( ( ) => tasks . value . filter ( ( t ) => t . enabled ) . length ) ;
const projects = computed ( ( ) => [ ... new Set ( tasks . value . map ( ( task ) => task . project ) . filter ( Boolean ) ) ] ) ;
const projectOptions = computed ( ( ) => {
@ -1143,7 +1081,9 @@ function buildPayload() {
& : hover {
border - color : rgba ( 37 , 99 , 235 , 0.45 ) ;
transform : translateY ( - 4 px ) ;
box - shadow : 0 20 px 40 px rgba ( 0 , 0 , 0 , 0.4 ) , 0 0 30 px rgba ( 37 , 99 , 235 , 0.15 ) ;
box - shadow :
0 20 px 40 px rgba ( 0 , 0 , 0 , 0.4 ) ,
0 0 30 px rgba ( 37 , 99 , 235 , 0.15 ) ;
. card - glow {
opacity : 1 ;
@ -1161,10 +1101,22 @@ function buildPayload() {
opacity : 0.6 ;
transition : opacity 0.3 s ease ;
& . top - left { top : 8 px ; left : 8 px ; }
& . top - right { top : 8 px ; right : 8 px ; }
& . bottom - left { bottom : 8 px ; left : 8 px ; }
& . bottom - right { bottom : 8 px ; right : 8 px ; }
& . top - left {
top : 8 px ;
left : 8 px ;
}
& . top - right {
top : 8 px ;
right : 8 px ;
}
& . bottom - left {
bottom : 8 px ;
left : 8 px ;
}
& . bottom - right {
bottom : 8 px ;
right : 8 px ;
}
}
}
@ -1295,8 +1247,12 @@ function buildPayload() {
}
@ keyframes scanline {
0 % { left : - 100 % ; }
100 % { left : 200 % ; }
0 % {
left : - 100 % ;
}
100 % {
left : 200 % ;
}
}
. task - empty {
@ -1446,7 +1402,9 @@ function buildPayload() {
. status - value {
color : # ff6b6b ;
& . enabled { color : # 2 ba471 ; }
& . enabled {
color : # 2 ba471 ;
}
}
}
@ -1605,7 +1563,8 @@ function buildPayload() {
border : 1 px solid rgba ( 37 , 99 , 235 , 0.4 ) ! important ;
box - shadow : none ! important ;
& : hover , & . is - focus {
& : hover ,
& . is - focus {
border - color : rgba ( 37 , 99 , 235 , 0.6 ) ! important ;
}
}
@ -1728,10 +1687,10 @@ function buildPayload() {
}
. material - label {
flex - shrink : 0 ;
color : # 1 f2937 ;
font - weight : 600 ;
}
flex - shrink : 0 ;
color : # 1 f2937 ;
font - weight : 600 ;
}
. material - link {
overflow : hidden ;
@ -1832,7 +1791,8 @@ function buildPayload() {
border : 1 px solid rgba ( 37 , 99 , 235 , 0.4 ) ! important ;
box - shadow : none ! important ;
& : hover , & . is - focus {
& : hover ,
& . is - focus {
border - color : rgba ( 37 , 99 , 235 , 0.6 ) ! important ;
}
}