yks-element 1.0.322 → 1.0.792

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.
Files changed (88) hide show
  1. package/README.md +74 -8
  2. package/lib/theme-chalk/buttons.css +1 -0
  3. package/lib/theme-chalk/common.css +1 -0
  4. package/lib/theme-chalk/dialogs.css +1 -0
  5. package/{packages/Topic/src/indefiniteChoice.vue → lib/theme-chalk/element-variables.css} +0 -0
  6. package/lib/theme-chalk/elements.css +1 -0
  7. package/lib/theme-chalk/enlarge.css +1 -0
  8. package/{packages/styles → lib/theme-chalk}/fonts/element-icons.ttf +0 -0
  9. package/{packages/styles → lib/theme-chalk}/fonts/element-icons.woff +0 -0
  10. package/{packages/styles → lib/theme-chalk}/fonts/iconfont.ttf +0 -0
  11. package/lib/theme-chalk/fonts/iconfont.woff +0 -0
  12. package/lib/theme-chalk/icons.css +1 -0
  13. package/lib/theme-chalk/index.css +1 -0
  14. package/lib/theme-chalk/multimedia.css +1 -0
  15. package/lib/theme-chalk/paginations.css +1 -0
  16. package/lib/theme-chalk/scrollbars.css +1 -0
  17. package/lib/theme-chalk/selects.css +1 -0
  18. package/lib/theme-chalk/tables.css +1 -0
  19. package/lib/theme-chalk/tinymce.css +1 -0
  20. package/lib/theme-chalk/uploadfile.css +1 -0
  21. package/lib/theme-chalk/video.css +1 -0
  22. package/{packages/Topic/src/matching.vue → lib/theme-chalk/videoPlayer.css} +0 -0
  23. package/lib/yks.js +1 -0
  24. package/package.json +42 -12
  25. package/lib/fonts/element-icons.535877f5.woff +0 -0
  26. package/lib/fonts/element-icons.732389de.ttf +0 -0
  27. package/lib/fonts/iconfont.19124b0d.ttf +0 -0
  28. package/lib/fonts/iconfont.3ae3dd4e.woff +0 -0
  29. package/lib/yks.css +0 -1
  30. package/packages/Button/index.js +0 -8
  31. package/packages/Button/src/index.vue +0 -78
  32. package/packages/Dialog/index.js +0 -8
  33. package/packages/Dialog/src/index.vue +0 -103
  34. package/packages/Multimedia/index.js +0 -8
  35. package/packages/Multimedia/src/index.vue +0 -179
  36. package/packages/Pagination/index.js +0 -8
  37. package/packages/Pagination/src/index.vue +0 -149
  38. package/packages/Scrollbar/index.js +0 -8
  39. package/packages/Scrollbar/src/index.vue +0 -27
  40. package/packages/Select/index.js +0 -8
  41. package/packages/Select/src/index.vue +0 -350
  42. package/packages/Select/src/option.vue +0 -29
  43. package/packages/Table/index.js +0 -8
  44. package/packages/Table/src/index.vue +0 -141
  45. package/packages/Tinymce/index.js +0 -8
  46. package/packages/Tinymce/src/config.js +0 -25
  47. package/packages/Tinymce/src/index.vue +0 -500
  48. package/packages/Topic/index.js +0 -23
  49. package/packages/Topic/src/attachment.vue +0 -125
  50. package/packages/Topic/src/audioFrequency.vue +0 -127
  51. package/packages/Topic/src/clozeFillInBlanks.vue +0 -267
  52. package/packages/Topic/src/compound.vue +0 -221
  53. package/packages/Topic/src/config.js +0 -132
  54. package/packages/Topic/src/fillInBlanks.vue +0 -272
  55. package/packages/Topic/src/judgment.vue +0 -140
  56. package/packages/Topic/src/multiple.vue +0 -193
  57. package/packages/Topic/src/pictureAnswer.vue +0 -127
  58. package/packages/Topic/src/shortAnswer.vue +0 -136
  59. package/packages/Topic/src/single.vue +0 -194
  60. package/packages/UploadFile/index.js +0 -8
  61. package/packages/UploadFile/src/index.vue +0 -390
  62. package/packages/Video/index.js +0 -8
  63. package/packages/Video/src/index.vue +0 -351
  64. package/packages/assets/mixins/topic.js +0 -137
  65. package/packages/assets/utils/index.js +0 -83
  66. package/packages/assets/utils/topic.js +0 -132
  67. package/packages/icon/default/icons.js +0 -182
  68. package/packages/icon/default/icons.min.js +0 -1
  69. package/packages/icon/default/index.js +0 -7
  70. package/packages/icon/ks-pdf.png +0 -0
  71. package/packages/icon/ks-ppt.png +0 -0
  72. package/packages/icon/ks-word.png +0 -0
  73. package/packages/icon/ks-xslx.png +0 -0
  74. package/packages/icon/music-bg.png +0 -0
  75. package/packages/icon/video-bg.png +0 -0
  76. package/packages/index.js +0 -223
  77. package/packages/option/index.js +0 -6
  78. package/packages/styles/_mixin.scss +0 -93
  79. package/packages/styles/_variables.scss +0 -40
  80. package/packages/styles/common.scss +0 -200
  81. package/packages/styles/element-ui.scss +0 -135
  82. package/packages/styles/element-variables.scss +0 -794
  83. package/packages/styles/fonts/iconfont.woff +0 -0
  84. package/packages/styles/icon.scss +0 -69
  85. package/packages/styles/index.scss +0 -11
  86. package/packages/styles/select.scss +0 -98
  87. package/packages/styles/table.scss +0 -45
  88. package/packages/styles/topic.scss +0 -26
