@qxs-bns/components 0.0.48 → 0.0.49

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 (177) hide show
  1. package/es/index.css +5 -5
  2. package/es/package.json.mjs +1 -1
  3. package/es/src/data-chart/src/components/area.vue2.mjs.map +1 -1
  4. package/es/src/data-chart/src/components/bar.vue.mjs +1 -1
  5. package/es/src/data-chart/src/components/bar.vue.mjs.map +1 -1
  6. package/es/src/data-chart/src/components/card.vue2.mjs.map +1 -1
  7. package/es/src/data-chart/src/components/empty.svg.mjs +1 -1
  8. package/es/src/data-chart/src/components/empty.svg.mjs.map +1 -1
  9. package/es/src/data-chart/src/components/empty.vue.mjs +1 -1
  10. package/es/src/data-chart/src/components/empty.vue.mjs.map +1 -1
  11. package/es/src/data-chart/src/components/funnel.vue.mjs +1 -1
  12. package/es/src/data-chart/src/components/funnel.vue.mjs.map +1 -1
  13. package/es/src/data-chart/src/components/line.vue2.mjs +1 -1
  14. package/es/src/data-chart/src/components/line.vue2.mjs.map +1 -1
  15. package/es/src/data-chart/src/components/pie.vue.mjs +1 -1
  16. package/es/src/data-chart/src/components/pie.vue.mjs.map +1 -1
  17. package/es/src/data-chart/src/components/radar.vue.mjs +1 -1
  18. package/es/src/data-chart/src/components/radar.vue.mjs.map +1 -1
  19. package/es/src/data-chart/src/components/scatter-simple.vue.mjs +1 -1
  20. package/es/src/data-chart/src/components/scatter-simple.vue.mjs.map +1 -1
  21. package/es/src/data-chart/src/components/scatter.vue.mjs +1 -1
  22. package/es/src/data-chart/src/components/scatter.vue.mjs.map +1 -1
  23. package/es/src/data-chart/src/components/table.vue.mjs +1 -1
  24. package/es/src/data-chart/src/components/table.vue.mjs.map +1 -1
  25. package/es/src/data-chart/src/data-chart.vue.mjs +1 -1
  26. package/es/src/data-chart/src/data-chart.vue.mjs.map +1 -1
  27. package/es/src/data-chart/src/utils/config.mjs +1 -1
  28. package/es/src/data-chart/src/utils/config.mjs.map +1 -1
  29. package/es/src/data-chart/src/utils/safe-eval.mjs +2 -0
  30. package/es/src/data-chart/src/utils/safe-eval.mjs.map +1 -0
  31. package/es/src/data-chart/src/utils/useCharts.mjs +1 -1
  32. package/es/src/data-chart/src/utils/useCharts.mjs.map +1 -1
  33. package/es/src/file-upload/src/file-upload.vue.mjs +1 -1
  34. package/es/src/file-upload/src/file-upload.vue.mjs.map +1 -1
  35. package/es/src/fixed-action-bar/src/fixed-action-bar.vue.mjs +1 -1
  36. package/es/src/fixed-action-bar/src/fixed-action-bar.vue.mjs.map +1 -1
  37. package/es/src/image-upload/src/image-upload.vue.mjs +1 -1
  38. package/es/src/image-upload/src/image-upload.vue.mjs.map +1 -1
  39. package/es/src/photo-crop-tool/src/photo-crop-tool.vue.mjs.map +1 -1
  40. package/es/src/subject-action/index.mjs.map +1 -1
  41. package/es/src/subject-action/src/subject-action.vue.mjs +1 -1
  42. package/es/src/subject-action/src/subject-action.vue.mjs.map +1 -1
  43. package/es/src/subject-layout/index.mjs.map +1 -1
  44. package/es/src/subject-layout/src/subject-layout.vue.mjs.map +1 -1
  45. package/es/src/subject-list/src/components/SubjectPageEnd.vue.mjs +1 -1
  46. package/es/src/subject-list/src/components/SubjectPageEnd.vue.mjs.map +1 -1
  47. package/es/src/subject-list/src/components/SubjectRichText.vue.mjs +1 -1
  48. package/es/src/subject-list/src/components/SubjectRichText.vue.mjs.map +1 -1
  49. package/es/src/subject-list/src/components/subject-blank-fill.vue.mjs +1 -1
  50. package/es/src/subject-list/src/components/subject-blank-fill.vue.mjs.map +1 -1
  51. package/es/src/subject-list/src/components/subject-scale.vue.mjs +1 -1
  52. package/es/src/subject-list/src/components/subject-scale.vue.mjs.map +1 -1
  53. package/es/src/subject-list/src/components/subject-single.vue.mjs +1 -1
  54. package/es/src/subject-list/src/components/subject-single.vue.mjs.map +1 -1
  55. package/es/src/subject-list/src/components/subject-text-fill.vue.mjs +1 -1
  56. package/es/src/subject-list/src/components/subject-text-fill.vue.mjs.map +1 -1
  57. package/es/src/subject-list/src/subject-list.vue.mjs +1 -1
  58. package/es/src/subject-list/src/subject-list.vue.mjs.map +1 -1
  59. package/es/src/subject-type/index.mjs.map +1 -1
  60. package/es/src/subject-type/src/subject-type.vue.mjs.map +1 -1
  61. package/lib/index.css +5 -5
  62. package/lib/package.json.cjs +1 -1
  63. package/lib/src/data-chart/src/components/area.vue2.cjs.map +1 -1
  64. package/lib/src/data-chart/src/components/bar.vue.cjs +1 -1
  65. package/lib/src/data-chart/src/components/bar.vue.cjs.map +1 -1
  66. package/lib/src/data-chart/src/components/card.vue2.cjs.map +1 -1
  67. package/lib/src/data-chart/src/components/empty.svg.cjs +1 -1
  68. package/lib/src/data-chart/src/components/empty.svg.cjs.map +1 -1
  69. package/lib/src/data-chart/src/components/empty.vue.cjs +1 -1
  70. package/lib/src/data-chart/src/components/empty.vue.cjs.map +1 -1
  71. package/lib/src/data-chart/src/components/funnel.vue.cjs +1 -1
  72. package/lib/src/data-chart/src/components/funnel.vue.cjs.map +1 -1
  73. package/lib/src/data-chart/src/components/line.vue2.cjs +1 -1
  74. package/lib/src/data-chart/src/components/line.vue2.cjs.map +1 -1
  75. package/lib/src/data-chart/src/components/pie.vue.cjs +1 -1
  76. package/lib/src/data-chart/src/components/pie.vue.cjs.map +1 -1
  77. package/lib/src/data-chart/src/components/radar.vue.cjs +1 -1
  78. package/lib/src/data-chart/src/components/radar.vue.cjs.map +1 -1
  79. package/lib/src/data-chart/src/components/scatter-simple.vue.cjs +1 -1
  80. package/lib/src/data-chart/src/components/scatter-simple.vue.cjs.map +1 -1
  81. package/lib/src/data-chart/src/components/scatter.vue.cjs +1 -1
  82. package/lib/src/data-chart/src/components/scatter.vue.cjs.map +1 -1
  83. package/lib/src/data-chart/src/components/table.vue.cjs +1 -1
  84. package/lib/src/data-chart/src/components/table.vue.cjs.map +1 -1
  85. package/lib/src/data-chart/src/data-chart.vue.cjs +1 -1
  86. package/lib/src/data-chart/src/data-chart.vue.cjs.map +1 -1
  87. package/lib/src/data-chart/src/utils/config.cjs +1 -1
  88. package/lib/src/data-chart/src/utils/config.cjs.map +1 -1
  89. package/lib/src/data-chart/src/utils/safe-eval.cjs +2 -0
  90. package/lib/src/data-chart/src/utils/safe-eval.cjs.map +1 -0
  91. package/lib/src/data-chart/src/utils/useCharts.cjs +1 -1
  92. package/lib/src/data-chart/src/utils/useCharts.cjs.map +1 -1
  93. package/lib/src/file-upload/src/file-upload.vue.cjs +1 -1
  94. package/lib/src/file-upload/src/file-upload.vue.cjs.map +1 -1
  95. package/lib/src/fixed-action-bar/src/fixed-action-bar.vue.cjs +1 -1
  96. package/lib/src/fixed-action-bar/src/fixed-action-bar.vue.cjs.map +1 -1
  97. package/lib/src/image-upload/src/image-upload.vue.cjs +1 -1
  98. package/lib/src/image-upload/src/image-upload.vue.cjs.map +1 -1
  99. package/lib/src/photo-crop-tool/src/photo-crop-tool.vue.cjs.map +1 -1
  100. package/lib/src/subject-action/index.cjs.map +1 -1
  101. package/lib/src/subject-action/src/subject-action.vue.cjs +1 -1
  102. package/lib/src/subject-action/src/subject-action.vue.cjs.map +1 -1
  103. package/lib/src/subject-layout/index.cjs.map +1 -1
  104. package/lib/src/subject-layout/src/subject-layout.vue.cjs.map +1 -1
  105. package/lib/src/subject-list/src/components/SubjectPageEnd.vue.cjs +1 -1
  106. package/lib/src/subject-list/src/components/SubjectPageEnd.vue.cjs.map +1 -1
  107. package/lib/src/subject-list/src/components/SubjectRichText.vue.cjs +1 -1
  108. package/lib/src/subject-list/src/components/SubjectRichText.vue.cjs.map +1 -1
  109. package/lib/src/subject-list/src/components/subject-blank-fill.vue.cjs +1 -1
  110. package/lib/src/subject-list/src/components/subject-blank-fill.vue.cjs.map +1 -1
  111. package/lib/src/subject-list/src/components/subject-scale.vue.cjs +1 -1
  112. package/lib/src/subject-list/src/components/subject-scale.vue.cjs.map +1 -1
  113. package/lib/src/subject-list/src/components/subject-single.vue.cjs +1 -1
  114. package/lib/src/subject-list/src/components/subject-single.vue.cjs.map +1 -1
  115. package/lib/src/subject-list/src/components/subject-text-fill.vue.cjs +1 -1
  116. package/lib/src/subject-list/src/components/subject-text-fill.vue.cjs.map +1 -1
  117. package/lib/src/subject-list/src/subject-list.vue.cjs +1 -1
  118. package/lib/src/subject-list/src/subject-list.vue.cjs.map +1 -1
  119. package/lib/src/subject-type/index.cjs.map +1 -1
  120. package/lib/src/subject-type/src/subject-type.vue.cjs.map +1 -1
  121. package/package.json +4 -11
  122. package/theme-chalk/index.css +1 -1
  123. package/theme-chalk/src/base.scss +2 -2
  124. package/theme-chalk/src/fixed-action-bar.css +1 -1
  125. package/theme-chalk/src/fixed-action-bar.scss +1 -1
  126. package/theme-chalk/src/image-upload.css +1 -1
  127. package/theme-chalk/src/image-upload.scss +3 -1
  128. package/theme-chalk/src/subject-action.css +1 -1
  129. package/theme-chalk/src/subject-action.scss +3 -2
  130. package/theme-chalk/src/subject-layout.scss +19 -19
  131. package/theme-chalk/src/subject-list.css +1 -1
  132. package/theme-chalk/src/subject-list.scss +15 -14
  133. package/theme-chalk/src/tiny-mce-editor.scss +4 -2
  134. package/types/src/data-chart/src/components/area.vue.d.ts.map +1 -1
  135. package/types/src/data-chart/src/components/bar.vue.d.ts.map +1 -1
  136. package/types/src/data-chart/src/components/card.vue.d.ts.map +1 -1
  137. package/types/src/data-chart/src/components/empty.vue.d.ts.map +1 -1
  138. package/types/src/data-chart/src/components/funnel.vue.d.ts.map +1 -1
  139. package/types/src/data-chart/src/components/line.vue.d.ts.map +1 -1
  140. package/types/src/data-chart/src/components/pie.vue.d.ts +1 -1
  141. package/types/src/data-chart/src/components/pie.vue.d.ts.map +1 -1
  142. package/types/src/data-chart/src/components/radar.vue.d.ts.map +1 -1
  143. package/types/src/data-chart/src/components/scatter-simple.vue.d.ts.map +1 -1
  144. package/types/src/data-chart/src/components/scatter.vue.d.ts.map +1 -1
  145. package/types/src/data-chart/src/components/table.vue.d.ts.map +1 -1
  146. package/types/src/data-chart/src/data-chart.vue.d.ts.map +1 -1
  147. package/types/src/data-chart/src/utils/config.d.ts.map +1 -1
  148. package/types/src/data-chart/src/utils/safe-eval.d.ts +9 -0
  149. package/types/src/data-chart/src/utils/safe-eval.d.ts.map +1 -0
  150. package/types/src/data-chart/src/utils/useCharts.d.ts +4 -4
  151. package/types/src/data-chart/src/utils/useCharts.d.ts.map +1 -1
  152. package/types/src/file-upload/src/file-upload.vue.d.ts +5 -5
  153. package/types/src/file-upload/src/file-upload.vue.d.ts.map +1 -1
  154. package/types/src/fixed-action-bar/index.d.ts +3 -3
  155. package/types/src/fixed-action-bar/src/fixed-action-bar.vue.d.ts +1 -1
  156. package/types/src/fixed-action-bar/src/fixed-action-bar.vue.d.ts.map +1 -1
  157. package/types/src/image-upload/src/image-upload.vue.d.ts +6 -6
  158. package/types/src/image-upload/src/image-upload.vue.d.ts.map +1 -1
  159. package/types/src/photo-crop-tool/src/photo-crop-tool.vue.d.ts.map +1 -1
  160. package/types/src/subject-action/index.d.ts +11 -11
  161. package/types/src/subject-action/index.d.ts.map +1 -1
  162. package/types/src/subject-action/src/subject-action.vue.d.ts +10 -10
  163. package/types/src/subject-action/src/subject-action.vue.d.ts.map +1 -1
  164. package/types/src/subject-layout/index.d.ts +1 -1
  165. package/types/src/subject-layout/index.d.ts.map +1 -1
  166. package/types/src/subject-layout/src/subject-layout.vue.d.ts.map +1 -1
  167. package/types/src/subject-list/src/components/SubjectPageEnd.vue.d.ts.map +1 -1
  168. package/types/src/subject-list/src/components/SubjectRichText.vue.d.ts.map +1 -1
  169. package/types/src/subject-list/src/components/subject-blank-fill.vue.d.ts.map +1 -1
  170. package/types/src/subject-list/src/components/subject-scale.vue.d.ts.map +1 -1
  171. package/types/src/subject-list/src/components/subject-single.vue.d.ts.map +1 -1
  172. package/types/src/subject-list/src/components/subject-text-fill.vue.d.ts.map +1 -1
  173. package/types/src/subject-list/src/subject-list.vue.d.ts.map +1 -1
  174. package/types/src/subject-type/index.d.ts +1 -1
  175. package/types/src/subject-type/index.d.ts.map +1 -1
  176. package/types/src/subject-type/src/subject-type.vue.d.ts.map +1 -1
  177. package/types/tsconfig.tsbuildinfo +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"subject-single.vue.cjs","sources":["../../../../../../../packages/components/src/subject-list/src/components/subject-single.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { CirclePlus, Remove } from '@element-plus/icons-vue'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport SubjectAction from '../../../subject-action/src/subject-action.vue'\nimport SubjectLayout from '../../../subject-layout/src/subject-layout.vue'\nimport TinyMceEditor from '../../../tiny-mce-editor/src/tiny-mce-editor.vue'\nimport { setGuid } from '@qxs-bns/utils'\n\ndefineOptions({\n name: 'QxsSubjectSingle',\n})\nconst props = defineProps<{\n orderIndex: number\n title?: string\n isSave: boolean\n showAction?: boolean\n type: 'single' | 'multiple' | 'sort'\n isEdit: boolean\n isSet: boolean\n answerList?: any\n leastAnswerCount?: number\n analysis?: string\n examExpand?: string\n examRichTextContent?: string\n showAnalysis?: boolean\n examAnswerRelationType?: number\n customId?: number\n examId?: number\n isKey: boolean\n answerCheckType: number\n}>()\nconst emits = defineEmits(['move', 'save', 'delete', 'edit', 'add', 'setRelation'])\n\nconst attrs = useAttrs()\n\nconst answersIndex = ref(0)\nconst isKey = ref(props.isKey)\nconst answerCheckType = ref(1)\nconst examAnswerRelationType = ref(props.examAnswerRelationType)\nconst answers = ref<{\n title: string\n isCorrect: boolean\n orderIndex?: number\n resultItem?: string\n customAnswerId?: string\n answerRelations?: {\n relationExamId: number\n relationAnswers: {\n relationAnswerId: number\n relationAnswerIndex: number\n }[]\n }[]\n}[]>([{\n title: '',\n isCorrect: false,\n}, {\n title: '',\n isCorrect: false,\n}, {\n title: '',\n isCorrect: false,\n}, {\n title: '',\n isCorrect: false,\n}])\n\nconst leastAnswerCount = ref(2)\nconst title = ref('')\nconst analysis = ref('')\nconst showRichText = ref(false)\nconst richText = ref('')\nconst startTime = ref(0)\nconst showRichContent = ref(false)\nconst resultItem = ref<string>('')\nconst titlePlaceholder = computed(() => {\n if (props.type === 'single') {\n return '单选题'\n }\n else if (props.type === 'multiple') {\n return '多选题'\n }\n else {\n return '排序题'\n }\n})\n\nconst orderList = ref<string[]>([])\n\nconst leastAnswerOptions = computed(() => {\n const items = []\n const length = answers.value.length\n for (let count = length; count > 1; count--) {\n items.push({\n label: `至少选择${count}项`,\n value: count,\n })\n }\n return items.reverse()\n})\nfunction addAnswer() {\n if (props.isSave) {\n return\n }\n answers.value.push({\n title: '',\n isCorrect: false,\n customAnswerId: setGuid()\n })\n}\n\nfunction deleteAnswer(index: number) {\n if (answers.value.length < 3 || props.isSave) {\n return\n }\n answers.value.splice(index, 1)\n}\n\nfunction setCorrect(it: any, event: any) {\n if (props.type === 'single') {\n // 单选题:确保只有一个支持选项\n if (event) {\n answers.value.forEach((answer: any) => {\n if (answer !== it) {\n answer.isCorrect = false\n }\n })\n }\n it.isCorrect = event\n } else if (props.type === 'multiple') {\n // 多选题:可以有多个支持选项\n it.isCorrect = event\n }\n}\nfunction setRelation(item: any) {\n item.customAnswerId = item.examAnswerId || setGuid()\n emits('setRelation', props.customId, item)\n}\n\nfunction deleteRichText() {\n showRichText.value = false\n richText.value = ''\n}\n\nfunction save() {\n if (!title.value) {\n ElMessage.error('题目标题不能为空!')\n return\n }\n // 答题设置必选\n if(!answerCheckType.value) {\n ElMessage.error('请选择答题设置')\n return\n }\n let msg = ''\n let isSetCorrectAnswer = false\n let correctAnswerCount = 0\n if (props.type === 'multiple' || props.type === 'single') {\n answers.value.forEach((v: any, i: number) => {\n if (!v.title?.trim()) {\n msg += `选项${String.fromCharCode(65 + i)}未填写。`\n }\n if (v.isCorrect) {\n isSetCorrectAnswer = true\n correctAnswerCount++\n }\n v.relationType = v.resultItem ? 1 : (v.answerRelations?.length ? 2 : null)\n })\n }\n else if (props.type === 'sort') {\n // 如果设置了支持选项\n if (orderList.value.length) {\n isSetCorrectAnswer = true\n }\n }\n if (msg) {\n ElMessage.error(msg)\n return\n }\n\n const uniqueAnswer = new Set(answers.value.map((item: any) => item.title))\n\n if (uniqueAnswer.size !== answers.value.length) {\n ElMessage.error('选项不能重复')\n return\n }\n\n if (props.type === 'multiple') {\n if (correctAnswerCount === 1) {\n ElMessage.error('请至少设置两个支持选项')\n return\n }\n\n if (isSetCorrectAnswer && correctAnswerCount < leastAnswerCount.value) {\n ElMessage.error('至少选几项与支持选项数不符')\n return\n }\n } \n\n if(answerCheckType.value === 2 || answerCheckType.value === 3) {\n // 必须有设置支持选项\n if (!isSetCorrectAnswer) {\n ElMessage.error('请设置支持选项')\n return\n }\n }\n\n emits('save', {\n title: title.value,\n answers: answers.value.map((item: any, index: number) => {\n return { ...item, orderIndex: index + 1 }\n }),\n examExpand: orderList.value.map((i: string) => i.charCodeAt(0) - 65 + 1).join(','),\n analysis: analysis.value,\n isSetCorrectAnswer,\n leastAnswerCount: leastAnswerCount.value,\n examRichTextContent: showRichText.value ? richText.value : '',\n examAnswerRelationType: examAnswerRelationType.value,\n isKey: isKey.value,\n answerCheckType: answerCheckType.value\n })\n}\n\nfunction init() {\n if (props.title) {\n title.value = props.title\n }\n\n if (props.answerCheckType) {\n answerCheckType.value = props.answerCheckType\n }\n\n if (props.isKey) {\n isKey.value = props.isKey\n }\n\n if (props.examAnswerRelationType) {\n examAnswerRelationType.value = props.examAnswerRelationType\n }\n\n if (props.answerList && props.answerList.length) {\n answers.value = props.answerList\n }\n\n if (props.leastAnswerCount) {\n leastAnswerCount.value = props.leastAnswerCount\n }\n\n if (props.examExpand) {\n // 设置支持选项 props.examExpand里是答案id\n if (props.examExpand) {\n const correctAnswerIdList = props.examExpand.split(',')\n\n // 遍历 correctAnswerIdList,直接在 props.answerList 中查找对应的 orderIndex 并转换成字母\n orderList.value = correctAnswerIdList.map((id: string) => {\n const answer = props.answerList.find((item: any) => item.answerId?.toString() === id)\n return answer ? String.fromCharCode(65 + answer.orderIndex - 1) : id\n }).filter(Boolean) // 过滤掉任何可能的空字符串\n }\n }\n\n if (props.analysis) {\n analysis.value = props.analysis\n }\n\n if (props.examRichTextContent) {\n richText.value = props.examRichTextContent\n showRichText.value = true\n }\n}\nfunction onOpenResult(i: number) {\n answersIndex.value = i\n resultItem.value = answers.value[i].resultItem || ''\n showRichContent.value = true\n}\n\nfunction onSaveResult() {\n answers.value[answersIndex.value].resultItem = resultItem.value || ''\n showRichContent.value = false\n}\nfunction onCloseResult() {\n showRichContent.value = false\n resultItem.value = ''\n}\nfunction setKey(key: boolean) {\n isKey.value = key\n}\nfunction setAnswerSetting(type: number) {\n answerCheckType.value = type\n}\n\nfunction add(type: string, canSet: boolean) {\n emits('add', type, canSet? props.examAnswerRelationType: null)\n}\n// 监听isEdit\nwatch(() => props.isEdit, () => {\n if (props.isEdit) {\n startTime.value = new Date().getTime()\n }\n})\n\nconst relationLength = computed(() => {\n return (v: any) => {\n let count = 0\n v.forEach((item: any) => {\n if (item.relationAnswers) {\n count += item.relationAnswers.length\n }\n })\n return count\n }\n})\n\nconst ns = useNamespace('subject-single')\n\nonMounted(init)\n</script>\n\n<template>\n <div :class=\"ns.e('single-exam')\">\n <SubjectLayout\n :show-edit=\"isEdit\"\n >\n <template #preview>\n <div class=\"preview\">\n <div>\n <span class=\"title\">\n {{ orderIndex + 1 }}.{{ title }}\n <span v-if=\"type === 'single'\">(单选题)</span>\n <span v-else-if=\"['multiple', 'sort'].includes(type)\">\n ({{ titlePlaceholder }}{{ leastAnswerCount ? `至少选${leastAnswerCount}项${type === 'sort' ? '并排序' : ''}` : '' }})\n </span>\n </span>\n </div>\n <div v-if=\"showRichText\">\n <div v-html=\"richText\" class=\"rich-text\"/>\n </div>\n <div class=\"preview-answer\">\n <template v-if=\"type === 'sort'\">\n <el-checkbox\n v-for=\"(item, index) in answers\"\n :key=\"index\"\n class=\"radio\"\n :disabled=\"true\"\n >\n <span class=\"order\">\n {{ String.fromCharCode(65 + index) }}.\n </span>\n {{ item.title }}\n </el-checkbox>\n </template>\n <template v-else>\n <el-radio\n v-for=\"(item, index) in answers\"\n :key=\"index\"\n class=\"radio\"\n value=\"disabled\"\n disabled\n >\n <span class=\"order\">\n {{ String.fromCharCode(65 + index) }}.\n </span>\n {{ item.title }} \n {{ item.isCorrect ? '(支持选项)' : '' }} \n {{ examAnswerRelationType === 1 ? (item.resultItem? '(已设置结果项)' : '(未设置结果项)' ) : ''}} \n {{ examAnswerRelationType === 2 ? (item.answerRelations?.length? '(已设置关联)' : '(未设置关联)') : '' }}\n </el-radio>\n </template>\n </div>\n </div>\n </template>\n <template v-if=\"isEdit\" #edit>\n <div class=\"flex\" :class=\"[{ 'margin-bottom': showRichText }]\">\n <div class=\"label flex flex-justify-center\">\n <span>题目:</span>\n </div>\n <div style=\"flex: 1;\">\n <el-input\n v-model=\"title\"\n type=\"textarea\"\n :rows=\"2\"\n :placeholder=\"`【${titlePlaceholder}】请输入问题`\"\n :disabled=\"isSave\"\n show-word-limit\n maxlength=\"200\"\n class=\"margin-bottom\"\n />\n </div>\n </div>\n <div class=\"margin-bottom flex flex-items-center\">\n <div class=\"label flex flex-justify-center\">\n <span>设置:</span>\n </div>\n <el-select\n v-if=\"['multiple', 'sort'].includes(type)\"\n v-model=\"leastAnswerCount\"\n style=\"width: 150px;\"\n placeholder=\"至少选择几项\"\n :disabled=\"isSave\"\n >\n <el-option\n v-for=\"item in leastAnswerOptions\"\n :key=\"item.value\"\n :value=\"item.value\"\n :label=\"item.label\"\n >\n </el-option>\n </el-select>\n </div>\n <div class=\"margin-bottom answer-list\">\n <div\n v-for=\"(item, index) in answers\"\n :key=\"index\"\n class=\"answer-item flex flex-items-center\"\n >\n <span class=\"label flex flex-justify-center\">{{ String.fromCharCode(65 + index) }}.</span>\n <el-input\n v-model=\"item.title\"\n class=\"input\"\n show-word-limit\n maxlength=\"100\"\n :placeholder=\"`选项${String.fromCharCode(65 + index)}`\"\n :disabled=\"isSave\"\n />\n <el-checkbox\n v-if=\"['single', 'multiple'].includes(type)\"\n v-model=\"item.isCorrect\"\n :class=\"[{ 'is-correct': item.isCorrect }]\"\n :disabled=\"isSave\"\n style=\"margin-left: 10px;\"\n @change=\"(event: any) => setCorrect(item, event)\"\n >\n 支持选项 \n </el-checkbox>\n <el-icon class=\"icon\">\n <CirclePlus\n :class=\"[{ disabled: isSave }]\"\n @click=\"addAnswer\"\n />\n </el-icon>\n <el-icon class=\"icon\">\n <Remove\n :class=\"[{ disabled: answers.length < 3 || isSave }]\"\n @click=\"deleteAnswer(index)\"\n />\n </el-icon>\n <el-link\n v-if=\"examAnswerRelationType === 1 && type !== 'sort'\"\n type=\"primary\"\n class=\"margin-left-10\"\n @click=\"onOpenResult(index)\"\n >\n <span>{{ item.resultItem ? '编辑结果' : '添加结果' }}</span>\n </el-link>\n <el-link\n v-if=\"examAnswerRelationType === 2 && type !== 'sort'\"\n type=\"primary\"\n class=\"margin-left-10\"\n @click=\"setRelation(item)\"\n >\n <span>{{ item.answerRelations?.length ? `关联了${relationLength(item.answerRelations)}项` : '关联检查' }}</span>\n </el-link>\n </div>\n </div>\n <div v-if=\"type === 'sort'\" class=\"margin-bottom flex flex-items-center\">\n <div class=\"label flex flex-justify-end\">\n <span>排序答案:</span>\n </div>\n <div style=\"flex: 1;\">\n <el-select\n v-model=\"orderList\"\n multiple\n style=\"width: 360px;\"\n placeholder=\"请按顺序选择排序答案\"\n :show-arrow=\"true\"\n >\n <el-option\n v-for=\"(item, index) in answers\"\n :key=\"index\"\n :label=\"item.title\"\n :value=\"String.fromCharCode(65 + index)\"\n />\n </el-select>\n </div>\n </div>\n <div\n v-if=\"showAnalysis\"\n class=\"flex\"\n >\n <div class=\"label flex flex-justify-center\">\n <span>解析:</span>\n </div>\n <div style=\"flex: 1;\">\n <el-input\n v-model=\"analysis\"\n type=\"textarea\"\n :rows=\"2\"\n placeholder=\"请输入题目解析\"\n />\n </div>\n </div>\n <div v-if=\"showRichText\" class=\"margin-bottom flex\">\n <div class=\"label flex flex-justify-center\">\n <span>富文本:</span>\n </div>\n <div style=\"flex: 1;\">\n <TinyMceEditor v-model:model-value=\"richText\" v-bind=\"attrs\" style=\"width: 100%;\" />\n <div class=\"flex flex-justify-end\">\n <el-link\n type=\"danger\"\n @click=\"deleteRichText\"\n >\n 删除富文本\n </el-link>\n </div>\n </div>\n </div>\n </template>\n <SubjectAction\n v-if=\"showAction\"\n :is-edit=\"isEdit\"\n :is-set=\"isSet\"\n :isKey=\"isKey\"\n :showOtherOption=\"props.type === 'multiple' || props.type === 'single'\"\n :examAnswerRelationType=\"props.examAnswerRelationType\"\n :answerCheckType=\"answerCheckType\"\n @move-up=\"emits('move', 'up')\"\n @move-down=\"emits('move', 'down')\"\n @delete=\"emits('delete')\"\n @save=\"save\"\n @edit=\"emits('edit')\"\n @add=\"add\"\n @onShowRichText=\"showRichText = true\"\n @setKey=\"setKey\"\n @setAnswerSetting=\"setAnswerSetting\"\n />\n </SubjectLayout>\n <el-dialog\n v-model=\"showRichContent\"\n title=\"添加结果\"\n class=\"customize-dialog\"\n >\n <TinyMceEditor\n :key=\"answersIndex\"\n v-model:model-value=\"resultItem\" \n v-bind=\"attrs\"\n style=\"width: 100%;\" />\n <template #footer>\n <el-button\n class=\"customize-button\"\n type=\"primary\"\n plain\n @click=\"onCloseResult\"\n >\n 取消\n </el-button>\n <el-button\n class=\"customize-button\"\n type=\"primary\"\n plain\n @click=\"onSaveResult\"\n >\n 保存\n </el-button>\n </template>\n </el-dialog>\n </div>\n</template>\n"],"names":["props","__props","emits","__emit","attrs","useAttrs","answersIndex","ref","isKey","answerCheckType","examAnswerRelationType","answers","title","isCorrect","leastAnswerCount","analysis","showRichText","richText","startTime","showRichContent","resultItem","titlePlaceholder","computed","type","orderList","leastAnswerOptions","items","count","value","length","push","label","reverse","addAnswer","isSave","customAnswerId","setGuid","deleteRichText","save","ElMessage","error","msg","isSetCorrectAnswer","correctAnswerCount","forEach","v","i","trim","String","fromCharCode","relationType","answerRelations","Set","map","item","size","index","orderIndex","examExpand","charCodeAt","join","examRichTextContent","onSaveResult","onCloseResult","setKey","key","setAnswerSetting","add","canSet","watch","isEdit","Date","getTime","relationLength","relationAnswers","ns","useNamespace","onMounted","answerList","correctAnswerIdList","split","id","answer","find","answerId","toString","filter","Boolean","it","event","splice","examAnswerId","customId"],"mappings":"m0EAWA,MAAMA,EAAQC,EAoBRC,EAAQC,EAERC,EAAQC,EAAAA,WAERC,EAAeC,MAAI,GACnBC,EAAQD,EAAAA,IAAIP,EAAMQ,OAClBC,EAAkBF,MAAI,GACtBG,EAAyBH,EAAAA,IAAIP,EAAMU,wBACnCC,EAAUJ,EAAAA,IAaX,CAAC,CACJK,MAAO,GACPC,WAAW,GACV,CACDD,MAAO,GACPC,WAAW,GACV,CACDD,MAAO,GACPC,WAAW,GACV,CACDD,MAAO,GACPC,WAAW,KAGPC,EAAmBP,MAAI,GACvBK,EAAQL,MAAI,IACZQ,EAAWR,MAAI,IACfS,EAAeT,OAAI,GACnBU,EAAWV,MAAI,IACfW,EAAYX,MAAI,GAChBY,EAAkBZ,OAAI,GACtBa,EAAab,MAAY,IACzBc,EAAmBC,EAAAA,UAAS,IACb,WAAftB,EAAMuB,KACD,MAEe,aAAfvB,EAAMuB,KACN,MAGA,QAILC,EAAYjB,EAAcA,IAAA,IAE1BkB,EAAqBH,EAAAA,UAAS,KAClC,MAAMI,EAAQ,GAEd,IAAA,IAASC,EADMhB,EAAQiB,MAAMC,OACJF,EAAQ,EAAGA,IAClCD,EAAMI,KAAK,CACTC,MAAO,OAAOJ,KACdC,MAAOD,IAGX,OAAOD,EAAMM,SAAQ,IAEvB,SAASC,IACHjC,EAAMkC,QAGVvB,EAAQiB,MAAME,KAAK,CACjBlB,MAAO,GACPC,WAAW,EACXsB,eAAgBC,EAAQA,WACzB,CA+BH,SAASC,IACPrB,EAAaY,OAAQ,EACrBX,EAASW,MAAQ,EAAA,CAGnB,SAASU,IACH,IAAC1B,EAAMgB,MAET,YADAW,EAAAA,UAAUC,MAAM,aAIf,IAAC/B,EAAgBmB,MAElB,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AAK8B,UAAUC,aAAeJ,IAClF,OAAOC,EAASlC,OAAOC,aAAa,GAAKiC,EAAOzB,WAAa,GAAKwB,CAAA,IACjEK,OAAOC,QAAO,CAIjBvF,EAAMe,WACRA,EAASa,MAAQ5B,EAAMe,UAGrBf,EAAM6D,sBACR5C,EAASW,MAAQ5B,EAAM6D,oBACvB7C,EAAaY,OAAQ,EACvB,6jJAtJO,SAAW4D,EAASC,GACR,WAAfzF,EAAMuB,MAEJkE,GACM9E,EAAAiB,MAAMgB,SAASsC,IACjBA,IAAWM,IACbN,EAAOrE,WAAY,EAAA,IAIzB2E,EAAG3E,UAAY4E,GACS,aAAfzF,EAAMuB,OAEfiE,EAAG3E,UAAY4E,EACjB,6hBArBF,SAAsBjC,GAChB7C,EAAQiB,MAAMC,OAAS,GAAK7B,EAAMkC,QAG9BvB,EAAAiB,MAAM8D,OAAOlC,EAAO,EAAC,gLA2JTV,IACpBxC,EAAasB,MAAQkB,EACrB1B,EAAWQ,MAAQjB,EAAQiB,MAAMkB,GAAG1B,YAAc,QAClDD,EAAgBS,OAAQ,GAH1B,IAAsBkB,kSAxItB,SAAqBQ,GACdA,EAAAnB,eAAiBmB,EAAKqC,cAAgBvD,EAAAA,UACrClC,EAAA,cAAeF,EAAM4F,SAAUtC,EAAI"}
