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,132 +0,0 @@
1
- /**
2
- * uploadRecording 录音
3
- * uploadVideo 视频
4
- * uploadAudio 音频
5
- * uploadFile 文件
6
- */
7
-
8
- export const toolbar = [
9
- 'bold underline italic strikethrough | kityformula-editor subscript superscript charmap | link image | table | removeformat | uploadRecording uploadVideo uploadAudio uploadFile'
10
- ]
11
-
12
- /* 选项、填空等 */
13
- export const toolbarSpare = ['kityformula-editor subscript superscript charmap']
14
-
15
- /* 插件 */
16
- export const plugins = ['kityformula-editor powerpaste lists image media table charmap imagetools']
17
-
18
- /* 选项字符 */
19
- export const letter = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N']
20
-
21
- /* 自定义添加菜单项(录音、上传视频、上传音乐、上传文件):题干 / 标题 - 类型 */
22
- export const stemItemType = {
23
- recording: 'stem_voiceRecord',
24
- video: 'stem_video',
25
- audio: 'stem_audio',
26
- file: 'stem_document'
27
- }
28
-
29
- /* 自定义添加菜单项(录音、上传视频、上传音乐、上传文件): 标准答案 - 类型 */
30
- export const shortItemType = {
31
- recording: 'answer_voiceRecord',
32
- video: 'answer_video',
33
- audio: 'answer_audio',
34
- file: 'answer_document'
35
- }
36
-
37
- /* 自定义添加菜单项(录音、上传视频、上传音乐、上传文件): 选项 - 类型 */
38
- export const optionItemType = {
39
- recording: 'option_voiceRecord',
40
- video: 'option_video',
41
- audio: 'option_audio',
42
- file: 'option_document'
43
- }
44
-
45
- /* 自定义添加菜单项(录音、上传视频、上传音乐、上传文件): 答案解析 - 类型 */
46
- export const analysisItemType = {
47
- recording: 'description_voiceRecord',
48
- video: 'description_video',
49
- audio: 'description_audio',
50
- file: 'description_document'
51
- }
52
-
53
- /**
54
- * 获取题类型
55
- * @param {string} type
56
- * @return {Object}
57
- */
58
- export const getFileType = (type, data) => {
59
- if (data) {
60
- let params = {}
61
- switch (type) {
62
- case 'stem':
63
- params = {
64
- stem_voiceRecord: 'recording',
65
- stem_video: 'video',
66
- stem_audio: 'audio',
67
- stem_document: 'file'
68
- }
69
- break
70
- case 'answer':
71
- params = {
72
- answer_voiceRecord: 'recording',
73
- answer_video: 'video',
74
- answer_audio: 'audio',
75
- answer_document: 'file'
76
- }
77
- break
78
- case 'option':
79
- params = {
80
- option_voiceRecord: 'recording',
81
- option_video: 'video',
82
- option_audio: 'audio',
83
- option_document: 'file'
84
- }
85
- break
86
- case 'analysis':
87
- params = {
88
- description_voiceRecord: 'recording',
89
- description_video: 'video',
90
- description_audio: 'audio',
91
- description_document: 'file'
92
- }
93
- break
94
- }
95
- const fileType = params[data.type]
96
-
97
- return {
98
- ...data,
99
- fileType
100
- }
101
- }
102
- return false
103
- }
104
-
105
- export const itemDataLists = () => {
106
- return [
107
- {
108
- optionName: 'A',
109
- content: '',
110
- optionAttrs: [],
111
- score: ''
112
- },
113
- {
114
- optionName: 'B',
115
- content: '',
116
- optionAttrs: [],
117
- score: ''
118
- },
119
- {
120
- optionName: 'C',
121
- content: '',
122
- optionAttrs: [],
123
- score: ''
124
- },
125
- {
126
- optionName: 'D',
127
- content: '',
128
- optionAttrs: [],
129
- score: ''
130
- }
131
- ]
132
- }
@@ -1,272 +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
- :uploadFileToHwCloud="uploadFileToHwCloud"
14
- :uploadFileFunction="uploadFileFunction"
15
- menubar=""
16
- height="200px"
17
- @change="($event) => getTinymceEdit($event, 'stem')"
18
- @delte="($event) => handleDelteAttrs($event, 'stem', fromData.stemAttrs)"
19
- />
20
- <div class="yks-flex yks-mt10">
21
- <el-button type="primary" class="yks-mr10" @click="handleFillInBlanks"
22
- >插入填空符</el-button
23
- >
24
- <span class="yks-fs-12 info">请在题干中你需要的位置插入填空符,并在下方编辑对应答案</span>
25
- </div>
26
-
27
- <div class="yks-flex single-single">
28
- <span class="single-single__label required__label">答案</span>
29
- <span class="yks-fs-12 yks-info">考生需要在每个空内输入正确的答案</span>
30
- </div>
31
- <div
32
- v-for="(item, index) in fromData.itemList"
33
- :key="`itemList${index}`"
34
- class="yks-flex yks-mb10 v-start"
35
- >
36
- <span class="yks-w_60 yks-mr10">填空{{ index + 1 }}</span>
37
- <yks-tinymce
38
- key="content"
39
- :value="item.content"
40
- :toolbar="toolbarSpare"
41
- :plugins="plugins"
42
- :charLimit="topicDataExtent.answerLength || 5000"
43
-
44
- :fileParams="getFileTypes('option', item.optionAttrs)"
45
- :uploadFileToHwCloud="uploadFileToHwCloud"
46
- :uploadFileFunction="uploadFileFunction"
47
- inline
48
- height="60px"
49
- menubar=""
50
- class="flex-1 radio-tinymce"
51
- @change="($event) => changeItem($event, item)"
52
- @delte="($event) => handleDelteAttrs($event, 'option', item.optionAttrs, item)"
53
- />
54
- <el-input-number
55
- v-model="item.score"
56
- controls-position="right"
57
- placeholder="分值"
58
- class="yks-mr10"
59
- size="large"
60
- :min="0"
61
- :step="0.5"
62
- :max="100"
63
- ></el-input-number>
64
- <el-button type="text" class="yks-danger" @click="handleDelte(index)">删除</el-button>
65
- </div>
66
-
67
- <div class="fill__other">
68
- <div class="text__warning">
69
- 1、如果勾选考生端开启数学公式编辑器,在PC端考生答题页面,本题答题区域考生可以使用数据公式编辑器。
70
- <br />
71
- 2、如果勾选按答案自动判分,需要考生填写内容须跟答案完全相同,才能得分,录入答案时,请不要加多余的空格标点符号等干扰字符,考生考后系统自动出分。
72
- <br />
73
- 3、如果没有勾选按答案自动判分,考生答卷需等待管理员后台手工判分。
74
- </div>
75
- <div class="yks-mt10">
76
- <el-checkbox v-model="fromData.mathematical"
77
- >开启数学公式编辑器(只适用于PC端答题)</el-checkbox
78
- >
79
- <div class="yks-mt10">
80
- <el-checkbox v-model="fromData.automaticScoring" true-label="1" false-label="0"
81
- >按答案自动判分</el-checkbox
82
- >
83
- </div>
84
- <div v-if="fromData.automaticScoring === '1'" class="yks-mt10">
85
- <el-checkbox v-model="fromData.outOfOrder" true-label="1" false-label="0"
86
- >允许考生答案与参考答案顺序不一致</el-checkbox
87
- >
88
- <el-checkbox v-model="fromData.neglect" true-label="1" false-label="0"
89
- >忽略大小写</el-checkbox
90
- >
91
- </div>
92
- </div>
93
- </div>
94
-
95
- <div class="single-stem__label">答案解析</div>
96
- <yks-tinymce
97
- key="description"
98
- :value="fromData.description"
99
- :toolbar="toolbar"
100
- :plugins="plugins"
101
- :charLimit="topicDataExtent.descriptionLength || 20000"
102
-
103
- :fileParams="getFileTypes('analysis', fromData.descriptionAttrs)"
104
- :uploadFileToHwCloud="uploadFileToHwCloud"
105
- :uploadFileFunction="uploadFileFunction"
106
- menubar=""
107
- height="200px"
108
- @change="($event) => getTinymceEdit($event, 'analysis')"
109
- @delte="($event) => handleDelteAttrs($event, 'analysis', fromData.descriptionAttrs)"
110
- />
111
- </div>
112
- </template>
113
- <script>
114
- import YksTinymce from '../../Tinymce/index'
115
- import TopicMixins from '../../assets/mixins/topic'
116
- import { stemItemType, optionItemType, analysisItemType } from './config'
117
-
118
- export default {
119
- name: 'YksFillinblanks',
120
- components: { YksTinymce },
121
- mixins: [TopicMixins],
122
- methods: {
123
- /**
124
- * data 富文本数据
125
- * field 对象名
126
- * type 类型
127
- */
128
- getTinymceEdit(data, type) {
129
- switch (type) {
130
- case 'stem':
131
- data.itemAttr.type = stemItemType[data.itemAttr.type]
132
- if (data.itemAttr.type && data.itemAttr.content) {
133
- this.fromData.stemAttrs.push(data.itemAttr)
134
- }
135
- // eslint-disable-next-line no-case-declarations
136
- const list = data.value.match(/<input ([^>|]+)>/g, '') || []
137
- // eslint-disable-next-line no-case-declarations
138
- const editor = this.$refs.stemTinymceEdit
139
- if ((this.fromData.itemList || []).length !== list.length && !this.processing) {
140
- const { itemContent } = this.fromData
141
- this.$message.error('请从下方填空符删除!')
142
- this.fromData.itemContent = itemContent.replace(
143
- /<input ([^>|]+)\/>/g,
144
- (all, value) => {
145
- const attributes = value.replace('disabled="disabled"', '')
146
- return `<input ${attributes} disabled="disabled" />`
147
- }
148
- )
149
- this.$nextTick(() => {
150
- editor.keepLastIndex()
151
- })
152
- } else {
153
- this.fromData.itemContent = data.value
154
- }
155
- break
156
- case 'analysis':
157
- data.itemAttr.type = analysisItemType[data.itemAttr.type]
158
- this.fromData.description = data.value
159
- if (data.itemAttr.type && data.itemAttr.content) {
160
- this.fromData.descriptionAttrs.push(data.itemAttr)
161
- }
162
- break
163
- default:
164
- break
165
- }
166
- this.$emit('change', this.fromData)
167
- },
168
-
169
- changeItem(data, row) {
170
- data.itemAttr.type = optionItemType[data.itemAttr.type]
171
- if (data.itemAttr.type && data.itemAttr.content) {
172
- row.optionAttrs.push(data.itemAttr)
173
- this.$set(row, 'optionAttrs', row.optionAttrs)
174
- }
175
- this.$set(row, 'content', data.value)
176
- this.$emit('change', this.fromData)
177
- },
178
-
179
- handleDelte(index) {
180
- const list = this.fromData.itemContent.match(/<input ([^>|]+)>/g, '') || []
181
- const classId = this.fromData.itemList[index].classId
182
- if (classId) {
183
- const subIndex = list.findIndex((v) => v.search(classId) !== -1)
184
- this.fromData.itemList.splice(index, 1)
185
- const editor = this.$refs.stemTinymceEdit
186
- editor.deleFillItem(subIndex)
187
- } else {
188
- this.fromData.itemList.splice(index, 1)
189
- const editor = this.$refs.stemTinymceEdit
190
- editor.deleFillItem(index)
191
- }
192
-
193
- this.$emit('change', this.fromData)
194
- },
195
-
196
- handleFillInBlanks() {
197
- if (this.fromData.itemList.length >= 40) {
198
- return
199
- }
200
- const value = Date.now()
201
- this.processing = true
202
- const editor = this.$refs.stemTinymceEdit
203
- editor.handleFillInBlanks(this.fromData.itemList.length, value)
204
- const { itemContent } = this.fromData
205
- let index = 0
206
- this.fromData.itemContent = itemContent.replace(/<input ([^>|]+)\/>/g, (all, value) => {
207
- index += 1
208
- return `<input value="${index}" ${value} />`
209
- })
210
- const list = this.fromData.itemContent.match(/<input ([^>|]+)>/g, '') || []
211
- const subIndex = list.findIndex((v) => v.search(value) !== -1)
212
- this.fromData.itemList.splice(subIndex, 0, {
213
- optionName: '',
214
- content: '',
215
- score: '',
216
- optionAttrs: [],
217
- classId: value
218
- })
219
- this.$nextTick(() => {
220
- editor.keepLastIndex()
221
- this.$emit('change', this.fromData)
222
- })
223
- this.processing = false
224
- },
225
-
226
- handleDelteAttrs(data, type, list, row = {}) {
227
- const listAttrs = list
228
- listAttrs.splice(data.index, 1)
229
- switch (type) {
230
- case 'stem':
231
- this.fromData.stemAttrs = listAttrs
232
- break
233
- case 'option':
234
- this.$set(row, 'optionAttrs', listAttrs)
235
- break
236
- case 'analysis':
237
- this.fromData.descriptionAttrs = listAttrs
238
- break
239
- default:
240
- break
241
- }
242
- this.$emit('change', this.fromData)
243
- }
244
- }
245
- }
246
- </script>
247
-
248
- <style lang="scss" scoped>
249
- .single-single {
250
- margin: 30px 0;
251
- .single-single__label {
252
- font-weight: 700;
253
- font-size: 18px;
254
- width: 100px;
255
- }
256
- }
257
- .single-stem__label {
258
- font-weight: 700;
259
- font-size: 18px;
260
- margin: 30px 0;
261
- }
262
- .radio-tinymce {
263
- font-size: 14px;
264
- margin-right: 20px;
265
- }
266
-
267
- ::v-deep {
268
- .el-radio-group {
269
- display: block;
270
- }
271
- }
272
- </style>
@@ -1,140 +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 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: 'YksJudgment',
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>