yks-element 1.0.317 → 1.0.320

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,140 @@
1
+ <template>
2
+ <div class="single">
3
+ <div class="single-stem__label required__label">题干</div>
4
+ <yks-tinymce
5
+ key="itemContent"
6
+ :value="fromData.itemContent"
7
+ :toolbar="toolbar"
8
+ :plugins="plugins"
9
+ :charLimit="topicDataExtent.itemContentLength || 20000"
10
+
11
+ :fileParams="getFileTypes('stem', fromData.stemAttrs)"
12
+ :uploadFileToHwCloud="uploadFileToHwCloud"
13
+ :uploadFileFunction="uploadFileFunction"
14
+ menubar=""
15
+ height="200px"
16
+ @change="($event) => getTinymceEdit($event, 'stem')"
17
+ @delte="($event) => handleDelteAttrs($event, 'stem', fromData.stemAttrs)"
18
+ />
19
+
20
+ <div class="yks-flex single-single">
21
+ <span class="single-single__label required__label">选项</span>
22
+ <span class="yks-fs-12 yks-info">请选择正确的判断项</span>
23
+ </div>
24
+ <el-radio-group v-model="fromData.answer">
25
+ <el-radio label="1">对</el-radio>
26
+ <el-radio label="0">错</el-radio>
27
+ </el-radio-group>
28
+ <div class="single-stem__label">答案解析</div>
29
+ <yks-tinymce
30
+ key="description"
31
+ :value="fromData.description"
32
+ :toolbar="toolbar"
33
+ :plugins="plugins"
34
+ :charLimit="topicDataExtent.descriptionLength || 20000"
35
+
36
+ :fileParams="getFileTypes('analysis', fromData.descriptionAttrs)"
37
+ :uploadFileToHwCloud="uploadFileToHwCloud"
38
+ :uploadFileFunction="uploadFileFunction"
39
+ menubar=""
40
+ height="200px"
41
+ @change="($event) => getTinymceEdit($event, 'analysis')"
42
+ @delte="($event) => handleDelteAttrs($event, 'analysis', fromData.descriptionAttrs)"
43
+ />
44
+ </div>
45
+ </template>
46
+ <script>
47
+ import YksTinymce from '../../Tinymce/index'
48
+ import TopicMixins from '../../assets/mixins/topic'
49
+ import { letter, stemItemType, analysisItemType } from './config'
50
+
51
+ export default {
52
+ name: 'Judgment',
53
+ components: { YksTinymce },
54
+ mixins: [TopicMixins],
55
+ methods: {
56
+ /**
57
+ * data 富文本数据
58
+ * field 对象名
59
+ * type 类型
60
+ */
61
+ getTinymceEdit(data, type) {
62
+ switch (type) {
63
+ case 'stem':
64
+ data.itemAttr.type = stemItemType[data.itemAttr.type]
65
+ this.fromData.itemContent = data.value
66
+ if (data.itemAttr.type && data.itemAttr.content) {
67
+ this.fromData.stemAttrs.push(data.itemAttr)
68
+ }
69
+ break
70
+ case 'analysis':
71
+ data.itemAttr.type = analysisItemType[data.itemAttr.type]
72
+ this.fromData.description = data.value
73
+ if (data.itemAttr.type && data.itemAttr.content) {
74
+ this.fromData.descriptionAttrs.push(data.itemAttr)
75
+ }
76
+ break
77
+ default:
78
+ break
79
+ }
80
+ this.$emit('change', this.fromData)
81
+ },
82
+
83
+ handleAddItem() {
84
+ const { itemList } = this.fromData
85
+ this.fromData.itemList.push({
86
+ optionName: letter[itemList.length],
87
+ content: '',
88
+ optionAttrs: []
89
+ })
90
+
91
+ this.$emit('change', this.fromData)
92
+ },
93
+
94
+ handleDelteAttrs(data, type, list, row = {}) {
95
+ const listAttrs = list
96
+ listAttrs.splice(data.index, 1)
97
+ switch (type) {
98
+ case 'stem':
99
+ this.fromData.stemAttrs = listAttrs
100
+ break
101
+ case 'option':
102
+ this.$set(row, 'optionAttrs', listAttrs)
103
+ break
104
+ case 'analysis':
105
+ this.fromData.descriptionAttrs = listAttrs
106
+ break
107
+ default:
108
+ break
109
+ }
110
+ this.$emit('change', this.fromData)
111
+ }
112
+ }
113
+ }
114
+ </script>
115
+
116
+ <style lang="scss" scoped>
117
+ .single-single {
118
+ margin: 30px 0;
119
+ .single-single__label {
120
+ font-weight: 700;
121
+ font-size: 18px;
122
+ width: 100px;
123
+ }
124
+ }
125
+ .single-stem__label {
126
+ font-weight: 700;
127
+ font-size: 18px;
128
+ margin: 30px 0;
129
+ }
130
+ .radio-tinymce {
131
+ font-size: 14px;
132
+ margin-right: 20px;
133
+ }
134
+
135
+ ::v-deep {
136
+ .el-radio-group {
137
+ display: block;
138
+ }
139
+ }
140
+ </style>
File without changes
@@ -0,0 +1,193 @@
1
+ <template>
2
+ <div class="single">
3
+ <div class="single-stem__label required__label">题干</div>
4
+ <yks-tinymce
5
+ key="itemContent"
6
+ :value="fromData.itemContent"
7
+ :toolbar="toolbar"
8
+ :plugins="plugins"
9
+ :charLimit="topicDataExtent.itemContentLength || 20000"
10
+
11
+ :fileParams="getFileTypes('stem', fromData.stemAttrs)"
12
+ :uploadFileToHwCloud="uploadFileToHwCloud"
13
+ :uploadFileFunction="uploadFileFunction"
14
+ menubar=""
15
+ height="200px"
16
+ @change="($event) => getTinymceEdit($event, 'stem')"
17
+ @delte="($event) => handleDelteAttrs($event, 'stem', fromData.stemAttrs)"
18
+ />
19
+
20
+ <div class="yks-flex single-single">
21
+ <span class="single-single__label required__label">选项</span>
22
+ <span class="yks-fs-12 yks-info">请在编辑完选项后选择正确的答案(至少两个)</span>
23
+ </div>
24
+ <el-checkbox-group v-model="fromData.answer">
25
+ <div
26
+ v-for="(item, index) in fromData.itemList"
27
+ :key="`itemList${index}`"
28
+ class="yks-flex v-start yks-mb10"
29
+ >
30
+ <el-checkbox :label="item.optionName" class="yks-w_60 yks-mr10"></el-checkbox>
31
+ <yks-tinymce
32
+ :key="`itemList${index}`"
33
+ :value="item.content"
34
+ :toolbar="toolbar"
35
+ :plugins="plugins"
36
+ :charLimit="topicDataExtent.answerLength || 5000"
37
+
38
+ :fileParams="getFileTypes('option', item.optionAttrs)"
39
+ :uploadFileToHwCloud="uploadFileToHwCloud"
40
+ :uploadFileFunction="uploadFileFunction"
41
+ inline
42
+ height="80px"
43
+ menubar=""
44
+ class="flex-1 radio-tinymce"
45
+ @change="($event) => changeItem($event, item)"
46
+ @delte="($event) => handleDelteAttrs($event, 'option', item.optionAttrs, item)"
47
+ />
48
+ <el-button
49
+ v-if="fromData.itemList.length > 2"
50
+ type="text"
51
+ class="yks-danger"
52
+ @click="handleDelte(index)"
53
+ >删除</el-button
54
+ >
55
+ </div>
56
+ </el-checkbox-group>
57
+ <el-button v-if="fromData.itemList.length < 14" type="primary" @click="handleAddItem"
58
+ >新增选项</el-button
59
+ >
60
+ <div class="single-stem__label">答案解析</div>
61
+ <yks-tinymce
62
+ key="description"
63
+ :value="fromData.description"
64
+ :toolbar="toolbar"
65
+ :plugins="plugins"
66
+ :charLimit="topicDataExtent.descriptionLength || 20000"
67
+
68
+ :fileParams="getFileTypes('analysis', fromData.descriptionAttrs)"
69
+ :uploadFileToHwCloud="uploadFileToHwCloud"
70
+ :uploadFileFunction="uploadFileFunction"
71
+ menubar=""
72
+ height="200px"
73
+ @change="($event) => getTinymceEdit($event, 'analysis')"
74
+ @delte="($event) => handleDelteAttrs($event, 'analysis', fromData.descriptionAttrs)"
75
+ />
76
+ </div>
77
+ </template>
78
+ <script>
79
+ import YksTinymce from '../../Tinymce/index'
80
+ import TopicMixins from '../../assets/mixins/topic'
81
+ import { letter, stemItemType, optionItemType, analysisItemType } from './config'
82
+
83
+ export default {
84
+ name: 'Multiple',
85
+ components: { YksTinymce },
86
+ mixins: [TopicMixins],
87
+ methods: {
88
+ /**
89
+ * data 富文本数据
90
+ * field 对象名
91
+ * type 类型
92
+ */
93
+ getTinymceEdit(data, type) {
94
+ switch (type) {
95
+ case 'stem':
96
+ data.itemAttr.type = stemItemType[data.itemAttr.type]
97
+ this.fromData.itemContent = data.value
98
+ if (data.itemAttr.type && data.itemAttr.content) {
99
+ this.fromData.stemAttrs.push(data.itemAttr)
100
+ }
101
+ break
102
+ case 'analysis':
103
+ data.itemAttr.type = analysisItemType[data.itemAttr.type]
104
+ this.fromData.description = data.value
105
+ if (data.itemAttr.type && data.itemAttr.content) {
106
+ this.fromData.descriptionAttrs.push(data.itemAttr)
107
+ }
108
+ break
109
+ default:
110
+ break
111
+ }
112
+ this.$emit('change', this.fromData)
113
+ },
114
+
115
+ changeItem(data, row) {
116
+ data.itemAttr.type = optionItemType[data.itemAttr.type]
117
+ if (data.itemAttr.type && data.itemAttr.content) {
118
+ row.optionAttrs.push(data.itemAttr)
119
+ this.$set(row, 'optionAttrs', row.optionAttrs)
120
+ }
121
+ this.$set(row, 'content', data.value)
122
+ this.$emit('change', this.fromData)
123
+ },
124
+
125
+ handleDelte(index) {
126
+ this.fromData.itemList.splice(index, 1)
127
+ this.fromData.itemList = this.fromData.itemList.map((v, index) => {
128
+ return {
129
+ ...v,
130
+ optionName: letter[index]
131
+ }
132
+ })
133
+ this.$emit('change', this.fromData)
134
+ },
135
+
136
+ handleAddItem() {
137
+ const { itemList } = this.fromData
138
+ this.fromData.itemList.push({
139
+ optionName: letter[itemList.length],
140
+ content: '',
141
+ optionAttrs: []
142
+ })
143
+
144
+ this.$emit('change', this.fromData)
145
+ },
146
+
147
+ handleDelteAttrs(data, type, list, row = {}) {
148
+ const listAttrs = list
149
+ listAttrs.splice(data.index, 1)
150
+ switch (type) {
151
+ case 'stem':
152
+ this.fromData.stemAttrs = listAttrs
153
+ break
154
+ case 'option':
155
+ this.$set(row, 'optionAttrs', listAttrs)
156
+ break
157
+ case 'analysis':
158
+ this.fromData.descriptionAttrs = listAttrs
159
+ break
160
+ default:
161
+ break
162
+ }
163
+ this.$emit('change', this.fromData)
164
+ }
165
+ }
166
+ }
167
+ </script>
168
+
169
+ <style lang="scss" scoped>
170
+ .single-single {
171
+ margin: 30px 0;
172
+ .single-single__label {
173
+ font-weight: 700;
174
+ font-size: 18px;
175
+ width: 100px;
176
+ }
177
+ }
178
+ .single-stem__label {
179
+ font-weight: 700;
180
+ font-size: 18px;
181
+ margin: 30px 0;
182
+ }
183
+ .radio-tinymce {
184
+ font-size: 14px;
185
+ margin-right: 20px;
186
+ }
187
+
188
+ ::v-deep {
189
+ .el-radio-group {
190
+ display: block;
191
+ }
192
+ }
193
+ </style>
@@ -0,0 +1,127 @@
1
+ <template>
2
+ <div class="single">
3
+ <div class="single-stem__label required__label">题干</div>
4
+ <yks-tinymce
5
+ key="itemContent"
6
+ :value="fromData.itemContent"
7
+ :toolbar="toolbar"
8
+ :plugins="plugins"
9
+ :charLimit="topicDataExtent.itemContentLength || 20000"
10
+
11
+ :fileParams="getFileTypes('stem', fromData.stemAttrs)"
12
+ :uploadFileToHwCloud="uploadFileToHwCloud"
13
+ :uploadFileFunction="uploadFileFunction"
14
+ menubar=""
15
+ height="200px"
16
+ @change="($event) => getTinymceEdit($event, 'stem')"
17
+ @delte="($event) => handleDelteAttrs($event, 'stem', fromData.stemAttrs)"
18
+ />
19
+ <div class="single-stem__label required__label">标准答案</div>
20
+ <yks-tinymce
21
+ key="answer"
22
+ :value="fromData.answer"
23
+ :toolbar="toolbar"
24
+ :plugins="plugins"
25
+ :charLimit="topicDataExtent.answerLength || 5000"
26
+
27
+ :fileParams="getFileTypes('answer', fromData.answerAttrs)"
28
+ :uploadFileToHwCloud="uploadFileToHwCloud"
29
+ :uploadFileFunction="uploadFileFunction"
30
+ menubar=""
31
+ height="200px"
32
+ @change="($event) => getTinymceEdit($event, 'answer')"
33
+ @delte="($event) => handleDelteAttrs($event, 'answer', fromData.answerAttrs)"
34
+ />
35
+ <div class="single-stem__label">答案解析</div>
36
+ <yks-tinymce
37
+ key="description"
38
+ :value="fromData.description"
39
+ :toolbar="toolbar"
40
+ :plugins="plugins"
41
+ :charLimit="topicDataExtent.descriptionLength || 20000"
42
+
43
+ :fileParams="getFileTypes('analysis', fromData.descriptionAttrs)"
44
+ :uploadFileToHwCloud="uploadFileToHwCloud"
45
+ :uploadFileFunction="uploadFileFunction"
46
+ menubar=""
47
+ height="200px"
48
+ @change="($event) => getTinymceEdit($event, 'analysis')"
49
+ @delte="($event) => handleDelteAttrs($event, 'analysis', fromData.descriptionAttrs)"
50
+ />
51
+ </div>
52
+ </template>
53
+ <script>
54
+ import YksTinymce from '../../Tinymce/index'
55
+ import TopicMixins from '../../assets/mixins/topic'
56
+ import { stemItemType, shortItemType, analysisItemType } from './config'
57
+
58
+ export default {
59
+ name: 'PictureAnswer',
60
+ components: { YksTinymce },
61
+ mixins: [TopicMixins],
62
+ methods: {
63
+ /**
64
+ * data 富文本数据
65
+ * field 对象名
66
+ * type 类型
67
+ */
68
+ getTinymceEdit(data, type) {
69
+ switch (type) {
70
+ case 'stem':
71
+ data.itemAttr.type = stemItemType[data.itemAttr.type]
72
+ this.fromData.itemContent = data.value
73
+ if (data.itemAttr.type && data.itemAttr.content) {
74
+ this.fromData.stemAttrs.push(data.itemAttr)
75
+ }
76
+ break
77
+ case 'answer':
78
+ data.itemAttr.type = shortItemType[data.itemAttr.type]
79
+ this.fromData.answer = data.value
80
+ if (data.itemAttr.type && data.itemAttr.content) {
81
+ this.fromData.answerAttrs.push(data.itemAttr)
82
+ }
83
+ break
84
+ case 'analysis':
85
+ data.itemAttr.type = analysisItemType[data.itemAttr.type]
86
+ this.fromData.description = data.value
87
+
88
+ if (data.itemAttr.type && data.itemAttr.content) {
89
+ this.fromData.descriptionAttrs.push(data.itemAttr)
90
+ }
91
+ break
92
+ default:
93
+ break
94
+ }
95
+ this.$emit('change', this.fromData)
96
+ },
97
+
98
+ handleDelteAttrs(data, type, list, row = {}) {
99
+ const listAttrs = list
100
+ listAttrs.splice(data.index, 1)
101
+ switch (type) {
102
+ case 'stem':
103
+ this.fromData.stemAttrs = listAttrs
104
+ break
105
+ case 'answer':
106
+ this.fromData.answerAttrs = listAttrs
107
+ break
108
+ case 'analysis':
109
+ this.fromData.descriptionAttrs = listAttrs
110
+ break
111
+ default:
112
+ break
113
+ }
114
+ this.$emit('change', this.fromData)
115
+ }
116
+ }
117
+ }
118
+ </script>
119
+
120
+ <style lang="scss" scoped>
121
+
122
+ .single-stem__label {
123
+ margin: 30px 0;
124
+ font-size: 18px;
125
+ font-weight: 700;
126
+ }
127
+ </style>
@@ -0,0 +1,136 @@
1
+ <template>
2
+ <div class="single">
3
+ <div class="single-stem__label required__label">题干</div>
4
+ <yks-tinymce
5
+ key="itemContent"
6
+ :value="fromData.itemContent"
7
+ :toolbar="toolbar"
8
+ :plugins="plugins"
9
+ :charLimit="topicDataExtent.itemContentLength || 20000"
10
+
11
+ :fileParams="getFileTypes('stem', fromData.stemAttrs)"
12
+ :uploadFileToHwCloud="uploadFileToHwCloud"
13
+ :uploadFileFunction="uploadFileFunction"
14
+ menubar=""
15
+ height="200px"
16
+ @change="($event) => getTinymceEdit($event, 'stem')"
17
+ @delte="($event) => handleDelteAttrs($event, 'stem', fromData.stemAttrs)"
18
+ />
19
+ <div class="single-stem__label required__label">标准答案</div>
20
+ <yks-tinymce
21
+ key="answer"
22
+ :value="fromData.answer"
23
+ :toolbar="toolbar"
24
+ :plugins="plugins"
25
+ :charLimit="topicDataExtent.answerLength || 5000"
26
+
27
+ :fileParams="getFileTypes('answer', fromData.answerAttrs)"
28
+ :uploadFileToHwCloud="uploadFileToHwCloud"
29
+ :uploadFileFunction="uploadFileFunction"
30
+ menubar=""
31
+ height="200px"
32
+ @change="($event) => getTinymceEdit($event, 'answer')"
33
+ @delte="($event) => handleDelteAttrs($event, 'answer', fromData.answerAttrs)"
34
+ />
35
+ <div class="fill__other">
36
+ <div class="text__warning">
37
+ 如果勾选考生端开启数学公式编辑器,在PC端考生答题页面,本题答题区域考生可以使用数据公式编辑器。
38
+ </div>
39
+ <div class="yks-mt10">
40
+ <el-checkbox v-model="fromData.mathematical"
41
+ >考生端开启数学公式编辑器(只适用于PC端答题)</el-checkbox
42
+ >
43
+ </div>
44
+ </div>
45
+ <div class="single-stem__label">答案解析</div>
46
+ <yks-tinymce
47
+ key="description"
48
+ :value="fromData.description"
49
+ :toolbar="toolbar"
50
+ :plugins="plugins"
51
+ :charLimit="topicDataExtent.descriptionLength || 20000"
52
+
53
+ :fileParams="getFileTypes('analysis', fromData.descriptionAttrs)"
54
+ :uploadFileToHwCloud="uploadFileToHwCloud"
55
+ :uploadFileFunction="uploadFileFunction"
56
+ menubar=""
57
+ height="200px"
58
+ @change="($event) => getTinymceEdit($event, 'analysis')"
59
+ @delte="($event) => handleDelteAttrs($event, 'analysis', fromData.descriptionAttrs)"
60
+ />
61
+ </div>
62
+ </template>
63
+ <script>
64
+ import YksTinymce from '../../Tinymce/index'
65
+ import TopicMixins from '../../assets/mixins/topic'
66
+ import { stemItemType, shortItemType, analysisItemType } from './config'
67
+
68
+ export default {
69
+ name: 'ShortAnswer',
70
+ components: { YksTinymce },
71
+ mixins: [TopicMixins],
72
+ methods: {
73
+ /**
74
+ * data 富文本数据
75
+ * field 对象名
76
+ * type 类型
77
+ */
78
+ getTinymceEdit(data, type) {
79
+ switch (type) {
80
+ case 'stem':
81
+ data.itemAttr.type = stemItemType[data.itemAttr.type]
82
+ this.fromData.itemContent = data.value
83
+ if (data.itemAttr.type && data.itemAttr.content) {
84
+ this.fromData.stemAttrs.push(data.itemAttr)
85
+ }
86
+ break
87
+ case 'answer':
88
+ data.itemAttr.type = shortItemType[data.itemAttr.type]
89
+ this.fromData.answer = data.value
90
+ if (data.itemAttr.type && data.itemAttr.content) {
91
+ this.fromData.answerAttrs.push(data.itemAttr)
92
+ }
93
+ break
94
+ case 'analysis':
95
+ data.itemAttr.type = analysisItemType[data.itemAttr.type]
96
+ this.fromData.description = data.value
97
+
98
+ if (data.itemAttr.type && data.itemAttr.content) {
99
+ this.fromData.descriptionAttrs.push(data.itemAttr)
100
+ }
101
+ break
102
+ default:
103
+ break
104
+ }
105
+ this.$emit('change', this.fromData)
106
+ },
107
+
108
+ handleDelteAttrs(data, type, list, row = {}) {
109
+ const listAttrs = list
110
+ listAttrs.splice(data.index, 1)
111
+ switch (type) {
112
+ case 'stem':
113
+ this.fromData.stemAttrs = listAttrs
114
+ break
115
+ case 'answer':
116
+ this.fromData.answerAttrs = listAttrs
117
+ break
118
+ case 'analysis':
119
+ this.fromData.descriptionAttrs = listAttrs
120
+ break
121
+ default:
122
+ break
123
+ }
124
+ this.$emit('change', this.fromData)
125
+ }
126
+ }
127
+ }
128
+ </script>
129
+
130
+ <style lang="scss" scoped>
131
+ .single-stem__label {
132
+ margin: 30px 0;
133
+ font-size: 18px;
134
+ font-weight: 700;
135
+ }
136
+ </style>