1
+ {"version":3,"file":"subject-single.vue.cjs","sources":["../../../../../../../packages/components/src/subject-list/src/components/subject-single.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { CirclePlus, Remove } from '@element-plus/icons-vue'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport { setGuid } from '@qxs-bns/utils'\nimport SubjectAction from '../../../subject-action/src/subject-action.vue'\nimport SubjectLayout from '../../../subject-layout/src/subject-layout.vue'\nimport TinyMceEditor from '../../../tiny-mce-editor/src/tiny-mce-editor.vue'\n\ndefineOptions({\n name: 'QxsSubjectSingle',\n})\nconst props = defineProps<{\n orderIndex: number\n title?: string\n isSave: boolean\n showAction?: boolean\n type: 'single' | 'multiple' | 'sort'\n isEdit: boolean\n isSet: boolean\n answerList?: any\n leastAnswerCount?: number\n analysis?: string\n examExpand?: string\n examRichTextContent?: string\n showAnalysis?: boolean\n examAnswerRelationType?: number\n customId?: number\n examId?: number\n isKey: boolean\n answerCheckType: number\n}>()\nconst emits = defineEmits(['move', 'save', 'delete', 'edit', 'add', 'setRelation'])\n\nconst attrs = useAttrs()\n\nconst answersIndex = ref(0)\nconst isKey = ref(props.isKey)\nconst answerCheckType = ref(1)\nconst examAnswerRelationType = ref(props.examAnswerRelationType)\nconst answers = ref<{\n title: string\n isCorrect: boolean\n orderIndex?: number\n resultItem?: string\n customAnswerId?: string\n answerRelations?: {\n relationExamId: number\n relationAnswers: {\n relationAnswerId: number\n relationAnswerIndex: number\n }[]\n }[]\n}[]>([{\n title: '',\n isCorrect: false,\n}, {\n title: '',\n isCorrect: false,\n}, {\n title: '',\n isCorrect: false,\n}, {\n title: '',\n isCorrect: false,\n}])\n\nconst leastAnswerCount = ref(2)\nconst title = ref('')\nconst analysis = ref('')\nconst showRichText = ref(false)\nconst richText = ref('')\nconst startTime = ref(0)\nconst showRichContent = ref(false)\nconst resultItem = ref<string>('')\nconst titlePlaceholder = computed(() => {\n if (props.type === 'single') {\n return '单选题'\n }\n else if (props.type === 'multiple') {\n return '多选题'\n }\n else {\n return '排序题'\n }\n})\n\nconst orderList = ref<string[]>([])\n\nconst leastAnswerOptions = computed(() => {\n const items = []\n const length = answers.value.length\n for (let count = length; count > 1; count--) {\n items.push({\n label: `至少选择${count}项`,\n value: count,\n })\n }\n return items.reverse()\n})\nfunction addAnswer() {\n if (props.isSave) {\n return\n }\n answers.value.push({\n title: '',\n isCorrect: false,\n customAnswerId: setGuid(),\n })\n}\n\nfunction deleteAnswer(index: number) {\n if (answers.value.length < 3 || props.isSave) {\n return\n }\n answers.value.splice(index, 1)\n}\n\nfunction setCorrect(it: any, event: any) {\n if (props.type === 'single') {\n // 单选题:确保只有一个支持选项\n if (event) {\n answers.value.forEach((answer: any) => {\n if (answer !== it) {\n answer.isCorrect = false\n }\n })\n }\n it.isCorrect = event\n }\n else if (props.type === 'multiple') {\n // 多选题:可以有多个支持选项\n it.isCorrect = event\n }\n}\nfunction setRelation(item: any) {\n item.customAnswerId = item.examAnswerId || setGuid()\n emits('setRelation', props.customId, item)\n}\n\nfunction deleteRichText() {\n showRichText.value = false\n richText.value = ''\n}\n\nfunction save() {\n if (!title.value) {\n ElMessage.error('题目标题不能为空!')\n return\n }\n // 答题设置必选\n if (!answerCheckType.value) {\n ElMessage.error('请选择答题设置')\n return\n }\n let msg = ''\n let isSetCorrectAnswer = false\n let correctAnswerCount = 0\n if (props.type === 'multiple' || props.type === 'single') {\n answers.value.forEach((v: any, i: number) => {\n if (!v.title?.trim()) {\n msg += `选项${String.fromCharCode(65 + i)}未填写。`\n }\n if (v.isCorrect) {\n isSetCorrectAnswer = true\n correctAnswerCount++\n }\n v.relationType = v.resultItem ? 1 : (v.answerRelations?.length ? 2 : null)\n })\n }\n else if (props.type === 'sort') {\n // 如果设置了支持选项\n if (orderList.value.length) {\n isSetCorrectAnswer = true\n }\n }\n if (msg) {\n ElMessage.error(msg)\n return\n }\n\n const uniqueAnswer = new Set(answers.value.map((item: any) => item.title))\n\n if (uniqueAnswer.size !== answers.value.length) {\n ElMessage.error('选项不能重复')\n return\n }\n\n if (props.type === 'multiple') {\n if (correctAnswerCount === 1) {\n ElMessage.error('请至少设置两个支持选项')\n return\n }\n\n if (isSetCorrectAnswer && correctAnswerCount < leastAnswerCount.value) {\n ElMessage.error('至少选几项与支持选项数不符')\n return\n }\n }\n\n if (answerCheckType.value === 2 || answerCheckType.value === 3) {\n // 必须有设置支持选项\n if (!isSetCorrectAnswer) {\n ElMessage.error('请设置支持选项')\n return\n }\n }\n\n emits('save', {\n title: title.value,\n answers: answers.value.map((item: any, index: number) => {\n return { ...item, orderIndex: index + 1 }\n }),\n examExpand: orderList.value.map((i: string) => i.charCodeAt(0) - 65 + 1).join(','),\n analysis: analysis.value,\n isSetCorrectAnswer,\n leastAnswerCount: leastAnswerCount.value,\n examRichTextContent: showRichText.value ? richText.value : '',\n examAnswerRelationType: examAnswerRelationType.value,\n isKey: isKey.value,\n answerCheckType: answerCheckType.value,\n })\n}\n\nfunction init() {\n if (props.title) {\n title.value = props.title\n }\n\n if (props.answerCheckType) {\n answerCheckType.value = props.answerCheckType\n }\n\n if (props.isKey) {\n isKey.value = props.isKey\n }\n\n if (props.examAnswerRelationType) {\n examAnswerRelationType.value = props.examAnswerRelationType\n }\n\n if (props.answerList && props.answerList.length) {\n answers.value = props.answerList\n }\n\n if (props.leastAnswerCount) {\n leastAnswerCount.value = props.leastAnswerCount\n }\n\n if (props.examExpand) {\n // 设置支持选项 props.examExpand里是答案id\n if (props.examExpand) {\n const correctAnswerIdList = props.examExpand.split(',')\n\n // 遍历 correctAnswerIdList,直接在 props.answerList 中查找对应的 orderIndex 并转换成字母\n orderList.value = correctAnswerIdList.map((id: string) => {\n const answer = props.answerList.find((item: any) => item.answerId?.toString() === id)\n return answer ? String.fromCharCode(65 + answer.orderIndex - 1) : id\n }).filter(Boolean) // 过滤掉任何可能的空字符串\n }\n }\n\n if (props.analysis) {\n analysis.value = props.analysis\n }\n\n if (props.examRichTextContent) {\n richText.value = props.examRichTextContent\n showRichText.value = true\n }\n}\nfunction onOpenResult(i: number) {\n answersIndex.value = i\n resultItem.value = answers.value[i].resultItem || ''\n showRichContent.value = true\n}\n\nfunction onSaveResult() {\n answers.value[answersIndex.value].resultItem = resultItem.value || ''\n showRichContent.value = false\n}\nfunction onCloseResult() {\n showRichContent.value = false\n resultItem.value = ''\n}\nfunction setKey(key: boolean) {\n isKey.value = key\n}\nfunction setAnswerSetting(type: number) {\n answerCheckType.value = type\n}\n\nfunction add(type: string, canSet: boolean) {\n emits('add', type, canSet ? props.examAnswerRelationType : null)\n}\n// 监听isEdit\nwatch(() => props.isEdit, () => {\n if (props.isEdit) {\n startTime.value = new Date().getTime()\n }\n})\n\nconst relationLength = computed(() => {\n return (v: any) => {\n let count = 0\n v.forEach((item: any) => {\n if (item.relationAnswers) {\n count += item.relationAnswers.length\n }\n })\n return count\n }\n})\n\nconst ns = useNamespace('subject-single')\n\nonMounted(init)\n</script>\n\n<template>\n <div :class=\"ns.e('single-exam')\">\n <SubjectLayout\n :show-edit=\"isEdit\"\n >\n <template #preview>\n <div class=\"preview\">\n <div>\n <span class=\"title\">\n {{ orderIndex + 1 }}.{{ title }}\n <span v-if=\"type === 'single'\">(单选题)</span>\n <span v-else-if=\"['multiple', 'sort'].includes(type)\">\n ({{ titlePlaceholder }}{{ leastAnswerCount ? `至少选${leastAnswerCount}项${type === 'sort' ? '并排序' : ''}` : '' }})\n </span>\n </span>\n </div>\n <div v-if=\"showRichText\">\n <div\n class=\"rich-text\"\n v-html=\"richText\"\n />\n </div>\n <div class=\"preview-answer\">\n <template v-if=\"type === 'sort'\">\n <el-checkbox\n v-for=\"(item, index) in answers\"\n :key=\"index\"\n class=\"radio\"\n :disabled=\"true\"\n >\n <span class=\"order\">\n {{ String.fromCharCode(65 + index) }}.\n </span>\n {{ item.title }}\n </el-checkbox>\n </template>\n <template v-else>\n <el-radio\n v-for=\"(item, index) in answers\"\n :key=\"index\"\n class=\"radio\"\n value=\"disabled\"\n disabled\n >\n <span class=\"order\">\n {{ String.fromCharCode(65 + index) }}.\n </span>\n {{ item.title }}\n {{ item.isCorrect ? '(支持选项)' : '' }}\n {{ examAnswerRelationType === 1 ? (item.resultItem ? '(已设置结果项)' : '(未设置结果项)') : '' }}\n {{ examAnswerRelationType === 2 ? (item.answerRelations?.length ? '(已设置关联)' : '(未设置关联)') : '' }}\n </el-radio>\n </template>\n </div>\n </div>\n </template>\n <template\n v-if=\"isEdit\"\n #edit\n >\n <div\n class=\"flex\"\n :class=\"[{ 'margin-bottom': showRichText }]\"\n >\n <div class=\"label flex flex-justify-center\">\n <span>题目:</span>\n </div>\n <div style=\"flex: 1;\">\n <el-input\n v-model=\"title\"\n type=\"textarea\"\n :rows=\"2\"\n :placeholder=\"`【${titlePlaceholder}】请输入问题`\"\n :disabled=\"isSave\"\n show-word-limit\n maxlength=\"200\"\n class=\"margin-bottom\"\n />\n </div>\n </div>\n <div class=\"margin-bottom flex flex-items-center\">\n <div class=\"label flex flex-justify-center\">\n <span>设置:</span>\n </div>\n <el-select\n v-if=\"['multiple', 'sort'].includes(type)\"\n v-model=\"leastAnswerCount\"\n style=\"width: 150px;\"\n placeholder=\"至少选择几项\"\n :disabled=\"isSave\"\n >\n <el-option\n v-for=\"item in leastAnswerOptions\"\n :key=\"item.value\"\n :value=\"item.value\"\n :label=\"item.label\"\n />\n </el-select>\n </div>\n <div class=\"margin-bottom answer-list\">\n <div\n v-for=\"(item, index) in answers\"\n :key=\"index\"\n class=\"answer-item flex flex-items-center\"\n >\n <span class=\"label flex flex-justify-center\">{{ String.fromCharCode(65 + index) }}.</span>\n <el-input\n v-model=\"item.title\"\n class=\"input\"\n show-word-limit\n maxlength=\"100\"\n :placeholder=\"`选项${String.fromCharCode(65 + index)}`\"\n :disabled=\"isSave\"\n />\n <el-checkbox\n v-if=\"['single', 'multiple'].includes(type)\"\n v-model=\"item.isCorrect\"\n :class=\"[{ 'is-correct': item.isCorrect }]\"\n :disabled=\"isSave\"\n style=\"margin-left: 10px;\"\n @change=\"(event: any) => setCorrect(item, event)\"\n >\n 支持选项\n </el-checkbox>\n <el-icon class=\"icon\">\n <CirclePlus\n :class=\"[{ disabled: isSave }]\"\n @click=\"addAnswer\"\n />\n </el-icon>\n <el-icon class=\"icon\">\n <Remove\n :class=\"[{ disabled: answers.length < 3 || isSave }]\"\n @click=\"deleteAnswer(index)\"\n />\n </el-icon>\n <el-link\n v-if=\"examAnswerRelationType === 1 && type !== 'sort'\"\n type=\"primary\"\n class=\"margin-left-10\"\n @click=\"onOpenResult(index)\"\n >\n <span>{{ item.resultItem ? '编辑结果' : '添加结果' }}</span>\n </el-link>\n <el-link\n v-if=\"examAnswerRelationType === 2 && type !== 'sort'\"\n type=\"primary\"\n class=\"margin-left-10\"\n @click=\"setRelation(item)\"\n >\n <span>{{ item.answerRelations?.length ? `关联了${relationLength(item.answerRelations)}项` : '关联检查' }}</span>\n </el-link>\n </div>\n </div>\n <div\n v-if=\"type === 'sort'\"\n class=\"margin-bottom flex flex-items-center\"\n >\n <div class=\"label flex flex-justify-end\">\n <span>排序答案:</span>\n </div>\n <div style=\"flex: 1;\">\n <el-select\n v-model=\"orderList\"\n multiple\n style=\"width: 360px;\"\n placeholder=\"请按顺序选择排序答案\"\n :show-arrow=\"true\"\n >\n <el-option\n v-for=\"(item, index) in answers\"\n :key=\"index\"\n :label=\"item.title\"\n :value=\"String.fromCharCode(65 + index)\"\n />\n </el-select>\n </div>\n </div>\n <div\n v-if=\"showAnalysis\"\n class=\"flex\"\n >\n <div class=\"label flex flex-justify-center\">\n <span>解析:</span>\n </div>\n <div style=\"flex: 1;\">\n <el-input\n v-model=\"analysis\"\n type=\"textarea\"\n :rows=\"2\"\n placeholder=\"请输入题目解析\"\n />\n </div>\n </div>\n <div\n v-if=\"showRichText\"\n class=\"margin-bottom flex\"\n >\n <div class=\"label flex flex-justify-center\">\n <span>富文本:</span>\n </div>\n <div style=\"flex: 1;\">\n <TinyMceEditor\n v-model:model-value=\"richText\"\n v-bind=\"attrs\"\n style=\"width: 100%;\"\n />\n <div class=\"flex flex-justify-end\">\n <el-link\n type=\"danger\"\n @click=\"deleteRichText\"\n >\n 删除富文本\n </el-link>\n </div>\n </div>\n </div>\n </template>\n <SubjectAction\n v-if=\"showAction\"\n :is-edit=\"isEdit\"\n :is-set=\"isSet\"\n :is-key=\"isKey\"\n :show-other-option=\"props.type === 'multiple' || props.type === 'single'\"\n :exam-answer-relation-type=\"props.examAnswerRelationType\"\n :answer-check-type=\"answerCheckType\"\n @move-up=\"emits('move', 'up')\"\n @move-down=\"emits('move', 'down')\"\n @delete=\"emits('delete')\"\n @save=\"save\"\n @edit=\"emits('edit')\"\n @add=\"add\"\n @on-show-rich-text=\"showRichText = true\"\n @set-key=\"setKey\"\n @set-answer-setting=\"setAnswerSetting\"\n />\n </SubjectLayout>\n <el-dialog\n v-model=\"showRichContent\"\n title=\"添加结果\"\n class=\"customize-dialog\"\n >\n <TinyMceEditor\n :key=\"answersIndex\"\n v-model:model-value=\"resultItem\"\n v-bind=\"attrs\"\n style=\"width: 100%;\"\n />\n <template #footer>\n <el-button\n class=\"customize-button\"\n type=\"primary\"\n plain\n @click=\"onCloseResult\"\n >\n 取消\n </el-button>\n <el-button\n class=\"customize-button\"\n type=\"primary\"\n plain\n @click=\"onSaveResult\"\n >\n 保存\n </el-button>\n </template>\n </el-dialog>\n </div>\n</template>\n"],"names":["props","__props","emits","__emit","attrs","useAttrs","answersIndex","ref","isKey","answerCheckType","examAnswerRelationType","answers","title","isCorrect","leastAnswerCount","analysis","showRichText","richText","startTime","showRichContent","resultItem","titlePlaceholder","computed","type","orderList","leastAnswerOptions","items","count","value","length","push","label","reverse","addAnswer","isSave","customAnswerId","setGuid","deleteRichText","save","ElMessage","error","msg","isSetCorrectAnswer","correctAnswerCount","forEach","v","i","trim","String","fromCharCode","relationType","answerRelations","Set","map","item","size","index","orderIndex","examExpand","charCodeAt","join","examRichTextContent","onSaveResult","onCloseResult","setKey","key","setAnswerSetting","add","canSet","watch","isEdit","Date","getTime","relationLength","relationAnswers","ns","useNamespace","onMounted","answerList","correctAnswerIdList","split","id","answer","find","answerId","toString","filter","Boolean","it","event","splice","examAnswerId","customId"],"mappings":"m0EAWA,MAAMA,EAAQC,EAoBRC,EAAQC,EAERC,EAAQC,EAAAA,WAERC,EAAeC,MAAI,GACnBC,EAAQD,EAAAA,IAAIP,EAAMQ,OAClBC,EAAkBF,MAAI,GACtBG,EAAyBH,EAAAA,IAAIP,EAAMU,wBACnCC,EAAUJ,EAAAA,IAaX,CAAC,CACJK,MAAO,GACPC,WAAW,GACV,CACDD,MAAO,GACPC,WAAW,GACV,CACDD,MAAO,GACPC,WAAW,GACV,CACDD,MAAO,GACPC,WAAW,KAGP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AS,GAAK7B,EAAMkC,QAG9BvB,EAAAiB,MAAM8D,OAAOlC,EAAO,EAAC,gLA4JTV,IACpBxC,EAAasB,MAAQkB,EACrB1B,EAAWQ,MAAQjB,EAAQiB,MAAMkB,GAAG1B,YAAc,QAClDD,EAAgBS,OAAQ,GAH1B,IAAsBkB,kSAxItB,SAAqBQ,GACdA,EAAAnB,eAAiBmB,EAAKqC,cAAgBvD,EAAAA,UACrClC,EAAA,cAAeF,EAAM4F,SAAUtC,EAAI"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("element-plus/es");require("element-plus/es/components/base/style/index"),require("element-plus/es/components/link/style/index"),require("element-plus/es/components/button/style/index"),require("element-plus/es/components/icon/style/index"),require("element-plus/es/components/tag/style/index"),require("element-plus/es/components/checkbox-group/style/index"),require("element-plus/es/components/input-number/style/index"),require("element-plus/es/components/input/style/index"),require("element-plus/es/components/checkbox/style/index");var t=require("vue"),l=require("@element-plus/icons-vue"),n=require("@qxs-bns/hooks"),a=require("element-plus"),o=require("../../../subject-action/src/subject-action.vue.cjs"),r=require("../../../subject-layout/src/subject-layout.vue.cjs"),s=require("../../../tiny-mce-editor/src/tiny-mce-editor.vue.cjs");const i={class:"preview"},d={class:"content"},u={class:"title"},c={key:0},m=["innerHTML"],p={class:"content flex flex-col"},f={key:1,class:"flex",style:{"margin-top":"10px",color:"#a8abb2"}},v={class:"title"},x={class:"flex"},V={style:{flex:"1"},class:"margin-bottom"},y={class:"margin-bottom flex flex-items-center"},g={class:"flex"},E={style:{flex:"1"}},k={class:"margin-bottom answer-list"},N={class:"label flex flex-justify-end"},w={class:"answer-tags"},h={class:"operation"},C={key:0,class:"margin-bottom flex"},b={style:{flex:"1"}},B={key:1,class:"margin-bottom flex"},q={style:{flex:"1"}},S={class:"flex flex-justify-end"};var I=t.defineComponent({__name:"subject-text-fill",props:{orderIndex:{type:Number,required:!0},title:{type:String,required:!1},isSave:{type:Boolean,required:!0},showAction:{type:Boolean,required:!1},answerList:{type:null,required:!1},analysis:{type:String,required:!1},isEdit:{type:Boolean,required:!0},isSet:{type:Boolean,required:!0},examExpand:{type:String,required:!1},examAnswerSettingVO:{type:Object,required:!1},examRichTextContent:{type:String,required:!1},showAnalysis:{type:Boolean,required:!1},examAnswerRelationType:{type:Number,required:!1}},emits:["move","save","delete","edit","add"],setup(I,{emit:j}){const O=I,A=j,R=t.useAttrs(),T=t.ref([{title:"",tag:"",showInput:!1}]),_=t.ref(""),L=t.ref(""),M=t.ref(),D=t.ref(""),U=t.ref(!1),F=t.ref(""),z=[{label:"答案不分顺序",value:"isInOrder"},{label:"忽略大小写",value:"isIgnoreCase"}],P=t.ref(["isInOrder","isIgnoreCase"]);function H(){T.value.push({title:"",tag:"",showInput:!1})}function G(){U.value=!1,F.value=""}function $(){if(_.value){if(M.value||D.value){if(!M.value)return void a.ElMessage.error("请完善答题设置!");if(!D.value)return void a.ElMessage.error("请输入问题正确答案!");if(T.value.length!==M.value)return void a.ElMessage.error("关键词个数设置有误!");const e=[];if(T.value.forEach(((t,l)=>{t.title||e.push(`关键词${l+1}未设置`)})),e.length>0)return void a.ElMessage.error(e.join(","))}A("save",{title:_.value,answers:T.value.filter((e=>e.title)).map((e=>({title:e.title}))),analysis:L.value,isSetCorrectAnswer:!!D.value,examExpand:D.value,examAnswerSettingBO:{isIgnoreCase:P.value?.includes("isIgnoreCase"),isInOrder:P.value?.includes("isInOrder"),keywordCount:M.value},examRichTextContent:U.value?F.value:""})}else a.ElMessage.error("题目标题不能为空!")}t.onMounted((function(){O.title&&(_.value=O.title),O.answerList&&O.answerList.length&&(T.value=O.answerList),O.examAnswerSettingVO&&(P.value=P.value.filter((e=>"isIgnoreCase"===e&&O.examAnswerSettingVO?.isIgnoreCase||"isInOrder"===e&&O.examAnswerSettingVO?.isInOrder))),O.examAnswerSettingVO?.keywordCount&&(M.value=O.examAnswerSettingVO?.keywordCount),O.examExpand&&(D.value=O.examExpand),O.analysis&&(L.value=O.analysis),O.examRichTextContent&&(F.value=O.examRichTextContent,U.value=!0)}));const J=n.useNamespace("subject-text-fill");return(n,a)=>{const I=e.ElCheckbox,j=e.ElInput,K=e.ElInputNumber,Q=e.ElCheckboxGroup,W=e.ElTag,X=e.ElIcon,Y=e.ElButton,Z=e.ElLink;return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(t.unref(J).e("text-fill-exam"))},[t.createVNode(r.default,{"show-edit":n.isEdit},{preview:t.withCtx((()=>[t.createElementVNode("div",i,[t.createElementVNode("div",d,[t.createElementVNode("span",u,t.toDisplayString(n.orderIndex+1)+"."+t.toDisplayString(t.unref(_))+"(问答题)",1),t.unref(U)?(t.openBlock(),t.createElementBlock("div",c,[t.createElementVNode("div",{innerHTML:t.unref(F),class:"rich-text"},null,8,m)])):t.createCommentVNode("v-if",!0),t.createElementVNode("div",p,[t.unref(T).some((e=>e.title))?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(t.unref(T),((e,l)=>(t.openBlock(),t.createBlock(I,{key:l,class:"radio",disabled:!0},{default:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(e.title),1)])),_:2},1024)))),128)):t.createCommentVNode("v-if",!0)]),t.unref(D)?(t.openBlock(),t.createElementBlock("div",f,[t.createElementVNode("span",v,"正确答案:"+t.toDisplayString(t.unref(D)),1)])):t.createCommentVNode("v-if",!0)])])])),edit:t.withCtx((()=>[t.createElementVNode("div",x,[a[12]||(a[12]=t.createElementVNode("div",{class:"label flex flex-justify-end"},[t.createElementVNode("span",null,"题目:")],-1)),t.createElementVNode("div",V,[t.createVNode(j,{modelValue:t.unref(_),"onUpdate:modelValue":a[0]||(a[0]=e=>t.isRef(_)?_.value=e:null),type:"textarea",rows:2,placeholder:"【问答题】请输入问题",maxlength:200,"show-word-limit":"",disabled:n.isSave},null,8,["modelValue","disabled"])])]),t.createElementVNode("div",y,[a[13]||(a[13]=t.createElementVNode("div",{class:"label flex flex-justify-end"},[t.createElementVNode("span",null,"答题设置:")],-1)),a[14]||(a[14]=t.createElementVNode("span",null,"共答对",-1)),t.createVNode(K,{modelValue:t.unref(M),"onUpdate:modelValue":a[1]||(a[1]=e=>t.isRef(M)?M.value=e:null),style:{width:"100px",margin:"0 10px"},min:1},null,8,["modelValue"]),a[15]||(a[15]=t.createElementVNode("span",{style:{"margin-right":"10px"}},"个关键词,算是正确的",-1)),(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(z,(e=>t.createVNode(Q,{key:e.value,modelValue:t.unref(P),"onUpdate:modelValue":a[2]||(a[2]=e=>t.isRef(P)?P.value=e:null)},{default:t.withCtx((()=>[t.createVNode(I,{label:e.value,class:"margin-left-10"},{default:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(e.label),1)])),_:2},1032,["label"])])),_:2},1032,["modelValue"]))),64))]),t.createElementVNode("div",g,[a[16]||(a[16]=t.createElementVNode("div",{class:"label flex flex-justify-end"},[t.createElementVNode("span",null,"答案:")],-1)),t.createElementVNode("div",E,[t.createVNode(j,{modelValue:t.unref(D),"onUpdate:modelValue":a[3]||(a[3]=e=>t.isRef(D)?D.value=e:null),type:"textarea",rows:2,placeholder:"请输入正确答案",maxlength:200,"show-word-limit":"",disabled:n.isSave},null,8,["modelValue","disabled"])])]),t.createElementVNode("div",k,[a[17]||(a[17]=t.createElementVNode("span",{style:{"padding-left":"60px"}},"*如遇包含特殊字符的关键词,需添加多个同义词,例:'CO₂'需添加同义词'CO2'",-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(T),((e,a)=>(t.openBlock(),t.createElementBlock("div",{key:a,class:"answer-item flex flex-items-center"},[t.createElementVNode("div",N,[t.createElementVNode("span",null,"关键词"+t.toDisplayString(a+1)+":",1)]),t.createElementVNode("div",w,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.title.split(","),(l=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:l},[l?(t.openBlock(),t.createBlock(W,{key:0,closable:"",onClose:t=>function(e,t){if(e){const l=t.title.split(","),n=l.findIndex((t=>t===e));n>-1&&(l.splice(n,1),t.title=l.join(","))}}(l,e)},{default:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(l),1)])),_:2},1032,["onClose"])):t.createCommentVNode("v-if",!0)],64)))),128)),n.isSave?t.createCommentVNode("v-if",!0):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[e.showInput?(t.openBlock(),t.createBlock(j,{key:0,modelValue:e.tag,"onUpdate:modelValue":t=>e.tag=t,style:{width:"80px"},onBlur:()=>function(e){e.showInput=!1,e.tag&&(e.title=e.title?[e.title,e.tag].join(","):e.tag,e.tag="")}(e)},null,8,["modelValue","onUpdate:modelValue","onBlur"])):(t.openBlock(),t.createBlock(Y,{key:1,size:"small",onClick:t=>e.showInput=!0},{default:t.withCtx((()=>[t.createVNode(X,null,{default:t.withCtx((()=>[t.createVNode(t.unref(l.Plus))])),_:1}),t.createElementVNode("span",null,t.toDisplayString(e.title?"添加同义词":"添加关键词"),1)])),_:2},1032,["onClick"]))],64))]),t.createElementVNode("div",h,[t.createVNode(X,{class:"icon"},{default:t.withCtx((()=>[t.createVNode(t.unref(l.CirclePlus),{class:t.normalizeClass([{disabled:n.isSave}]),onClick:H},null,8,["class"])])),_:1}),t.createVNode(X,{class:"icon"},{default:t.withCtx((()=>[t.createVNode(t.unref(l.Remove),{class:t.normalizeClass([{disabled:t.unref(T).length<2||n.isSave}]),onClick:e=>function(e){T.value.length<2||O.isSave||T.value.splice(e,1)}(a)},null,8,["class","onClick"])])),_:2},1024)])])))),128))]),n.showAnalysis?(t.openBlock(),t.createElementBlock("div",C,[a[18]||(a[18]=t.createElementVNode("div",{class:"label flex flex-justify-end"},[t.createElementVNode("span",null,"解析:")],-1)),t.createElementVNode("div",b,[t.createVNode(j,{modelValue:t.unref(L),"onUpdate:modelValue":a[4]||(a[4]=e=>t.isRef(L)?L.value=e:null),type:"textarea",rows:2,placeholder:"请输入题目解析"},null,8,["modelValue"])])])):t.createCommentVNode("v-if",!0),t.unref(U)?(t.openBlock(),t.createElementBlock("div",B,[a[20]||(a[20]=t.createElementVNode("div",{class:"label flex flex-justify-center"},[t.createElementVNode("span",null,"富文本:")],-1)),t.createElementVNode("div",q,[t.createVNode(s.default,t.mergeProps({"model-value":t.unref(F),"onUpdate:modelValue":a[5]||(a[5]=e=>t.isRef(F)?F.value=e:null)},t.unref(R),{style:{width:"100%"}}),null,16,["model-value"]),t.createElementVNode("div",S,[t.createVNode(Z,{type:"danger",onClick:G},{default:t.withCtx((()=>a[19]||(a[19]=[t.createTextVNode(" 删除富文本 ")]))),_:1})])])])):t.createCommentVNode("v-if",!0)])),default:t.withCtx((()=>[n.showAction?(t.openBlock(),t.createBlock(o.default,{key:0,"is-edit":n.isEdit,"is-set":n.isSet,showOtherOption:!1,examAnswerRelationType:O.examAnswerRelationType,onMoveUp:a[6]||(a[6]=e=>A("move","up")),onMoveDown:a[7]||(a[7]=e=>A("move","down")),onDelete:a[8]||(a[8]=e=>A("delete")),onSave:$,onEdit:a[9]||(a[9]=e=>A("edit")),onAdd:a[10]||(a[10]=e=>A("add",e)),onOnShowRichText:a[11]||(a[11]=e=>U.value=!0)},null,8,["is-edit","is-set","examAnswerRelationType"])):t.createCommentVNode("v-if",!0)])),_:1},8,["show-edit"])],2)}}});exports.default=I;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("element-plus/es");require("element-plus/es/components/base/style/index"),require("element-plus/es/components/link/style/index"),require("element-plus/es/components/button/style/index"),require("element-plus/es/components/icon/style/index"),require("element-plus/es/components/tag/style/index"),require("element-plus/es/components/checkbox-group/style/index"),require("element-plus/es/components/input-number/style/index"),require("element-plus/es/components/input/style/index"),require("element-plus/es/components/checkbox/style/index");var t=require("vue"),l=require("@element-plus/icons-vue"),n=require("@qxs-bns/hooks"),a=require("element-plus"),o=require("../../../subject-action/src/subject-action.vue.cjs"),r=require("../../../subject-layout/src/subject-layout.vue.cjs"),s=require("../../../tiny-mce-editor/src/tiny-mce-editor.vue.cjs");const i={class:"preview"},d={class:"content"},u={class:"title"},c={key:0},m=["innerHTML"],p={class:"content flex flex-col"},f={key:1,class:"flex",style:{"margin-top":"10px",color:"#a8abb2"}},v={class:"title"},x={class:"flex"},V={style:{flex:"1"},class:"margin-bottom"},y={class:"margin-bottom flex flex-items-center"},g={class:"flex"},E={style:{flex:"1"}},k={class:"margin-bottom answer-list"},N={class:"label flex flex-justify-end"},w={class:"answer-tags"},h={class:"operation"},C={key:0,class:"margin-bottom flex"},b={style:{flex:"1"}},B={key:1,class:"margin-bottom flex"},q={style:{flex:"1"}},S={class:"flex flex-justify-end"};var I=t.defineComponent({__name:"subject-text-fill",props:{orderIndex:{type:Number,required:!0},title:{type:String,required:!1},isSave:{type:Boolean,required:!0},showAction:{type:Boolean,required:!1},answerList:{type:null,required:!1},analysis:{type:String,required:!1},isEdit:{type:Boolean,required:!0},isSet:{type:Boolean,required:!0},examExpand:{type:String,required:!1},examAnswerSettingVO:{type:Object,required:!1},examRichTextContent:{type:String,required:!1},showAnalysis:{type:Boolean,required:!1},examAnswerRelationType:{type:Number,required:!1}},emits:["move","save","delete","edit","add"],setup(I,{emit:j}){const O=I,A=j,R=t.useAttrs(),T=t.ref([{title:"",tag:"",showInput:!1}]),_=t.ref(""),L=t.ref(""),M=t.ref(),D=t.ref(""),U=t.ref(!1),F=t.ref(""),z=[{label:"答案不分顺序",value:"isInOrder"},{label:"忽略大小写",value:"isIgnoreCase"}],P=t.ref(["isInOrder","isIgnoreCase"]);function H(){T.value.push({title:"",tag:"",showInput:!1})}function G(){U.value=!1,F.value=""}function $(){if(_.value){if(M.value||D.value){if(!M.value)return void a.ElMessage.error("请完善答题设置!");if(!D.value)return void a.ElMessage.error("请输入问题正确答案!");if(T.value.length!==M.value)return void a.ElMessage.error("关键词个数设置有误!");const e=[];if(T.value.forEach(((t,l)=>{t.title||e.push(`关键词${l+1}未设置`)})),e.length>0)return void a.ElMessage.error(e.join(","))}A("save",{title:_.value,answers:T.value.filter((e=>e.title)).map((e=>({title:e.title}))),analysis:L.value,isSetCorrectAnswer:!!D.value,examExpand:D.value,examAnswerSettingBO:{isIgnoreCase:P.value?.includes("isIgnoreCase"),isInOrder:P.value?.includes("isInOrder"),keywordCount:M.value},examRichTextContent:U.value?F.value:""})}else a.ElMessage.error("题目标题不能为空!")}t.onMounted((function(){O.title&&(_.value=O.title),O.answerList&&O.answerList.length&&(T.value=O.answerList),O.examAnswerSettingVO&&(P.value=P.value.filter((e=>"isIgnoreCase"===e&&O.examAnswerSettingVO?.isIgnoreCase||"isInOrder"===e&&O.examAnswerSettingVO?.isInOrder))),O.examAnswerSettingVO?.keywordCount&&(M.value=O.examAnswerSettingVO?.keywordCount),O.examExpand&&(D.value=O.examExpand),O.analysis&&(L.value=O.analysis),O.examRichTextContent&&(F.value=O.examRichTextContent,U.value=!0)}));const J=n.useNamespace("subject-text-fill");return(n,a)=>{const I=e.ElCheckbox,j=e.ElInput,K=e.ElInputNumber,Q=e.ElCheckboxGroup,W=e.ElTag,X=e.ElIcon,Y=e.ElButton,Z=e.ElLink;return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(t.unref(J).e("text-fill-exam"))},[t.createVNode(r.default,{"show-edit":n.isEdit},{preview:t.withCtx((()=>[t.createElementVNode("div",i,[t.createElementVNode("div",d,[t.createElementVNode("span",u,t.toDisplayString(n.orderIndex+1)+"."+t.toDisplayString(t.unref(_))+"(问答题)",1),t.unref(U)?(t.openBlock(),t.createElementBlock("div",c,[t.createElementVNode("div",{class:"rich-text",innerHTML:t.unref(F)},null,8,m)])):t.createCommentVNode("v-if",!0),t.createElementVNode("div",p,[t.unref(T).some((e=>e.title))?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(t.unref(T),((e,l)=>(t.openBlock(),t.createBlock(I,{key:l,class:"radio",disabled:!0},{default:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(e.title),1)])),_:2},1024)))),128)):t.createCommentVNode("v-if",!0)]),t.unref(D)?(t.openBlock(),t.createElementBlock("div",f,[t.createElementVNode("span",v,"正确答案:"+t.toDisplayString(t.unref(D)),1)])):t.createCommentVNode("v-if",!0)])])])),edit:t.withCtx((()=>[t.createElementVNode("div",x,[a[12]||(a[12]=t.createElementVNode("div",{class:"label flex flex-justify-end"},[t.createElementVNode("span",null,"题目:")],-1)),t.createElementVNode("div",V,[t.createVNode(j,{modelValue:t.unref(_),"onUpdate:modelValue":a[0]||(a[0]=e=>t.isRef(_)?_.value=e:null),type:"textarea",rows:2,placeholder:"【问答题】请输入问题",maxlength:200,"show-word-limit":"",disabled:n.isSave},null,8,["modelValue","disabled"])])]),t.createElementVNode("div",y,[a[13]||(a[13]=t.createElementVNode("div",{class:"label flex flex-justify-end"},[t.createElementVNode("span",null,"答题设置:")],-1)),a[14]||(a[14]=t.createElementVNode("span",null,"共答对",-1)),t.createVNode(K,{modelValue:t.unref(M),"onUpdate:modelValue":a[1]||(a[1]=e=>t.isRef(M)?M.value=e:null),style:{width:"100px",margin:"0 10px"},min:1},null,8,["modelValue"]),a[15]||(a[15]=t.createElementVNode("span",{style:{"margin-right":"10px"}},"个关键词,算是正确的",-1)),(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(z,(e=>t.createVNode(Q,{key:e.value,modelValue:t.unref(P),"onUpdate:modelValue":a[2]||(a[2]=e=>t.isRef(P)?P.value=e:null)},{default:t.withCtx((()=>[t.createVNode(I,{label:e.value,class:"margin-left-10"},{default:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(e.label),1)])),_:2},1032,["label"])])),_:2},1032,["modelValue"]))),64))]),t.createElementVNode("div",g,[a[16]||(a[16]=t.createElementVNode("div",{class:"label flex flex-justify-end"},[t.createElementVNode("span",null,"答案:")],-1)),t.createElementVNode("div",E,[t.createVNode(j,{modelValue:t.unref(D),"onUpdate:modelValue":a[3]||(a[3]=e=>t.isRef(D)?D.value=e:null),type:"textarea",rows:2,placeholder:"请输入正确答案",maxlength:200,"show-word-limit":"",disabled:n.isSave},null,8,["modelValue","disabled"])])]),t.createElementVNode("div",k,[a[17]||(a[17]=t.createElementVNode("span",{style:{"padding-left":"60px"}},"*如遇包含特殊字符的关键词,需添加多个同义词,例:'CO₂'需添加同义词'CO2'",-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(T),((e,a)=>(t.openBlock(),t.createElementBlock("div",{key:a,class:"answer-item flex flex-items-center"},[t.createElementVNode("div",N,[t.createElementVNode("span",null,"关键词"+t.toDisplayString(a+1)+":",1)]),t.createElementVNode("div",w,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.title.split(","),(l=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:l},[l?(t.openBlock(),t.createBlock(W,{key:0,closable:"",onClose:t=>function(e,t){if(e){const l=t.title.split(","),n=l.findIndex((t=>t===e));n>-1&&(l.splice(n,1),t.title=l.join(","))}}(l,e)},{default:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(l),1)])),_:2},1032,["onClose"])):t.createCommentVNode("v-if",!0)],64)))),128)),n.isSave?t.createCommentVNode("v-if",!0):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[e.showInput?(t.openBlock(),t.createBlock(j,{key:0,modelValue:e.tag,"onUpdate:modelValue":t=>e.tag=t,style:{width:"80px"},onBlur:()=>function(e){e.showInput=!1,e.tag&&(e.title=e.title?[e.title,e.tag].join(","):e.tag,e.tag="")}(e)},null,8,["modelValue","onUpdate:modelValue","onBlur"])):(t.openBlock(),t.createBlock(Y,{key:1,size:"small",onClick:t=>e.showInput=!0},{default:t.withCtx((()=>[t.createVNode(X,null,{default:t.withCtx((()=>[t.createVNode(t.unref(l.Plus))])),_:1}),t.createElementVNode("span",null,t.toDisplayString(e.title?"添加同义词":"添加关键词"),1)])),_:2},1032,["onClick"]))],64))]),t.createElementVNode("div",h,[t.createVNode(X,{class:"icon"},{default:t.withCtx((()=>[t.createVNode(t.unref(l.CirclePlus),{class:t.normalizeClass([{disabled:n.isSave}]),onClick:H},null,8,["class"])])),_:1}),t.createVNode(X,{class:"icon"},{default:t.withCtx((()=>[t.createVNode(t.unref(l.Remove),{class:t.normalizeClass([{disabled:t.unref(T).length<2||n.isSave}]),onClick:e=>function(e){T.value.length<2||O.isSave||T.value.splice(e,1)}(a)},null,8,["class","onClick"])])),_:2},1024)])])))),128))]),n.showAnalysis?(t.openBlock(),t.createElementBlock("div",C,[a[18]||(a[18]=t.createElementVNode("div",{class:"label flex flex-justify-end"},[t.createElementVNode("span",null,"解析:")],-1)),t.createElementVNode("div",b,[t.createVNode(j,{modelValue:t.unref(L),"onUpdate:modelValue":a[4]||(a[4]=e=>t.isRef(L)?L.value=e:null),type:"textarea",rows:2,placeholder:"请输入题目解析"},null,8,["modelValue"])])])):t.createCommentVNode("v-if",!0),t.unref(U)?(t.openBlock(),t.createElementBlock("div",B,[a[20]||(a[20]=t.createElementVNode("div",{class:"label flex flex-justify-center"},[t.createElementVNode("span",null,"富文本:")],-1)),t.createElementVNode("div",q,[t.createVNode(s.default,t.mergeProps({"model-value":t.unref(F),"onUpdate:modelValue":a[5]||(a[5]=e=>t.isRef(F)?F.value=e:null)},t.unref(R),{style:{width:"100%"}}),null,16,["model-value"]),t.createElementVNode("div",S,[t.createVNode(Z,{type:"danger",onClick:G},{default:t.withCtx((()=>a[19]||(a[19]=[t.createTextVNode(" 删除富文本 ")]))),_:1})])])])):t.createCommentVNode("v-if",!0)])),default:t.withCtx((()=>[n.showAction?(t.openBlock(),t.createBlock(o.default,{key:0,"is-edit":n.isEdit,"is-set":n.isSet,"show-other-option":!1,"exam-answer-relation-type":O.examAnswerRelationType,onMoveUp:a[6]||(a[6]=e=>A("move","up")),onMoveDown:a[7]||(a[7]=e=>A("move","down")),onDelete:a[8]||(a[8]=e=>A("delete")),onSave:$,onEdit:a[9]||(a[9]=e=>A("edit")),onAdd:a[10]||(a[10]=e=>A("add",e)),onOnShowRichText:a[11]||(a[11]=e=>U.value=!0)},null,8,["is-edit","is-set","exam-answer-relation-type"])):t.createCommentVNode("v-if",!0)])),_:1},8,["show-edit"])],2)}}});exports.default=I;
2
2
  //# sourceMappingURL=subject-text-fill.vue.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"subject-text-fill.vue.cjs","sources":["../../../../../../../packages/components/src/subject-list/src/components/subject-text-fill.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { CirclePlus, Plus, Remove } from '@element-plus/icons-vue'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport { ElMessage } from 'element-plus'\nimport SubjectAction from '../../../subject-action/src/subject-action.vue'\nimport SubjectLayout from '../../../subject-layout/src/subject-layout.vue'\nimport TinyMceEditor from '../../../tiny-mce-editor/src/tiny-mce-editor.vue'\n\nconst props = defineProps<{\n orderIndex: number\n title?: string\n isSave: boolean\n showAction?: boolean\n answerList?: any\n analysis?: string\n isEdit: boolean\n isSet: boolean\n examExpand?: string\n examAnswerSettingVO?: {\n isInOrder: boolean\n isIgnoreCase: boolean\n keywordCount: number\n }\n examRichTextContent?: string\n showAnalysis?: boolean\n examAnswerRelationType?: number\n}>()\nconst emits = defineEmits(['move', 'save', 'delete', 'edit', 'add'])\n\nconst attrs = useAttrs()\n\nconst answers = ref<{\n title: string\n tag: string\n showInput: boolean\n}[]>([{\n title: '',\n tag: '',\n showInput: false,\n}])\n\nconst title = ref('')\nconst analysis = ref('')\nconst keywordCount = ref()\nconst correct = ref('')\nconst showRichText = ref(false)\nconst richText = ref('')\n\nconst checkList = [\n {\n label: '答案不分顺序',\n value: 'isInOrder',\n },\n {\n label: '忽略大小写',\n value: 'isIgnoreCase',\n },\n]\n\nconst isCheckList = ref(['isInOrder', 'isIgnoreCase'])\n\nfunction handleAddTag(item: any) {\n item.showInput = false\n if (item.tag) {\n item.title = item.title ? [item.title, item.tag].join(',') : item.tag\n item.tag = ''\n }\n}\n\nfunction closeTag(tag: string, item: any) {\n if (tag) {\n const tags = item.title.split(',')\n const index = tags.findIndex((i: string) => i === tag)\n if (index > -1) {\n tags.splice(index, 1)\n item.title = tags.join(',')\n }\n }\n}\n\nfunction addAnswer() {\n answers.value.push({\n title: '',\n tag: '',\n showInput: false,\n })\n}\n\nfunction deleteAnswer(index: number) {\n if (answers.value.length < 2 || props.isSave) {\n return\n }\n answers.value.splice(index, 1)\n}\n\nfunction deleteRichText() {\n showRichText.value = false\n richText.value = ''\n}\n\nfunction save() {\n if (!title.value) {\n ElMessage.error('题目标题不能为空!')\n return\n }\n\n if (keywordCount.value || correct.value) {\n if (!keywordCount.value) {\n ElMessage.error('请完善答题设置!')\n return\n }\n\n if (!correct.value) {\n ElMessage.error('请输入问题正确答案!')\n return\n }\n\n if (answers.value.length !== keywordCount.value) {\n ElMessage.error('关键词个数设置有误!')\n return\n }\n const msg: string[] = []\n answers.value.forEach((item, index) => {\n if (!item.title) {\n msg.push(`关键词${index + 1}未设置`)\n }\n })\n if (msg.length > 0) {\n ElMessage.error(msg.join(','))\n return\n }\n }\n\n emits('save', {\n title: title.value,\n answers: answers.value.filter((i: any) => i.title).map((item: any) => {\n return { title: item.title }\n }),\n analysis: analysis.value,\n isSetCorrectAnswer: !!correct.value,\n examExpand: correct.value,\n examAnswerSettingBO: {\n isIgnoreCase: isCheckList.value?.includes('isIgnoreCase'),\n isInOrder: isCheckList.value?.includes('isInOrder'),\n ...{ keywordCount: keywordCount.value },\n },\n examRichTextContent: showRichText.value ? richText.value : '',\n })\n}\n\nfunction init() {\n if (props.title) {\n title.value = props.title\n }\n\n if (props.answerList && props.answerList.length) {\n answers.value = props.answerList\n }\n\n if (props.examAnswerSettingVO) {\n // 仅保留与设置匹配的选项\n isCheckList.value = isCheckList.value.filter(item =>\n (item === 'isIgnoreCase' && props.examAnswerSettingVO?.isIgnoreCase)\n || (item === 'isInOrder' && props.examAnswerSettingVO?.isInOrder),\n )\n }\n\n if (props.examAnswerSettingVO?.keywordCount) {\n keywordCount.value = props.examAnswerSettingVO?.keywordCount\n }\n\n if (props.examExpand) {\n correct.value = props.examExpand\n }\n\n if (props.analysis) {\n analysis.value = props.analysis\n }\n\n if (props.examRichTextContent) {\n richText.value = props.examRichTextContent\n showRichText.value = true\n }\n}\n\nonMounted(init)\nconst ns = useNamespace('subject-text-fill')\n</script>\n\n<template>\n <div :class=\"ns.e('text-fill-exam')\">\n <SubjectLayout :show-edit=\"isEdit\">\n <template #preview>\n <div class=\"preview\">\n <div class=\"content\">\n <span class=\"title\">{{ orderIndex + 1 }}.{{ title }}(问答题)</span>\n <div v-if=\"showRichText\">\n <div v-html=\"richText\" class=\"rich-text\" />\n </div>\n <div class=\"content flex flex-col\">\n <template v-if=\"answers.some(item => item.title)\">\n <el-checkbox\n v-for=\"(item, index) in answers\"\n :key=\"index\"\n class=\"radio\"\n :disabled=\"true\"\n >\n {{ item.title }}\n </el-checkbox>\n </template>\n </div>\n <div\n v-if=\"correct\"\n class=\"flex\"\n style=\"margin-top: 10px;color: #a8abb2;\"\n >\n <span class=\"title\">正确答案:{{ correct }}</span>\n </div>\n </div>\n </div>\n </template>\n <template #edit>\n <div class=\"flex\">\n <div class=\"label flex flex-justify-end\">\n <span>题目:</span>\n </div>\n <div style=\"flex: 1;\" class=\"margin-bottom\">\n <el-input\n v-model=\"title\"\n type=\"textarea\"\n :rows=\"2\"\n placeholder=\"【问答题】请输入问题\"\n :maxlength=\"200\"\n show-word-limit\n :disabled=\"isSave\"\n />\n </div>\n </div>\n <div class=\"margin-bottom flex flex-items-center\">\n <div class=\"label flex flex-justify-end\">\n <span>答题设置:</span>\n </div>\n <span>共答对</span>\n <el-input-number\n v-model=\"keywordCount\"\n style=\"width: 100px;margin: 0 10px;\"\n :min=\"1\"\n />\n <span style=\"margin-right: 10px;\">个关键词,算是正确的</span>\n <el-checkbox-group\n v-for=\"item in checkList\"\n :key=\"item.value\"\n v-model=\"isCheckList\"\n >\n <el-checkbox :label=\"item.value\" class=\"margin-left-10\">\n {{ item.label }}\n </el-checkbox>\n </el-checkbox-group>\n </div>\n <div class=\"flex\">\n <div class=\"label flex flex-justify-end\">\n <span>答案:</span>\n </div>\n <div style=\"flex: 1;\">\n <el-input\n v-model=\"correct\"\n type=\"textarea\"\n :rows=\"2\"\n placeholder=\"请输入正确答案\"\n :maxlength=\"200\"\n show-word-limit\n :disabled=\"isSave\"\n />\n </div>\n </div>\n <div class=\"margin-bottom answer-list\">\n <span style=\"padding-left: 60px;\">*如遇包含特殊字符的关键词,需添加多个同义词,例:'CO₂'需添加同义词'CO2'</span>\n <div\n v-for=\"(item, index) in answers\"\n :key=\"index\"\n class=\"answer-item flex flex-items-center\"\n >\n <div class=\"label flex flex-justify-end\">\n <span>关键词{{ index + 1 }}:</span>\n </div>\n\n <div class=\"answer-tags\">\n <template\n v-for=\"i in item.title.split(',')\"\n :key=\"i\"\n >\n <el-tag\n v-if=\"i\"\n closable\n @close=\"closeTag(i, item)\"\n >\n {{ i }}\n </el-tag>\n </template>\n <template v-if=\"!isSave\">\n <el-input\n v-if=\"item.showInput\"\n v-model=\"item.tag\"\n style=\"width: 80px;\"\n @blur=\"() => handleAddTag(item)\"\n />\n <el-button\n v-else\n size=\"small\"\n @click=\"item.showInput = true\"\n >\n <el-icon><Plus /></el-icon>\n <span>{{ item.title ? '添加同义词' : '添加关键词' }}</span>\n </el-button>\n </template>\n </div>\n <div class=\"operation\">\n <el-icon class=\"icon\">\n <CirclePlus\n :class=\"[{ disabled: isSave }]\"\n @click=\"addAnswer\"\n />\n </el-icon>\n <el-icon class=\"icon\">\n <Remove\n :class=\"[{ disabled: answers.length < 2 || isSave }]\"\n @click=\"deleteAnswer(index)\"\n />\n </el-icon>\n </div>\n </div>\n </div>\n <div v-if=\"showAnalysis\" class=\"margin-bottom flex\">\n <div class=\"label flex flex-justify-end\">\n <span>解析:</span>\n </div>\n <div style=\"flex: 1;\">\n <el-input\n v-model=\"analysis\"\n type=\"textarea\"\n :rows=\"2\"\n placeholder=\"请输入题目解析\"\n />\n </div>\n </div>\n <div v-if=\"showRichText\" class=\"margin-bottom flex\">\n <div class=\"label flex flex-justify-center\">\n <span>富文本:</span>\n </div>\n <div style=\"flex: 1;\">\n <TinyMceEditor v-model:model-value=\"richText\" v-bind=\"attrs\" style=\"width: 100%;\" />\n <div class=\"flex flex-justify-end\">\n <el-link\n type=\"danger\"\n @click=\"deleteRichText\"\n >\n 删除富文本\n </el-link>\n </div>\n </div>\n </div>\n </template>\n <SubjectAction\n v-if=\"showAction\"\n :is-edit=\"isEdit\"\n :is-set=\"isSet\"\n :showOtherOption=\"false\"\n :examAnswerRelationType=\"props.examAnswerRelationType\"\n @move-up=\"emits('move', 'up')\"\n @move-down=\"emits('move', 'down')\"\n @delete=\"emits('delete')\"\n @save=\"save\"\n @edit=\"emits('edit')\"\n @add=\"type => emits('add', type)\"\n @onShowRichText=\"showRichText = true\"\n />\n </SubjectLayout>\n </div>\n</template>\n"],"names":["props","__props","emits","__emit","attrs","useAttrs","answers","ref","title","tag","showInput","analysis","keywordCount","correct","showRichText","richText","checkList","label","value","isCheckList","addAnswer","push","deleteRichText","save","ElMessage","error","length","msg","forEach","item","index","join","filter","i","map","isSetCorrectAnswer","examExpand","examAnswerSettingBO","isIgnoreCase","includes","isInOrder","examRichTextContent","onMounted","answerList","examAnswerSettingVO","ns","useNamespace","tags","split","findIndex","splice","isSave"],"mappings":"8nEAQA,MAAMA,EAAQC,EAmBRC,EAAQC,EAERC,EAAQC,EAAAA,WAERC,EAAUC,EAAAA,IAIX,CAAC,CACJC,MAAO,GACPC,IAAK,GACLC,WAAW,KAGPF,EAAQD,MAAI,IACZI,EAAWJ,MAAI,IACfK,EAAeL,EAAAA,MACfM,EAAUN,MAAI,IACdO,EAAeP,OAAI,GACnBQ,EAAWR,MAAI,IAEfS,EAAY,CAChB,CACEC,MAAO,SACPC,MAAO,aAET,CACED,MAAO,QACPC,MAAO,iBAILC,EAAcZ,EAAAA,IAAI,CAAC,YAAa,iBAqBtC,SAASa,IACPd,EAAQY,MAAMG,KAAK,CACjBb,MAAO,GACPC,IAAK,GACLC,WAAW,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,aAIvDxC,EAAM4C,qBAAqBhC,eAChBA,EAAAM,MAAQlB,EAAM4C,qBAAqBhC,cAG9CZ,EAAMoC,aACRvB,EAAQK,MAAQlB,EAAMoC,YAGpBpC,EAAMW,WACRA,EAASO,MAAQlB,EAAMW,UAGrBX,EAAMyC,sBACR1B,EAASG,MAAQlB,EAAMyC,oBACvB3B,EAAaI,OAAQ,EACvB,IAII,MAAA2B,EAAKC,eAAa,0hHArHf,SAASrC,EAAaoB,GAC7B,GAAIpB,EAAK,CACP,MAAMsC,EAAOlB,EAAKrB,MAAMwC,MAAM,KACxBlB,EAAQiB,EAAKE,WAAWhB,GAAcA,IAAMxB,IAC9CqB,GAAQ,IACLiB,EAAAG,OAAOpB,EAAO,GACdD,EAAArB,MAAQuC,EAAKhB,KAAK,KACzB,CACF,yXAhBF,SAAsBF,GACpBA,EAAKnB,WAAY,EACbmB,EAAKpB,MACPoB,EAAKrB,MAAQqB,EAAKrB,MAAQ,CAACqB,EAAKrB,MAAOqB,EAAKpB,KAAKsB,KAAK,KAAOF,EAAKpB,IAClEoB,EAAKpB,IAAM,GACb,kuBAsBF,SAAsBqB,GAChBxB,EAAQY,MAAMQ,OAAS,GAAK1B,EAAMmD,QAG9B7C,EAAAY,MAAMgC,OAAOpB,EAAO,EAAC"}
