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