@@ -1,127 +0,0 @@
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: 'YksAudiofrequency',
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>
@@ -1,267 +0,0 @@
1
- <template>
2
- <div class="single">
3
- <div class="single-stem__label required__label">题干</div>
4
- <yks-tinymce
5
- ref="stemTinymceEdit"
6
- key="itemContent"
7
- :value="fromData.itemContent"
8
- :toolbar="toolbar"
9
- :plugins="plugins"
10
- :charLimit="topicDataExtent.itemContentLength || 20000"
11
-
12
- :fileParams="getFileTypes('stem', fromData.stemAttrs)"
13
- menubar=""
14
- height="200px"
15
- @change="($event) => getTinymceEdit($event, 'stem')"
16
- @delte="($event) => handleDelteAttrs($event, 'stem', fromData.stemAttrs)"
17
- />
18
- <div class="yks-flex yks-mt10">
19
- <el-button type="primary" class="yks-mr10" @click="handleFillInBlanks"
20
- >插入填空符</el-button
21
- >
22
- <span class="yks-fs-12 yks-info">请在题干中你需要的位置插入填空符,并在下方编辑对应答案</span>
23
- </div>
24
-
25
- <div class="yks-flex single-single">
26
- <span class="single-single__label required__label">答案</span>
27
- <span class="yks-fs-12 yks-info">考生需要在每个空内输入正确的答案</span>
28
- </div>
29
- <div
30
- v-for="(item, index) in fromData.itemList"
31
- :key="`itemList${index}`"
32
- class="yks-flex yks-mb10 v-start"
33
- >
34
- <span class="yks-w_60 yks-mr10">填空{{ index + 1 }}</span>
35
- <yks-tinymce
36
- key="content"
37
- :value="item.content"
38
- :toolbar="toolbarSpare"
39
- :plugins="plugins"
40
- :charLimit="topicDataExtent.answerLength || 5000"
41
-
42
- :fileParams="getFileTypes('option', item.optionAttrs)"
43
- inline
44
- height="60px"
45
- menubar=""
46
- class="flex-1 radio-tinymce"
47
- @change="($event) => changeItem($event, item)"
48
- @delte="($event) => handleDelteAttrs($event, 'option', item.optionAttrs, item)"
49
- />
50
- <el-input-number
51
- v-model="item.score"
52
- controls-position="right"
53
- placeholder="分值"
54
- class="yks-mr10"
55
- size="large"
56
- :min="0"
57
- :step="0.5"
58
- :max="100"
59
- ></el-input-number>
60
- <el-button type="text" class="yks-danger" @click="handleDelte(index)">删除</el-button>
61
- </div>
62
-
63
- <div class="fill__other">
64
- <div class="text__warning">
65
- 1、如果勾选考生端开启数学公式编辑器,在PC端考生答题页面,本题答题区域考生可以使用数据公式编辑器。
66
- <br />
67
- 2、如果勾选按答案自动判分,需要考生填写内容须跟答案完全相同,才能得分,录入答案时,请不要加多余的空格标点符号等干扰字符,考生考后系统自动出分。
68
- <br />
69
- 3、如果没有勾选按答案自动判分,考生答卷需等待管理员后台手工判分。
70
- </div>
71
- <div class="yks-mt10">
72
- <el-checkbox v-model="fromData.mathematical"
73
- >开启数学公式编辑器(只适用于PC端答题)</el-checkbox
74
- >
75
- <div class="yks-mt10">
76
- <el-checkbox v-model="fromData.automaticScoring" true-label="1" false-label="0"
77
- >按答案自动判分</el-checkbox
78
- >
79
- </div>
80
- <div v-if="fromData.automaticScoring === '1'" class="yks-mt10">
81
- <el-checkbox v-model="fromData.outOfOrder" true-label="1" false-label="0"
82
- >允许考生答案与参考答案顺序不一致</el-checkbox
83
- >
84
- <el-checkbox v-model="fromData.neglect" true-label="1" false-label="0"
85
- >忽略大小写</el-checkbox
86
- >
87
- </div>
88
- </div>
89
- </div>
90
-
91
- <div class="single-stem__label">答案解析</div>
92
- <yks-tinymce
93
- key="description"
94
- :value="fromData.description"
95
- :toolbar="toolbar"
96
- :plugins="plugins"
97
- :charLimit="topicDataExtent.descriptionLength || 20000"
98
-
99
- :fileParams="getFileTypes('analysis', fromData.descriptionAttrs)"
100
- menubar=""
101
- height="200px"
102
- @change="($event) => getTinymceEdit($event, 'analysis')"
103
- @delte="($event) => handleDelteAttrs($event, 'analysis', fromData.descriptionAttrs)"
104
- />
105
- </div>
106
- </template>
107
- <script>
108
- import YksTinymce from '../../Tinymce/index'
109
- import TopicMixins from '../../assets/mixins/topic'
110
- import { stemItemType, optionItemType, analysisItemType } from './config'
111
-
112
- export default {
113
- name: 'YksClozefillinblanks',
114
- components: { YksTinymce },
115
- mixins: [TopicMixins],
116
- methods: {
117
- /**
118
- * data 富文本数据
119
- * field 对象名
120
- * type 类型
121
- */
122
- getTinymceEdit(data, type) {
123
- switch (type) {
124
- case 'stem':
125
- data.itemAttr.type = stemItemType[data.itemAttr.type]
126
- if (data.itemAttr.type && data.itemAttr.content) {
127
- this.fromData.stemAttrs.push(data.itemAttr)
128
- }
129
- // eslint-disable-next-line no-case-declarations
130
- const list = data.value.match(/<input ([^>|]+)>/g, '') || []
131
- // eslint-disable-next-line no-case-declarations
132
- const editor = this.$refs.stemTinymceEdit
133
- if ((this.fromData.itemList || []).length !== list.length && !this.processing) {
134
- const { itemContent } = this.fromData
135
- this.$message.error('请从下方填空符删除!')
136
- this.fromData.itemContent = itemContent.replace(
137
- /<input ([^>|]+)\/>/g,
138
- (all, value) => {
139
- const attributes = value.replace('disabled="disabled"', '')
140
- return `<input ${attributes} disabled="disabled" />`
141
- }
142
- )
143
- this.$nextTick(() => {
144
- editor.keepLastIndex()
145
- })
146
- } else {
147
- this.fromData.itemContent = data.value
148
- }
149
- break
150
- case 'analysis':
151
- data.itemAttr.type = analysisItemType[data.itemAttr.type]
152
- this.fromData.description = data.value
153
- if (data.itemAttr.type && data.itemAttr.content) {
154
- this.fromData.descriptionAttrs.push(data.itemAttr)
155
- }
156
- break
157
- default:
158
- break
159
- }
160
- this.$emit('change', this.fromData)
161
- },
162
-
163
- changeItem(data, row) {
164
- data.itemAttr.type = optionItemType[data.itemAttr.type]
165
- if (data.itemAttr.type && data.itemAttr.content) {
166
- row.optionAttrs.push(data.itemAttr)
167
- this.$set(row, 'optionAttrs', row.optionAttrs)
168
- }
169
- this.$set(row, 'content', data.value)
170
- this.$emit('change', this.fromData)
171
- },
172
-
173
- handleDelte(index) {
174
- const list = this.fromData.itemContent.match(/<input ([^>|]+)>/g, '') || []
175
- const classId = this.fromData.itemList[index].classId
176
- if (classId) {
177
- const subIndex = list.findIndex((v) => v.search(classId) !== -1)
178
- this.fromData.itemList.splice(index, 1)
179
- const editor = this.$refs.stemTinymceEdit
180
- editor.deleFillItem(subIndex)
181
- } else {
182
- this.fromData.itemList.splice(index, 1)
183
- const editor = this.$refs.stemTinymceEdit
184
- editor.deleFillItem(index)
185
- }
186
-
187
- this.$emit('change', this.fromData)
188
- },
189
-
190
- handleFillInBlanks() {
191
- if (this.fromData.itemList.length >= 40) {
192
- return
193
- }
194
-
195
- const value = Date.now()
196
- this.processing = true
197
- const editor = this.$refs.stemTinymceEdit
198
- editor.handleFillInBlanks(this.fromData.itemList.length, value)
199
- const { itemContent } = this.fromData
200
- let index = 0
201
- this.fromData.itemContent = itemContent.replace(/<input ([^>|]+)\/>/g, (all, value) => {
202
- index += 1
203
- return `<input value="${index}" ${value} />`
204
- })
205
- const list = this.fromData.itemContent.match(/<input ([^>|]+)>/g, '') || []
206
- const subIndex = list.findIndex((v) => v.search(value) !== -1)
207
- this.fromData.itemList.splice(subIndex, 0, {
208
- optionName: '',
209
- content: '',
210
- score: '',
211
- optionAttrs: [],
212
- classId: value
213
- })
214
- this.$nextTick(() => {
215
- editor.keepLastIndex()
216
- this.$emit('change', this.fromData)
217
- })
218
- this.processing = false
219
- },
220
-
221
- handleDelteAttrs(data, type, list, row = {}) {
222
- const listAttrs = list
223
- listAttrs.splice(data.index, 1)
224
- switch (type) {
225
- case 'stem':
226
- this.fromData.stemAttrs = listAttrs
227
- break
228
- case 'option':
229
- this.$set(row, 'optionAttrs', listAttrs)
230
- break
231
- case 'analysis':
232
- this.fromData.descriptionAttrs = listAttrs
233
- break
234
- default:
235
- break
236
- }
237
- this.$emit('change', this.fromData)
238
- }
239
- }
240
- }
241
- </script>
242
-
243
- <style lang="scss" scoped>
244
- .single-single {
245
- margin: 30px 0;
246
- .single-single__label {
247
- font-weight: 700;
248
- font-size: 18px;
249
- width: 100px;
250
- }
251
- }
252
- .single-stem__label {
253
- font-weight: 700;
254
- font-size: 18px;
255
- margin: 30px 0;
256
- }
257
- .radio-tinymce {
258
- font-size: 14px;
259
- margin-right: 20px;
260
- }
261
-
262
- ::v-deep {
263
- .el-radio-group {
264
- display: block;
265
- }
266
- }
267
- </style>
@@ -1,221 +0,0 @@
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
21
- v-for="(item, index) in fromData.compoundList"
22
- :key="`compoundList${index}`"
23
- class="yks-ml10"
24
- >
25
- <div class="yks-flex single-single">
26
- <span class="single-single__label required__label"
27
- >{{ index + 1 }}) {{ topic[item.componentId] }}</span
28
- >
29
- <span class="yks-fs-12 yks-mr10">分值</span>
30
- <span class="flex-1">
31
- <el-input-number
32
- v-model="item.score"
33
- :min="0"
34
- :step="0.5"
35
- :max="100"
36
- ></el-input-number>
37
- <el-button
38
- v-if="index > 0"
39
- type="text"
40
- class="yks-ml10"
41
- @click="handleShiftItem('up', index)"
42
- >上移题目</el-button
43
- >
44
- <el-button
45
- v-if="
46
- index + 1 !== fromData.compoundList.length &&
47
- fromData.compoundList.length > 0
48
- "
49
- type="text"
50
- class="yks-ml10"
51
- @click="handleShiftItem('down', index)"
52
- >下移题目</el-button
53
- >
54
- </span>
55
- <el-button
56
- v-if="fromData.compoundList.length > 1"
57
- type="text"
58
- class="yks-danger"
59
- @click="handleDelte(index)"
60
- >删除</el-button
61
- >
62
- </div>
63
- <component
64
- :is="getComponentId(item.componentId)"
65
- v-model="item.itemContentList"
66
- :topicDataExtent="topicDataExtent"
67
- :uploadFileToHwCloud="uploadFileToHwCloud"
68
- ></component>
69
- </div>
70
-
71
- <div class="yks-flex h-between compound-button">
72
- <el-button type="primary" @click="handleAddItem('single')">添加单选题</el-button>
73
- <el-button type="primary" @click="handleAddItem('judgment')">添加判断题</el-button>
74
- <el-button type="primary" @click="handleAddItem('multiple')">添加多选题</el-button>
75
- <el-button type="primary" @click="handleAddItem('short_answer')">添加简答题</el-button>
76
- </div>
77
- </div>
78
- </template>
79
- <script>
80
- import YksTinymce from '../../Tinymce/index'
81
- import TopicMixins from '../../assets/mixins/topic'
82
- import { analysisItemType, stemItemType, itemDataLists } from './config'
83
- import { Single, Multiple, Judgment, ShortAnswer } from '../index'
84
-
85
- export default {
86
- name: 'YksCompound',
87
- components: { YksTinymce, Single, Multiple, Judgment, ShortAnswer },
88
- mixins: [TopicMixins],
89
- methods: {
90
- handleDelte(index) {
91
- this.fromData.compoundList.splice(index, 1)
92
- this.$emit('change', this.fromData)
93
- },
94
-
95
- handleAddItem(value) {
96
- const params = {
97
- itemContentList: {
98
- answer: '',
99
- itemContent: '',
100
- itemList: itemDataLists(),
101
- stemAttrs: [],
102
- answerAttrs: [],
103
- descriptionAttrs: [],
104
- description: ''
105
- },
106
- score: 0,
107
- componentId: value
108
- }
109
-
110
- switch (value) {
111
- case 'multiple':
112
- params.itemContentList.answer = []
113
- break
114
- case 'judgment':
115
- params.itemContentList.itemList = []
116
- break
117
- case 'short_answer':
118
- params.itemContentList.itemList = []
119
- break
120
- }
121
- this.fromData.compoundList.push(params)
122
- this.$emit('change', this.fromData)
123
- },
124
-
125
- /**
126
- * data 富文本数据
127
- * field 对象名
128
- * type 类型
129
- */
130
- getTinymceEdit(data, type) {
131
- switch (type) {
132
- case 'stem':
133
- data.itemAttr.type = stemItemType[data.itemAttr.type]
134
- this.fromData.itemContent = data.value
135
- if (data.itemAttr.type && data.itemAttr.content) {
136
- this.fromData.stemAttrs.push(data.itemAttr)
137
- }
138
- break
139
- case 'analysis':
140
- data.itemAttr.type = analysisItemType[data.itemAttr.type]
141
- this.fromData.description = data.value
142
- if (data.itemAttr.type && data.itemAttr.content) {
143
- this.fromData.descriptionAttrs.push(data.itemAttr)
144
- }
145
- break
146
- default:
147
- break
148
- }
149
- this.$emit('change', this.fromData)
150
- },
151
-
152
- handleShiftItem(type, index) {
153
- const { compoundList } = this.fromData
154
- if (type === 'up') {
155
- compoundList[index] = compoundList.splice(index - 1, 1, compoundList[index])[0]
156
- } else {
157
- compoundList[index] = compoundList.splice(index + 1, 1, compoundList[index])[0]
158
- }
159
- this.fromData.compoundList = compoundList
160
- this.$emit('change', this.fromData)
161
- },
162
-
163
- getComponentId(value) {
164
- if (value === 'short_answer') {
165
- return 'shortAnswer'
166
- }
167
- return value
168
- },
169
-
170
- handleDelteAttrs(data, type, list, row = {}) {
171
- const listAttrs = list
172
- listAttrs.splice(data.index, 1)
173
- switch (type) {
174
- case 'stem':
175
- this.fromData.stemAttrs = listAttrs
176
- break
177
- case 'option':
178
- this.$set(row, 'optionAttrs', listAttrs)
179
- break
180
- case 'analysis':
181
- this.fromData.descriptionAttrs = listAttrs
182
- break
183
- default:
184
- break
185
- }
186
- this.$emit('change', this.fromData)
187
- }
188
- }
189
- }
190
- </script>
191
-
192
- <style lang="scss" scoped>
193
- .single-single {
194
- margin: 30px 0;
195
- .single-single__label {
196
- font-weight: 700;
197
- font-size: 18px;
198
- margin-right: 20px;
199
- }
200
- }
201
- .single-stem__label {
202
- font-weight: 700;
203
- font-size: 18px;
204
- margin: 30px 0;
205
- }
206
- .radio-tinymce {
207
- font-size: 14px;
208
- margin-right: 20px;
209
- }
210
-
211
- .compound-button {
212
- margin: 20px auto;
213
- width: 60%;
214
- }
215
-
216
- ::v-deep {
217
- .el-radio-group {
218
- display: block;
219
- }
220
- }
221
- </style>