@qxs-bns/components 0.0.35 → 0.0.36

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,2 +1,2 @@
1
- var r="0.0.35";export{r as version};
1
+ var r="0.0.36";export{r as version};
2
2
  //# sourceMappingURL=package.json.mjs.map
@@ -1,2 +1,2 @@
1
- import{defineComponent as e,ref as t,useAttrs as s,watch as n,createElementBlock as i,openBlock as a,normalizeClass as o,unref as l,createElementVNode as r,Fragment as d,renderList as c,createBlock as m,createCommentVNode as x,mergeProps as u}from"vue";import p from"./components/subject-blank-fill.vue.mjs";import w from"./components/subject-scale.vue.mjs";import v from"./components/subject-single.vue.mjs";import y from"./components/subject-text-fill.vue.mjs";import h from"./components/SubjectRichText.vue.mjs";import T from"./components/SubjectPageEnd.vue.mjs";import{useNamespace as A}from"@qxs-bns/hooks";import{setGuid as R}from"@qxs-bns/utils";import{ElMessage as f}from"element-plus/es";const E={class:"subject-list-wrapper"};var S=e({name:"QxsSubjectList",__name:"subject-list",props:{subjectList:{type:Array,required:!0},isPreview:{type:Boolean,required:!0}},emits:["setRelation"],setup(e,{expose:S,emit:C}){const g=e,D=t([]),j=C,b=s();function _(){let e=0,t=!1;return D.value.map(((s,n,i)=>{"page_end"===s.answerType&&(e++,t=n===i.length-1)})),t?e:e+1}function k(e,t,s){console.log(t,"index"),t||0===t?D.value.splice(t+1,0,{customId:R(),answerType:e,analysis:"",scaleQuestionList:[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1,examAnswerRelationType:s}):D.value.push({customId:R(),answerType:e,analysis:"",scaleQuestionList:[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1,examAnswerRelationType:s})}function I(e,t){if("up"===t&&e>0){const[t]=D.value.splice(e,1);D.value.splice(e-1,0,t)}else if("down"===t&&e<D.value.length-1){const[t]=D.value.splice(e,1);D.value.splice(e+1,0,t)}}function M(e,t){for(let s=0;s<D.value.length;s++)e===s&&(D.value[e]={...D.value[e],...t,isEdit:!1,examAnswerRelationType:t.examAnswerRelationType})}function L(e){D.value.splice(e,1),f.success("删除成功")}function P(e,t){j("setRelation",e,t)}S({addSubject:k,currentList:D,uploadExcel:function(e){D.value=D.value.concat(e)},addExam:function(e){const t=[];e.answers?.map((e=>{t.push({...e,title:e.answer,answerId:e.examAnswerId,isCorrect:e.isCorrect})})),D.value.push({...e,customId:R(),answerType:e.richTextContent?"rich_text":e.examTypeEnum,answers:t,isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1})},setAnswerRelation:function(e,t,s){e.length&&D.value?.map((n=>{n.customId===t&&n.answers?.map((t=>{t.customAnswerId===s&&(t.answerRelations=e)}))}))}}),n((()=>g.subjectList),(e=>{e&&(D.value=[...e])}),{immediate:!0});const q=A("subject-list");return(e,t)=>(a(),i("div",{class:o(l(q).e("list-exam"))},[r("div",E,[(a(!0),i(d,null,c(l(D),((t,s)=>(a(),i("div",{key:s+t.examId||t.title},[["single","multiple","sort"].includes(t.answerType)?(a(),m(v,u({key:0,ref_for:!0},l(b),{"order-index":s,title:t.title,type:t.answerType,"exam-id":t.examId,isKey:t.isKey,"is-save":!t.isRealCanDel,customId:t.customId,"is-set":t.hasSet||!1,"answer-list":t.answers,analysis:t.analysis,"least-answer-count":t.leastAnswerCount,"is-edit":t.isEdit||!1,"show-action":!e.isPreview,"exam-expand":t.examExpand,answerCheckType:t.answerCheckType,"exam-rich-text-content":t.examRichTextContent,examAnswerRelationType:t.examAnswerRelationType,onSetRelation:P,onMove:e=>I(s,e),onDelete:e=>L(s),onSave:e=>M(s,e),onEdit:e=>t.isEdit=!0,onAdd:(e,t)=>k(e,s,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"===t.answerType?(a(),m(w,u({key:1,ref_for:!0},l(b),{"order-index":s,title:t.title,"is-save":!t.isRealCanDel,"is-set":t.hasSet||!1,"answer-list":t.answers,analysis:t.analysis,"is-edit":t.isEdit||!1,"scale-question-list":t.scaleQuestionList,"show-action":!e.isPreview,"exam-rich-text-content":t.examRichTextContent,examAnswerRelationType:t.examAnswerRelationType,onMove:e=>I(s,e),onDelete:e=>L(s),onSave:e=>M(s,e),onEdit:e=>t.isEdit=!0,onAdd:e=>k(e,s,null)}),null,16,["order-index","title","is-save","is-set","answer-list","analysis","is-edit","scale-question-list","show-action","exam-rich-text-content","examAnswerRelationType","onMove","onDelete","onSave","onEdit","onAdd"])):"blank_fill"===t.answerType?(a(),m(p,u({key:2,ref_for:!0},l(b),{"order-index":s,title:t.title,"is-save":!t.isRealCanDel,"is-set":t.hasSet||!1,"answer-list":t.answers,analysis:t.analysis,"show-action":!e.isPreview,"is-edit":t.isEdit||!1,"exam-answer-setting-v-o":t.examAnswerSettingVO||{},"exam-rich-text-content":t.examRichTextContent,examAnswerRelationType:t.examAnswerRelationType,onMove:e=>I(s,e),onDelete:e=>L(s),onSave:e=>M(s,e),onEdit:e=>t.isEdit=!0,onAdd:e=>k(e,s,null)}),null,16,["order-index","title","is-save","is-set","answer-list","analysis","show-action","is-edit","exam-answer-setting-v-o","exam-rich-text-content","examAnswerRelationType","onMove","onDelete","onSave","onEdit","onAdd"])):"text_fill"===t.answerType?(a(),m(y,u({key:3,ref_for:!0},l(b),{"order-index":s,title:t.title,"is-save":!t.isRealCanDel,"is-set":t.hasSet||!1,"answer-list":t.answers,analysis:t.analysis,"show-action":!e.isPreview,"is-edit":t.isEdit||!1,"exam-expand":t.examExpand,"exam-answer-setting-v-o":t.examAnswerSettingVO||{},examAnswerRelationType:t.examAnswerRelationType,"exam-rich-text-content":t.examRichTextContent,onMove:e=>I(s,e),onDelete:e=>L(s),onSave:e=>M(s,e),onEdit:e=>t.isEdit=!0,onAdd:e=>k(e,s,null)}),null,16,["order-index","title","is-save","is-set","answer-list","analysis","show-action","is-edit","exam-expand","exam-answer-setting-v-o","examAnswerRelationType","exam-rich-text-content","onMove","onDelete","onSave","onEdit","onAdd"])):"rich_text"===t.answerType?(a(),m(h,u({key:4,ref_for:!0},l(b),{"order-index":s,richTextContent:t.richTextContent,"is-set":t.hasSet||!1,"is-save":!t.isRealCanDel,"is-edit":t.isEdit||!1,"show-action":!e.isPreview,onMove:e=>I(s,e),onDelete:e=>L(s),examAnswerRelationType:t.examAnswerRelationType,onSave:e=>M(s,e),onEdit:e=>t.isEdit=!0,onAdd:e=>k(e,s,null)}),null,16,["order-index","richTextContent","is-set","is-save","is-edit","show-action","onMove","onDelete","examAnswerRelationType","onSave","onEdit","onAdd"])):"page_end"===t.answerType?(a(),m(T,{"total-page":_(),key:s,"current-page-index":(e=>{const t=D.value.filter((e=>"page_end"===e.answerType));let s=0;return t?.forEach(((t,n)=>{e===t.id&&(s=n+1)})),s})(t.id),item:t,"order-index":s,"is-edit":t.isEdit||!1,"is-set":t.hasSet||!1,"is-save":!t.isRealCanDel,examAnswerRelationType:t.examAnswerRelationType,onMove:e=>I(s,e),onDelete:e=>L(s),onSave:e=>M(s,e),onEdit:e=>t.isEdit=!0,onAdd:e=>k(e,s,null)},null,8,["total-page","current-page-index","item","order-index","is-edit","is-set","is-save","examAnswerRelationType","onMove","onDelete","onSave","onEdit","onAdd"])):x("v-if",!0)])))),128))])],2))}});export{S as default};
1
+ import{defineComponent as e,ref as s,useAttrs as t,watch as n,createElementBlock as i,openBlock as a,normalizeClass as o,unref as l,createElementVNode as r,Fragment as d,renderList as c,createBlock as m,createCommentVNode as u,mergeProps as x}from"vue";import p from"./components/subject-blank-fill.vue.mjs";import w from"./components/subject-scale.vue.mjs";import v from"./components/subject-single.vue.mjs";import y from"./components/subject-text-fill.vue.mjs";import h from"./components/SubjectRichText.vue.mjs";import T from"./components/SubjectPageEnd.vue.mjs";import{useNamespace as f}from"@qxs-bns/hooks";import{setGuid as A}from"@qxs-bns/utils";import{ElMessage as R}from"element-plus/es";const E={class:"subject-list-wrapper"};var S=e({name:"QxsSubjectList",__name:"subject-list",props:{subjectList:{type:Array,required:!0},isPreview:{type:Boolean,required:!0}},emits:["setRelation"],setup(e,{expose:S,emit:C}){const g=e,D=s([]),j=C,b=t();function I(e){return D.value.filter((e=>"page_end"===e.answerType)).findIndex((s=>s.customId===e))+1}function _(){D.value.push({customId:A(),answerType:"page_end",analysis:"",scaleQuestionList:[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1,examAnswerRelationType:0})}function k(e,s=null,t=null){const n={customId:A(),answerType:e,analysis:"",scaleQuestionList:[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1,examAnswerRelationType:t};null!==s?D.value.splice(s+1,0,n):D.value.push(n)}function M(e,s){if("up"===s&&e>0){const[s]=D.value.splice(e,1);D.value.splice(e-1,0,s)}else if("down"===s&&e<D.value.length-1){const[s]=D.value.splice(e,1);D.value.splice(e+1,0,s)}}function L(e,s){D.value[e]={...D.value[e],...s,isEdit:!1,examAnswerRelationType:s.examAnswerRelationType}}function P(e){D.value.splice(e,1),R.success("删除成功")}function q(e,s){j("setRelation",e,s)}S({addSubject:k,currentList:D,uploadExcel:function(e){D.value=D.value.concat(e)},addExam:function(e){const s=e.answers?.map((e=>({...e,title:e.answer,answerId:e.examAnswerId,isCorrect:e.isCorrect})))||[];D.value.push({...e,customId:A(),answerType:e.richTextContent?"rich_text":e.examTypeEnum,answers:s,isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1}),e.pageIndex-I(e.customId)==1&&_();I(e.customId)>1&&_()},setAnswerRelation:function(e,s,t){if(e.length){const n=D.value.find((e=>e.customId===s));if(n){const s=n.answers?.find((e=>e.customAnswerId===t));s&&(s.answerRelations=e)}}}}),n((()=>g.subjectList),(e=>{e&&(D.value=[...e])}),{immediate:!0});const Q=f("subject-list");return(e,s)=>(a(),i("div",{class:o(l(Q).e("list-exam"))},[r("div",E,[(a(!0),i(d,null,c(l(D),((s,t)=>(a(),i("div",{key:s.customId,class:"subject-item"},[["single","multiple","sort"].includes(s.answerType)?(a(),m(v,x({key:0,ref_for:!0},l(b),{"order-index":t,title:s.title,type:s.answerType,"exam-id":s.examId,isKey:s.isKey,"is-save":!s.isRealCanDel,customId:s.customId,"is-set":s.hasSet||!1,"answer-list":s.answers,analysis:s.analysis,"least-answer-count":s.leastAnswerCount,"is-edit":s.isEdit||!1,"show-action":!e.isPreview,"exam-expand":s.examExpand,answerCheckType:s.answerCheckType,"exam-rich-text-content":s.examRichTextContent,examAnswerRelationType:s.examAnswerRelationType,onSetRelation:q,onMove:e=>M(t,e),onDelete:e=>P(t),onSave:e=>L(t,e),onEdit:e=>s.isEdit=!0,onAdd:(e,s)=>k(e,t,s)}),null,16,["order-index","title","type","exam-id","isKey","is-save","customId","is-set","answer-list","analysis","least-answer-count","is-edit","show-action","exam-expand","answerCheckType","exam-rich-text-content","examAnswerRelationType","onMove","onDelete","onSave","onEdit","onAdd"])):"scale"===s.answerType?(a(),m(w,x({key:1,ref_for:!0},l(b),{"order-index":t,title:s.title,"is-save":!s.isRealCanDel,"is-set":s.hasSet||!1,"answer-list":s.answers,analysis:s.analysis,"is-edit":s.isEdit||!1,"scale-question-list":s.scaleQuestionList,"show-action":!e.isPreview,"exam-rich-text-content":s.examRichTextContent,examAnswerRelationType:s.examAnswerRelationType,onMove:e=>M(t,e),onDelete:e=>P(t),onSave:e=>L(t,e),onEdit:e=>s.isEdit=!0,onAdd:e=>k(e,t,null)}),null,16,["order-index","title","is-save","is-set","answer-list","analysis","is-edit","scale-question-list","show-action","exam-rich-text-content","examAnswerRelationType","onMove","onDelete","onSave","onEdit","onAdd"])):"blank_fill"===s.answerType?(a(),m(p,x({key:2,ref_for:!0},l(b),{"order-index":t,title:s.title,"is-save":!s.isRealCanDel,"is-set":s.hasSet||!1,"answer-list":s.answers,analysis:s.analysis,"show-action":!e.isPreview,"is-edit":s.isEdit||!1,"exam-answer-setting-v-o":s.examAnswerSettingVO||{},"exam-rich-text-content":s.examRichTextContent,examAnswerRelationType:s.examAnswerRelationType,onMove:e=>M(t,e),onDelete:e=>P(t),onSave:e=>L(t,e),onEdit:e=>s.isEdit=!0,onAdd:e=>k(e,t,null)}),null,16,["order-index","title","is-save","is-set","answer-list","analysis","show-action","is-edit","exam-answer-setting-v-o","exam-rich-text-content","examAnswerRelationType","onMove","onDelete","onSave","onEdit","onAdd"])):"text_fill"===s.answerType?(a(),m(y,x({key:3,ref_for:!0},l(b),{"order-index":t,title:s.title,"is-save":!s.isRealCanDel,"is-set":s.hasSet||!1,"answer-list":s.answers,analysis:s.analysis,"show-action":!e.isPreview,"is-edit":s.isEdit||!1,"exam-expand":s.examExpand,"exam-answer-setting-v-o":s.examAnswerSettingVO||{},examAnswerRelationType:s.examAnswerRelationType,"exam-rich-text-content":s.examRichTextContent,onMove:e=>M(t,e),onDelete:e=>P(t),onSave:e=>L(t,e),onEdit:e=>s.isEdit=!0,onAdd:e=>k(e,t,null)}),null,16,["order-index","title","is-save","is-set","answer-list","analysis","show-action","is-edit","exam-expand","exam-answer-setting-v-o","examAnswerRelationType","exam-rich-text-content","onMove","onDelete","onSave","onEdit","onAdd"])):"rich_text"===s.answerType?(a(),m(h,x({key:4,ref_for:!0},l(b),{"order-index":t,richTextContent:s.richTextContent,"is-set":s.hasSet||!1,"is-save":!s.isRealCanDel,"is-edit":s.isEdit||!1,"show-action":!e.isPreview,onMove:e=>M(t,e),onDelete:e=>P(t),examAnswerRelationType:s.examAnswerRelationType,onSave:e=>L(t,e),onEdit:e=>s.isEdit=!0,onAdd:e=>k(e,t,null)}),null,16,["order-index","richTextContent","is-set","is-save","is-edit","show-action","onMove","onDelete","examAnswerRelationType","onSave","onEdit","onAdd"])):"page_end"===s.answerType?(a(),m(T,{"total-page":D.value.filter((e=>"page_end"===e.answerType)).length,key:t,"current-page-index":I(s.customId),item:s,"order-index":t,"is-edit":s.isEdit||!1,"is-set":s.hasSet||!1,"is-save":!s.isRealCanDel,examAnswerRelationType:s.examAnswerRelationType,onMove:e=>M(t,e),onDelete:e=>P(t),onSave:e=>L(t,e),onEdit:e=>s.isEdit=!0,onAdd:e=>k(e,t,null)},null,8,["total-page","current-page-index","item","order-index","is-edit","is-set","is-save","examAnswerRelationType","onMove","onDelete","onSave","onEdit","onAdd"])):u("v-if",!0)])))),128))])],2))}});export{S as default};
2
2
  //# sourceMappingURL=subject-list.vue.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"subject-list.vue.mjs","sources":["../../../../../../packages/components/src/subject-list/src/subject-list.vue"],"sourcesContent":["<script setup lang=\"ts\">\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":"w5BAeA,MAAMA,EAAQC,EAIRC,EAAcC,EAAI,IAClBC,EAAQC,EAERC,EAAQC,IAUd,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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8DF,SAAiBZ,GACf,MAAMa,EAAoB,GACrBb,EAAAc,SAASrC,KAAKC,IACjBmC,EAAWf,KAAK,IACXpB,EACHqC,MAAOrC,EAAEsC,OACTC,SAAUvC,EAAEwC,aACZC,UAAWzC,EAAEyC,WACd,IAEHnD,EAAYQ,MAAMsB,KAAK,IAClBE,EACHV,SAAUC,IACVV,WAAYmB,EAAKoB,gBAAkB,YAAcpB,EAAKqB,aACtDP,QAASD,EACTnB,QAAQ,EACRC,QAAQ,EACRC,cAAc,EACdC,QAAQ,GACT,EAhFDyB,kBAwHO,SAAkBC,EAAsBjC,EAAkBkC,GAE7DD,EAAgBzC,QACNd,EAAAQ,OAAOC,KAAKC,IACnBA,EAAEY,WAAaA,GACdZ,EAAAoC,SAASrC,KAAKgD,IAEXA,EAAED,iBAAmBA,IACtBC,EAAEF,gBAAkBA,EAAA,GAEvB,GAGP,IAGFG,GAAM,IAAM5D,EAAM6D,cAAcC,IAC1BA,IACU5D,EAAAQ,MAAQ,IAAIoD,GAAO,GAEhC,CAAEC,WAAW,IAEV,MAAAC,EAAKC,EAAa,8tHA7Hf,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.mjs","sources":["../../../../../../packages/components/src/subject-list/src/subject-list.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport SubjectBlankFill from './components/subject-blank-fill.vue'\nimport SubjectScale from './components/subject-scale.vue'\nimport SubjectSingle from './components/subject-single.vue'\nimport SubjectTextFill from './components/subject-text-fill.vue'\nimport SubjectRichText from './components/SubjectRichText.vue'\nimport SubjectPageEnd from './components/SubjectPageEnd.vue'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport { setGuid } from '@qxs-bns/utils'\n\ndefineOptions({\n name: 'QxsSubjectList',\n})\n\nconst props = defineProps<{\n subjectList: any[]\n isPreview: boolean\n}>()\nconst currentList = ref([] as any)\nconst emits = defineEmits(['setRelation'])\n\nconst attrs = useAttrs()\n\ndefineExpose({\n addSubject,\n currentList,\n uploadExcel,\n addExam,\n setAnswerRelation,\n})\n\nfunction totalPageIndex() {\n return currentList.value.filter((v: any) => v.answerType === 'page_end').length\n}\n\nfunction currentPageIndex(currentId: any) {\n const currentPageList = currentList.value.filter((v: any) => v.answerType === 'page_end')\n const currentIndex = currentPageList.findIndex((c: any) => c.customId === currentId)\n return currentIndex + 1\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 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\n if (item.pageIndex - currentPageIndex(item.customId) === 1) {\n addPageEnd()\n }\n\n if (currentPageIndex(item.customId) > 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 if (answerRelations.length) {\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}\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","currentPageIndex","currentId","value","filter","v","answerType","findIndex","c","customId","addPageEnd","push","setGuid","analysis","scaleQuestionList","isSave","isEdit","isRealCanDel","hasSet","examAnswerRelationType","addSubject","type","index","newSubject","splice","move","item","length","saveSubject","deleteSubject","ElMessage","success","setRelation","examAnswers","__expose","uploadExcel","list","concat","addExam","answerList","answers","map","title","answer","answerId","examAnswerId","isCorrect","richTextContent","examTypeEnum","pageIndex","setAnswerRelation","answerRelations","customAnswerId","targetItem","find","targetAnswer","watch","subjectList","newList","immediate","ns","useNamespace"],"mappings":"w5BAcA,MAAMA,EAAQC,EAIRC,EAAcC,EAAI,IAClBC,EAAQC,EAERC,EAAQC,IAcd,SAASC,EAAiBC,GAGxB,OAFwBP,EAAYQ,MAAMC,QAAQC,GAA4B,aAAjBA,EAAEC,aAC1BC,WAAWC,GAAWA,EAAEC,WAAaP,IACpD,CAAA,CAGxB,SAASQ,IACPf,EAAYQ,MAAMQ,KAAK,CACrBF,SAAUG,IACVN,WAAY,WACZO,SAAU,GACVC,kBAAmB,GACnBC,QAAQ,EACRC,QAAQ,EACRC,cAAc,EACdC,QAAQ,EACRC,uBAAwB,GACzB,CAGH,SAASC,EAAWC,EAAcC,EAAuB,KAAMH,EAAwC,MACrG,MAAMI,EAAa,CACjBd,SAAUG,IACVN,WAAYe,EACZR,SAAU,GACVC,kBAAmB,GACnBC,QAAQ,EACRC,QAAQ,EACRC,cAAc,EACdC,QAAQ,EACRC,0BAGY,OAAVG,EACF3B,EAAYQ,MAAMqB,OAAOF,EAAQ,EAAG,EAAGC,GAE3B5B,EAAAQ,MAAMQ,KAAKY,EACzB,CAmCO,SAAAE,EAAKH,EAAeD,GACvB,GAAS,OAATA,GAAiBC,EAAQ,EAAG,CAC9B,MAAOI,GAAQ/B,EAAYQ,MAAMqB,OAAOF,EAAO,GAC/C3B,EAAYQ,MAAMqB,OAAOF,EAAQ,EAAG,EAAGI,EAAI,SACzB,SAATL,GAAmBC,EAAQ3B,EAAYQ,MAAMwB,OAAS,EAAG,CAClE,MAAOD,GAAQ/B,EAAYQ,MAAMqB,OAAOF,EAAO,GAC/C3B,EAAYQ,MAAMqB,OAAOF,EAAQ,EAAG,EAAGI,EAAI,CAC7C,CAGO,SAAAE,EAAYN,EAAeI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C,GAA4B,aAAjBA,EAAEC,aAA2BqB"}
@@ -1,2 +1,2 @@
1
- "use strict";exports.version="0.0.35";
1
+ "use strict";exports.version="0.0.36";
2
2
  //# sourceMappingURL=package.json.cjs.map
@@ -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("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();function h(){let e=0,t=!1;return w.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?w.value.splice(t+1,0,{customId:r.setGuid(),answerType:e,analysis:"",scaleQuestionList:[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1,examAnswerRelationType:n}):w.value.push({customId:r.setGuid(),answerType:e,analysis:"",scaleQuestionList:[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1,examAnswerRelationType:n})}function f(e,t){if("up"===t&&e>0){const[t]=w.value.splice(e,1);w.value.splice(e-1,0,t)}else if("down"===t&&e<w.value.length-1){const[t]=w.value.splice(e,1);w.value.splice(e+1,0,t)}}function A(e,t){for(let n=0;n<w.value.length;n++)e===n&&(w.value[e]={...w.value[e],...t,isEdit:!1,examAnswerRelationType:t.examAnswerRelationType})}function R(e){w.value.splice(e,1),c.ElMessage.success("删除成功")}function E(e,t){v("setRelation",e,t)}p({addSubject:T,currentList:w,uploadExcel:function(e){w.value=w.value.concat(e)},addExam:function(e){const t=[];e.answers?.map((e=>{t.push({...e,title:e.answer,answerId:e.examAnswerId,isCorrect:e.isCorrect})})),w.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){e.length&&w.value?.map((s=>{s.customId===t&&s.answers?.map((t=>{t.customAnswerId===n&&(t.answerRelations=e)}))}))}}),e.watch((()=>m.subjectList),(e=>{e&&(w.value=[...e])}),{immediate:!0});const k=l.useNamespace("subject-list");return(l,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(k).e("list-exam"))},[e.createElementVNode("div",d,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(w),((r,c)=>(e.openBlock(),e.createElementBlock("div",{key: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(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:E,onMove:e=>f(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(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=>f(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(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=>f(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(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=>f(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(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=>f(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":h(),key:c,"current-page-index":(e=>{const t=w.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=>f(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=u;
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("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:x,emit:p}){const m=u,w=e.ref([]),v=p,y=e.useAttrs();function f(e){return w.value.filter((e=>"page_end"===e.answerType)).findIndex((t=>t.customId===e))+1}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,t=null,n=null){const s={customId:r.setGuid(),answerType:e,analysis:"",scaleQuestionList:[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1,examAnswerRelationType:n};null!==t?w.value.splice(t+1,0,s):w.value.push(s)}function A(e,t){if("up"===t&&e>0){const[t]=w.value.splice(e,1);w.value.splice(e-1,0,t)}else if("down"===t&&e<w.value.length-1){const[t]=w.value.splice(e,1);w.value.splice(e+1,0,t)}}function R(e,t){w.value[e]={...w.value[e],...t,isEdit:!1,examAnswerRelationType:t.examAnswerRelationType}}function E(e){w.value.splice(e,1),c.ElMessage.success("删除成功")}function k(e,t){v("setRelation",e,t)}x({addSubject:T,currentList:w,uploadExcel:function(e){w.value=w.value.concat(e)},addExam:function(e){const t=e.answers?.map((e=>({...e,title:e.answer,answerId:e.examAnswerId,isCorrect:e.isCorrect})))||[];w.value.push({...e,customId:r.setGuid(),answerType:e.richTextContent?"rich_text":e.examTypeEnum,answers:t,isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1}),e.pageIndex-f(e.customId)==1&&h();f(e.customId)>1&&h()},setAnswerRelation:function(e,t,n){if(e.length){const s=w.value.find((e=>e.customId===t));if(s){const t=s.answers?.find((e=>e.customAnswerId===n));t&&(t.answerRelations=e)}}}}),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,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(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(t.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":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,E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1
+ {"version":3,"file":"subject-list.vue.cjs","sources":["../../../../../../packages/components/src/subject-list/src/subject-list.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport SubjectBlankFill from './components/subject-blank-fill.vue'\nimport SubjectScale from './components/subject-scale.vue'\nimport SubjectSingle from './components/subject-single.vue'\nimport SubjectTextFill from './components/subject-text-fill.vue'\nimport SubjectRichText from './components/SubjectRichText.vue'\nimport SubjectPageEnd from './components/SubjectPageEnd.vue'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport { setGuid } from '@qxs-bns/utils'\n\ndefineOptions({\n name: 'QxsSubjectList',\n})\n\nconst props = defineProps<{\n subjectList: any[]\n isPreview: boolean\n}>()\nconst currentList = ref([] as any)\nconst emits = defineEmits(['setRelation'])\n\nconst attrs = useAttrs()\n\ndefineExpose({\n addSubject,\n currentList,\n uploadExcel,\n addExam,\n setAnswerRelation,\n})\n\nfunction totalPageIndex() {\n return currentList.value.filter((v: any) => v.answerType === 'page_end').length\n}\n\nfunction currentPageIndex(currentId: any) {\n const currentPageList = currentList.value.filter((v: any) => v.answerType === 'page_end')\n const currentIndex = currentPageList.findIndex((c: any) => c.customId === currentId)\n return currentIndex + 1\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 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\n if (item.pageIndex - currentPageIndex(item.customId) === 1) {\n addPageEnd()\n }\n\n if (currentPageIndex(item.customId) > 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 if (answerRelations.length) {\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}\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","currentPageIndex","currentId","value","filter","v","answerType","findIndex","c","customId","addPageEnd","push","setGuid","analysis","scaleQuestionList","isSave","isEdit","isRealCanDel","hasSet","examAnswerRelationType","addSubject","type","index","newSubject","splice","move","item","length","saveSubject","deleteSubject","ElMessage","success","setRelation","examAnswers","__expose","uploadExcel","list","concat","addExam","answerList","answers","map","title","answer","answerId","examAnswerId","isCorrect","richTextContent","examTypeEnum","pageIndex","setAnswerRelation","answerRelations","customAnswerId","targetItem","find","targetAnswer","watch","subjectList","newList","immediate","ns","useNamespace"],"mappings":"0sBAcA,MAAMA,EAAQC,EAIRC,EAAcC,EAAIA,IAAA,IAClBC,EAAQC,EAERC,EAAQC,EAAAA,WAcd,SAASC,EAAiBC,GAGxB,OAFwBP,EAAYQ,MAAMC,QAAQC,GAA4B,aAAjBA,EAAEC,aAC1BC,WAAWC,GAAWA,EAAEC,WAAaP,IACpD,CAAA,CAGxB,SAASQ,IACPf,EAAYQ,MAAMQ,KAAK,CACrBF,SAAUG,EAAAA,UACVN,WAAY,WACZO,SAAU,GACVC,kBAAmB,GACnBC,QAAQ,EACRC,QAAQ,EACRC,cAAc,EACdC,QAAQ,EACRC,uBAAwB,GACzB,CAGH,SAASC,EAAWC,EAAcC,EAAuB,KAAMH,EAAwC,MACrG,MAAMI,EAAa,CACjBd,SAAUG,EAAAA,UACVN,WAAYe,EACZR,SAAU,GACVC,kBAAmB,GACnBC,QAAQ,EACRC,QAAQ,EACRC,cAAc,EACdC,QAAQ,EACRC,0BAGY,OAAVG,EACF3B,EAAYQ,MAAMqB,OAAOF,EAAQ,EAAG,EAAGC,GAE3B5B,EAAAQ,MAAMQ,KAAKY,EACzB,CAmCO,SAAAE,EAAKH,EAAe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xB,OAAQ,CACpB,MAAA0B,EAAa1D,EAAYQ,MAAMmD,MAAMjD,GAAWA,EAAEI,WAAaA,IACrE,GAAI4C,EAAY,CACR,MAAAE,EAAeF,EAAWb,SAASc,MAAM9C,GAAWA,EAAE4C,iBAAmBA,IAC3EG,IACFA,EAAaJ,gBAAkBA,EACjC,CACF,CACF,IAGFK,EAAAA,OAAM,IAAM/D,EAAMgE,cAAcC,IAC1BA,IACU/D,EAAAQ,MAAQ,IAAIuD,GAAO,GAEhC,CAAEC,WAAW,IAEV,MAAAC,EAAKC,eAAa,6mIAzHflE,EAAYQ,MAAMC,QAAQC,GAA4B,aAAjBA,EAAEC,aAA2BqB"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@qxs-bns/components",
3
3
  "type": "module",
4
- "version": "0.0.35",
4
+ "version": "0.0.36",
5
5
  "description": "Vue 3 Component Library",
6
6
  "license": "MIT",
7
7
  "homepage": "https://trry-hub.github.io/qxs-bns/",
@@ -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: number, examAnswerRelationType: number | null) => void;
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;
@@ -2,7 +2,7 @@ type __VLS_Props = {
2
2
  subjectList: any[];
3
3
  isPreview: boolean;
4
4
  };
5
- declare function addSubject(type: string, index: number, examAnswerRelationType: number | null): void;
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":"AAmQA,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,GAAG,EAAE,CAAA;IAClB,SAAS,EAAE,OAAO,CAAA;CACnB,CAAC;AA4CF,iBAAS,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,sBAAsB,EAAE,MAAM,GAAG,IAAI,QA4BrF;AAED,iBAAS,OAAO,CAAC,IAAI,EAAE,GAAG,QAoBzB;AACD,iBAAS,WAAW,CAAC,IAAI,EAAE,GAAG,EAAE,QAE/B;AAoCD,iBAAS,iBAAiB,CAAC,eAAe,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,QAcxF;;;;;;;;;;;;AAwdD,wBAQG"}
1
+ {"version":3,"file":"subject-list.vue.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/subject-list/src/subject-list.vue"],"names":[],"mappings":"AAgPA,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,QA0BzB;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,QAUxF;;;;;;;;;;;;AA0dD,wBAQG"}