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
118
119
120
121
122
123
124
125
126
<template>
<el-row class="vw-tooth-bit">
<div class="title">咬合关系:</div>
<div class="vw-tooth-bit-content">
<div class="flex flex-wrap">
<vw-tooth-bit-item
v-model="value[item.prop]"
:label="item.label"
v-for="(item, index) in occlusalList"
:key="index"
></vw-tooth-bit-item>
</div>
</div>
<div class="title">其它:</div>
<div class="vw-tooth-bit-content">
<div class="flex flex-wrap">
<vw-tooth-bit-item
v-model="value[item.prop]"
:label="item.label"
v-for="(item, index) in otherList"
:key="index"
></vw-tooth-bit-item>
</div>
</div>
</el-row>
</template>
<script>
import VwToothBitItem from "./VwToothBitItem.vue"
import { isObject } from "@/utils/validate"
export default {
name: "VwToothBit",
components: { VwToothBitItem },
props: {
disabled: Boolean,
value: Object,
},
data() {
return {
occlusalList: [
{
label: "深覆𬌗",
prop: "deepoverhe",
},
{
label: "深覆盖",
prop: "deepcover",
},
{
label: "错𬌗拥挤",
prop: "crowded",
},
{
label: "对刃𬌗",
prop: "blade",
},
{
label: "反𬌗",
prop: "thehe",
},
{
label: "开𬌗",
prop: "andhe",
},
{
label: "食物嵌塞/无接触点",
prop: "plug",
},
],
otherList: [
{
label: "龋",
prop: "caries",
},
{
label: "楔状缺损",
prop: "defect",
},
{
label: "充填体悬突",
prop: "suspended",
},
{
label: "不良修复体",
prop: "badRepair",
},
],
}
},
watch: {
value() {
this.init()
},
},
methods: {
init() {
if (!isObject(this.value)) this.$emit("input", {})
this.occlusalList.forEach((item) => {
this.$set(this.value, item.prop, this.value[item.prop] || {})
})
this.otherList.forEach((item) => {
this.$set(this.value, item.prop, this.value[item.prop] || {})
})
},
},
created() {
this.init()
},
}
</script>
<style lang="scss" scoped>
.vw-tooth-bit {
padding: 20px 0;
.title {
float: left;
width: 90px;
margin-top: 25px;
font-size: 16px;
text-align: right;
font-weight: bold;
line-height: 1;
}
.vw-tooth-bit-content {
overflow: hidden;
}
}
</style>