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
<template>
<div style="height:600px;overflow-y:auto;">
<div class="mainTitle">{{evaluation.name}}</div>
<div v-for="content in evaluationContents" :key="content.id">
<a-comment>
{{content.showIndex + '.' + content.name + ' (' + content.score + '分)'}}
</a-comment>
<a-comment v-if="content.hasSubitem">
<a-comment v-for="item in content.contentItems" :key="item.id">
{{item.showIndex + '.' + item.name + ' (' + item.score + '分)'}}<br />
<a-radio-group v-if="item.valueType == 1" @change="radioGroupItemValueChange($event,item)" :disabled="disabled">
<a-radio v-for="record in item.itemValues" :value="record.id" :key="record.id">{{record.name}}</a-radio>
</a-radio-group>
<a-checkbox-group v-if="item.valueType == 2" @change="checkBoxItemValueChange($event,item)" :disabled="disabled">
<a-checkbox v-for="record in item.itemValues" :value="record.id" :key="record.id">{{record.name}}</a-checkbox>
</a-checkbox-group>
<!-- {{item.name}} -->
<a-input-number v-if="item.valueType == 3" :min="0.5" :step="0.5" :max="item.score" :precision="1" :disabled="disabled" @change="e => onNumberItemValueChange(e, record, col)" />
</a-comment>
</a-comment>
<a-comment v-else>
<a-radio-group v-if="content.valueType == 1" @change="radioGroupContentValueChange($event,content)" :disabled="disabled">
<a-radio v-for="record in content.contentValues" :value="record.id" :key="record.id">{{record.name}}</a-radio>
</a-radio-group>
<a-checkbox-group v-if="content.valueType == 2" @change="checkBoxContentValueChange($event, content)" :disabled="disabled">
<a-checkbox v-for="record in content.contentValues" :value="record.id" :key="record.id">{{record.name}}</a-checkbox>
</a-checkbox-group>
<!-- {{content.name}} -->
<a-input-number v-if="content.valueType == 3" :min="0.5" :step="0.5" :max="content.score" :precision="1" :disabled="disabled" @change="e => onNumberContentValueChange(e, content, col)" />
</a-comment>
</div>
<div style="clear: both;height: 20px;"></div>
</div>
</template>
<script>
export default {
name: 'EvaluationContentView',
props: {
value: {
type: String,
default: () => {
return null
},
},
controlDisabled: {
type: Boolean,
default: () => {
return true
}
}
},
data() {
return {
evaluation: {},
evaluationContents: [],
disabled: true
}
},
created() {
this.getEvaluationById()
this.getEvaluationContentByEvalId()
this.disabled = this.controlDisabled
},
methods: {
getEvaluationById() {
let par = { id: this.value }
this.$api.systemManage.getEvaluationById(par).then(({ data = {} }) => {
if (data) {
this.evaluation = data
}
}).catch(() => {})
},
getEvaluationContentByEvalId() {
let par = { id: this.value }
this.$api.systemManage.getEvaluationContentByEvalId(par).then(({ data = {} }) => {
if (data) {
this.evaluationContents = data
}
}).catch(() => {})
},
radioGroupItemValueChange(event, item) {
},
checkBoxItemValueChange(event, item) {
},
onNumberItemValueChange(value, record, column) {
},
radioGroupContentValueChange(event, content) {
},
checkBoxContentValueChange(event, content) {
},
onNumberContentValueChange(value, record, column) {
}
}
}
</script>
<style scoped>
::v-deep .ant-comment-inner {
padding: 5px 0
}
::v-deep .ant-modal-body {
line-height: 2.5;
}
.mainTitle {
text-align: center;
font-size: 15pt;
}
</style>