alignerParams-modal.vue
3.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<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>