alignerParams-modal.vue 3.25 KB
<template>
    <el-dialog
        v-model="isVisible"
        :title="$t('generateAligner')"
        align-center
        :close-on-click-modal="false"
        :modal="false"
        width="600px"
    >
        <span class="message">
            <div class="checkbox">
                <span class="demonstration" v-text="$t('establishBase')" />
                <el-checkbox v-model="isBase" label="" size="large" />
            </div>
            <div class="slider-demo-block" v-for="item in alignerParams" :key="item.key">
                <div class="value">
                    <span>{{ item.value }} mm</span>
                </div>
                <div class="input">
                    <span class="demonstration" v-text="item.key" />
                    <el-slider v-model="item.value" :max="item.max" :min="item.min" :step="0.01" />
                </div>
            </div>
        </span>
        <template #footer>
            <div class="dialog-footer">
                <span class="button-hollow" @click="onCancel">{{ $t('Cancel') }}</span>
                <span class="button-big" type="primary" @click="onGenerate">{{ $t('generateAligner') }}</span>
            </div>
        </template>
    </el-dialog>
</template>
<script setup>
import { storeToRefs } from 'pinia';
import { useAlignerParamsStore } from '@/views/stores/modal/useAlignerParamsStore';
import { useEditorStore } from '@/views/stores/useEditorStore';

const editorStore = useEditorStore();
const { generateAlignerConfirm } = editorStore;

const store = useAlignerParamsStore();
const { alignerParams, setAlignerParamsModalVisible } = store;
const { isVisible, isBase } = storeToRefs(store);

const onCancel = () => {
    setAlignerParamsModalVisible(false);
};

const onGenerate = () => {
    generateAlignerConfirm();
    setAlignerParamsModalVisible(false);
};
</script>
<style lang="less" scoped>
.checkbox {
    width: 100%;
    display: flex;
    -webkit-box-pack: justify;
    justify-content: space-between;
    line-height: 30px;
    align-items: center;
    .demonstration {
        font-size: 14px;
        color: var(--el-text-color-secondary);
        flex: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        margin-bottom: 0;
        text-align: end;
        margin-right: 12px;
    }
    .demonstration + .el-checkbox {
        flex: 0 0 70%;
    }
    .el-checkbox {
        margin-left: 12px;
    }
}
.slider-demo-block {
    .value {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        margin-bottom: -11px;
    }
    .input {
        width: 100%;
        display: flex;
        -webkit-box-pack: justify;
        justify-content: space-between;
        line-height: 30px;
        .el-slider {
            margin-top: 0;
            margin-left: 12px;
        }
        .demonstration {
            font-size: 14px;
            color: var(--el-text-color-secondary);
            flex: 1;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            margin-bottom: 0;
            text-align: end;
            margin-right: 12px;
        }
        .demonstration + .el-slider {
            flex: 0 0 70%;
        }
    }
}
.dialog-footer {
    display: flex;
    gap: 12px;
}
</style>