fix: hide boundary controls in comprehensive training

bugfix/ai-assessment-evidence-rescore
陈沅 1 month ago
parent 9256e8f4f4
commit 9a837c6c03

@ -382,9 +382,9 @@
</section>
<footer v-if="configuredSteps.length" class="step-navigation" aria-label="步骤操作">
<el-button v-if="currentStep > 1" plain @click="goPreviousStep">上一步</el-button>
<el-button v-if="!isFirstConfiguredStep" plain @click="goPreviousStep">上一步</el-button>
<el-button type="primary" :loading="saving" @click="saveCurrentProgress">保存当前进度</el-button>
<el-button v-if="currentStep < configuredSteps.length" plain @click="goNextStep">下一步</el-button>
<el-button v-if="!isLastConfiguredStep" plain @click="goNextStep">下一步</el-button>
</footer>
</section>
@ -744,6 +744,8 @@ const saving = ref(false);
const uploading = ref(false);
const currentStep = ref(1);
const configuredSteps = computed(() => parseArray(remoteTask.value?.steps));
const isFirstConfiguredStep = computed(() => currentStep.value <= 1);
const isLastConfiguredStep = computed(() => configuredSteps.value.length > 0 && currentStep.value >= configuredSteps.value.length);
const indexedConfiguredSteps = computed(() => configuredSteps.value.map((step, index) => ({ step, index })));
const comprehensiveStepNavRef = ref(null);
const comprehensiveNavDragging = ref(false);

@ -30,3 +30,10 @@ test("综合实训步骤保持单行并支持鼠标或触控左右拖动", () =>
assert.match(pageSource, /\.comprehensive-step-strip \.step-name\s*\{[\s\S]*?white-space: nowrap/);
assert.doesNotMatch(pageSource, /comprehensive-turn-row|comprehensive-turn-rail/);
});
test("综合实训首尾步骤只展示可用的底部导航", () => {
assert.match(pageSource, /const isFirstConfiguredStep = computed\(\(\) => currentStep\.value <= 1\);/);
assert.match(pageSource, /const isLastConfiguredStep = computed\(\(\) => configuredSteps\.value\.length > 0 && currentStep\.value >= configuredSteps\.value\.length\);/);
assert.match(pageSource, /v-if="!isFirstConfiguredStep" plain @click="goPreviousStep">上一步/);
assert.match(pageSource, /v-if="!isLastConfiguredStep" plain @click="goNextStep">下一步/);
});

Loading…
Cancel
Save