progress.vue 4.55 KB
<template>
    <section class="inprogress">
        <span class="button-big" @click="onProgress" v-text="nextStepButtonText" />
        <div class="steps">
            <el-steps :active="currentProgressStepNumber" align-center>
                <el-tooltip class="box-item" effect="dark" placement="top" :visible="currentProgressStepNumber === 0">
                    <template #content>
                        <span>
                            <div class="tip">
                                {{ 'Make sure the Mesh Direction is the same as \n shown in the' }}
                                <el-popover placement="top" trigger="hover" :width="530">
                                    <template #reference>
                                        <u class="connect"> Picture. </u>
                                    </template>
                                    <img :width="500" :src="POSITIONIMAGE" alt="" />
                                </el-popover>
                            </div>
                        </span>
                    </template>
                    <el-step id="step1" :title="$t('steps.position')" :icon="LocationInformation" />
                </el-tooltip>
                <el-step :title="$t('steps.marginedit')" :icon="EditPen" />
                <el-tooltip class="box-item" effect="dark" placement="top" :visible="currentProgressStepNumber === 2">
                    <template #content>
                        <span>
                            <div class="tip">
                                {{
                                    'Left Click on Mesh to Generate a Reference Point. \n It is the same as shown in the'
                                }}
                                <el-popover placement="top" trigger="hover" :width="530">
                                    <template #reference>
                                        <u class="connect"> Picture. </u>
                                    </template>
                                    <img :width="500" :src="TRIMREGIONIMAGE" alt="" />
                                </el-popover>
                            </div>
                        </span>
                    </template>

                    <el-step :title="$t('steps.trimPointDefine')" :icon="Crop" />
                </el-tooltip>
                <el-step :title="$t('steps.aligner')" :icon="FolderChecked" />
            </el-steps>
        </div>
    </section>
</template>
<script setup>
import POSITIONIMAGE from '@/views/assets/images/in-progress/position-example.png';
import TRIMREGIONIMAGE from '@/views/assets/images/in-progress/trimregion-example.png';

import { EditPen, LocationInformation, FolderChecked, Crop } from '@element-plus/icons-vue';
import { useInProgressStore } from '@/views/stores/inprogress/useInProgressStore';
import { useEditorStore } from '@/views/stores/useEditorStore';
import { storeToRefs } from 'pinia';
import { onMounted } from 'vue';
import { useRoute } from 'vue-router';

const route = useRoute();

const editorStore = useEditorStore();
const { generateAiTrimlines, editTrimlines, markPointsOnMesh, generateAlignerModal, handleAlignerCompleted } =
    editorStore;

const store = useInProgressStore();
const { currentProgress, currentProgressStepNumber, nextStepButtonText } = storeToRefs(store);

const onProgress = () => {
    switch (currentProgress.value) {
        case 'position':
            generateAiTrimlines();
            break;
        case 'positionComplete':
            editTrimlines();
            break;
        case 'edit':
            markPointsOnMesh();
            break;
        case 'trimPointDefine':
            generateAlignerModal();
            break;
        case 'aligner':
        case 'waiting':
            handleAlignerCompleted();
            break;
    }
};

onMounted(() => {
    const { blockOutValue, gapValue, thicknessValue, materialCompValue, materialCompRange } = route.query;
});
</script>
<style lang="less" scoped>
.inprogress {
    span.button-big {
        position: absolute;
        bottom: 25px;
        margin-left: 16px;
        width: 350px !important;
        height: 60px !important;
        z-index: 2000 !important;
    }
    .steps {
        position: absolute;
        bottom: 25px;
        width: 100%;
        display: flex;
        justify-content: center;
        :deep(.el-step__icon) {
            background: #f6f4f3 !important;
        }
        :deep(.el-steps--horizontal) {
            width: 700px !important;
        }
    }
}

.tip {
    white-space: pre-line;
    font-size: 14px;
}
.connect {
    font-size: 16px;
    color: red;
    cursor: pointer;
}
</style>