@qxs-bns/components 0.0.80 → 0.0.82

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 (68) hide show
  1. package/es/package.json.mjs +1 -1
  2. package/es/src/subject-action/src/subject-action.vue.mjs +1 -1
  3. package/es/src/subject-action/src/subject-action.vue.mjs.map +1 -1
  4. package/es/src/subject-list/src/components/SubjectPageEnd.vue.mjs +1 -1
  5. package/es/src/subject-list/src/components/SubjectPageEnd.vue.mjs.map +1 -1
  6. package/es/src/subject-list/src/components/subject-blank-fill.vue.mjs +1 -1
  7. package/es/src/subject-list/src/components/subject-blank-fill.vue.mjs.map +1 -1
  8. package/es/src/subject-list/src/components/subject-scale.vue.mjs +1 -1
  9. package/es/src/subject-list/src/components/subject-scale.vue.mjs.map +1 -1
  10. package/es/src/subject-list/src/components/subject-single.vue.mjs +1 -1
  11. package/es/src/subject-list/src/components/subject-single.vue.mjs.map +1 -1
  12. package/es/src/subject-list/src/components/subject-text-fill.vue.mjs +1 -1
  13. package/es/src/subject-list/src/components/subject-text-fill.vue.mjs.map +1 -1
  14. package/es/src/subject-list/src/subject-list.vue.mjs +1 -1
  15. package/es/src/subject-list/src/subject-list.vue.mjs.map +1 -1
  16. package/lib/package.json.cjs +1 -1
  17. package/lib/src/subject-action/src/subject-action.vue.cjs +1 -1
  18. package/lib/src/subject-action/src/subject-action.vue.cjs.map +1 -1
  19. package/lib/src/subject-list/src/components/SubjectPageEnd.vue.cjs +1 -1
  20. package/lib/src/subject-list/src/components/SubjectPageEnd.vue.cjs.map +1 -1
  21. package/lib/src/subject-list/src/components/subject-blank-fill.vue.cjs +1 -1
  22. package/lib/src/subject-list/src/components/subject-blank-fill.vue.cjs.map +1 -1
  23. package/lib/src/subject-list/src/components/subject-scale.vue.cjs +1 -1
  24. package/lib/src/subject-list/src/components/subject-scale.vue.cjs.map +1 -1
  25. package/lib/src/subject-list/src/components/subject-single.vue.cjs +1 -1
  26. package/lib/src/subject-list/src/components/subject-single.vue.cjs.map +1 -1
  27. package/lib/src/subject-list/src/components/subject-text-fill.vue.cjs +1 -1
  28. package/lib/src/subject-list/src/components/subject-text-fill.vue.cjs.map +1 -1
  29. package/lib/src/subject-list/src/subject-list.vue.cjs +1 -1
  30. package/lib/src/subject-list/src/subject-list.vue.cjs.map +1 -1
  31. package/package.json +4 -3
  32. package/theme-chalk/index.css +1 -1
  33. package/theme-chalk/src/image-upload.css +1 -1
  34. package/theme-chalk/src/image-upload.scss +2 -1
  35. package/theme-chalk/src/normalize.css +1 -1
  36. package/theme-chalk/src/normalize.scss +4 -132
  37. package/types/src/data-chart/src/components/area.vue.d.ts.map +1 -1
  38. package/types/src/data-chart/src/components/bar.vue.d.ts.map +1 -1
  39. package/types/src/data-chart/src/components/card.vue.d.ts.map +1 -1
  40. package/types/src/data-chart/src/components/empty.vue.d.ts.map +1 -1
  41. package/types/src/data-chart/src/components/funnel.vue.d.ts.map +1 -1
  42. package/types/src/data-chart/src/components/line.vue.d.ts.map +1 -1
  43. package/types/src/data-chart/src/components/pie.vue.d.ts.map +1 -1
  44. package/types/src/data-chart/src/components/radar.vue.d.ts.map +1 -1
  45. package/types/src/data-chart/src/components/scatter-simple.vue.d.ts.map +1 -1
  46. package/types/src/data-chart/src/components/scatter.vue.d.ts.map +1 -1
  47. package/types/src/data-chart/src/components/table.vue.d.ts.map +1 -1
  48. package/types/src/data-chart/src/data-chart.vue.d.ts.map +1 -1
  49. package/types/src/file-upload/src/file-upload.vue.d.ts.map +1 -1
  50. package/types/src/fixed-action-bar/src/fixed-action-bar.vue.d.ts.map +1 -1
  51. package/types/src/icon/src/icon.vue.d.ts.map +1 -1
  52. package/types/src/image-upload/src/image-upload.vue.d.ts +3 -3
  53. package/types/src/image-upload/src/image-upload.vue.d.ts.map +1 -1
  54. package/types/src/photo-crop-tool/src/photo-crop-tool.vue.d.ts.map +1 -1
  55. package/types/src/subject-action/src/subject-action.vue.d.ts.map +1 -1
  56. package/types/src/subject-layout/src/subject-layout.vue.d.ts.map +1 -1
  57. package/types/src/subject-list/src/components/SubjectPageEnd.vue.d.ts.map +1 -1
  58. package/types/src/subject-list/src/components/SubjectRichText.vue.d.ts.map +1 -1
  59. package/types/src/subject-list/src/components/subject-blank-fill.vue.d.ts.map +1 -1
  60. package/types/src/subject-list/src/components/subject-scale.vue.d.ts.map +1 -1
  61. package/types/src/subject-list/src/components/subject-single.vue.d.ts +1 -1
  62. package/types/src/subject-list/src/components/subject-single.vue.d.ts.map +1 -1
  63. package/types/src/subject-list/src/components/subject-text-fill.vue.d.ts.map +1 -1
  64. package/types/src/subject-list/src/subject-list.vue.d.ts.map +1 -1
  65. package/types/src/subject-type/src/subject-type.vue.d.ts.map +1 -1
  66. package/types/src/tiny-mce-editor/index.d.ts.map +1 -1
  67. package/types/src/tiny-mce-editor/src/tiny-mce-editor.vue.d.ts.map +1 -1
  68. 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 { setGuid } from '@qxs-bns/utils'\nimport { ElMessage } from 'element-plus'\nimport { computed, onMounted, ref, useAttrs, watch } from 'vue'\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","_createElementBlock","class","_normalizeClass","_unref","e","_createVNode","SubjectLayout","_createSlots","preview","_createElementVNode","_hoisted_1","_hoisted_2","_toDisplayString","_openBlock","includes","_hoisted_4","_hoisted_5","innerHTML","_hoisted_7","_Fragment","_renderList","_createBlock","_component_el_checkbox","disabled","_hoisted_8","_component_el_radio","_hoisted_9","showAction","SubjectAction","isSet","onMoveUp","onMoveDown","onDelete","onSave","onEdit","onAdd","onOnShowRichText","onSetKey","onSetAnswerSetting","_hoisted_10","_component_el_input","$event","rows","placeholder","maxlength","_hoisted_11","_component_el_select","style","width","_component_el_option","_hoisted_12","_hoisted_13","modelValue","onChange","event","it","setCorrect","_cache","_component_el_icon","CirclePlus","onClick","Remove","splice","deleteAnswer","_component_el_link","onOpenResult","examAnswerId","customId","setRelation","_hoisted_14","_hoisted_15","multiple","showAnalysis","_hoisted_16","_hoisted_17","_hoisted_18","_hoisted_19","TinyMceEditor","_mergeProps","_hoisted_20","_component_el_dialog","footer","_component_el_button","plain"],"mappings":"8sDAaA,MAAMA,EAAQC,EAoBRC,EAAQC,EAERC,EAAQC,EAAAA,WAERC,EAAeC,EAAAA,IAAI,GACnBC,EAAQD,EAAAA,IAAIP,EAAMQ,OAClBC,EAAkBF,EAAAA,IAAI,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,EAAAA,IAAI,GACvBK,EAAQL,EAAAA,IAAI,IACZQ,EAAWR,EAAAA,IAAI,IACfS,EAAeT,EAAAA,KAAI,GACnBU,EAAWV,EAAAA,IAAI,IACfW,EAAYX,EAAAA,IAAI,GAChBY,EAAkBZ,EAAAA,KAAI,GACtBa,EAAab,EAAAA,IAAY,IACzBc,EAAmBC,EAAAA,SAAS,IACb,WAAftB,EAAMuB,KACD,MAEe,aAAfvB,EAAMuB,KACN,MAGA,OAILC,EAAYjB,EAAAA,IAAc,IAE1BkB,EAAqBH,EAAAA,SAAS,KAClC,MAAMI,EAAQ,GAEd,IAAA,IAASC,EADMhB,EAAQiB,MAAMC,OACJF,EAAQ,EAAGA,IAClCD,EAAMI,KAAK,CACTC,MAAO,OAAOJ,KACdC,MAAOD,IAGX,OAAOD,EAAMM,YAEf,SAASC,IACHjC,EAAMkC,QAGVvB,EAAQiB,MAAME,KAAK,CACjBlB,MAAO,GACPC,WAAW,EACXsB,eAAgBC,EAAAA,WAEpB,CA+BA,SAASC,IACPrB,EAAaY,OAAQ,EACrBX,EAASW,MAAQ,EACnB,CAEA,SAASU,IACP,IAAK1B,EAAMgB,MAET,YADAW,EAAAA,UAAUC,MAAM,aAIlB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F,EAAA,MAAAA,EAAA,IAAA,mBAFC,QAED,wCAtBF,IAKE,EALF5C,EAAAA,YAAAQ,EAAAA,YAKEwD,EAAAA,QALFC,aAKE,CAJCrG,IAAK3D,EAAAsB,MACE,cAAaR,EAAAQ,6CAAAR,EAAUQ,MAAAqG,IACvBtC,EAAAA,MAAAvF,GAAK,CACbmI,MAAA,CAAAC,MAAA,UAAoB,KAAA,GAAA,CAAA"}
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 { ElButton, ElCheckbox, ElDialog, ElIcon, ElInput, ElLink, ElMessage, ElOption, ElRadio, ElSelect } from 'element-plus'\nimport { nanoid } from 'nanoid'\nimport { computed, onMounted, ref, useAttrs, watch } from 'vue'\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?: string\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: nanoid(),\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 || nanoid()\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 <ElCheckbox\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 </ElCheckbox>\n </template>\n <template v-else>\n <ElRadio\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 </ElRadio>\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 <ElInput\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 <ElSelect\n v-if=\"['multiple', 'sort'].includes(type)\"\n v-model=\"leastAnswerCount\"\n style=\"width: 150px;\"\n placeholder=\"至少选择几项\"\n :disabled=\"isSave\"\n >\n <ElOption\n v-for=\"item in leastAnswerOptions\"\n :key=\"item.value\"\n :value=\"item.value\"\n :label=\"item.label\"\n />\n </ElSelect>\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 <ElInput\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 <ElCheckbox\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 </ElCheckbox>\n <ElIcon class=\"icon\">\n <CirclePlus\n :class=\"[{ disabled: isSave }]\"\n @click=\"addAnswer\"\n />\n </ElIcon>\n <ElIcon class=\"icon\">\n <Remove\n :class=\"[{ disabled: answers.length < 3 || isSave }]\"\n @click=\"deleteAnswer(index)\"\n />\n </ElIcon>\n <ElLink\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 </ElLink>\n <ElLink\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 </ElLink>\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 <ElSelect\n v-model=\"orderList\"\n multiple\n style=\"width: 360px;\"\n placeholder=\"请按顺序选择排序答案\"\n :show-arrow=\"true\"\n >\n <ElOption\n v-for=\"(item, index) in answers\"\n :key=\"index\"\n :label=\"item.title\"\n :value=\"String.fromCharCode(65 + index)\"\n />\n </ElSelect>\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 <ElInput\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 <ElLink\n type=\"danger\"\n @click=\"deleteRichText\"\n >\n 删除富文本\n </ElLink>\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 <ElDialog\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 <ElButton\n class=\"customize-button\"\n type=\"primary\"\n plain\n @click=\"onCloseResult\"\n >\n 取消\n </ElButton>\n <ElButton\n class=\"customize-button\"\n type=\"primary\"\n plain\n @click=\"onSaveResult\"\n >\n 保存\n </ElButton>\n </template>\n </ElDialog>\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","nanoid","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","_createElementBlock","class","_normalizeClass","_unref","e","_createVNode","SubjectLayout","_createSlots","preview","_createElementVNode","_hoisted_1","_hoisted_2","_toDisplayString","_openBlock","includes","_hoisted_4","_hoisted_5","innerHTML","_hoisted_7","_Fragment","_renderList","_createBlock","ElCheckbox","disabled","_hoisted_8","ElRadio","_hoisted_9","showAction","SubjectAction","isSet","onMoveUp","onMoveDown","onDelete","onSave","onEdit","onAdd","onOnShowRichText","onSetKey","onSetAnswerSetting","_hoisted_10","ElInput","$event","rows","placeholder","maxlength","_hoisted_11","ElSelect","style","width","ElOption","_hoisted_12","_hoisted_13","modelValue","onChange","event","it","setCorrect","_cache","ElIcon","CirclePlus","onClick","Remove","splice","deleteAnswer","ElLink","onOpenResult","examAnswerId","customId","setRelation","_hoisted_14","_hoisted_15","multiple","showAnalysis","_hoisted_16","_hoisted_17","_hoisted_18","_hoisted_19","TinyMceEditor","_mergeProps","_hoisted_20","ElDialog","footer","ElButton","plain"],"mappings":"ssDAaA,MAAMA,EAAQC,EAoBRC,EAAQC,EAERC,EAAQC,EAAAA,WAERC,EAAeC,EAAAA,IAAI,GACnBC,EAAQD,EAAAA,IAAIP,EAAMQ,OAClBC,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AAAA,UAAA,CANTjF,MAAM,mBACNlE,KAAK,UACLoJ,MAAA,GACCvB,QAAOtF,sBACT,IAEDmF,EAAA,MAAAA,EAAA,IAAA,mBAFC,QAED,wCAtBF,IAKE,EALF5C,EAAAA,YAAAQ,EAAAA,YAKEwD,EAAAA,QALFC,aAKE,CAJCrG,IAAK3D,EAAAsB,MACE,cAAaR,EAAAQ,6CAAAR,EAAUQ,MAAAqG,IACvBtC,EAAAA,MAAAvF,GAAK,CACbmI,MAAA,CAAAC,MAAA,UAAoB,KAAA,GAAA,CAAA"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue"),t=require("@element-plus/icons-vue"),l=require("@qxs-bns/hooks"),a=require("element-plus"),n=require("../../../subject-action/src/subject-action.vue.cjs"),o=require("../../../subject-layout/src/subject-layout.vue.cjs"),r=require("../../../tiny-mce-editor/src/tiny-mce-editor.vue.cjs");const s={class:"preview"},i={class:"content"},d={class:"title"},c={key:0},u=["innerHTML"],m={class:"content flex flex-col"},v={key:1,class:"flex",style:{"margin-top":"10px",color:"#a8abb2"}},p={class:"title"},x={class:"flex"},f={style:{flex:"1"},class:"margin-bottom"},V={class:"margin-bottom flex flex-items-center"},y={class:"flex"},g={style:{flex:"1"}},N={class:"margin-bottom answer-list"},w={class:"label flex flex-justify-end"},k={class:"answer-tags"},E={class:"operation"},C={key:0,class:"margin-bottom flex"},h={style:{flex:"1"}},B={key:1,class:"margin-bottom flex"},b={style:{flex:"1"}},S={class:"flex flex-justify-end"};var j=e.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(j,{emit:q}){const I=j,O=q,A=e.useAttrs(),_=e.ref([{title:"",tag:"",showInput:!1}]),T=e.ref(""),M=e.ref(""),D=e.ref(),L=e.ref(""),U=e.ref(!1),R=e.ref(""),F=[{label:"答案不分顺序",value:"isInOrder"},{label:"忽略大小写",value:"isIgnoreCase"}],z=e.ref(["isInOrder","isIgnoreCase"]);function P(){_.value.push({title:"",tag:"",showInput:!1})}function H(){U.value=!1,R.value=""}function $(){if(T.value){if(D.value||L.value){if(!D.value)return void a.ElMessage.error("请完善答题设置!");if(!L.value)return void a.ElMessage.error("请输入问题正确答案!");if(_.value.length!==D.value)return void a.ElMessage.error("关键词个数设置有误!");const e=[];if(_.value.forEach((t,l)=>{t.title||e.push(`关键词${l+1}未设置`)}),e.length>0)return void a.ElMessage.error(e.join(","))}O("save",{title:T.value,answers:_.value.filter(e=>e.title).map(e=>({title:e.title})),analysis:M.value,isSetCorrectAnswer:!!L.value,examExpand:L.value,examAnswerSettingBO:{isIgnoreCase:z.value?.includes("isIgnoreCase"),isInOrder:z.value?.includes("isInOrder"),keywordCount:D.value},examRichTextContent:U.value?R.value:""})}else a.ElMessage.error("题目标题不能为空!")}e.onMounted(function(){I.title&&(T.value=I.title),I.answerList&&I.answerList.length&&(_.value=I.answerList),I.examAnswerSettingVO&&(z.value=z.value.filter(e=>"isIgnoreCase"===e&&I.examAnswerSettingVO?.isIgnoreCase||"isInOrder"===e&&I.examAnswerSettingVO?.isInOrder)),I.examAnswerSettingVO?.keywordCount&&(D.value=I.examAnswerSettingVO?.keywordCount),I.examExpand&&(L.value=I.examExpand),I.analysis&&(M.value=I.analysis),I.examRichTextContent&&(R.value=I.examRichTextContent,U.value=!0)});const G=l.useNamespace("subject-text-fill");return(l,a)=>{const j=e.resolveComponent("el-checkbox"),q=e.resolveComponent("el-input"),J=e.resolveComponent("el-input-number"),K=e.resolveComponent("el-checkbox-group"),Q=e.resolveComponent("el-tag"),W=e.resolveComponent("el-icon"),X=e.resolveComponent("el-button"),Y=e.resolveComponent("el-link");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(G).e("text-fill-exam"))},[e.createVNode(o.default,{"show-edit":l.isEdit},{preview:e.withCtx(()=>[e.createElementVNode("div",s,[e.createElementVNode("div",i,[e.createElementVNode("span",d,e.toDisplayString(l.orderIndex+1)+"."+e.toDisplayString(T.value)+"(问答题)",1),U.value?(e.openBlock(),e.createElementBlock("div",c,[e.createElementVNode("div",{class:"rich-text",innerHTML:R.value},null,8,u)])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",m,[_.value.some(e=>e.title)?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(_.value,(t,l)=>(e.openBlock(),e.createBlock(j,{key:l,class:"radio",disabled:!0},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:2},1024))),128)):e.createCommentVNode("v-if",!0)]),L.value?(e.openBlock(),e.createElementBlock("div",v,[e.createElementVNode("span",p,"正确答案:"+e.toDisplayString(L.value),1)])):e.createCommentVNode("v-if",!0)])])]),edit:e.withCtx(()=>[e.createElementVNode("div",x,[a[12]||(a[12]=e.createElementVNode("div",{class:"label flex flex-justify-end"},[e.createElementVNode("span",null,"题目:")],-1)),e.createElementVNode("div",f,[e.createVNode(q,{modelValue:T.value,"onUpdate:modelValue":a[0]||(a[0]=e=>T.value=e),type:"textarea",rows:2,placeholder:"【问答题】请输入问题",maxlength:200,"show-word-limit":"",disabled:l.isSave},null,8,["modelValue","disabled"])])]),e.createElementVNode("div",V,[a[13]||(a[13]=e.createElementVNode("div",{class:"label flex flex-justify-end"},[e.createElementVNode("span",null,"答题设置:")],-1)),a[14]||(a[14]=e.createElementVNode("span",null,"共答对",-1)),e.createVNode(J,{modelValue:D.value,"onUpdate:modelValue":a[1]||(a[1]=e=>D.value=e),style:{width:"100px",margin:"0 10px"},min:1},null,8,["modelValue"]),a[15]||(a[15]=e.createElementVNode("span",{style:{"margin-right":"10px"}},"个关键词,算是正确的",-1)),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(F,t=>e.createVNode(K,{key:t.value,modelValue:z.value,"onUpdate:modelValue":a[2]||(a[2]=e=>z.value=e)},{default:e.withCtx(()=>[e.createVNode(j,{label:t.value,class:"margin-left-10"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:2},1032,["label"])]),_:2},1032,["modelValue"])),64))]),e.createElementVNode("div",y,[a[16]||(a[16]=e.createElementVNode("div",{class:"label flex flex-justify-end"},[e.createElementVNode("span",null,"答案:")],-1)),e.createElementVNode("div",g,[e.createVNode(q,{modelValue:L.value,"onUpdate:modelValue":a[3]||(a[3]=e=>L.value=e),type:"textarea",rows:2,placeholder:"请输入正确答案",maxlength:200,"show-word-limit":"",disabled:l.isSave},null,8,["modelValue","disabled"])])]),e.createElementVNode("div",N,[a[17]||(a[17]=e.createElementVNode("span",{style:{"padding-left":"60px"}},"*如遇包含特殊字符的关键词,需添加多个同义词,例:'CO₂'需添加同义词'CO2'",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(a,n)=>(e.openBlock(),e.createElementBlock("div",{key:n,class:"answer-item flex flex-items-center"},[e.createElementVNode("div",w,[e.createElementVNode("span",null,"关键词"+e.toDisplayString(n+1)+":",1)]),e.createElementVNode("div",k,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.title.split(","),t=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:t},[t?(e.openBlock(),e.createBlock(Q,{key:0,closable:"",onClose:e=>function(e,t){if(e){const l=t.title.split(","),a=l.findIndex(t=>t===e);a>-1&&(l.splice(a,1),t.title=l.join(","))}}(t,a)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t),1)]),_:2},1032,["onClose"])):e.createCommentVNode("v-if",!0)],64))),128)),l.isSave?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[a.showInput?(e.openBlock(),e.createBlock(q,{key:0,modelValue:a.tag,"onUpdate:modelValue":e=>a.tag=e,style:{width:"80px"},onBlur:()=>function(e){e.showInput=!1,e.tag&&(e.title=e.title?[e.title,e.tag].join(","):e.tag,e.tag="")}(a)},null,8,["modelValue","onUpdate:modelValue","onBlur"])):(e.openBlock(),e.createBlock(X,{key:1,size:"small",onClick:e=>a.showInput=!0},{default:e.withCtx(()=>[e.createVNode(W,null,{default:e.withCtx(()=>[e.createVNode(e.unref(t.Plus))]),_:1}),e.createElementVNode("span",null,e.toDisplayString(a.title?"添加同义词":"添加关键词"),1)]),_:2},1032,["onClick"]))],64))]),e.createElementVNode("div",E,[e.createVNode(W,{class:"icon"},{default:e.withCtx(()=>[e.createVNode(e.unref(t.CirclePlus),{class:e.normalizeClass([{disabled:l.isSave}]),onClick:P},null,8,["class"])]),_:1}),e.createVNode(W,{class:"icon"},{default:e.withCtx(()=>[e.createVNode(e.unref(t.Remove),{class:e.normalizeClass([{disabled:_.value.length<2||l.isSave}]),onClick:e=>function(e){_.value.length<2||I.isSave||_.value.splice(e,1)}(n)},null,8,["class","onClick"])]),_:2},1024)])]))),128))]),l.showAnalysis?(e.openBlock(),e.createElementBlock("div",C,[a[18]||(a[18]=e.createElementVNode("div",{class:"label flex flex-justify-end"},[e.createElementVNode("span",null,"解析:")],-1)),e.createElementVNode("div",h,[e.createVNode(q,{modelValue:M.value,"onUpdate:modelValue":a[4]||(a[4]=e=>M.value=e),type:"textarea",rows:2,placeholder:"请输入题目解析"},null,8,["modelValue"])])])):e.createCommentVNode("v-if",!0),U.value?(e.openBlock(),e.createElementBlock("div",B,[a[20]||(a[20]=e.createElementVNode("div",{class:"label flex flex-justify-center"},[e.createElementVNode("span",null,"富文本:")],-1)),e.createElementVNode("div",b,[e.createVNode(r.default,e.mergeProps({"model-value":R.value,"onUpdate:modelValue":a[5]||(a[5]=e=>R.value=e)},e.unref(A),{style:{width:"100%"}}),null,16,["model-value"]),e.createElementVNode("div",S,[e.createVNode(Y,{type:"danger",onClick:H},{default:e.withCtx(()=>a[19]||(a[19]=[e.createTextVNode(" 删除富文本 ",-1)])),_:1,__:[19]})])])])):e.createCommentVNode("v-if",!0)]),default:e.withCtx(()=>[l.showAction?(e.openBlock(),e.createBlock(n.default,{key:0,"is-edit":l.isEdit,"is-set":l.isSet,"show-other-option":!1,"exam-answer-relation-type":I.examAnswerRelationType,onMoveUp:a[6]||(a[6]=e=>O("move","up")),onMoveDown:a[7]||(a[7]=e=>O("move","down")),onDelete:a[8]||(a[8]=e=>O("delete")),onSave:$,onEdit:a[9]||(a[9]=e=>O("edit")),onAdd:a[10]||(a[10]=e=>O("add",e)),onOnShowRichText:a[11]||(a[11]=e=>U.value=!0)},null,8,["is-edit","is-set","exam-answer-relation-type"])):e.createCommentVNode("v-if",!0)]),_:1},8,["show-edit"])],2)}}});exports.default=j;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue"),l=require("@element-plus/icons-vue"),t=require("@qxs-bns/hooks"),a=require("element-plus"),n=require("../../../subject-action/src/subject-action.vue.cjs"),o=require("../../../subject-layout/src/subject-layout.vue.cjs"),r=require("../../../tiny-mce-editor/src/tiny-mce-editor.vue.cjs");const i={class:"preview"},s={class:"content"},d={class:"title"},u={key:0},c=["innerHTML"],m={class:"content flex flex-col"},v={key:1,class:"flex",style:{"margin-top":"10px",color:"#a8abb2"}},p={class:"title"},f={class:"flex"},x={style:{flex:"1"},class:"margin-bottom"},V={class:"margin-bottom flex flex-items-center"},y={class:"flex"},E={style:{flex:"1"}},g={class:"margin-bottom answer-list"},N={class:"label flex flex-justify-end"},k={class:"answer-tags"},w={class:"operation"},h={key:0,class:"margin-bottom flex"},C={style:{flex:"1"}},B={key:1,class:"margin-bottom flex"},b={style:{flex:"1"}},S={class:"flex flex-justify-end"};var I=e.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 q=I,O=j,A=e.useAttrs(),_=e.ref([{title:"",tag:"",showInput:!1}]),T=e.ref(""),L=e.ref(""),M=e.ref(),D=e.ref(""),U=e.ref(!1),R=e.ref(""),F=[{label:"答案不分顺序",value:"isInOrder"},{label:"忽略大小写",value:"isIgnoreCase"}],z=e.ref(["isInOrder","isIgnoreCase"]);function P(){_.value.push({title:"",tag:"",showInput:!1})}function H(){U.value=!1,R.value=""}function G(){if(T.value){if(M.value||D.value){if(!M.value)return void a.ElMessage.error("请完善答题设置!");if(!D.value)return void a.ElMessage.error("请输入问题正确答案!");if(_.value.length!==M.value)return void a.ElMessage.error("关键词个数设置有误!");const e=[];if(_.value.forEach((l,t)=>{l.title||e.push(`关键词${t+1}未设置`)}),e.length>0)return void a.ElMessage.error(e.join(","))}O("save",{title:T.value,answers:_.value.filter(e=>e.title).map(e=>({title:e.title})),analysis:L.value,isSetCorrectAnswer:!!D.value,examExpand:D.value,examAnswerSettingBO:{isIgnoreCase:z.value?.includes("isIgnoreCase"),isInOrder:z.value?.includes("isInOrder"),keywordCount:M.value},examRichTextContent:U.value?R.value:""})}else a.ElMessage.error("题目标题不能为空!")}e.onMounted(function(){q.title&&(T.value=q.title),q.answerList&&q.answerList.length&&(_.value=q.answerList),q.examAnswerSettingVO&&(z.value=z.value.filter(e=>"isIgnoreCase"===e&&q.examAnswerSettingVO?.isIgnoreCase||"isInOrder"===e&&q.examAnswerSettingVO?.isInOrder)),q.examAnswerSettingVO?.keywordCount&&(M.value=q.examAnswerSettingVO?.keywordCount),q.examExpand&&(D.value=q.examExpand),q.analysis&&(L.value=q.analysis),q.examRichTextContent&&(R.value=q.examRichTextContent,U.value=!0)});const $=t.useNamespace("subject-text-fill");return(t,I)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref($).e("text-fill-exam"))},[e.createVNode(o.default,{"show-edit":t.isEdit},{preview:e.withCtx(()=>[e.createElementVNode("div",i,[e.createElementVNode("div",s,[e.createElementVNode("span",d,e.toDisplayString(t.orderIndex+1)+"."+e.toDisplayString(T.value)+"(问答题)",1),U.value?(e.openBlock(),e.createElementBlock("div",u,[e.createElementVNode("div",{class:"rich-text",innerHTML:R.value},null,8,c)])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",m,[_.value.some(e=>e.title)?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(_.value,(l,t)=>(e.openBlock(),e.createBlock(e.unref(a.ElCheckbox),{key:t,class:"radio",disabled:!0},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.title),1)]),_:2},1024))),128)):e.createCommentVNode("v-if",!0)]),D.value?(e.openBlock(),e.createElementBlock("div",v,[e.createElementVNode("span",p,"正确答案:"+e.toDisplayString(D.value),1)])):e.createCommentVNode("v-if",!0)])])]),edit:e.withCtx(()=>[e.createElementVNode("div",f,[I[12]||(I[12]=e.createElementVNode("div",{class:"label flex flex-justify-end"},[e.createElementVNode("span",null,"题目:")],-1)),e.createElementVNode("div",x,[e.createVNode(e.unref(a.ElInput),{modelValue:T.value,"onUpdate:modelValue":I[0]||(I[0]=e=>T.value=e),type:"textarea",rows:2,placeholder:"【问答题】请输入问题",maxlength:200,"show-word-limit":"",disabled:t.isSave},null,8,["modelValue","disabled"])])]),e.createElementVNode("div",V,[I[13]||(I[13]=e.createElementVNode("div",{class:"label flex flex-justify-end"},[e.createElementVNode("span",null,"答题设置:")],-1)),I[14]||(I[14]=e.createElementVNode("span",null,"共答对",-1)),e.createVNode(e.unref(a.ElInputNumber),{modelValue:M.value,"onUpdate:modelValue":I[1]||(I[1]=e=>M.value=e),style:{width:"100px",margin:"0 10px"},min:1},null,8,["modelValue"]),I[15]||(I[15]=e.createElementVNode("span",{style:{"margin-right":"10px"}},"个关键词,算是正确的",-1)),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(F,l=>e.createVNode(e.unref(a.ElCheckboxGroup),{key:l.value,modelValue:z.value,"onUpdate:modelValue":I[2]||(I[2]=e=>z.value=e)},{default:e.withCtx(()=>[e.createVNode(e.unref(a.ElCheckbox),{label:l.value,class:"margin-left-10"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.label),1)]),_:2},1032,["label"])]),_:2},1032,["modelValue"])),64))]),e.createElementVNode("div",y,[I[16]||(I[16]=e.createElementVNode("div",{class:"label flex flex-justify-end"},[e.createElementVNode("span",null,"答案:")],-1)),e.createElementVNode("div",E,[e.createVNode(e.unref(a.ElInput),{modelValue:D.value,"onUpdate:modelValue":I[3]||(I[3]=e=>D.value=e),type:"textarea",rows:2,placeholder:"请输入正确答案",maxlength:200,"show-word-limit":"",disabled:t.isSave},null,8,["modelValue","disabled"])])]),e.createElementVNode("div",g,[I[17]||(I[17]=e.createElementVNode("span",{style:{"padding-left":"60px"}},"*如遇包含特殊字符的关键词,需添加多个同义词,例:'CO₂'需添加同义词'CO2'",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(n,o)=>(e.openBlock(),e.createElementBlock("div",{key:o,class:"answer-item flex flex-items-center"},[e.createElementVNode("div",N,[e.createElementVNode("span",null,"关键词"+e.toDisplayString(o+1)+":",1)]),e.createElementVNode("div",k,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.title.split(","),l=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:l},[l?(e.openBlock(),e.createBlock(e.unref(a.ElTag),{key:0,closable:"",onClose:e=>function(e,l){if(e){const t=l.title.split(","),a=t.findIndex(l=>l===e);a>-1&&(t.splice(a,1),l.title=t.join(","))}}(l,n)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l),1)]),_:2},1032,["onClose"])):e.createCommentVNode("v-if",!0)],64))),128)),t.isSave?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[n.showInput?(e.openBlock(),e.createBlock(e.unref(a.ElInput),{key:0,modelValue:n.tag,"onUpdate:modelValue":e=>n.tag=e,style:{width:"80px"},onBlur:()=>function(e){e.showInput=!1,e.tag&&(e.title=e.title?[e.title,e.tag].join(","):e.tag,e.tag="")}(n)},null,8,["modelValue","onUpdate:modelValue","onBlur"])):(e.openBlock(),e.createBlock(e.unref(a.ElButton),{key:1,size:"small",onClick:e=>n.showInput=!0},{default:e.withCtx(()=>[e.createVNode(e.unref(a.ElIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(l.Plus))]),_:1}),e.createElementVNode("span",null,e.toDisplayString(n.title?"添加同义词":"添加关键词"),1)]),_:2},1032,["onClick"]))],64))]),e.createElementVNode("div",w,[e.createVNode(e.unref(a.ElIcon),{class:"icon"},{default:e.withCtx(()=>[e.createVNode(e.unref(l.CirclePlus),{class:e.normalizeClass([{disabled:t.isSave}]),onClick:P},null,8,["class"])]),_:1}),e.createVNode(e.unref(a.ElIcon),{class:"icon"},{default:e.withCtx(()=>[e.createVNode(e.unref(l.Remove),{class:e.normalizeClass([{disabled:_.value.length<2||t.isSave}]),onClick:e=>function(e){_.value.length<2||q.isSave||_.value.splice(e,1)}(o)},null,8,["class","onClick"])]),_:2},1024)])]))),128))]),t.showAnalysis?(e.openBlock(),e.createElementBlock("div",h,[I[18]||(I[18]=e.createElementVNode("div",{class:"label flex flex-justify-end"},[e.createElementVNode("span",null,"解析:")],-1)),e.createElementVNode("div",C,[e.createVNode(e.unref(a.ElInput),{modelValue:L.value,"onUpdate:modelValue":I[4]||(I[4]=e=>L.value=e),type:"textarea",rows:2,placeholder:"请输入题目解析"},null,8,["modelValue"])])])):e.createCommentVNode("v-if",!0),U.value?(e.openBlock(),e.createElementBlock("div",B,[I[20]||(I[20]=e.createElementVNode("div",{class:"label flex flex-justify-center"},[e.createElementVNode("span",null,"富文本:")],-1)),e.createElementVNode("div",b,[e.createVNode(r.default,e.mergeProps({"model-value":R.value,"onUpdate:modelValue":I[5]||(I[5]=e=>R.value=e)},e.unref(A),{style:{width:"100%"}}),null,16,["model-value"]),e.createElementVNode("div",S,[e.createVNode(e.unref(a.ElLink),{type:"danger",onClick:H},{default:e.withCtx(()=>I[19]||(I[19]=[e.createTextVNode(" 删除富文本 ",-1)])),_:1,__:[19]})])])])):e.createCommentVNode("v-if",!0)]),default:e.withCtx(()=>[t.showAction?(e.openBlock(),e.createBlock(n.default,{key:0,"is-edit":t.isEdit,"is-set":t.isSet,"show-other-option":!1,"exam-answer-relation-type":q.examAnswerRelationType,onMoveUp:I[6]||(I[6]=e=>O("move","up")),onMoveDown:I[7]||(I[7]=e=>O("move","down")),onDelete:I[8]||(I[8]=e=>O("delete")),onSave:G,onEdit:I[9]||(I[9]=e=>O("edit")),onAdd:I[10]||(I[10]=e=>O("add",e)),onOnShowRichText:I[11]||(I[11]=e=>U.value=!0)},null,8,["is-edit","is-set","exam-answer-relation-type"])):e.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 { onMounted, ref, useAttrs } from 'vue'\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","_createElementBlock","class","_normalizeClass","_unref","e","_createVNode","SubjectLayout","isEdit","preview","_createElementVNode","_hoisted_1","_hoisted_2","_hoisted_3","_toDisplayString","orderIndex","_hoisted_4","innerHTML","_hoisted_6","some","_openBlock","_Fragment","key","_renderList","_createBlock","_component_el_checkbox","disabled","_createTextVNode","_hoisted_7","_hoisted_8","edit","_hoisted_9","_hoisted_10","_component_el_input","$event","type","rows","placeholder","maxlength","isSave","_hoisted_11","_cache","_component_el_input_number","style","width","margin","min","_component_el_checkbox_group","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","split","_component_el_tag","closable","onClose","tags","findIndex","splice","closeTag","modelValue","onBlur","handleAddTag","_component_el_button","size","onClick","_component_el_icon","Plus","_hoisted_17","CirclePlus","Remove","deleteAnswer","showAnalysis","_hoisted_18","_hoisted_19","_hoisted_20","_hoisted_21","TinyMceEditor","_mergeProps","_hoisted_22","_component_el_link","showAction","SubjectAction","isSet","examAnswerRelationType","onMoveUp","onMoveDown","onDelete","onSave","onEdit","onAdd","onOnShowRichText"],"mappings":"slDASA,MAAMA,EAAQC,EAmBRC,EAAQC,EAERC,EAAQC,EAAAA,WAERC,EAAUC,EAAAA,IAIX,CAAC,CACJC,MAAO,GACPC,IAAK,GACLC,WAAW,KAGPF,EAAQD,EAAAA,IAAI,IACZI,EAAWJ,EAAAA,IAAI,IACfK,EAAeL,EAAAA,MACfM,EAAUN,EAAAA,IAAI,IACdO,EAAeP,EAAAA,KAAI,GACnBQ,EAAWR,EA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AAaxF,2DAOvByF,EAAAA,cADRrD,EAAAA,YAAAnB,EAAAA,mBAeM,MAfNyE,EAeM,eAXJhE,EAAAA,mBAEM,MAAA,CAFDR,MAAM,+BAA6B,CACtCQ,qBAAgB,YAAV,aAERA,EAAAA,mBAOM,MAPNiE,EAOM,CANJrE,EAAAA,YAKE2B,EAAA,YAJSpE,EAAAO,2CAAAP,EAAQO,MAAA8D,GACjBC,KAAK,WACJC,KAAM,EACPC,YAAY,uEAKVrE,EAAAI,OADRgD,EAAAA,YAAAnB,EAAAA,mBAsBM,MAtBN2E,EAsBM,eAlBJlE,EAAAA,mBAEM,MAAA,CAFDR,MAAM,kCAAgC,CACzCQ,qBAAiB,YAAX,cAERA,EAAAA,mBAcM,MAdNmE,EAcM,CAbJvE,EAAAA,YAIEwE,EAAAA,QAJFC,aAIE,CAHQ,cAAa9G,EAAAG,2CAAAH,EAAQG,MAAA8D,IACrB9B,EAAAA,MAAA9C,GAAK,CACbqF,MAAA,CAAAC,MAAA,UAAoB,KAAA,GAAA,CAAA,gBAEtBlC,EAAAA,mBAOM,MAPNsE,EAOM,CANJ1E,EAAAA,YAKU2E,EAAA,CAJR9C,KAAK,SACJ+B,QAAO1F,sBACT,IAEDiE,EAAA,MAAAA,EAAA,IAAA,mBAFC,WAED,+EAKR,IAaE,CAZMyC,EAAAA,0BADR1D,EAAAA,YAaE2D,EAAAA,QAAA,OAXC,UAAS3E,EAAAA,OACT,SAAQ4E,EAAAA,MACR,qBAAmB,EACnB,4BAA2BlI,EAAMmI,uBACjCC,wBAASlI,EAAK,OAAA,OACdmI,0BAAWnI,EAAK,OAAA,SAChBoI,wBAAQpI,EAAK,WACbqI,OAAMhH,EACNiH,sBAAMtI,EAAK,SACXuI,MAAGlD,EAAA,MAAAA,EAAA,IAAEN,GAAQ/E,QAAa+E,IAC1ByD,kCAAmB5H,EAAAI,OAAY"}
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 { ElButton, ElCheckbox, ElCheckboxGroup, ElIcon, ElInput, ElInputNumber, ElLink, ElMessage, ElTag } from 'element-plus'\nimport { onMounted, ref, useAttrs } from 'vue'\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 <ElCheckbox\n v-for=\"(item, index) in answers\"\n :key=\"index\"\n class=\"radio\"\n :disabled=\"true\"\n >\n {{ item.title }}\n </ElCheckbox>\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 <ElInput\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 <ElInputNumber\n v-model=\"keywordCount\"\n style=\"width: 100px;margin: 0 10px;\"\n :min=\"1\"\n />\n <span style=\"margin-right: 10px;\">个关键词,算是正确的</span>\n <ElCheckboxGroup\n v-for=\"item in checkList\"\n :key=\"item.value\"\n v-model=\"isCheckList\"\n >\n <ElCheckbox\n :label=\"item.value\"\n class=\"margin-left-10\"\n >\n {{ item.label }}\n </ElCheckbox>\n </ElCheckboxGroup>\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 <ElInput\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 <ElTag\n v-if=\"i\"\n closable\n @close=\"closeTag(i, item)\"\n >\n {{ i }}\n </ElTag>\n </template>\n <template v-if=\"!isSave\">\n <ElInput\n v-if=\"item.showInput\"\n v-model=\"item.tag\"\n style=\"width: 80px;\"\n @blur=\"() => handleAddTag(item)\"\n />\n <ElButton\n v-else\n size=\"small\"\n @click=\"item.showInput = true\"\n >\n <ElIcon><Plus /></ElIcon>\n <span>{{ item.title ? '添加同义词' : '添加关键词' }}</span>\n </ElButton>\n </template>\n </div>\n <div class=\"operation\">\n <ElIcon class=\"icon\">\n <CirclePlus\n :class=\"[{ disabled: isSave }]\"\n @click=\"addAnswer\"\n />\n </ElIcon>\n <ElIcon class=\"icon\">\n <Remove\n :class=\"[{ disabled: answers.length < 2 || isSave }]\"\n @click=\"deleteAnswer(index)\"\n />\n </ElIcon>\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 <ElInput\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 <ElLink\n type=\"danger\"\n @click=\"deleteRichText\"\n >\n 删除富文本\n </ElLink>\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","_createElementBlock","class","_normalizeClass","_unref","e","_createVNode","SubjectLayout","isEdit","preview","_createElementVNode","_hoisted_1","_hoisted_2","_hoisted_3","_toDisplayString","orderIndex","_hoisted_4","innerHTML","_hoisted_6","some","_openBlock","_Fragment","key","_renderList","_createBlock","ElCheckbox","disabled","_createTextVNode","_hoisted_7","_hoisted_8","edit","_hoisted_9","_hoisted_10","ElInput","$event","type","rows","placeholder","maxlength","isSave","_hoisted_11","_cache","ElInputNumber","style","width","margin","min","ElCheckboxGroup","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","split","ElTag","closable","onClose","tags","findIndex","splice","closeTag","modelValue","onBlur","handleAddTag","ElButton","size","onClick","ElIcon","Plus","_hoisted_17","CirclePlus","Remove","deleteAnswer","showAnalysis","_hoisted_18","_hoisted_19","_hoisted_20","_hoisted_21","TinyMceEditor","_mergeProps","_hoisted_22","ElLink","showAction","SubjectAction","isSet","examAnswerRelationType","onMoveUp","onMoveDown","onDelete","onSave","onEdit","onAdd","onOnShowRichText"],"mappings":"slDASA,MAAMA,EAAQC,EAmBRC,EAAQC,EAERC,EAAQC,EAAAA,WAERC,EAAUC,EAAAA,IAIX,CAAC,CACJC,MAAO,GACPC,IAAK,GACLC,WAAW,KAGPF,EAAQD,EAAAA,IAAI,IACZI,EAAWJ,EAAAA,IAAI,IACfK,EAAeL,EAAAA,MACfM,EAAUN,EAAAA,IAAI,IACdO,EAAeP,EAAAA,KAAI,GACnBQ,EAAWR,EAAAA,IAAI,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,GAEf,CASA,SAASY,IACPR,EAAaI,OAAQ,EACrBH,EAASG,MAAQ,EACnB,CAEA,SAASK,IACP,GAAKf,EAAMU,MAAX,CAKA,GAAIN,EAAaM,OAASL,EAAQK,MAAO,CACvC,IAAKN,EAAaM,MAEhB,YADAM,EAAAA,UAAUC,MAAM,YAIlB,IAAKZ,EAAQK,MAEX,YADAM,EAAAA,UAAUC,MAAM,cAIlB,GAAInB,EAAQY,MAAMQ,SAAWd,EAAaM,MAExC,YADAM,EAAAA,UAAUC,MAAM,cAGlB,MAAME,EAAgB,GAMtB,GALArB,EAAQY,MAAMU,QAAQ,CAACC,EAAMC,KACtBD,EAAKrB,OACRmB,EAAIN,KAAK,MAAMS,EAAQ,UAGvBH,EAAID,OAAS,EAEf,YADAF,EAAAA,UAAUC,MAAME,EAAII,KAAK,KAG7B,CAEA7B,EAAM,OAAQ,CACZM,MAAOA,EAAMU,MACbZ,QAASA,EAAQY,MAAMc,OAAQC,GAAWA,E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B9B,EAAAA,MAAA9C,GAAK,CACbqF,MAAA,CAAAC,MAAA,UAAoB,KAAA,GAAA,CAAA,gBAEtBlC,EAAAA,mBAOM,MAPNsE,EAOM,CANJ1E,cAKSF,EAAAA,MAAA6E,EAAAA,QAAA,CAJP9C,KAAK,SACJ+B,QAAO1F,sBACT,IAEDiE,EAAA,MAAAA,EAAA,IAAA,mBAFC,WAED,+EAKR,IAaE,CAZMyC,EAAAA,0BADR1D,EAAAA,YAaE2D,EAAAA,QAAA,OAXC,UAAS3E,EAAAA,OACT,SAAQ4E,EAAAA,MACR,qBAAmB,EACnB,4BAA2BlI,EAAMmI,uBACjCC,wBAASlI,EAAK,OAAA,OACdmI,0BAAWnI,EAAK,OAAA,SAChBoI,wBAAQpI,EAAK,WACbqI,OAAMhH,EACNiH,sBAAMtI,EAAK,SACXuI,MAAGlD,EAAA,MAAAA,EAAA,IAAEN,GAAQ/E,QAAa+E,IAC1ByD,kCAAmB5H,EAAAI,OAAY"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue"),t=require("@qxs-bns/hooks"),n=require("@qxs-bns/utils"),s=require("element-plus"),a=require("./components/subject-blank-fill.vue.cjs"),i=require("./components/subject-scale.vue.cjs"),o=require("./components/subject-single.vue.cjs"),l=require("./components/subject-text-fill.vue.cjs"),r=require("./components/SubjectPageEnd.vue.cjs"),c=require("./components/SubjectRichText.vue.cjs");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 s=[];e.forEach(e=>{const a={...e,customId:n.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&&(s.push({customId:n.setGuid(),answerType:"page_end",analysis:"",scaleQuestionList:[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1,examAnswerRelationType:0}),t=a.pageIndex),s.push(a)}),v.value=v.value.concat(s)},setAnswerRelation:function(e,t,n){const s=v.value.find(e=>e.customId===t);if(s){const t=s.answers?.find(e=>e.customAnswerId===n);t&&(t.answerRelations=e)}}});const f=e.computed(()=>{const e=v.value.filter(e=>"page_end"===e.answerType);return t=>{const n=e.findIndex(e=>e.customId===t);return-1!==n?n+1:0}});function h(){return e=>{let t=0,n=0;return v.value.forEach(s=>{"page_end"!==s.answerType&&(t++,e===s.customId&&(n=t))}),n-1}}function E(e,t=null,s=null){const a={customId:n.setGuid(),answerType:e,analysis:"",scaleQuestionList:[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1,examAnswerRelationType:s};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 S(e){v.value.splice(e,1),s.ElMessage.success("删除成功")}function g(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,n)=>(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(v.value,(n,s)=>(e.openBlock(),e.createElementBlock("div",{key:n.customId,class:"subject-item"},[["single","multiple","sort"].includes(n.answerType)?(e.openBlock(),e.createBlock(o.default,e.mergeProps({key:0,ref_for:!0},e.unref(y),{"order-index":h()(n.customId),title:n.title,type:n.answerType,"exam-id":n.examId,"is-key":n.isKey,"is-save":!n.isRealCanDel,"custom-id":n.customId,"is-set":n.hasSet||!1,"answer-list":n.answers,analysis:n.analysis,"least-answer-count":n.leastAnswerCount,"is-edit":n.isEdit||!1,"show-action":!t.isPreview,"exam-expand":n.examExpand,"answer-check-type":n.answerCheckType,"exam-rich-text-content":n.examRichTextContent,"exam-answer-relation-type":n.examAnswerRelationType,onSetRelation:g,onMove:e=>k(s,e),onDelete:e=>S(s),onSave:e=>T(s,e),onEdit:e=>n.isEdit=!0,onAdd:(e,t)=>E(e,s,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"===n.answerType?(e.openBlock(),e.createBlock(i.default,e.mergeProps({key:1,ref_for:!0},e.unref(y),{"order-index":h()(n.customId),title:n.title,"is-save":!n.isRealCanDel,"is-set":n.hasSet||!1,"answer-list":n.answers,analysis:n.analysis,"is-edit":n.isEdit||!1,"scale-question-list":n.scaleQuestionList,"show-action":!t.isPreview,"exam-rich-text-content":n.examRichTextContent,"exam-answer-relation-type":n.examAnswerRelationType,onMove:e=>k(s,e),onDelete:e=>S(s),onSave:e=>T(s,e),onEdit:e=>n.isEdit=!0,onAdd:e=>E(e,s,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"===n.answerType?(e.openBlock(),e.createBlock(a.default,e.mergeProps({key:2,ref_for:!0},e.unref(y),{"order-index":h()(n.customId),title:n.title,"is-save":!n.isRealCanDel,"is-set":n.hasSet||!1,"answer-list":n.answers,analysis:n.analysis,"show-action":!t.isPreview,"is-edit":n.isEdit||!1,"exam-answer-setting-v-o":n.examAnswerSettingVO||{},"exam-rich-text-content":n.examRichTextContent,"exam-answer-relation-type":n.examAnswerRelationType,onMove:e=>k(s,e),onDelete:e=>S(s),onSave:e=>T(s,e),onEdit:e=>n.isEdit=!0,onAdd:e=>E(e,s,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"===n.answerType?(e.openBlock(),e.createBlock(l.default,e.mergeProps({key:3,ref_for:!0},e.unref(y),{"order-index":h()(n.customId),title:n.title,"is-save":!n.isRealCanDel,"is-set":n.hasSet||!1,"answer-list":n.answers,analysis:n.analysis,"show-action":!t.isPreview,"is-edit":n.isEdit||!1,"exam-expand":n.examExpand,"exam-answer-setting-v-o":n.examAnswerSettingVO||{},"exam-answer-relation-type":n.examAnswerRelationType,"exam-rich-text-content":n.examRichTextContent,onMove:e=>k(s,e),onDelete:e=>S(s),onSave:e=>T(s,e),onEdit:e=>n.isEdit=!0,onAdd:e=>E(e,s,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"===n.answerType?(e.openBlock(),e.createBlock(c.default,e.mergeProps({key:4,ref_for:!0},e.unref(y),{"order-index":h()(n.customId),"rich-text-content":n.richTextContent,"is-set":n.hasSet||!1,"is-save":!n.isRealCanDel,"is-edit":n.isEdit||!1,"show-action":!t.isPreview,"exam-answer-relation-type":n.examAnswerRelationType,onMove:e=>k(s,e),onDelete:e=>S(s),onSave:e=>T(s,e),onEdit:e=>n.isEdit=!0,onAdd:e=>E(e,s,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"===n.answerType?(e.openBlock(),e.createBlock(r.default,{key:s,"total-page":v.value.filter(e=>"page_end"===e.answerType).length,"current-page-index":f.value(n.customId),item:n,"is-edit":n.isEdit||!1,"is-set":n.hasSet||!1,"is-save":!n.isRealCanDel,"exam-answer-relation-type":n.examAnswerRelationType,onMove:e=>k(s,e),onDelete:e=>S(s),onSave:e=>T(s,e),onEdit:e=>n.isEdit=!0,onAdd:e=>E(e,s,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;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue"),t=require("@qxs-bns/hooks"),n=require("element-plus"),s=require("nanoid"),a=require("./components/subject-blank-fill.vue.cjs"),i=require("./components/subject-scale.vue.cjs"),o=require("./components/subject-single.vue.cjs"),l=require("./components/subject-text-fill.vue.cjs"),r=require("./components/SubjectPageEnd.vue.cjs"),c=require("./components/SubjectRichText.vue.cjs");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:p,emit:m}){const x=u,w=m,v=e.ref([]),y=e.useAttrs();p({addSubject:E,currentList:v,uploadExcel:function(e){v.value=v.value.concat(e)},addExam:function(e){let t=1;const n=[];e.forEach(e=>{const a={...e,customId:s.nanoid(),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.nanoid(),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,n){const s=v.value.find(e=>e.customId===t);if(s){const t=s.answers?.find(e=>e.customAnswerId===n);t&&(t.answerRelations=e)}}});const f=e.computed(()=>{const e=v.value.filter(e=>"page_end"===e.answerType);return t=>{const n=e.findIndex(e=>e.customId===t);return-1!==n?n+1:0}});function h(){return e=>{let t=0,n=0;return v.value.forEach(s=>{"page_end"!==s.answerType&&(t++,e===s.customId&&(n=t))}),n-1}}function E(e,t=null,n=null){const a={customId:s.nanoid(),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 S(e){v.value.splice(e,1),n.ElMessage.success("删除成功")}function A(e,t){w("setRelation",e,t)}e.watch(()=>x.subjectList,e=>{e&&(v.value=[...e])},{immediate:!0});const g=t.useNamespace("subject-list");return(t,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(g).e("list-exam"))},[e.createElementVNode("div",d,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(n,s)=>(e.openBlock(),e.createElementBlock("div",{key:n.customId,class:"subject-item"},[["single","multiple","sort"].includes(n.answerType)?(e.openBlock(),e.createBlock(o.default,e.mergeProps({key:0,ref_for:!0},e.unref(y),{"order-index":h()(n.customId),title:n.title,type:n.answerType,"exam-id":n.examId,"is-key":n.isKey,"is-save":!n.isRealCanDel,"custom-id":n.customId,"is-set":n.hasSet||!1,"answer-list":n.answers,analysis:n.analysis,"least-answer-count":n.leastAnswerCount,"is-edit":n.isEdit||!1,"show-action":!t.isPreview,"exam-expand":n.examExpand,"answer-check-type":n.answerCheckType,"exam-rich-text-content":n.examRichTextContent,"exam-answer-relation-type":n.examAnswerRelationType,onSetRelation:A,onMove:e=>k(s,e),onDelete:e=>S(s),onSave:e=>T(s,e),onEdit:e=>n.isEdit=!0,onAdd:(e,t)=>E(e,s,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"===n.answerType?(e.openBlock(),e.createBlock(i.default,e.mergeProps({key:1,ref_for:!0},e.unref(y),{"order-index":h()(n.customId),title:n.title,"is-save":!n.isRealCanDel,"is-set":n.hasSet||!1,"answer-list":n.answers,analysis:n.analysis,"is-edit":n.isEdit||!1,"scale-question-list":n.scaleQuestionList,"show-action":!t.isPreview,"exam-rich-text-content":n.examRichTextContent,"exam-answer-relation-type":n.examAnswerRelationType,onMove:e=>k(s,e),onDelete:e=>S(s),onSave:e=>T(s,e),onEdit:e=>n.isEdit=!0,onAdd:e=>E(e,s,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"===n.answerType?(e.openBlock(),e.createBlock(a.default,e.mergeProps({key:2,ref_for:!0},e.unref(y),{"order-index":h()(n.customId),title:n.title,"is-save":!n.isRealCanDel,"is-set":n.hasSet||!1,"answer-list":n.answers,analysis:n.analysis,"show-action":!t.isPreview,"is-edit":n.isEdit||!1,"exam-answer-setting-v-o":n.examAnswerSettingVO||{},"exam-rich-text-content":n.examRichTextContent,"exam-answer-relation-type":n.examAnswerRelationType,onMove:e=>k(s,e),onDelete:e=>S(s),onSave:e=>T(s,e),onEdit:e=>n.isEdit=!0,onAdd:e=>E(e,s,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"===n.answerType?(e.openBlock(),e.createBlock(l.default,e.mergeProps({key:3,ref_for:!0},e.unref(y),{"order-index":h()(n.customId),title:n.title,"is-save":!n.isRealCanDel,"is-set":n.hasSet||!1,"answer-list":n.answers,analysis:n.analysis,"show-action":!t.isPreview,"is-edit":n.isEdit||!1,"exam-expand":n.examExpand,"exam-answer-setting-v-o":n.examAnswerSettingVO||{},"exam-answer-relation-type":n.examAnswerRelationType,"exam-rich-text-content":n.examRichTextContent,onMove:e=>k(s,e),onDelete:e=>S(s),onSave:e=>T(s,e),onEdit:e=>n.isEdit=!0,onAdd:e=>E(e,s,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"===n.answerType?(e.openBlock(),e.createBlock(c.default,e.mergeProps({key:4,ref_for:!0},e.unref(y),{"order-index":h()(n.customId),"rich-text-content":n.richTextContent,"is-set":n.hasSet||!1,"is-save":!n.isRealCanDel,"is-edit":n.isEdit||!1,"show-action":!t.isPreview,"exam-answer-relation-type":n.examAnswerRelationType,onMove:e=>k(s,e),onDelete:e=>S(s),onSave:e=>T(s,e),onEdit:e=>n.isEdit=!0,onAdd:e=>E(e,s,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"===n.answerType?(e.openBlock(),e.createBlock(r.default,{key:s,"total-page":v.value.filter(e=>"page_end"===e.answerType).length,"current-page-index":f.value(n.customId),item:n,"is-edit":n.isEdit||!1,"is-set":n.hasSet||!1,"is-save":!n.isRealCanDel,"exam-answer-relation-type":n.examAnswerRelationType,onMove:e=>k(s,e),onDelete:e=>S(s),onSave:e=>T(s,e),onEdit:e=>n.isEdit=!0,onAdd:e=>E(e,s,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 { useNamespace } from '@qxs-bns/hooks'\nimport { setGuid } from '@qxs-bns/utils'\nimport { ElMessage } from 'element-plus'\nimport { computed, ref, useAttrs, watch } from 'vue'\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","_createElementBlock","class","_normalizeClass","_unref","e","_createElementVNode","_hoisted_1","_openBlock","_Fragment","_renderList","key","includes","_createBlock","SubjectSingle","_mergeProps","examId","isKey","leastAnswerCount","isPreview","examExpand","answerCheckType","examRichTextContent","onSetRelation","onMove","onDelete","$event","onSave","onEdit","onAdd","SubjectScale","SubjectBlankFill","examAnswerSettingVO","SubjectTextFill","SubjectRichText","SubjectPageEnd"],"mappings":"usBAgBA,MAAMA,EAAQC,EAIRC,EAAQC,EACRC,EAAcC,EAAAA,IAAI,IAClBC,EAAQC,EAAAA,WAEdC,EAAa,CACXC,aACAL,cACAM,YAuGF,SAAqBC,GACnBP,EAAYQ,MAAQR,EAAYQ,MAAMC,OAAOF,EAC/C,EAxGEG,QAuDF,SAAiBC,GACfC,QAAQC,IAAIF,EAAO,SAEnB,IAAIG,EAAe,EACnB,MAAMC,EAAiB,GAEvBJ,EAAMK,QAASC,IAEb,MAAMC,EAAU,IACXD,EACHE,SAAUC,EAAAA,UACVC,WAAYJ,EAAEK,gBAAkB,YAAcL,EAAEM,aAChDC,QAASP,EAAEO,SAASC,IAAKC,IAAA,IACpBA,EACHC,MAAOD,EAAEE,OACTC,SAAUH,EAAEI,aACZC,UAAWL,EAAEK,cACR,GACPC,QAAQ,EACRC,QAAQ,EACRC,cAAc,EACdC,QAAQ,GAINjB,EAAQkB,UAAYtB,IACtBC,EAAQsB,KAAK,CACXlB,SAAUC,EAAAA,UACVC,WAAY,WACZiB,SAAU,GACVC,kBAAmB,GACnBP,QAAQ,EACRC,QAAQ,EACRC,cAAc,EACdC,QAAQ,EACRK,uBAAwB,IAE1B1B,EAAeI,EAAQkB,WAIzBrB,EAAQsB,KAAKnB,KAIflB,EAAYQ,MAAQR,EAAYQ,MAAMC,OAAOM,EAC/C,EApGE0B,kBAsIF,SAA2BC,EAAsBvB,EAAkBwB,GACjE,MAAMC,EAAa5C,EAAYQ,MAAMqC,KAAM5B,GAAWA,EAAEE,WAAaA,GACrE,GAAIyB,EAAY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nC,EAAcP,GACtB2C,OAAOvC,GAAcE,EAAYN,EAAOI,GACxCwC,OAAIF,GAAEtC,EAAK5B,QAAM,EACjBqE,MAAM9C,GAAiBnD,EAAWmD,EAAMC,EAAK,2KAGpB,aAAfI,EAAKxC,0BADlBiE,EAAAA,YAeEsB,EAAAA,QAAA,CAbCxB,IAAK3B,EACL,aAzQFzD,EAAYQ,MAAM0C,OAAQjC,GAA4B,aAAjBA,EAAEI,YAA2ByC,OA0QhE,qBAAoBf,EAAAvC,MAAiBqD,EAAK1C,UAC1C0C,OACA,UAASA,EAAK5B,SAAM,EACpB,SAAQ4B,EAAK1B,SAAM,EACnB,WAAU0B,EAAK3B,aACf,4BAA2B2B,EAAKrB,uBAChCyD,OAAOzC,GAAwBI,EAAKH,EAAOD,GAC3C0C,SAAMC,GAAEnC,EAAcP,GACtB2C,OAAOvC,GAAcE,EAAYN,EAAOI,GACxCwC,OAAIF,GAAEtC,EAAK5B,QAAM,EACjBqE,MAAM9C,GAAiBnD,EAAWmD,EAAMC,EAAK"}
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 { ElMessage } from 'element-plus'\nimport { nanoid } from 'nanoid'\nimport { computed, ref, useAttrs, watch } from 'vue'\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: nanoid(),\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 let currentIndex = 1\n const newList: any[] = []\n\n items.forEach((v: any) => {\n // 创建新的题目对象\n const newItem = {\n ...v,\n customId: nanoid(),\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: nanoid(),\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","currentIndex","newList","forEach","v","newItem","customId","nanoid","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","_createElementBlock","class","_normalizeClass","_unref","e","_createElementVNode","_hoisted_1","_openBlock","_Fragment","_renderList","key","includes","_createBlock","SubjectSingle","_mergeProps","examId","isKey","leastAnswerCount","isPreview","examExpand","answerCheckType","examRichTextContent","onSetRelation","onMove","onDelete","$event","onSave","onEdit","onAdd","SubjectScale","SubjectBlankFill","examAnswerSettingVO","SubjectTextFill","SubjectRichText","SubjectPageEnd"],"mappings":"+rBAgBA,MAAMA,EAAQC,EAIRC,EAAQC,EACRC,EAAcC,EAAAA,IAAI,IAClBC,EAAQC,EAAAA,WAEdC,EAAa,CACXC,aACAL,cACAM,YAqGF,SAAqBC,GACnBP,EAAYQ,MAAQR,EAAYQ,MAAMC,OAAOF,EAC/C,EAtGEG,QAuDF,SAAiBC,GACf,IAAIC,EAAe,EACnB,MAAMC,EAAiB,GAEvBF,EAAMG,QAASC,IAEb,MAAMC,EAAU,IACXD,EACHE,SAAUC,EAAAA,SACVC,WAAYJ,EAAEK,gBAAkB,YAAcL,EAAEM,aAChDC,QAASP,EAAEO,SAASC,IAAKC,IAAA,IACpBA,EACHC,MAAOD,EAAEE,OAC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version": "0.0.80",
4
+ "version": "0.0.82",
5
5
  "description": "Vue 3 Component Library",
6
6
  "license": "MIT",
7
7
  "homepage": "https://qxs-bns.pages.dev/guide/components/overview.html",
@@ -45,11 +45,12 @@
45
45
  "@iconify/vue": "^5.0.0",
46
46
  "@qxs-bns/directives": "0.0.19",
47
47
  "@qxs-bns/hooks": "0.0.7",
48
- "@qxs-bns/icons": "0.0.9",
49
- "@qxs-bns/utils": "0.0.27",
48
+ "@qxs-bns/icons": "0.0.10",
49
+ "@qxs-bns/utils": "0.0.28",
50
50
  "@vueuse/core": "^11.3.0",
51
51
  "echarts": "^5.5.1",
52
52
  "lodash-es": "^4.17.21",
53
+ "nanoid": "^5.1.5",
53
54
  "tinymce": "^7.6.1"
54
55
  },
55
56
  "types": "./types/index.d.ts",