@ -17,17 +17,10 @@
< / span >
< / p >
< / div >
< TrainingMaterialButton
class = "release-channel-toolbar"
: material - name = "taskConfig?.materialName"
: material - url = "taskConfig?.materialUrl"
: training - data - name = "taskConfig?.trainingDataName"
: training - data - url = "taskConfig?.trainingDataUrl"
: guide - manual - name = "taskConfig?.guideManualName"
: guide - manual - url = "taskConfig?.guideManualUrl"
: ai - manual - name = "taskConfig?.aiManualName"
: ai - manual - url = "taskConfig?.aiManualUrl"
/ >
< / section >
< section class = "task-action-strip" >
< TrainingTaskToolbar :task-key ="TASK_KEY" :on-submit ="submitTask" :on-reset ="resetTraining" :on-export ="exportOutcome" / >
< / section >
< section class = "task-card" >
@ -180,7 +173,6 @@
< footer class = "footer-actions" >
< el -button @ click = "activeStep = 3" > 上一步 < / e l - b u t t o n >
< el -button :loading ="saving" @click ="saveRankingStep" > 保 存 当 前 进 度 < / el -button >
< el -button type = "primary" :loading ="validating" @click ="validateRankingStep" > 提 交 任 务 < / el -button >
< / footer >
< / section >
< / section >
@ -194,9 +186,9 @@ import { computed, onMounted, ref } from "vue";
import { ArrowRight , Document , Download , Minus , Plus } from "@element-plus/icons-vue" ;
import { ElMessage } from "element-plus" ;
import TrainingAiSidebar from "@/views/components/TrainingAiSidebar.vue" ;
import Training MaterialButton from "@/views/components/TrainingMaterialButton .vue";
import Training TaskToolbar from "@/views/components/TrainingTaskToolbar .vue";
import { getTrainingTaskByKey } from "@/api/trainingTask" ;
import { getStudentTrainingAnswer, saveStudentTrainingAnswer , validateReleaseChannelEvaluationStepOne , validateReleaseChannelEvaluationStepTwo , validateReleaseChannelEvaluationStepThree , validateReleaseChannelEvaluationStepFour } from "@/api/studentTrainingAnswer" ;
import { deleteStudentTrainingAnswer, getStudentTrainingAnswer, saveStudentTrainingAnswer , validateReleaseChannelEvaluationStepOne , validateReleaseChannelEvaluationStepTwo , validateReleaseChannelEvaluationStepThree , validateReleaseChannelEvaluationStepFour } from "@/api/studentTrainingAnswer" ;
import { parseTrainingArray } from "@/views/training/taskKeyMap" ;
const TASK _KEY = "release-channel-evaluation" ;
@ -260,6 +252,9 @@ function syncRankingRows(savedRows = []) { const savedByChannel = new Map(savedR
function openStepFour ( ) { syncRankingRows ( rankingRows . value ) ; activeStep . value = 4 ; }
async function saveRankingStep ( ) { if ( saving . value ) return ; saving . value = true ; try { await saveAnswer ( 4 , { step4Answer : JSON . stringify ( rankingPayload ( ) ) } ) ; ElMessage . success ( "当前进度已保存" ) ; } finally { saving . value = false ; } }
async function validateRankingStep ( ) { if ( validating . value ) return ; validating . value = true ; try { await validateReleaseChannelEvaluationStepFour ( rankingPayload ( ) ) ; await saveStudentTrainingAnswer ( TASK _KEY , { saveAction : "SUBMIT" , currentStep : 4 , step4Answer : JSON . stringify ( rankingPayload ( ) ) } ) ; ElMessage . success ( "渠道排名校验通过,任务已提交" ) ; } catch ( error ) { ElMessage . error ( error ? . message || "请检查渠道排名和核心渠道运营建议" ) ; } finally { validating . value = false ; } }
async function submitTask ( ) { return validateRankingStep ( ) ; }
async function resetTraining ( ) { if ( saving . value || validating . value ) return ; try { await deleteStudentTrainingAnswer ( TASK _KEY ) ; weightRows . value = defaultWeightRows ( ) ; channelRows . value = defaultChannelRows ( ) ; scoreRows . value = [ ] ; rankingRows . value = [ ] ; coreChannelAnalysis . value = "" ; activeStep . value = 1 ; ElMessage . success ( "已清空全部实训步骤,可以重新开始" ) ; } catch ( error ) { ElMessage . error ( "重新实训失败,请稍后重试" ) ; } }
function exportOutcome ( ) { ElMessage . info ( "导出功能正在开发中" ) ; }
function downloadPracticeGuide ( ) {
downloadBuiltInFile ( RELEASE _CHANNEL _GUIDE _URL , "21.实训操作说明.docx" ) ;
}
@ -391,16 +386,18 @@ onMounted(async () => { try { const result = await getTrainingTaskByKey(TASK_KEY
}
/* ===== 工具栏:一行不换行 ===== */
. task - header : deep ( . material - actions ) {
flex : 0 0 auto ;
display : flex ;
flex - wrap : nowrap ;
gap : 6 px ;
}
. task - header : deep ( . material - button ) {
flex : 0 0 auto ;
white - space : nowrap ;
/* ===== 工具栏: TrainingTaskToolbar 按钮右对齐 ===== */
. task - action - strip {
margin : 0 ;
padding : 10 px 16 px ;
: deep ( . training - task - toolbar ) {
display : flex ;
flex - wrap : wrap ;
align - items : center ;
justify - content : flex - end ;
gap : 8 px ;
}
}
/* ===== task-card: 透明容器 ===== */
@ -667,7 +664,10 @@ onMounted(async () => { try { const result = await getTrainingTaskByKey(TASK_KEY
/* ===== 响应式 ===== */
@ media ( max - width : 720 px ) {
. task - header { flex - direction : column ; align - items : flex - start ; }
. task - header : deep ( . material - actions ) { width : 100 % ; }
. task - action - strip {
: deep ( . training - task - toolbar ) { justify - content : stretch ; }
: deep ( . training - task - toolbar > * ) { flex : 1 1 auto ; }
}
. workbench - head { flex - direction : column ; }
. table - actions ,
. footer - actions { align - items : stretch ; flex - direction : column ; }
@ -819,36 +819,46 @@ onMounted(async () => { try { const result = await getTrainingTaskByKey(TASK_KEY
}
/ * = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* 共用组件换肤 : Training MaterialButton 资料 按钮 → 教育蓝
* 共用组件换肤 : Training TaskToolbar 工具栏 按钮 → 教育蓝
* === === === === === === === === === === === === === === === === === === === === * /
. release - channel - page . task - header . material - button . el - button {
height : 34 px ! important ;
min - height : 34 px ! important ;
border : 1 px solid rgba ( 37 , 99 , 235 , 0.35 ) ! important ;
border - radius : 8 px ! important ;
color : # 2563 eb ! important ;
background : # ffffff ! important ;
font - size : 13 px ! important ;
font - weight : 600 ! important ;
transition : border - color 0.16 s ease , background 0.16 s ease , color 0.16 s ease , box - shadow 0.16 s ease ! important ;
& : hover {
border - color : # 2563 eb ! important ;
color : # 2563 eb ! important ;
background : # eff6ff ! important ;
box - shadow : 0 2 px 6 px rgba ( 37 , 99 , 235 , 0.12 ) ! important ;
}
. release - channel - page . task - action - strip . task - toolbar - button . el - button {
display : inline - flex ;
align - items : center ;
justify - content : center ;
gap : 6 px ;
min - height : 34 px ;
height : 34 px ;
padding : 0 14 px ;
border : 1 px solid rgba ( 37 , 99 , 235 , 0.35 ) ;
border - radius : 8 px ;
color : # 2563 eb ;
background : # ffffff ;
font - size : 13 px ;
font - weight : 600 ;
transition : border - color 0.16 s ease , background 0.16 s ease , color 0.16 s ease , box - shadow 0.16 s ease ;
}
& . is - plain {
border - color : # e5e7eb ! important ;
color : # 9 ca3af ! important ;
& : hover {
border - color : # e5e7eb ! important ;
color : # 9 ca3af ! important ;
background : # ffffff ! important ;
box - shadow : none ! important ;
}
}
. release - channel - page . task - action - strip . task - toolbar - button : hover ,
. release - channel - page . task - action - strip . task - toolbar - button : focus {
border - color : # 2563 eb ;
color : # 1 d4ed8 ;
background : # eff6ff ;
box - shadow : 0 2 px 6 px rgba ( 37 , 99 , 235 , 0.12 ) ;
}
. release - channel - page . task - action - strip . task - toolbar - button -- submit . el - button {
border - color : # 2563 eb ;
color : # ffffff ;
background : # 2563 eb ;
box - shadow : 0 1 px 2 px rgba ( 37 , 99 , 235 , 0.35 ) , 0 3 px 10 px rgba ( 37 , 99 , 235 , 0.22 ) ;
}
. release - channel - page . task - action - strip . task - toolbar - button -- submit : hover ,
. release - channel - page . task - action - strip . task - toolbar - button -- submit : focus {
border - color : # 1 d4ed8 ;
color : # ffffff ;
background : # 1 d4ed8 ;
box - shadow : 0 2 px 4 px rgba ( 37 , 99 , 235 , 0.4 ) , 0 5 px 14 px rgba ( 29 , 78 , 216 , 0.28 ) ;
}
/* ===== 表格操作按钮换肤 ===== */