@qxs-bns/components 0.0.28 → 0.0.29

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.
@@ -1 +1 @@
1
- {"version":3,"file":"subject-single.vue.cjs","sources":["../../../../../../../packages/components/src/subject-list/src/components/subject-single.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { CirclePlus, Remove } from '@element-plus/icons-vue'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport SubjectAction from '../../../subject-action/src/subject-action.vue'\nimport SubjectLayout from '../../../subject-layout/src/subject-layout.vue'\nimport TinyMceEditor from '../../../tiny-mce-editor/src/tiny-mce-editor.vue'\nimport { setGuid } from '@qxs-bns/utils'\n\ndefineOptions({\n name: 'QxsSubjectSingle',\n})\nconst props = defineProps<{\n orderIndex: number\n title?: string\n isSave: boolean\n showAction?: boolean\n type: 'single' | 'multiple' | 'sort'\n isEdit: boolean\n isSet: boolean\n answerList?: any\n leastAnswerCount?: number\n analysis?: string\n examExpand?: string\n examRichTextContent?: string\n showAnalysis?: boolean\n examAnswerRelationType?: number\n customId?: number\n examId?: number\n isKey: boolean\n answerCheckType: number\n}>()\nconst emits = defineEmits(['move', 'save', 'delete', 'edit', 'add', 'setRelation'])\n\nconst attrs = useAttrs()\n\nconst answersIndex = ref(0)\nconst isKey = ref(props.isKey)\nconst answerCheckType = ref(props.answerCheckType)\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 title: '',\n isCorrect: false,\n}])\n\nconst leastAnswerCount = ref()\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 emits('setRelation', props.examId, 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 let msg = ''\n let isSetCorrectAnswer = false\n let examAnswerRelationType = null\n let correctAnswerCount = 0\n if (props.type === 'multiple' || props.type === 'single') {\n answers.value.forEach((v: any, i: number) => {\n if (!v.title) {\n msg += `选项${String.fromCharCode(65 + i)}未填写。`\n }\n if (v.isCorrect) {\n isSetCorrectAnswer = true\n correctAnswerCount++\n }\n if (v.resultItem) {\n examAnswerRelationType = 1\n }\n if (v.answerRelations?.length) {\n examAnswerRelationType = 2\n }\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 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,\n isKey: isKey.value,\n answerCheckType: answerCheckType.value\n })\n}\n\nfunction init() {\n if (props.title) {\n title.value = props.title\n }\n // const customId = props.id || setGuid()\n\n if (props.answerCheckType) {\n answerCheckType.value = props.answerCheckType\n }\n\n if (props.answerList && props.answerList.length) {\n answers.value = props.answerList.map((item: any) => {\n return { ...item, customAnswerId: item.examAnswerId || setGuid() }\n })\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}\n\nfunction onCloseResult() {\n showRichContent.value = false\n resultItem.value = ''\n}\n\nfunction onOpenResult(i: number) {\n answersIndex.value = i\n // console.log(answers.value[i].resultItem, 1);\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}\n\nfunction setKey(key: boolean) {\n isKey.value = key\n}\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})\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\"\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\"\n type=\"primary\"\n class=\"margin-left-10\"\n @click=\"setRelation(item)\"\n >\n <span>{{ item.answerRelations?.length ? `关联了${item.answerRelations?.length}项` : '关联检查' }}</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 mode=\"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 :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=\"(answers[answersIndex].resultItem as string)\" \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","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","examAnswerRelationType","correctAnswerCount","forEach","v","i","String","fromCharCode","answerRelations","Set","map","item","size","index","orderIndex","examExpand","charCodeAt","join","examRichTextContent","onCloseResult","onSaveResult","setKey","key","setAnswerSetting","add","canSet","watch","isEdit","Date","getTime","ns","useNamespace","onMounted","answerList","examAnswerId","correctAnswerIdList","split","id","answer","find","answerId","toString","filter","Boolean","it","event","splice","examId","customId"],"mappings":"8sDAWA,MAAMA,EAAQC,EAoBRC,EAAQC,EAERC,EAAQC,EAAAA,WAERC,EAAeC,MAAI,GACnBC,EAAQD,EAAAA,IAAIP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MwF,OAAQxF,EAAMyF,SAAUrC,EAAI"}
1
+ {"version":3,"file":"subject-single.vue.cjs","sources":["../../../../../../../packages/components/src/subject-list/src/components/subject-single.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { CirclePlus, Remove } from '@element-plus/icons-vue'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport 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'\nimport { ElMessage } from 'element-plus'\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(false)\nconst answerCheckType = ref(1)\nconst examAnswerRelationType = ref(1)\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()\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 let msg = ''\n let isSetCorrectAnswer = false\n // let examAnswerRelationType = null\n let correctAnswerCount = 0\n if (props.type === 'multiple' || props.type === 'single') {\n answers.value.forEach((v: any, i: number) => {\n if (!v.title) {\n msg += `选项${String.fromCharCode(65 + i)}未填写。`\n }\n if (v.isCorrect) {\n isSetCorrectAnswer = true\n correctAnswerCount++\n }\n // if (v.resultItem) {\n // examAnswerRelationType = 1\n // }\n // if (v.answerRelations?.length) {\n // examAnswerRelationType = 2\n // }\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 console.log(answerCheckType.value, 111)\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 // const customId = props.id || setGuid()\n\n if (props.answerCheckType) {\n answerCheckType.value = props.answerCheckType\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\"\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\"\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 mode=\"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 :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","String","fromCharCode","Set","map","item","size","console","log","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":"wuDAYA,MAAMA,EAAQC,EAoBRC,EAAQC,EAERC,EAAQC,EAAAA,WAERC,EAAeC,MAAI,GACnBC,EAAQD,OAAI,GACZE,EAAkBF,MAAI,GACtBG,EAAyBH,MAAI,GAC7BI,EAAUJ,EAAAA,IAaX,CAAC,CACJK,MAAO,GACPC,WAAW,GACV,CACDD,MAAO,GACPC,WAAW,GACV,CACDD,MAAO,GACPC,WAAW,GACV,CACDD,MAAO,GACPC,WAAW,KAGPC,EAAmBP,EAAAA,MACnBK,EAAQL,MAAI,IACZQ,EAAWR,MAAI,IACfS,EAAeT,OAAI,GACnBU,EAAWV,MAAI,IACfW,EAAYX,MAAI,GAChBY,EAAkBZ,OAAI,GACtBa,EAAab,MAAY,IACzBc,EAAmBC,EAAAA,UAAS,IACb,WAAftB,EAAMuB,KACD,MAEe,aAAfvB,EAAMuB,KACN,MAGA,QAILC,EAAYjB,EAAcA,IAAA,IAE1BkB,EAAqBH,EAAAA,UAAS,KAClC,MAAMI,EAAQ,GAEd,IAAA,IAASC,EADMhB,EAAQiB,MAAMC,OACJF,EAAQ,EAAGA,IAClCD,EAAMI,KAAK,CACTC,MAAO,OAAOJ,KACdC,MAAOD,IAGX,OAAOD,EAAMM,SAAQ,IAEvB,SAASC,IACHjC,EAAMkC,QAGVvB,EAAQiB,MAAME,KAAK,CACjBlB,MAAO,GACPC,WAAW,EACXsB,eAAgBC,EAAQA,WACzB,CA+BH,SAASC,IACPrB,EAAaY,OAAQ,EACrBX,EAASW,MAAQ,EAAA,CAGnB,SAASU,IACH,IAAC1B,EAAMgB,MAET,YADAW,EAAAA,UAAUC,MAAM,aAGlB,IAAIC,EAAM,GACNC,GAAqB,EAErBC,EAAqB,EAwBzB,GAvBmB,aAAf3C,EAAMuB,MAAsC,WAAfvB,EAAMuB,KACrCZ,EAAQiB,MA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5B,EAAM4D,oBACvB5C,EAAaY,OAAQ,EACvB,69IAzJO,SAAW2D,EAASC,GACR,WAAfxF,EAAMuB,MAEJiE,GACM7E,EAAAiB,MAAMgB,SAASqC,IACjBA,IAAWM,IACbN,EAAOpE,WAAY,EAAA,IAIzB0E,EAAG1E,UAAY2E,GACS,aAAfxF,EAAMuB,OAEfgE,EAAG1E,UAAY2E,EACjB,6hBArBF,SAAsBjC,GAChB5C,EAAQiB,MAAMC,OAAS,GAAK7B,EAAMkC,QAG9BvB,EAAAiB,MAAM6D,OAAOlC,EAAO,EAAC,+JA8JTT,IACpBxC,EAAasB,MAAQkB,EACrB1B,EAAWQ,MAAQjB,EAAQiB,MAAMkB,GAAG1B,YAAc,QAClDD,EAAgBS,OAAQ,GAH1B,IAAsBkB,iRA3ItB,SAAqBK,GACdA,EAAAhB,eAAiBgB,EAAKuC,cAAgBtD,EAAAA,UACrClC,EAAA,cAAeF,EAAM2F,SAAUxC,EAAI"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue"),t=require("./components/subject-blank-fill.vue.cjs"),n=require("./components/subject-scale.vue.cjs"),s=require("./components/subject-single.vue.cjs"),i=require("./components/subject-text-fill.vue.cjs"),a=require("./components/SubjectRichText.vue.cjs"),o=require("./components/SubjectPageEnd.vue.cjs"),l=require("@qxs-bns/hooks"),r=require("@qxs-bns/utils"),c=require("vue-demi"),d=require("element-plus/es");const u={class:"subject-list-wrapper"};var x=e.defineComponent({name:"QxsSubjectList",__name:"subject-list",props:{subjectList:{type:Array,required:!0},isPreview:{type:Boolean,required:!0}},emits:["setRelation"],setup(x,{expose:p,emit:m}){const w=x,v=c.ref([]),y=m,h=c.useAttrs();function f(){let e=0,t=!1;return v.value.map(((n,s,i)=>{"page_end"===n.answerType&&(e++,t=s===i.length-1)})),t?e:e+1}function T(e,t,n){console.log(t,"index"),t||0===t?v.value.splice(t+1,0,{customId:r.setGuid(),answerType:e,analysis:"",scaleQuestionList:[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1,examAnswerRelationType:n}):v.value.push({customId:r.setGuid(),answerType:e,analysis:"",scaleQuestionList:[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1,examAnswerRelationType:n})}function E(e,t){if("up"===t&&e>0){const[t]=v.value.splice(e,1);v.value.splice(e-1,0,t)}else if("down"===t&&e<v.value.length-1){const[t]=v.value.splice(e,1);v.value.splice(e+1,0,t)}}function A(e,t){for(let n=0;n<v.value.length;n++)e===n&&(v.value[e]={...v.value[e],...t,isEdit:!1})}function R(e){v.value.splice(e,1),d.ElMessage.success("删除成功")}function k(e,t){y("setRelation",e,t)}p({addSubject:T,currentList:v,uploadExcel:function(e){v.value=v.value.concat(e)},addExam:function(e){const t=[];e.answers?.map((e=>{t.push({...e,title:e.answer,answerId:e.examAnswerId,isCorrect:e.isCorrect})})),v.value.push({...e,customId:r.setGuid(),answerType:e.richTextContent?"rich_text":e.examTypeEnum,answers:t,isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1})},setAnswerRelation:function(e,t,n){console.log(e,t,n,111),console.log(v.value,222),e.length&&v.value.forEach((s=>{s.customId===t&&s.answer.forEach((t=>{t.customAnswerId===n&&(t.answerRelations=e)}))}))}}),c.watch((()=>w.subjectList),(e=>{e&&(v.value=[...e])}),{immediate:!0});const S=l.useNamespace("subject-list");return(l,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(S).e("list-exam"))},[e.createElementVNode("div",u,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(v),((r,c)=>(e.openBlock(),e.createElementBlock("div",{key:c+r.examId||r.title},[["single","multiple","sort"].includes(r.answerType)?(e.openBlock(),e.createBlock(s.default,e.mergeProps({key:0,ref_for:!0},e.unref(h),{"order-index":c,title:r.title,type:r.answerType,"exam-id":r.examId,isKey:r.isKey,"is-save":!r.isRealCanDel,customId:r.customId,"is-set":r.hasSet||!1,"answer-list":r.answers,analysis:r.analysis,"least-answer-count":r.leastAnswerCount,"is-edit":r.isEdit||!1,"show-action":!l.isPreview,"exam-expand":r.examExpand,answerCheckType:r.answerCheckType,"exam-rich-text-content":r.examRichTextContent,examAnswerRelationType:r.examAnswerRelationType,onSetRelation:k,onMove:e=>E(c,e),onDelete:e=>R(c),onSave:e=>A(c,e),onEdit:e=>r.isEdit=!0,onAdd:(e,t)=>T(e,c,t)}),null,16,["order-index","title","type","exam-id","isKey","is-save","customId","is-set","answer-list","analysis","least-answer-count","is-edit","show-action","exam-expand","answerCheckType","exam-rich-text-content","examAnswerRelationType","onMove","onDelete","onSave","onEdit","onAdd"])):"scale"===r.answerType?(e.openBlock(),e.createBlock(n.default,e.mergeProps({key:1,ref_for:!0},e.unref(h),{"order-index":c,title:r.title,"is-save":!r.isRealCanDel,"is-set":r.hasSet||!1,"answer-list":r.answers,analysis:r.analysis,"is-edit":r.isEdit||!1,"scale-question-list":r.scaleQuestionList,"show-action":!l.isPreview,"exam-rich-text-content":r.examRichTextContent,examAnswerRelationType:r.examAnswerRelationType,onMove:e=>E(c,e),onDelete:e=>R(c),onSave:e=>A(c,e),onEdit:e=>r.isEdit=!0,onAdd:e=>T(e,c,null)}),null,16,["order-index","title","is-save","is-set","answer-list","analysis","is-edit","scale-question-list","show-action","exam-rich-text-content","examAnswerRelationType","onMove","onDelete","onSave","onEdit","onAdd"])):"blank_fill"===r.answerType?(e.openBlock(),e.createBlock(t.default,e.mergeProps({key:2,ref_for:!0},e.unref(h),{"order-index":c,title:r.title,"is-save":!r.isRealCanDel,"is-set":r.hasSet||!1,"answer-list":r.answers,analysis:r.analysis,"show-action":!l.isPreview,"is-edit":r.isEdit||!1,"exam-answer-setting-v-o":r.examAnswerSettingVO||{},"exam-rich-text-content":r.examRichTextContent,examAnswerRelationType:r.examAnswerRelationType,onMove:e=>E(c,e),onDelete:e=>R(c),onSave:e=>A(c,e),onEdit:e=>r.isEdit=!0,onAdd:e=>T(e,c,null)}),null,16,["order-index","title","is-save","is-set","answer-list","analysis","show-action","is-edit","exam-answer-setting-v-o","exam-rich-text-content","examAnswerRelationType","onMove","onDelete","onSave","onEdit","onAdd"])):"text_fill"===r.answerType?(e.openBlock(),e.createBlock(i.default,e.mergeProps({key:3,ref_for:!0},e.unref(h),{"order-index":c,title:r.title,"is-save":!r.isRealCanDel,"is-set":r.hasSet||!1,"answer-list":r.answers,analysis:r.analysis,"show-action":!l.isPreview,"is-edit":r.isEdit||!1,"exam-expand":r.examExpand,"exam-answer-setting-v-o":r.examAnswerSettingVO||{},examAnswerRelationType:r.examAnswerRelationType,"exam-rich-text-content":r.examRichTextContent,onMove:e=>E(c,e),onDelete:e=>R(c),onSave:e=>A(c,e),onEdit:e=>r.isEdit=!0,onAdd:e=>T(e,c,null)}),null,16,["order-index","title","is-save","is-set","answer-list","analysis","show-action","is-edit","exam-expand","exam-answer-setting-v-o","examAnswerRelationType","exam-rich-text-content","onMove","onDelete","onSave","onEdit","onAdd"])):"rich_text"===r.answerType?(e.openBlock(),e.createBlock(a.default,e.mergeProps({key:4,ref_for:!0},e.unref(h),{"order-index":c,richTextContent:r.richTextContent,"is-set":r.hasSet||!1,"is-save":!r.isRealCanDel,"is-edit":r.isEdit||!1,"show-action":!l.isPreview,onMove:e=>E(c,e),onDelete:e=>R(c),examAnswerRelationType:r.examAnswerRelationType,onSave:e=>A(c,e),onEdit:e=>r.isEdit=!0,onAdd:e=>T(e,c,null)}),null,16,["order-index","richTextContent","is-set","is-save","is-edit","show-action","onMove","onDelete","examAnswerRelationType","onSave","onEdit","onAdd"])):"page_end"===r.answerType?(e.openBlock(),e.createBlock(o.default,{"total-page":f(),key:c,"current-page-index":(e=>{const t=v.value.filter((e=>"page_end"===e.answerType));let n=0;return t.forEach(((t,s)=>{e===t.id&&(n=s+1)})),n})(r.id),item:r,"order-index":c,"is-edit":r.isEdit||!1,"is-set":r.hasSet||!1,"is-save":!r.isRealCanDel,examAnswerRelationType:r.examAnswerRelationType,onMove:e=>E(c,e),onDelete:e=>R(c),onSave:e=>A(c,e),onEdit:e=>r.isEdit=!0,onAdd:e=>T(e,c,null)},null,8,["total-page","current-page-index","item","order-index","is-edit","is-set","is-save","examAnswerRelationType","onMove","onDelete","onSave","onEdit","onAdd"])):e.createCommentVNode("v-if",!0)])))),128))])],2))}});exports.default=x;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue"),t=require("./components/subject-blank-fill.vue.cjs"),n=require("./components/subject-scale.vue.cjs"),s=require("./components/subject-single.vue.cjs"),i=require("./components/subject-text-fill.vue.cjs"),a=require("./components/SubjectRichText.vue.cjs"),o=require("./components/SubjectPageEnd.vue.cjs"),l=require("@qxs-bns/hooks"),r=require("@qxs-bns/utils"),c=require("vue-demi"),d=require("element-plus/es");const u={class:"subject-list-wrapper"};var x=e.defineComponent({name:"QxsSubjectList",__name:"subject-list",props:{subjectList:{type:Array,required:!0},isPreview:{type:Boolean,required:!0}},emits:["setRelation"],setup(x,{expose:p,emit:m}){const w=x,v=c.ref([]),y=m,h=c.useAttrs();function f(){let e=0,t=!1;return v.value.map(((n,s,i)=>{"page_end"===n.answerType&&(e++,t=s===i.length-1)})),t?e:e+1}function T(e,t,n){console.log(t,"index"),t||0===t?v.value.splice(t+1,0,{customId:r.setGuid(),answerType:e,analysis:"",scaleQuestionList:[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1,examAnswerRelationType:n}):v.value.push({customId:r.setGuid(),answerType:e,analysis:"",scaleQuestionList:[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1,examAnswerRelationType:n})}function A(e,t){if("up"===t&&e>0){const[t]=v.value.splice(e,1);v.value.splice(e-1,0,t)}else if("down"===t&&e<v.value.length-1){const[t]=v.value.splice(e,1);v.value.splice(e+1,0,t)}}function E(e,t){for(let n=0;n<v.value.length;n++)e===n&&(v.value[e]={...v.value[e],...t,isEdit:!1,examAnswerRelationType:t.examAnswerRelationType})}function R(e){v.value.splice(e,1),d.ElMessage.success("删除成功")}function k(e,t){y("setRelation",e,t)}p({addSubject:T,currentList:v,uploadExcel:function(e){v.value=v.value.concat(e)},addExam:function(e){const t=[];e.answers?.map((e=>{t.push({...e,title:e.answer,answerId:e.examAnswerId,isCorrect:e.isCorrect})})),v.value.push({...e,customId:r.setGuid(),answerType:e.richTextContent?"rich_text":e.examTypeEnum,answers:t,isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1})},setAnswerRelation:function(e,t,n){console.log(e,t,n,111),console.log(v.value,222),e.length&&v.value.forEach((s=>{s.customId===t&&s.answer.forEach((t=>{t.customAnswerId===n&&(t.answerRelations=e)}))}))}}),c.watch((()=>w.subjectList),(e=>{e&&(v.value=[...e])}),{immediate:!0});const S=l.useNamespace("subject-list");return(l,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(S).e("list-exam"))},[e.createElementVNode("div",u,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(v),((r,c)=>(e.openBlock(),e.createElementBlock("div",{key:c+r.examId||r.title},[["single","multiple","sort"].includes(r.answerType)?(e.openBlock(),e.createBlock(s.default,e.mergeProps({key:0,ref_for:!0},e.unref(h),{"order-index":c,title:r.title,type:r.answerType,"exam-id":r.examId,isKey:r.isKey,"is-save":!r.isRealCanDel,customId:r.customId,"is-set":r.hasSet||!1,"answer-list":r.answers,analysis:r.analysis,"least-answer-count":r.leastAnswerCount,"is-edit":r.isEdit||!1,"show-action":!l.isPreview,"exam-expand":r.examExpand,answerCheckType:r.answerCheckType,"exam-rich-text-content":r.examRichTextContent,examAnswerRelationType:r.examAnswerRelationType,onSetRelation:k,onMove:e=>A(c,e),onDelete:e=>R(c),onSave:e=>E(c,e),onEdit:e=>r.isEdit=!0,onAdd:(e,t)=>T(e,c,t)}),null,16,["order-index","title","type","exam-id","isKey","is-save","customId","is-set","answer-list","analysis","least-answer-count","is-edit","show-action","exam-expand","answerCheckType","exam-rich-text-content","examAnswerRelationType","onMove","onDelete","onSave","onEdit","onAdd"])):"scale"===r.answerType?(e.openBlock(),e.createBlock(n.default,e.mergeProps({key:1,ref_for:!0},e.unref(h),{"order-index":c,title:r.title,"is-save":!r.isRealCanDel,"is-set":r.hasSet||!1,"answer-list":r.answers,analysis:r.analysis,"is-edit":r.isEdit||!1,"scale-question-list":r.scaleQuestionList,"show-action":!l.isPreview,"exam-rich-text-content":r.examRichTextContent,examAnswerRelationType:r.examAnswerRelationType,onMove:e=>A(c,e),onDelete:e=>R(c),onSave:e=>E(c,e),onEdit:e=>r.isEdit=!0,onAdd:e=>T(e,c,null)}),null,16,["order-index","title","is-save","is-set","answer-list","analysis","is-edit","scale-question-list","show-action","exam-rich-text-content","examAnswerRelationType","onMove","onDelete","onSave","onEdit","onAdd"])):"blank_fill"===r.answerType?(e.openBlock(),e.createBlock(t.default,e.mergeProps({key:2,ref_for:!0},e.unref(h),{"order-index":c,title:r.title,"is-save":!r.isRealCanDel,"is-set":r.hasSet||!1,"answer-list":r.answers,analysis:r.analysis,"show-action":!l.isPreview,"is-edit":r.isEdit||!1,"exam-answer-setting-v-o":r.examAnswerSettingVO||{},"exam-rich-text-content":r.examRichTextContent,examAnswerRelationType:r.examAnswerRelationType,onMove:e=>A(c,e),onDelete:e=>R(c),onSave:e=>E(c,e),onEdit:e=>r.isEdit=!0,onAdd:e=>T(e,c,null)}),null,16,["order-index","title","is-save","is-set","answer-list","analysis","show-action","is-edit","exam-answer-setting-v-o","exam-rich-text-content","examAnswerRelationType","onMove","onDelete","onSave","onEdit","onAdd"])):"text_fill"===r.answerType?(e.openBlock(),e.createBlock(i.default,e.mergeProps({key:3,ref_for:!0},e.unref(h),{"order-index":c,title:r.title,"is-save":!r.isRealCanDel,"is-set":r.hasSet||!1,"answer-list":r.answers,analysis:r.analysis,"show-action":!l.isPreview,"is-edit":r.isEdit||!1,"exam-expand":r.examExpand,"exam-answer-setting-v-o":r.examAnswerSettingVO||{},examAnswerRelationType:r.examAnswerRelationType,"exam-rich-text-content":r.examRichTextContent,onMove:e=>A(c,e),onDelete:e=>R(c),onSave:e=>E(c,e),onEdit:e=>r.isEdit=!0,onAdd:e=>T(e,c,null)}),null,16,["order-index","title","is-save","is-set","answer-list","analysis","show-action","is-edit","exam-expand","exam-answer-setting-v-o","examAnswerRelationType","exam-rich-text-content","onMove","onDelete","onSave","onEdit","onAdd"])):"rich_text"===r.answerType?(e.openBlock(),e.createBlock(a.default,e.mergeProps({key:4,ref_for:!0},e.unref(h),{"order-index":c,richTextContent:r.richTextContent,"is-set":r.hasSet||!1,"is-save":!r.isRealCanDel,"is-edit":r.isEdit||!1,"show-action":!l.isPreview,onMove:e=>A(c,e),onDelete:e=>R(c),examAnswerRelationType:r.examAnswerRelationType,onSave:e=>E(c,e),onEdit:e=>r.isEdit=!0,onAdd:e=>T(e,c,null)}),null,16,["order-index","richTextContent","is-set","is-save","is-edit","show-action","onMove","onDelete","examAnswerRelationType","onSave","onEdit","onAdd"])):"page_end"===r.answerType?(e.openBlock(),e.createBlock(o.default,{"total-page":f(),key:c,"current-page-index":(e=>{const t=v.value.filter((e=>"page_end"===e.answerType));let n=0;return t.forEach(((t,s)=>{e===t.id&&(n=s+1)})),n})(r.id),item:r,"order-index":c,"is-edit":r.isEdit||!1,"is-set":r.hasSet||!1,"is-save":!r.isRealCanDel,examAnswerRelationType:r.examAnswerRelationType,onMove:e=>A(c,e),onDelete:e=>R(c),onSave:e=>E(c,e),onEdit:e=>r.isEdit=!0,onAdd:e=>T(e,c,null)},null,8,["total-page","current-page-index","item","order-index","is-edit","is-set","is-save","examAnswerRelationType","onMove","onDelete","onSave","onEdit","onAdd"])):e.createCommentVNode("v-if",!0)])))),128))])],2))}});exports.default=x;
2
2
  //# sourceMappingURL=subject-list.vue.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"subject-list.vue.cjs","sources":["../../../../../../packages/components/src/subject-list/src/subject-list.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// import isEqual from 'lodash/isEqual'\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 let totalPageIndex = 0\n let isLastPageIndex = false\n currentList.value.map((v: any, i: number, arr: any) => {\n if (v.answerType === 'page_end') {\n totalPageIndex++\n isLastPageIndex = i === arr.length - 1\n }\n })\n // 假设最后是一个分页器认为是最后一页\n return isLastPageIndex ? totalPageIndex : totalPageIndex + 1\n}\n\nfunction currentPageIndex() {\n return (currentId: any) => {\n const currentPageList = currentList.value.filter(\n (v: any) => v.answerType === 'page_end'\n )\n let currentIndex = 0\n currentPageList.forEach((c: any, i: number) => {\n if (currentId === c.id) {\n currentIndex = i + 1\n }\n })\n return currentIndex\n }\n}\n\nfunction addSubject(type: string, index: number, examAnswerRelationType: number | null) {\n console.log(index, 'index')\n if (index || index === 0) {\n currentList.value.splice(index + 1, 0, {\n customId: setGuid(),\n answerType: type,\n analysis: '',\n scaleQuestionList: [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n examAnswerRelationType: examAnswerRelationType,\n })\n }\n else {\n currentList.value.push({\n customId: setGuid(),\n answerType: type,\n analysis: '',\n scaleQuestionList: [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n examAnswerRelationType: examAnswerRelationType,\n })\n }\n}\n\nfunction addExam(item: any) {\n const answerList: any[] = []\n item.answers?.map((v: any) => {\n answerList.push({\n ...v,\n title: v.answer,\n answerId: v.examAnswerId,\n isCorrect: v.isCorrect,\n })\n })\n currentList.value.push({\n ...item,\n customId: setGuid(),\n answerType: item.richTextContent ? 'rich_text' : item.examTypeEnum,\n answers: answerList,\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n })\n}\nfunction uploadExcel(list: any[]) {\n currentList.value = currentList.value.concat(list)\n}\n\nfunction move(index: number, type: 'up' | 'down') {\n if (type === 'up' && index > 0) {\n const [item] = currentList.value.splice(index, 1)\n currentList.value.splice(index - 1, 0, item)\n }\n else if (type === 'down' && index < currentList.value.length - 1) {\n const [item] = currentList.value.splice(index, 1)\n currentList.value.splice(index + 1, 0, item)\n }\n}\n\nfunction saveSubject(index: number, item: any) {\n for (let idx = 0; idx < currentList.value.length; idx++) {\n if (index === idx) {\n currentList.value[index] =\n {\n ...currentList.value[index],\n ...item,\n isEdit: false,\n }\n }\n }\n}\n\nfunction deleteSubject(index: number) {\n currentList.value.splice(index, 1)\n ElMessage.success('删除成功')\n}\n\nfunction setRelation(examId: string, examAnswers: any) {\n emits('setRelation', examId, examAnswers)\n}\n\nfunction setAnswerRelation(answerRelations: any, customId: string, customAnswerId: string,) {\n // 给examId设置答案关联\n console.log(answerRelations, customId, customAnswerId, 111);\n console.log(currentList.value, 222);\n if (answerRelations.length) {\n currentList.value.forEach((c: any) => {\n if (c.customId === customId) {\n c.answer.forEach((c: any) => {\n if (c.customAnswerId === customAnswerId) {\n c.answerRelations = answerRelations\n }\n })\n }\n })\n }\n}\nwatch(() => props.subjectList, (newList: any) => {\n if (newList) {\n currentList.value = [...newList]\n }\n}, { immediate: true })\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=\"index + item.examId || item.title\">\n <template v-if=\"['single', 'multiple', 'sort'].includes(item.answerType)\">\n <SubjectSingle \n v-bind=\"attrs\" \n :order-index=\"index\" \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 </template>\n <SubjectScale v-bind=\"attrs\" v-else-if=\"item.answerType === 'scale'\" :order-index=\"index\" :title=\"item.title\"\n :is-save=\"!item.isRealCanDel\" :is-set=\"item.hasSet || false\" :answer-list=\"item.answers\"\n :analysis=\"item.analysis\" :is-edit=\"item.isEdit || false\" :scale-question-list=\"item.scaleQuestionList\"\n :show-action=\"!isPreview\" :exam-rich-text-content=\"item.examRichTextContent\"\n :examAnswerRelationType=\"item.examAnswerRelationType\" @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\" @save=\"(item: any) => saveSubject(index, item)\" @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\" />\n <SubjectBlankFill v-bind=\"attrs\" v-else-if=\"item.answerType === 'blank_fill'\" :order-index=\"index\"\n :title=\"item.title\" :is-save=\"!item.isRealCanDel\" :is-set=\"item.hasSet || false\" :answer-list=\"item.answers\"\n :analysis=\"item.analysis\" :show-action=\"!isPreview\" :is-edit=\"item.isEdit || false\"\n :exam-answer-setting-v-o=\"item.examAnswerSettingVO || {}\" :exam-rich-text-content=\"item.examRichTextContent\"\n :examAnswerRelationType=\"item.examAnswerRelationType\" @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\" @save=\"(item: any) => saveSubject(index, item)\" @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\" />\n <SubjectTextFill v-bind=\"attrs\" v-else-if=\"item.answerType === 'text_fill'\" :order-index=\"index\"\n :title=\"item.title\" :is-save=\"!item.isRealCanDel\" :is-set=\"item.hasSet || false\" :answer-list=\"item.answers\"\n :analysis=\"item.analysis\" :show-action=\"!isPreview\" :is-edit=\"item.isEdit || false\"\n :exam-expand=\"item.examExpand\" :exam-answer-setting-v-o=\"item.examAnswerSettingVO || {}\"\n :examAnswerRelationType=\"item.examAnswerRelationType\" :exam-rich-text-content=\"item.examRichTextContent\"\n @move=\"(type: 'up' | 'down') => move(index, type)\" @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\" @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\" />\n <SubjectRichText v-bind=\"attrs\" v-else-if=\"item.answerType === 'rich_text'\" :order-index=\"index\"\n :richTextContent=\"item.richTextContent\" :is-set=\"item.hasSet || false\" :is-save=\"!item.isRealCanDel\"\n :is-edit=\"item.isEdit || false\" :show-action=\"!isPreview\" @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\" :examAnswerRelationType=\"item.examAnswerRelationType\"\n @save=\"(item: any) => saveSubject(index, item)\" @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\" />\n <SubjectPageEnd v-else-if=\"item.answerType === 'page_end'\" :total-page=\"totalPageIndex()\" :key=\"index\"\n :current-page-index=\"currentPageIndex()(item.id)\" :item=\"item\" :order-index=\"index\"\n :is-edit=\"item.isEdit || false\" :is-set=\"item.hasSet || false\" :is-save=\"!item.isRealCanDel\"\n :examAnswerRelationType=\"item.examAnswerRelationType\" @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\" @save=\"(item: any) => saveSubject(index, item)\" @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\" />\n </div>\n </div>\n </div>\n</template>\n"],"names":["props","__props","currentList","ref","emits","__emit","attrs","useAttrs","totalPageIndex","isLastPageIndex","value","map","v","i","arr","answerType","length","addSubject","type","index","examAnswerRelationType","console","log","splice","customId","setGuid","analysis","scaleQuestionList","isSave","isEdit","isRealCanDel","hasSet","push","move","item","saveSubject","idx","deleteSubject","ElMessage","success","setRelation","examId","examAnswers","__expose","uploadExcel","list","concat","addExam","answerList","answers","title","answer","answerId","examAnswerId","isCorrect","richTextContent","examTypeEnum","setAnswerRelation","answerRelations","customAnswerId","forEach","c","watch","subjectList","newList","immediate","ns","useNamespace","currentId","currentPageList","filter","currentIndex","id"],"mappings":"guBAeA,MAAMA,EAAQC,EAIRC,EAAcC,EAAIA,IAAA,IAClBC,EAAQC,EAERC,EAAQC,EAAAA,WAUd,SAASC,IACP,IAAIA,EAAiB,EACjBC,GAAkB,EAQf,OAPPP,EAAYQ,MAAMC,KAAI,CAACC,EAAQC,EAAWC,KACnB,aAAjBF,EAAEG,aACJP,IACkBC,EAAAI,IAAMC,EAAIE,OAAS,EAAA,IAIlCP,EAAkBD,EAAiBA,EAAiB,CAAA,CAkBpD,SAAAS,EAAWC,EAAcC,EAAeC,GACvCC,QAAAC,IAAIH,EAAO,SACfA,GAAmB,IAAVA,EACXjB,EAAYQ,MAAMa,OAAOJ,EAAQ,EAAG,EAAG,CACrCK,SAAUC,EAAAA,UACVV,WAAYG,EACZQ,SAAU,GACVC,kBAAmB,GACnBC,QAAQ,EACRC,QAAQ,EACRC,cAAc,EACdC,QAAQ,EACRX,2BAIFlB,EAAYQ,MAAMsB,KAAK,CACrBR,SAAUC,EAAAA,UACVV,WAAYG,EACZQ,SAAU,GACVC,kBAAmB,GACnBC,QAAQ,EACRC,QAAQ,E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BC,EAAsBlC,EAAkBmC,GAEjEtC,QAAQC,IAAIoC,EAAiBlC,EAAUmC,EAAgB,KAC/CtC,QAAAC,IAAIpB,EAAYQ,MAAO,KAC3BgD,EAAgB1C,QACNd,EAAAQ,MAAMkD,SAASC,IACrBA,EAAErC,WAAaA,GACfqC,EAAAV,OAAOS,SAASC,IACZA,EAAEF,iBAAmBA,IACvBE,EAAEH,gBAAkBA,EAAA,GAEvB,GAGP,IAEFI,EAAAA,OAAM,IAAM9D,EAAM+D,cAAcC,IAC1BA,IACU9D,EAAAQ,MAAQ,IAAIsD,GAAO,GAEhC,CAAEC,WAAW,IACV,MAAAC,EAAKC,eAAa,goIA3Hf,CAACC,IACA,MAAAC,EAAkBnE,EAAYQ,MAAM4D,QACvC1D,GAA4B,aAAjBA,EAAEG,aAEhB,IAAIwD,EAAe,EAMZ,OALSF,EAAAT,SAAQ,CAACC,EAAQhD,KAC3BuD,IAAcP,EAAEW,KAClBD,EAAe1D,EAAI,EAAA,IAGhB0D,CAAA"}
