|
@@ -2,6 +2,7 @@
|
|
|
import { computed, ref, useTemplateRef } from 'vue';
|
|
|
import { useRouter } from 'vue-router';
|
|
|
|
|
|
+import SvgIcon from '@/components/SvgIcon.vue';
|
|
|
import { t } from '@/i18n';
|
|
|
import { addUnit } from '@/utils';
|
|
|
|
|
@@ -15,6 +16,7 @@ interface Props {
|
|
|
form: T;
|
|
|
rules: FormRules<T>;
|
|
|
contentOffset?: number;
|
|
|
+ headerMargin?: number;
|
|
|
}
|
|
|
|
|
|
const props = defineProps<Props>();
|
|
@@ -22,6 +24,10 @@ const props = defineProps<Props>();
|
|
|
const router = useRouter();
|
|
|
const current = ref(0);
|
|
|
|
|
|
+const currentStep = computed(() => {
|
|
|
+ return props.steps[current.value];
|
|
|
+});
|
|
|
+
|
|
|
const isFirstStep = computed(() => {
|
|
|
return current.value === 0;
|
|
|
});
|
|
@@ -55,10 +61,20 @@ const currentComponent = computed(() => {
|
|
|
});
|
|
|
|
|
|
const contentStyle = computed<CSSProperties>(() => {
|
|
|
- const contentOffset = props.steps[current.value].contentOffset ?? props.contentOffset;
|
|
|
+ // const contentOffset = props.steps[current.value].contentOffset ?? props.contentOffset;
|
|
|
+
|
|
|
+ return {
|
|
|
+ // paddingLeft: addUnit(contentOffset ?? 312),
|
|
|
+ };
|
|
|
+});
|
|
|
+
|
|
|
+const headerStyle = computed<CSSProperties>(() => {
|
|
|
+ const dividerWidth = currentStep.value.hideHeaderDivider ? 0 : 1;
|
|
|
+ const headerMargin = currentStep.value.headerMargin ?? props.headerMargin;
|
|
|
|
|
|
return {
|
|
|
- paddingLeft: addUnit(contentOffset ?? 312),
|
|
|
+ borderBottomWidth: addUnit(dividerWidth),
|
|
|
+ marginBottom: addUnit(headerMargin ?? 40),
|
|
|
};
|
|
|
});
|
|
|
|
|
@@ -109,13 +125,17 @@ const finishCurrentStep = async () => {
|
|
|
<div class="use-guide-steps">
|
|
|
<ASteps v-model:current="current" :items="steps" direction="vertical" />
|
|
|
</div>
|
|
|
- <AButton class="use-guide-doc-button">
|
|
|
- <img src="@/assets/img/file-black.png" />
|
|
|
+ <AButton class="icon-button doc-button">
|
|
|
+ <SvgIcon name="eye-o" />
|
|
|
{{ $t('common.viewDoc') }}
|
|
|
</AButton>
|
|
|
</ALayoutSider>
|
|
|
<ALayout>
|
|
|
<ALayoutContent class="use-guide-main" :style="contentStyle">
|
|
|
+ <div v-show="!currentStep.hideHeader" class="step-header" :style="headerStyle">
|
|
|
+ <div class="step-title">{{ currentStep.stepTitle || currentStep.title }}</div>
|
|
|
+ <div class="step-description">{{ currentStep.stepDescription }}</div>
|
|
|
+ </div>
|
|
|
<AForm ref="formRef" :model="form" :rules="rules" :layout="formLayout">
|
|
|
<component
|
|
|
ref="stepItem"
|
|
@@ -128,20 +148,26 @@ const finishCurrentStep = async () => {
|
|
|
</AForm>
|
|
|
</ALayoutContent>
|
|
|
<ALayoutFooter class="use-guide-footer">
|
|
|
- <div>
|
|
|
- <AButton type="text" :disabled="isLastStep" @click="goNextStep">{{ $t('common.skip') }}</AButton>
|
|
|
- <AButton type="text" @click="goPrevStep">{{ $t('common.return') }}</AButton>
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <AButton v-if="exportButtonShow" @click="exportStepContent">{{ $t('common.exportToLocal') }}</AButton>
|
|
|
- <AButton
|
|
|
- v-show="nextStepButtonShow"
|
|
|
- type="primary"
|
|
|
- :disabled="nextStepButtonDisabled"
|
|
|
- @click="finishCurrentStep"
|
|
|
- >
|
|
|
- {{ nextStepButtonText }}
|
|
|
- </AButton>
|
|
|
+ <div class="use-guide-step-button-container">
|
|
|
+ <div>
|
|
|
+ <AButton type="text" :disabled="isLastStep" @click="goNextStep">{{ $t('common.skip') }}</AButton>
|
|
|
+ <AButton type="text" @click="goPrevStep">{{ $t('common.return') }}</AButton>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <AButton v-if="exportButtonShow" class="icon-button export-button" @click="exportStepContent">
|
|
|
+ <SvgIcon name="download" />
|
|
|
+ {{ $t('common.exportToLocal') }}
|
|
|
+ </AButton>
|
|
|
+ <AButton
|
|
|
+ v-show="nextStepButtonShow"
|
|
|
+ class="next-step-button"
|
|
|
+ type="primary"
|
|
|
+ :disabled="nextStepButtonDisabled"
|
|
|
+ @click="finishCurrentStep"
|
|
|
+ >
|
|
|
+ {{ nextStepButtonText }}
|
|
|
+ </AButton>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</ALayoutFooter>
|
|
|
</ALayout>
|
|
@@ -154,8 +180,8 @@ const finishCurrentStep = async () => {
|
|
|
}
|
|
|
|
|
|
.use-guide-sider {
|
|
|
- padding-top: 46px;
|
|
|
- padding-bottom: 34px;
|
|
|
+ padding-top: 48px;
|
|
|
+ padding-bottom: 40px;
|
|
|
background: #f0f0f0;
|
|
|
|
|
|
:deep(.ant-layout-sider-children) {
|
|
@@ -165,7 +191,7 @@ const finishCurrentStep = async () => {
|
|
|
}
|
|
|
|
|
|
.use-guide-title {
|
|
|
- margin-bottom: 26px;
|
|
|
+ margin-bottom: 32px;
|
|
|
text-align: center;
|
|
|
}
|
|
|
|
|
@@ -214,31 +240,65 @@ const finishCurrentStep = async () => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- .use-guide-doc-button {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
-
|
|
|
- img {
|
|
|
- margin-right: 10px;
|
|
|
- }
|
|
|
+ .doc-button {
|
|
|
+ width: 120px;
|
|
|
+ height: 40px;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
.use-guide-main {
|
|
|
- padding-top: 60px;
|
|
|
+ padding: 40px;
|
|
|
+ padding-bottom: 0;
|
|
|
overflow: auto;
|
|
|
background: var(--antd-color-bg-base);
|
|
|
+
|
|
|
+ .step-header {
|
|
|
+ padding-bottom: 40px;
|
|
|
+ border-bottom: 1px solid #e4e7ed;
|
|
|
+ }
|
|
|
+
|
|
|
+ .step-title {
|
|
|
+ margin-bottom: 8px;
|
|
|
+ font-size: 20px;
|
|
|
+ font-weight: 500;
|
|
|
+ line-height: 28px;
|
|
|
+ color: var(--antd-color-text);
|
|
|
+ }
|
|
|
+
|
|
|
+ .step-description {
|
|
|
+ min-height: 22px;
|
|
|
+ font-size: 14px;
|
|
|
+ line-height: 22px;
|
|
|
+ color: var(--antd-color-text-secondary);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
.use-guide-footer {
|
|
|
+ padding-inline: 40px;
|
|
|
+ background: var(--antd-color-bg-base);
|
|
|
+}
|
|
|
+
|
|
|
+.use-guide-step-button-container {
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
- padding-right: 211px;
|
|
|
- padding-left: 187px;
|
|
|
- background: var(--antd-color-bg-base);
|
|
|
+ max-width: 686px;
|
|
|
+
|
|
|
+ button {
|
|
|
+ height: 40px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .ant-btn-text {
|
|
|
+ width: 80px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .export-button {
|
|
|
+ width: 136px;
|
|
|
+ margin-right: 16px;
|
|
|
+ }
|
|
|
|
|
|
- button + button {
|
|
|
- margin-left: 16px;
|
|
|
+ .next-step-button {
|
|
|
+ width: 128px;
|
|
|
+ font-size: 16px;
|
|
|
}
|
|
|
}
|
|
|
</style>
|