1
+ {"version":3,"file":"subject-text-fill.vue.cjs","sources":["../../../../../../../packages/components/src/subject-list/src/components/subject-text-fill.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { CirclePlus, Plus, Remove } from '@element-plus/icons-vue'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport { ElMessage } from 'element-plus'\nimport SubjectAction from '../../../subject-action/src/subject-action.vue'\nimport SubjectLayout from '../../../subject-layout/src/subject-layout.vue'\nimport TinyMceEditor from '../../../tiny-mce-editor/src/tiny-mce-editor.vue'\n\nconst props = defineProps<{\n orderIndex: number\n title?: string\n isSave: boolean\n showAction?: boolean\n answerList?: any\n analysis?: string\n isEdit: boolean\n isSet: boolean\n examExpand?: string\n examAnswerSettingVO?: {\n isInOrder: boolean\n isIgnoreCase: boolean\n keywordCount: number\n }\n examRichTextContent?: string\n showAnalysis?: boolean\n examAnswerRelationType?: number\n}>()\nconst emits = defineEmits(['move', 'save', 'delete', 'edit', 'add'])\n\nconst attrs = useAttrs()\n\nconst answers = ref<{\n title: string\n tag: string\n showInput: boolean\n}[]>([{\n title: '',\n tag: '',\n showInput: false,\n}])\n\nconst title = ref('')\nconst analysis = ref('')\nconst keywordCount = ref()\nconst correct = ref('')\nconst showRichText = ref(false)\nconst richText = ref('')\n\nconst checkList = [\n {\n label: '答案不分顺序',\n value: 'isInOrder',\n },\n {\n label: '忽略大小写',\n value: 'isIgnoreCase',\n },\n]\n\nconst isCheckList = ref(['isInOrder', 'isIgnoreCase'])\n\nfunction handleAddTag(item: any) {\n item.showInput = false\n if (item.tag) {\n item.title = item.title ? [item.title, item.tag].join(',') : item.tag\n item.tag = ''\n }\n}\n\nfunction closeTag(tag: string, item: any) {\n if (tag) {\n const tags = item.title.split(',')\n const index = tags.findIndex((i: string) => i === tag)\n if (index > -1) {\n tags.splice(index, 1)\n item.title = tags.join(',')\n }\n }\n}\n\nfunction addAnswer() {\n answers.value.push({\n title: '',\n tag: '',\n showInput: false,\n })\n}\n\nfunction deleteAnswer(index: number) {\n if (answers.value.length < 2 || props.isSave) {\n return\n }\n answers.value.splice(index, 1)\n}\n\nfunction deleteRichText() {\n showRichText.value = false\n richText.value = ''\n}\n\nfunction save() {\n if (!title.value) {\n ElMessage.error('题目标题不能为空!')\n return\n }\n\n if (keywordCount.value || correct.value) {\n if (!keywordCount.value) {\n ElMessage.error('请完善答题设置!')\n return\n }\n\n if (!correct.value) {\n ElMessage.error('请输入问题正确答案!')\n return\n }\n\n if (answers.value.length !== keywordCount.value) {\n ElMessage.error('关键词个数设置有误!')\n return\n }\n const msg: string[] = []\n answers.value.forEach((item, index) => {\n if (!item.title) {\n msg.push(`关键词${index + 1}未设置`)\n }\n })\n if (msg.length > 0) {\n ElMessage.error(msg.join(','))\n return\n }\n }\n\n emits('save', {\n title: title.value,\n answers: answers.value.filter((i: any) => i.title).map((item: any) => {\n return { title: item.title }\n }),\n analysis: analysis.value,\n isSetCorrectAnswer: !!correct.value,\n examExpand: correct.value,\n examAnswerSettingBO: {\n isIgnoreCase: isCheckList.value?.includes('isIgnoreCase'),\n isInOrder: isCheckList.value?.includes('isInOrder'),\n ...{ keywordCount: keywordCount.value },\n },\n examRichTextContent: showRichText.value ? richText.value : '',\n })\n}\n\nfunction init() {\n if (props.title) {\n title.value = props.title\n }\n\n if (props.answerList && props.answerList.length) {\n answers.value = props.answerList\n }\n\n if (props.examAnswerSettingVO) {\n // 仅保留与设置匹配的选项\n isCheckList.value = isCheckList.value.filter(item =>\n (item === 'isIgnoreCase' && props.examAnswerSettingVO?.isIgnoreCase)\n || (item === 'isInOrder' && props.examAnswerSettingVO?.isInOrder),\n )\n }\n\n if (props.examAnswerSettingVO?.keywordCount) {\n keywordCount.value = props.examAnswerSettingVO?.keywordCount\n }\n\n if (props.examExpand) {\n correct.value = props.examExpand\n }\n\n if (props.analysis) {\n analysis.value = props.analysis\n }\n\n if (props.examRichTextContent) {\n richText.value = props.examRichTextContent\n showRichText.value = true\n }\n}\n\nonMounted(init)\nconst ns = useNamespace('subject-text-fill')\n</script>\n\n<template>\n <div :class=\"ns.e('text-fill-exam')\">\n <SubjectLayout :show-edit=\"isEdit\">\n <template #preview>\n <div class=\"preview\">\n <div class=\"content\">\n <span class=\"title\">{{ orderIndex + 1 }}.{{ title }}(问答题)</span>\n <div v-if=\"showRichText\">\n <div\n class=\"rich-text\"\n v-html=\"richText\"\n />\n </div>\n <div class=\"content flex flex-col\">\n <template v-if=\"answers.some(item => item.title)\">\n <el-checkbox\n v-for=\"(item, index) in answers\"\n :key=\"index\"\n class=\"radio\"\n :disabled=\"true\"\n >\n {{ item.title }}\n </el-checkbox>\n </template>\n </div>\n <div\n v-if=\"correct\"\n class=\"flex\"\n style=\"margin-top: 10px;color: #a8abb2;\"\n >\n <span class=\"title\">正确答案:{{ correct }}</span>\n </div>\n </div>\n </div>\n </template>\n <template #edit>\n <div class=\"flex\">\n <div class=\"label flex flex-justify-end\">\n <span>题目:</span>\n </div>\n <div\n style=\"flex: 1;\"\n class=\"margin-bottom\"\n >\n <el-input\n v-model=\"title\"\n type=\"textarea\"\n :rows=\"2\"\n placeholder=\"【问答题】请输入问题\"\n :maxlength=\"200\"\n show-word-limit\n :disabled=\"isSave\"\n />\n </div>\n </div>\n <div class=\"margin-bottom flex flex-items-center\">\n <div class=\"label flex flex-justify-end\">\n <span>答题设置:</span>\n </div>\n <span>共答对</span>\n <el-input-number\n v-model=\"keywordCount\"\n style=\"width: 100px;margin: 0 10px;\"\n :min=\"1\"\n />\n <span style=\"margin-right: 10px;\">个关键词,算是正确的</span>\n <el-checkbox-group\n v-for=\"item in checkList\"\n :key=\"item.value\"\n v-model=\"isCheckList\"\n >\n <el-checkbox\n :label=\"item.value\"\n class=\"margin-left-10\"\n >\n {{ item.label }}\n </el-checkbox>\n </el-checkbox-group>\n </div>\n <div class=\"flex\">\n <div class=\"label flex flex-justify-end\">\n <span>答案:</span>\n </div>\n <div style=\"flex: 1;\">\n <el-input\n v-model=\"correct\"\n type=\"textarea\"\n :rows=\"2\"\n placeholder=\"请输入正确答案\"\n :maxlength=\"200\"\n show-word-limit\n :disabled=\"isSave\"\n />\n </div>\n </div>\n <div class=\"margin-bottom answer-list\">\n <span style=\"padding-left: 60px;\">*如遇包含特殊字符的关键词,需添加多个同义词,例:'CO₂'需添加同义词'CO2'</span>\n <div\n v-for=\"(item, index) in answers\"\n :key=\"index\"\n class=\"answer-item flex flex-items-center\"\n >\n <div class=\"label flex flex-justify-end\">\n <span>关键词{{ index + 1 }}:</span>\n </div>\n\n <div class=\"answer-tags\">\n <template\n v-for=\"i in item.title.split(',')\"\n :key=\"i\"\n >\n <el-tag\n v-if=\"i\"\n closable\n @close=\"closeTag(i, item)\"\n >\n {{ i }}\n </el-tag>\n </template>\n <template v-if=\"!isSave\">\n <el-input\n v-if=\"item.showInput\"\n v-model=\"item.tag\"\n style=\"width: 80px;\"\n @blur=\"() => handleAddTag(item)\"\n />\n <el-button\n v-else\n size=\"small\"\n @click=\"item.showInput = true\"\n >\n <el-icon><Plus /></el-icon>\n <span>{{ item.title ? '添加同义词' : '添加关键词' }}</span>\n </el-button>\n </template>\n </div>\n <div class=\"operation\">\n <el-icon class=\"icon\">\n <CirclePlus\n :class=\"[{ disabled: isSave }]\"\n @click=\"addAnswer\"\n />\n </el-icon>\n <el-icon class=\"icon\">\n <Remove\n :class=\"[{ disabled: answers.length < 2 || isSave }]\"\n @click=\"deleteAnswer(index)\"\n />\n </el-icon>\n </div>\n </div>\n </div>\n <div\n v-if=\"showAnalysis\"\n class=\"margin-bottom flex\"\n >\n <div class=\"label flex flex-justify-end\">\n <span>解析:</span>\n </div>\n <div style=\"flex: 1;\">\n <el-input\n v-model=\"analysis\"\n type=\"textarea\"\n :rows=\"2\"\n placeholder=\"请输入题目解析\"\n />\n </div>\n </div>\n <div\n v-if=\"showRichText\"\n class=\"margin-bottom flex\"\n >\n <div class=\"label flex flex-justify-center\">\n <span>富文本:</span>\n </div>\n <div style=\"flex: 1;\">\n <TinyMceEditor\n v-model:model-value=\"richText\"\n v-bind=\"attrs\"\n style=\"width: 100%;\"\n />\n <div class=\"flex flex-justify-end\">\n <el-link\n type=\"danger\"\n @click=\"deleteRichText\"\n >\n 删除富文本\n </el-link>\n </div>\n </div>\n </div>\n </template>\n <SubjectAction\n v-if=\"showAction\"\n :is-edit=\"isEdit\"\n :is-set=\"isSet\"\n :show-other-option=\"false\"\n :exam-answer-relation-type=\"props.examAnswerRelationType\"\n @move-up=\"emits('move', 'up')\"\n @move-down=\"emits('move', 'down')\"\n @delete=\"emits('delete')\"\n @save=\"save\"\n @edit=\"emits('edit')\"\n @add=\"type => emits('add', type)\"\n @on-show-rich-text=\"showRichText = true\"\n />\n </SubjectLayout>\n </div>\n</template>\n"],"names":["props","__props","emits","__emit","attrs","useAttrs","answers","ref","title","tag","showInput","analysis","keywordCount","correct","showRichText","richText","checkList","label","value","isCheckList","addAnswer","push","deleteRichText","save","ElMessage","error","length","msg","forEach","item","index","join","filter","i","map","isSetCorrectAnswer","examExpand","examAnswerSettingBO","isIgnoreCase","includes","isInOrder","examRichTextContent","onMounted","answerList","examAnswerSettingVO","ns","useNamespace","tags","split","findIndex","splice","isSave"],"mappings":"8nEAQA,MAAMA,EAAQC,EAmBRC,EAAQC,EAERC,EAAQC,EAAAA,WAERC,EAAUC,EAAAA,IAIX,CAAC,CACJC,MAAO,GACPC,IAAK,GACLC,WAAW,KAGPF,EAAQD,MAAI,IACZI,EAAWJ,MAAI,IACfK,EAAeL,EAAAA,MACfM,EAAUN,MAAI,IACdO,EAAeP,OAAI,GACnBQ,EAAWR,MAAI,IAEfS,EAAY,CAChB,CACEC,MAAO,SACPC,MAAO,aAET,CACED,MAAO,QACPC,MAAO,iBAILC,EAAcZ,EAAAA,IAAI,CAAC,YAAa,iBAqBtC,SAASa,IACPd,EAAQY,MAAMG,KAAK,CACjBb,MAAO,GACPC,IAAK,GACLC,WAAW,GACZ,CAUH,SAASY,IACPR,EAAaI,OAAQ,EACrBH,EAASG,MAAQ,EAAA,CAGnB,SAASK,IACH,GAACf,EAAMU,MAAP,CAKA,GAAAN,EAAaM,OAASL,EAAQK,MAAO,CACnC,IAACN,EAAaM,MAEhB,YADAM,EAAAA,UAAUC,MAAM,YAId,IAACZ,EAAQK,MAEX,YADAM,EAAAA,UAAUC,MAAM,cAIlB,GAAInB,EAAQY,MAAMQ,SAAWd,EAAaM,MAExC,YADAM,EAAAA,UAAUC,MAAM,cAGlB,MAAME,EAAgB,GAMlB,GALJrB,EAAQY,MAAMU,SAAQ,CAACC,EAAMC,KACtBD,EAAKrB,OACRmB,EAAIN,KAAK,MAAMS,EAAQ,OAAM,IAG7BH,EAAID,OAAS,EAEf,YADAF,EAAAA,UAAUC,MAAME,EAAII,KA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AAsBF,GACpBA,EAAKnB,WAAY,EACbmB,EAAKpB,MACPoB,EAAKrB,MAAQqB,EAAKrB,MAAQ,CAACqB,EAAKrB,MAAOqB,EAAKpB,KAAKsB,KAAK,KAAOF,EAAKpB,IAClEoB,EAAKpB,IAAM,GACb,kuBAsBF,SAAsBqB,GAChBxB,EAAQY,MAAMQ,OAAS,GAAK1B,EAAMmD,QAG9B7C,EAAAY,MAAMgC,OAAOpB,EAAO,EAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue"),t=require("./components/subject-blank-fill.vue.cjs"),s=require("./components/subject-scale.vue.cjs"),n=require("./components/subject-single.vue.cjs"),i=require("./components/subject-text-fill.vue.cjs"),a=require("./components/SubjectRichText.vue.cjs"),o=require("./components/SubjectPageEnd.vue.cjs"),l=require("@qxs-bns/hooks"),r=require("@qxs-bns/utils"),c=require("element-plus/es");require("element-plus/es/components/base/style/index"),require("element-plus/es/components/message/style/index");const d={class:"subject-list-wrapper"};var u=e.defineComponent({name:"QxsSubjectList",__name:"subject-list",props:{subjectList:{type:Array,required:!0},isPreview:{type:Boolean,required:!0}},emits:["setRelation"],setup(u,{expose:m,emit:p}){const x=u,w=e.ref([]),v=p,y=e.useAttrs();m({addSubject:T,currentList:w,uploadExcel:function(e){w.value=w.value.concat(e)},addExam:function(e){console.log(e,"items");let t=1;const s=[];e.forEach((e=>{const n={...e,customId:r.setGuid(),answerType:e.richTextContent?"rich_text":e.examTypeEnum,answers:e.answers?.map((e=>({...e,title:e.answer,answerId:e.examAnswerId,isCorrect:e.isCorrect})))||[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1};n.pageIndex>t&&(s.push({customId:r.setGuid(),answerType:"page_end",analysis:"",scaleQuestionList:[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1,examAnswerRelationType:0}),t=n.pageIndex),s.push(n)})),w.value=w.value.concat(s)},setAnswerRelation:function(e,t,s){const n=w.value.find((e=>e.customId===t));if(n){const t=n.answers?.find((e=>e.customAnswerId===s));t&&(t.answerRelations=e)}}});const f=e.computed((()=>{const e=w.value.filter((e=>"page_end"===e.answerType));return t=>{const s=e.findIndex((e=>e.customId===t));return-1!==s?s+1:0}}));function h(){return e=>{let t=0,s=0;return w.value.forEach((n=>{"page_end"!==n.answerType&&(t++,e===n.customId&&(s=t))})),s-1}}function T(e,t=null,s=null){const n={customId:r.setGuid(),answerType:e,analysis:"",scaleQuestionList:[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1,examAnswerRelationType:s};null!==t?w.value.splice(t+1,0,n):w.value.push(n)}function A(e,t){if("up"===t&&e>0){const[t]=w.value.splice(e,1);w.value.splice(e-1,0,t)}else if("down"===t&&e<w.value.length-1){const[t]=w.value.splice(e,1);w.value.splice(e+1,0,t)}}function E(e,t){w.value[e]={...w.value[e],...t,isEdit:!1,examAnswerRelationType:t.examAnswerRelationType}}function R(e){w.value.splice(e,1),c.ElMessage.success("删除成功")}function g(e,t){v("setRelation",e,t)}e.watch((()=>x.subjectList),(e=>{e&&(w.value=[...e])}),{immediate:!0});const k=l.useNamespace("subject-list");return(l,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(k).e("list-exam"))},[e.createElementVNode("div",d,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(w),((r,c)=>(e.openBlock(),e.createElementBlock("div",{key:r.customId,class:"subject-item"},[["single","multiple","sort"].includes(r.answerType)?(e.openBlock(),e.createBlock(n.default,e.mergeProps({key:0,ref_for:!0},e.unref(y),{"order-index":h()(r.customId),title:r.title,type:r.answerType,"exam-id":r.examId,isKey:r.isKey,"is-save":!r.isRealCanDel,customId:r.customId,"is-set":r.hasSet||!1,"answer-list":r.answers,analysis:r.analysis,"least-answer-count":r.leastAnswerCount,"is-edit":r.isEdit||!1,"show-action":!l.isPreview,"exam-expand":r.examExpand,answerCheckType:r.answerCheckType,"exam-rich-text-content":r.examRichTextContent,examAnswerRelationType:r.examAnswerRelationType,onSetRelation:g,onMove:e=>A(c,e),onDelete:e=>R(c),onSave:e=>E(c,e),onEdit:e=>r.isEdit=!0,onAdd:(e,t)=>T(e,c,t)}),null,16,["order-index","title","type","exam-id","isKey","is-save","customId","is-set","answer-list","analysis","least-answer-count","is-edit","show-action","exam-expand","answerCheckType","exam-rich-text-content","examAnswerRelationType","onMove","onDelete","onSave","onEdit","onAdd"])):"scale"===r.answerType?(e.openBlock(),e.createBlock(s.default,e.mergeProps({key:1,ref_for:!0},e.unref(y),{"order-index":h()(r.customId),title:r.title,"is-save":!r.isRealCanDel,"is-set":r.hasSet||!1,"answer-list":r.answers,analysis:r.analysis,"is-edit":r.isEdit||!1,"scale-question-list":r.scaleQuestionList,"show-action":!l.isPreview,"exam-rich-text-content":r.examRichTextContent,examAnswerRelationType:r.examAnswerRelationType,onMove:e=>A(c,e),onDelete:e=>R(c),onSave:e=>E(c,e),onEdit:e=>r.isEdit=!0,onAdd:e=>T(e,c,null)}),null,16,["order-index","title","is-save","is-set","answer-list","analysis","is-edit","scale-question-list","show-action","exam-rich-text-content","examAnswerRelationType","onMove","onDelete","onSave","onEdit","onAdd"])):"blank_fill"===r.answerType?(e.openBlock(),e.createBlock(t.default,e.mergeProps({key:2,ref_for:!0},e.unref(y),{"order-index":h()(r.customId),title:r.title,"is-save":!r.isRealCanDel,"is-set":r.hasSet||!1,"answer-list":r.answers,analysis:r.analysis,"show-action":!l.isPreview,"is-edit":r.isEdit||!1,"exam-answer-setting-v-o":r.examAnswerSettingVO||{},"exam-rich-text-content":r.examRichTextContent,examAnswerRelationType:r.examAnswerRelationType,onMove:e=>A(c,e),onDelete:e=>R(c),onSave:e=>E(c,e),onEdit:e=>r.isEdit=!0,onAdd:e=>T(e,c,null)}),null,16,["order-index","title","is-save","is-set","answer-list","analysis","show-action","is-edit","exam-answer-setting-v-o","exam-rich-text-content","examAnswerRelationType","onMove","onDelete","onSave","onEdit","onAdd"])):"text_fill"===r.answerType?(e.openBlock(),e.createBlock(i.default,e.mergeProps({key:3,ref_for:!0},e.unref(y),{"order-index":h()(r.customId),title:r.title,"is-save":!r.isRealCanDel,"is-set":r.hasSet||!1,"answer-list":r.answers,analysis:r.analysis,"show-action":!l.isPreview,"is-edit":r.isEdit||!1,"exam-expand":r.examExpand,"exam-answer-setting-v-o":r.examAnswerSettingVO||{},examAnswerRelationType:r.examAnswerRelationType,"exam-rich-text-content":r.examRichTextContent,onMove:e=>A(c,e),onDelete:e=>R(c),onSave:e=>E(c,e),onEdit:e=>r.isEdit=!0,onAdd:e=>T(e,c,null)}),null,16,["order-index","title","is-save","is-set","answer-list","analysis","show-action","is-edit","exam-expand","exam-answer-setting-v-o","examAnswerRelationType","exam-rich-text-content","onMove","onDelete","onSave","onEdit","onAdd"])):"rich_text"===r.answerType?(e.openBlock(),e.createBlock(a.default,e.mergeProps({key:4,ref_for:!0},e.unref(y),{"order-index":h()(r.customId),richTextContent:r.richTextContent,"is-set":r.hasSet||!1,"is-save":!r.isRealCanDel,"is-edit":r.isEdit||!1,"show-action":!l.isPreview,onMove:e=>A(c,e),onDelete:e=>R(c),examAnswerRelationType:r.examAnswerRelationType,onSave:e=>E(c,e),onEdit:e=>r.isEdit=!0,onAdd:e=>T(e,c,null)}),null,16,["order-index","richTextContent","is-set","is-save","is-edit","show-action","onMove","onDelete","examAnswerRelationType","onSave","onEdit","onAdd"])):"page_end"===r.answerType?(e.openBlock(),e.createBlock(o.default,{"total-page":w.value.filter((e=>"page_end"===e.answerType)).length,key:c,"current-page-index":e.unref(f)(r.customId),item:r,"is-edit":r.isEdit||!1,"is-set":r.hasSet||!1,"is-save":!r.isRealCanDel,examAnswerRelationType:r.examAnswerRelationType,onMove:e=>A(c,e),onDelete:e=>R(c),onSave:e=>E(c,e),onEdit:e=>r.isEdit=!0,onAdd:e=>T(e,c,null)},null,8,["total-page","current-page-index","item","is-edit","is-set","is-save","examAnswerRelationType","onMove","onDelete","onSave","onEdit","onAdd"])):e.createCommentVNode("v-if",!0)])))),128))])],2))}});exports.default=u;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue"),t=require("@qxs-bns/hooks"),s=require("@qxs-bns/utils"),n=require("./components/subject-blank-fill.vue.cjs"),a=require("./components/subject-scale.vue.cjs"),i=require("./components/subject-single.vue.cjs"),o=require("./components/subject-text-fill.vue.cjs"),l=require("./components/SubjectPageEnd.vue.cjs"),r=require("./components/SubjectRichText.vue.cjs"),c=require("element-plus/es");require("element-plus/es/components/base/style/index"),require("element-plus/es/components/message/style/index");const d={class:"subject-list-wrapper"};var u=e.defineComponent({name:"QxsSubjectList",__name:"subject-list",props:{subjectList:{type:Array,required:!0},isPreview:{type:Boolean,required:!0}},emits:["setRelation"],setup(u,{expose:m,emit:p}){const x=u,w=p,v=e.ref([]),y=e.useAttrs();m({addSubject:E,currentList:v,uploadExcel:function(e){v.value=v.value.concat(e)},addExam:function(e){console.log(e,"items");let t=1;const n=[];e.forEach((e=>{const a={...e,customId:s.setGuid(),answerType:e.richTextContent?"rich_text":e.examTypeEnum,answers:e.answers?.map((e=>({...e,title:e.answer,answerId:e.examAnswerId,isCorrect:e.isCorrect})))||[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1};a.pageIndex>t&&(n.push({customId:s.setGuid(),answerType:"page_end",analysis:"",scaleQuestionList:[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1,examAnswerRelationType:0}),t=a.pageIndex),n.push(a)})),v.value=v.value.concat(n)},setAnswerRelation:function(e,t,s){const n=v.value.find((e=>e.customId===t));if(n){const t=n.answers?.find((e=>e.customAnswerId===s));t&&(t.answerRelations=e)}}});const f=e.computed((()=>{const e=v.value.filter((e=>"page_end"===e.answerType));return t=>{const s=e.findIndex((e=>e.customId===t));return-1!==s?s+1:0}}));function h(){return e=>{let t=0,s=0;return v.value.forEach((n=>{"page_end"!==n.answerType&&(t++,e===n.customId&&(s=t))})),s-1}}function E(e,t=null,n=null){const a={customId:s.setGuid(),answerType:e,analysis:"",scaleQuestionList:[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1,examAnswerRelationType:n};null!==t?v.value.splice(t+1,0,a):v.value.push(a)}function k(e,t){if("up"===t&&e>0){const[t]=v.value.splice(e,1);v.value.splice(e-1,0,t)}else if("down"===t&&e<v.value.length-1){const[t]=v.value.splice(e,1);v.value.splice(e+1,0,t)}}function T(e,t){v.value[e]={...v.value[e],...t,isEdit:!1,examAnswerRelationType:t.examAnswerRelationType}}function g(e){v.value.splice(e,1),c.ElMessage.success("删除成功")}function S(e,t){w("setRelation",e,t)}e.watch((()=>x.subjectList),(e=>{e&&(v.value=[...e])}),{immediate:!0});const A=t.useNamespace("subject-list");return(t,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(A).e("list-exam"))},[e.createElementVNode("div",d,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(v),((s,c)=>(e.openBlock(),e.createElementBlock("div",{key:s.customId,class:"subject-item"},[["single","multiple","sort"].includes(s.answerType)?(e.openBlock(),e.createBlock(i.default,e.mergeProps({key:0,ref_for:!0},e.unref(y),{"order-index":h()(s.customId),title:s.title,type:s.answerType,"exam-id":s.examId,"is-key":s.isKey,"is-save":!s.isRealCanDel,"custom-id":s.customId,"is-set":s.hasSet||!1,"answer-list":s.answers,analysis:s.analysis,"least-answer-count":s.leastAnswerCount,"is-edit":s.isEdit||!1,"show-action":!t.isPreview,"exam-expand":s.examExpand,"answer-check-type":s.answerCheckType,"exam-rich-text-content":s.examRichTextContent,"exam-answer-relation-type":s.examAnswerRelationType,onSetRelation:S,onMove:e=>k(c,e),onDelete:e=>g(c),onSave:e=>T(c,e),onEdit:e=>s.isEdit=!0,onAdd:(e,t)=>E(e,c,t)}),null,16,["order-index","title","type","exam-id","is-key","is-save","custom-id","is-set","answer-list","analysis","least-answer-count","is-edit","show-action","exam-expand","answer-check-type","exam-rich-text-content","exam-answer-relation-type","onMove","onDelete","onSave","onEdit","onAdd"])):"scale"===s.answerType?(e.openBlock(),e.createBlock(a.default,e.mergeProps({key:1,ref_for:!0},e.unref(y),{"order-index":h()(s.customId),title:s.title,"is-save":!s.isRealCanDel,"is-set":s.hasSet||!1,"answer-list":s.answers,analysis:s.analysis,"is-edit":s.isEdit||!1,"scale-question-list":s.scaleQuestionList,"show-action":!t.isPreview,"exam-rich-text-content":s.examRichTextContent,"exam-answer-relation-type":s.examAnswerRelationType,onMove:e=>k(c,e),onDelete:e=>g(c),onSave:e=>T(c,e),onEdit:e=>s.isEdit=!0,onAdd:e=>E(e,c,null)}),null,16,["order-index","title","is-save","is-set","answer-list","analysis","is-edit","scale-question-list","show-action","exam-rich-text-content","exam-answer-relation-type","onMove","onDelete","onSave","onEdit","onAdd"])):"blank_fill"===s.answerType?(e.openBlock(),e.createBlock(n.default,e.mergeProps({key:2,ref_for:!0},e.unref(y),{"order-index":h()(s.customId),title:s.title,"is-save":!s.isRealCanDel,"is-set":s.hasSet||!1,"answer-list":s.answers,analysis:s.analysis,"show-action":!t.isPreview,"is-edit":s.isEdit||!1,"exam-answer-setting-v-o":s.examAnswerSettingVO||{},"exam-rich-text-content":s.examRichTextContent,"exam-answer-relation-type":s.examAnswerRelationType,onMove:e=>k(c,e),onDelete:e=>g(c),onSave:e=>T(c,e),onEdit:e=>s.isEdit=!0,onAdd:e=>E(e,c,null)}),null,16,["order-index","title","is-save","is-set","answer-list","analysis","show-action","is-edit","exam-answer-setting-v-o","exam-rich-text-content","exam-answer-relation-type","onMove","onDelete","onSave","onEdit","onAdd"])):"text_fill"===s.answerType?(e.openBlock(),e.createBlock(o.default,e.mergeProps({key:3,ref_for:!0},e.unref(y),{"order-index":h()(s.customId),title:s.title,"is-save":!s.isRealCanDel,"is-set":s.hasSet||!1,"answer-list":s.answers,analysis:s.analysis,"show-action":!t.isPreview,"is-edit":s.isEdit||!1,"exam-expand":s.examExpand,"exam-answer-setting-v-o":s.examAnswerSettingVO||{},"exam-answer-relation-type":s.examAnswerRelationType,"exam-rich-text-content":s.examRichTextContent,onMove:e=>k(c,e),onDelete:e=>g(c),onSave:e=>T(c,e),onEdit:e=>s.isEdit=!0,onAdd:e=>E(e,c,null)}),null,16,["order-index","title","is-save","is-set","answer-list","analysis","show-action","is-edit","exam-expand","exam-answer-setting-v-o","exam-answer-relation-type","exam-rich-text-content","onMove","onDelete","onSave","onEdit","onAdd"])):"rich_text"===s.answerType?(e.openBlock(),e.createBlock(r.default,e.mergeProps({key:4,ref_for:!0},e.unref(y),{"order-index":h()(s.customId),"rich-text-content":s.richTextContent,"is-set":s.hasSet||!1,"is-save":!s.isRealCanDel,"is-edit":s.isEdit||!1,"show-action":!t.isPreview,"exam-answer-relation-type":s.examAnswerRelationType,onMove:e=>k(c,e),onDelete:e=>g(c),onSave:e=>T(c,e),onEdit:e=>s.isEdit=!0,onAdd:e=>E(e,c,null)}),null,16,["order-index","rich-text-content","is-set","is-save","is-edit","show-action","exam-answer-relation-type","onMove","onDelete","onSave","onEdit","onAdd"])):"page_end"===s.answerType?(e.openBlock(),e.createBlock(l.default,{key:c,"total-page":v.value.filter((e=>"page_end"===e.answerType)).length,"current-page-index":e.unref(f)(s.customId),item:s,"is-edit":s.isEdit||!1,"is-set":s.hasSet||!1,"is-save":!s.isRealCanDel,"exam-answer-relation-type":s.examAnswerRelationType,onMove:e=>k(c,e),onDelete:e=>g(c),onSave:e=>T(c,e),onEdit:e=>s.isEdit=!0,onAdd:e=>E(e,c,null)},null,8,["total-page","current-page-index","item","is-edit","is-set","is-save","exam-answer-relation-type","onMove","onDelete","onSave","onEdit","onAdd"])):e.createCommentVNode("v-if",!0)])))),128))])],2))}});exports.default=u;
2
2
  //# sourceMappingURL=subject-list.vue.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"subject-list.vue.cjs","sources":["../../../../../../packages/components/src/subject-list/src/subject-list.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport SubjectBlankFill from './components/subject-blank-fill.vue'\nimport SubjectScale from './components/subject-scale.vue'\nimport SubjectSingle from './components/subject-single.vue'\nimport SubjectTextFill from './components/subject-text-fill.vue'\nimport SubjectRichText from './components/SubjectRichText.vue'\nimport SubjectPageEnd from './components/SubjectPageEnd.vue'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport { setGuid } from '@qxs-bns/utils'\n\ndefineOptions({\n name: 'QxsSubjectList',\n})\n\nconst props = defineProps<{\n subjectList: any[]\n isPreview: boolean\n}>()\nconst currentList = ref([] as any)\nconst emits = defineEmits(['setRelation'])\n\nconst attrs = useAttrs()\n\ndefineExpose({\n addSubject,\n currentList,\n uploadExcel,\n addExam,\n setAnswerRelation,\n})\n\nfunction totalPageIndex() {\n return currentList.value.filter((v: any) => v.answerType === 'page_end').length\n}\n\nconst currentPageIndex = computed(() => {\n const currentPageList = currentList.value.filter((v: any) => v.answerType === 'page_end')\n return (currentId: string) => {\n const currentIndex = currentPageList.findIndex((c: any) => c.customId === currentId)\n return currentIndex !== -1 ? currentIndex + 1 : 0\n }\n})\n\nfunction currentIndex() {\n return (currentExamId: string) => {\n let current = 0\n let output = 0\n\n // 遍历 currentList,过滤掉分页器,并计算题目序号\n currentList.value.forEach((v: any) => {\n if (v.answerType !== 'page_end') { // 排除分页器\n current++\n if (currentExamId === v.customId) { // 匹配当前题目 ID\n output = current\n }\n }\n })\n\n return output-1\n }\n}\n\nfunction addSubject(type: string, index: number | null = null, examAnswerRelationType: number | null = null) {\n const newSubject = {\n customId: setGuid(),\n answerType: type,\n analysis: '',\n scaleQuestionList: [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n examAnswerRelationType,\n }\n\n if (index !== null) {\n currentList.value.splice(index + 1, 0, newSubject)\n } else {\n currentList.value.push(newSubject)\n }\n}\nfunction addExam(items: any[]) {\n console.log(items, 'items')\n\n let currentIndex = 1\n const newList: any[] = []\n\n items.forEach((v: any) => {\n // 创建新的题目对象\n const newItem = {\n ...v,\n customId: setGuid(),\n answerType: v.richTextContent ? 'rich_text' : v.examTypeEnum,\n answers: v.answers?.map((c: any) => ({\n ...c,\n title: c.answer,\n answerId: c.examAnswerId,\n isCorrect: c.isCorrect,\n })) || [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n }\n\n // 如果当前题目的 pageIndex 和 currentIndex 不一致,则插入分页器\n if (newItem.pageIndex > currentIndex) {\n newList.push({\n customId: setGuid(),\n answerType: 'page_end',\n analysis: '',\n scaleQuestionList: [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n examAnswerRelationType: 0,\n })\n currentIndex = newItem.pageIndex\n }\n\n // 将题目添加到 newList\n newList.push(newItem)\n })\n\n // 更新 currentList\n currentList.value = currentList.value.concat(newList)\n}\nfunction uploadExcel(list: any[]) {\n currentList.value = currentList.value.concat(list)\n}\n\nfunction move(index: number, type: 'up' | 'down') {\n if (type === 'up' && index > 0) {\n const [item] = currentList.value.splice(index, 1)\n currentList.value.splice(index - 1, 0, item)\n } else if (type === 'down' && index < currentList.value.length - 1) {\n const [item] = currentList.value.splice(index, 1)\n currentList.value.splice(index + 1, 0, item)\n }\n}\n\nfunction saveSubject(index: number, item: any) {\n currentList.value[index] = {\n ...currentList.value[index],\n ...item,\n isEdit: false,\n examAnswerRelationType: item.examAnswerRelationType,\n }\n}\n\nfunction deleteSubject(index: number) {\n currentList.value.splice(index, 1)\n ElMessage.success('删除成功')\n}\n\nfunction setRelation(customId: number, examAnswers: any) {\n emits('setRelation', customId, examAnswers)\n}\n\nfunction setAnswerRelation(answerRelations: any, customId: string, customAnswerId: string) {\n const targetItem = currentList.value.find((v: any) => v.customId === customId)\n if (targetItem) {\n const targetAnswer = targetItem.answers?.find((c: any) => c.customAnswerId === customAnswerId)\n if (targetAnswer) {\n targetAnswer.answerRelations = answerRelations\n }\n }\n}\n\nwatch(() => props.subjectList, (newList: any) => {\n if (newList) {\n currentList.value = [...newList]\n }\n}, { immediate: true })\n\nconst ns = useNamespace('subject-list')\n</script>\n\n<template>\n <div :class=\"ns.e('list-exam')\">\n <div class=\"subject-list-wrapper\">\n <div v-for=\"(item, index) in currentList\" :key=\"item.customId\" class=\"subject-item\">\n <template v-if=\"['single', 'multiple', 'sort'].includes(item.answerType)\">\n <SubjectSingle\n v-bind=\"attrs\"\n :order-index=\"currentIndex()(item.customId)\"\n :title=\"item.title\"\n :type=\"item.answerType\"\n :exam-id=\"item.examId\"\n :isKey=\"item.isKey\"\n :is-save=\"!item.isRealCanDel\"\n :customId=\"item.customId\"\n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\"\n :analysis=\"item.analysis\"\n :least-answer-count=\"item.leastAnswerCount\"\n :is-edit=\"item.isEdit || false\"\n :show-action=\"!isPreview\"\n :exam-expand=\"item.examExpand\"\n :answerCheckType=\"item.answerCheckType\"\n :exam-rich-text-content=\"item.examRichTextContent\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n @setRelation=\"setRelation\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string, examAnswerRelationType: number) => addSubject(type, index, examAnswerRelationType)\"\n />\n </template>\n <SubjectScale\n v-bind=\"attrs\"\n v-else-if=\"item.answerType === 'scale'\"\n :order-index=\"currentIndex()(item.customId)\"\n :title=\"item.title\"\n :is-save=\"!item.isRealCanDel\"\n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\"\n :analysis=\"item.analysis\"\n :is-edit=\"item.isEdit || false\"\n :scale-question-list=\"item.scaleQuestionList\"\n :show-action=\"!isPreview\"\n :exam-rich-text-content=\"item.examRichTextContent\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n <SubjectBlankFill\n v-bind=\"attrs\"\n v-else-if=\"item.answerType === 'blank_fill'\"\n :order-index=\"currentIndex()(item.customId)\"\n :title=\"item.title\"\n :is-save=\"!item.isRealCanDel\"\n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\"\n :analysis=\"item.analysis\"\n :show-action=\"!isPreview\"\n :is-edit=\"item.isEdit || false\"\n :exam-answer-setting-v-o=\"item.examAnswerSettingVO || {}\"\n :exam-rich-text-content=\"item.examRichTextContent\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n <SubjectTextFill\n v-bind=\"attrs\"\n v-else-if=\"item.answerType === 'text_fill'\"\n :order-index=\"currentIndex()(item.customId)\"\n :title=\"item.title\"\n :is-save=\"!item.isRealCanDel\"\n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\"\n :analysis=\"item.analysis\"\n :show-action=\"!isPreview\"\n :is-edit=\"item.isEdit || false\"\n :exam-expand=\"item.examExpand\"\n :exam-answer-setting-v-o=\"item.examAnswerSettingVO || {}\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n :exam-rich-text-content=\"item.examRichTextContent\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n <SubjectRichText\n v-bind=\"attrs\"\n :order-index=\"currentIndex()(item.customId)\"\n v-else-if=\"item.answerType === 'rich_text'\"\n :richTextContent=\"item.richTextContent\"\n :is-set=\"item.hasSet || false\"\n :is-save=\"!item.isRealCanDel\"\n :is-edit=\"item.isEdit || false\"\n :show-action=\"!isPreview\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n <SubjectPageEnd\n v-else-if=\"item.answerType === 'page_end'\"\n :total-page=\"totalPageIndex()\"\n :key=\"index\"\n :current-page-index=\"currentPageIndex(item.customId)\"\n :item=\"item\"\n :is-edit=\"item.isEdit || false\"\n :is-set=\"item.hasSet || false\"\n :is-save=\"!item.isRealCanDel\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n </div>\n </div>\n </div>\n</template>"],"names":["props","__props","currentList","ref","emits","__emit","attrs","useAttrs","__expose","addSubject","uploadExcel","list","value","concat","addExam","items","console","log","currentIndex","newList","forEach","v","newItem","customId","setGuid","answerType","richTextContent","examTypeEnum","answers","map","c","title","answer","answerId","examAnswerId","isCorrect","isSave","isEdit","isRealCanDel","hasSet","pageIndex","push","analysis","scaleQuestionList","examAnswerRelationType","setAnswerRelation","answerRelations","customAnswerId","targetItem","find","targetAnswer","currentPageIndex","computed","currentPageList","filter","currentId","findIndex","currentExamId","current","output","type","index","newSubject","splice","move","item","length","saveSubject","deleteSubject","ElMessage","success","setRelation","examAnswers","watch","subjectList","immediate","ns","useNamespace"],"mappings":"2zBAcA,MAAMA,EAAQC,EAIRC,EAAcC,EAAIA,IAAA,IAClBC,EAAQC,EAERC,EAAQC,EAAAA,WAEDC,EAAA,CACXC,aACAP,cACAQ,YAsGF,SAAqBC,GACnBT,EAAYU,MAAQV,EAAYU,MAAMC,OAAOF,EAAI,EAtGjDG,QAsDF,SAAiBC,GACPC,QAAAC,IAAIF,EAAO,SAEnB,IAAIG,EAAe,EACnB,MAAMC,EAAiB,GAEjBJ,EAAAK,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,EAAcC,EAAuB,KAAMjB,EAAwC,MACrG,MAAMkB,EAAa,CACjBvC,SAAUC,EAAAA,UACVC,WAAYmC,EACZlB,SAAU,GACVC,kBAAmB,GACnBP,QAAQ,EACRC,QAAQ,EACRC,cAAc,EACdC,QAAQ,EACRK,0BAGY,OAAViB,EACF3D,EAAYU,MAAMmD,OAAOF,EAAQ,EAAG,EAAGC,GAE3B5D,EAAAU,MAAM6B,KAAKqB,EACzB,CAqDO,SAAAE,EAAKH,EAAeD,GACvB,GAAS,OAATA,GAAiBC,EAAQ,EAAG,CAC9B,MAAOI,GAAQ/D,EAAYU,MAAMmD,OAAOF,EAAO,GAC/C3D,EAAYU,MAAMmD,OAAOF,EAAQ,EAAG,EAAGI,EAAI,SACzB,SAATL,GAAmBC,EAAQ3D,EAAYU,MAAMsD,OAAS,EAAG,CAClE,MAAOD,GAAQ/D,EAAYU,MAAMmD,OAAOF,EAAO,GAC/C3D,EAAYU,MAAMmD,OAAOF,EAAQ,EAAG,EAAGI,EAAI,CAC7C,CAGO,SAAAE,EAAYN,EAAeI,GACtB/D,EAAAU,MAAMiD,GAAS,IACtB3D,EAAYU,MAAMiD,MAClBI,EACH5B,QAAQ,EACRO,uBAAwBqB,EAAKrB,uBAC/B,CAGF,SAASwB,EAAcP,GACT3D,EAAAU,MAAMmD,OAAOF,EAAO,GAChCQ,EAAAA,UAAUC,QAAQ,OAAM,CAGjB,SAAAC,EAAYhD,EAAkBiD,GAC/BpE,EAAA,cAAemB,EAAUiD,EAAW,CAa5CC,EAAAA,OAAM,IAAMzE,EAAM0E,cAAcvD,IAC1BA,IACUjB,EAAAU,MAAQ,IAAIO,GAAO,GAEhC,CAAEwD,WAAW,IAEV,MAAAC,EAAKC,eAAa,mrIAhJf3E,EAAYU,MAAM0C,QAAQjC,GAA4B,aAAjBA,EAAEI,aAA2ByC"}