1
+ {"version":3,"file":"subject-list.vue.cjs","sources":["../../../../../../packages/components/src/subject-list/src/subject-list.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// import isEqual from 'lodash/isEqual'\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 let totalPageIndex = 0\n let isLastPageIndex = false\n currentList.value.map((v: any, i: number, arr: any) => {\n if (v.answerType === 'page_end') {\n totalPageIndex++\n isLastPageIndex = i === arr.length - 1\n }\n })\n // 假设最后是一个分页器认为是最后一页\n return isLastPageIndex ? totalPageIndex : totalPageIndex + 1\n}\n\nfunction currentPageIndex() {\n return (currentId: any) => {\n const currentPageList = currentList.value.filter(\n (v: any) => v.answerType === 'page_end'\n )\n let currentIndex = 0\n currentPageList.forEach((c: any, i: number) => {\n if (currentId === c.id) {\n currentIndex = i + 1\n }\n })\n return currentIndex\n }\n}\n\nfunction addSubject(type: string, index: number, examAnswerRelationType: number | null) {\n console.log(index, 'index')\n if (index || index === 0) {\n currentList.value.splice(index + 1, 0, {\n customId: setGuid(),\n answerType: type,\n analysis: '',\n scaleQuestionList: [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n examAnswerRelationType: examAnswerRelationType,\n })\n }\n else {\n currentList.value.push({\n customId: setGuid(),\n answerType: type,\n analysis: '',\n scaleQuestionList: [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n examAnswerRelationType: examAnswerRelationType,\n })\n }\n}\n\nfunction addExam(item: any) {\n const answerList: any[] = []\n item.answers?.map((v: any) => {\n answerList.push({\n ...v,\n title: v.answer,\n answerId: v.examAnswerId,\n isCorrect: v.isCorrect,\n })\n })\n currentList.value.push({\n ...item,\n customId: setGuid(),\n answerType: item.richTextContent ? 'rich_text' : item.examTypeEnum,\n answers: answerList,\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n })\n}\nfunction uploadExcel(list: any[]) {\n currentList.value = currentList.value.concat(list)\n}\n\nfunction move(index: number, type: 'up' | 'down') {\n if (type === 'up' && index > 0) {\n const [item] = currentList.value.splice(index, 1)\n currentList.value.splice(index - 1, 0, item)\n }\n else if (type === 'down' && index < currentList.value.length - 1) {\n const [item] = currentList.value.splice(index, 1)\n currentList.value.splice(index + 1, 0, item)\n }\n}\n\nfunction saveSubject(index: number, item: any) {\n for (let idx = 0; idx < currentList.value.length; idx++) {\n if (index === idx) {\n currentList.value[index] =\n {\n ...currentList.value[index],\n ...item,\n isEdit: false,\n examAnswerRelationType: item.examAnswerRelationType,\n }\n }\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 // 给examId设置答案关联\n console.log(answerRelations, customId, customAnswerId, 111);\n console.log(currentList.value, 222);\n if (answerRelations.length) {\n currentList.value.forEach((c: any) => {\n if (c.customId === customId) {\n c.answer.forEach((c: any) => {\n if (c.customAnswerId === customAnswerId) {\n c.answerRelations = answerRelations\n }\n })\n }\n })\n }\n}\nwatch(() => props.subjectList, (newList: any) => {\n if (newList) {\n currentList.value = [...newList]\n }\n}, { immediate: true })\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=\"index + item.examId || item.title\">\n <template v-if=\"['single', 'multiple', 'sort'].includes(item.answerType)\">\n <SubjectSingle \n v-bind=\"attrs\" \n :order-index=\"index\" \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 </template>\n <SubjectScale v-bind=\"attrs\" v-else-if=\"item.answerType === 'scale'\" :order-index=\"index\" :title=\"item.title\"\n :is-save=\"!item.isRealCanDel\" :is-set=\"item.hasSet || false\" :answer-list=\"item.answers\"\n :analysis=\"item.analysis\" :is-edit=\"item.isEdit || false\" :scale-question-list=\"item.scaleQuestionList\"\n :show-action=\"!isPreview\" :exam-rich-text-content=\"item.examRichTextContent\"\n :examAnswerRelationType=\"item.examAnswerRelationType\" @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\" @save=\"(item: any) => saveSubject(index, item)\" @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\" />\n <SubjectBlankFill v-bind=\"attrs\" v-else-if=\"item.answerType === 'blank_fill'\" :order-index=\"index\"\n :title=\"item.title\" :is-save=\"!item.isRealCanDel\" :is-set=\"item.hasSet || false\" :answer-list=\"item.answers\"\n :analysis=\"item.analysis\" :show-action=\"!isPreview\" :is-edit=\"item.isEdit || false\"\n :exam-answer-setting-v-o=\"item.examAnswerSettingVO || {}\" :exam-rich-text-content=\"item.examRichTextContent\"\n :examAnswerRelationType=\"item.examAnswerRelationType\" @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\" @save=\"(item: any) => saveSubject(index, item)\" @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\" />\n <SubjectTextFill v-bind=\"attrs\" v-else-if=\"item.answerType === 'text_fill'\" :order-index=\"index\"\n :title=\"item.title\" :is-save=\"!item.isRealCanDel\" :is-set=\"item.hasSet || false\" :answer-list=\"item.answers\"\n :analysis=\"item.analysis\" :show-action=\"!isPreview\" :is-edit=\"item.isEdit || false\"\n :exam-expand=\"item.examExpand\" :exam-answer-setting-v-o=\"item.examAnswerSettingVO || {}\"\n :examAnswerRelationType=\"item.examAnswerRelationType\" :exam-rich-text-content=\"item.examRichTextContent\"\n @move=\"(type: 'up' | 'down') => move(index, type)\" @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\" @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\" />\n <SubjectRichText v-bind=\"attrs\" v-else-if=\"item.answerType === 'rich_text'\" :order-index=\"index\"\n :richTextContent=\"item.richTextContent\" :is-set=\"item.hasSet || false\" :is-save=\"!item.isRealCanDel\"\n :is-edit=\"item.isEdit || false\" :show-action=\"!isPreview\" @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\" :examAnswerRelationType=\"item.examAnswerRelationType\"\n @save=\"(item: any) => saveSubject(index, item)\" @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\" />\n <SubjectPageEnd v-else-if=\"item.answerType === 'page_end'\" :total-page=\"totalPageIndex()\" :key=\"index\"\n :current-page-index=\"currentPageIndex()(item.id)\" :item=\"item\" :order-index=\"index\"\n :is-edit=\"item.isEdit || false\" :is-set=\"item.hasSet || false\" :is-save=\"!item.isRealCanDel\"\n :examAnswerRelationType=\"item.examAnswerRelationType\" @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\" @save=\"(item: any) => saveSubject(index, item)\" @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\" />\n </div>\n </div>\n </div>\n</template>\n"],"names":["props","__props","currentList","ref","emits","__emit","attrs","useAttrs","totalPageIndex","isLastPageIndex","value","map","v","i","arr","answerType","length","addSubject","type","index","examAnswerRelationType","console","log","splice","customId","setGuid","analysis","scaleQuestionList","isSave","isEdit","isRealCanDel","hasSet","push","move","item","saveSubject","idx","deleteSubject","ElMessage","success","setRelation","examAnswers","__expose","uploadExcel","list","concat","addExam","answerList","answers","title","answer","answerId","examAnswerId","isCorrect","richTextContent","examTypeEnum","setAnswerRelation","answerRelations","customAnswerId","forEach","c","watch","subjectList","newList","immediate","ns","useNamespace","currentId","currentPageList","filter","currentIndex","id"],"mappings":"guBAeA,MAAMA,EAAQC,EAIRC,EAAcC,EAAIA,IAAA,IAClBC,EAAQC,EAERC,EAAQC,EAAAA,WAUd,SAASC,IACP,IAAIA,EAAiB,EACjBC,GAAkB,EAQf,OAPPP,EAAYQ,MAAMC,KAAI,CAACC,EAAQC,EAAWC,KACnB,aAAjBF,EAAEG,aACJP,IACkBC,EAAAI,IAAMC,EAAIE,OAAS,EAAA,IAIlCP,EAAkBD,EAAiBA,EAAiB,CAAA,CAkBpD,SAAAS,EAAWC,EAAcC,EAAeC,GACvCC,QAAAC,IAAIH,EAAO,SACfA,GAAmB,IAAVA,EACXjB,EAAYQ,MAAMa,OAAOJ,EAAQ,EAAG,EAAG,CACrCK,SAAUC,EAAAA,UACVV,WAAYG,EACZQ,SAAU,GACVC,kBAAmB,GACnBC,QAAQ,EACRC,QAAQ,EACRC,cAAc,EACdC,QAAQ,EACRX,2BAIFlB,EAAYQ,MAAMsB,KAAK,CACrBR,SAAUC,EAAAA,UACVV,WAAYG,EACZQ,SAAU,GACVC,kBAAmB,GACnBC,QAAQ,EACRC,QAAQ,EACRC,cAAc,EACdC,QAAQ,EACRX,0BAEJ,CA4BO,SAAAa,EAAKd,EAAeD,GACvB,GAAS,OAATA,GAAiBC,EAAQ,EAAG,CAC9B,MAAOe,GAAQhC,EAAYQ,MAAMa,OAAOJ,EAAO,GAC/CjB,EAAYQ,MAAMa,OAAOJ,EAAQ,EAAG,EAAGe,EAAI,SAE3B,SAAThB,GAAmBC,EAAQjB,EAAYQ,MAAMM,OAAS,EAAG,CAChE,MAAOkB,GAAQhC,EAAYQ,MAAMa,OAAOJ,EAAO,GAC/CjB,EAAYQ,MAAMa,OAAOJ,EAAQ,EAAG,EAAGe,EAAI,CAC7C,CAGO,SAAAC,EAAYhB,EAAee,GAClC,IAAA,IA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IA5Hf,CAACC,IACA,MAAAC,EAAkBlE,EAAYQ,MAAM2D,QACvCzD,GAA4B,aAAjBA,EAAEG,aAEhB,IAAIuD,EAAe,EAMZ,OALSF,EAAAT,SAAQ,CAACC,EAAQ/C,KAC3BsD,IAAcP,EAAEW,KAClBD,EAAezD,EAAI,EAAA,IAGhByD,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@qxs-bns/components",
3
3
  "type": "module",
4
- "version": "0.0.28",
4
+ "version": "0.0.29",
5
5
  "description": "Vue 3 Component Library",
6
6
  "license": "MIT",
7
7
  "homepage": "https://trry-hub.github.io/qxs-bns/",