@qxs-bns/components 0.0.45 → 0.0.47
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.
- package/es/_virtual/_plugin-vue_export-helper.mjs +1 -1
- package/es/index.css +83 -0
- package/es/package.json.mjs +1 -1
- package/es/src/data-chart/src/components/area.vue.mjs +1 -1
- package/es/src/data-chart/src/components/area.vue2.mjs +1 -1
- package/es/src/data-chart/src/components/bar.vue.mjs +1 -1
- package/es/src/data-chart/src/components/card.vue.mjs +1 -1
- package/es/src/data-chart/src/components/card.vue2.mjs +1 -1
- package/es/src/data-chart/src/components/card.vue2.mjs.map +1 -1
- package/es/src/data-chart/src/components/empty.vue.mjs +1 -1
- package/es/src/data-chart/src/components/funnel.vue.mjs +1 -1
- package/es/src/data-chart/src/components/line.vue.mjs +1 -1
- package/es/src/data-chart/src/components/line.vue2.mjs +1 -1
- package/es/src/data-chart/src/components/pie.vue.mjs +1 -1
- package/es/src/data-chart/src/components/radar.vue.mjs +1 -1
- package/es/src/data-chart/src/components/scatter-simple.vue.mjs +1 -1
- package/es/src/data-chart/src/components/scatter.vue.mjs +1 -1
- package/es/src/data-chart/src/components/table.vue.mjs +1 -1
- package/es/src/data-chart/src/components/table.vue.mjs.map +1 -1
- package/es/src/data-chart/src/data-chart.vue.mjs +1 -1
- package/es/src/data-chart/src/utils/config.mjs +1 -1
- package/es/src/data-chart/src/utils/useCharts.mjs +1 -1
- package/es/src/file-upload/src/file-upload.vue.mjs +1 -1
- package/es/src/file-upload/src/file-upload.vue.mjs.map +1 -1
- package/es/src/fixed-action-bar/src/fixed-action-bar.vue.mjs +1 -1
- package/es/src/image-upload/src/image-upload.vue.mjs +1 -1
- package/es/src/image-upload/src/image-upload.vue.mjs.map +1 -1
- package/es/src/photo-crop-tool/src/composables.mjs +1 -1
- package/es/src/photo-crop-tool/src/photo-crop-tool.vue.mjs +1 -1
- package/es/src/subject-action/src/subject-action.vue.mjs +1 -1
- package/es/src/subject-action/src/subject-action.vue.mjs.map +1 -1
- package/es/src/subject-layout/src/subject-layout.vue.mjs +1 -1
- package/es/src/subject-list/src/components/SubjectPageEnd.vue.mjs +1 -1
- package/es/src/subject-list/src/components/SubjectPageEnd.vue.mjs.map +1 -1
- package/es/src/subject-list/src/components/SubjectRichText.vue.mjs +1 -1
- package/es/src/subject-list/src/components/subject-blank-fill.vue.mjs +1 -1
- package/es/src/subject-list/src/components/subject-blank-fill.vue.mjs.map +1 -1
- package/es/src/subject-list/src/components/subject-scale.vue.mjs +1 -1
- package/es/src/subject-list/src/components/subject-scale.vue.mjs.map +1 -1
- package/es/src/subject-list/src/components/subject-single.vue.mjs +1 -1
- package/es/src/subject-list/src/components/subject-single.vue.mjs.map +1 -1
- package/es/src/subject-list/src/components/subject-text-fill.vue.mjs +1 -1
- package/es/src/subject-list/src/components/subject-text-fill.vue.mjs.map +1 -1
- package/es/src/subject-list/src/subject-list.vue.mjs +1 -1
- package/es/src/subject-list/src/subject-list.vue.mjs.map +1 -1
- package/es/src/subject-type/src/subject-type.vue.mjs +1 -1
- package/es/src/tiny-mce-editor/index.mjs.map +1 -1
- package/es/src/tiny-mce-editor/src/tiny-mce-editor.vue.mjs +1 -1
- package/es/src/tiny-mce-editor/src/tiny-mce-editor.vue.mjs.map +1 -1
- package/es/src/withInstall.mjs +1 -1
- package/lib/_virtual/_plugin-vue_export-helper.cjs +1 -1
- package/lib/index.cjs +1 -1
- package/lib/index.css +83 -0
- package/lib/package.json.cjs +1 -1
- package/lib/src/components.cjs +1 -1
- package/lib/src/data-chart/index.cjs +1 -1
- package/lib/src/data-chart/src/components/area.vue.cjs +1 -1
- package/lib/src/data-chart/src/components/area.vue2.cjs +1 -1
- package/lib/src/data-chart/src/components/bar.vue.cjs +1 -1
- package/lib/src/data-chart/src/components/card.vue.cjs +1 -1
- package/lib/src/data-chart/src/components/card.vue2.cjs +1 -1
- package/lib/src/data-chart/src/components/card.vue2.cjs.map +1 -1
- package/lib/src/data-chart/src/components/empty.vue.cjs +1 -1
- package/lib/src/data-chart/src/components/funnel.vue.cjs +1 -1
- package/lib/src/data-chart/src/components/line.vue.cjs +1 -1
- package/lib/src/data-chart/src/components/line.vue2.cjs +1 -1
- package/lib/src/data-chart/src/components/pie.vue.cjs +1 -1
- package/lib/src/data-chart/src/components/radar.vue.cjs +1 -1
- package/lib/src/data-chart/src/components/scatter-simple.vue.cjs +1 -1
- package/lib/src/data-chart/src/components/scatter.vue.cjs +1 -1
- package/lib/src/data-chart/src/components/table.vue.cjs +1 -1
- package/lib/src/data-chart/src/components/table.vue.cjs.map +1 -1
- package/lib/src/data-chart/src/data-chart.vue.cjs +1 -1
- package/lib/src/data-chart/src/utils/useCharts.cjs +1 -1
- package/lib/src/file-upload/index.cjs +1 -1
- package/lib/src/file-upload/src/file-upload.vue.cjs +1 -1
- package/lib/src/file-upload/src/file-upload.vue.cjs.map +1 -1
- package/lib/src/fixed-action-bar/index.cjs +1 -1
- package/lib/src/fixed-action-bar/src/fixed-action-bar.vue.cjs +1 -1
- package/lib/src/image-upload/index.cjs +1 -1
- package/lib/src/image-upload/src/image-upload.vue.cjs +1 -1
- package/lib/src/image-upload/src/image-upload.vue.cjs.map +1 -1
- package/lib/src/make-installer.cjs +1 -1
- package/lib/src/photo-crop-tool/index.cjs +1 -1
- package/lib/src/photo-crop-tool/src/composables.cjs +1 -1
- package/lib/src/photo-crop-tool/src/photo-crop-tool.vue.cjs +1 -1
- package/lib/src/subject-action/index.cjs +1 -1
- package/lib/src/subject-action/src/subject-action.vue.cjs +1 -1
- package/lib/src/subject-action/src/subject-action.vue.cjs.map +1 -1
- package/lib/src/subject-layout/index.cjs +1 -1
- package/lib/src/subject-layout/src/subject-layout.vue.cjs +1 -1
- package/lib/src/subject-list/index.cjs +1 -1
- package/lib/src/subject-list/src/components/SubjectPageEnd.vue.cjs +1 -1
- package/lib/src/subject-list/src/components/SubjectPageEnd.vue.cjs.map +1 -1
- package/lib/src/subject-list/src/components/SubjectRichText.vue.cjs +1 -1
- package/lib/src/subject-list/src/components/subject-blank-fill.vue.cjs +1 -1
- package/lib/src/subject-list/src/components/subject-blank-fill.vue.cjs.map +1 -1
- package/lib/src/subject-list/src/components/subject-scale.vue.cjs +1 -1
- package/lib/src/subject-list/src/components/subject-scale.vue.cjs.map +1 -1
- package/lib/src/subject-list/src/components/subject-single.vue.cjs +1 -1
- package/lib/src/subject-list/src/components/subject-single.vue.cjs.map +1 -1
- package/lib/src/subject-list/src/components/subject-text-fill.vue.cjs +1 -1
- package/lib/src/subject-list/src/components/subject-text-fill.vue.cjs.map +1 -1
- package/lib/src/subject-list/src/subject-list.vue.cjs +1 -1
- package/lib/src/subject-list/src/subject-list.vue.cjs.map +1 -1
- package/lib/src/subject-type/index.cjs +1 -1
- package/lib/src/subject-type/src/subject-type.vue.cjs +1 -1
- package/lib/src/tiny-mce-editor/index.cjs +1 -1
- package/lib/src/tiny-mce-editor/index.cjs.map +1 -1
- package/lib/src/tiny-mce-editor/src/tiny-mce-editor.vue.cjs +1 -1
- package/lib/src/tiny-mce-editor/src/tiny-mce-editor.vue.cjs.map +1 -1
- package/lib/src/withInstall.cjs +1 -1
- package/package.json +4 -6
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/index.scss +13 -0
- package/theme-chalk/src/base.css +1 -0
- package/theme-chalk/src/base.scss +16 -0
- package/theme-chalk/src/common/element-plus.css +1 -0
- package/theme-chalk/src/common/element-plus.scss +606 -0
- package/theme-chalk/src/data-chart/empty.css +1 -0
- package/theme-chalk/src/data-chart/empty.scss +24 -0
- package/theme-chalk/src/data-chart/index.css +1 -0
- package/theme-chalk/src/data-chart/index.scss +9 -0
- package/theme-chalk/src/data-chart/table.css +1 -0
- package/theme-chalk/src/data-chart/table.scss +39 -0
- package/theme-chalk/src/file-upload.css +1 -0
- package/theme-chalk/src/file-upload.scss +34 -0
- package/theme-chalk/src/fixed-action-bar.css +1 -0
- package/theme-chalk/src/fixed-action-bar.scss +18 -0
- package/theme-chalk/src/image-upload.css +1 -0
- package/theme-chalk/src/image-upload.scss +135 -0
- package/theme-chalk/src/mixins/_var.css +0 -0
- package/theme-chalk/src/mixins/_var.scss +24 -0
- package/theme-chalk/src/mixins/config.css +0 -0
- package/theme-chalk/src/mixins/config.scss +14 -0
- package/theme-chalk/src/mixins/function.css +0 -0
- package/theme-chalk/src/mixins/function.scss +95 -0
- package/theme-chalk/src/mixins/mixins.css +0 -0
- package/theme-chalk/src/mixins/mixins.scss +103 -0
- package/theme-chalk/src/photo-crop-tool.css +1 -0
- package/theme-chalk/src/photo-crop-tool.scss +84 -0
- package/theme-chalk/src/subject-action.css +1 -0
- package/theme-chalk/src/subject-action.scss +36 -0
- package/theme-chalk/src/subject-layout.css +1 -0
- package/theme-chalk/src/subject-layout.scss +28 -0
- package/theme-chalk/src/subject-list.css +1 -0
- package/theme-chalk/src/subject-list.scss +289 -0
- package/theme-chalk/src/subject-template.scss +5 -0
- package/theme-chalk/src/subject-type.css +1 -0
- package/theme-chalk/src/subject-type.scss +32 -0
- package/theme-chalk/src/tiny-mce-editor.css +1 -0
- package/theme-chalk/src/tiny-mce-editor.scss +27 -0
- package/types/src/file-upload/src/file-upload.vue.d.ts.map +1 -1
- package/types/src/image-upload/index.d.ts +3 -40
- package/types/src/image-upload/index.d.ts.map +1 -1
- package/types/src/image-upload/src/image-upload.vue.d.ts +11 -20
- package/types/src/image-upload/src/image-upload.vue.d.ts.map +1 -1
- package/types/src/subject-action/src/subject-action.vue.d.ts.map +1 -1
- package/types/src/subject-layout/src/subject-layout.vue.d.ts.map +1 -1
- package/types/src/subject-list/src/components/subject-blank-fill.vue.d.ts.map +1 -1
- package/types/src/subject-list/src/components/subject-scale.vue.d.ts.map +1 -1
- package/types/src/subject-list/src/components/subject-single.vue.d.ts.map +1 -1
- package/types/src/subject-list/src/components/subject-text-fill.vue.d.ts.map +1 -1
- package/types/src/tiny-mce-editor/index.d.ts +1 -1
- package/types/src/tiny-mce-editor/index.d.ts.map +1 -1
- package/types/src/tiny-mce-editor/src/tiny-mce-editor.vue.d.ts +19 -19
- package/types/src/tiny-mce-editor/src/tiny-mce-editor.vue.d.ts.map +1 -1
- package/types/tsconfig.tsbuildinfo +1 -1
- package/es/node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.mjs +0 -2
- package/es/node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.mjs.map +0 -1
- package/es/src/data-chart/src/components/area.vue3.mjs +0 -2
- package/es/src/data-chart/src/components/area.vue3.mjs.map +0 -1
- package/es/src/data-chart/src/components/card.vue3.mjs +0 -2
- package/es/src/data-chart/src/components/card.vue3.mjs.map +0 -1
- package/es/src/data-chart/src/components/line.vue3.mjs +0 -2
- package/es/src/data-chart/src/components/line.vue3.mjs.map +0 -1
- package/lib/node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.cjs +0 -2
- package/lib/node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.cjs.map +0 -1
- package/lib/src/data-chart/src/components/area.vue3.cjs +0 -2
- package/lib/src/data-chart/src/components/area.vue3.cjs.map +0 -1
- package/lib/src/data-chart/src/components/card.vue3.cjs +0 -2
- package/lib/src/data-chart/src/components/card.vue3.cjs.map +0 -1
- package/lib/src/data-chart/src/components/line.vue3.cjs +0 -2
- package/lib/src/data-chart/src/components/line.vue3.cjs.map +0 -1
- package/theme-chalk/base.css +0 -1
- package/theme-chalk/file-upload.css +0 -1
- package/theme-chalk/fixed-action-bar.css +0 -1
- package/theme-chalk/image-upload.css +0 -1
- package/theme-chalk/photo-crop-tool.css +0 -1
- package/theme-chalk/src/base.scss.js +0 -4
- package/theme-chalk/src/base.scss.js.map +0 -1
- package/theme-chalk/src/file-upload.scss.js +0 -4
- package/theme-chalk/src/file-upload.scss.js.map +0 -1
- package/theme-chalk/src/fixed-action-bar.scss.js +0 -4
- package/theme-chalk/src/fixed-action-bar.scss.js.map +0 -1
- package/theme-chalk/src/image-upload.scss.js +0 -4
- package/theme-chalk/src/image-upload.scss.js.map +0 -1
- package/theme-chalk/src/index.scss.js +0 -4
- package/theme-chalk/src/index.scss.js.map +0 -1
- package/theme-chalk/src/photo-crop-tool.scss.js +0 -4
- package/theme-chalk/src/photo-crop-tool.scss.js.map +0 -1
- package/theme-chalk/src/subject-action.scss.js +0 -4
- package/theme-chalk/src/subject-action.scss.js.map +0 -1
- package/theme-chalk/src/subject-layout.scss.js +0 -4
- package/theme-chalk/src/subject-layout.scss.js.map +0 -1
- package/theme-chalk/src/subject-list.scss.js +0 -4
- package/theme-chalk/src/subject-list.scss.js.map +0 -1
- package/theme-chalk/src/subject-template.scss.js +0 -4
- package/theme-chalk/src/subject-template.scss.js.map +0 -1
- package/theme-chalk/src/subject-type.scss.js +0 -4
- package/theme-chalk/src/subject-type.scss.js.map +0 -1
- package/theme-chalk/src/tiny-mce-editor.scss.js +0 -4
- package/theme-chalk/src/tiny-mce-editor.scss.js.map +0 -1
- package/theme-chalk/subject-action.css +0 -1
- package/theme-chalk/subject-layout.css +0 -1
- package/theme-chalk/subject-list.css +0 -1
- package/theme-chalk/subject-type.css +0 -1
- package/theme-chalk/tiny-mce-editor.css +0 -1
- /package/theme-chalk/{subject-template.css → src/subject-template.css} +0 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"subject-single.vue.mjs","sources":["../../../../../../../packages/components/src/subject-list/src/components/subject-single.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { CirclePlus, Remove } from '@element-plus/icons-vue'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport SubjectAction from '../../../subject-action/src/subject-action.vue'\nimport SubjectLayout from '../../../subject-layout/src/subject-layout.vue'\nimport TinyMceEditor from '../../../tiny-mce-editor/src/tiny-mce-editor.vue'\nimport { setGuid } from '@qxs-bns/utils'\n\ndefineOptions({\n name: 'QxsSubjectSingle',\n})\nconst props = defineProps<{\n orderIndex: number\n title?: string\n isSave: boolean\n showAction?: boolean\n type: 'single' | 'multiple' | 'sort'\n isEdit: boolean\n isSet: boolean\n answerList?: any\n leastAnswerCount?: number\n analysis?: string\n examExpand?: string\n examRichTextContent?: string\n showAnalysis?: boolean\n examAnswerRelationType?: number\n customId?: number\n examId?: number\n isKey: boolean\n answerCheckType: number\n}>()\nconst emits = defineEmits(['move', 'save', 'delete', 'edit', 'add', 'setRelation'])\n\nconst attrs = useAttrs()\n\nconst answersIndex = ref(0)\nconst isKey = ref(props.isKey)\nconst answerCheckType = ref(1)\nconst examAnswerRelationType = ref(props.examAnswerRelationType)\nconst answers = ref<{\n title: string\n isCorrect: boolean\n orderIndex?: number\n resultItem?: string\n customAnswerId?: string\n answerRelations?: {\n relationExamId: number\n relationAnswers: {\n relationAnswerId: number\n relationAnswerIndex: number\n }[]\n }[]\n}[]>([{\n title: '',\n isCorrect: false,\n}, {\n title: '',\n isCorrect: false,\n}, {\n title: '',\n isCorrect: false,\n}, {\n title: '',\n isCorrect: false,\n}])\n\nconst leastAnswerCount = ref(2)\nconst title = ref('')\nconst analysis = ref('')\nconst showRichText = ref(false)\nconst richText = ref('')\nconst startTime = ref(0)\nconst showRichContent = ref(false)\nconst resultItem = ref<string>('')\nconst titlePlaceholder = computed(() => {\n if (props.type === 'single') {\n return '单选题'\n }\n else if (props.type === 'multiple') {\n return '多选题'\n }\n else {\n return '排序题'\n }\n})\n\nconst orderList = ref<string[]>([])\n\nconst leastAnswerOptions = computed(() => {\n const items = []\n const length = answers.value.length\n for (let count = length; count > 1; count--) {\n items.push({\n label: `至少选择${count}项`,\n value: count,\n })\n }\n return items.reverse()\n})\nfunction addAnswer() {\n if (props.isSave) {\n return\n }\n answers.value.push({\n title: '',\n isCorrect: false,\n customAnswerId: setGuid()\n })\n}\n\nfunction deleteAnswer(index: number) {\n if (answers.value.length < 3 || props.isSave) {\n return\n }\n answers.value.splice(index, 1)\n}\n\nfunction setCorrect(it: any, event: any) {\n if (props.type === 'single') {\n // 单选题:确保只有一个支持选项\n if (event) {\n answers.value.forEach((answer: any) => {\n if (answer !== it) {\n answer.isCorrect = false\n }\n })\n }\n it.isCorrect = event\n } else if (props.type === 'multiple') {\n // 多选题:可以有多个支持选项\n it.isCorrect = event\n }\n}\nfunction setRelation(item: any) {\n item.customAnswerId = item.examAnswerId || setGuid()\n emits('setRelation', props.customId, item)\n}\n\nfunction deleteRichText() {\n showRichText.value = false\n richText.value = ''\n}\n\nfunction save() {\n if (!title.value) {\n ElMessage.error('题目标题不能为空!')\n return\n }\n // 答题设置必选\n if(!answerCheckType.value) {\n ElMessage.error('请选择答题设置')\n return\n }\n let msg = ''\n let isSetCorrectAnswer = false\n let correctAnswerCount = 0\n if (props.type === 'multiple' || props.type === 'single') {\n answers.value.forEach((v: any, i: number) => {\n if (!v.title?.trim()) {\n msg += `选项${String.fromCharCode(65 + i)}未填写。`\n }\n if (v.isCorrect) {\n isSetCorrectAnswer = true\n correctAnswerCount++\n }\n v.relationType = v.resultItem ? 1 : (v.answerRelations?.length ? 2 : null)\n })\n }\n else if (props.type === 'sort') {\n // 如果设置了支持选项\n if (orderList.value.length) {\n isSetCorrectAnswer = true\n }\n }\n if (msg) {\n ElMessage.error(msg)\n return\n }\n\n const uniqueAnswer = new Set(answers.value.map((item: any) => item.title))\n\n if (uniqueAnswer.size !== answers.value.length) {\n ElMessage.error('选项不能重复')\n return\n }\n\n if (props.type === 'multiple') {\n if (correctAnswerCount === 1) {\n ElMessage.error('请至少设置两个支持选项')\n return\n }\n\n if (isSetCorrectAnswer && correctAnswerCount < leastAnswerCount.value) {\n ElMessage.error('至少选几项与支持选项数不符')\n return\n }\n } \n\n if(answerCheckType.value === 2 || answerCheckType.value === 3) {\n // 必须有设置支持选项\n if (!isSetCorrectAnswer) {\n ElMessage.error('请设置支持选项')\n return\n }\n }\n\n emits('save', {\n title: title.value,\n answers: answers.value.map((item: any, index: number) => {\n return { ...item, orderIndex: index + 1 }\n }),\n examExpand: orderList.value.map((i: string) => i.charCodeAt(0) - 65 + 1).join(','),\n analysis: analysis.value,\n isSetCorrectAnswer,\n leastAnswerCount: leastAnswerCount.value,\n examRichTextContent: showRichText.value ? richText.value : '',\n examAnswerRelationType: examAnswerRelationType.value,\n isKey: isKey.value,\n answerCheckType: answerCheckType.value\n })\n}\n\nfunction init() {\n if (props.title) {\n title.value = props.title\n }\n\n if (props.answerCheckType) {\n answerCheckType.value = props.answerCheckType\n }\n\n if (props.isKey) {\n isKey.value = props.isKey\n }\n\n if (props.examAnswerRelationType) {\n examAnswerRelationType.value = props.examAnswerRelationType\n }\n\n if (props.answerList && props.answerList.length) {\n answers.value = props.answerList\n }\n\n if (props.leastAnswerCount) {\n leastAnswerCount.value = props.leastAnswerCount\n }\n\n if (props.examExpand) {\n // 设置支持选项 props.examExpand里是答案id\n if (props.examExpand) {\n const correctAnswerIdList = props.examExpand.split(',')\n\n // 遍历 correctAnswerIdList,直接在 props.answerList 中查找对应的 orderIndex 并转换成字母\n orderList.value = correctAnswerIdList.map((id: string) => {\n const answer = props.answerList.find((item: any) => item.answerId?.toString() === id)\n return answer ? String.fromCharCode(65 + answer.orderIndex - 1) : id\n }).filter(Boolean) // 过滤掉任何可能的空字符串\n }\n }\n\n if (props.analysis) {\n analysis.value = props.analysis\n }\n\n if (props.examRichTextContent) {\n richText.value = props.examRichTextContent\n showRichText.value = true\n }\n}\nfunction onOpenResult(i: number) {\n answersIndex.value = i\n resultItem.value = answers.value[i].resultItem || ''\n showRichContent.value = true\n}\n\nfunction onSaveResult() {\n answers.value[answersIndex.value].resultItem = resultItem.value || ''\n showRichContent.value = false\n}\nfunction onCloseResult() {\n showRichContent.value = false\n resultItem.value = ''\n}\nfunction setKey(key: boolean) {\n isKey.value = key\n}\nfunction setAnswerSetting(type: number) {\n answerCheckType.value = type\n}\n\nfunction add(type: string, canSet: boolean) {\n emits('add', type, canSet? props.examAnswerRelationType: null)\n}\n// 监听isEdit\nwatch(() => props.isEdit, () => {\n if (props.isEdit) {\n startTime.value = new Date().getTime()\n }\n})\n\nconst relationLength = computed(() => {\n return (v: any) => {\n let count = 0\n v.forEach((item: any) => {\n if (item.relationAnswers) {\n count += item.relationAnswers.length\n }\n })\n return count\n }\n})\n\nconst ns = useNamespace('subject-single')\n\nonMounted(init)\n</script>\n\n<template>\n <div :class=\"ns.e('single-exam')\">\n <SubjectLayout\n :show-edit=\"isEdit\"\n >\n <template #preview>\n <div class=\"preview\">\n <div>\n <span class=\"title\">\n {{ orderIndex + 1 }}.{{ title }}\n <span v-if=\"type === 'single'\">(单选题)</span>\n <span v-else-if=\"['multiple', 'sort'].includes(type)\">\n ({{ titlePlaceholder }}{{ leastAnswerCount ? `至少选${leastAnswerCount}项${type === 'sort' ? '并排序' : ''}` : '' }})\n </span>\n </span>\n </div>\n <div v-if=\"showRichText\">\n <div v-html=\"richText\" />\n </div>\n <div class=\"preview-answer\">\n <template v-if=\"type === 'sort'\">\n <el-checkbox\n v-for=\"(item, index) in answers\"\n :key=\"index\"\n class=\"radio\"\n :disabled=\"true\"\n >\n <span class=\"order\">\n {{ String.fromCharCode(65 + index) }}.\n </span>\n {{ item.title }}\n </el-checkbox>\n </template>\n <template v-else>\n <el-radio\n v-for=\"(item, index) in answers\"\n :key=\"index\"\n class=\"radio\"\n value=\"disabled\"\n disabled\n >\n <span class=\"order\">\n {{ String.fromCharCode(65 + index) }}.\n </span>\n {{ item.title }} \n {{ item.isCorrect ? '(支持选项)' : '' }} \n {{ examAnswerRelationType === 1 ? (item.resultItem? '(已设置结果项)' : '(未设置结果项)' ) : ''}} \n {{ examAnswerRelationType === 2 ? (item.answerRelations?.length? '(已设置关联)' : '(未设置关联)') : '' }}\n </el-radio>\n </template>\n </div>\n </div>\n </template>\n <template v-if=\"isEdit\" #edit>\n <div class=\"flex\" :class=\"[{ 'margin-bottom': showRichText }]\">\n <div class=\"label flex flex-justify-center\">\n <span>题目:</span>\n </div>\n <div style=\"flex: 1;\">\n <el-input\n v-model=\"title\"\n type=\"textarea\"\n :rows=\"2\"\n :placeholder=\"`【${titlePlaceholder}】请输入问题`\"\n :disabled=\"isSave\"\n show-word-limit\n maxlength=\"200\"\n class=\"margin-bottom\"\n />\n </div>\n </div>\n <div class=\"margin-bottom flex flex-items-center\">\n <div class=\"label flex flex-justify-center\">\n <span>设置:</span>\n </div>\n <el-select\n v-if=\"['multiple', 'sort'].includes(type)\"\n v-model=\"leastAnswerCount\"\n style=\"width: 150px;\"\n placeholder=\"至少选择几项\"\n :disabled=\"isSave\"\n >\n <el-option\n v-for=\"item in leastAnswerOptions\"\n :key=\"item.value\"\n :value=\"item.value\"\n :label=\"item.label\"\n >\n </el-option>\n </el-select>\n </div>\n <div class=\"margin-bottom answer-list\">\n <div\n v-for=\"(item, index) in answers\"\n :key=\"index\"\n class=\"answer-item flex flex-items-center\"\n >\n <span class=\"order\">{{ String.fromCharCode(65 + index) }}.</span>\n <el-input\n v-model=\"item.title\"\n class=\"input\"\n show-word-limit\n maxlength=\"100\"\n :placeholder=\"`选项${String.fromCharCode(65 + index)}`\"\n :disabled=\"isSave\"\n />\n <el-checkbox\n v-if=\"['single', 'multiple'].includes(type)\"\n v-model=\"item.isCorrect\"\n :class=\"[{ 'is-correct': item.isCorrect }]\"\n :disabled=\"isSave\"\n style=\"margin-left: 10px;\"\n @change=\"(event: any) => setCorrect(item, event)\"\n >\n 支持选项 \n </el-checkbox>\n <el-icon class=\"icon\">\n <CirclePlus\n :class=\"[{ disabled: isSave }]\"\n @click=\"addAnswer\"\n />\n </el-icon>\n <el-icon class=\"icon\">\n <Remove\n :class=\"[{ disabled: answers.length < 3 || isSave }]\"\n @click=\"deleteAnswer(index)\"\n />\n </el-icon>\n <el-link\n v-if=\"examAnswerRelationType === 1 && type !== 'sort'\"\n type=\"primary\"\n class=\"margin-left-10\"\n @click=\"onOpenResult(index)\"\n >\n <span>{{ item.resultItem ? '编辑结果' : '添加结果' }}</span>\n </el-link>\n <el-link\n v-if=\"examAnswerRelationType === 2 && type !== 'sort'\"\n type=\"primary\"\n class=\"margin-left-10\"\n @click=\"setRelation(item)\"\n >\n <span>{{ item.answerRelations?.length ? `关联了${relationLength(item.answerRelations)}项` : '关联检查' }}</span>\n </el-link>\n </div>\n </div>\n <div v-if=\"type === 'sort'\" class=\"margin-bottom flex flex-items-center\">\n <div class=\"label flex flex-justify-end\">\n <span>排序答案:</span>\n </div>\n <div style=\"flex: 1;\">\n <el-select\n v-model=\"orderList\"\n multiple\n style=\"width: 360px;\"\n placeholder=\"请按顺序选择排序答案\"\n :show-arrow=\"true\"\n >\n <!-- :options=\"[...Array(answers.length)].map((_, i) => ({ value: String.fromCharCode(65 + i) }))\" -->\n <el-option\n v-for=\"(item, index) in answers\"\n :key=\"index\"\n :label=\"item.title\"\n :value=\"String.fromCharCode(65 + index)\"\n />\n </el-select>\n </div>\n </div>\n <div\n v-if=\"showAnalysis\"\n class=\"flex\"\n >\n <div class=\"label flex flex-justify-center\">\n <span>解析:</span>\n </div>\n <div style=\"flex: 1;\">\n <el-input\n v-model=\"analysis\"\n type=\"textarea\"\n :rows=\"2\"\n placeholder=\"请输入题目解析\"\n />\n </div>\n </div>\n <div v-if=\"showRichText\" class=\"margin-bottom flex\">\n <div class=\"label flex flex-justify-center\">\n <span>富文本:</span>\n </div>\n <div style=\"flex: 1;\">\n <TinyMceEditor v-model:model-value=\"richText\" v-bind=\"attrs\" style=\"width: 100%;\" />\n <div class=\"flex flex-justify-end\">\n <el-link\n type=\"danger\"\n @click=\"deleteRichText\"\n >\n 删除富文本\n </el-link>\n </div>\n </div>\n </div>\n </template>\n <SubjectAction\n v-if=\"showAction\"\n :is-edit=\"isEdit\"\n :is-set=\"isSet\"\n :isKey=\"isKey\"\n :showOtherOption=\"props.type === 'multiple' || props.type === 'single'\"\n :examAnswerRelationType=\"props.examAnswerRelationType\"\n :answerCheckType=\"answerCheckType\"\n @move-up=\"emits('move', 'up')\"\n @move-down=\"emits('move', 'down')\"\n @delete=\"emits('delete')\"\n @save=\"save\"\n @edit=\"emits('edit')\"\n @add=\"add\"\n @onShowRichText=\"showRichText = true\"\n @setKey=\"setKey\"\n @setAnswerSetting=\"setAnswerSetting\"\n />\n </SubjectLayout>\n <el-dialog\n v-model=\"showRichContent\"\n title=\"添加结果\"\n class=\"customize-dialog\"\n >\n <TinyMceEditor\n :key=\"answersIndex\"\n v-model:model-value=\"resultItem\" \n v-bind=\"attrs\"\n style=\"width: 100%;\" />\n <template #footer>\n <el-button\n class=\"customize-button\"\n type=\"primary\"\n plain\n @click=\"onCloseResult\"\n >\n 取消\n </el-button>\n <el-button\n class=\"customize-button\"\n type=\"primary\"\n plain\n @click=\"onSaveResult\"\n >\n 保存\n </el-button>\n </template>\n </el-dialog>\n </div>\n</template>\n"],"names":["props","__props","emits","__emit","attrs","useAttrs","answersIndex","ref","isKey","answerCheckType","examAnswerRelationType","answers","title","isCorrect","leastAnswerCount","analysis","showRichText","richText","startTime","showRichContent","resultItem","titlePlaceholder","computed","type","orderList","leastAnswerOptions","items","count","value","length","push","label","reverse","addAnswer","isSave","customAnswerId","setGuid","deleteRichText","save","ElMessage","error","msg","isSetCorrectAnswer","correctAnswerCount","forEach","v","i","trim","String","fromCharCode","relationType","answerRelations","Set","map","item","size","index","orderIndex","examExpand","charCodeAt","join","examRichTextContent","onSaveResult","onCloseResult","setKey","key","setAnswerSetting","add","canSet","watch","isEdit","Date","getTime","relationLength","relationAnswers","ns","useNamespace","onMounted","answerList","correctAnswerIdList","split","id","answer","find","answerId","toString","filter","Boolean","it","event","splice","examAnswerId","customId"],"mappings":"8pEAWA,MAAMA,GAAQC,EAoBRC,GAAQC,GAERC,GAAQC,IAERC,GAAeC,EAAI,GACnBC,GAAQD,EAAIP,GAAMQ,OAClBC,GAAkBF,EAAI,GACtBG,GAAyBH,EAAIP,GAAMU,wBACnCC,GAAUJ,EAaX,CAAC,CACJK,MAAO,GACPC,WAAW,GACV,CACDD,MAAO,GACPC,WAAW,GACV,CACDD,MAAO,GACPC,WAAW,GACV,CACDD,MAAO,GACPC,WAAW,KAGPC,GAAmBP,EAAI,GACvBK,GAAQL,E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QiB,MAAMkB,GAAG1B,YAAc,QAClDD,GAAgBS,OAAQ,GAH1B,IAAsBkB,yMAxItB,SAAqBQ,GACdA,EAAAnB,eAAiBmB,EAAKqC,cAAgBvD,IACrClC,GAAA,cAAeF,GAAM4F,SAAUtC,EAAI"}
|
1
|
+
{"version":3,"file":"subject-single.vue.mjs","sources":["../../../../../../../packages/components/src/subject-list/src/components/subject-single.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { CirclePlus, Remove } from '@element-plus/icons-vue'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport SubjectAction from '../../../subject-action/src/subject-action.vue'\nimport SubjectLayout from '../../../subject-layout/src/subject-layout.vue'\nimport TinyMceEditor from '../../../tiny-mce-editor/src/tiny-mce-editor.vue'\nimport { setGuid } from '@qxs-bns/utils'\n\ndefineOptions({\n name: 'QxsSubjectSingle',\n})\nconst props = defineProps<{\n orderIndex: number\n title?: string\n isSave: boolean\n showAction?: boolean\n type: 'single' | 'multiple' | 'sort'\n isEdit: boolean\n isSet: boolean\n answerList?: any\n leastAnswerCount?: number\n analysis?: string\n examExpand?: string\n examRichTextContent?: string\n showAnalysis?: boolean\n examAnswerRelationType?: number\n customId?: number\n examId?: number\n isKey: boolean\n answerCheckType: number\n}>()\nconst emits = defineEmits(['move', 'save', 'delete', 'edit', 'add', 'setRelation'])\n\nconst attrs = useAttrs()\n\nconst answersIndex = ref(0)\nconst isKey = ref(props.isKey)\nconst answerCheckType = ref(1)\nconst examAnswerRelationType = ref(props.examAnswerRelationType)\nconst answers = ref<{\n title: string\n isCorrect: boolean\n orderIndex?: number\n resultItem?: string\n customAnswerId?: string\n answerRelations?: {\n relationExamId: number\n relationAnswers: {\n relationAnswerId: number\n relationAnswerIndex: number\n }[]\n }[]\n}[]>([{\n title: '',\n isCorrect: false,\n}, {\n title: '',\n isCorrect: false,\n}, {\n title: '',\n isCorrect: false,\n}, {\n title: '',\n isCorrect: false,\n}])\n\nconst leastAnswerCount = ref(2)\nconst title = ref('')\nconst analysis = ref('')\nconst showRichText = ref(false)\nconst richText = ref('')\nconst startTime = ref(0)\nconst showRichContent = ref(false)\nconst resultItem = ref<string>('')\nconst titlePlaceholder = computed(() => {\n if (props.type === 'single') {\n return '单选题'\n }\n else if (props.type === 'multiple') {\n return '多选题'\n }\n else {\n return '排序题'\n }\n})\n\nconst orderList = ref<string[]>([])\n\nconst leastAnswerOptions = computed(() => {\n const items = []\n const length = answers.value.length\n for (let count = length; count > 1; count--) {\n items.push({\n label: `至少选择${count}项`,\n value: count,\n })\n }\n return items.reverse()\n})\nfunction addAnswer() {\n if (props.isSave) {\n return\n }\n answers.value.push({\n title: '',\n isCorrect: false,\n customAnswerId: setGuid()\n })\n}\n\nfunction deleteAnswer(index: number) {\n if (answers.value.length < 3 || props.isSave) {\n return\n }\n answers.value.splice(index, 1)\n}\n\nfunction setCorrect(it: any, event: any) {\n if (props.type === 'single') {\n // 单选题:确保只有一个支持选项\n if (event) {\n answers.value.forEach((answer: any) => {\n if (answer !== it) {\n answer.isCorrect = false\n }\n })\n }\n it.isCorrect = event\n } else if (props.type === 'multiple') {\n // 多选题:可以有多个支持选项\n it.isCorrect = event\n }\n}\nfunction setRelation(item: any) {\n item.customAnswerId = item.examAnswerId || setGuid()\n emits('setRelation', props.customId, item)\n}\n\nfunction deleteRichText() {\n showRichText.value = false\n richText.value = ''\n}\n\nfunction save() {\n if (!title.value) {\n ElMessage.error('题目标题不能为空!')\n return\n }\n // 答题设置必选\n if(!answerCheckType.value) {\n ElMessage.error('请选择答题设置')\n return\n }\n let msg = ''\n let isSetCorrectAnswer = false\n let correctAnswerCount = 0\n if (props.type === 'multiple' || props.type === 'single') {\n answers.value.forEach((v: any, i: number) => {\n if (!v.title?.trim()) {\n msg += `选项${String.fromCharCode(65 + i)}未填写。`\n }\n if (v.isCorrect) {\n isSetCorrectAnswer = true\n correctAnswerCount++\n }\n v.relationType = v.resultItem ? 1 : (v.answerRelations?.length ? 2 : null)\n })\n }\n else if (props.type === 'sort') {\n // 如果设置了支持选项\n if (orderList.value.length) {\n isSetCorrectAnswer = true\n }\n }\n if (msg) {\n ElMessage.error(msg)\n return\n }\n\n const uniqueAnswer = new Set(answers.value.map((item: any) => item.title))\n\n if (uniqueAnswer.size !== answers.value.length) {\n ElMessage.error('选项不能重复')\n return\n }\n\n if (props.type === 'multiple') {\n if (correctAnswerCount === 1) {\n ElMessage.error('请至少设置两个支持选项')\n return\n }\n\n if (isSetCorrectAnswer && correctAnswerCount < leastAnswerCount.value) {\n ElMessage.error('至少选几项与支持选项数不符')\n return\n }\n } \n\n if(answerCheckType.value === 2 || answerCheckType.value === 3) {\n // 必须有设置支持选项\n if (!isSetCorrectAnswer) {\n ElMessage.error('请设置支持选项')\n return\n }\n }\n\n emits('save', {\n title: title.value,\n answers: answers.value.map((item: any, index: number) => {\n return { ...item, orderIndex: index + 1 }\n }),\n examExpand: orderList.value.map((i: string) => i.charCodeAt(0) - 65 + 1).join(','),\n analysis: analysis.value,\n isSetCorrectAnswer,\n leastAnswerCount: leastAnswerCount.value,\n examRichTextContent: showRichText.value ? richText.value : '',\n examAnswerRelationType: examAnswerRelationType.value,\n isKey: isKey.value,\n answerCheckType: answerCheckType.value\n })\n}\n\nfunction init() {\n if (props.title) {\n title.value = props.title\n }\n\n if (props.answerCheckType) {\n answerCheckType.value = props.answerCheckType\n }\n\n if (props.isKey) {\n isKey.value = props.isKey\n }\n\n if (props.examAnswerRelationType) {\n examAnswerRelationType.value = props.examAnswerRelationType\n }\n\n if (props.answerList && props.answerList.length) {\n answers.value = props.answerList\n }\n\n if (props.leastAnswerCount) {\n leastAnswerCount.value = props.leastAnswerCount\n }\n\n if (props.examExpand) {\n // 设置支持选项 props.examExpand里是答案id\n if (props.examExpand) {\n const correctAnswerIdList = props.examExpand.split(',')\n\n // 遍历 correctAnswerIdList,直接在 props.answerList 中查找对应的 orderIndex 并转换成字母\n orderList.value = correctAnswerIdList.map((id: string) => {\n const answer = props.answerList.find((item: any) => item.answerId?.toString() === id)\n return answer ? String.fromCharCode(65 + answer.orderIndex - 1) : id\n }).filter(Boolean) // 过滤掉任何可能的空字符串\n }\n }\n\n if (props.analysis) {\n analysis.value = props.analysis\n }\n\n if (props.examRichTextContent) {\n richText.value = props.examRichTextContent\n showRichText.value = true\n }\n}\nfunction onOpenResult(i: number) {\n answersIndex.value = i\n resultItem.value = answers.value[i].resultItem || ''\n showRichContent.value = true\n}\n\nfunction onSaveResult() {\n answers.value[answersIndex.value].resultItem = resultItem.value || ''\n showRichContent.value = false\n}\nfunction onCloseResult() {\n showRichContent.value = false\n resultItem.value = ''\n}\nfunction setKey(key: boolean) {\n isKey.value = key\n}\nfunction setAnswerSetting(type: number) {\n answerCheckType.value = type\n}\n\nfunction add(type: string, canSet: boolean) {\n emits('add', type, canSet? props.examAnswerRelationType: null)\n}\n// 监听isEdit\nwatch(() => props.isEdit, () => {\n if (props.isEdit) {\n startTime.value = new Date().getTime()\n }\n})\n\nconst relationLength = computed(() => {\n return (v: any) => {\n let count = 0\n v.forEach((item: any) => {\n if (item.relationAnswers) {\n count += item.relationAnswers.length\n }\n })\n return count\n }\n})\n\nconst ns = useNamespace('subject-single')\n\nonMounted(init)\n</script>\n\n<template>\n <div :class=\"ns.e('single-exam')\">\n <SubjectLayout\n :show-edit=\"isEdit\"\n >\n <template #preview>\n <div class=\"preview\">\n <div>\n <span class=\"title\">\n {{ orderIndex + 1 }}.{{ title }}\n <span v-if=\"type === 'single'\">(单选题)</span>\n <span v-else-if=\"['multiple', 'sort'].includes(type)\">\n ({{ titlePlaceholder }}{{ leastAnswerCount ? `至少选${leastAnswerCount}项${type === 'sort' ? '并排序' : ''}` : '' }})\n </span>\n </span>\n </div>\n <div v-if=\"showRichText\">\n <div v-html=\"richText\" class=\"rich-text\"/>\n </div>\n <div class=\"preview-answer\">\n <template v-if=\"type === 'sort'\">\n <el-checkbox\n v-for=\"(item, index) in answers\"\n :key=\"index\"\n class=\"radio\"\n :disabled=\"true\"\n >\n <span class=\"order\">\n {{ String.fromCharCode(65 + index) }}.\n </span>\n {{ item.title }}\n </el-checkbox>\n </template>\n <template v-else>\n <el-radio\n v-for=\"(item, index) in answers\"\n :key=\"index\"\n class=\"radio\"\n value=\"disabled\"\n disabled\n >\n <span class=\"order\">\n {{ String.fromCharCode(65 + index) }}.\n </span>\n {{ item.title }} \n {{ item.isCorrect ? '(支持选项)' : '' }} \n {{ examAnswerRelationType === 1 ? (item.resultItem? '(已设置结果项)' : '(未设置结果项)' ) : ''}} \n {{ examAnswerRelationType === 2 ? (item.answerRelations?.length? '(已设置关联)' : '(未设置关联)') : '' }}\n </el-radio>\n </template>\n </div>\n </div>\n </template>\n <template v-if=\"isEdit\" #edit>\n <div class=\"flex\" :class=\"[{ 'margin-bottom': showRichText }]\">\n <div class=\"label flex flex-justify-center\">\n <span>题目:</span>\n </div>\n <div style=\"flex: 1;\">\n <el-input\n v-model=\"title\"\n type=\"textarea\"\n :rows=\"2\"\n :placeholder=\"`【${titlePlaceholder}】请输入问题`\"\n :disabled=\"isSave\"\n show-word-limit\n maxlength=\"200\"\n class=\"margin-bottom\"\n />\n </div>\n </div>\n <div class=\"margin-bottom flex flex-items-center\">\n <div class=\"label flex flex-justify-center\">\n <span>设置:</span>\n </div>\n <el-select\n v-if=\"['multiple', 'sort'].includes(type)\"\n v-model=\"leastAnswerCount\"\n style=\"width: 150px;\"\n placeholder=\"至少选择几项\"\n :disabled=\"isSave\"\n >\n <el-option\n v-for=\"item in leastAnswerOptions\"\n :key=\"item.value\"\n :value=\"item.value\"\n :label=\"item.label\"\n >\n </el-option>\n </el-select>\n </div>\n <div class=\"margin-bottom answer-list\">\n <div\n v-for=\"(item, index) in answers\"\n :key=\"index\"\n class=\"answer-item flex flex-items-center\"\n >\n <span class=\"label flex flex-justify-center\">{{ String.fromCharCode(65 + index) }}.</span>\n <el-input\n v-model=\"item.title\"\n class=\"input\"\n show-word-limit\n maxlength=\"100\"\n :placeholder=\"`选项${String.fromCharCode(65 + index)}`\"\n :disabled=\"isSave\"\n />\n <el-checkbox\n v-if=\"['single', 'multiple'].includes(type)\"\n v-model=\"item.isCorrect\"\n :class=\"[{ 'is-correct': item.isCorrect }]\"\n :disabled=\"isSave\"\n style=\"margin-left: 10px;\"\n @change=\"(event: any) => setCorrect(item, event)\"\n >\n 支持选项 \n </el-checkbox>\n <el-icon class=\"icon\">\n <CirclePlus\n :class=\"[{ disabled: isSave }]\"\n @click=\"addAnswer\"\n />\n </el-icon>\n <el-icon class=\"icon\">\n <Remove\n :class=\"[{ disabled: answers.length < 3 || isSave }]\"\n @click=\"deleteAnswer(index)\"\n />\n </el-icon>\n <el-link\n v-if=\"examAnswerRelationType === 1 && type !== 'sort'\"\n type=\"primary\"\n class=\"margin-left-10\"\n @click=\"onOpenResult(index)\"\n >\n <span>{{ item.resultItem ? '编辑结果' : '添加结果' }}</span>\n </el-link>\n <el-link\n v-if=\"examAnswerRelationType === 2 && type !== 'sort'\"\n type=\"primary\"\n class=\"margin-left-10\"\n @click=\"setRelation(item)\"\n >\n <span>{{ item.answerRelations?.length ? `关联了${relationLength(item.answerRelations)}项` : '关联检查' }}</span>\n </el-link>\n </div>\n </div>\n <div v-if=\"type === 'sort'\" class=\"margin-bottom flex flex-items-center\">\n <div class=\"label flex flex-justify-end\">\n <span>排序答案:</span>\n </div>\n <div style=\"flex: 1;\">\n <el-select\n v-model=\"orderList\"\n multiple\n style=\"width: 360px;\"\n placeholder=\"请按顺序选择排序答案\"\n :show-arrow=\"true\"\n >\n <el-option\n v-for=\"(item, index) in answers\"\n :key=\"index\"\n :label=\"item.title\"\n :value=\"String.fromCharCode(65 + index)\"\n />\n </el-select>\n </div>\n </div>\n <div\n v-if=\"showAnalysis\"\n class=\"flex\"\n >\n <div class=\"label flex flex-justify-center\">\n <span>解析:</span>\n </div>\n <div style=\"flex: 1;\">\n <el-input\n v-model=\"analysis\"\n type=\"textarea\"\n :rows=\"2\"\n placeholder=\"请输入题目解析\"\n />\n </div>\n </div>\n <div v-if=\"showRichText\" class=\"margin-bottom flex\">\n <div class=\"label flex flex-justify-center\">\n <span>富文本:</span>\n </div>\n <div style=\"flex: 1;\">\n <TinyMceEditor v-model:model-value=\"richText\" v-bind=\"attrs\" style=\"width: 100%;\" />\n <div class=\"flex flex-justify-end\">\n <el-link\n type=\"danger\"\n @click=\"deleteRichText\"\n >\n 删除富文本\n </el-link>\n </div>\n </div>\n </div>\n </template>\n <SubjectAction\n v-if=\"showAction\"\n :is-edit=\"isEdit\"\n :is-set=\"isSet\"\n :isKey=\"isKey\"\n :showOtherOption=\"props.type === 'multiple' || props.type === 'single'\"\n :examAnswerRelationType=\"props.examAnswerRelationType\"\n :answerCheckType=\"answerCheckType\"\n @move-up=\"emits('move', 'up')\"\n @move-down=\"emits('move', 'down')\"\n @delete=\"emits('delete')\"\n @save=\"save\"\n @edit=\"emits('edit')\"\n @add=\"add\"\n @onShowRichText=\"showRichText = true\"\n @setKey=\"setKey\"\n @setAnswerSetting=\"setAnswerSetting\"\n />\n </SubjectLayout>\n <el-dialog\n v-model=\"showRichContent\"\n title=\"添加结果\"\n class=\"customize-dialog\"\n >\n <TinyMceEditor\n :key=\"answersIndex\"\n v-model:model-value=\"resultItem\" \n v-bind=\"attrs\"\n style=\"width: 100%;\" />\n <template #footer>\n <el-button\n class=\"customize-button\"\n type=\"primary\"\n plain\n @click=\"onCloseResult\"\n >\n 取消\n </el-button>\n <el-button\n class=\"customize-button\"\n type=\"primary\"\n plain\n @click=\"onSaveResult\"\n >\n 保存\n </el-button>\n </template>\n </el-dialog>\n </div>\n</template>\n"],"names":["props","__props","emits","__emit","attrs","useAttrs","answersIndex","ref","isKey","answerCheckType","examAnswerRelationType","answers","title","isCorrect","leastAnswerCount","analysis","showRichText","richText","startTime","showRichContent","resultItem","titlePlaceholder","computed","type","orderList","leastAnswerOptions","items","count","value","length","push","label","reverse","addAnswer","isSave","customAnswerId","setGuid","deleteRichText","save","ElMessage","error","msg","isSetCorrectAnswer","correctAnswerCount","forEach","v","i","trim","String","fromCharCode","relationType","answerRelations","Set","map","item","size","index","orderIndex","examExpand","charCodeAt","join","examRichTextContent","onSaveResult","onCloseResult","setKey","key","setAnswerSetting","add","canSet","watch","isEdit","Date","getTime","relationLength","relationAnswers","ns","useNamespace","onMounted","answerList","correctAnswerIdList","split","id","answer","find","answerId","toString","filter","Boolean","it","event","splice","examAnswerId","customId"],"mappings":"owFAWA,MAAMA,GAAQC,EAoBRC,GAAQC,GAERC,GAAQC,IAERC,GAAeC,EAAI,GACnBC,GAAQD,EAAIP,GAAMQ,OAClBC,GAAkBF,EAAI,GACtBG,GAAyBH,EAAIP,GAAMU,wBACnCC,GAAUJ,EAaX,CAAC,CACJK,MAAO,GACPC,WAAW,GACV,CACDD,MAAO,GACPC,WAAW,GACV,CACDD,MAAO,GACPC,WAAW,GACV,CACDD,MAAO,GACPC,WAAW,KAGPC,GAAmBP,EAAI,GACvBK,GAAQL,EAAI,IACZQ,GAAWR,EAAI,IACfS,GAAeT,GAAI,GACnBU,GAAWV,EAAI,IACfW,GAAYX,EAAI,GAChBY,GAAkBZ,GAAI,GACtBa,GAAab,EAAY,IACzBc,GAAmBC,GAAS,IACb,WAAftB,GAAMuB,KACD,MAEe,aAAfvB,GAAMuB,KACN,MAGA,QAILC,GAAYjB,EAAc,IAE1BkB,GAAqBH,GAAS,KAClC,MAAMI,EAAQ,GAEd,IAAA,IAASC,EADMhB,GAAQiB,MAAMC,OACJF,EAAQ,EAAGA,IAClCD,EAAMI,KAAK,CACTC,MAAO,OAAOJ,KACdC,MAAOD,IAGX,OAAOD,EAAMM,SAAQ,IAEvB,SAASC,KACHjC,GAAMkC,QAGVvB,GAAQiB,MAAME,KAAK,CACjBlB,MAAO,GACPC,WAAW,EACXsB,eAAgBC,KACjB,CA+BH,SAASC,KACPrB,GAAaY,OAAQ,EACrBX,GAASW,MAAQ,EAAA,CAGnB,SAASU,KACH,IAAC1B,GAAMgB,MAET,YADAW,EAAUC,MAAM,aAIf,IAAC/B,GAAgBmB,MA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a,GAAKiC,EAAOzB,WAAa,GAAKwB,CAAA,IACjEK,OAAOC,QAAO,CAIjBvF,GAAMe,WACRA,GAASa,MAAQ5B,GAAMe,UAGrBf,GAAM6D,sBACR5C,GAASW,MAAQ5B,GAAM6D,oBACvB7C,GAAaY,OAAQ,EACvB,uqGAtJO,SAAW4D,EAASC,GACR,WAAfzF,GAAMuB,MAEJkE,GACM9E,GAAAiB,MAAMgB,SAASsC,IACjBA,IAAWM,IACbN,EAAOrE,WAAY,EAAA,IAIzB2E,EAAG3E,UAAY4E,GACS,aAAfzF,GAAMuB,OAEfiE,EAAG3E,UAAY4E,EACjB,gXArBF,SAAsBjC,GAChB7C,GAAQiB,MAAMC,OAAS,GAAK7B,GAAMkC,QAG9BvB,GAAAiB,MAAM8D,OAAOlC,EAAO,EAAC,qJA2JTV,IACpBxC,GAAasB,MAAQkB,EACrB1B,GAAWQ,MAAQjB,GAAQiB,MAAMkB,GAAG1B,YAAc,QAClDD,GAAgBS,OAAQ,GAH1B,IAAsBkB,yMAxItB,SAAqBQ,GACdA,EAAAnB,eAAiBmB,EAAKqC,cAAgBvD,IACrClC,GAAA,cAAeF,GAAM4F,SAAUtC,EAAI"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{ElInput as e,ElInputNumber as l,ElCheckboxGroup as t,ElCheckbox as s,ElTag as
|
1
|
+
import{ElInput as e,ElInputNumber as l,ElCheckboxGroup as t,ElCheckbox as s,ElTag as n,ElButton as i,ElIcon as a,ElLink as o}from"element-plus/es";import"element-plus/es/components/base/style/index";import"element-plus/es/components/link/style/index";import"element-plus/es/components/button/style/index";import"element-plus/es/components/icon/style/index";import"element-plus/es/components/tag/style/index";import"element-plus/es/components/checkbox-group/style/index";import"element-plus/es/components/input-number/style/index";import"element-plus/es/components/input/style/index";import"element-plus/es/components/checkbox/style/index";import{defineComponent as u,useAttrs as r,ref as d,onMounted as m,createElementBlock as p,openBlock as c,normalizeClass as v,unref as x,createVNode as f,withCtx as y,createBlock as w,createCommentVNode as g,createElementVNode as h,isRef as b,Fragment as k,renderList as V,createTextVNode as C,toDisplayString as S,mergeProps as j}from"vue";import{Plus as I,CirclePlus as O,Remove as A}from"@element-plus/icons-vue";import{useNamespace as q}from"@qxs-bns/hooks";import{ElMessage as _}from"element-plus";import T from"../../../subject-action/src/subject-action.vue.mjs";import E from"../../../subject-layout/src/subject-layout.vue.mjs";import R from"../../../tiny-mce-editor/src/tiny-mce-editor.vue.mjs";const U={class:"preview"},B={class:"content"},L={class:"title"},M={key:0},D=["innerHTML"],H={class:"content flex flex-col"},N={key:1,class:"flex",style:{"margin-top":"10px",color:"#a8abb2"}},z={class:"title"},$={class:"flex"},F={style:{flex:"1"},class:"margin-bottom"},G={class:"margin-bottom flex flex-items-center"},J={class:"flex"},K={style:{flex:"1"}},P={class:"margin-bottom answer-list"},Q={class:"label flex flex-justify-end"},W={class:"answer-tags"},X={class:"operation"},Y={key:0,class:"margin-bottom flex"},Z={style:{flex:"1"}},ee={key:1,class:"margin-bottom flex"},le={style:{flex:"1"}},te={class:"flex flex-justify-end"};var se=u({__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(u,{emit:se}){const ne=u,ie=se,ae=r(),oe=d([{title:"",tag:"",showInput:!1}]),ue=d(""),re=d(""),de=d(),me=d(""),pe=d(!1),ce=d(""),ve=[{label:"答案不分顺序",value:"isInOrder"},{label:"忽略大小写",value:"isIgnoreCase"}],xe=d(["isInOrder","isIgnoreCase"]);function fe(){oe.value.push({title:"",tag:"",showInput:!1})}function ye(){pe.value=!1,ce.value=""}function we(){if(ue.value){if(de.value||me.value){if(!de.value)return void _.error("请完善答题设置!");if(!me.value)return void _.error("请输入问题正确答案!");if(oe.value.length!==de.value)return void _.error("关键词个数设置有误!");const e=[];if(oe.value.forEach(((l,t)=>{l.title||e.push(`关键词${t+1}未设置`)})),e.length>0)return void _.error(e.join(","))}ie("save",{title:ue.value,answers:oe.value.filter((e=>e.title)).map((e=>({title:e.title}))),analysis:re.value,isSetCorrectAnswer:!!me.value,examExpand:me.value,examAnswerSettingBO:{isIgnoreCase:xe.value?.includes("isIgnoreCase"),isInOrder:xe.value?.includes("isInOrder"),keywordCount:de.value},examRichTextContent:pe.value?ce.value:""})}else _.error("题目标题不能为空!")}m((function(){ne.title&&(ue.value=ne.title),ne.answerList&&ne.answerList.length&&(oe.value=ne.answerList),ne.examAnswerSettingVO&&(xe.value=xe.value.filter((e=>"isIgnoreCase"===e&&ne.examAnswerSettingVO?.isIgnoreCase||"isInOrder"===e&&ne.examAnswerSettingVO?.isInOrder))),ne.examAnswerSettingVO?.keywordCount&&(de.value=ne.examAnswerSettingVO?.keywordCount),ne.examExpand&&(me.value=ne.examExpand),ne.analysis&&(re.value=ne.analysis),ne.examRichTextContent&&(ce.value=ne.examRichTextContent,pe.value=!0)}));const ge=q("subject-text-fill");return(u,r)=>{const d=s,m=e,q=l,_=t,se=n,he=a,be=i,ke=o;return c(),p("div",{class:v(x(ge).e("text-fill-exam"))},[f(E,{"show-edit":u.isEdit},{preview:y((()=>[h("div",U,[h("div",B,[h("span",L,S(u.orderIndex+1)+"."+S(x(ue))+"(问答题)",1),x(pe)?(c(),p("div",M,[h("div",{innerHTML:x(ce),class:"rich-text"},null,8,D)])):g("v-if",!0),h("div",H,[x(oe).some((e=>e.title))?(c(!0),p(k,{key:0},V(x(oe),((e,l)=>(c(),w(d,{key:l,class:"radio",disabled:!0},{default:y((()=>[C(S(e.title),1)])),_:2},1024)))),128)):g("v-if",!0)]),x(me)?(c(),p("div",N,[h("span",z,"正确答案:"+S(x(me)),1)])):g("v-if",!0)])])])),edit:y((()=>[h("div",$,[r[12]||(r[12]=h("div",{class:"label flex flex-justify-end"},[h("span",null,"题目:")],-1)),h("div",F,[f(m,{modelValue:x(ue),"onUpdate:modelValue":r[0]||(r[0]=e=>b(ue)?ue.value=e:null),type:"textarea",rows:2,placeholder:"【问答题】请输入问题",maxlength:200,"show-word-limit":"",disabled:u.isSave},null,8,["modelValue","disabled"])])]),h("div",G,[r[13]||(r[13]=h("div",{class:"label flex flex-justify-end"},[h("span",null,"答题设置:")],-1)),r[14]||(r[14]=h("span",null,"共答对",-1)),f(q,{modelValue:x(de),"onUpdate:modelValue":r[1]||(r[1]=e=>b(de)?de.value=e:null),style:{width:"100px",margin:"0 10px"},min:1},null,8,["modelValue"]),r[15]||(r[15]=h("span",{style:{"margin-right":"10px"}},"个关键词,算是正确的",-1)),(c(),p(k,null,V(ve,(e=>f(_,{key:e.value,modelValue:x(xe),"onUpdate:modelValue":r[2]||(r[2]=e=>b(xe)?xe.value=e:null)},{default:y((()=>[f(d,{label:e.value,class:"margin-left-10"},{default:y((()=>[C(S(e.label),1)])),_:2},1032,["label"])])),_:2},1032,["modelValue"]))),64))]),h("div",J,[r[16]||(r[16]=h("div",{class:"label flex flex-justify-end"},[h("span",null,"答案:")],-1)),h("div",K,[f(m,{modelValue:x(me),"onUpdate:modelValue":r[3]||(r[3]=e=>b(me)?me.value=e:null),type:"textarea",rows:2,placeholder:"请输入正确答案",maxlength:200,"show-word-limit":"",disabled:u.isSave},null,8,["modelValue","disabled"])])]),h("div",P,[r[17]||(r[17]=h("span",{style:{"padding-left":"60px"}},"*如遇包含特殊字符的关键词,需添加多个同义词,例:'CO₂'需添加同义词'CO2'",-1)),(c(!0),p(k,null,V(x(oe),((e,l)=>(c(),p("div",{key:l,class:"answer-item flex flex-items-center"},[h("div",Q,[h("span",null,"关键词"+S(l+1)+":",1)]),h("div",W,[(c(!0),p(k,null,V(e.title.split(","),(l=>(c(),p(k,{key:l},[l?(c(),w(se,{key:0,closable:"",onClose:t=>function(e,l){if(e){const t=l.title.split(","),s=t.findIndex((l=>l===e));s>-1&&(t.splice(s,1),l.title=t.join(","))}}(l,e)},{default:y((()=>[C(S(l),1)])),_:2},1032,["onClose"])):g("v-if",!0)],64)))),128)),u.isSave?g("v-if",!0):(c(),p(k,{key:0},[e.showInput?(c(),w(m,{key:0,modelValue:e.tag,"onUpdate:modelValue":l=>e.tag=l,style:{width:"80px"},onBlur:()=>function(e){e.showInput=!1,e.tag&&(e.title=e.title?[e.title,e.tag].join(","):e.tag,e.tag="")}(e)},null,8,["modelValue","onUpdate:modelValue","onBlur"])):(c(),w(be,{key:1,size:"small",onClick:l=>e.showInput=!0},{default:y((()=>[f(he,null,{default:y((()=>[f(x(I))])),_:1}),h("span",null,S(e.title?"添加同义词":"添加关键词"),1)])),_:2},1032,["onClick"]))],64))]),h("div",X,[f(he,{class:"icon"},{default:y((()=>[f(x(O),{class:v([{disabled:u.isSave}]),onClick:fe},null,8,["class"])])),_:1}),f(he,{class:"icon"},{default:y((()=>[f(x(A),{class:v([{disabled:x(oe).length<2||u.isSave}]),onClick:e=>function(e){oe.value.length<2||ne.isSave||oe.value.splice(e,1)}(l)},null,8,["class","onClick"])])),_:2},1024)])])))),128))]),u.showAnalysis?(c(),p("div",Y,[r[18]||(r[18]=h("div",{class:"label flex flex-justify-end"},[h("span",null,"解析:")],-1)),h("div",Z,[f(m,{modelValue:x(re),"onUpdate:modelValue":r[4]||(r[4]=e=>b(re)?re.value=e:null),type:"textarea",rows:2,placeholder:"请输入题目解析"},null,8,["modelValue"])])])):g("v-if",!0),x(pe)?(c(),p("div",ee,[r[20]||(r[20]=h("div",{class:"label flex flex-justify-center"},[h("span",null,"富文本:")],-1)),h("div",le,[f(R,j({"model-value":x(ce),"onUpdate:modelValue":r[5]||(r[5]=e=>b(ce)?ce.value=e:null)},x(ae),{style:{width:"100%"}}),null,16,["model-value"]),h("div",te,[f(ke,{type:"danger",onClick:ye},{default:y((()=>r[19]||(r[19]=[C(" 删除富文本 ")]))),_:1})])])])):g("v-if",!0)])),default:y((()=>[u.showAction?(c(),w(T,{key:0,"is-edit":u.isEdit,"is-set":u.isSet,showOtherOption:!1,examAnswerRelationType:ne.examAnswerRelationType,onMoveUp:r[6]||(r[6]=e=>ie("move","up")),onMoveDown:r[7]||(r[7]=e=>ie("move","down")),onDelete:r[8]||(r[8]=e=>ie("delete")),onSave:we,onEdit:r[9]||(r[9]=e=>ie("edit")),onAdd:r[10]||(r[10]=e=>ie("add",e)),onOnShowRichText:r[11]||(r[11]=e=>pe.value=!0)},null,8,["is-edit","is-set","examAnswerRelationType"])):g("v-if",!0)])),_:1},8,["show-edit"])],2)}}});export{se as default};
|
2
2
|
//# sourceMappingURL=subject-text-fill.vue.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"subject-text-fill.vue.mjs","sources":["../../../../../../../packages/components/src/subject-list/src/components/subject-text-fill.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { CirclePlus, Plus, Remove } from '@element-plus/icons-vue'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport { ElMessage } from 'element-plus'\nimport SubjectAction from '../../../subject-action/src/subject-action.vue'\nimport SubjectLayout from '../../../subject-layout/src/subject-layout.vue'\nimport TinyMceEditor from '../../../tiny-mce-editor/src/tiny-mce-editor.vue'\n\nconst props = defineProps<{\n orderIndex: number\n title?: string\n isSave: boolean\n showAction?: boolean\n answerList?: any\n analysis?: string\n isEdit: boolean\n isSet: boolean\n examExpand?: string\n examAnswerSettingVO?: {\n isInOrder: boolean\n isIgnoreCase: boolean\n keywordCount: number\n }\n examRichTextContent?: string\n showAnalysis?: boolean\n examAnswerRelationType?: number\n}>()\nconst emits = defineEmits(['move', 'save', 'delete', 'edit', 'add'])\n\nconst attrs = useAttrs()\n\nconst answers = ref<{\n title: string\n tag: string\n showInput: boolean\n}[]>([{\n title: '',\n tag: '',\n showInput: false,\n}])\n\nconst title = ref('')\nconst analysis = ref('')\nconst keywordCount = ref()\nconst correct = ref('')\nconst showRichText = ref(false)\nconst richText = ref('')\n\nconst checkList = [\n {\n label: '答案不分顺序',\n value: 'isInOrder',\n },\n {\n label: '忽略大小写',\n value: 'isIgnoreCase',\n },\n]\n\nconst isCheckList = ref(['isInOrder', 'isIgnoreCase'])\n\nfunction handleAddTag(item: any) {\n item.showInput = false\n if (item.tag) {\n item.title = item.title ? [item.title, item.tag].join(',') : item.tag\n item.tag = ''\n }\n}\n\nfunction closeTag(tag: string, item: any) {\n if (tag) {\n const tags = item.title.split(',')\n const index = tags.findIndex((i: string) => i === tag)\n if (index > -1) {\n tags.splice(index, 1)\n item.title = tags.join(',')\n }\n }\n}\n\nfunction addAnswer() {\n answers.value.push({\n title: '',\n tag: '',\n showInput: false,\n })\n}\n\nfunction deleteAnswer(index: number) {\n if (answers.value.length < 2 || props.isSave) {\n return\n }\n answers.value.splice(index, 1)\n}\n\nfunction deleteRichText() {\n showRichText.value = false\n richText.value = ''\n}\n\nfunction save() {\n if (!title.value) {\n ElMessage.error('题目标题不能为空!')\n return\n }\n\n if (keywordCount.value || correct.value) {\n if (!keywordCount.value) {\n ElMessage.error('请完善答题设置!')\n return\n }\n\n if (!correct.value) {\n ElMessage.error('请输入问题正确答案!')\n return\n }\n\n if (answers.value.length !== keywordCount.value) {\n ElMessage.error('关键词个数设置有误!')\n return\n }\n const msg: string[] = []\n answers.value.forEach((item, index) => {\n if (!item.title) {\n msg.push(`关键词${index + 1}未设置`)\n }\n })\n if (msg.length > 0) {\n ElMessage.error(msg.join(','))\n return\n }\n }\n\n emits('save', {\n title: title.value,\n answers: answers.value.filter((i: any) => i.title).map((item: any) => {\n return { title: item.title }\n }),\n analysis: analysis.value,\n isSetCorrectAnswer: !!correct.value,\n examExpand: correct.value,\n examAnswerSettingBO: {\n isIgnoreCase: isCheckList.value?.includes('isIgnoreCase'),\n isInOrder: isCheckList.value?.includes('isInOrder'),\n ...{ keywordCount: keywordCount.value },\n },\n examRichTextContent: showRichText.value ? richText.value : '',\n })\n}\n\nfunction init() {\n if (props.title) {\n title.value = props.title\n }\n\n if (props.answerList && props.answerList.length) {\n answers.value = props.answerList\n }\n\n if (props.examAnswerSettingVO) {\n // 仅保留与设置匹配的选项\n isCheckList.value = isCheckList.value.filter(item =>\n (item === 'isIgnoreCase' && props.examAnswerSettingVO?.isIgnoreCase)\n || (item === 'isInOrder' && props.examAnswerSettingVO?.isInOrder),\n )\n }\n\n if (props.examAnswerSettingVO?.keywordCount) {\n keywordCount.value = props.examAnswerSettingVO?.keywordCount\n }\n\n if (props.examExpand) {\n correct.value = props.examExpand\n }\n\n if (props.analysis) {\n analysis.value = props.analysis\n }\n\n if (props.examRichTextContent) {\n richText.value = props.examRichTextContent\n showRichText.value = true\n }\n}\n\nonMounted(init)\nconst ns = useNamespace('subject-text-fill')\n</script>\n\n<template>\n <div :class=\"ns.e('text-fill-exam')\">\n <SubjectLayout :show-edit=\"isEdit\">\n <template #preview>\n <div class=\"preview\">\n <div class=\"content\">\n <span class=\"title\">{{ orderIndex + 1 }}.{{ title }}(问答题)</span>\n <div v-if=\"showRichText\">\n <div v-html=\"richText\" />\n </div>\n <div class=\"content flex flex-col\">\n <template v-if=\"answers.some(item => item.title)\">\n <el-checkbox\n v-for=\"(item, index) in answers\"\n :key=\"index\"\n class=\"radio\"\n :disabled=\"true\"\n >\n {{ item.title }}\n </el-checkbox>\n </template>\n </div>\n <div\n v-if=\"correct\"\n class=\"flex\"\n style=\"margin-top: 10px;color: #a8abb2;\"\n >\n <span class=\"title\">正确答案:{{ correct }}</span>\n </div>\n </div>\n </div>\n </template>\n <template #edit>\n <div class=\"flex\">\n <div class=\"label flex flex-justify-end\">\n <span>题目:</span>\n </div>\n <div style=\"flex: 1;\" class=\"margin-bottom\">\n <el-input\n v-model=\"title\"\n type=\"textarea\"\n :rows=\"2\"\n placeholder=\"【问答题】请输入问题\"\n :maxlength=\"200\"\n show-word-limit\n :disabled=\"isSave\"\n />\n </div>\n </div>\n <div class=\"margin-bottom flex flex-items-center\">\n <div class=\"label flex flex-justify-end\">\n <span>答题设置:</span>\n </div>\n <span>共答对</span>\n <el-input-number\n v-model=\"keywordCount\"\n style=\"width: 100px;margin: 0 10px;\"\n :min=\"1\"\n />\n <span style=\"margin-right: 10px;\">个关键词,算是正确的</span>\n <el-checkbox-group\n v-for=\"item in checkList\"\n :key=\"item.value\"\n v-model=\"isCheckList\"\n >\n <el-checkbox :label=\"item.value\" class=\"margin-left-10\">\n {{ item.label }}\n </el-checkbox>\n </el-checkbox-group>\n </div>\n <div class=\"flex\">\n <div class=\"label flex flex-justify-end\">\n <span>答案:</span>\n </div>\n <div style=\"flex: 1;\">\n <el-input\n v-model=\"correct\"\n type=\"textarea\"\n :rows=\"2\"\n placeholder=\"请输入正确答案\"\n :maxlength=\"200\"\n show-word-limit\n :disabled=\"isSave\"\n />\n </div>\n </div>\n <div class=\"margin-bottom answer-list\">\n <span style=\"padding-left: 60px;\">*如遇包含特殊字符的关键词,需添加多个同义词,例:'CO₂'需添加同义词'CO2'</span>\n <div\n v-for=\"(item, index) in answers\"\n :key=\"index\"\n class=\"answer-item flex flex-items-center\"\n >\n <div class=\"label flex flex-justify-end\">\n <span>关键词{{ index + 1 }}:</span>\n </div>\n\n <div class=\"answer-tags\">\n <template\n v-for=\"i in item.title.split(',')\"\n :key=\"i\"\n >\n <el-tag\n v-if=\"i\"\n closable\n @close=\"closeTag(i, item)\"\n >\n {{ i }}\n </el-tag>\n </template>\n <template v-if=\"!isSave\">\n <el-input\n v-if=\"item.showInput\"\n v-model=\"item.tag\"\n style=\"width: 80px;\"\n @blur=\"() => handleAddTag(item)\"\n />\n <el-button\n v-else\n size=\"small\"\n @click=\"item.showInput = true\"\n >\n <el-icon><Plus /></el-icon>\n <span>{{ item.title ? '添加同义词' : '添加关键词' }}</span>\n </el-button>\n </template>\n </div>\n <div class=\"operation\">\n <el-icon class=\"icon\">\n <CirclePlus\n :class=\"[{ disabled: isSave }]\"\n @click=\"addAnswer\"\n />\n </el-icon>\n <el-icon class=\"icon\">\n <Remove\n :class=\"[{ disabled: answers.length < 2 || isSave }]\"\n @click=\"deleteAnswer(index)\"\n />\n </el-icon>\n </div>\n </div>\n </div>\n <div v-if=\"showAnalysis\" class=\"margin-bottom flex\">\n <div class=\"label flex flex-justify-end\">\n <span>解析:</span>\n </div>\n <div style=\"flex: 1;\">\n <el-input\n v-model=\"analysis\"\n type=\"textarea\"\n :rows=\"2\"\n placeholder=\"请输入题目解析\"\n />\n </div>\n </div>\n <div v-if=\"showRichText\" class=\"margin-bottom flex\">\n <div class=\"label flex flex-justify-center\">\n <span>富文本:</span>\n </div>\n <div style=\"flex: 1;\">\n <TinyMceEditor v-model:model-value=\"richText\" v-bind=\"attrs\" style=\"width: 100%;\" />\n <div class=\"flex flex-justify-end\">\n <el-link\n type=\"danger\"\n @click=\"deleteRichText\"\n >\n 删除富文本\n </el-link>\n </div>\n </div>\n </div>\n </template>\n <SubjectAction\n v-if=\"showAction\"\n :is-edit=\"isEdit\"\n :is-set=\"isSet\"\n :showOtherOption=\"false\"\n :examAnswerRelationType=\"props.examAnswerRelationType\"\n @move-up=\"emits('move', 'up')\"\n @move-down=\"emits('move', 'down')\"\n @delete=\"emits('delete')\"\n @save=\"save\"\n @edit=\"emits('edit')\"\n @add=\"type => emits('add', type)\"\n @onShowRichText=\"showRichText = true\"\n />\n </SubjectLayout>\n </div>\n</template>\n"],"names":["props","__props","emits","__emit","attrs","useAttrs","answers","ref","title","tag","showInput","analysis","keywordCount","correct","showRichText","richText","checkList","label","value","isCheckList","addAnswer","push","deleteRichText","save","ElMessage","error","length","msg","forEach","item","index","join","filter","i","map","isSetCorrectAnswer","examExpand","examAnswerSettingBO","isIgnoreCase","includes","isInOrder","examRichTextContent","onMounted","answerList","examAnswerSettingVO","ns","useNamespace","tags","split","findIndex","splice","isSave"],"mappings":"siEAQA,MAAMA,GAAQC,EAmBRC,GAAQC,GAERC,GAAQC,IAERC,GAAUC,EAIX,CAAC,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YA6CjB,CAsCHiB,GAnCA,WACM1C,GAAMQ,QACRA,GAAMU,MAAQlB,GAAMQ,OAGlBR,GAAM2C,YAAc3C,GAAM2C,WAAWjB,SACvCpB,GAAQY,MAAQlB,GAAM2C,YAGpB3C,GAAM4C,sBAEIzB,GAAAD,MAAQC,GAAYD,MAAMc,QAAOH,GACjC,iBAATA,GAA2B7B,GAAM4C,qBAAqBN,cAC1C,cAATT,GAAwB7B,GAAM4C,qBAAqBJ,aAIvDxC,GAAM4C,qBAAqBhC,eAChBA,GAAAM,MAAQlB,GAAM4C,qBAAqBhC,cAG9CZ,GAAMoC,aACRvB,GAAQK,MAAQlB,GAAMoC,YAGpBpC,GAAMW,WACRA,GAASO,MAAQlB,GAAMW,UAGrBX,GAAMyC,sBACR1B,GAASG,MAAQlB,GAAMyC,oBACvB3B,GAAaI,OAAQ,EACvB,IAII,MAAA2B,GAAKC,EAAa,6tEArHf,SAASrC,EAAaoB,GAC7B,GAAIpB,EAAK,CACP,MAAMsC,EAAOlB,EAAKrB,MAAMwC,MAAM,KACxBlB,EAAQiB,EAAKE,WAAWhB,GAAcA,IAAMxB,IAC9CqB,GAAQ,IACLiB,EAAAG,OAAOpB,EAAO,GACdD,EAAArB,MAAQuC,EAAKhB,KAAK,KACzB,CACF,+OAhBF,SAAsBF,GACpBA,EAAKnB,WAAY,EACbmB,EAAKpB,MACPoB,EAAKrB,MAAQqB,EAAKrB,MAAQ,CAACqB,EAAKrB,MAAOqB,EAAKpB,KAAKsB,KAAK,KAAOF,EAAKpB,IAClEoB,EAAKpB,IAAM,GACb,ueAsBF,SAAsBqB,GAChBxB,GAAQY,MAAMQ,OAAS,GAAK1B,GAAMmD,QAG9B7C,GAAAY,MAAMgC,OAAOpB,EAAO,EAAC"}
|
1
|
+
{"version":3,"file":"subject-text-fill.vue.mjs","sources":["../../../../../../../packages/components/src/subject-list/src/components/subject-text-fill.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { CirclePlus, Plus, Remove } from '@element-plus/icons-vue'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport { ElMessage } from 'element-plus'\nimport SubjectAction from '../../../subject-action/src/subject-action.vue'\nimport SubjectLayout from '../../../subject-layout/src/subject-layout.vue'\nimport TinyMceEditor from '../../../tiny-mce-editor/src/tiny-mce-editor.vue'\n\nconst props = defineProps<{\n orderIndex: number\n title?: string\n isSave: boolean\n showAction?: boolean\n answerList?: any\n analysis?: string\n isEdit: boolean\n isSet: boolean\n examExpand?: string\n examAnswerSettingVO?: {\n isInOrder: boolean\n isIgnoreCase: boolean\n keywordCount: number\n }\n examRichTextContent?: string\n showAnalysis?: boolean\n examAnswerRelationType?: number\n}>()\nconst emits = defineEmits(['move', 'save', 'delete', 'edit', 'add'])\n\nconst attrs = useAttrs()\n\nconst answers = ref<{\n title: string\n tag: string\n showInput: boolean\n}[]>([{\n title: '',\n tag: '',\n showInput: false,\n}])\n\nconst title = ref('')\nconst analysis = ref('')\nconst keywordCount = ref()\nconst correct = ref('')\nconst showRichText = ref(false)\nconst richText = ref('')\n\nconst checkList = [\n {\n label: '答案不分顺序',\n value: 'isInOrder',\n },\n {\n label: '忽略大小写',\n value: 'isIgnoreCase',\n },\n]\n\nconst isCheckList = ref(['isInOrder', 'isIgnoreCase'])\n\nfunction handleAddTag(item: any) {\n item.showInput = false\n if (item.tag) {\n item.title = item.title ? [item.title, item.tag].join(',') : item.tag\n item.tag = ''\n }\n}\n\nfunction closeTag(tag: string, item: any) {\n if (tag) {\n const tags = item.title.split(',')\n const index = tags.findIndex((i: string) => i === tag)\n if (index > -1) {\n tags.splice(index, 1)\n item.title = tags.join(',')\n }\n }\n}\n\nfunction addAnswer() {\n answers.value.push({\n title: '',\n tag: '',\n showInput: false,\n })\n}\n\nfunction deleteAnswer(index: number) {\n if (answers.value.length < 2 || props.isSave) {\n return\n }\n answers.value.splice(index, 1)\n}\n\nfunction deleteRichText() {\n showRichText.value = false\n richText.value = ''\n}\n\nfunction save() {\n if (!title.value) {\n ElMessage.error('题目标题不能为空!')\n return\n }\n\n if (keywordCount.value || correct.value) {\n if (!keywordCount.value) {\n ElMessage.error('请完善答题设置!')\n return\n }\n\n if (!correct.value) {\n ElMessage.error('请输入问题正确答案!')\n return\n }\n\n if (answers.value.length !== keywordCount.value) {\n ElMessage.error('关键词个数设置有误!')\n return\n }\n const msg: string[] = []\n answers.value.forEach((item, index) => {\n if (!item.title) {\n msg.push(`关键词${index + 1}未设置`)\n }\n })\n if (msg.length > 0) {\n ElMessage.error(msg.join(','))\n return\n }\n }\n\n emits('save', {\n title: title.value,\n answers: answers.value.filter((i: any) => i.title).map((item: any) => {\n return { title: item.title }\n }),\n analysis: analysis.value,\n isSetCorrectAnswer: !!correct.value,\n examExpand: correct.value,\n examAnswerSettingBO: {\n isIgnoreCase: isCheckList.value?.includes('isIgnoreCase'),\n isInOrder: isCheckList.value?.includes('isInOrder'),\n ...{ keywordCount: keywordCount.value },\n },\n examRichTextContent: showRichText.value ? richText.value : '',\n })\n}\n\nfunction init() {\n if (props.title) {\n title.value = props.title\n }\n\n if (props.answerList && props.answerList.length) {\n answers.value = props.answerList\n }\n\n if (props.examAnswerSettingVO) {\n // 仅保留与设置匹配的选项\n isCheckList.value = isCheckList.value.filter(item =>\n (item === 'isIgnoreCase' && props.examAnswerSettingVO?.isIgnoreCase)\n || (item === 'isInOrder' && props.examAnswerSettingVO?.isInOrder),\n )\n }\n\n if (props.examAnswerSettingVO?.keywordCount) {\n keywordCount.value = props.examAnswerSettingVO?.keywordCount\n }\n\n if (props.examExpand) {\n correct.value = props.examExpand\n }\n\n if (props.analysis) {\n analysis.value = props.analysis\n }\n\n if (props.examRichTextContent) {\n richText.value = props.examRichTextContent\n showRichText.value = true\n }\n}\n\nonMounted(init)\nconst ns = useNamespace('subject-text-fill')\n</script>\n\n<template>\n <div :class=\"ns.e('text-fill-exam')\">\n <SubjectLayout :show-edit=\"isEdit\">\n <template #preview>\n <div class=\"preview\">\n <div class=\"content\">\n <span class=\"title\">{{ orderIndex + 1 }}.{{ title }}(问答题)</span>\n <div v-if=\"showRichText\">\n <div v-html=\"richText\" class=\"rich-text\" />\n </div>\n <div class=\"content flex flex-col\">\n <template v-if=\"answers.some(item => item.title)\">\n <el-checkbox\n v-for=\"(item, index) in answers\"\n :key=\"index\"\n class=\"radio\"\n :disabled=\"true\"\n >\n {{ item.title }}\n </el-checkbox>\n </template>\n </div>\n <div\n v-if=\"correct\"\n class=\"flex\"\n style=\"margin-top: 10px;color: #a8abb2;\"\n >\n <span class=\"title\">正确答案:{{ correct }}</span>\n </div>\n </div>\n </div>\n </template>\n <template #edit>\n <div class=\"flex\">\n <div class=\"label flex flex-justify-end\">\n <span>题目:</span>\n </div>\n <div style=\"flex: 1;\" class=\"margin-bottom\">\n <el-input\n v-model=\"title\"\n type=\"textarea\"\n :rows=\"2\"\n placeholder=\"【问答题】请输入问题\"\n :maxlength=\"200\"\n show-word-limit\n :disabled=\"isSave\"\n />\n </div>\n </div>\n <div class=\"margin-bottom flex flex-items-center\">\n <div class=\"label flex flex-justify-end\">\n <span>答题设置:</span>\n </div>\n <span>共答对</span>\n <el-input-number\n v-model=\"keywordCount\"\n style=\"width: 100px;margin: 0 10px;\"\n :min=\"1\"\n />\n <span style=\"margin-right: 10px;\">个关键词,算是正确的</span>\n <el-checkbox-group\n v-for=\"item in checkList\"\n :key=\"item.value\"\n v-model=\"isCheckList\"\n >\n <el-checkbox :label=\"item.value\" class=\"margin-left-10\">\n {{ item.label }}\n </el-checkbox>\n </el-checkbox-group>\n </div>\n <div class=\"flex\">\n <div class=\"label flex flex-justify-end\">\n <span>答案:</span>\n </div>\n <div style=\"flex: 1;\">\n <el-input\n v-model=\"correct\"\n type=\"textarea\"\n :rows=\"2\"\n placeholder=\"请输入正确答案\"\n :maxlength=\"200\"\n show-word-limit\n :disabled=\"isSave\"\n />\n </div>\n </div>\n <div class=\"margin-bottom answer-list\">\n <span style=\"padding-left: 60px;\">*如遇包含特殊字符的关键词,需添加多个同义词,例:'CO₂'需添加同义词'CO2'</span>\n <div\n v-for=\"(item, index) in answers\"\n :key=\"index\"\n class=\"answer-item flex flex-items-center\"\n >\n <div class=\"label flex flex-justify-end\">\n <span>关键词{{ index + 1 }}:</span>\n </div>\n\n <div class=\"answer-tags\">\n <template\n v-for=\"i in item.title.split(',')\"\n :key=\"i\"\n >\n <el-tag\n v-if=\"i\"\n closable\n @close=\"closeTag(i, item)\"\n >\n {{ i }}\n </el-tag>\n </template>\n <template v-if=\"!isSave\">\n <el-input\n v-if=\"item.showInput\"\n v-model=\"item.tag\"\n style=\"width: 80px;\"\n @blur=\"() => handleAddTag(item)\"\n />\n <el-button\n v-else\n size=\"small\"\n @click=\"item.showInput = true\"\n >\n <el-icon><Plus /></el-icon>\n <span>{{ item.title ? '添加同义词' : '添加关键词' }}</span>\n </el-button>\n </template>\n </div>\n <div class=\"operation\">\n <el-icon class=\"icon\">\n <CirclePlus\n :class=\"[{ disabled: isSave }]\"\n @click=\"addAnswer\"\n />\n </el-icon>\n <el-icon class=\"icon\">\n <Remove\n :class=\"[{ disabled: answers.length < 2 || isSave }]\"\n @click=\"deleteAnswer(index)\"\n />\n </el-icon>\n </div>\n </div>\n </div>\n <div v-if=\"showAnalysis\" class=\"margin-bottom flex\">\n <div class=\"label flex flex-justify-end\">\n <span>解析:</span>\n </div>\n <div style=\"flex: 1;\">\n <el-input\n v-model=\"analysis\"\n type=\"textarea\"\n :rows=\"2\"\n placeholder=\"请输入题目解析\"\n />\n </div>\n </div>\n <div v-if=\"showRichText\" class=\"margin-bottom flex\">\n <div class=\"label flex flex-justify-center\">\n <span>富文本:</span>\n </div>\n <div style=\"flex: 1;\">\n <TinyMceEditor v-model:model-value=\"richText\" v-bind=\"attrs\" style=\"width: 100%;\" />\n <div class=\"flex flex-justify-end\">\n <el-link\n type=\"danger\"\n @click=\"deleteRichText\"\n >\n 删除富文本\n </el-link>\n </div>\n </div>\n </div>\n </template>\n <SubjectAction\n v-if=\"showAction\"\n :is-edit=\"isEdit\"\n :is-set=\"isSet\"\n :showOtherOption=\"false\"\n :examAnswerRelationType=\"props.examAnswerRelationType\"\n @move-up=\"emits('move', 'up')\"\n @move-down=\"emits('move', 'down')\"\n @delete=\"emits('delete')\"\n @save=\"save\"\n @edit=\"emits('edit')\"\n @add=\"type => emits('add', type)\"\n @onShowRichText=\"showRichText = true\"\n />\n </SubjectLayout>\n </div>\n</template>\n"],"names":["props","__props","emits","__emit","attrs","useAttrs","answers","ref","title","tag","showInput","analysis","keywordCount","correct","showRichText","richText","checkList","label","value","isCheckList","addAnswer","push","deleteRichText","save","ElMessage","error","length","msg","forEach","item","index","join","filter","i","map","isSetCorrectAnswer","examExpand","examAnswerSettingBO","isIgnoreCase","includes","isInOrder","examRichTextContent","onMounted","answerList","examAnswerSettingVO","ns","useNamespace","tags","split","findIndex","splice","isSave"],"mappings":"khFAQA,MAAMA,GAAQC,EAmBRC,GAAQC,GAERC,GAAQC,IAERC,GAAUC,EAIX,CAAC,CACJC,MAAO,GACPC,IAAK,GACLC,WAAW,KAGPF,GAAQD,EAAI,IACZI,GAAWJ,EAAI,IACfK,GAAeL,IACfM,GAAUN,EAAI,IACdO,GAAeP,GAAI,GACnBQ,GAAWR,EAAI,IAEfS,GAAY,CAChB,CACEC,MAAO,SACPC,MAAO,aAET,CACED,MAAO,QACPC,MAAO,iBAILC,GAAcZ,EAAI,CAAC,YAAa,iBAqBtC,SAASa,KACPd,GAAQY,MAAMG,KAAK,CACjBb,MAAO,GACPC,IAAK,GACLC,WAAW,GACZ,CAUH,SAASY,KACPR,GAAaI,OAAQ,EACrBH,GAASG,MAAQ,EAAA,CAGnB,SAASK,KACH,GAACf,GAAMU,MAAP,CAKA,GAAAN,GAAaM,OAASL,GAAQK,MAAO,CACnC,IAACN,GAAaM,MAEhB,YADAM,EAAUC,MAAM,YAId,IAACZ,GAAQK,MAEX,YADAM,EAAUC,MAAM,cAIlB,GAAInB,GAAQY,MAAMQ,SAAWd,GAAaM,MAExC,YADAM,EAAUC,MAA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rB,MAAMwC,MAAM,KACxBlB,EAAQiB,EAAKE,WAAWhB,GAAcA,IAAMxB,IAC9CqB,GAAQ,IACLiB,EAAAG,OAAOpB,EAAO,GACdD,EAAArB,MAAQuC,EAAKhB,KAAK,KACzB,CACF,+OAhBF,SAAsBF,GACpBA,EAAKnB,WAAY,EACbmB,EAAKpB,MACPoB,EAAKrB,MAAQqB,EAAKrB,MAAQ,CAACqB,EAAKrB,MAAOqB,EAAKpB,KAAKsB,KAAK,KAAOF,EAAKpB,IAClEoB,EAAKpB,IAAM,GACb,ueAsBF,SAAsBqB,GAChBxB,GAAQY,MAAMQ,OAAS,GAAK1B,GAAMmD,QAG9B7C,GAAAY,MAAMgC,OAAOpB,EAAO,EAAC"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{defineComponent as e,ref as
|
1
|
+
import{defineComponent as e,ref as s,useAttrs as t,computed as n,watch as i,createElementBlock as a,openBlock as o,normalizeClass as l,unref as r,createElementVNode as d,Fragment as c,renderList as m,createBlock as u,createCommentVNode as p,mergeProps as x}from"vue";import w from"./components/subject-blank-fill.vue.mjs";import v from"./components/subject-scale.vue.mjs";import y from"./components/subject-single.vue.mjs";import h from"./components/subject-text-fill.vue.mjs";import T from"./components/SubjectRichText.vue.mjs";import f from"./components/SubjectPageEnd.vue.mjs";import{useNamespace as A}from"@qxs-bns/hooks";import{setGuid as R}from"@qxs-bns/utils";import{ElMessage as E}from"element-plus/es";import"element-plus/es/components/base/style/index";import"element-plus/es/components/message/style/index";const S={class:"subject-list-wrapper"};var g=e({name:"QxsSubjectList",__name:"subject-list",props:{subjectList:{type:Array,required:!0},isPreview:{type:Boolean,required:!0}},emits:["setRelation"],setup(e,{expose:g,emit:C}){const I=e,D=s([]),j=C,b=t();g({addSubject:M,currentList:D,uploadExcel:function(e){D.value=D.value.concat(e)},addExam:function(e){console.log(e,"items");let s=1;const t=[];e.forEach((e=>{const n={...e,customId:R(),answerType:e.richTextContent?"rich_text":e.examTypeEnum,answers:e.answers?.map((e=>({...e,title:e.answer,answerId:e.examAnswerId,isCorrect:e.isCorrect})))||[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1};n.pageIndex>s&&(t.push({customId:R(),answerType:"page_end",analysis:"",scaleQuestionList:[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1,examAnswerRelationType:0}),s=n.pageIndex),t.push(n)})),D.value=D.value.concat(t)},setAnswerRelation:function(e,s,t){const n=D.value.find((e=>e.customId===s));if(n){const s=n.answers?.find((e=>e.customAnswerId===t));s&&(s.answerRelations=e)}}});const _=n((()=>{const e=D.value.filter((e=>"page_end"===e.answerType));return s=>{const t=e.findIndex((e=>e.customId===s));return-1!==t?t+1:0}}));function k(){return e=>{let s=0,t=0;return D.value.forEach((n=>{"page_end"!==n.answerType&&(s++,e===n.customId&&(t=s))})),t-1}}function M(e,s=null,t=null){const n={customId:R(),answerType:e,analysis:"",scaleQuestionList:[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1,examAnswerRelationType:t};null!==s?D.value.splice(s+1,0,n):D.value.push(n)}function L(e,s){if("up"===s&&e>0){const[s]=D.value.splice(e,1);D.value.splice(e-1,0,s)}else if("down"===s&&e<D.value.length-1){const[s]=D.value.splice(e,1);D.value.splice(e+1,0,s)}}function P(e,s){D.value[e]={...D.value[e],...s,isEdit:!1,examAnswerRelationType:s.examAnswerRelationType}}function q(e){D.value.splice(e,1),E.success("删除成功")}function Q(e,s){j("setRelation",e,s)}i((()=>I.subjectList),(e=>{e&&(D.value=[...e])}),{immediate:!0});const K=A("subject-list");return(e,s)=>(o(),a("div",{class:l(r(K).e("list-exam"))},[d("div",S,[(o(!0),a(c,null,m(r(D),((s,t)=>(o(),a("div",{key:s.customId,class:"subject-item"},[["single","multiple","sort"].includes(s.answerType)?(o(),u(y,x({key:0,ref_for:!0},r(b),{"order-index":k()(s.customId),title:s.title,type:s.answerType,"exam-id":s.examId,isKey:s.isKey,"is-save":!s.isRealCanDel,customId:s.customId,"is-set":s.hasSet||!1,"answer-list":s.answers,analysis:s.analysis,"least-answer-count":s.leastAnswerCount,"is-edit":s.isEdit||!1,"show-action":!e.isPreview,"exam-expand":s.examExpand,answerCheckType:s.answerCheckType,"exam-rich-text-content":s.examRichTextContent,examAnswerRelationType:s.examAnswerRelationType,onSetRelation:Q,onMove:e=>L(t,e),onDelete:e=>q(t),onSave:e=>P(t,e),onEdit:e=>s.isEdit=!0,onAdd:(e,s)=>M(e,t,s)}),null,16,["order-index","title","type","exam-id","isKey","is-save","customId","is-set","answer-list","analysis","least-answer-count","is-edit","show-action","exam-expand","answerCheckType","exam-rich-text-content","examAnswerRelationType","onMove","onDelete","onSave","onEdit","onAdd"])):"scale"===s.answerType?(o(),u(v,x({key:1,ref_for:!0},r(b),{"order-index":k()(s.customId),title:s.title,"is-save":!s.isRealCanDel,"is-set":s.hasSet||!1,"answer-list":s.answers,analysis:s.analysis,"is-edit":s.isEdit||!1,"scale-question-list":s.scaleQuestionList,"show-action":!e.isPreview,"exam-rich-text-content":s.examRichTextContent,examAnswerRelationType:s.examAnswerRelationType,onMove:e=>L(t,e),onDelete:e=>q(t),onSave:e=>P(t,e),onEdit:e=>s.isEdit=!0,onAdd:e=>M(e,t,null)}),null,16,["order-index","title","is-save","is-set","answer-list","analysis","is-edit","scale-question-list","show-action","exam-rich-text-content","examAnswerRelationType","onMove","onDelete","onSave","onEdit","onAdd"])):"blank_fill"===s.answerType?(o(),u(w,x({key:2,ref_for:!0},r(b),{"order-index":k()(s.customId),title:s.title,"is-save":!s.isRealCanDel,"is-set":s.hasSet||!1,"answer-list":s.answers,analysis:s.analysis,"show-action":!e.isPreview,"is-edit":s.isEdit||!1,"exam-answer-setting-v-o":s.examAnswerSettingVO||{},"exam-rich-text-content":s.examRichTextContent,examAnswerRelationType:s.examAnswerRelationType,onMove:e=>L(t,e),onDelete:e=>q(t),onSave:e=>P(t,e),onEdit:e=>s.isEdit=!0,onAdd:e=>M(e,t,null)}),null,16,["order-index","title","is-save","is-set","answer-list","analysis","show-action","is-edit","exam-answer-setting-v-o","exam-rich-text-content","examAnswerRelationType","onMove","onDelete","onSave","onEdit","onAdd"])):"text_fill"===s.answerType?(o(),u(h,x({key:3,ref_for:!0},r(b),{"order-index":k()(s.customId),title:s.title,"is-save":!s.isRealCanDel,"is-set":s.hasSet||!1,"answer-list":s.answers,analysis:s.analysis,"show-action":!e.isPreview,"is-edit":s.isEdit||!1,"exam-expand":s.examExpand,"exam-answer-setting-v-o":s.examAnswerSettingVO||{},examAnswerRelationType:s.examAnswerRelationType,"exam-rich-text-content":s.examRichTextContent,onMove:e=>L(t,e),onDelete:e=>q(t),onSave:e=>P(t,e),onEdit:e=>s.isEdit=!0,onAdd:e=>M(e,t,null)}),null,16,["order-index","title","is-save","is-set","answer-list","analysis","show-action","is-edit","exam-expand","exam-answer-setting-v-o","examAnswerRelationType","exam-rich-text-content","onMove","onDelete","onSave","onEdit","onAdd"])):"rich_text"===s.answerType?(o(),u(T,x({key:4,ref_for:!0},r(b),{"order-index":k()(s.customId),richTextContent:s.richTextContent,"is-set":s.hasSet||!1,"is-save":!s.isRealCanDel,"is-edit":s.isEdit||!1,"show-action":!e.isPreview,onMove:e=>L(t,e),onDelete:e=>q(t),examAnswerRelationType:s.examAnswerRelationType,onSave:e=>P(t,e),onEdit:e=>s.isEdit=!0,onAdd:e=>M(e,t,null)}),null,16,["order-index","richTextContent","is-set","is-save","is-edit","show-action","onMove","onDelete","examAnswerRelationType","onSave","onEdit","onAdd"])):"page_end"===s.answerType?(o(),u(f,{"total-page":D.value.filter((e=>"page_end"===e.answerType)).length,key:t,"current-page-index":r(_)(s.customId),item:s,"is-edit":s.isEdit||!1,"is-set":s.hasSet||!1,"is-save":!s.isRealCanDel,examAnswerRelationType:s.examAnswerRelationType,onMove:e=>L(t,e),onDelete:e=>q(t),onSave:e=>P(t,e),onEdit:e=>s.isEdit=!0,onAdd:e=>M(e,t,null)},null,8,["total-page","current-page-index","item","is-edit","is-set","is-save","examAnswerRelationType","onMove","onDelete","onSave","onEdit","onAdd"])):p("v-if",!0)])))),128))])],2))}});export{g as default};
|
2
2
|
//# sourceMappingURL=subject-list.vue.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"subject-list.vue.mjs","sources":["../../../../../../packages/components/src/subject-list/src/subject-list.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport SubjectBlankFill from './components/subject-blank-fill.vue'\nimport SubjectScale from './components/subject-scale.vue'\nimport SubjectSingle from './components/subject-single.vue'\nimport SubjectTextFill from './components/subject-text-fill.vue'\nimport SubjectRichText from './components/SubjectRichText.vue'\nimport SubjectPageEnd from './components/SubjectPageEnd.vue'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport { setGuid } from '@qxs-bns/utils'\n\ndefineOptions({\n name: 'QxsSubjectList',\n})\n\nconst props = defineProps<{\n subjectList: any[]\n isPreview: boolean\n}>()\nconst currentList = ref([] as any)\nconst emits = defineEmits(['setRelation'])\n\nconst attrs = useAttrs()\n\ndefineExpose({\n addSubject,\n currentList,\n uploadExcel,\n addExam,\n setAnswerRelation,\n})\n\nfunction totalPageIndex() {\n return currentList.value.filter((v: any) => v.answerType === 'page_end').length\n}\n\nconst currentPageIndex = computed(() => {\n const currentPageList = currentList.value.filter((v: any) => v.answerType === 'page_end')\n return (currentId: string) => {\n const currentIndex = currentPageList.findIndex((c: any) => c.customId === currentId)\n return currentIndex !== -1 ? currentIndex + 1 : 0\n }\n})\n\nfunction currentIndex() {\n return (currentExamId: string) => {\n let current = 0\n let output = 0\n\n // 遍历 currentList,过滤掉分页器,并计算题目序号\n currentList.value.forEach((v: any) => {\n if (v.answerType !== 'page_end') { // 排除分页器\n current++\n if (currentExamId === v.customId) { // 匹配当前题目 ID\n output = current\n }\n }\n })\n\n return output-1\n }\n}\n\nfunction addSubject(type: string, index: number | null = null, examAnswerRelationType: number | null = null) {\n const newSubject = {\n customId: setGuid(),\n answerType: type,\n analysis: '',\n scaleQuestionList: [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n examAnswerRelationType,\n }\n\n if (index !== null) {\n currentList.value.splice(index + 1, 0, newSubject)\n } else {\n currentList.value.push(newSubject)\n }\n}\nfunction addExam(items: any[]) {\n console.log(items, 'items')\n\n let currentIndex = 1\n const newList: any[] = []\n\n items.forEach((v: any) => {\n // 创建新的题目对象\n const newItem = {\n ...v,\n customId: setGuid(),\n answerType: v.richTextContent ? 'rich_text' : v.examTypeEnum,\n answers: v.answers?.map((c: any) => ({\n ...c,\n title: c.answer,\n answerId: c.examAnswerId,\n isCorrect: c.isCorrect,\n })) || [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n }\n\n // 如果当前题目的 pageIndex 和 currentIndex 不一致,则插入分页器\n if (newItem.pageIndex > currentIndex) {\n newList.push({\n customId: setGuid(),\n answerType: 'page_end',\n analysis: '',\n scaleQuestionList: [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n examAnswerRelationType: 0,\n })\n currentIndex = newItem.pageIndex\n }\n\n // 将题目添加到 newList\n newList.push(newItem)\n })\n\n // 更新 currentList\n currentList.value = currentList.value.concat(newList)\n}\nfunction uploadExcel(list: any[]) {\n currentList.value = currentList.value.concat(list)\n}\n\nfunction move(index: number, type: 'up' | 'down') {\n if (type === 'up' && index > 0) {\n const [item] = currentList.value.splice(index, 1)\n currentList.value.splice(index - 1, 0, item)\n } else if (type === 'down' && index < currentList.value.length - 1) {\n const [item] = currentList.value.splice(index, 1)\n currentList.value.splice(index + 1, 0, item)\n }\n}\n\nfunction saveSubject(index: number, item: any) {\n currentList.value[index] = {\n ...currentList.value[index],\n ...item,\n isEdit: false,\n examAnswerRelationType: item.examAnswerRelationType,\n }\n}\n\nfunction deleteSubject(index: number) {\n currentList.value.splice(index, 1)\n ElMessage.success('删除成功')\n}\n\nfunction setRelation(customId: number, examAnswers: any) {\n emits('setRelation', customId, examAnswers)\n}\n\nfunction setAnswerRelation(answerRelations: any, customId: string, customAnswerId: string) {\n const targetItem = currentList.value.find((v: any) => v.customId === customId)\n if (targetItem) {\n const targetAnswer = targetItem.answers?.find((c: any) => c.customAnswerId === customAnswerId)\n if (targetAnswer) {\n targetAnswer.answerRelations = answerRelations\n }\n }\n}\n\nwatch(() => props.subjectList, (newList: any) => {\n if (newList) {\n currentList.value = [...newList]\n }\n}, { immediate: true })\n\nconst ns = useNamespace('subject-list')\n</script>\n\n<template>\n <div :class=\"ns.e('list-exam')\">\n <div class=\"subject-list-wrapper\">\n <div v-for=\"(item, index) in currentList\" :key=\"item.customId\" class=\"subject-item\">\n <template v-if=\"['single', 'multiple', 'sort'].includes(item.answerType)\">\n <SubjectSingle\n v-bind=\"attrs\"\n :order-index=\"currentIndex()(item.customId)\"\n :title=\"item.title\"\n :type=\"item.answerType\"\n :exam-id=\"item.examId\"\n :isKey=\"item.isKey\"\n :is-save=\"!item.isRealCanDel\"\n :customId=\"item.customId\"\n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\"\n :analysis=\"item.analysis\"\n :least-answer-count=\"item.leastAnswerCount\"\n :is-edit=\"item.isEdit || false\"\n :show-action=\"!isPreview\"\n :exam-expand=\"item.examExpand\"\n :answerCheckType=\"item.answerCheckType\"\n :exam-rich-text-content=\"item.examRichTextContent\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n @setRelation=\"setRelation\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string, examAnswerRelationType: number) => addSubject(type, index, examAnswerRelationType)\"\n />\n </template>\n <SubjectScale\n v-bind=\"attrs\"\n v-else-if=\"item.answerType === 'scale'\"\n :order-index=\"currentIndex()(item.customId)\"\n :title=\"item.title\"\n :is-save=\"!item.isRealCanDel\"\n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\"\n :analysis=\"item.analysis\"\n :is-edit=\"item.isEdit || false\"\n :scale-question-list=\"item.scaleQuestionList\"\n :show-action=\"!isPreview\"\n :exam-rich-text-content=\"item.examRichTextContent\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n <SubjectBlankFill\n v-bind=\"attrs\"\n v-else-if=\"item.answerType === 'blank_fill'\"\n :order-index=\"currentIndex()(item.customId)\"\n :title=\"item.title\"\n :is-save=\"!item.isRealCanDel\"\n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\"\n :analysis=\"item.analysis\"\n :show-action=\"!isPreview\"\n :is-edit=\"item.isEdit || false\"\n :exam-answer-setting-v-o=\"item.examAnswerSettingVO || {}\"\n :exam-rich-text-content=\"item.examRichTextContent\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n <SubjectTextFill\n v-bind=\"attrs\"\n v-else-if=\"item.answerType === 'text_fill'\"\n :order-index=\"currentIndex()(item.customId)\"\n :title=\"item.title\"\n :is-save=\"!item.isRealCanDel\"\n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\"\n :analysis=\"item.analysis\"\n :show-action=\"!isPreview\"\n :is-edit=\"item.isEdit || false\"\n :exam-expand=\"item.examExpand\"\n :exam-answer-setting-v-o=\"item.examAnswerSettingVO || {}\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n :exam-rich-text-content=\"item.examRichTextContent\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n <SubjectRichText\n v-bind=\"attrs\"\n :order-index=\"currentIndex()(item.customId)\"\n v-else-if=\"item.answerType === 'rich_text'\"\n :richTextContent=\"item.richTextContent\"\n :is-set=\"item.hasSet || false\"\n :is-save=\"!item.isRealCanDel\"\n :is-edit=\"item.isEdit || false\"\n :show-action=\"!isPreview\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n <SubjectPageEnd\n v-else-if=\"item.answerType === 'page_end'\"\n :total-page=\"totalPageIndex()\"\n :key=\"index\"\n :current-page-index=\"currentPageIndex(item.customId)\"\n :item=\"item\"\n :is-edit=\"item.isEdit || false\"\n :is-set=\"item.hasSet || false\"\n :is-save=\"!item.isRealCanDel\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n </div>\n </div>\n </div>\n</template>"],"names":["props","__props","currentList","ref","emits","__emit","attrs","useAttrs","__expose","addSubject","uploadExcel","list","value","concat","addExam","items","console","log","currentIndex","newList","forEach","v","newItem","customId","setGuid","answerType","richTextContent","examTypeEnum","answers","map","c","title","answer","answerId","examAnswerId","isCorrect","isSave","isEdit","isRealCanDel","hasSet","pageIndex","push","analysis","scaleQuestionList","examAnswerRelationType","setAnswerRelation","answerRelations","customAnswerId","targetItem","find","targetAnswer","currentPageIndex","computed","currentPageList","filter","currentId","findIndex","currentExamId","current","output","type","index","newSubject","splice","move","item","length","saveSubject","deleteSubject","ElMessage","success","setRelation","examAnswers","watch","subjectList","immediate","ns","useNamespace"],"mappings":"s6BAcA,MAAMA,EAAQC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,GAAO,GAEhC,CAAEwD,WAAW,IAEV,MAAAC,EAAKC,EAAa,ixHAhJf3E,EAAYU,MAAM0C,QAAQjC,GAA4B,aAAjBA,EAAEI,aAA2ByC"}
|
1
|
+
{"version":3,"file":"subject-list.vue.mjs","sources":["../../../../../../packages/components/src/subject-list/src/subject-list.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport SubjectBlankFill from './components/subject-blank-fill.vue'\nimport SubjectScale from './components/subject-scale.vue'\nimport SubjectSingle from './components/subject-single.vue'\nimport SubjectTextFill from './components/subject-text-fill.vue'\nimport SubjectRichText from './components/SubjectRichText.vue'\nimport SubjectPageEnd from './components/SubjectPageEnd.vue'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport { setGuid } from '@qxs-bns/utils'\n\ndefineOptions({\n name: 'QxsSubjectList',\n})\n\nconst props = defineProps<{\n subjectList: any[]\n isPreview: boolean\n}>()\nconst currentList = ref([] as any)\nconst emits = defineEmits(['setRelation'])\n\nconst attrs = useAttrs()\n\ndefineExpose({\n addSubject,\n currentList,\n uploadExcel,\n addExam,\n setAnswerRelation,\n})\n\nfunction totalPageIndex() {\n return currentList.value.filter((v: any) => v.answerType === 'page_end').length\n}\n\nconst currentPageIndex = computed(() => {\n const currentPageList = currentList.value.filter((v: any) => v.answerType === 'page_end')\n return (currentId: string) => {\n const currentIndex = currentPageList.findIndex((c: any) => c.customId === currentId)\n return currentIndex !== -1 ? currentIndex + 1 : 0\n }\n})\n\nfunction currentIndex() {\n return (currentExamId: string) => {\n let current = 0\n let output = 0\n\n // 遍历 currentList,过滤掉分页器,并计算题目序号\n currentList.value.forEach((v: any) => {\n if (v.answerType !== 'page_end') { // 排除分页器\n current++\n if (currentExamId === v.customId) { // 匹配当前题目 ID\n output = current\n }\n }\n })\n\n return output-1\n }\n}\n\nfunction addSubject(type: string, index: number | null = null, examAnswerRelationType: number | null = null) {\n const newSubject = {\n customId: setGuid(),\n answerType: type,\n analysis: '',\n scaleQuestionList: [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n examAnswerRelationType,\n }\n\n if (index !== null) {\n currentList.value.splice(index + 1, 0, newSubject)\n } else {\n currentList.value.push(newSubject)\n }\n}\nfunction addExam(items: any[]) {\n console.log(items, 'items')\n\n let currentIndex = 1\n const newList: any[] = []\n\n items.forEach((v: any) => {\n // 创建新的题目对象\n const newItem = {\n ...v,\n customId: setGuid(),\n answerType: v.richTextContent ? 'rich_text' : v.examTypeEnum,\n answers: v.answers?.map((c: any) => ({\n ...c,\n title: c.answer,\n answerId: c.examAnswerId,\n isCorrect: c.isCorrect,\n })) || [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n }\n\n // 如果当前题目的 pageIndex 和 currentIndex 不一致,则插入分页器\n if (newItem.pageIndex > currentIndex) {\n newList.push({\n customId: setGuid(),\n answerType: 'page_end',\n analysis: '',\n scaleQuestionList: [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n examAnswerRelationType: 0,\n })\n currentIndex = newItem.pageIndex\n }\n\n // 将题目添加到 newList\n newList.push(newItem)\n })\n\n // 更新 currentList\n currentList.value = currentList.value.concat(newList)\n}\nfunction uploadExcel(list: any[]) {\n currentList.value = currentList.value.concat(list)\n}\n\nfunction move(index: number, type: 'up' | 'down') {\n if (type === 'up' && index > 0) {\n const [item] = currentList.value.splice(index, 1)\n currentList.value.splice(index - 1, 0, item)\n } else if (type === 'down' && index < currentList.value.length - 1) {\n const [item] = currentList.value.splice(index, 1)\n currentList.value.splice(index + 1, 0, item)\n }\n}\n\nfunction saveSubject(index: number, item: any) {\n currentList.value[index] = {\n ...currentList.value[index],\n ...item,\n isEdit: false,\n examAnswerRelationType: item.examAnswerRelationType,\n }\n}\n\nfunction deleteSubject(index: number) {\n currentList.value.splice(index, 1)\n ElMessage.success('删除成功')\n}\n\nfunction setRelation(customId: number, examAnswers: any) {\n emits('setRelation', customId, examAnswers)\n}\n\nfunction setAnswerRelation(answerRelations: any, customId: string, customAnswerId: string) {\n const targetItem = currentList.value.find((v: any) => v.customId === customId)\n if (targetItem) {\n const targetAnswer = targetItem.answers?.find((c: any) => c.customAnswerId === customAnswerId)\n if (targetAnswer) {\n targetAnswer.answerRelations = answerRelations\n }\n }\n}\n\nwatch(() => props.subjectList, (newList: any) => {\n if (newList) {\n currentList.value = [...newList]\n }\n}, { immediate: true })\n\nconst ns = useNamespace('subject-list')\n</script>\n\n<template>\n <div :class=\"ns.e('list-exam')\">\n <div class=\"subject-list-wrapper\">\n <div v-for=\"(item, index) in currentList\" :key=\"item.customId\" class=\"subject-item\">\n <template v-if=\"['single', 'multiple', 'sort'].includes(item.answerType)\">\n <SubjectSingle\n v-bind=\"attrs\"\n :order-index=\"currentIndex()(item.customId)\"\n :title=\"item.title\"\n :type=\"item.answerType\"\n :exam-id=\"item.examId\"\n :isKey=\"item.isKey\"\n :is-save=\"!item.isRealCanDel\"\n :customId=\"item.customId\"\n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\"\n :analysis=\"item.analysis\"\n :least-answer-count=\"item.leastAnswerCount\"\n :is-edit=\"item.isEdit || false\"\n :show-action=\"!isPreview\"\n :exam-expand=\"item.examExpand\"\n :answerCheckType=\"item.answerCheckType\"\n :exam-rich-text-content=\"item.examRichTextContent\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n @setRelation=\"setRelation\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string, examAnswerRelationType: number) => addSubject(type, index, examAnswerRelationType)\"\n />\n </template>\n <SubjectScale\n v-bind=\"attrs\"\n v-else-if=\"item.answerType === 'scale'\"\n :order-index=\"currentIndex()(item.customId)\"\n :title=\"item.title\"\n :is-save=\"!item.isRealCanDel\"\n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\"\n :analysis=\"item.analysis\"\n :is-edit=\"item.isEdit || false\"\n :scale-question-list=\"item.scaleQuestionList\"\n :show-action=\"!isPreview\"\n :exam-rich-text-content=\"item.examRichTextContent\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n <SubjectBlankFill\n v-bind=\"attrs\"\n v-else-if=\"item.answerType === 'blank_fill'\"\n :order-index=\"currentIndex()(item.customId)\"\n :title=\"item.title\"\n :is-save=\"!item.isRealCanDel\"\n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\"\n :analysis=\"item.analysis\"\n :show-action=\"!isPreview\"\n :is-edit=\"item.isEdit || false\"\n :exam-answer-setting-v-o=\"item.examAnswerSettingVO || {}\"\n :exam-rich-text-content=\"item.examRichTextContent\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n <SubjectTextFill\n v-bind=\"attrs\"\n v-else-if=\"item.answerType === 'text_fill'\"\n :order-index=\"currentIndex()(item.customId)\"\n :title=\"item.title\"\n :is-save=\"!item.isRealCanDel\"\n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\"\n :analysis=\"item.analysis\"\n :show-action=\"!isPreview\"\n :is-edit=\"item.isEdit || false\"\n :exam-expand=\"item.examExpand\"\n :exam-answer-setting-v-o=\"item.examAnswerSettingVO || {}\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n :exam-rich-text-content=\"item.examRichTextContent\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n <SubjectRichText\n v-bind=\"attrs\"\n :order-index=\"currentIndex()(item.customId)\"\n v-else-if=\"item.answerType === 'rich_text'\"\n :richTextContent=\"item.richTextContent\"\n :is-set=\"item.hasSet || false\"\n :is-save=\"!item.isRealCanDel\"\n :is-edit=\"item.isEdit || false\"\n :show-action=\"!isPreview\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n <SubjectPageEnd\n v-else-if=\"item.answerType === 'page_end'\"\n :total-page=\"totalPageIndex()\"\n :key=\"index\"\n :current-page-index=\"currentPageIndex(item.customId)\"\n :item=\"item\"\n :is-edit=\"item.isEdit || false\"\n :is-set=\"item.hasSet || false\"\n :is-save=\"!item.isRealCanDel\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n </div>\n </div>\n </div>\n</template>"],"names":["props","__props","currentList","ref","emits","__emit","attrs","useAttrs","__expose","addSubject","uploadExcel","list","value","concat","addExam","items","console","log","currentIndex","newList","forEach","v","newItem","customId","setGuid","answerType","richTextContent","examTypeEnum","answers","map","c","title","answer","answerId","examAnswerId","isCorrect","isSave","isEdit","isRealCanDel","hasSet","pageIndex","push","analysis","scaleQuestionList","examAnswerRelationType","setAnswerRelation","answerRelations","customAnswerId","targetItem","find","targetAnswer","currentPageIndex","computed","currentPageList","filter","currentId","findIndex","currentExamId","current","output","type","index","newSubject","splice","move","item","length","saveSubject","deleteSubject","ElMessage","success","setRelation","examAnswers","watch","subjectList","immediate","ns","useNamespace"],"mappings":"ihCAcA,MAAMA,EAAQC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,GAAO,GAEhC,CAAEwD,WAAW,IAEV,MAAAC,EAAKC,EAAa,ixHAhJf3E,EAAYU,MAAM0C,QAAQjC,GAA4B,aAAjBA,EAAEI,aAA2ByC"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{defineComponent as e,ref as l,createElementBlock as t,openBlock as s,normalizeClass as
|
1
|
+
import{defineComponent as e,ref as l,createElementBlock as t,openBlock as s,normalizeClass as a,unref as i,createElementVNode as c,Fragment as p,renderList as n,toDisplayString as y}from"vue";import{useNamespace as b}from"@qxs-bns/hooks";const u={class:"type-item"},m={class:"base-subject"},o=["onClick"],d={class:"type-item"},v={class:"base-subject flex"},r=["onClick"],k={class:"type-item"},f={class:"base-subject flex"},x=["onClick"];var j=e({name:"QxsSubjectType",__name:"subject-type",emits:["select"],setup(e,{emit:j}){const C=j,_=l([{type:"single",label:"单选题"},{type:"multiple",label:"多选题"},{type:"blank_fill",label:"填空题"},{type:"text_fill",label:"问答题"},{type:"scale",label:"量表题"},{type:"sort",label:"排序题"}]),g=l([{type:"rich_text",label:"富文本"},{type:"page_end",label:"分页器"}]),h=l([{type:"single",label:"单选题"},{type:"multiple",label:"多选题"}]),q=b("subject-type");return(e,l)=>(s(),t("div",{class:a(i(q).e("type-list"))},[c("div",u,[l[0]||(l[0]=c("div",null,"普通题目类型",-1)),c("div",m,[(s(!0),t(p,null,n(i(_),(e=>(s(),t("div",{key:e.type,class:"item flex-center",onClick:l=>C("select",e.type)},[c("span",null,y(e.label),1)],8,o)))),128))])]),c("div",d,[l[1]||(l[1]=c("div",null,"其他",-1)),c("div",v,[(s(!0),t(p,null,n(i(g),(e=>(s(),t("div",{key:e.type,class:"item flex-center",onClick:l=>C("select",e.type)},[c("span",null,y(e.label),1)],8,r)))),128))])]),c("div",k,[l[2]||(l[2]=c("div",null,"互动问答类型(支持设置结果项)",-1)),c("div",f,[(s(!0),t(p,null,n(i(h),(e=>(s(),t("div",{key:e.type,class:"item flex-center",onClick:l=>C("select",e.type,!0)},[c("span",null,y(e.label),1)],8,x)))),128))])])],2))}});export{j as default};
|
2
2
|
//# sourceMappingURL=subject-type.vue.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../../packages/components/src/tiny-mce-editor/index.ts"],"sourcesContent":["import { withInstall } from '../withInstall'\nimport component from './src/tiny-mce-editor.vue'\n\nconst QxsTinyMceEditor = withInstall(component)\n
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../packages/components/src/tiny-mce-editor/index.ts"],"sourcesContent":["import { withInstall } from '../withInstall'\nimport component from './src/tiny-mce-editor.vue'\n\nconst QxsTinyMceEditor = withInstall(component)\n\nexport {\n QxsTinyMceEditor,\n}\n\nexport default QxsTinyMceEditor\n"],"names":["QxsTinyMceEditor","withInstall","component"],"mappings":"8FAGA,MAAMA,EAAmBC,EAAYC"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{defineComponent as e,
|
1
|
+
import{defineComponent as e,shallowRef as t,ref as i,computed as n,watch as o,onMounted as a,onBeforeUnmount as l,createElementBlock as r,openBlock as s,normalizeClass as m,unref as u,createCommentVNode as p,withDirectives as c,createElementVNode as d,isRef as g,vModelText as y}from"vue";import{useNamespace as f}from"@qxs-bns/hooks";import{merge as h}from"lodash-es";import v from"tinymce/tinymce";import"tinymce/themes/silver/theme";import"tinymce/icons/default/icons";import"tinymce/models/dom";import"tinymce/plugins/autolink";import"tinymce/plugins/autoresize";import"tinymce/plugins/fullscreen";import"tinymce/plugins/image";import"tinymce/plugins/insertdatetime";import"tinymce/plugins/link";import"tinymce/plugins/lists";import"tinymce/plugins/media";import"tinymce/plugins/preview";import"tinymce/plugins/table";import"tinymce/plugins/wordcount";import"tinymce/plugins/code";import"tinymce/plugins/searchreplace";import"tinymce/plugins/nonbreaking";const b=["id","name"];var k=e({name:"QxsTinyMceEditor",__name:"tiny-mce-editor",props:{modelValue:{type:String,required:!0,default:""},config:{type:Object,required:!1,default:()=>({})},assetsBasePath:{type:String,required:!1,default:""}},emits:["update:modelValue"],setup(e,{emit:k}){const _=k,x=f("tiny-mce-editor"),w=e.assetsBasePath||"node_modules/",S=t(null),V=i(`tiny-mce-textarea-${Date.now()}-${Math.random().toString(36).substr(2,9)}`),$=n({get:()=>e.modelValue,set(e){_("update:modelValue",e)}}),z={selector:`textarea#${V.value}`,promotion:!1,license_key:"gpl",elementpath:!1,language:"zh-Hans",language_url:`${w}tinymce/langs/zh-Hans.js`,skin_url:`${w}tinymce/skins/ui/oxide`,content_css:`${w}tinymce/skins/content/default/content.min.css`,min_height:300,max_height:700,plugins:"autolink autoresize fullscreen image insertdatetime link lists media preview table wordcount code searchreplace nonbreaking",toolbar:"undo redo | bold italic underline strikethrough | blocks | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | forecolor backcolor removeformat | link image media table insertdatetime searchreplace | preview code",branding:!1,autoresize:!0,menubar:!1,nonbreaking_force_tab:!0,toolbar_mode:"sliding",insertdatetime_formats:["%Y年%m月%d日","%H点%M分%S秒","%Y-%m-%d","%H:%M:%S"],setup:t=>{S.value=t,t.on("input change undo redo",(()=>{$.value=t.getContent()})),t.on("init",(()=>{t.setContent($.value)})),e.config?.expandSetup?.(t)}},q=n((()=>{const t=z;return e.config.images_upload_handler||("string"==typeof t.plugins?t.plugins=t.plugins.replace("image",""):Array.isArray(t.plugins)&&(t.plugins=t.plugins.filter((e=>"image"!==e)))),h(t,e.config)}));return o((()=>e.modelValue),(e=>{S.value&&e!==S.value.getContent()&&S.value.setContent(e)}),{immediate:!0}),a((async()=>{"undefined"!=typeof window&&v.init(q.value)})),l((()=>{S.value&&(S.value.destroy(),S.value=null)})),(e,t)=>(s(),r("div",{class:m(u(x).e("tiny-mce"))},[p(" 使用动态生成的 id "),c(d("textarea",{id:u(V),"onUpdate:modelValue":t[0]||(t[0]=e=>g($)?$.value=e:null),name:u(V)},null,8,b),[[y,u($)]])],2))}});export{k as default};
|
2
2
|
//# sourceMappingURL=tiny-mce-editor.vue.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"tiny-mce-editor.vue.mjs","sources":["../../../../../../packages/components/src/tiny-mce-editor/src/tiny-mce-editor.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Editor, RawEditorOptions } from
|
1
|
+
{"version":3,"file":"tiny-mce-editor.vue.mjs","sources":["../../../../../../packages/components/src/tiny-mce-editor/src/tiny-mce-editor.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Editor, RawEditorOptions } from 'tinymce/tinymce'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport { merge } from 'lodash-es'\nimport tinymce from 'tinymce/tinymce'\n\n// 导入核心功能\nimport 'tinymce/themes/silver/theme'\nimport 'tinymce/icons/default/icons'\nimport 'tinymce/models/dom'\n\nimport 'tinymce/plugins/autolink'\nimport 'tinymce/plugins/autoresize'\nimport 'tinymce/plugins/fullscreen'\nimport 'tinymce/plugins/image'\nimport 'tinymce/plugins/insertdatetime'\nimport 'tinymce/plugins/link'\nimport 'tinymce/plugins/lists'\nimport 'tinymce/plugins/media'\nimport 'tinymce/plugins/preview'\nimport 'tinymce/plugins/table'\nimport 'tinymce/plugins/wordcount'\nimport 'tinymce/plugins/code'\nimport 'tinymce/plugins/searchreplace'\nimport 'tinymce/plugins/nonbreaking'\n// 导入语言包\n\ndefineOptions({\n name: 'QxsTinyMceEditor',\n})\n\nconst {\n modelValue = '',\n config = {},\n assetsBasePath = '',\n} = defineProps<{\n modelValue: string\n config?: RawEditorOptions & {\n expandSetup?: RawEditorOptions['setup']\n }\n assetsBasePath?: string\n}>()\n\nconst emit = defineEmits(['update:modelValue'])\n\nconst ns = useNamespace('tiny-mce-editor')\n\nconst colorScheme = 'light'\nconst basePath = assetsBasePath || 'node_modules/'\n// 存储编辑器实例的引用\nconst editorInstance = shallowRef<Editor | null>(null)\n// 生成唯一的 id\nconst uniqueId = ref(\n `tiny-mce-textarea-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,\n)\n\nconst content = computed({\n get() {\n return modelValue\n },\n set(val) {\n emit('update:modelValue', val)\n },\n})\n\nconst defaultSetting: RawEditorOptions = {\n // 使用动态生成的 id\n selector: `textarea#${uniqueId.value}`,\n promotion: false, // 禁用推广信息\n license_key: 'gpl',\n elementpath: false,\n language: 'zh-Hans',\n language_url: `${basePath}tinymce/langs/zh-Hans.js`,\n skin_url: `${basePath}${\n colorScheme === 'light' ? 'tinymce/skins/ui/oxide' : 'tinymce/skins/ui/oxide-dark'\n }`,\n content_css: `${basePath}${\n colorScheme === 'light'\n ? 'tinymce/skins/content/default/content.min.css'\n : 'tinymce/skins/content/dark/content.min.css'\n }`,\n min_height: 300,\n max_height: 700,\n plugins:\n 'autolink autoresize fullscreen image insertdatetime link lists media preview table wordcount code searchreplace nonbreaking',\n toolbar:\n 'undo redo | bold italic underline strikethrough | blocks | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | forecolor backcolor removeformat | link image media table insertdatetime searchreplace | preview code',\n branding: false,\n autoresize: true,\n menubar: false,\n nonbreaking_force_tab: true,\n toolbar_mode: 'sliding',\n insertdatetime_formats: [\n '%Y年%m月%d日',\n '%H点%M分%S秒',\n '%Y-%m-%d',\n '%H:%M:%S',\n ],\n // https://www.tiny.cloud/docs/tinymce/6/file-image-upload/#images_upload_handler\n // images_upload_handler: async (blobInfo: any, progress: any) => {\n // // blobInfo, succFun, failFun, progress\n // const files = blobInfo.blob()\n // const formData = new FormData()\n // formData.append('image', files)\n\n // const { res, error } = await useApi({\n // // ...commonUrls.uploadImage,\n // params: {\n // bucketType: classify,\n // },\n // data: formData,\n // onUploadProgress: (e: any) => {\n // progress((e.loaded / e.total) * 100)\n // },\n // })\n // if (res) {\n // const { normal } = res\n // console.log('normal: ', res)\n // return normal\n // }\n // if (error) {\n // console.log(error.message)\n // return Promise.reject(error.message)\n // }\n // },\n setup: (editor: Editor) => {\n // 保存编辑器实例\n editorInstance.value = editor\n\n // 监听编辑器内容变化\n editor.on('input change undo redo', () => {\n content.value = editor.getContent()\n })\n\n // 编辑器初始化完成后设置内容\n editor.on('init', () => {\n editor.setContent(content.value)\n })\n\n config?.expandSetup?.(editor)\n },\n}\n\nconst initSetting = computed(() => {\n const dealDefaultSetting = defaultSetting\n if (!config.images_upload_handler) {\n // 删除 image 图片 plugin\n if (typeof dealDefaultSetting.plugins === 'string') {\n dealDefaultSetting.plugins = dealDefaultSetting.plugins.replace(\n 'image',\n '',\n )\n }\n else if (Array.isArray(dealDefaultSetting.plugins)) {\n dealDefaultSetting.plugins = dealDefaultSetting.plugins.filter(\n plugin => plugin !== 'image',\n )\n }\n }\n return merge(dealDefaultSetting, config)\n})\n\n// 监听 modelValue 的变化\nwatch(() => modelValue, (newVal) => {\n // 确保编辑器已初始化且内容确实发生变化\n if (editorInstance.value && newVal !== editorInstance.value.getContent()) {\n editorInstance.value.setContent(newVal)\n }\n}, { immediate: true })\n\nonMounted(async () => {\n if (typeof window !== 'undefined') {\n tinymce.init(initSetting.value)\n }\n})\n\n// 组件卸载时清理\nonBeforeUnmount(() => {\n if (editorInstance.value) {\n editorInstance.value.destroy()\n editorInstance.value = null\n }\n})\n</script>\n\n<template>\n <div :class=\"ns.e('tiny-mce')\">\n <!-- 使用动态生成的 id -->\n <textarea\n :id=\"uniqueId\"\n v-model=\"content\"\n :name=\"uniqueId\"\n />\n </div>\n</template>\n"],"names":["emit","__emit","ns","useNamespace","basePath","__props","assetsBasePath","editorInstance","shallowRef","uniqueId","ref","Date","now","Math","random","toString","substr","content","computed","get","modelValue","set","val","defaultSetting","selector","value","promotion","license_key","elementpath","language","language_url","skin_url","content_css","min_height","max_height","plugins","toolbar","branding","autoresize","menubar","nonbreaking_force_tab","toolbar_mode","insertdatetime_formats","setup","editor","on","getContent","setContent","config","expandSetup","initSetting","dealDefaultSetting","images_upload_handler","replace","Array","isArray","filter","plugin","merge","watch","newVal","immediate","onMounted","async","window","tinymce","init","onBeforeUnmount","destroy"],"mappings":"2tCA2CA,MAAMA,EAAOC,EAEPC,EAAK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DC,EAAAC,KAAKhB,EAAYzB,MAAK,IAKlC0C,GAAgB,KACV5D,EAAekB,QACjBlB,EAAekB,MAAM2C,UACrB7D,EAAekB,MAAQ,KAAA"}
|
package/es/src/withInstall.mjs
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
function
|
1
|
+
function n(n,o){return n.install=o=>{for(const t of[n,...Object.values({})])o.component(t.name,t)},n}export{n as withInstall};
|
2
2
|
//# sourceMappingURL=withInstall.mjs.map
|
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.default=(e,t)=>{const o=e.__vccOpts||e;for(const[e,
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.default=(e,t)=>{const o=e.__vccOpts||e;for(const[e,r]of t)o[e]=r;return o};
|
2
2
|
//# sourceMappingURL=_plugin-vue_export-helper.cjs.map
|
package/lib/index.cjs
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./src/defaults.cjs"),
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./src/defaults.cjs"),s=require("./src/data-chart/index.cjs"),r=require("./src/file-upload/index.cjs"),t=require("./src/fixed-action-bar/index.cjs"),o=require("./src/image-upload/index.cjs"),i=require("./src/photo-crop-tool/index.cjs"),c=require("./src/subject-action/index.cjs"),x=require("./src/subject-layout/index.cjs"),u=require("./src/subject-list/index.cjs"),a=require("./src/subject-type/index.cjs"),d=require("./src/tiny-mce-editor/index.cjs");const p=e.default.install,l=e.default.version;exports.default=e.default,exports.QxsDataChart=s.QxsDataChart,exports.QxsFileUpload=r.QxsFileUpload,exports.QxsFixedActionBar=t.QxsFixedActionBar,exports.QxsImageUpload=o.QxsImageUpload,exports.QxsPhotoCropTool=i.QxsPhotoCropTool,exports.QxsSubjectAction=c.QxsSubjectAction,exports.QxsSubjectLayout=x.QxsSubjectLayout,exports.QxsSubjectList=u.QxsSubjectList,exports.QxsSubjectType=a.QxsSubjectType,exports.QxsTinyMceEditor=d.QxsTinyMceEditor,exports.install=p,exports.version=l;
|
2
2
|
//# sourceMappingURL=index.cjs.map
|