1
+ {"version":3,"file":"subject-list.vue.cjs","sources":["../../../../../../packages/components/src/subject-list/src/subject-list.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useNamespace } from '@qxs-bns/hooks'\nimport { setGuid } from '@qxs-bns/utils'\nimport SubjectBlankFill from './components/subject-blank-fill.vue'\nimport SubjectScale from './components/subject-scale.vue'\nimport SubjectSingle from './components/subject-single.vue'\nimport SubjectTextFill from './components/subject-text-fill.vue'\nimport SubjectPageEnd from './components/SubjectPageEnd.vue'\nimport SubjectRichText from './components/SubjectRichText.vue'\n\ndefineOptions({\n name: 'QxsSubjectList',\n})\n\nconst props = defineProps<{\n subjectList: any[]\n isPreview: boolean\n}>()\nconst emits = defineEmits(['setRelation'])\nconst currentList = ref([] as any)\nconst attrs = useAttrs()\n\ndefineExpose({\n addSubject,\n currentList,\n uploadExcel,\n addExam,\n setAnswerRelation,\n})\n\nfunction totalPageIndex() {\n return currentList.value.filter((v: any) => v.answerType === 'page_end').length\n}\n\nconst currentPageIndex = computed(() => {\n const currentPageList = currentList.value.filter((v: any) => v.answerType === 'page_end')\n return (currentId: string) => {\n const currentIndex = currentPageList.findIndex((c: any) => c.customId === currentId)\n return currentIndex !== -1 ? currentIndex + 1 : 0\n }\n})\n\nfunction currentIndex() {\n return (currentExamId: string) => {\n let current = 0\n let output = 0\n\n // 遍历 currentList,过滤掉分页器,并计算题目序号\n currentList.value.forEach((v: any) => {\n if (v.answerType !== 'page_end') { // 排除分页器\n current++\n if (currentExamId === v.customId) { // 匹配当前题目 ID\n output = current\n }\n }\n })\n\n return output - 1\n }\n}\n\nfunction addSubject(type: string, index: number | null = null, examAnswerRelationType: number | null = null) {\n const newSubject = {\n customId: setGuid(),\n answerType: type,\n analysis: '',\n scaleQuestionList: [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n examAnswerRelationType,\n }\n\n if (index !== null) {\n currentList.value.splice(index + 1, 0, newSubject)\n }\n else {\n currentList.value.push(newSubject)\n }\n}\nfunction addExam(items: any[]) {\n console.log(items, 'items')\n\n let currentIndex = 1\n const newList: any[] = []\n\n items.forEach((v: any) => {\n // 创建新的题目对象\n const newItem = {\n ...v,\n customId: setGuid(),\n answerType: v.richTextContent ? 'rich_text' : v.examTypeEnum,\n answers: v.answers?.map((c: any) => ({\n ...c,\n title: c.answer,\n answerId: c.examAnswerId,\n isCorrect: c.isCorrect,\n })) || [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n }\n\n // 如果当前题目的 pageIndex 和 currentIndex 不一致,则插入分页器\n if (newItem.pageIndex > currentIndex) {\n newList.push({\n customId: setGuid(),\n answerType: 'page_end',\n analysis: '',\n scaleQuestionList: [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n examAnswerRelationType: 0,\n })\n currentIndex = newItem.pageIndex\n }\n\n // 将题目添加到 newList\n newList.push(newItem)\n })\n\n // 更新 currentList\n currentList.value = currentList.value.concat(newList)\n}\nfunction uploadExcel(list: any[]) {\n currentList.value = currentList.value.concat(list)\n}\n\nfunction move(index: number, type: 'up' | 'down') {\n if (type === 'up' && index > 0) {\n const [item] = currentList.value.splice(index, 1)\n currentList.value.splice(index - 1, 0, item)\n }\n else if (type === 'down' && index < currentList.value.length - 1) {\n const [item] = currentList.value.splice(index, 1)\n currentList.value.splice(index + 1, 0, item)\n }\n}\n\nfunction saveSubject(index: number, item: any) {\n currentList.value[index] = {\n ...currentList.value[index],\n ...item,\n isEdit: false,\n examAnswerRelationType: item.examAnswerRelationType,\n }\n}\n\nfunction deleteSubject(index: number) {\n currentList.value.splice(index, 1)\n ElMessage.success('删除成功')\n}\n\nfunction setRelation(customId: number, examAnswers: any) {\n emits('setRelation', customId, examAnswers)\n}\n\nfunction setAnswerRelation(answerRelations: any, customId: string, customAnswerId: string) {\n const targetItem = currentList.value.find((v: any) => v.customId === customId)\n if (targetItem) {\n const targetAnswer = targetItem.answers?.find((c: any) => c.customAnswerId === customAnswerId)\n if (targetAnswer) {\n targetAnswer.answerRelations = answerRelations\n }\n }\n}\n\nwatch(() => props.subjectList, (newList: any) => {\n if (newList) {\n currentList.value = [...newList]\n }\n}, { immediate: true })\n\nconst ns = useNamespace('subject-list')\n</script>\n\n<template>\n <div :class=\"ns.e('list-exam')\">\n <div class=\"subject-list-wrapper\">\n <div\n v-for=\"(item, index) in currentList\"\n :key=\"item.customId\"\n class=\"subject-item\"\n >\n <template v-if=\"['single', 'multiple', 'sort'].includes(item.answerType)\">\n <SubjectSingle\n v-bind=\"attrs\"\n :order-index=\"currentIndex()(item.customId)\"\n :title=\"item.title\"\n :type=\"item.answerType\"\n :exam-id=\"item.examId\"\n :is-key=\"item.isKey\"\n :is-save=\"!item.isRealCanDel\"\n :custom-id=\"item.customId\"\n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\"\n :analysis=\"item.analysis\"\n :least-answer-count=\"item.leastAnswerCount\"\n :is-edit=\"item.isEdit || false\"\n :show-action=\"!isPreview\"\n :exam-expand=\"item.examExpand\"\n :answer-check-type=\"item.answerCheckType\"\n :exam-rich-text-content=\"item.examRichTextContent\"\n :exam-answer-relation-type=\"item.examAnswerRelationType\"\n @set-relation=\"setRelation\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string, examAnswerRelationType: number) => addSubject(type, index, examAnswerRelationType)\"\n />\n </template>\n <SubjectScale\n v-else-if=\"item.answerType === 'scale'\"\n v-bind=\"attrs\"\n :order-index=\"currentIndex()(item.customId)\"\n :title=\"item.title\"\n :is-save=\"!item.isRealCanDel\"\n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\"\n :analysis=\"item.analysis\"\n :is-edit=\"item.isEdit || false\"\n :scale-question-list=\"item.scaleQuestionList\"\n :show-action=\"!isPreview\"\n :exam-rich-text-content=\"item.examRichTextContent\"\n :exam-answer-relation-type=\"item.examAnswerRelationType\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n <SubjectBlankFill\n v-else-if=\"item.answerType === 'blank_fill'\"\n v-bind=\"attrs\"\n :order-index=\"currentIndex()(item.customId)\"\n :title=\"item.title\"\n :is-save=\"!item.isRealCanDel\"\n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\"\n :analysis=\"item.analysis\"\n :show-action=\"!isPreview\"\n :is-edit=\"item.isEdit || false\"\n :exam-answer-setting-v-o=\"item.examAnswerSettingVO || {}\"\n :exam-rich-text-content=\"item.examRichTextContent\"\n :exam-answer-relation-type=\"item.examAnswerRelationType\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n <SubjectTextFill\n v-else-if=\"item.answerType === 'text_fill'\"\n v-bind=\"attrs\"\n :order-index=\"currentIndex()(item.customId)\"\n :title=\"item.title\"\n :is-save=\"!item.isRealCanDel\"\n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\"\n :analysis=\"item.analysis\"\n :show-action=\"!isPreview\"\n :is-edit=\"item.isEdit || false\"\n :exam-expand=\"item.examExpand\"\n :exam-answer-setting-v-o=\"item.examAnswerSettingVO || {}\"\n :exam-answer-relation-type=\"item.examAnswerRelationType\"\n :exam-rich-text-content=\"item.examRichTextContent\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n <SubjectRichText\n v-else-if=\"item.answerType === 'rich_text'\"\n v-bind=\"attrs\"\n :order-index=\"currentIndex()(item.customId)\"\n :rich-text-content=\"item.richTextContent\"\n :is-set=\"item.hasSet || false\"\n :is-save=\"!item.isRealCanDel\"\n :is-edit=\"item.isEdit || false\"\n :show-action=\"!isPreview\"\n :exam-answer-relation-type=\"item.examAnswerRelationType\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n <SubjectPageEnd\n v-else-if=\"item.answerType === 'page_end'\"\n :key=\"index\"\n :total-page=\"totalPageIndex()\"\n :current-page-index=\"currentPageIndex(item.customId)\"\n :item=\"item\"\n :is-edit=\"item.isEdit || false\"\n :is-set=\"item.hasSet || false\"\n :is-save=\"!item.isRealCanDel\"\n :exam-answer-relation-type=\"item.examAnswerRelationType\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n </div>\n </div>\n </div>\n</template>\n"],"names":["props","__props","emits","__emit","currentList","ref","attrs","useAttrs","__expose","addSubject","uploadExcel","list","value","concat","addExam","items","console","log","currentIndex","newList","forEach","v","newItem","customId","setGuid","answerType","richTextContent","examTypeEnum","answers","map","c","title","answer","answerId","examAnswerId","isCorrect","isSave","isEdit","isRealCanDel","hasSet","pageIndex","push","analysis","scaleQuestionList","examAnswerRelationType","setAnswerRelation","answerRelations","customAnswerId","targetItem","find","targetAnswer","currentPageIndex","computed","currentPageList","filter","currentId","findIndex","currentExamId","current","output","type","index","newSubject","splice","move","item","length","saveSubject","deleteSubject","ElMessage","success","setRelation","examAnswers","watch","subjectList","immediate","ns","useNamespace"],"mappings":"2zBAcA,MAAMA,EAAQC,EAIRC,EAAQC,EACRC,EAAcC,EAAIA,IAAA,IAClBC,EAAQC,EAAAA,WAEDC,EAAA,CACXC,aACAL,cACAM,YAuGF,SAAqBC,GACnBP,EAAYQ,MAAQR,EAAYQ,MAAMC,OAAOF,EAAI,EAvGjDG,QAuDF,SAAiBC,GAC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AEI,aAA2ByC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../../../packages/components/src/subject-type/index.ts"],"sourcesContent":["import { withInstall } from '../withInstall'\nimport component from './src/subject-type.vue'\n\nconst QxsSubjectType = withInstall(component)\n \nexport {\n QxsSubjectType\n}\n \nexport default QxsSubjectType"],"names":["QxsSubjectType","withInstall","component","default"],"mappings":"gJAGA,MAAMA,EAAiBC,cAAYC,EAASC"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../../../packages/components/src/subject-type/index.ts"],"sourcesContent":["import { withInstall } from '../withInstall'\nimport component from './src/subject-type.vue'\n\nconst QxsSubjectType = withInstall(component)\n\nexport {\n QxsSubjectType,\n}\n\nexport default QxsSubjectType\n"],"names":["QxsSubjectType","withInstall","component","default"],"mappings":"gJAGA,MAAMA,EAAiBC,cAAYC,EAASC"}
@@ -1 +1 @@
1
- {"version":3,"file":"subject-type.vue.cjs","sources":["../../../../../../packages/components/src/subject-type/src/subject-type.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useNamespace } from '@qxs-bns/hooks'\n\ndefineOptions({\n name: 'QxsSubjectType',\n})\nconst emits = defineEmits(['select'])\nconst subjectOptions = ref([\n {\n type: 'single',\n label: '单选题',\n }, {\n type: 'multiple',\n label: '多选题',\n },\n {\n type: 'blank_fill',\n label: '填空题',\n },\n {\n type: 'text_fill',\n label: '问答题',\n },\n {\n type: 'scale',\n label: '量表题',\n },\n {\n type: 'sort',\n label: '排序题',\n },\n])\nconst otherOptions = ref([\n {\n type: 'rich_text',\n label: '富文本',\n },\n {\n type: 'page_end',\n label: '分页器',\n },\n])\nconst interactionOptions = ref([\n {\n type: 'single',\n label: '单选题',\n }, {\n type: 'multiple',\n label: '多选题',\n },\n])\nconst ns = useNamespace('subject-type')\n\n</script>\n\n<template>\n <div :class=\"ns.e('type-list')\">\n <div class=\"type-item\">\n <div>普通题目类型</div>\n <div class=\"base-subject\">\n <div v-for=\"item in subjectOptions\" :key=\"item.type\" class=\"item flex-center\"\n @click=\"emits('select', item.type)\">\n <span>{{ item.label }}</span>\n </div>\n </div>\n </div>\n <div class=\"type-item\">\n <div>其他</div>\n <div class=\"base-subject flex\">\n <div v-for=\"item in otherOptions\" :key=\"item.type\" class=\"item flex-center\" @click=\"emits('select', item.type)\">\n <span>{{ item.label }}</span>\n </div>\n </div>\n </div>\n <div class=\"type-item\">\n <div>互动问答类型(支持设置结果项)</div>\n <div class=\"base-subject flex\">\n <div v-for=\"item in interactionOptions\" :key=\"item.type\" class=\"item flex-center\"\n @click=\"emits('select', item.type, true)\">\n <span>{{ item.label }}</span>\n </div>\n </div>\n </div>\n </div>\n</template>\n"],"names":["emits","__emit","subjectOptions","ref","type","label","otherOptions","interactionOptions","ns","useNamespace"],"mappings":"oaAMA,MAAMA,EAAQC,EACRC,EAAiBC,EAAAA,IAAI,CACzB,CACEC,KAAM,SACNC,MAAO,OACN,CACDD,KAAM,WACNC,MAAO,OAET,CACED,KAAM,aACNC,MAAO,OAET,CACED,KAAM,YACNC,MAAO,OAET,CACED,KAAM,QACNC,MAAO,OAET,CACED,KAAM,OACNC,MAAO,SAGLC,EAAeH,EAAAA,IAAI,CACvB,CACEC,KAAM,YACNC,MAAO,OAET,CACED,KAAM,WACNC,MAAO,SAGLE,EAAqBJ,EAAAA,IAAI,CAC7B,CACEC,KAAM,SACNC,MAAO,OACN,CACDD,KAAM,WACNC,MAAO,SAGLG,EAAKC,eAAa"}
1
+ {"version":3,"file":"subject-type.vue.cjs","sources":["../../../../../../packages/components/src/subject-type/src/subject-type.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useNamespace } from '@qxs-bns/hooks'\n\ndefineOptions({\n name: 'QxsSubjectType',\n})\nconst emits = defineEmits(['select'])\nconst subjectOptions = ref([\n {\n type: 'single',\n label: '单选题',\n }, {\n type: 'multiple',\n label: '多选题',\n },\n {\n type: 'blank_fill',\n label: '填空题',\n },\n {\n type: 'text_fill',\n label: '问答题',\n },\n {\n type: 'scale',\n label: '量表题',\n },\n {\n type: 'sort',\n label: '排序题',\n },\n])\nconst otherOptions = ref([\n {\n type: 'rich_text',\n label: '富文本',\n },\n {\n type: 'page_end',\n label: '分页器',\n },\n])\nconst interactionOptions = ref([\n {\n type: 'single',\n label: '单选题',\n }, {\n type: 'multiple',\n label: '多选题',\n },\n])\nconst ns = useNamespace('subject-type')\n</script>\n\n<template>\n <div :class=\"ns.e('type-list')\">\n <div class=\"type-item\">\n <div>普通题目类型</div>\n <div class=\"base-subject\">\n <div\n v-for=\"item in subjectOptions\"\n :key=\"item.type\"\n class=\"item flex-center\"\n @click=\"emits('select', item.type)\"\n >\n <span>{{ item.label }}</span>\n </div>\n </div>\n </div>\n <div class=\"type-item\">\n <div>其他</div>\n <div class=\"base-subject flex\">\n <div\n v-for=\"item in otherOptions\"\n :key=\"item.type\"\n class=\"item flex-center\"\n @click=\"emits('select', item.type)\"\n >\n <span>{{ item.label }}</span>\n </div>\n </div>\n </div>\n <div class=\"type-item\">\n <div>互动问答类型(支持设置结果项)</div>\n <div class=\"base-subject flex\">\n <div\n v-for=\"item in interactionOptions\"\n :key=\"item.type\"\n class=\"item flex-center\"\n @click=\"emits('select', item.type, true)\"\n >\n <span>{{ item.label }}</span>\n </div>\n </div>\n </div>\n </div>\n</template>\n"],"names":["emits","__emit","subjectOptions","ref","type","label","otherOptions","interactionOptions","ns","useNamespace"],"mappings":"oaAMA,MAAMA,EAAQC,EACRC,EAAiBC,EAAAA,IAAI,CACzB,CACEC,KAAM,SACNC,MAAO,OACN,CACDD,KAAM,WACNC,MAAO,OAET,CACED,KAAM,aACNC,MAAO,OAET,CACED,KAAM,YACNC,MAAO,OAET,CACED,KAAM,QACNC,MAAO,OAET,CACED,KAAM,OACNC,MAAO,SAGLC,EAAeH,EAAAA,IAAI,CACvB,CACEC,KAAM,YACNC,MAAO,OAET,CACED,KAAM,WACNC,MAAO,SAGLE,EAAqBJ,EAAAA,IAAI,CAC7B,CACEC,KAAM,SACNC,MAAO,OACN,CACDD,KAAM,WACNC,MAAO,SAGLG,EAAKC,eAAa"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@qxs-bns/components",
3
3
  "type": "module",
4
- "version": "0.0.48",
4
+ "version": "0.0.49",
5
5
  "description": "Vue 3 Component Library",
6
6
  "license": "MIT",
7
7
  "homepage": "https://trry-hub.github.io/qxs-bns/",
@@ -64,17 +64,10 @@
64
64
  "require": "./lib/index.cjs",
65
65
  "types": "./types/index.d.ts"
66
66
  },
