|
@@ -34,6 +34,10 @@ const exportButtonShow = computed(() => {
|
|
|
return props.steps[current.value].exportButtonShow;
|
|
|
});
|
|
|
|
|
|
+const nextStepButtonShow = computed(() => {
|
|
|
+ return !props.steps[current.value].nextStepButtonHide;
|
|
|
+});
|
|
|
+
|
|
|
const nextStepButtonText = computed(() => {
|
|
|
return props.steps[current.value].nextStepButtonText || t('common.nextStep');
|
|
|
});
|
|
@@ -58,6 +62,10 @@ const contentStyle = computed<CSSProperties>(() => {
|
|
|
};
|
|
|
});
|
|
|
|
|
|
+const goToStep = (index: number) => {
|
|
|
+ current.value = index;
|
|
|
+};
|
|
|
+
|
|
|
const goNextStep = () => {
|
|
|
current.value++;
|
|
|
};
|
|
@@ -111,7 +119,14 @@ const finishCurrentStep = () => {
|
|
|
<ALayout>
|
|
|
<ALayoutContent class="use-guide-main" :style="contentStyle">
|
|
|
<AForm ref="formRef" :model="form" :rules="rules" :layout="formLayout">
|
|
|
- <component ref="stepItem" :is="currentComponent" :steps="steps" :step-index="current" :form="form" />
|
|
|
+ <component
|
|
|
+ ref="stepItem"
|
|
|
+ :is="currentComponent"
|
|
|
+ :form="form"
|
|
|
+ :steps="steps"
|
|
|
+ :step-index="current"
|
|
|
+ :go-to-step="goToStep"
|
|
|
+ />
|
|
|
</AForm>
|
|
|
</ALayoutContent>
|
|
|
<ALayoutFooter class="use-guide-footer">
|
|
@@ -121,7 +136,12 @@ const finishCurrentStep = () => {
|
|
|
</div>
|
|
|
<div>
|
|
|
<AButton v-if="exportButtonShow" @click="exportStepContent">{{ $t('common.exportToLocal') }}</AButton>
|
|
|
- <AButton type="primary" :disabled="nextStepButtonDisabled" @click="finishCurrentStep">
|
|
|
+ <AButton
|
|
|
+ v-show="nextStepButtonShow"
|
|
|
+ type="primary"
|
|
|
+ :disabled="nextStepButtonDisabled"
|
|
|
+ @click="finishCurrentStep"
|
|
|
+ >
|
|
|
{{ nextStepButtonText }}
|
|
|
</AButton>
|
|
|
</div>
|