|
@@ -197,7 +197,8 @@ const steps = reactive(
|
|
|
},
|
|
|
],
|
|
|
},
|
|
|
- ])
|
|
|
+ ],
|
|
|
+)
|
|
|
|
|
|
let gid = $ref<number>(0)
|
|
|
let pids = $ref<number[]>([])
|
|
@@ -300,7 +301,8 @@ function handleClickTask(currentStep: number, idx: number, idy: number) {
|
|
|
else
|
|
|
return item
|
|
|
})) {
|
|
|
- router.push(`/${currentStep}/${idx}/${idy}`)
|
|
|
+ sessionStorage.setItem('StepId', JSON.stringify({ gid: currentStep, pid: idx, cid: idy }))
|
|
|
+ router.push('/detail')
|
|
|
}
|
|
|
else {
|
|
|
ElMessage({
|
|
@@ -311,6 +313,18 @@ function handleClickTask(currentStep: number, idx: number, idy: number) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+function beforeClickTask() {
|
|
|
+ const continueDoTask = Math.random() > 0.8// false
|
|
|
+ if (!continueDoTask) {
|
|
|
+ ElMessage({
|
|
|
+ message: '无权操作',
|
|
|
+ type: 'warning',
|
|
|
+ grouping: true,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ return continueDoTask
|
|
|
+}
|
|
|
+
|
|
|
function handleCompleteTask(gid: number, pid: number, idy: number) {
|
|
|
if (stepsMap[gid][pid][idy] === 1) {
|
|
|
return ElMessage({
|
|
@@ -319,12 +333,12 @@ function handleCompleteTask(gid: number, pid: number, idy: number) {
|
|
|
grouping: true,
|
|
|
})
|
|
|
}
|
|
|
- stepsMap[gid][pid][idy] = 1
|
|
|
+ window.handleCompleteTask(gid, pid, idy)
|
|
|
if (pid === stepsMap[gid].length - 1)
|
|
|
return
|
|
|
const line = lineList[gid][pid][idy]
|
|
|
line.setOptions({ color: '#003eee' })
|
|
|
- document.querySelectorAll('.leader-line')[line._id as number - 1]?.classList.add('z10')
|
|
|
+ document.querySelectorAll('.leader-line')[line._id - 1]?.classList.add('z10')
|
|
|
}
|
|
|
|
|
|
onBeforeRouteLeave(() => {
|
|
@@ -337,8 +351,8 @@ onBeforeRouteLeave(() => {
|
|
|
<div class="h-full w-220px">
|
|
|
<el-steps direction="vertical" :active="gid">
|
|
|
<el-step
|
|
|
- v-for="({ title, children }, idx) in steps" :key="title" class="cursor-pointer hover:bg-light-600" :class="idx === currentStep && 'bg-light-400'"
|
|
|
- @click="handleSwitchGid(idx)"
|
|
|
+ v-for="({ title, children }, idx) in steps" :key="title" class="cursor-pointer hover:bg-light-600"
|
|
|
+ :class="idx === currentStep && 'bg-light-400'" @click="handleSwitchGid(idx)"
|
|
|
>
|
|
|
<template #title>
|
|
|
<div class="mb-4 font-normal">
|
|
@@ -363,9 +377,9 @@ onBeforeRouteLeave(() => {
|
|
|
<!-- <div ref="Ref1" class="Ref1" h-10 w-10 bg-red-500 />
|
|
|
<div ref="Ref2" class="Ref2" mt-100 h-10 w-10 bg-red-500 /> -->
|
|
|
<div class="h-full flex justify-between">
|
|
|
- <div v-for="(step, idx) in steps[currentStep].children" :key="idx" class="h-full flex flex-col justify-evenly">
|
|
|
+ <div v-for="(step, idx) in steps[currentStep].children " :key="idx" class="h-full flex flex-col justify-evenly">
|
|
|
<the-card
|
|
|
- v-for="(task, idy) in step.children" :key="idy"
|
|
|
+ v-for="(task, idy) in step.children " :key="idy"
|
|
|
:ref="el => { CardsRef[idx] = CardsRef[idx] || []; CardsRef[idx][idy] = el as any }" :title="task.title"
|
|
|
:description="task.description" :completed="!!stepsMap[currentStep][idx][idy]"
|
|
|
>
|
|
@@ -373,13 +387,13 @@ onBeforeRouteLeave(() => {
|
|
|
<template v-if="task.title === '预划考号区域'">
|
|
|
<div
|
|
|
class="min-w-60px cursor-pointer rounded bg-light-50 py-3px text-center text-xs"
|
|
|
- @click="handleClickTask(currentStep, idx, idy)"
|
|
|
+ @click="beforeClickTask() && handleClickTask(currentStep, idx, idy)"
|
|
|
>
|
|
|
{{ !!stepsMap[currentStep][idx][idy] ? '已经完成' : '立即开始' }}
|
|
|
</div>
|
|
|
<div
|
|
|
class="min-w-60px cursor-pointer rounded bg-light-50 py-3px text-center text-xs"
|
|
|
- @click="handleCompleteTask(currentStep, idx, idy)"
|
|
|
+ @click="beforeClickTask() && handleCompleteTask(currentStep, idx, idy)"
|
|
|
>
|
|
|
{{ '跳过' }}
|
|
|
</div>
|
|
@@ -387,7 +401,7 @@ onBeforeRouteLeave(() => {
|
|
|
<template v-else>
|
|
|
<div
|
|
|
class="min-w-60px cursor-pointer rounded bg-light-50 py-3px text-center text-xs"
|
|
|
- @click="handleClickTask(currentStep, idx, idy)"
|
|
|
+ @click="beforeClickTask() && handleClickTask(currentStep, idx, idy)"
|
|
|
>
|
|
|
{{ !!stepsMap[currentStep][idx][idy] ? '已经完成' : '立即开始' }}
|
|
|
</div>
|
|
@@ -400,9 +414,7 @@ onBeforeRouteLeave(() => {
|
|
|
<el-link type="primary">
|
|
|
修改试题答案
|
|
|
</el-link>
|
|
|
- <el-link type="primary">
|
|
|
- 设置成绩查看权限
|
|
|
- </el-link>
|
|
|
+ <qxsz :disabled="!!stepsMap[currentStep][idx][idy]" />
|
|
|
<el-link type="primary">
|
|
|
标记缺考
|
|
|
</el-link>
|
|
@@ -411,7 +423,6 @@ onBeforeRouteLeave(() => {
|
|
|
</template>
|
|
|
</the-card>
|
|
|
</div>
|
|
|
- <div />
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|