67
- "./es/*": {
68
- "import": "./es/*.mjs",
69
- "types": "./types/*.d.ts"
70
- },
71
- "./lib/*": {
72
- "require": "./lib/*.cjs",
73
- "types": "./types/*.d.ts"
74
- },
75
67
  "./*": {
76
- "import": "./es/*",
77
- "types": "./types/*.d.ts"
68
+ "import": "./*",
69
+ "require": "./*",
70
+ "types": "./*"
78
71
  },
79
72
  "./theme-chalk/*": "./theme-chalk/*"
80
73
  }
@@ -1 +1 @@
1
- :root [data-fixed-calc-width]{position:fixed;right:0;left:0%}:root [data-mode=mobile] [data-fixed-calc-width]{width:100% !important}.qxs-data-chart__data-chart-table{box-sizing:border-box;display:flex;flex-direction:column}.qxs-data-chart__data-chart-table .title{display:flex;align-items:center;justify-content:space-between;padding:0 5px;margin-top:2px;margin-bottom:7px;font-family:sans-serif;font-size:14px;font-weight:bolder;color:#464646}.qxs-data-chart__data-chart-table :deep(.qxs-table){position:relative;display:flex;flex:1;flex-direction:column;overflow:hidden;background-color:rgba(0,0,0,0);border-top-left-radius:4px;border-top-right-radius:4px}.qxs-data-chart__data-chart-table :deep(.qxs-table) .qxs-table__body-wrapper .qxs-table__cell{border-right:0}.qxs-data-chart__empty{display:flex;align-items:center;justify-content:center;height:100%}.qxs-data-chart__empty-content{display:flex;flex-direction:column;align-items:center;pointer-events:none}.qxs-data-chart__empty-description{margin-top:8px;font-size:14px;line-height:1.4;color:var(--qxs-text-color-secondary, #909399)}.qxs-data-chart__wrapper{height:100%}.qxs-fixed-action-bar__actionbar{bottom:0;z-index:10;padding:var(--qxs-fixed-action-bar-actionbar-padding);padding-bottom:calc(env(safe-area-inset-bottom) + var(--qxs-fixed-action-bar-actionbar-padding-bottom));text-align:center;background-color:var(--qxs-bg-color, #fff);box-shadow:0 0 1px 0 var(--qxs-border-color, #f3f3f2);transition:box-shadow .3s,var(--qxs-transition-box-shadow, #f3f3f2)}.qxs-fixed-action-bar__actionbar.is-shadow{box-shadow:0 -10px 10px -10px var(--qxs-border-color, #fff)}.qxs-photo-crop-tool__img-box{position:relative;display:flex;align-items:center;justify-content:center;width:100%;height:100%;overflow:hidden;background-color:#fafafa}.qxs-photo-crop-tool__error-message{color:red}.qxs-photo-crop-tool__image{max-width:100%;max-height:100%;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;user-select:none;-o-object-fit:contain;object-fit:contain;-webkit-user-drag:none}.qxs-photo-crop-tool__crop-tool-box{position:absolute;width:calc(var(--qxs-photo-crop-tool-width)*1px);max-width:100%;height:calc(var(--qxs-photo-crop-tool-height)*1px);max-height:100%;aspect-ratio:var(--qxs-photo-crop-tool-aspect-ratio);overflow:hidden;cursor:move;border:1px dashed #fff;box-shadow:0 0 0 9999px rgba(0,0,0,.4)}.qxs-photo-crop-tool__crop-tool-box>div{position:absolute;z-index:3;width:30%;aspect-ratio:1/1;background-color:rgba(2,2,2,.01);border-radius:50%;transition:all .3s}.qxs-photo-crop-tool__crop-tool-box>div:hover,.qxs-photo-crop-tool__crop-tool-box>div:active{background-color:rgba(2,2,2,.5)}.qxs-photo-crop-tool__top-left{top:0;left:0;cursor:nwse-resize;transform:translate3d(-50%, -50%, 0)}.qxs-photo-crop-tool__top-right{top:0;right:0;cursor:nesw-resize;transform:translate3d(50%, -50%, 0)}.qxs-photo-crop-tool__bottom-right{right:0;bottom:0;cursor:nwse-resize;transform:translate3d(50%, 50%, 0)}.qxs-photo-crop-tool__bottom-left{bottom:0;left:0;cursor:nesw-resize;transform:translate3d(-50%, 50%, 0)}.qxs-image-upload__container{line-height:initial}.qxs-image-upload__control{display:inline-block;vertical-align:top}.qxs-image-upload__control .image{position:relative;overflow:hidden;border-radius:6px}.qxs-image-upload__control .image .mask{position:absolute;top:0;width:100%;height:100%;background-color:var(--qxs-overlay-color-lighter);opacity:0;transition:opacity .3s}.qxs-image-upload__control .image .mask .actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;width:100px;height:100px;position:absolute;top:50%;left:50%;transform:translateX(-50%) translateY(-50%)}.qxs-image-upload__control .image .mask .actions span{width:50%;color:var(--qxs-color-white);text-align:center;cursor:pointer;transition:color .1s,transform .1s}.qxs-image-upload__control .image .mask .actions span:hover{transform:scale(1.5)}.qxs-image-upload__control .image .mask .actions span [class=qxs-icon]{font-size:24px}.qxs-image-upload__control .image:hover .mask{opacity:1}.qxs-image-upload__control .is-drag{font-size:0;display:inline-block !important}.qxs-image-upload__control .is-drag [class$=-upload-dragger]{display:inline-block;padding:0;font-size:0}.qxs-image-upload__control .is-drag [class$=-upload-dragger] [class$=-image]{display:block}.qxs-image-upload__control .is-drag [class$=-upload-dragger].is-dragover{border-width:1px}.qxs-image-upload__control .is-drag [class$=-upload-dragger] .image-slot{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;height:100%;font-size:14px;color:var(--qxs-text-color-placeholder);background-color:#f5f5f5;transition:all .3s}.qxs-image-upload__control .is-drag [class$=-upload-dragger] .image-slot:hover{background-color:#eee}.qxs-image-upload__control .is-drag [class$=-upload-dragger] .image-slot [class$=-icon]{font-size:28px}.qxs-image-upload__control .is-drag [class$=-upload-dragger] .image-slot p{margin-top:10px;margin-bottom:0;line-height:1em;color:#5a5a5a}.qxs-image-upload__control .is-drag [class$=-upload-dragger] .progress{position:absolute;top:0}.qxs-image-upload__control .is-drag [class$=-upload-dragger] .progress::after{position:absolute;top:0;left:0;width:100%;height:100%;content:"";background-color:var(--qxs-overlay-color-lighter)}.qxs-image-upload__control .is-drag [class$=-upload-dragger] .progress [class$=-progress]{z-index:1;position:absolute;top:50%;left:50%;transform:translateX(-50%) translateY(-50%)}.qxs-image-upload__control .is-drag [class$=-upload-dragger] .progress [class$=-progress] [class$=-progress__text]{color:var(--qxs-text-color-placeholder)}.qxs-image-upload__container [class$=-upload__tip-text]{font-size:14px;line-height:32px;color:#c8c8c8}.qxs-file-upload__control .is-drag{display:inline-block !important}.qxs-file-upload__control .is-drag [class$=-upload-dragger]{padding:0}.qxs-file-upload__control .is-drag [class$=-upload-dragger] [class$=-icon--upload]{margin-bottom:0;font-size:40px}.qxs-file-upload__control .is-drag [class$=-upload-dragger] [class$=-upload__text]{padding:0 6px;font-size:14px;line-height:1.5}.qxs-file-upload__control .is-drag.is-dragover{border-width:1px}.qxs-file-upload__control .is-drag .slot{width:160px;height:90px}.qxs-tiny-mce-editor__tiny-mce .tox-tinymce{border-width:1px;border-radius:var(--qxs-border-radius-base, 4px)}.qxs-tiny-mce-editor__tiny-mce .tox-tinymce:not(.tox-tinymce-inline) .tox-editor-header{box-shadow:0 2px 2px -2px rgba(34,47,62,.1),0 4px 4px -4px rgba(34,47,62,.07)}.qxs-tiny-mce-editor__tiny-mce .tox-tinymce .tox-sidebar-wrap{overflow-y:auto}.qxs-tiny-mce-editor__tiny-mce .tox-tinymce .tox-sidebar-wrap .tox-edit-area::before{border-width:1px;border-radius:0}.qxs-tiny-mce-editor .tox-tinymce-aux{z-index:2500 !important}.qxs-subject-list__list-exam .flex{display:flex;align-items:center}.qxs-subject-list__list-exam .flex-items-center{display:flex;align-items:center}.qxs-subject-list__list-exam .flex-justify-between{display:flex;justify-content:space-between}.qxs-subject-list__list-exam .flex-justify-center{display:flex;justify-content:center}.qxs-subject-list__list-exam .flex-justify-end{display:flex;justify-content:flex-end}.qxs-subject-list__list-exam .margin-left-10{margin-left:10px}.qxs-subject-list__list-exam .label{min-width:50px}.qxs-subject-list__list-exam .flex-1{flex:1}.qxs-subject-list__list-exam .subject-list-wrapper{width:100%;margin-bottom:20px}.qxs-subject-list__list-exam .margin-bottom{margin-bottom:20px}.qxs-subject-list__list-exam .auto-line{flex:1;background-color:#c8c8c8;height:1px;margin:0 15px}.qxs-subject-list__list-exam .title{font-size:14px;font-weight:500}.qxs-subject-list__list-exam .rich-text img{max-width:100%}.qxs-subject-single__single-exam .preview-answer{display:flex;flex-direction:column;margin-bottom:10px}.qxs-subject-single__single-exam .flex{display:flex;align-items:center}.qxs-subject-single__single-exam .margin-bottom{margin-bottom:20px}.qxs-subject-single__single-exam .answer-list .answer-item{margin-top:15px}.qxs-subject-single__single-exam .answer-list .answer-item .input{width:300px}.qxs-subject-single__single-exam .answer-list .answer-item .input [class$=-input]{font-weight:bold}.qxs-subject-single__single-exam .answer-list .answer-item .correct{margin:0 10px}.qxs-subject-single__single-exam .answer-list .answer-item .correct:hover{color:#3d61e3;cursor:pointer}.qxs-subject-single__single-exam .answer-list .answer-item .is-correct{color:#67c23a}.qxs-subject-single__single-exam .answer-list .answer-item .icon{margin-left:10px;font-size:18px;color:#a3a3a3;cursor:pointer}.qxs-subject-single__single-exam .answer-list .answer-item .disabled{color:#c0c4cc;cursor:not-allowed}.qxs-subject-single__single-exam .preview .answer-radio{padding-left:10px}.qxs-subject-single__single-exam .preview .answer-radio .radio{margin-top:10px}.qxs-subject-blank-fill__blank-fill-exam .flex{display:flex;align-items:center}.qxs-subject-blank-fill__blank-fill-exam .label{min-width:50px;margin-right:10px}.qxs-subject-blank-fill__blank-fill-exam .margin-bottom{margin-bottom:20px}.qxs-subject-blank-fill__blank-fill-exam .answer-list .answer-item{width:100%;margin-top:15px}.qxs-subject-blank-fill__blank-fill-exam .answer-list .answer-item .answer-tags{flex:1;padding:5px 15px;border:1px solid #eee;border-radius:4px}.qxs-subject-blank-fill__blank-fill-exam .answer-list .answer-item .answer-tags [class$=-tag]{margin-right:10px}.qxs-subject-blank-fill__blank-fill-exam .preview .content{min-height:100px;padding-top:10px;background-color:#fff}.qxs-subject-text-fill__text-fill-exam .flex{display:flex;align-items:center}.qxs-subject-text-fill__text-fill-exam .label{min-width:50px;margin-right:10px}.qxs-subject-text-fill__text-fill-exam .margin-bottom{margin-bottom:20px}.qxs-subject-text-fill__text-fill-exam .answer-list .answer-item{width:100%;margin-top:15px}.qxs-subject-text-fill__text-fill-exam .answer-list .answer-item .answer-tags{flex:1;padding:5px 15px;border:1px solid #eee;border-radius:4px}.qxs-subject-text-fill__text-fill-exam .answer-list .answer-item .operation .icon{margin-left:10px;font-size:16px;color:#a3a3a3;cursor:pointer}.qxs-subject-text-fill__text-fill-exam .answer-list .answer-item .operation .disabled{color:#c0c4cc;cursor:not-allowed}.qxs-subject-text-fill__text-fill-exam .preview .content{min-height:100px;margin-top:10px}.qxs-subject-scale__scale-exam .flex{display:flex;align-items:center}.qxs-subject-scale__scale-exam .label{min-width:50px}.qxs-subject-scale__scale-exam .margin-bottom{margin-bottom:20px}.qxs-subject-scale__scale-exam .answer{margin:20px 0}.qxs-subject-scale__scale-exam .answer .answer-list{margin-left:40px}.qxs-subject-scale__scale-exam .answer .answer-list .answer-item{margin-bottom:20px}.qxs-subject-scale__scale-exam .answer .answer-list .answer-item .order{width:16px;margin-right:10px}.qxs-subject-scale__scale-exam .answer .answer-list .answer-item .icon{margin-left:10px;font-size:16px;color:#a3a3a3;cursor:pointer}.qxs-subject-scale__scale-exam .answer .answer-list .answer-item .disabled{color:#c0c4cc;cursor:not-allowed}.qxs-subject-scale__scale-exam .preview .answer-radio .radio-item .qxs-radio-wrapper{margin-inline-end:0}.qxs-subject-layout__layout-exam{padding:10px;font-size:12px;color:#5a5a5a}.qxs-subject-layout__layout-exam .edit{position:relative;padding:20px 10px;padding-bottom:10px;margin-top:20px;background-color:#f6f7fb}.qxs-subject-layout__layout-exam .edit .triangle-up{position:absolute;top:-20px;left:100px;width:0;height:0;border-right:20px solid rgba(0,0,0,0);border-bottom:20px solid #f6f7fb;border-left:20px solid rgba(0,0,0,0)}.qxs-subject-action__action-exam .action{padding:20px 0}.qxs-subject-action__action-exam .active{background-color:#f6f7fb;padding-left:10px;padding-right:10px}.qxs-subject-action__action-exam .btn-margin{margin-right:10px}.qxs-subject-action__action-exam .has-set{display:flex;align-items:center;font-size:12px;color:#bbb}.qxs-subject-action__action-exam .vertical-radio-group{display:flex;flex-direction:column;align-items:flex-start;margin-left:20px}.qxs-subject-action__action-exam .vertical-radio-group ::v-deep(.qxs-radio){display:block;margin-right:0}.qxs-subject-type__type-list .type-item{margin-bottom:20px}.qxs-subject-type__type-list .base-subject{display:flex;flex-wrap:wrap;align-items:center}.qxs-subject-type__type-list .base-subject .item{width:50px;height:22px;margin-top:10px;margin-right:10px;font-size:14px;color:#5a5a5a;text-align:center;cursor:pointer;background:#fafafa}.qxs-subject-type__type-list .base-subject .item:hover{color:#3d61e3;background:rgba(61,97,227,.12)}
1
+ :root [data-fixed-calc-width]{position:fixed;right:0;left:0%}:root [data-mode=mobile] [data-fixed-calc-width]{width:100% !important}.qxs-data-chart__data-chart-table{box-sizing:border-box;display:flex;flex-direction:column}.qxs-data-chart__data-chart-table .title{display:flex;align-items:center;justify-content:space-between;padding:0 5px;margin-top:2px;margin-bottom:7px;font-family:sans-serif;font-size:14px;font-weight:bolder;color:#464646}.qxs-data-chart__data-chart-table :deep(.qxs-table){position:relative;display:flex;flex:1;flex-direction:column;overflow:hidden;background-color:rgba(0,0,0,0);border-top-left-radius:4px;border-top-right-radius:4px}.qxs-data-chart__data-chart-table :deep(.qxs-table) .qxs-table__body-wrapper .qxs-table__cell{border-right:0}.qxs-data-chart__empty{display:flex;align-items:center;justify-content:center;height:100%}.qxs-data-chart__empty-content{display:flex;flex-direction:column;align-items:center;pointer-events:none}.qxs-data-chart__empty-description{margin-top:8px;font-size:14px;line-height:1.4;color:var(--qxs-text-color-secondary, #909399)}.qxs-data-chart__wrapper{height:100%}.qxs-fixed-action-bar__actionbar{bottom:0;z-index:10;padding:var(--qxs-fixed-action-bar-actionbar-padding);padding-bottom:calc(env(safe-area-inset-bottom) + var(--qxs-fixed-action-bar-actionbar-padding-bottom));text-align:center;background-color:var(--qxs-bg-color, #fff);box-shadow:0 0 1px 0 var(--qxs-border-color, #f3f3f2);transition:box-shadow .3s,var(--qxs-transition-box-shadow, #f3f3f2)}.qxs-fixed-action-bar__actionbar.is-shadow{box-shadow:0 0 1px 0 var(--qxs-border-color, #f3f3f2)}.qxs-photo-crop-tool__img-box{position:relative;display:flex;align-items:center;justify-content:center;width:100%;height:100%;overflow:hidden;background-color:#fafafa}.qxs-photo-crop-tool__error-message{color:red}.qxs-photo-crop-tool__image{max-width:100%;max-height:100%;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;user-select:none;-o-object-fit:contain;object-fit:contain;-webkit-user-drag:none}.qxs-photo-crop-tool__crop-tool-box{position:absolute;width:calc(var(--qxs-photo-crop-tool-width)*1px);max-width:100%;height:calc(var(--qxs-photo-crop-tool-height)*1px);max-height:100%;aspect-ratio:var(--qxs-photo-crop-tool-aspect-ratio);overflow:hidden;cursor:move;border:1px dashed #fff;box-shadow:0 0 0 9999px rgba(0,0,0,.4)}.qxs-photo-crop-tool__crop-tool-box>div{position:absolute;z-index:3;width:30%;aspect-ratio:1/1;background-color:rgba(2,2,2,.01);border-radius:50%;transition:all .3s}.qxs-photo-crop-tool__crop-tool-box>div:hover,.qxs-photo-crop-tool__crop-tool-box>div:active{background-color:rgba(2,2,2,.5)}.qxs-photo-crop-tool__top-left{top:0;left:0;cursor:nwse-resize;transform:translate3d(-50%, -50%, 0)}.qxs-photo-crop-tool__top-right{top:0;right:0;cursor:nesw-resize;transform:translate3d(50%, -50%, 0)}.qxs-photo-crop-tool__bottom-right{right:0;bottom:0;cursor:nwse-resize;transform:translate3d(50%, 50%, 0)}.qxs-photo-crop-tool__bottom-left{bottom:0;left:0;cursor:nesw-resize;transform:translate3d(-50%, 50%, 0)}.qxs-image-upload__container{line-height:initial}.qxs-image-upload__control{display:inline-block;vertical-align:top}.qxs-image-upload__control .image{position:relative;overflow:hidden;border-radius:6px}.qxs-image-upload__control .image .mask{position:absolute;top:0;width:100%;height:100%;background-color:var(--qxs-overlay-color-lighter);opacity:0;transition:opacity .3s}.qxs-image-upload__control .image .mask .actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;width:100px;height:100px;position:absolute;top:50%;left:50%;transform:translateX(-50%) translateY(-50%)}.qxs-image-upload__control .image .mask .actions span{width:50%;color:var(--qxs-color-white);text-align:center;cursor:pointer;transition:color .1s,transform .1s}.qxs-image-upload__control .image .mask .actions span:hover{transform:scale(1.5)}.qxs-image-upload__control .image .mask .actions span [class=qxs-icon]{font-size:24px}.qxs-image-upload__control .image:hover .mask{opacity:1}.qxs-image-upload__control .is-drag{display:inline-block !important;font-size:0}.qxs-image-upload__control .is-drag [class$=-upload-dragger]{display:inline-block;padding:0;font-size:0}.qxs-image-upload__control .is-drag [class$=-upload-dragger] [class$=-image]{display:block}.qxs-image-upload__control .is-drag [class$=-upload-dragger].is-dragover{border-width:1px}.qxs-image-upload__control .is-drag [class$=-upload-dragger] .image-slot{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;height:100%;font-size:14px;color:var(--qxs-text-color-placeholder);background-color:#f5f5f5;transition:all .3s}.qxs-image-upload__control .is-drag [class$=-upload-dragger] .image-slot:hover{background-color:#eee}.qxs-image-upload__control .is-drag [class$=-upload-dragger] .image-slot [class$=-icon]{font-size:28px}.qxs-image-upload__control .is-drag [class$=-upload-dragger] .image-slot p{margin-top:10px;margin-bottom:0;line-height:1em;color:#5a5a5a}.qxs-image-upload__control .is-drag [class$=-upload-dragger] .progress{position:absolute;top:0}.qxs-image-upload__control .is-drag [class$=-upload-dragger] .progress::after{position:absolute;top:0;left:0;width:100%;height:100%;content:"";background-color:var(--qxs-overlay-color-lighter)}.qxs-image-upload__control .is-drag [class$=-upload-dragger] .progress [class$=-progress]{z-index:1;position:absolute;top:50%;left:50%;transform:translateX(-50%) translateY(-50%)}.qxs-image-upload__control .is-drag [class$=-upload-dragger] .progress [class$=-progress] [class$=-progress__text]{color:var(--qxs-text-color-placeholder)}.qxs-image-upload__container [class$=-upload__tip-text]{font-size:14px;line-height:32px;color:#c8c8c8}.qxs-file-upload__control .is-drag{display:inline-block !important}.qxs-file-upload__control .is-drag [class$=-upload-dragger]{padding:0}.qxs-file-upload__control .is-drag [class$=-upload-dragger] [class$=-icon--upload]{margin-bottom:0;font-size:40px}.qxs-file-upload__control .is-drag [class$=-upload-dragger] [class$=-upload__text]{padding:0 6px;font-size:14px;line-height:1.5}.qxs-file-upload__control .is-drag.is-dragover{border-width:1px}.qxs-file-upload__control .is-drag .slot{width:160px;height:90px}.qxs-tiny-mce-editor__tiny-mce .tox-tinymce{border-width:1px;border-radius:var(--qxs-border-radius-base, 4px)}.qxs-tiny-mce-editor__tiny-mce .tox-tinymce:not(.tox-tinymce-inline) .tox-editor-header{box-shadow:0 2px 2px -2px rgba(34,47,62,.1),0 4px 4px -4px rgba(34,47,62,.07)}.qxs-tiny-mce-editor__tiny-mce .tox-tinymce .tox-sidebar-wrap{overflow-y:auto}.qxs-tiny-mce-editor__tiny-mce .tox-tinymce .tox-sidebar-wrap .tox-edit-area::before{border-width:1px;border-radius:0}.qxs-tiny-mce-editor .tox-tinymce-aux{z-index:2500 !important}.qxs-subject-list__list-exam .flex{display:flex;align-items:center}.qxs-subject-list__list-exam .flex-items-center{display:flex;align-items:center}.qxs-subject-list__list-exam .flex-justify-between{display:flex;justify-content:space-between}.qxs-subject-list__list-exam .flex-justify-center{display:flex;justify-content:center}.qxs-subject-list__list-exam .flex-justify-end{display:flex;justify-content:flex-end}.qxs-subject-list__list-exam .margin-left-10{margin-left:10px}.qxs-subject-list__list-exam .label{min-width:50px}.qxs-subject-list__list-exam .flex-1{flex:1}.qxs-subject-list__list-exam .subject-list-wrapper{width:100%;margin-bottom:20px}.qxs-subject-list__list-exam .margin-bottom{margin-bottom:20px}.qxs-subject-list__list-exam .auto-line{flex:1;height:1px;margin:0 15px;background-color:#c8c8c8}.qxs-subject-list__list-exam .title{font-size:14px;font-weight:500}.qxs-subject-list__list-exam .rich-text img{max-width:100%}.qxs-subject-single__single-exam .preview-answer{display:flex;flex-direction:column;margin-bottom:10px}.qxs-subject-single__single-exam .flex{display:flex;align-items:center}.qxs-subject-single__single-exam .margin-bottom{margin-bottom:20px}.qxs-subject-single__single-exam .answer-list .answer-item{margin-top:15px}.qxs-subject-single__single-exam .answer-list .answer-item .input{width:300px}.qxs-subject-single__single-exam .answer-list .answer-item .input [class$=-input]{font-weight:bold}.qxs-subject-single__single-exam .answer-list .answer-item .correct{margin:0 10px}.qxs-subject-single__single-exam .answer-list .answer-item .correct:hover{color:#3d61e3;cursor:pointer}.qxs-subject-single__single-exam .answer-list .answer-item .is-correct{color:#67c23a}.qxs-subject-single__single-exam .answer-list .answer-item .icon{margin-left:10px;font-size:18px;color:#a3a3a3;cursor:pointer}.qxs-subject-single__single-exam .answer-list .answer-item .disabled{color:#c0c4cc;cursor:not-allowed}.qxs-subject-single__single-exam .preview .answer-radio{padding-left:10px}.qxs-subject-single__single-exam .preview .answer-radio .radio{margin-top:10px}.qxs-subject-blank-fill__blank-fill-exam .flex{display:flex;align-items:center}.qxs-subject-blank-fill__blank-fill-exam .label{min-width:50px;margin-right:10px}.qxs-subject-blank-fill__blank-fill-exam .margin-bottom{margin-bottom:20px}.qxs-subject-blank-fill__blank-fill-exam .answer-list .answer-item{width:100%;margin-top:15px}.qxs-subject-blank-fill__blank-fill-exam .answer-list .answer-item .answer-tags{flex:1;padding:5px 15px;border:1px solid #eee;border-radius:4px}.qxs-subject-blank-fill__blank-fill-exam .answer-list .answer-item .answer-tags [class$=-tag]{margin-right:10px}.qxs-subject-blank-fill__blank-fill-exam .preview .content{min-height:100px;padding-top:10px;background-color:#fff}.qxs-subject-text-fill__text-fill-exam .flex{display:flex;align-items:center}.qxs-subject-text-fill__text-fill-exam .label{min-width:50px;margin-right:10px}.qxs-subject-text-fill__text-fill-exam .margin-bottom{margin-bottom:20px}.qxs-subject-text-fill__text-fill-exam .answer-list .answer-item{width:100%;margin-top:15px}.qxs-subject-text-fill__text-fill-exam .answer-list .answer-item .answer-tags{flex:1;padding:5px 15px;border:1px solid #eee;border-radius:4px}.qxs-subject-text-fill__text-fill-exam .answer-list .answer-item .operation .icon{margin-left:10px;font-size:16px;color:#a3a3a3;cursor:pointer}.qxs-subject-text-fill__text-fill-exam .answer-list .answer-item .operation .disabled{color:#c0c4cc;cursor:not-allowed}.qxs-subject-text-fill__text-fill-exam .preview .content{min-height:100px;margin-top:10px}.qxs-subject-scale__scale-exam .flex{display:flex;align-items:center}.qxs-subject-scale__scale-exam .label{min-width:50px}.qxs-subject-scale__scale-exam .margin-bottom{margin-bottom:20px}.qxs-subject-scale__scale-exam .answer{margin:20px 0}.qxs-subject-scale__scale-exam .answer .answer-list{margin-left:40px}.qxs-subject-scale__scale-exam .answer .answer-list .answer-item{margin-bottom:20px}.qxs-subject-scale__scale-exam .answer .answer-list .answer-item .order{width:16px;margin-right:10px}.qxs-subject-scale__scale-exam .answer .answer-list .answer-item .icon{margin-left:10px;font-size:16px;color:#a3a3a3;cursor:pointer}.qxs-subject-scale__scale-exam .answer .answer-list .answer-item .disabled{color:#c0c4cc;cursor:not-allowed}.qxs-subject-scale__scale-exam .preview .answer-radio .radio-item .qxs-radio-wrapper{margin-inline-end:0}.qxs-subject-layout__layout-exam{padding:10px;font-size:12px;color:#5a5a5a}.qxs-subject-layout__layout-exam .edit{position:relative;padding:20px 10px;padding-bottom:10px;margin-top:20px;background-color:#f6f7fb}.qxs-subject-layout__layout-exam .edit .triangle-up{position:absolute;top:-20px;left:100px;width:0;height:0;border-right:20px solid rgba(0,0,0,0);border-bottom:20px solid #f6f7fb;border-left:20px solid rgba(0,0,0,0)}.qxs-subject-action__action-exam .action{padding:20px 0}.qxs-subject-action__action-exam .active{padding-right:10px;padding-left:10px;background-color:#f6f7fb}.qxs-subject-action__action-exam .btn-margin{margin-right:10px}.qxs-subject-action__action-exam .has-set{display:flex;align-items:center;font-size:12px;color:#bbb}.qxs-subject-action__action-exam .vertical-radio-group{display:flex;flex-direction:column;align-items:flex-start;margin-left:20px}.qxs-subject-action__action-exam .vertical-radio-group ::v-deep(.qxs-radio){display:block;margin-right:0}.qxs-subject-type__type-list .type-item{margin-bottom:20px}.qxs-subject-type__type-list .base-subject{display:flex;flex-wrap:wrap;align-items:center}.qxs-subject-type__type-list .base-subject .item{width:50px;height:22px;margin-top:10px;margin-right:10px;font-size:14px;color:#5a5a5a;text-align:center;cursor:pointer;background:#fafafa}.qxs-subject-type__type-list .base-subject .item:hover{color:#3d61e3;background:rgba(61,97,227,.12)}
@@ -1,5 +1,5 @@
1
- @forward './mixins/var.scss';
2
-
1
+ @forward "./mixins/var";
2
+
3
3
  :root {
4
4
  // 右侧内容区针对fixed元素,有横向铺满的需求,可在fixed元素上设置 [data-fixed-calc-width]
5
5
  [data-fixed-calc-width] {
@@ -1 +1 @@
1
- .qxs-fixed-action-bar__actionbar{bottom:0;z-index:10;padding:var(--qxs-fixed-action-bar-actionbar-padding);padding-bottom:calc(env(safe-area-inset-bottom) + var(--qxs-fixed-action-bar-actionbar-padding-bottom));text-align:center;background-color:var(--qxs-bg-color, #fff);box-shadow:0 0 1px 0 var(--qxs-border-color, #f3f3f2);transition:box-shadow .3s,var(--qxs-transition-box-shadow, #f3f3f2)}.qxs-fixed-action-bar__actionbar.is-shadow{box-shadow:0 -10px 10px -10px var(--qxs-border-color, #fff)}
1
+ .qxs-fixed-action-bar__actionbar{bottom:0;z-index:10;padding:var(--qxs-fixed-action-bar-actionbar-padding);padding-bottom:calc(env(safe-area-inset-bottom) + var(--qxs-fixed-action-bar-actionbar-padding-bottom));text-align:center;background-color:var(--qxs-bg-color, #fff);box-shadow:0 0 1px 0 var(--qxs-border-color, #f3f3f2);transition:box-shadow .3s,var(--qxs-transition-box-shadow, #f3f3f2)}.qxs-fixed-action-bar__actionbar.is-shadow{box-shadow:0 0 1px 0 var(--qxs-border-color, #f3f3f2)}
@@ -12,7 +12,7 @@
12
12
  transition: box-shadow 0.3s, var(--qxs-transition-box-shadow, #f3f3f2);
13
13
 
14
14
  @include when(shadow) {
15
- box-shadow: 0 -10px 10px -10px var(--qxs-border-color, #fff);
15
+ box-shadow: 0 0 1px 0 var(--qxs-border-color, #f3f3f2);
16
16
  }
17
17
  }
18
18
  }
@@ -1 +1 @@
1
- .qxs-image-upload__container{line-height:initial}.qxs-image-upload__control{display:inline-block;vertical-align:top}.qxs-image-upload__control .image{position:relative;overflow:hidden;border-radius:6px}.qxs-image-upload__control .image .mask{position:absolute;top:0;width:100%;height:100%;background-color:var(--qxs-overlay-color-lighter);opacity:0;transition:opacity .3s}.qxs-image-upload__control .image .mask .actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;width:100px;height:100px;position:absolute;top:50%;left:50%;transform:translateX(-50%) translateY(-50%)}.qxs-image-upload__control .image .mask .actions span{width:50%;color:var(--qxs-color-white);text-align:center;cursor:pointer;transition:color .1s,transform .1s}.qxs-image-upload__control .image .mask .actions span:hover{transform:scale(1.5)}.qxs-image-upload__control .image .mask .actions span [class=qxs-icon]{font-size:24px}.qxs-image-upload__control .image:hover .mask{opacity:1}.qxs-image-upload__control .is-drag{font-size:0;display:inline-block !important}.qxs-image-upload__control .is-drag [class$=-upload-dragger]{display:inline-block;padding:0;font-size:0}.qxs-image-upload__control .is-drag [class$=-upload-dragger] [class$=-image]{display:block}.qxs-image-upload__control .is-drag [class$=-upload-dragger].is-dragover{border-width:1px}.qxs-image-upload__control .is-drag [class$=-upload-dragger] .image-slot{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;height:100%;font-size:14px;color:var(--qxs-text-color-placeholder);background-color:#f5f5f5;transition:all .3s}.qxs-image-upload__control .is-drag [class$=-upload-dragger] .image-slot:hover{background-color:#eee}.qxs-image-upload__control .is-drag [class$=-upload-dragger] .image-slot [class$=-icon]{font-size:28px}.qxs-image-upload__control .is-drag [class$=-upload-dragger] .image-slot p{margin-top:10px;margin-bottom:0;line-height:1em;color:#5a5a5a}.qxs-image-upload__control .is-drag [class$=-upload-dragger] .progress{position:absolute;top:0}.qxs-image-upload__control .is-drag [class$=-upload-dragger] .progress::after{position:absolute;top:0;left:0;width:100%;height:100%;content:"";background-color:var(--qxs-overlay-color-lighter)}.qxs-image-upload__control .is-drag [class$=-upload-dragger] .progress [class$=-progress]{z-index:1;position:absolute;top:50%;left:50%;transform:translateX(-50%) translateY(-50%)}.qxs-image-upload__control .is-drag [class$=-upload-dragger] .progress [class$=-progress] [class$=-progress__text]{color:var(--qxs-text-color-placeholder)}.qxs-image-upload__container [class$=-upload__tip-text]{font-size:14px;line-height:32px;color:#c8c8c8}
1
+ .qxs-image-upload__container{line-height:initial}.qxs-image-upload__control{display:inline-block;vertical-align:top}.qxs-image-upload__control .image{position:relative;overflow:hidden;border-radius:6px}.qxs-image-upload__control .image .mask{position:absolute;top:0;width:100%;height:100%;background-color:var(--qxs-overlay-color-lighter);opacity:0;transition:opacity .3s}.qxs-image-upload__control .image .mask .actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;width:100px;height:100px;position:absolute;top:50%;left:50%;transform:translateX(-50%) translateY(-50%)}.qxs-image-upload__control .image .mask .actions span{width:50%;color:var(--qxs-color-white);text-align:center;cursor:pointer;transition:color .1s,transform .1s}.qxs-image-upload__control .image .mask .actions span:hover{transform:scale(1.5)}.qxs-image-upload__control .image .mask .actions span [class=qxs-icon]{font-size:24px}.qxs-image-upload__control .image:hover .mask{opacity:1}.qxs-image-upload__control .is-drag{display:inline-block !important;font-size:0}.qxs-image-upload__control .is-drag [class$=-upload-dragger]{display:inline-block;padding:0;font-size:0}.qxs-image-upload__control .is-drag [class$=-upload-dragger] [class$=-image]{display:block}.qxs-image-upload__control .is-drag [class$=-upload-dragger].is-dragover{border-width:1px}.qxs-image-upload__control .is-drag [class$=-upload-dragger] .image-slot{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;height:100%;font-size:14px;color:var(--qxs-text-color-placeholder);background-color:#f5f5f5;transition:all .3s}.qxs-image-upload__control .is-drag [class$=-upload-dragger] .image-slot:hover{background-color:#eee}.qxs-image-upload__control .is-drag [class$=-upload-dragger] .image-slot [class$=-icon]{font-size:28px}.qxs-image-upload__control .is-drag [class$=-upload-dragger] .image-slot p{margin-top:10px;margin-bottom:0;line-height:1em;color:#5a5a5a}.qxs-image-upload__control .is-drag [class$=-upload-dragger] .progress{position:absolute;top:0}.qxs-image-upload__control .is-drag [class$=-upload-dragger] .progress::after{position:absolute;top:0;left:0;width:100%;height:100%;content:"";background-color:var(--qxs-overlay-color-lighter)}.qxs-image-upload__control .is-drag [class$=-upload-dragger] .progress [class$=-progress]{z-index:1;position:absolute;top:50%;left:50%;transform:translateX(-50%) translateY(-50%)}.qxs-image-upload__control .is-drag [class$=-upload-dragger] .progress [class$=-progress] [class$=-progress__text]{color:var(--qxs-text-color-placeholder)}.qxs-image-upload__container [class$=-upload__tip-text]{font-size:14px;line-height:32px;color:#c8c8c8}