@qxs-bns/components 0.0.39 → 0.0.40

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.39";export{r as version};
1
+ var r="0.0.40";export{r as version};
2
2
  //# sourceMappingURL=package.json.mjs.map
@@ -1,2 +1,2 @@
1
- import{defineComponent as e,ref as s,useAttrs as t,computed as n,watch as i,createElementBlock as a,openBlock as o,normalizeClass as l,unref as r,createElementVNode as d,Fragment as c,renderList as m,createBlock as x,createCommentVNode as u,mergeProps as p}from"vue";import w from"./components/subject-blank-fill.vue.mjs";import v from"./components/subject-scale.vue.mjs";import y from"./components/subject-single.vue.mjs";import h from"./components/subject-text-fill.vue.mjs";import T from"./components/SubjectRichText.vue.mjs";import f from"./components/SubjectPageEnd.vue.mjs";import{useNamespace as A}from"@qxs-bns/hooks";import{setGuid as R}from"@qxs-bns/utils";import{ElMessage as E}from"element-plus/es";const S={class:"subject-list-wrapper"};var C=e({name:"QxsSubjectList",__name:"subject-list",props:{subjectList:{type:Array,required:!0},isPreview:{type:Boolean,required:!0}},emits:["setRelation"],setup(e,{expose:C,emit:g}){const D=e,j=s([]),b=g,I=t();C({addSubject:k,currentList:j,uploadExcel:function(e){j.value=j.value.concat(e)},addExam:function(e){console.log(e,"items");let s=1;const t=[];e.forEach((e=>{const n={...e,customId:R(),answerType:e.richTextContent?"rich_text":e.examTypeEnum,answers:e.answers?.map((e=>({...e,title:e.answer,answerId:e.examAnswerId,isCorrect:e.isCorrect})))||[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1};n.pageIndex>s&&(t.push({customId:R(),answerType:"page_end",analysis:"",scaleQuestionList:[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1,examAnswerRelationType:0}),s=n.pageIndex),t.push(n)})),j.value=j.value.concat(t)},setAnswerRelation:function(e,s,t){const n=j.value.find((e=>e.customId===s));if(n){const s=n.answers?.find((e=>e.customAnswerId===t));s&&(s.answerRelations=e)}}});const _=n((()=>{const e=j.value.filter((e=>"page_end"===e.answerType));return s=>{const t=e.findIndex((e=>e.customId===s));return-1!==t?t+1:0}}));function k(e,s=null,t=null){const n={customId:R(),answerType:e,analysis:"",scaleQuestionList:[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1,examAnswerRelationType:t};null!==s?j.value.splice(s+1,0,n):j.value.push(n)}function M(e,s){if("up"===s&&e>0){const[s]=j.value.splice(e,1);j.value.splice(e-1,0,s)}else if("down"===s&&e<j.value.length-1){const[s]=j.value.splice(e,1);j.value.splice(e+1,0,s)}}function L(e,s){j.value[e]={...j.value[e],...s,isEdit:!1,examAnswerRelationType:s.examAnswerRelationType}}function P(e){j.value.splice(e,1),E.success("删除成功")}function q(e,s){b("setRelation",e,s)}i((()=>D.subjectList),(e=>{e&&(j.value=[...e])}),{immediate:!0});const Q=A("subject-list");return(e,s)=>(o(),a("div",{class:l(r(Q).e("list-exam"))},[d("div",S,[(o(!0),a(c,null,m(r(j),((s,t)=>(o(),a("div",{key:s.customId,class:"subject-item"},[["single","multiple","sort"].includes(s.answerType)?(o(),x(y,p({key:0,ref_for:!0},r(I),{"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?(o(),x(v,p({key:1,ref_for:!0},r(I),{"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?(o(),x(w,p({key:2,ref_for:!0},r(I),{"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?(o(),x(h,p({key:3,ref_for:!0},r(I),{"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?(o(),x(T,p({key:4,ref_for:!0},r(I),{"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?(o(),x(f,{"total-page":j.value.filter((e=>"page_end"===e.answerType)).length,key:t,"current-page-index":r(_)(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{C as default};
1
+ import{defineComponent as e,ref as t,useAttrs as s,computed as n,watch as i,createElementBlock as a,openBlock as o,normalizeClass as l,unref as r,createElementVNode as d,Fragment as c,renderList as m,createBlock as u,createCommentVNode as x,mergeProps as p}from"vue";import w from"./components/subject-blank-fill.vue.mjs";import v from"./components/subject-scale.vue.mjs";import y from"./components/subject-single.vue.mjs";import h from"./components/subject-text-fill.vue.mjs";import T from"./components/SubjectRichText.vue.mjs";import f from"./components/SubjectPageEnd.vue.mjs";import{useNamespace as A}from"@qxs-bns/hooks";import{setGuid as R}from"@qxs-bns/utils";import{ElMessage as E}from"element-plus/es";const S={class:"subject-list-wrapper"};var g=e({name:"QxsSubjectList",__name:"subject-list",props:{subjectList:{type:Array,required:!0},isPreview:{type:Boolean,required:!0}},emits:["setRelation"],setup(e,{expose:g,emit:C}){const I=e,D=t([]),j=C,b=s();g({addSubject:M,currentList:D,uploadExcel:function(e){D.value=D.value.concat(e)},addExam:function(e){console.log(e,"items");let t=1;const s=[];e.forEach((e=>{const n={...e,customId:R(),answerType:e.richTextContent?"rich_text":e.examTypeEnum,answers:e.answers?.map((e=>({...e,title:e.answer,answerId:e.examAnswerId,isCorrect:e.isCorrect})))||[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1};n.pageIndex>t&&(s.push({customId:R(),answerType:"page_end",analysis:"",scaleQuestionList:[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1,examAnswerRelationType:0}),t=n.pageIndex),s.push(n)})),D.value=D.value.concat(s)},setAnswerRelation:function(e,t,s){const n=D.value.find((e=>e.customId===t));if(n){const t=n.answers?.find((e=>e.customAnswerId===s));t&&(t.answerRelations=e)}}});const _=n((()=>{const e=D.value.filter((e=>"page_end"===e.answerType));return t=>{const s=e.findIndex((e=>e.customId===t));return-1!==s?s+1:0}}));function k(){return e=>{let t=0,s=0;return D.value.forEach((n=>{"page_end"!==n.answerType&&(t++,e===n.customId&&(s=t))})),s-1}}function M(e,t=null,s=null){const n={customId:R(),answerType:e,analysis:"",scaleQuestionList:[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1,examAnswerRelationType:s};null!==t?D.value.splice(t+1,0,n):D.value.push(n)}function L(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 P(e,t){D.value[e]={...D.value[e],...t,isEdit:!1,examAnswerRelationType:t.examAnswerRelationType}}function q(e){D.value.splice(e,1),E.success("删除成功")}function Q(e,t){j("setRelation",e,t)}i((()=>I.subjectList),(e=>{e&&(D.value=[...e])}),{immediate:!0});const K=A("subject-list");return(e,t)=>(o(),a("div",{class:l(r(K).e("list-exam"))},[d("div",S,[(o(!0),a(c,null,m(r(D),((t,s)=>(o(),a("div",{key:t.customId,class:"subject-item"},[["single","multiple","sort"].includes(t.answerType)?(o(),u(y,p({key:0,ref_for:!0},r(b),{"order-index":k()(t.customId),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:Q,onMove:e=>L(s,e),onDelete:e=>q(s),onSave:e=>P(s,e),onEdit:e=>t.isEdit=!0,onAdd:(e,t)=>M(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?(o(),u(v,p({key:1,ref_for:!0},r(b),{"order-index":k()(t.customId),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=>L(s,e),onDelete:e=>q(s),onSave:e=>P(s,e),onEdit:e=>t.isEdit=!0,onAdd:e=>M(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?(o(),u(w,p({key:2,ref_for:!0},r(b),{"order-index":k()(t.customId),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=>L(s,e),onDelete:e=>q(s),onSave:e=>P(s,e),onEdit:e=>t.isEdit=!0,onAdd:e=>M(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?(o(),u(h,p({key:3,ref_for:!0},r(b),{"order-index":k()(t.customId),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=>L(s,e),onDelete:e=>q(s),onSave:e=>P(s,e),onEdit:e=>t.isEdit=!0,onAdd:e=>M(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?(o(),u(T,p({key:4,ref_for:!0},r(b),{"order-index":k()(t.customId),richTextContent:t.richTextContent,"is-set":t.hasSet||!1,"is-save":!t.isRealCanDel,"is-edit":t.isEdit||!1,"show-action":!e.isPreview,onMove:e=>L(s,e),onDelete:e=>q(s),examAnswerRelationType:t.examAnswerRelationType,onSave:e=>P(s,e),onEdit:e=>t.isEdit=!0,onAdd:e=>M(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?(o(),u(f,{"total-page":D.value.filter((e=>"page_end"===e.answerType)).length,key:s,"current-page-index":r(_)(t.customId),item:t,"is-edit":t.isEdit||!1,"is-set":t.hasSet||!1,"is-save":!t.isRealCanDel,examAnswerRelationType:t.examAnswerRelationType,onMove:e=>L(s,e),onDelete:e=>q(s),onSave:e=>P(s,e),onEdit:e=>t.isEdit=!0,onAdd:e=>M(e,s,null)},null,8,["total-page","current-page-index","item","is-edit","is-set","is-save","examAnswerRelationType","onMove","onDelete","onSave","onEdit","onAdd"])):x("v-if",!0)])))),128))])],2))}});export{g as default};
2
2
  //# sourceMappingURL=subject-list.vue.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"subject-list.vue.mjs","sources":["../../../../../../packages/components/src/subject-list/src/subject-list.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport SubjectBlankFill from './components/subject-blank-fill.vue'\nimport SubjectScale from './components/subject-scale.vue'\nimport SubjectSingle from './components/subject-single.vue'\nimport SubjectTextFill from './components/subject-text-fill.vue'\nimport SubjectRichText from './components/SubjectRichText.vue'\nimport SubjectPageEnd from './components/SubjectPageEnd.vue'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport { setGuid } from '@qxs-bns/utils'\n\ndefineOptions({\n name: 'QxsSubjectList',\n})\n\nconst props = defineProps<{\n subjectList: any[]\n isPreview: boolean\n}>()\nconst currentList = ref([] as any)\nconst emits = defineEmits(['setRelation'])\n\nconst attrs = useAttrs()\n\ndefineExpose({\n addSubject,\n currentList,\n uploadExcel,\n addExam,\n setAnswerRelation,\n})\n\nfunction totalPageIndex() {\n return currentList.value.filter((v: any) => v.answerType === 'page_end').length\n}\n\nconst currentPageIndex = computed(() => {\n const currentPageList = currentList.value.filter((v: any) => v.answerType === 'page_end')\n return (currentId: string) => {\n const currentIndex = currentPageList.findIndex((c: any) => c.customId === currentId)\n return currentIndex !== -1 ? currentIndex + 1 : 0\n }\n})\n\n// function 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\n// function addExam(item: any) {\n// let currentPageIndex = 1\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// 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.value.push(newItem)\n\n// if (item.pageIndex - currentPageIndex === 1) {\n// addPageEnd()\n// currentPageIndex++\n// }\n\n// if (currentPageIndex > 1) {\n// addPageEnd()\n// }\n// }\nfunction addExam(items: any[]) {\n console.log(items, 'items')\n\n let currentPageIndex = 1\n const newList: any[] = []\n\n items.forEach((v: any) => {\n // 创建新的题目对象\n const newItem = {\n ...v,\n customId: setGuid(),\n answerType: v.richTextContent ? 'rich_text' : v.examTypeEnum,\n answers: v.answers?.map((c: any) => ({\n ...c,\n title: c.answer,\n answerId: c.examAnswerId,\n isCorrect: c.isCorrect,\n })) || [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n }\n\n // 如果当前题目的 pageIndex 和 currentPageIndex 不一致,则插入分页器\n if (newItem.pageIndex > currentPageIndex) {\n newList.push({\n customId: setGuid(),\n answerType: 'page_end',\n analysis: '',\n scaleQuestionList: [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n examAnswerRelationType: 0,\n })\n currentPageIndex = newItem.pageIndex\n }\n\n // 将题目添加到 newList\n newList.push(newItem)\n })\n\n // 更新 currentList\n currentList.value = currentList.value.concat(newList)\n}\nfunction uploadExcel(list: any[]) {\n currentList.value = currentList.value.concat(list)\n}\n\nfunction move(index: number, type: 'up' | 'down') {\n if (type === 'up' && index > 0) {\n const [item] = currentList.value.splice(index, 1)\n currentList.value.splice(index - 1, 0, item)\n } else if (type === 'down' && index < currentList.value.length - 1) {\n const [item] = currentList.value.splice(index, 1)\n currentList.value.splice(index + 1, 0, item)\n }\n}\n\nfunction saveSubject(index: number, item: any) {\n currentList.value[index] = {\n ...currentList.value[index],\n ...item,\n isEdit: false,\n examAnswerRelationType: item.examAnswerRelationType,\n }\n}\n\nfunction deleteSubject(index: number) {\n currentList.value.splice(index, 1)\n ElMessage.success('删除成功')\n}\n\nfunction setRelation(customId: number, examAnswers: any) {\n emits('setRelation', customId, examAnswers)\n}\n\nfunction setAnswerRelation(answerRelations: any, customId: string, customAnswerId: string) {\n const targetItem = currentList.value.find((v: any) => v.customId === customId)\n if (targetItem) {\n const targetAnswer = targetItem.answers?.find((c: any) => c.customAnswerId === customAnswerId)\n if (targetAnswer) {\n targetAnswer.answerRelations = answerRelations\n }\n }\n}\n\nwatch(() => props.subjectList, (newList: any) => {\n if (newList) {\n currentList.value = [...newList]\n }\n}, { immediate: true })\n\nconst ns = useNamespace('subject-list')\n</script>\n\n<template>\n <div :class=\"ns.e('list-exam')\">\n <div class=\"subject-list-wrapper\">\n <div v-for=\"(item, index) in currentList\" :key=\"item.customId\" class=\"subject-item\">\n <template v-if=\"['single', 'multiple', 'sort'].includes(item.answerType)\">\n <SubjectSingle\n v-bind=\"attrs\"\n :order-index=\"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 />\n </template>\n <SubjectScale\n v-bind=\"attrs\"\n v-else-if=\"item.answerType === 'scale'\"\n :order-index=\"index\"\n :title=\"item.title\"\n :is-save=\"!item.isRealCanDel\"\n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\"\n :analysis=\"item.analysis\"\n :is-edit=\"item.isEdit || false\"\n :scale-question-list=\"item.scaleQuestionList\"\n :show-action=\"!isPreview\"\n :exam-rich-text-content=\"item.examRichTextContent\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n <SubjectBlankFill\n v-bind=\"attrs\"\n v-else-if=\"item.answerType === 'blank_fill'\"\n :order-index=\"index\"\n :title=\"item.title\"\n :is-save=\"!item.isRealCanDel\"\n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\"\n :analysis=\"item.analysis\"\n :show-action=\"!isPreview\"\n :is-edit=\"item.isEdit || false\"\n :exam-answer-setting-v-o=\"item.examAnswerSettingVO || {}\"\n :exam-rich-text-content=\"item.examRichTextContent\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n <SubjectTextFill\n v-bind=\"attrs\"\n v-else-if=\"item.answerType === 'text_fill'\"\n :order-index=\"index\"\n :title=\"item.title\"\n :is-save=\"!item.isRealCanDel\"\n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\"\n :analysis=\"item.analysis\"\n :show-action=\"!isPreview\"\n :is-edit=\"item.isEdit || false\"\n :exam-expand=\"item.examExpand\"\n :exam-answer-setting-v-o=\"item.examAnswerSettingVO || {}\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n :exam-rich-text-content=\"item.examRichTextContent\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n <SubjectRichText\n v-bind=\"attrs\"\n v-else-if=\"item.answerType === 'rich_text'\"\n :order-index=\"index\"\n :richTextContent=\"item.richTextContent\"\n :is-set=\"item.hasSet || false\"\n :is-save=\"!item.isRealCanDel\"\n :is-edit=\"item.isEdit || false\"\n :show-action=\"!isPreview\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n <SubjectPageEnd\n v-else-if=\"item.answerType === 'page_end'\"\n :total-page=\"totalPageIndex()\"\n :key=\"index\"\n :current-page-index=\"currentPageIndex(item.customId)\"\n :item=\"item\"\n :order-index=\"index\"\n :is-edit=\"item.isEdit || false\"\n :is-set=\"item.hasSet || false\"\n :is-save=\"!item.isRealCanDel\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n </div>\n </div>\n </div>\n</template>"],"names":["props","__props","currentList","ref","emits","__emit","attrs","useAttrs","__expose","addSubject","uploadExcel","list","value","concat","addExam","items","console","log","currentPageIndex","newList","forEach","v","newItem","customId","setGuid","answerType","richTextContent","examTypeEnum","answers","map","c","title","answer","answerId","examAnswerId","isCorrect","isSave","isEdit","isRealCanDel","hasSet","pageIndex","push","analysis","scaleQuestionList","examAnswerRelationType","setAnswerRelation","answerRelations","customAnswerId","targetItem","find","targetAnswer","computed","currentPageList","filter","currentId","currentIndex","findIndex","type","index","newSubject","splice","move","item","length","saveSubject","deleteSubject","ElMessage","success","setRelation","examAnswers","watch","subjectList","immediate","ns","useNamespace"],"mappings":"s6BAcA,MAAMA,EAAQC,EAIRC,EAAcC,EAAI,IAClBC,EAAQC,EAERC,EAAQC,IAEDC,EAAA,CACXC,aACAP,cACAQ,YAiIF,SAAqBC,GACnBT,EAAYU,MAAQV,EAAYU,MAAMC,OAAOF,EAAI,EAjIjDG,QAiFF,SAAiBC,GACPC,QAAAC,IAAIF,EAAO,SAEnB,IAAIG,EAAmB,EACvB,MAAMC,EAAiB,GAEjBJ,EAAAK,SAASC,IAEb,MAAMC,EAAU,IACXD,EACHE,SAAUC,IACVC,WAAYJ,EAAEK,gBAAkB,YAAcL,EAAEM,aAChDC,QAASP,EAAEO,SAASC,KAAKC,IAAY,IAChCA,EACHC,MAAOD,EAAEE,OACTC,SAAUH,EAAEI,aACZC,UAAWL,EAAEK,eACR,GACPC,QAAQ,EACRC,QAAQ,EACRC,cAAc,EACdC,QAAQ,GAINjB,EAAQkB,UAAYtB,IACtBC,EAAQsB,KAAK,CACXlB,SAAUC,IACVC,WAAY,WACZiB,SAAU,GACVC,kBAAmB,GACnBP,QAAQ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D,EAAYU,MAAMgD,OAAOF,EAAQ,EAAG,EAAGI,EAAI,CAC7C,CAGO,SAAAE,EAAYN,EAAeI,GACtB5D,EAAAU,MAAM8C,GAAS,IACtBxD,EAAYU,MAAM8C,MAClBI,EACHzB,QAAQ,EACRO,uBAAwBkB,EAAKlB,uBAC/B,CAGF,SAASqB,EAAcP,GACTxD,EAAAU,MAAMgD,OAAOF,EAAO,GAChCQ,EAAUC,QAAQ,OAAM,CAGjB,SAAAC,EAAY7C,EAAkB8C,GAC/BjE,EAAA,cAAemB,EAAU8C,EAAW,CAa5CC,GAAM,IAAMtE,EAAMuE,cAAcpD,IAC1BA,IACUjB,EAAAU,MAAQ,IAAIO,GAAO,GAEhC,CAAEqD,WAAW,IAEV,MAAAC,EAAKC,EAAa,2sHA3KfxE,EAAYU,MAAMyC,QAAQhC,GAA4B,aAAjBA,EAAEI,aAA2BsC"}
1
+ {"version":3,"file":"subject-list.vue.mjs","sources":["../../../../../../packages/components/src/subject-list/src/subject-list.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport SubjectBlankFill from './components/subject-blank-fill.vue'\nimport SubjectScale from './components/subject-scale.vue'\nimport SubjectSingle from './components/subject-single.vue'\nimport SubjectTextFill from './components/subject-text-fill.vue'\nimport SubjectRichText from './components/SubjectRichText.vue'\nimport SubjectPageEnd from './components/SubjectPageEnd.vue'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport { setGuid } from '@qxs-bns/utils'\n\ndefineOptions({\n name: 'QxsSubjectList',\n})\n\nconst props = defineProps<{\n subjectList: any[]\n isPreview: boolean\n}>()\nconst currentList = ref([] as any)\nconst emits = defineEmits(['setRelation'])\n\nconst attrs = useAttrs()\n\ndefineExpose({\n addSubject,\n currentList,\n uploadExcel,\n addExam,\n setAnswerRelation,\n})\n\nfunction totalPageIndex() {\n return currentList.value.filter((v: any) => v.answerType === 'page_end').length\n}\n\nconst currentPageIndex = computed(() => {\n const currentPageList = currentList.value.filter((v: any) => v.answerType === 'page_end')\n return (currentId: string) => {\n const currentIndex = currentPageList.findIndex((c: any) => c.customId === currentId)\n return currentIndex !== -1 ? currentIndex + 1 : 0\n }\n})\n\nfunction currentIndex() {\n return (currentExamId: string) => {\n let current = 0\n let output = 0\n\n // 遍历 currentList,过滤掉分页器,并计算题目序号\n currentList.value.forEach((v: any) => {\n if (v.answerType !== 'page_end') { // 排除分页器\n current++\n if (currentExamId === v.customId) { // 匹配当前题目 ID\n output = current\n }\n }\n })\n\n return output-1\n }\n}\n\nfunction addSubject(type: string, index: number | null = null, examAnswerRelationType: number | null = null) {\n const newSubject = {\n customId: setGuid(),\n answerType: type,\n analysis: '',\n scaleQuestionList: [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n examAnswerRelationType,\n }\n\n if (index !== null) {\n currentList.value.splice(index + 1, 0, newSubject)\n } else {\n currentList.value.push(newSubject)\n }\n}\nfunction addExam(items: any[]) {\n console.log(items, 'items')\n\n let currentIndex = 1\n const newList: any[] = []\n\n items.forEach((v: any) => {\n // 创建新的题目对象\n const newItem = {\n ...v,\n customId: setGuid(),\n answerType: v.richTextContent ? 'rich_text' : v.examTypeEnum,\n answers: v.answers?.map((c: any) => ({\n ...c,\n title: c.answer,\n answerId: c.examAnswerId,\n isCorrect: c.isCorrect,\n })) || [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n }\n\n // 如果当前题目的 pageIndex 和 currentIndex 不一致,则插入分页器\n if (newItem.pageIndex > currentIndex) {\n newList.push({\n customId: setGuid(),\n answerType: 'page_end',\n analysis: '',\n scaleQuestionList: [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n examAnswerRelationType: 0,\n })\n currentIndex = newItem.pageIndex\n }\n\n // 将题目添加到 newList\n newList.push(newItem)\n })\n\n // 更新 currentList\n currentList.value = currentList.value.concat(newList)\n}\nfunction uploadExcel(list: any[]) {\n currentList.value = currentList.value.concat(list)\n}\n\nfunction move(index: number, type: 'up' | 'down') {\n if (type === 'up' && index > 0) {\n const [item] = currentList.value.splice(index, 1)\n currentList.value.splice(index - 1, 0, item)\n } else if (type === 'down' && index < currentList.value.length - 1) {\n const [item] = currentList.value.splice(index, 1)\n currentList.value.splice(index + 1, 0, item)\n }\n}\n\nfunction saveSubject(index: number, item: any) {\n currentList.value[index] = {\n ...currentList.value[index],\n ...item,\n isEdit: false,\n examAnswerRelationType: item.examAnswerRelationType,\n }\n}\n\nfunction deleteSubject(index: number) {\n currentList.value.splice(index, 1)\n ElMessage.success('删除成功')\n}\n\nfunction setRelation(customId: number, examAnswers: any) {\n emits('setRelation', customId, examAnswers)\n}\n\nfunction setAnswerRelation(answerRelations: any, customId: string, customAnswerId: string) {\n const targetItem = currentList.value.find((v: any) => v.customId === customId)\n if (targetItem) {\n const targetAnswer = targetItem.answers?.find((c: any) => c.customAnswerId === customAnswerId)\n if (targetAnswer) {\n targetAnswer.answerRelations = answerRelations\n }\n }\n}\n\nwatch(() => props.subjectList, (newList: any) => {\n if (newList) {\n currentList.value = [...newList]\n }\n}, { immediate: true })\n\nconst ns = useNamespace('subject-list')\n</script>\n\n<template>\n <div :class=\"ns.e('list-exam')\">\n <div class=\"subject-list-wrapper\">\n <div v-for=\"(item, index) in currentList\" :key=\"item.customId\" class=\"subject-item\">\n <template v-if=\"['single', 'multiple', 'sort'].includes(item.answerType)\">\n <SubjectSingle\n v-bind=\"attrs\"\n :order-index=\"currentIndex()(item.customId)\"\n :title=\"item.title\"\n :type=\"item.answerType\"\n :exam-id=\"item.examId\"\n :isKey=\"item.isKey\"\n :is-save=\"!item.isRealCanDel\"\n :customId=\"item.customId\"\n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\"\n :analysis=\"item.analysis\"\n :least-answer-count=\"item.leastAnswerCount\"\n :is-edit=\"item.isEdit || false\"\n :show-action=\"!isPreview\"\n :exam-expand=\"item.examExpand\"\n :answerCheckType=\"item.answerCheckType\"\n :exam-rich-text-content=\"item.examRichTextContent\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n @setRelation=\"setRelation\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string, examAnswerRelationType: number) => addSubject(type, index, examAnswerRelationType)\"\n />\n </template>\n <SubjectScale\n v-bind=\"attrs\"\n v-else-if=\"item.answerType === 'scale'\"\n :order-index=\"currentIndex()(item.customId)\"\n :title=\"item.title\"\n :is-save=\"!item.isRealCanDel\"\n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\"\n :analysis=\"item.analysis\"\n :is-edit=\"item.isEdit || false\"\n :scale-question-list=\"item.scaleQuestionList\"\n :show-action=\"!isPreview\"\n :exam-rich-text-content=\"item.examRichTextContent\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n <SubjectBlankFill\n v-bind=\"attrs\"\n v-else-if=\"item.answerType === 'blank_fill'\"\n :order-index=\"currentIndex()(item.customId)\"\n :title=\"item.title\"\n :is-save=\"!item.isRealCanDel\"\n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\"\n :analysis=\"item.analysis\"\n :show-action=\"!isPreview\"\n :is-edit=\"item.isEdit || false\"\n :exam-answer-setting-v-o=\"item.examAnswerSettingVO || {}\"\n :exam-rich-text-content=\"item.examRichTextContent\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n <SubjectTextFill\n v-bind=\"attrs\"\n v-else-if=\"item.answerType === 'text_fill'\"\n :order-index=\"currentIndex()(item.customId)\"\n :title=\"item.title\"\n :is-save=\"!item.isRealCanDel\"\n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\"\n :analysis=\"item.analysis\"\n :show-action=\"!isPreview\"\n :is-edit=\"item.isEdit || false\"\n :exam-expand=\"item.examExpand\"\n :exam-answer-setting-v-o=\"item.examAnswerSettingVO || {}\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n :exam-rich-text-content=\"item.examRichTextContent\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n <SubjectRichText\n v-bind=\"attrs\"\n :order-index=\"currentIndex()(item.customId)\"\n v-else-if=\"item.answerType === 'rich_text'\"\n :richTextContent=\"item.richTextContent\"\n :is-set=\"item.hasSet || false\"\n :is-save=\"!item.isRealCanDel\"\n :is-edit=\"item.isEdit || false\"\n :show-action=\"!isPreview\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n <SubjectPageEnd\n v-else-if=\"item.answerType === 'page_end'\"\n :total-page=\"totalPageIndex()\"\n :key=\"index\"\n :current-page-index=\"currentPageIndex(item.customId)\"\n :item=\"item\"\n :is-edit=\"item.isEdit || false\"\n :is-set=\"item.hasSet || false\"\n :is-save=\"!item.isRealCanDel\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n </div>\n </div>\n </div>\n</template>"],"names":["props","__props","currentList","ref","emits","__emit","attrs","useAttrs","__expose","addSubject","uploadExcel","list","value","concat","addExam","items","console","log","currentIndex","newList","forEach","v","newItem","customId","setGuid","answerType","richTextContent","examTypeEnum","answers","map","c","title","answer","answerId","examAnswerId","isCorrect","isSave","isEdit","isRealCanDel","hasSet","pageIndex","push","analysis","scaleQuestionList","examAnswerRelationType","setAnswerRelation","answerRelations","customAnswerId","targetItem","find","targetAnswer","currentPageIndex","computed","currentPageList","filter","currentId","findIndex","currentExamId","current","output","type","index","newSubject","splice","move","item","length","saveSubject","deleteSubject","ElMessage","success","setRelation","examAnswers","watch","subjectList","immediate","ns","useNamespace"],"mappings":"s6BAcA,MAAMA,EAAQC,EAIRC,EAAcC,EAAI,IAClBC,EAAQC,EAERC,EAAQC,IAEDC,EAAA,CACXC,aACAP,cACAQ,YAsGF,SAAqBC,GACnBT,EAAYU,MAAQV,EAAYU,MAAMC,OAAOF,EAAI,EAtGjDG,QAsDF,SAAiBC,GACPC,QAAAC,IAAIF,EAAO,SAEnB,IAAIG,EAAe,EACnB,MAAMC,EAAiB,GAEjBJ,EAAAK,SAASC,IAEb,MAAMC,EAAU,IACXD,EACHE,SAAUC,IACVC,WAAYJ,EAAEK,gBAAkB,YAAcL,EAAEM,aAChDC,QAASP,EAAEO,SAASC,KAAKC,IAAY,IAChCA,EACHC,MAAOD,EAAEE,OACTC,SAAUH,EAAEI,aACZC,UAAWL,EAAEK,eACR,GACPC,QAAQ,EACRC,QAAQ,EACRC,cAAc,EACdC,QAAQ,GAINjB,EAAQkB,UAAYtB,IACtBC,EAAQsB,KAAK,CACXlB,SAAUC,IACVC,WAAY,WACZiB,SAAU,GACVC,kBAAmB,GACnBP,QAAQ,EACRC,QAAQ,EACRC,cAAc,EACdC,QAAQ,EACRK,uBAAwB,IAE1B1B,EAAeI,EAAQkB,WAIzBrB,EAAQsB,KAAKnB,EAAO,IAItBpB,EAAYU,MAAQV,EAAYU,MAAMC,OAAOM,EAAO,EAlGpD0B,kBAoIO,SAAk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AYU,MAAMmD,OAAOF,EAAQ,EAAG,EAAGI,EAAI,CAC7C,CAGO,SAAAE,EAAYN,EAAeI,GACtB/D,EAAAU,MAAMiD,GAAS,IACtB3D,EAAYU,MAAMiD,MAClBI,EACH5B,QAAQ,EACRO,uBAAwBqB,EAAKrB,uBAC/B,CAGF,SAASwB,EAAcP,GACT3D,EAAAU,MAAMmD,OAAOF,EAAO,GAChCQ,EAAUC,QAAQ,OAAM,CAGjB,SAAAC,EAAYhD,EAAkBiD,GAC/BpE,EAAA,cAAemB,EAAUiD,EAAW,CAa5CC,GAAM,IAAMzE,EAAM0E,cAAcvD,IAC1BA,IACUjB,EAAAU,MAAQ,IAAIO,GAAO,GAEhC,CAAEwD,WAAW,IAEV,MAAAC,EAAKC,EAAa,ixHAhJf3E,EAAYU,MAAM0C,QAAQjC,GAA4B,aAAjBA,EAAEI,aAA2ByC"}
@@ -1,2 +1,2 @@
1
- "use strict";exports.version="0.0.39";
1
+ "use strict";exports.version="0.0.40";
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();p({addSubject:h,currentList:w,uploadExcel:function(e){w.value=w.value.concat(e)},addExam:function(e){console.log(e,"items");let t=1;const n=[];e.forEach((e=>{const s={...e,customId:r.setGuid(),answerType:e.richTextContent?"rich_text":e.examTypeEnum,answers:e.answers?.map((e=>({...e,title:e.answer,answerId:e.examAnswerId,isCorrect:e.isCorrect})))||[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1};s.pageIndex>t&&(n.push({customId:r.setGuid(),answerType:"page_end",analysis:"",scaleQuestionList:[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1,examAnswerRelationType:0}),t=s.pageIndex),n.push(s)})),w.value=w.value.concat(n)},setAnswerRelation:function(e,t,n){const s=w.value.find((e=>e.customId===t));if(s){const t=s.answers?.find((e=>e.customAnswerId===n));t&&(t.answerRelations=e)}}});const f=e.computed((()=>{const e=w.value.filter((e=>"page_end"===e.answerType));return t=>{const n=e.findIndex((e=>e.customId===t));return-1!==n?n+1:0}}));function h(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 T(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){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)}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: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:E,onMove:e=>T(c,e),onDelete:e=>R(c),onSave:e=>A(c,e),onEdit:e=>r.isEdit=!0,onAdd:(e,t)=>h(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=>T(c,e),onDelete:e=>R(c),onSave:e=>A(c,e),onEdit:e=>r.isEdit=!0,onAdd:e=>h(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=>T(c,e),onDelete:e=>R(c),onSave:e=>A(c,e),onEdit:e=>r.isEdit=!0,onAdd:e=>h(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=>T(c,e),onDelete:e=>R(c),onSave:e=>A(c,e),onEdit:e=>r.isEdit=!0,onAdd:e=>h(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=>T(c,e),onDelete:e=>R(c),examAnswerRelationType:r.examAnswerRelationType,onSave:e=>A(c,e),onEdit:e=>r.isEdit=!0,onAdd:e=>h(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=>T(c,e),onDelete:e=>R(c),onSave:e=>A(c,e),onEdit:e=>r.isEdit=!0,onAdd:e=>h(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:m,emit:p}){const x=u,w=e.ref([]),v=p,y=e.useAttrs();m({addSubject:T,currentList:w,uploadExcel:function(e){w.value=w.value.concat(e)},addExam:function(e){console.log(e,"items");let t=1;const n=[];e.forEach((e=>{const s={...e,customId:r.setGuid(),answerType:e.richTextContent?"rich_text":e.examTypeEnum,answers:e.answers?.map((e=>({...e,title:e.answer,answerId:e.examAnswerId,isCorrect:e.isCorrect})))||[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1};s.pageIndex>t&&(n.push({customId:r.setGuid(),answerType:"page_end",analysis:"",scaleQuestionList:[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1,examAnswerRelationType:0}),t=s.pageIndex),n.push(s)})),w.value=w.value.concat(n)},setAnswerRelation:function(e,t,n){const s=w.value.find((e=>e.customId===t));if(s){const t=s.answers?.find((e=>e.customAnswerId===n));t&&(t.answerRelations=e)}}});const f=e.computed((()=>{const e=w.value.filter((e=>"page_end"===e.answerType));return t=>{const n=e.findIndex((e=>e.customId===t));return-1!==n?n+1:0}}));function h(){return e=>{let t=0,n=0;return w.value.forEach((s=>{"page_end"!==s.answerType&&(t++,e===s.customId&&(n=t))})),n-1}}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 E(e,t){w.value[e]={...w.value[e],...t,isEdit:!1,examAnswerRelationType:t.examAnswerRelationType}}function R(e){w.value.splice(e,1),c.ElMessage.success("删除成功")}function k(e,t){v("setRelation",e,t)}e.watch((()=>x.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":h()(r.customId),title:r.title,type:r.answerType,"exam-id":r.examId,isKey:r.isKey,"is-save":!r.isRealCanDel,customId:r.customId,"is-set":r.hasSet||!1,"answer-list":r.answers,analysis:r.analysis,"least-answer-count":r.leastAnswerCount,"is-edit":r.isEdit||!1,"show-action":!l.isPreview,"exam-expand":r.examExpand,answerCheckType:r.answerCheckType,"exam-rich-text-content":r.examRichTextContent,examAnswerRelationType:r.examAnswerRelationType,onSetRelation:k,onMove:e=>A(c,e),onDelete:e=>R(c),onSave:e=>E(c,e),onEdit:e=>r.isEdit=!0,onAdd:(e,t)=>T(e,c,t)}),null,16,["order-index","title","type","exam-id","isKey","is-save","customId","is-set","answer-list","analysis","least-answer-count","is-edit","show-action","exam-expand","answerCheckType","exam-rich-text-content","examAnswerRelationType","onMove","onDelete","onSave","onEdit","onAdd"])):"scale"===r.answerType?(e.openBlock(),e.createBlock(n.default,e.mergeProps({key:1,ref_for:!0},e.unref(y),{"order-index":h()(r.customId),title:r.title,"is-save":!r.isRealCanDel,"is-set":r.hasSet||!1,"answer-list":r.answers,analysis:r.analysis,"is-edit":r.isEdit||!1,"scale-question-list":r.scaleQuestionList,"show-action":!l.isPreview,"exam-rich-text-content":r.examRichTextContent,examAnswerRelationType:r.examAnswerRelationType,onMove:e=>A(c,e),onDelete:e=>R(c),onSave:e=>E(c,e),onEdit:e=>r.isEdit=!0,onAdd:e=>T(e,c,null)}),null,16,["order-index","title","is-save","is-set","answer-list","analysis","is-edit","scale-question-list","show-action","exam-rich-text-content","examAnswerRelationType","onMove","onDelete","onSave","onEdit","onAdd"])):"blank_fill"===r.answerType?(e.openBlock(),e.createBlock(t.default,e.mergeProps({key:2,ref_for:!0},e.unref(y),{"order-index":h()(r.customId),title:r.title,"is-save":!r.isRealCanDel,"is-set":r.hasSet||!1,"answer-list":r.answers,analysis:r.analysis,"show-action":!l.isPreview,"is-edit":r.isEdit||!1,"exam-answer-setting-v-o":r.examAnswerSettingVO||{},"exam-rich-text-content":r.examRichTextContent,examAnswerRelationType:r.examAnswerRelationType,onMove:e=>A(c,e),onDelete:e=>R(c),onSave:e=>E(c,e),onEdit:e=>r.isEdit=!0,onAdd:e=>T(e,c,null)}),null,16,["order-index","title","is-save","is-set","answer-list","analysis","show-action","is-edit","exam-answer-setting-v-o","exam-rich-text-content","examAnswerRelationType","onMove","onDelete","onSave","onEdit","onAdd"])):"text_fill"===r.answerType?(e.openBlock(),e.createBlock(i.default,e.mergeProps({key:3,ref_for:!0},e.unref(y),{"order-index":h()(r.customId),title:r.title,"is-save":!r.isRealCanDel,"is-set":r.hasSet||!1,"answer-list":r.answers,analysis:r.analysis,"show-action":!l.isPreview,"is-edit":r.isEdit||!1,"exam-expand":r.examExpand,"exam-answer-setting-v-o":r.examAnswerSettingVO||{},examAnswerRelationType:r.examAnswerRelationType,"exam-rich-text-content":r.examRichTextContent,onMove:e=>A(c,e),onDelete:e=>R(c),onSave:e=>E(c,e),onEdit:e=>r.isEdit=!0,onAdd:e=>T(e,c,null)}),null,16,["order-index","title","is-save","is-set","answer-list","analysis","show-action","is-edit","exam-expand","exam-answer-setting-v-o","examAnswerRelationType","exam-rich-text-content","onMove","onDelete","onSave","onEdit","onAdd"])):"rich_text"===r.answerType?(e.openBlock(),e.createBlock(a.default,e.mergeProps({key:4,ref_for:!0},e.unref(y),{"order-index":h()(r.customId),richTextContent:r.richTextContent,"is-set":r.hasSet||!1,"is-save":!r.isRealCanDel,"is-edit":r.isEdit||!1,"show-action":!l.isPreview,onMove:e=>A(c,e),onDelete:e=>R(c),examAnswerRelationType:r.examAnswerRelationType,onSave:e=>E(c,e),onEdit:e=>r.isEdit=!0,onAdd:e=>T(e,c,null)}),null,16,["order-index","richTextContent","is-set","is-save","is-edit","show-action","onMove","onDelete","examAnswerRelationType","onSave","onEdit","onAdd"])):"page_end"===r.answerType?(e.openBlock(),e.createBlock(o.default,{"total-page":w.value.filter((e=>"page_end"===e.answerType)).length,key:c,"current-page-index":e.unref(f)(r.customId),item:r,"is-edit":r.isEdit||!1,"is-set":r.hasSet||!1,"is-save":!r.isRealCanDel,examAnswerRelationType:r.examAnswerRelationType,onMove:e=>A(c,e),onDelete:e=>R(c),onSave:e=>E(c,e),onEdit:e=>r.isEdit=!0,onAdd:e=>T(e,c,null)},null,8,["total-page","current-page-index","item","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\">\nimport SubjectBlankFill from './components/subject-blank-fill.vue'\nimport SubjectScale from './components/subject-scale.vue'\nimport SubjectSingle from './components/subject-single.vue'\nimport SubjectTextFill from './components/subject-text-fill.vue'\nimport SubjectRichText from './components/SubjectRichText.vue'\nimport SubjectPageEnd from './components/SubjectPageEnd.vue'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport { setGuid } from '@qxs-bns/utils'\n\ndefineOptions({\n name: 'QxsSubjectList',\n})\n\nconst props = defineProps<{\n subjectList: any[]\n isPreview: boolean\n}>()\nconst currentList = ref([] as any)\nconst emits = defineEmits(['setRelation'])\n\nconst attrs = useAttrs()\n\ndefineExpose({\n addSubject,\n currentList,\n uploadExcel,\n addExam,\n setAnswerRelation,\n})\n\nfunction totalPageIndex() {\n return currentList.value.filter((v: any) => v.answerType === 'page_end').length\n}\n\nconst currentPageIndex = computed(() => {\n const currentPageList = currentList.value.filter((v: any) => v.answerType === 'page_end')\n return (currentId: string) => {\n const currentIndex = currentPageList.findIndex((c: any) => c.customId === currentId)\n return currentIndex !== -1 ? currentIndex + 1 : 0\n }\n})\n\n// function 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\n// function addExam(item: any) {\n// let currentPageIndex = 1\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// 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.value.push(newItem)\n\n// if (item.pageIndex - currentPageIndex === 1) {\n// addPageEnd()\n// currentPageIndex++\n// }\n\n// if (currentPageIndex > 1) {\n// addPageEnd()\n// }\n// }\nfunction addExam(items: any[]) {\n console.log(items, 'items')\n\n let currentPageIndex = 1\n const newList: any[] = []\n\n items.forEach((v: any) => {\n // 创建新的题目对象\n const newItem = {\n ...v,\n customId: setGuid(),\n answerType: v.richTextContent ? 'rich_text' : v.examTypeEnum,\n answers: v.answers?.map((c: any) => ({\n ...c,\n title: c.answer,\n answerId: c.examAnswerId,\n isCorrect: c.isCorrect,\n })) || [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n }\n\n // 如果当前题目的 pageIndex 和 currentPageIndex 不一致,则插入分页器\n if (newItem.pageIndex > currentPageIndex) {\n newList.push({\n customId: setGuid(),\n answerType: 'page_end',\n analysis: '',\n scaleQuestionList: [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n examAnswerRelationType: 0,\n })\n currentPageIndex = newItem.pageIndex\n }\n\n // 将题目添加到 newList\n newList.push(newItem)\n })\n\n // 更新 currentList\n currentList.value = currentList.value.concat(newList)\n}\nfunction uploadExcel(list: any[]) {\n currentList.value = currentList.value.concat(list)\n}\n\nfunction move(index: number, type: 'up' | 'down') {\n if (type === 'up' && index > 0) {\n const [item] = currentList.value.splice(index, 1)\n currentList.value.splice(index - 1, 0, item)\n } else if (type === 'down' && index < currentList.value.length - 1) {\n const [item] = currentList.value.splice(index, 1)\n currentList.value.splice(index + 1, 0, item)\n }\n}\n\nfunction saveSubject(index: number, item: any) {\n currentList.value[index] = {\n ...currentList.value[index],\n ...item,\n isEdit: false,\n examAnswerRelationType: item.examAnswerRelationType,\n }\n}\n\nfunction deleteSubject(index: number) {\n currentList.value.splice(index, 1)\n ElMessage.success('删除成功')\n}\n\nfunction setRelation(customId: number, examAnswers: any) {\n emits('setRelation', customId, examAnswers)\n}\n\nfunction setAnswerRelation(answerRelations: any, customId: string, customAnswerId: string) {\n const targetItem = currentList.value.find((v: any) => v.customId === customId)\n if (targetItem) {\n const targetAnswer = targetItem.answers?.find((c: any) => c.customAnswerId === customAnswerId)\n if (targetAnswer) {\n targetAnswer.answerRelations = answerRelations\n }\n }\n}\n\nwatch(() => props.subjectList, (newList: any) => {\n if (newList) {\n currentList.value = [...newList]\n }\n}, { immediate: true })\n\nconst ns = useNamespace('subject-list')\n</script>\n\n<template>\n <div :class=\"ns.e('list-exam')\">\n <div class=\"subject-list-wrapper\">\n <div v-for=\"(item, index) in currentList\" :key=\"item.customId\" class=\"subject-item\">\n <template v-if=\"['single', 'multiple', 'sort'].includes(item.answerType)\">\n <SubjectSingle\n v-bind=\"attrs\"\n :order-index=\"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 />\n </template>\n <SubjectScale\n v-bind=\"attrs\"\n v-else-if=\"item.answerType === 'scale'\"\n :order-index=\"index\"\n :title=\"item.title\"\n :is-save=\"!item.isRealCanDel\"\n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\"\n :analysis=\"item.analysis\"\n :is-edit=\"item.isEdit || false\"\n :scale-question-list=\"item.scaleQuestionList\"\n :show-action=\"!isPreview\"\n :exam-rich-text-content=\"item.examRichTextContent\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n <SubjectBlankFill\n v-bind=\"attrs\"\n v-else-if=\"item.answerType === 'blank_fill'\"\n :order-index=\"index\"\n :title=\"item.title\"\n :is-save=\"!item.isRealCanDel\"\n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\"\n :analysis=\"item.analysis\"\n :show-action=\"!isPreview\"\n :is-edit=\"item.isEdit || false\"\n :exam-answer-setting-v-o=\"item.examAnswerSettingVO || {}\"\n :exam-rich-text-content=\"item.examRichTextContent\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n <SubjectTextFill\n v-bind=\"attrs\"\n v-else-if=\"item.answerType === 'text_fill'\"\n :order-index=\"index\"\n :title=\"item.title\"\n :is-save=\"!item.isRealCanDel\"\n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\"\n :analysis=\"item.analysis\"\n :show-action=\"!isPreview\"\n :is-edit=\"item.isEdit || false\"\n :exam-expand=\"item.examExpand\"\n :exam-answer-setting-v-o=\"item.examAnswerSettingVO || {}\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n :exam-rich-text-content=\"item.examRichTextContent\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n <SubjectRichText\n v-bind=\"attrs\"\n v-else-if=\"item.answerType === 'rich_text'\"\n :order-index=\"index\"\n :richTextContent=\"item.richTextContent\"\n :is-set=\"item.hasSet || false\"\n :is-save=\"!item.isRealCanDel\"\n :is-edit=\"item.isEdit || false\"\n :show-action=\"!isPreview\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n <SubjectPageEnd\n v-else-if=\"item.answerType === 'page_end'\"\n :total-page=\"totalPageIndex()\"\n :key=\"index\"\n :current-page-index=\"currentPageIndex(item.customId)\"\n :item=\"item\"\n :order-index=\"index\"\n :is-edit=\"item.isEdit || false\"\n :is-set=\"item.hasSet || false\"\n :is-save=\"!item.isRealCanDel\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n </div>\n </div>\n </div>\n</template>"],"names":["props","__props","currentList","ref","emits","__emit","attrs","useAttrs","__expose","addSubject","uploadExcel","list","value","concat","addExam","items","console","log","currentPageIndex","newList","forEach","v","newItem","customId","setGuid","answerType","richTextContent","examTypeEnum","answers","map","c","title","answer","answerId","examAnswerId","isCorrect","isSave","isEdit","isRealCanDel","hasSet","pageIndex","push","analysis","scaleQuestionList","examAnswerRelationType","setAnswerRelation","answerRelations","customAnswerId","targetItem","find","targetAnswer","computed","currentPageList","filter","currentId","currentIndex","findIndex","type","index","newSubject","splice","move","item","length","saveSubject","deleteSubject","ElMessage","success","setRelation","examAnswers","watch","subjectList","immediate","ns","useNamespace"],"mappings":"0sBAcA,MAAMA,EAAQC,EAIRC,EAAcC,EAAIA,IAAA,IAClBC,EAAQC,EAERC,EAAQC,EAAAA,WAEDC,EAAA,CACXC,aACAP,cACAQ,YAiIF,SAAqBC,GACnBT,EAAYU,MAAQV,EAAYU,MAAMC,OAAOF,EAAI,EAjIjDG,QAiFF,SAAiBC,GACPC,QAAAC,IAAIF,EAAO,SAEnB,IAAIG,EAAmB,EACvB,MAAMC,EAAiB,GAEjBJ,EAAAK,SAASC,IAEb,MAAMC,EAAU,IACXD,EACHE,SAAUC,EAAAA,UACVC,WAAYJ,EAAEK,gBAAkB,YAAcL,EAAEM,aAChDC,QAASP,EAAEO,SAASC,KAAKC,IAAY,IAChCA,EACHC,MAAOD,EAAEE,OACTC,SAAUH,EAAEI,aACZC,UAAWL,EAAEK,eACR,GACPC,QAAQ,EACRC,QAAQ,EACRC,cAAc,EACdC,QAAQ,GAINjB,EAAQkB,UAAYtB,IACtBC,EAAQsB,KAAK,CACXlB,SAAUC,EAAAA,UACVC,WAAY,WACZiB,SAAU,GACVC,kBAAmB,GACnBP,QAAQ,EACRC,QAAQ,EACRC,cAAc,EACdC,QAAQ,EACRK,uBAAwB,IAE1B1B,EAAmBI,EAAQkB,WAI7BrB,EAAQsB,KAAKnB,EAAO,IAItBpB,EAAYU,MAAQV,EAAYU,MAAMC,OAAOM,EAAO,EA7HpD0B,kBA+JO,SAAkBC,EAAsBvB,EAAkBwB,GAC3D,MAAAC,EAAa9C,EAAYU,MAAMqC,MAAM5B,GAAWA,EAAEE,WAAaA,IACrE,GAAIyB,EAAY,CACR,MAAAE,EAAeF,EAAWpB,SAASqB,MAAMnB,GAAWA,EAAEiB,iBAAmBA,IAC3EG,IACFA,EAAaJ,gBAAkBA,EACjC,C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uE,cAAcpD,IAC1BA,IACUjB,EAAAU,MAAQ,IAAIO,GAAO,GAEhC,CAAEqD,WAAW,IAEV,MAAAC,EAAKC,eAAa,6mIA3KfxE,EAAYU,MAAMyC,QAAQhC,GAA4B,aAAjBA,EAAEI,aAA2BsC"}
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\nconst currentPageIndex = computed(() => {\n const currentPageList = currentList.value.filter((v: any) => v.answerType === 'page_end')\n return (currentId: string) => {\n const currentIndex = currentPageList.findIndex((c: any) => c.customId === currentId)\n return currentIndex !== -1 ? currentIndex + 1 : 0\n }\n})\n\nfunction currentIndex() {\n return (currentExamId: string) => {\n let current = 0\n let output = 0\n\n // 遍历 currentList,过滤掉分页器,并计算题目序号\n currentList.value.forEach((v: any) => {\n if (v.answerType !== 'page_end') { // 排除分页器\n current++\n if (currentExamId === v.customId) { // 匹配当前题目 ID\n output = current\n }\n }\n })\n\n return output-1\n }\n}\n\nfunction addSubject(type: string, index: number | null = null, examAnswerRelationType: number | null = null) {\n const newSubject = {\n customId: setGuid(),\n answerType: type,\n analysis: '',\n scaleQuestionList: [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n examAnswerRelationType,\n }\n\n if (index !== null) {\n currentList.value.splice(index + 1, 0, newSubject)\n } else {\n currentList.value.push(newSubject)\n }\n}\nfunction addExam(items: any[]) {\n console.log(items, 'items')\n\n let currentIndex = 1\n const newList: any[] = []\n\n items.forEach((v: any) => {\n // 创建新的题目对象\n const newItem = {\n ...v,\n customId: setGuid(),\n answerType: v.richTextContent ? 'rich_text' : v.examTypeEnum,\n answers: v.answers?.map((c: any) => ({\n ...c,\n title: c.answer,\n answerId: c.examAnswerId,\n isCorrect: c.isCorrect,\n })) || [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n }\n\n // 如果当前题目的 pageIndex 和 currentIndex 不一致,则插入分页器\n if (newItem.pageIndex > currentIndex) {\n newList.push({\n customId: setGuid(),\n answerType: 'page_end',\n analysis: '',\n scaleQuestionList: [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n examAnswerRelationType: 0,\n })\n currentIndex = newItem.pageIndex\n }\n\n // 将题目添加到 newList\n newList.push(newItem)\n })\n\n // 更新 currentList\n currentList.value = currentList.value.concat(newList)\n}\nfunction uploadExcel(list: any[]) {\n currentList.value = currentList.value.concat(list)\n}\n\nfunction move(index: number, type: 'up' | 'down') {\n if (type === 'up' && index > 0) {\n const [item] = currentList.value.splice(index, 1)\n currentList.value.splice(index - 1, 0, item)\n } else if (type === 'down' && index < currentList.value.length - 1) {\n const [item] = currentList.value.splice(index, 1)\n currentList.value.splice(index + 1, 0, item)\n }\n}\n\nfunction saveSubject(index: number, item: any) {\n currentList.value[index] = {\n ...currentList.value[index],\n ...item,\n isEdit: false,\n examAnswerRelationType: item.examAnswerRelationType,\n }\n}\n\nfunction deleteSubject(index: number) {\n currentList.value.splice(index, 1)\n ElMessage.success('删除成功')\n}\n\nfunction setRelation(customId: number, examAnswers: any) {\n emits('setRelation', customId, examAnswers)\n}\n\nfunction setAnswerRelation(answerRelations: any, customId: string, customAnswerId: string) {\n const targetItem = currentList.value.find((v: any) => v.customId === customId)\n if (targetItem) {\n const targetAnswer = targetItem.answers?.find((c: any) => c.customAnswerId === customAnswerId)\n if (targetAnswer) {\n targetAnswer.answerRelations = answerRelations\n }\n }\n}\n\nwatch(() => props.subjectList, (newList: any) => {\n if (newList) {\n currentList.value = [...newList]\n }\n}, { immediate: true })\n\nconst ns = useNamespace('subject-list')\n</script>\n\n<template>\n <div :class=\"ns.e('list-exam')\">\n <div class=\"subject-list-wrapper\">\n <div v-for=\"(item, index) in currentList\" :key=\"item.customId\" class=\"subject-item\">\n <template v-if=\"['single', 'multiple', 'sort'].includes(item.answerType)\">\n <SubjectSingle\n v-bind=\"attrs\"\n :order-index=\"currentIndex()(item.customId)\"\n :title=\"item.title\"\n :type=\"item.answerType\"\n :exam-id=\"item.examId\"\n :isKey=\"item.isKey\"\n :is-save=\"!item.isRealCanDel\"\n :customId=\"item.customId\"\n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\"\n :analysis=\"item.analysis\"\n :least-answer-count=\"item.leastAnswerCount\"\n :is-edit=\"item.isEdit || false\"\n :show-action=\"!isPreview\"\n :exam-expand=\"item.examExpand\"\n :answerCheckType=\"item.answerCheckType\"\n :exam-rich-text-content=\"item.examRichTextContent\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n @setRelation=\"setRelation\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string, examAnswerRelationType: number) => addSubject(type, index, examAnswerRelationType)\"\n />\n </template>\n <SubjectScale\n v-bind=\"attrs\"\n v-else-if=\"item.answerType === 'scale'\"\n :order-index=\"currentIndex()(item.customId)\"\n :title=\"item.title\"\n :is-save=\"!item.isRealCanDel\"\n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\"\n :analysis=\"item.analysis\"\n :is-edit=\"item.isEdit || false\"\n :scale-question-list=\"item.scaleQuestionList\"\n :show-action=\"!isPreview\"\n :exam-rich-text-content=\"item.examRichTextContent\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n <SubjectBlankFill\n v-bind=\"attrs\"\n v-else-if=\"item.answerType === 'blank_fill'\"\n :order-index=\"currentIndex()(item.customId)\"\n :title=\"item.title\"\n :is-save=\"!item.isRealCanDel\"\n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\"\n :analysis=\"item.analysis\"\n :show-action=\"!isPreview\"\n :is-edit=\"item.isEdit || false\"\n :exam-answer-setting-v-o=\"item.examAnswerSettingVO || {}\"\n :exam-rich-text-content=\"item.examRichTextContent\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n <SubjectTextFill\n v-bind=\"attrs\"\n v-else-if=\"item.answerType === 'text_fill'\"\n :order-index=\"currentIndex()(item.customId)\"\n :title=\"item.title\"\n :is-save=\"!item.isRealCanDel\"\n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\"\n :analysis=\"item.analysis\"\n :show-action=\"!isPreview\"\n :is-edit=\"item.isEdit || false\"\n :exam-expand=\"item.examExpand\"\n :exam-answer-setting-v-o=\"item.examAnswerSettingVO || {}\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n :exam-rich-text-content=\"item.examRichTextContent\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n <SubjectRichText\n v-bind=\"attrs\"\n :order-index=\"currentIndex()(item.customId)\"\n v-else-if=\"item.answerType === 'rich_text'\"\n :richTextContent=\"item.richTextContent\"\n :is-set=\"item.hasSet || false\"\n :is-save=\"!item.isRealCanDel\"\n :is-edit=\"item.isEdit || false\"\n :show-action=\"!isPreview\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n <SubjectPageEnd\n v-else-if=\"item.answerType === 'page_end'\"\n :total-page=\"totalPageIndex()\"\n :key=\"index\"\n :current-page-index=\"currentPageIndex(item.customId)\"\n :item=\"item\"\n :is-edit=\"item.isEdit || false\"\n :is-set=\"item.hasSet || false\"\n :is-save=\"!item.isRealCanDel\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n </div>\n </div>\n </div>\n</template>"],"names":["props","__props","currentList","ref","emits","__emit","attrs","useAttrs","__expose","addSubject","uploadExcel","list","value","concat","addExam","items","console","log","currentIndex","newList","forEach","v","newItem","customId","setGuid","answerType","richTextContent","examTypeEnum","answers","map","c","title","answer","answerId","examAnswerId","isCorrect","isSave","isEdit","isRealCanDel","hasSet","pageIndex","push","analysis","scaleQuestionList","examAnswerRelationType","setAnswerRelation","answerRelations","customAnswerId","targetItem","find","targetAnswer","currentPageIndex","computed","currentPageList","filter","currentId","findIndex","currentExamId","current","output","type","index","newSubject","splice","move","item","length","saveSubject","deleteSubject","ElMessage","success","setRelation","examAnswers","watch","subjectList","immedi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emB,EAAUiD,EAAW,CAa5CC,EAAAA,OAAM,IAAMzE,EAAM0E,cAAcvD,IAC1BA,IACUjB,EAAAU,MAAQ,IAAIO,GAAO,GAEhC,CAAEwD,WAAW,IAEV,MAAAC,EAAKC,eAAa,mrIAhJf3E,EAAYU,MAAM0C,QAAQjC,GAA4B,aAAjBA,EAAEI,aAA2ByC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@qxs-bns/components",
3
3
  "type": "module",
4
- "version": "0.0.39",
4
+ "version": "0.0.40",
5
5
  "description": "Vue 3 Component Library",
6
6
  "license": "MIT",
7
7
  "homepage": "https://trry-hub.github.io/qxs-bns/",
@@ -1 +1 @@
1
- {"version":3,"file":"subject-list.vue.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/subject-list/src/subject-list.vue"],"names":[],"mappings":"AA8VA,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,GAAG,EAAE,CAAA;IAClB,SAAS,EAAE,OAAO,CAAA;CACnB,CAAC;AA0CF,iBAAS,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,GAAE,MAAM,GAAG,IAAW,EAAE,sBAAsB,GAAE,MAAM,GAAG,IAAW,QAkB1G;AAiCD,iBAAS,OAAO,CAAC,KAAK,EAAE,GAAG,EAAE,QA8C5B;AACD,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
+ {"version":3,"file":"subject-list.vue.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/subject-list/src/subject-list.vue"],"names":[],"mappings":"AAkUA,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,GAAG,EAAE,CAAA;IAClB,SAAS,EAAE,OAAO,CAAA;CACnB,CAAC;AA+CF,iBAAS,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,GAAE,MAAM,GAAG,IAAW,EAAE,sBAAsB,GAAE,MAAM,GAAG,IAAW,QAkB1G;AACD,iBAAS,OAAO,CAAC,KAAK,EAAE,GAAG,EAAE,QA8C5B;AACD,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;;;;;;;;;;;;AAydD,wBAQG"}