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