@qxs-bns/components 0.0.35 → 0.0.37
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/package.json.mjs +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/subject-list.vue.mjs +1 -1
- package/es/src/subject-list/src/subject-list.vue.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/lib/package.json.cjs +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/subject-list.vue.cjs +1 -1
- package/lib/src/subject-list/src/subject-list.vue.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/package.json +1 -1
- package/types/src/data-chart/src/components/card.vue.d.ts.map +1 -1
- package/types/src/data-chart/src/components/radar.vue.d.ts.map +1 -1
- package/types/src/data-chart/src/components/scatter-simple.vue.d.ts.map +1 -1
- package/types/src/data-chart/src/components/scatter.vue.d.ts.map +1 -1
- package/types/src/data-chart/src/components/table.vue.d.ts.map +1 -1
- package/types/src/data-chart/src/data-chart.vue.d.ts.map +1 -1
- package/types/src/file-upload/src/file-upload.vue.d.ts.map +1 -1
- package/types/src/image-upload/src/image-upload.vue.d.ts.map +1 -1
- package/types/src/photo-crop-tool/src/photo-crop-tool.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/index.d.ts +1 -1
- package/types/src/subject-list/src/components/subject-single.vue.d.ts.map +1 -1
- package/types/src/subject-list/src/subject-list.vue.d.ts +1 -1
- package/types/src/subject-list/src/subject-list.vue.d.ts.map +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.map +1 -1
- package/types/tsconfig.tsbuildinfo +1 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"subject-single.vue.cjs","sources":["../../../../../../../packages/components/src/subject-list/src/components/subject-single.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { CirclePlus, Remove } from '@element-plus/icons-vue'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport SubjectAction from '../../../subject-action/src/subject-action.vue'\nimport SubjectLayout from '../../../subject-layout/src/subject-layout.vue'\nimport TinyMceEditor from '../../../tiny-mce-editor/src/tiny-mce-editor.vue'\nimport { setGuid } from '@qxs-bns/utils'\n\ndefineOptions({\n name: 'QxsSubjectSingle',\n})\nconst props = defineProps<{\n orderIndex: number\n title?: string\n isSave: boolean\n showAction?: boolean\n type: 'single' | 'multiple' | 'sort'\n isEdit: boolean\n isSet: boolean\n answerList?: any\n leastAnswerCount?: number\n analysis?: string\n examExpand?: string\n examRichTextContent?: string\n showAnalysis?: boolean\n examAnswerRelationType?: number\n customId?: number\n examId?: number\n isKey: boolean\n answerCheckType: number\n}>()\nconst emits = defineEmits(['move', 'save', 'delete', 'edit', 'add', 'setRelation'])\n\nconst attrs = useAttrs()\n\nconst answersIndex = ref(0)\nconst isKey = ref(props.isKey)\nconst answerCheckType = ref(1)\nconst examAnswerRelationType = ref(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(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 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?.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 // 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","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":"wrDAWA,MAAMA,EAAQC,EAoBRC,EAAQC,EAERC,EAAQC,EAAAA,WAERC,EAAeC,MAAI,GACnBC,EAAQD,EAAAA,IAAIP,EAAMQ,OAClBC,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,MAAI,GACvBK,EAAQL,MAAI,IACZQ,EAAWR,MAAI,IACfS,EAAeT,OAAI,GACnBU,EAAWV,MAAI,IACfW,EAAYX,MAAI,GAChBY,EAAkBZ,OAAI,GACtBa,EAAab,MAAY,IACzBc,EAAmBC,EAAAA,UAAS,IACb,WAAftB,EAAMuB,KACD,MAEe,aAAfvB,EAAMuB,KACN,MAGA,QAILC,EAAYjB,EAAcA,IAAA,IAE1BkB,EAAqBH,EAAAA,UAAS,KAClC,MAAMI,EAAQ,GAEd,IAAA,IAASC,EADMhB,EAAQiB,MAAMC,OACJF,EAAQ,EAAGA,IAClCD,EAAMI,KAAK,CACTC,MAAO,OAAOJ,KACdC,MAAOD,IAGX,OAAOD,EAAMM,SAAQ,IAEvB,SAASC,IACHjC,EAAMkC,QAGVvB,EAAQiB,MAAME,KAAK,CACjBlB,MAAO,GACPC,WAAW,EACXsB,eAAgBC,EAAQA,WACzB,CA+BH,SAASC,IACPrB,EAAaY,OAAQ,EACrBX,EAASW,MAAQ,EAAA,CAGnB,SAASU,IACH,IAAC1B,EAAMgB,MAET,YADAW,EAAAA,UAAUC,MAAM,aAGlB,IAAIC,EA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,IACjEK,OAAOC,QAAO,CAIjBvF,EAAMe,WACRA,EAASa,MAAQ5B,EAAMe,UAGrBf,EAAM6D,sBACR5C,EAASW,MAAQ5B,EAAM6D,oBACvB7C,EAAaY,OAAQ,EACvB,k+IAlJO,SAAW4D,EAASC,GACR,WAAfzF,EAAMuB,MAEJkE,GACM9E,EAAAiB,MAAMgB,SAASsC,IACjBA,IAAWM,IACbN,EAAOrE,WAAY,EAAA,IAIzB2E,EAAG3E,UAAY4E,GACS,aAAfzF,EAAMuB,OAEfiE,EAAG3E,UAAY4E,EACjB,6hBArBF,SAAsBjC,GAChB7C,EAAQiB,MAAMC,OAAS,GAAK7B,EAAMkC,QAG9BvB,EAAAiB,MAAM8D,OAAOlC,EAAO,EAAC,+JAuJTV,IACpBxC,EAAasB,MAAQkB,EACrB1B,EAAWQ,MAAQjB,EAAQiB,MAAMkB,GAAG1B,YAAc,QAClDD,EAAgBS,OAAQ,GAH1B,IAAsBkB,iRApItB,SAAqBQ,GACdA,EAAAnB,eAAiBmB,EAAKqC,cAAgBvD,EAAAA,UACrClC,EAAA,cAAeF,EAAM4F,SAAUtC,EAAI"}
|
1
|
+
{"version":3,"file":"subject-single.vue.cjs","sources":["../../../../../../../packages/components/src/subject-list/src/components/subject-single.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { CirclePlus, Remove } from '@element-plus/icons-vue'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport 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(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(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 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?.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 // 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 && 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":"wrDAWA,MAAMA,EAAQC,EAoBRC,EAAQC,EAERC,EAAQC,EAAAA,WAERC,EAAeC,MAAI,GACnBC,EAAQD,EAAAA,IAAIP,EAAMQ,OAClBC,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,MAAI,GACvBK,EAAQL,MAAI,IACZQ,EAAWR,MAAI,IACfS,EAAeT,OAAI,GACnBU,EAAWV,MAAI,IACfW,EAAYX,MAAI,GAChBY,EAAkBZ,OAAI,GACtB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vD,EAAAA,UACrClC,EAAA,cAAeF,EAAM4F,SAAUtC,EAAI"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue"),
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue"),n=require("./components/subject-blank-fill.vue.cjs"),t=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("element-plus/es");const d={class:"subject-list-wrapper"};var u=e.defineComponent({name:"QxsSubjectList",__name:"subject-list",props:{subjectList:{type:Array,required:!0},isPreview:{type:Boolean,required:!0}},emits:["setRelation"],setup(u,{expose:p,emit:x}){const m=u,w=e.ref([]),v=x,y=e.useAttrs();p({addSubject:T,currentList:w,uploadExcel:function(e){w.value=w.value.concat(e)},addExam:function(e){const n=e.answers?.map((e=>({...e,title:e.answer,answerId:e.examAnswerId,isCorrect:e.isCorrect})))||[],t={...e,customId:r.setGuid(),answerType:e.richTextContent?"rich_text":e.examTypeEnum,answers:n,isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1};w.value.push(t);const s=t.customId;e.pageIndex-f.value(s)==1&&(console.log(f.value(s)),h());f.value(s)>1&&h()},setAnswerRelation:function(e,n,t){const s=w.value.find((e=>e.customId===n));if(s){const n=s.answers?.find((e=>e.customAnswerId===t));n&&(n.answerRelations=e)}}});const f=e.computed((()=>{const e=w.value.filter((e=>"page_end"===e.answerType));return n=>{const t=e.findIndex((e=>e.customId===n));return-1!==t?t+1:0}}));function h(){w.value.push({customId:r.setGuid(),answerType:"page_end",analysis:"",scaleQuestionList:[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1,examAnswerRelationType:0})}function T(e,n=null,t=null){const s={customId:r.setGuid(),answerType:e,analysis:"",scaleQuestionList:[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1,examAnswerRelationType:t};null!==n?w.value.splice(n+1,0,s):w.value.push(s)}function A(e,n){if("up"===n&&e>0){const[n]=w.value.splice(e,1);w.value.splice(e-1,0,n)}else if("down"===n&&e<w.value.length-1){const[n]=w.value.splice(e,1);w.value.splice(e+1,0,n)}}function R(e,n){w.value[e]={...w.value[e],...n,isEdit:!1,examAnswerRelationType:n.examAnswerRelationType}}function E(e){w.value.splice(e,1),c.ElMessage.success("删除成功")}function k(e,n){v("setRelation",e,n)}e.watch((()=>m.subjectList),(e=>{e&&(w.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",d,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(w),((r,c)=>(e.openBlock(),e.createElementBlock("div",{key:r.customId,class:"subject-item"},[["single","multiple","sort"].includes(r.answerType)?(e.openBlock(),e.createBlock(s.default,e.mergeProps({key:0,ref_for:!0},e.unref(y),{"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=>E(c),onSave:e=>R(c,e),onEdit:e=>r.isEdit=!0,onAdd:(e,n)=>T(e,c,n)}),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(t.default,e.mergeProps({key:1,ref_for:!0},e.unref(y),{"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=>E(c),onSave:e=>R(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(n.default,e.mergeProps({key:2,ref_for:!0},e.unref(y),{"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=>E(c),onSave:e=>R(c,e),onEdit:e=>r.isEdit=!0,onAdd:e=>T(e,c,null)}),null,16,["order-index","title","is-save","is-set","answer-list","analysis","show-action","is-edit","exam-answer-setting-v-o","exam-rich-text-content","examAnswerRelationType","onMove","onDelete","onSave","onEdit","onAdd"])):"text_fill"===r.answerType?(e.openBlock(),e.createBlock(i.default,e.mergeProps({key:3,ref_for:!0},e.unref(y),{"order-index":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=>E(c),onSave:e=>R(c,e),onEdit:e=>r.isEdit=!0,onAdd:e=>T(e,c,null)}),null,16,["order-index","title","is-save","is-set","answer-list","analysis","show-action","is-edit","exam-expand","exam-answer-setting-v-o","examAnswerRelationType","exam-rich-text-content","onMove","onDelete","onSave","onEdit","onAdd"])):"rich_text"===r.answerType?(e.openBlock(),e.createBlock(a.default,e.mergeProps({key:4,ref_for:!0},e.unref(y),{"order-index":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=>E(c),examAnswerRelationType:r.examAnswerRelationType,onSave:e=>R(c,e),onEdit:e=>r.isEdit=!0,onAdd:e=>T(e,c,null)}),null,16,["order-index","richTextContent","is-set","is-save","is-edit","show-action","onMove","onDelete","examAnswerRelationType","onSave","onEdit","onAdd"])):"page_end"===r.answerType?(e.openBlock(),e.createBlock(o.default,{"total-page":w.value.filter((e=>"page_end"===e.answerType)).length,key:c,"current-page-index":e.unref(f)(r.customId),item:r,"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=>E(c),onSave:e=>R(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=u;
|
2
2
|
//# sourceMappingURL=subject-list.vue.cjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"subject-list.vue.cjs","sources":["../../../../../../packages/components/src/subject-list/src/subject-list.vue"],"sourcesContent":["<script setup lang=\"ts\">\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 if (answerRelations.length) {\n currentList.value?.map((v: any) => {\n if(v.customId === customId) {\n v.answers?.map((c: any) => {\n // 判断类型\n if(c.customAnswerId === customAnswerId) {\n c.answerRelations = answerRelations\n }\n })\n }\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=\"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","c","watch","subjectList","newList","immediate","ns","useNamespace","currentId","currentPageList","filter","currentIndex","forEach","id"],"mappings":"0sBAeA,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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OAAOC,KAAKC,IACnBA,EAAEY,WAAaA,GACdZ,EAAAoC,SAASrC,KAAKgD,IAEXA,EAAED,iBAAmBA,IACtBC,EAAEF,gBAAkBA,EAAA,GAEvB,GAGP,IAGFG,EAAAA,OAAM,IAAM5D,EAAM6D,cAAcC,IAC1BA,IACU5D,EAAAQ,MAAQ,IAAIoD,GAAO,GAEhC,CAAEC,WAAW,IAEV,MAAAC,EAAKC,eAAa,goIA7Hf,CAACC,IACA,MAAAC,EAAkBjE,EAAYQ,MAAM0D,QACvCxD,GAA4B,aAAjBA,EAAEG,aAEhB,IAAIsD,EAAe,EAMZ,OALUF,GAAAG,SAAQ,CAACX,EAAQ9C,KAC5BqD,IAAcP,EAAEY,KAClBF,EAAexD,EAAI,EAAA,IAGhBwD,CAAA"}
|
1
|
+
{"version":3,"file":"subject-list.vue.cjs","sources":["../../../../../../packages/components/src/subject-list/src/subject-list.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport SubjectBlankFill from './components/subject-blank-fill.vue'\nimport SubjectScale from './components/subject-scale.vue'\nimport SubjectSingle from './components/subject-single.vue'\nimport SubjectTextFill from './components/subject-text-fill.vue'\nimport SubjectRichText from './components/SubjectRichText.vue'\nimport SubjectPageEnd from './components/SubjectPageEnd.vue'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport { setGuid } from '@qxs-bns/utils'\n\ndefineOptions({\n name: 'QxsSubjectList',\n})\n\nconst props = defineProps<{\n subjectList: any[]\n isPreview: boolean\n}>()\nconst currentList = ref([] as any)\nconst emits = defineEmits(['setRelation'])\n\nconst attrs = useAttrs()\n\ndefineExpose({\n addSubject,\n currentList,\n uploadExcel,\n addExam,\n setAnswerRelation,\n})\n\nfunction totalPageIndex() {\n return currentList.value.filter((v: any) => v.answerType === 'page_end').length\n}\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})\nfunction addPageEnd() {\n currentList.value.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}\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}\n\nfunction addExam(item: any) {\n const answerList = item.answers?.map((v: any) => ({\n ...v,\n title: v.answer,\n answerId: v.examAnswerId,\n isCorrect: v.isCorrect,\n })) || []\n\n // 创建新的题目对象\n const newItem = {\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\n // 将新题目添加到 currentList\n currentList.value.push(newItem)\n\n // 获取刚刚添加的题目的 customId\n const newCustomId = newItem.customId\n\n // 判断是否需要添加 page_end \n if ((item.pageIndex - currentPageIndex.value(newCustomId)) === 1) {\n console.log(currentPageIndex.value(newCustomId));\n addPageEnd()\n }\n\n if (currentPageIndex.value(newCustomId) > 1) {\n addPageEnd()\n }\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 } 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=\"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.customId)\" :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","__expose","addSubject","uploadExcel","list","value","concat","addExam","item","answerList","answers","map","v","title","answer","answerId","examAnswerId","isCorrect","newItem","customId","setGuid","answerType","richTextContent","examTypeEnum","isSave","isEdit","isRealCanDel","hasSet","push","newCustomId","pageIndex","currentPageIndex","console","log","addPageEnd","setAnswerRelation","answerRelations","customAnswerId","targetItem","find","targetAnswer","c","computed","currentPageList","filter","currentId","currentIndex","findIndex","analysis","scaleQuestionList","examAnswerRelationType","type","index","newSubject","splice","move","length","saveSubject","deleteSubject","ElMessage","success","setRelation","examAnswers","watch","subjectList","newList","immediate","ns","useNamespace"],"mappings":"0sBAcA,MAAMA,EAAQC,EA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aAA2BmC"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue"),i=require("@qxs-bns/hooks"),n=require("lodash-es"),t=require("tinymce/tinymce");require("tinymce/themes/silver/theme"),require("tinymce/icons/default/icons"),require("tinymce/models/dom"),require("tinymce/plugins/autolink"),require("tinymce/plugins/autoresize"),require("tinymce/plugins/fullscreen"),require("tinymce/plugins/image"),require("tinymce/plugins/insertdatetime"),require("tinymce/plugins/link"),require("tinymce/plugins/lists"),require("tinymce/plugins/media"),require("tinymce/plugins/preview"),require("tinymce/plugins/table"),require("tinymce/plugins/wordcount"),require("tinymce/plugins/code"),require("tinymce/plugins/searchreplace"),require("tinymce/plugins/nonbreaking");const r=["id","name"];var
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue"),i=require("@qxs-bns/hooks"),n=require("lodash-es"),t=require("tinymce/tinymce");require("tinymce/themes/silver/theme"),require("tinymce/icons/default/icons"),require("tinymce/models/dom"),require("tinymce/plugins/autolink"),require("tinymce/plugins/autoresize"),require("tinymce/plugins/fullscreen"),require("tinymce/plugins/image"),require("tinymce/plugins/insertdatetime"),require("tinymce/plugins/link"),require("tinymce/plugins/lists"),require("tinymce/plugins/media"),require("tinymce/plugins/preview"),require("tinymce/plugins/table"),require("tinymce/plugins/wordcount"),require("tinymce/plugins/code"),require("tinymce/plugins/searchreplace"),require("tinymce/plugins/nonbreaking");const r=["id","name"];var a=e.defineComponent({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(a,{emit:u}){const l=u,s=i.useNamespace("file-upload"),o=e.computed({get:()=>a.modelValue,set(e){l("update:modelValue",e)}}),c=e.ref(`tiny-mce-textarea-${Date.now()}-${Math.random().toString(36).substr(2,9)}`),m=a.assetsBasePath||"node_modules/",d={selector:`textarea#${c.value}`,promotion:!1,license_key:"gpl",elementpath:!1,language:"zh-Hans",language_url:`${m}tinymce/langs/zh-Hans.js`,skin_url:`${m}tinymce/skins/ui/oxide`,content_css:`${m}tinymce/skins/content/default/content.min.css`,min_height:250,max_height:600,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:e=>{e.on("input change undo redo",(()=>{o.value=e.getContent()})),e.on("init",(()=>{e.setContent(o.value)})),a.config?.expandSetup?.(e)}},g=e.computed((()=>{const e=d;return a.config.images_upload_handler||("string"==typeof e.plugins?e.plugins=e.plugins.replace("image",""):Array.isArray(e.plugins)&&(e.plugins=e.plugins.filter((e=>"image"!==e)))),n.merge(e,a.config)}));return e.onMounted((async()=>{"undefined"!=typeof window&&t.init(g.value)})),(i,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(s).e("tiny-mce"))},[e.createCommentVNode(" 使用动态生成的 id "),e.withDirectives(e.createElementVNode("textarea",{id:e.unref(c),"onUpdate:modelValue":n[0]||(n[0]=i=>e.isRef(o)?o.value=i:null),name:e.unref(c)},null,8,r),[[e.vModelText,e.unref(o)]])],2))}});exports.default=a;
|
2
2
|
//# sourceMappingURL=tiny-mce-editor.vue.cjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"tiny-mce-editor.vue.cjs","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\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(\"file-upload\");\n\nconst colorScheme = \"light\";\n\nconst content = computed({\n get() {\n return modelValue;\n },\n set(val) {\n emit(\"update:modelValue\", val);\n },\n});\n\n// 生成唯一的 id\nconst uniqueId = ref(\n `tiny-mce-textarea-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`\n);\n\nconst basePath
|
1
|
+
{"version":3,"file":"tiny-mce-editor.vue.cjs","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(\"file-upload\");\n\nconst colorScheme = \"light\";\n\nconst content = computed({\n get() {\n return modelValue;\n },\n set(val) {\n emit(\"update:modelValue\", val);\n },\n});\n\n// 生成唯一的 id\nconst uniqueId = ref(\n `tiny-mce-textarea-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`\n);\n\nconst basePath = assetsBasePath || \"node_modules/\";\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\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: 250,\n max_height: 600,\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 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 } 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\nonMounted(async () => {\n if (typeof window !== \"undefined\") {\n tinymce.init(initSetting.value);\n }\n});\n</script>\n\n<template>\n <div :class=\"ns.e('tiny-mce')\">\n <!-- 使用动态生成的 id -->\n <textarea :id=\"uniqueId\" v-model=\"content\" :name=\"uniqueId\" />\n </div>\n</template>\n"],"names":["emit","__emit","ns","useNamespace","content","computed","get","__props","modelValue","set","val","uniqueId","ref","Date","now","Math","random","toString","substr","basePath","assetsBasePath","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","onMounted","async","window","tinymce","init"],"mappings":"ujCA2CA,MAAMA,EAAOC,EAEPC,EAAKC,eAAa,eAIlBC,EAAUC,EAAAA,SAAS,CACvBC,IAAM,IACGC,EAAUC,WAEnB,GAAAC,CAAIC,GACFV,EAAK,oBAAqBU,EAAG,IAK3BC,EAAWC,EAAAA,IACf,qBAAqBC,KAAKC,SAASC,KAAKC,SAASC,SAAS,IAAIC,OAAO,EAAG,MAGpEC,EAAWZ,EAAAa,gBAAkB,gBAC7BC,EAAmC,CAEvCC,SAAU,YAAYX,EAASY,QAC/BC,WAAW,EACXC,YAAa,MACbC,aAAa,EACbC,SAAU,UAEVC,aAAc,GAAGT,4BACjBU,SAAU,GAAGV,0BAGbW,YAAa,GAAGX,iDAKhBY,WAAY,IACZC,WAAY,IACZC,QACE,8HACFC,QACE,oPACFC,UAAU,EACVC,YAAY,EACZC,SAAS,EACTC,uBAAuB,EACvBC,aAAc,UACdC,uBAAwB,CACtB,YACA,YACA,WACA,YA6BFC,MAAQC,IAECA,EAAAC,GAAG,0BAA0B,KAC1BvC,EAAAmB,MAAQmB,EAAOE,YAAW,IAI7BF,EAAAC,GAAG,QAAQ,KACTD,EAAAG,WAAWzC,EAAQmB,MAAK,IAG3BhB,EAAAuC,QAAEC,cAAcL,EAAM,GAI1BM,EAAc3C,EAAAA,UAAS,KAC3B,MAAM4C,EAAqB5B,EAcpB,OAbFd,EAAMuC,OAACI,wBAEgC,iBAA/BD,EAAmBhB,QACTgB,EAAAhB,QAAUgB,EAAmBhB,QAAQkB,QACtD,QACA,IAEOC,MAAMC,QAAQJ,EAAmBhB,WACvBgB,EAAAhB,QAAUgB,EAAmBhB,QAAQqB,QACrDC,GAAsB,UAAXA,MAIXC,QAAMP,EAAoB1C,SAAM,WAGzCkD,EAAAA,WAAUC,UACc,oBAAXC,QACDC,EAAAC,KAAKb,EAAYzB,MAAK"}
|
package/package.json
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"card.vue.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/data-chart/src/components/card.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"card.vue.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/data-chart/src/components/card.vue"],"names":[],"mappings":"AAAA,OAuJO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AACnC,OAAO,KAAK,EAAc,iBAAiB,EAAE,MAAM,UAAU,CAAA;;;cAwLzC,QAAQ,CAAC,iBAAiB,CAAC;;;;;;;;;;cAA3B,QAAQ,CAAC,iBAAiB,CAAC;;;;;;;;;;;AAP/C,wBAgBG"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"radar.vue.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/data-chart/src/components/radar.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"radar.vue.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/data-chart/src/components/radar.vue"],"names":[],"mappings":"AAAA,OAmFO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAShE,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,iBAAiB,CAAA;IAC5B,YAAY,EAAE,aAAa,CAAA;CAC5B,CAAC;;AAoGF,wBAMG"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"scatter-simple.vue.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/data-chart/src/components/scatter-simple.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"scatter-simple.vue.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/data-chart/src/components/scatter-simple.vue"],"names":[],"mappings":"AAAA,OA4EO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAOhE,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,iBAAiB,CAAA;IAC5B,YAAY,EAAE,aAAa,CAAA;CAC5B,CAAC;;AA+FF,wBAMG"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"scatter.vue.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/data-chart/src/components/scatter.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"scatter.vue.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/data-chart/src/components/scatter.vue"],"names":[],"mappings":"AAAA,OA6EO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAQhE,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,iBAAiB,CAAA;IAC5B,YAAY,EAAE,aAAa,CAAA;CAC5B,CAAC;;AA+FF,wBAMG"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"table.vue.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/data-chart/src/components/table.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"table.vue.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/data-chart/src/components/table.vue"],"names":[],"mappings":"AAAA,OAsFO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AACnC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;;;cAwL7B,QAAQ,CAAC,iBAAiB,CAAC;;;;;;;;;;cAA3B,QAAQ,CAAC,iBAAiB,CAAC;;;;;;;;;;;AAP/C,wBAgBG"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"data-chart.vue.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/data-chart/src/data-chart.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"data-chart.vue.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/data-chart/src/data-chart.vue"],"names":[],"mappings":"AAAA,OAyKO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAqB,MAAM,SAAS,CAAA;AAC3E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAwB5C,KAAK,WAAW,GAAG;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAA;IACtC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,YAAY,CAAC,EAAE,aAAa,CAAA;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,CAAC;AA0FF,iBAAS,UAAU,SAQlB;;;;AA0ED,wBAOG"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"file-upload.vue.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/file-upload/src/file-upload.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"file-upload.vue.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/file-upload/src/file-upload.vue"],"names":[],"mappings":"AAAA,OAiGO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAQhE,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;IAC9B,OAAO,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACjC,IAAI,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC3B,IAAI,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,cAAc,EAAE,CAAC;IACzB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;CAChB,CAAC;;;;;;AAqKF,wBAOG"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"image-upload.vue.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/image-upload/src/image-upload.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"image-upload.vue.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/image-upload/src/image-upload.vue"],"names":[],"mappings":"AAAA,OAwLO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAOxE,KAAK,WAAW,GAAG;IACf,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAA;IAC7B,OAAO,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAA;IAChC,IAAI,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAC1B,IAAI,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE,WAAW,CAAC,cAAc,CAAC,CAAA;CAC3C,CAAC;;;;;;;;WAPQ,MAAM;YAEL,MAAM;UALR,WAAW,CAAC,MAAM,CAAC;UAEnB,MAAM;YAEJ,MAAM;SAHT,MAAM;WAMJ,OAAO;iBADD,MAAM;;AAuVxB,wBAQG"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"photo-crop-tool.vue.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/photo-crop-tool/src/photo-crop-tool.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"photo-crop-tool.vue.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/photo-crop-tool/src/photo-crop-tool.vue"],"names":[],"mappings":"AAAA,OAiZO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AA+InC,iBAAe,IAAI,CAAC,GAAG,GAAE,gBAAgC,wBAyBxD;AA0JD,iBAAS,MAAM,SAKd;;;cAkKmB,QAAQ,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;IAehC;;;OAGG;;;;;;;;;;cAlBe,QAAQ,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;IAehC;;;OAGG;;;;;;;;;;;;AA1BL,wBAgCG"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"subject-layout.vue.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/subject-layout/src/subject-layout.vue"],"names":[],"mappings":"AAgCA,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,OAAO,CAAA;CAClB,CAAC;AAGF,QAAA,MAAM,EAAE;
|
1
|
+
{"version":3,"file":"subject-layout.vue.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/subject-layout/src/subject-layout.vue"],"names":[],"mappings":"AAgCA,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,OAAO,CAAA;CAClB,CAAC;AAGF,QAAA,MAAM,EAAE;sBAlBiB,KACtB;mBAGA,CAAC;eAEiB,CAAC;gBAAqC,CAAC;oBAE7C,CAAC,iBAAiB,CAAC;gBAG1B,CAAC,kBACT,CAAA;oBAEiB,CAAC,kBAEL,CAAC;qBAEL,CAAA,iBAAiB,CAAC,kBACxB,CAAC;;;;;;;;;CADqC,CAAA;AAKzC,QAAA,MAAM,SAAS,EAAS,YAAY,CAAC,gBAAgB,CAAC,OAAO,UAAU,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC;AAyBxF,QAAA,IAAI,OAAO,IAAU,EAAE,OAAO,IAAU,EAAE,OAAO,IAAW,CAAE;AAC9D,KAAK,WAAW,GAAG,oBAAoB,CAAC,qBAAqB,CAAC,OAAO,SAAS,CAAC,MAAM,CAAC,GACpF;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GAC5C;IAAE,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GACzC;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC,CAAC;AAYhD,QAAA,MAAM,UAAU;QAGN,OAAO,EAAE;oPAIjB,CAAC;AACH,QAAA,MAAM,eAAe,kSAMnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
@@ -2,7 +2,7 @@ declare const QxsSubjectList: import("../withInstall").SFCWithInstall<import("vu
|
|
2
2
|
subjectList: any[];
|
3
3
|
isPreview: boolean;
|
4
4
|
}, {
|
5
|
-
addSubject: (type: string, index
|
5
|
+
addSubject: (type: string, index?: number | null, examAnswerRelationType?: number | null) => void;
|
6
6
|
currentList: globalThis.Ref<any, any>;
|
7
7
|
uploadExcel: (list: any[]) => void;
|
8
8
|
addExam: (item: any) => void;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"subject-single.vue.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/subject-list/src/components/subject-single.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"subject-single.vue.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/subject-list/src/components/subject-single.vue"],"names":[],"mappings":"AAgkBA,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,OAAO,CAAA;IACf,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,IAAI,EAAE,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAA;IACpC,MAAM,EAAE,OAAO,CAAA;IACf,KAAK,EAAE,OAAO,CAAA;IACd,UAAU,CAAC,EAAE,GAAG,CAAA;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,OAAO,CAAA;IACd,eAAe,EAAE,MAAM,CAAA;CACxB,CAAC;;;;;;;;;;;;;;;;AAogCF,wBAOG"}
|
@@ -2,7 +2,7 @@ type __VLS_Props = {
|
|
2
2
|
subjectList: any[];
|
3
3
|
isPreview: boolean;
|
4
4
|
};
|
5
|
-
declare function addSubject(type: string, index
|
5
|
+
declare function addSubject(type: string, index?: number | null, examAnswerRelationType?: number | null): void;
|
6
6
|
declare function addExam(item: any): void;
|
7
7
|
declare function uploadExcel(list: any[]): void;
|
8
8
|
declare function setAnswerRelation(answerRelations: any, customId: string, customAnswerId: string): void;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"subject-list.vue.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/subject-list/src/subject-list.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"subject-list.vue.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/subject-list/src/subject-list.vue"],"names":[],"mappings":"AAuPA,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,GAAG,EAAE,CAAA;IAClB,SAAS,EAAE,OAAO,CAAA;CACnB,CAAC;AAwCF,iBAAS,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,GAAE,MAAM,GAAG,IAAW,EAAE,sBAAsB,GAAE,MAAM,GAAG,IAAW,QAkB1G;AAED,iBAAS,OAAO,CAAC,IAAI,EAAE,GAAG,QAmCzB;AAED,iBAAS,WAAW,CAAC,IAAI,EAAE,GAAG,EAAE,QAE/B;AA8BD,iBAAS,iBAAiB,CAAC,eAAe,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,QAQxF;;;;;;;;;;;;AA0dD,wBAQG"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/components/src/tiny-mce-editor/index.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,gBAAgB;;;
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/components/src/tiny-mce-editor/index.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,gBAAgB;;;mBAMm3K,CAAC;;;;;;;;mBAAD,CAAC;;;;;yGAN31K,CAAA;AAE/C,OAAO,EACL,gBAAgB,EACjB,CAAA;AAED,eAAe,gBAAgB,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"tiny-mce-editor.vue.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/tiny-mce-editor/src/tiny-mce-editor.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"tiny-mce-editor.vue.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/tiny-mce-editor/src/tiny-mce-editor.vue"],"names":[],"mappings":"AAAA,OA6KO,KAAK,EAAU,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAMhE,OAAO,6BAA6B,CAAC;AACrC,OAAO,6BAA6B,CAAC;AACrC,OAAO,oBAAoB,CAAC;AAE5B,OAAO,0BAA0B,CAAC;AAClC,OAAO,4BAA4B,CAAC;AACpC,OAAO,4BAA4B,CAAC;AACpC,OAAO,uBAAuB,CAAC;AAC/B,OAAO,gCAAgC,CAAC;AACxC,OAAO,sBAAsB,CAAC;AAC9B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,yBAAyB,CAAC;AACjC,OAAO,uBAAuB,CAAC;AAC/B,OAAO,2BAA2B,CAAC;AACnC,OAAO,sBAAsB,CAAC;AAC9B,OAAO,+BAA+B,CAAC;AACvC,OAAO,6BAA6B,CAAC;AAOrC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,gBAAgB,GAAG;QAC1B,WAAW,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;KACzC,CAAC;IACF,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;;;;;;AAuKF,wBAOG"}
|