@qxs-bns/components 0.0.37 → 0.0.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/package.json.mjs +1 -1
- package/es/src/subject-list/src/components/subject-scale.vue.mjs +1 -1
- package/es/src/subject-list/src/components/subject-scale.vue.mjs.map +1 -1
- package/es/src/subject-list/src/subject-list.vue.mjs +1 -1
- package/es/src/subject-list/src/subject-list.vue.mjs.map +1 -1
- package/lib/package.json.cjs +1 -1
- package/lib/src/subject-list/src/components/subject-scale.vue.cjs +1 -1
- package/lib/src/subject-list/src/components/subject-scale.vue.cjs.map +1 -1
- package/lib/src/subject-list/src/subject-list.vue.cjs +1 -1
- package/lib/src/subject-list/src/subject-list.vue.cjs.map +1 -1
- package/package.json +1 -1
- package/types/src/subject-list/src/components/subject-scale.vue.d.ts.map +1 -1
- package/types/src/subject-list/src/subject-list.vue.d.ts.map +1 -1
- package/types/tsconfig.tsbuildinfo +1 -1
package/es/package.json.mjs
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
var r="0.0.
|
1
|
+
var r="0.0.38";export{r as version};
|
2
2
|
//# sourceMappingURL=package.json.mjs.map
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{ElInput as e,ElIcon as l,ElLink as t,ElRow as a,ElCol as s,ElRadio as n}from"element-plus/es";import{defineComponent as i,useAttrs as o,ref as u,computed as r,onMounted as d,createElementBlock as c,openBlock as p,normalizeClass as v,unref as m,createVNode as f,withCtx as x,createBlock as y,createCommentVNode as h,createElementVNode as w,isRef as b,Fragment as g,renderList as j,toDisplayString as C,mergeProps as S,createTextVNode as k}from"vue";import{CirclePlus as V,Remove as q}from"@element-plus/icons-vue";import{useNamespace as T}from"@qxs-bns/hooks";import{ElMessage as _}from"element-plus";import L from"../../../subject-action/src/subject-action.vue.mjs";import A from"../../../subject-layout/src/subject-layout.vue.mjs";import R from"../../../tiny-mce-editor/src/tiny-mce-editor.vue.mjs";const
|
1
|
+
import{ElInput as e,ElIcon as l,ElLink as t,ElRow as a,ElCol as s,ElRadio as n}from"element-plus/es";import{defineComponent as i,useAttrs as o,ref as u,computed as r,onMounted as d,createElementBlock as c,openBlock as p,normalizeClass as v,unref as m,createVNode as f,withCtx as x,createBlock as y,createCommentVNode as h,createElementVNode as w,isRef as b,Fragment as g,renderList as j,toDisplayString as C,mergeProps as S,createTextVNode as k}from"vue";import{CirclePlus as V,Remove as q}from"@element-plus/icons-vue";import{useNamespace as T}from"@qxs-bns/hooks";import{ElMessage as _}from"element-plus";import L from"../../../subject-action/src/subject-action.vue.mjs";import A from"../../../subject-layout/src/subject-layout.vue.mjs";import R from"../../../tiny-mce-editor/src/tiny-mce-editor.vue.mjs";const U={class:"preview"},M={class:"title"},E={key:0},O=["innerHTML"],Q={class:"answer-radio flex flex-col"},B={style:{flex:"1"}},D={class:"answer flex"},H={class:"flex"},I={class:"answer-list flex-col"},N={class:"order"},$={class:"flex",style:{"margin-bottom":"20px"}},P={style:{flex:"1"}},z={key:0,class:"margin-bottom flex"},F={style:{flex:"1"}},G={class:"flex flex-justify-end"};var J=i({name:"QxsSubjectScale",__name:"subject-scale",props:{orderIndex:{type:Number,required:!0},title:{type:String,required:!1},isSave:{type:Boolean,required:!0},showAction:{type:Boolean,required:!1},answerList:{type:null,required:!1},analysis:{type:String,required:!1},rowTitle:{type:String,required:!1},isEdit:{type:Boolean,required:!0},isSet:{type:Boolean,required:!0},scaleQuestionList:{type:null,required:!1},examRichTextContent:{type:String,required:!1},examAnswerRelationType:{type:Number,required:!1}},emits:["move","save","delete","edit","add"],setup(i,{emit:J}){const K=i,W=J,X=o(),Y=u([{title:""},{title:""},{title:""},{title:""},{title:""}]),Z=u(""),ee=u(""),le=u(""),te=u(!1),ae=u(""),se=u([]),ne=r((()=>Math.ceil(24/(Y.value.length+1))));function ie(){5!==Y.value.length&&Y.value.push({title:""})}function oe(){te.value=!1,ae.value=""}function ue(){if(!Z.value)return void _.error("题目标题不能为空!");let e="";Y.value.forEach(((l,t)=>{l.title||(e+=`选项${String.fromCharCode(65+t)}未填写。`)})),e?_.error(e):le.value?(se.value=le.value.split("\n").filter((e=>e)),W("save",{title:Z.value,answers:Y.value,analysis:ee.value,scaleQuestionList:se.value,examRichTextContent:te.value?ae.value:""})):_.error("行标题不能为空!")}d((function(){K.title&&(Z.value=K.title),K.answerList&&K.answerList.length&&(Y.value=K.answerList),K.analysis&&(ee.value=K.analysis),K.scaleQuestionList&&(se.value=K.scaleQuestionList,le.value=se.value.join("\n")),K.examRichTextContent&&(ae.value=K.examRichTextContent,te.value=!0)}));const re=T("subject-scale");return(i,o)=>{const u=s,r=a,d=n,T=e,_=l,J=t;return p(),c("div",{class:v(m(re).e("scale-exam"))},[f(A,{"show-edit":i.isEdit},{preview:x((()=>[w("div",U,[w("div",null,[w("span",M,C(i.orderIndex+1)+"."+C(m(Z))+"(量表题)",1),m(te)?(p(),c("div",E,[w("div",{innerHTML:m(ae)},null,8,O)])):h("v-if",!0)]),w("div",Q,[f(r,{style:{padding:"10px 0"}},{default:x((()=>[f(u,{span:m(ne)},null,8,["span"]),(p(!0),c(g,null,j(m(Y),(e=>(p(),y(u,{key:e.title,class:"flex flex-center",span:m(ne)},{default:x((()=>[w("span",null,C(e.title),1)])),_:2},1032,["span"])))),128))])),_:1}),(p(!0),c(g,null,j(m(se),(e=>(p(),y(r,{key:e,style:{padding:"10px 0"}},{default:x((()=>[f(u,{span:m(ne),class:"flex flex-center"},{default:x((()=>[w("span",null,C(e),1)])),_:2},1032,["span"]),(p(!0),c(g,null,j(m(Y).length,(e=>(p(),y(u,{key:e,class:"radio-item flex flex-center",span:m(ne)},{default:x((()=>[f(d,{disabled:!0})])),_:2},1032,["span"])))),128))])),_:2},1024)))),128))])])])),edit:x((()=>[w("div",{class:v(["flex",[{"margin-bottom":m(te)}]])},[o[10]||(o[10]=w("div",{class:"label flex flex-justify-center"},[w("span",null,"题目:")],-1)),w("div",B,[f(T,{modelValue:m(Z),"onUpdate:modelValue":o[0]||(o[0]=e=>b(Z)?Z.value=e:null),type:"textarea",rows:2,placeholder:"【量表题】请输入问题",disabled:i.isSave},null,8,["modelValue","disabled"])])],2),w("div",D,[o[11]||(o[11]=w("div",{class:"label flex flex-justify-center"},[w("span",null,"行标题:")],-1)),w("div",H,[f(T,{modelValue:m(le),"onUpdate:modelValue":o[1]||(o[1]=e=>b(le)?le.value=e:null),type:"textarea",placeholder:"请输入行标题",style:{width:"160px"},rows:10},null,8,["modelValue"]),w("div",I,[(p(!0),c(g,null,j(m(Y),((e,l)=>(p(),c("div",{key:l,class:"answer-item flex flex-items-center"},[w("span",N,C(String.fromCharCode(65+l))+".",1),f(T,{modelValue:e.title,"onUpdate:modelValue":l=>e.title=l,class:"input","show-word-limit":"",maxlength:10,placeholder:`选项${String.fromCharCode(65+l)}`,disabled:i.isSave},null,8,["modelValue","onUpdate:modelValue","placeholder","disabled"]),h(' <PlusCircleOutlined\n class="icon"\n :class="[{ disabled: answers.length === 5 }]"\n @click="addAnswer"\n />\n <MinusCircleOutlined\n class="icon"\n :class="[{ disabled: answers.length < 3 }]"\n @click="deleteAnswer(index)"\n /> '),f(_,{class:"icon"},{default:x((()=>[f(m(V),{class:v([{disabled:5===m(Y).length}]),onClick:ie},null,8,["class"])])),_:1}),f(_,{class:"icon"},{default:x((()=>[f(m(q),{class:v([{disabled:m(Y).length<3}]),onClick:e=>function(e){Y.value.length<3||Y.value.splice(e,1)}(l)},null,8,["class","onClick"])])),_:2},1024)])))),128))])])]),w("div",$,[o[12]||(o[12]=w("div",{class:"label flex flex-justify-center"},[w("span",null,"解析:")],-1)),w("div",P,[f(T,{modelValue:m(ee),"onUpdate:modelValue":o[2]||(o[2]=e=>b(ee)?ee.value=e:null),type:"textarea",rows:2,placeholder:"请输入题目解析"},null,8,["modelValue"])])]),m(te)?(p(),c("div",z,[o[14]||(o[14]=w("div",{class:"label flex flex-justify-center"},[w("span",null,"富文本:")],-1)),w("div",F,[f(R,S({"model-value":m(ae),"onUpdate:modelValue":o[3]||(o[3]=e=>b(ae)?ae.value=e:null)},m(X),{style:{width:"100%"}}),null,16,["model-value"]),w("div",G,[f(J,{type:"danger",onClick:oe},{default:x((()=>o[13]||(o[13]=[k(" 删除富文本 ")]))),_:1})])])])):h("v-if",!0)])),default:x((()=>[i.showAction?(p(),y(L,{key:0,"is-edit":i.isEdit,"is-set":i.isSet,showOtherOption:!1,examAnswerRelationType:K.examAnswerRelationType,onMoveUp:o[4]||(o[4]=e=>W("move","up")),onMoveDown:o[5]||(o[5]=e=>W("move","down")),onDelete:o[6]||(o[6]=e=>W("delete")),onSave:ue,onEdit:o[7]||(o[7]=e=>W("edit")),onAdd:o[8]||(o[8]=e=>W("add",e)),onOnShowRichText:o[9]||(o[9]=e=>te.value=!0)},null,8,["is-edit","is-set","examAnswerRelationType"])):h("v-if",!0)])),_:1},8,["show-edit"])],2)}}});export{J as default};
|
2
2
|
//# sourceMappingURL=subject-scale.vue.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"subject-scale.vue.mjs","sources":["../../../../../../../packages/components/src/subject-list/src/components/subject-scale.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { CirclePlus, Remove } from '@element-plus/icons-vue'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport { ElMessage } from 'element-plus'\nimport SubjectAction from '../../../subject-action/src/subject-action.vue'\nimport SubjectLayout from '../../../subject-layout/src/subject-layout.vue'\nimport TinyMceEditor from '../../../tiny-mce-editor/src/tiny-mce-editor.vue'\n\ndefineOptions({\n name: 'QxsSubjectScale',\n})\nconst props = defineProps<{\n orderIndex: number\n title?: string\n isSave: boolean\n showAction?: boolean\n answerList?: any\n analysis?: string\n rowTitle?: string\n isEdit: boolean\n isSet: boolean\n scaleQuestionList?: any\n examRichTextContent?: string\n examAnswerRelationType?: number\n}>()\nconst emits = defineEmits(['move', 'save', 'delete', 'edit', 'add'])\n\nconst attrs = useAttrs()\n\nconst answers = ref<{\n title: string\n}[]>([{\n title: '',\n}, {\n title: '',\n}, {\n title: '',\n}, {\n title: '',\n}, {\n title: '',\n}])\n\nconst title = ref('')\nconst analysis = ref('')\nconst rowTitle = ref('')\nconst showRichText = ref(false)\nconst richText = ref('')\nconst scaleQuestionList = ref<string[]>([])\nconst span = computed(() => Math.ceil(24 / (answers.value.length + 1)))\nfunction addAnswer() {\n if (answers.value.length === 5) {\n return\n }\n answers.value.push({\n title: '',\n })\n}\n\nfunction deleteAnswer(index: number) {\n if (answers.value.length < 3) {\n return\n }\n answers.value.splice(index, 1)\n}\n\nfunction deleteRichText() {\n showRichText.value = false\n richText.value = ''\n}\n\nfunction save() {\n if (!title.value) {\n ElMessage.error('题目标题不能为空!')\n return\n }\n let msg = ''\n answers.value.forEach((v, i) => {\n if (!v.title) {\n msg += `选项${String.fromCharCode(65 + i)}未填写。`\n }\n })\n\n if (msg) {\n ElMessage.error(msg)\n return\n }\n\n if (!rowTitle.value) {\n ElMessage.error('行标题不能为空!')\n return\n }\n\n scaleQuestionList.value = rowTitle.value.split('\\n').filter(i => i)\n\n emits('save', {\n title: title.value,\n answers: answers.value,\n analysis: analysis.value,\n scaleQuestionList: scaleQuestionList.value,\n examRichTextContent: showRichText.value ? richText.value : '',\n })\n}\n\nfunction init() {\n if (props.title) {\n title.value = props.title\n }\n\n if (props.answerList && props.answerList.length) {\n answers.value = props.answerList\n }\n\n if (props.analysis) {\n analysis.value = props.analysis\n }\n\n if (props.scaleQuestionList) {\n scaleQuestionList.value = props.scaleQuestionList\n rowTitle.value = scaleQuestionList.value.join('\\n')\n }\n if (props.examRichTextContent) {\n richText.value = props.examRichTextContent\n showRichText.value = true\n }\n}\n\nonMounted(init)\nconst ns = useNamespace('subject-scale')\n</script>\n\n<template>\n <div :class=\"ns.e('scale-exam')\">\n <SubjectLayout :show-edit=\"isEdit\">\n <template #preview>\n <div class=\"preview\">\n <div>\n <span class=\"title\">{{ orderIndex + 1 }}.{{ title }}(量表题)</span>\n <div v-if=\"showRichText\">\n <div v-html=\"richText\" />\n </div>\n </div>\n <div class=\"answer-radio flex flex-col\">\n <el-row style=\"padding: 10px 0;\">\n <el-col :span=\"span\" />\n <el-col\n v-for=\"item in answers\"\n :key=\"item.title\"\n class=\"flex flex-center\"\n :span=\"span\"\n >\n <span>{{ item.title }}</span>\n </el-col>\n </el-row>\n <el-row\n v-for=\"item in scaleQuestionList\"\n :key=\"item\"\n style=\"padding: 10px 0;\"\n >\n <el-col :span=\"span\" class=\"flex flex-center\">\n <span>{{ item }}</span>\n </el-col>\n <el-col\n v-for=\"i in answers.length\"\n :key=\"i\"\n class=\"radio-item flex flex-center\"\n :span=\"span\"\n >\n <el-radio :disabled=\"true\" />\n </el-col>\n </el-row>\n </div>\n </div>\n </template>\n <template #edit>\n <div class=\"flex\" :class=\"[{ 'margin-bottom': showRichText }]\">\n <div class=\"label flex flex-justify-center\">\n <span>题目:</span>\n </div>\n <div style=\"flex: 1;\">\n <el-input\n v-model=\"title\"\n type=\"textarea\"\n :rows=\"2\"\n placeholder=\"【量表题】请输入问题\"\n :disabled=\"isSave\"\n />\n </div>\n </div>\n <div class=\"answer flex\">\n <div class=\"label flex flex-justify-center\">\n <span>行标题:</span>\n </div>\n <div class=\"flex\">\n <el-input\n v-model.trim=\"rowTitle\"\n type=\"textarea\"\n placeholder=\"请输入行标题\"\n style=\"width: 160px;\"\n :rows=\"10\"\n />\n <div class=\"answer-list flex-col\">\n <div\n v-for=\"(item, index) in answers\"\n :key=\"index\"\n class=\"answer-item flex flex-items-center\"\n >\n <span class=\"order\">{{ String.fromCharCode(65 + index) }}.</span>\n <el-input\n v-model=\"item.title\"\n class=\"input\"\n show-word-limit\n :maxlength=\"10\"\n :placeholder=\"`选项${String.fromCharCode(65 + index)}`\"\n :disabled=\"isSave\"\n />\n <!-- <PlusCircleOutlined\n class=\"icon\"\n :class=\"[{ disabled: answers.length === 5 }]\"\n @click=\"addAnswer\"\n />\n <MinusCircleOutlined\n class=\"icon\"\n :class=\"[{ disabled: answers.length < 3 }]\"\n @click=\"deleteAnswer(index)\"\n /> -->\n <el-icon class=\"icon\">\n <CirclePlus\n :class=\"[{ disabled: answers.length === 5 }]\"\n @click=\"addAnswer\"\n />\n </el-icon>\n <el-icon class=\"icon\">\n <Remove\n :class=\"[{ disabled: answers.length < 3 }]\"\n @click=\"deleteAnswer(index)\"\n />\n </el-icon>\n </div>\n </div>\n </div>\n </div>\n <div class=\"flex\" style=\"margin-bottom: 20px;\">\n <div class=\"label flex flex-justify-center\">\n <span>解析:</span>\n </div>\n <div style=\"flex: 1;\">\n <el-input\n v-model=\"analysis\"\n type=\"textarea\"\n :rows=\"2\"\n placeholder=\"请输入题目解析\"\n />\n </div>\n </div>\n <div v-if=\"showRichText\" class=\"margin-bottom flex\">\n <div class=\"label flex flex-justify-center\">\n <span>富文本:</span>\n </div>\n <div style=\"flex: 1;\">\n <TinyMceEditor v-model:model-value=\"richText\" v-bind=\"attrs\" style=\"width: 100%;\" />\n <div class=\"flex flex-justify-end\">\n <el-link\n type=\"danger\"\n @click=\"deleteRichText\"\n >\n 删除富文本\n </el-link>\n </div>\n </div>\n </div>\n </template>\n <SubjectAction\n v-if=\"showAction\"\n :is-edit=\"isEdit\"\n :is-set=\"isSet\"\n :showOtherOption=\"false\"\n :examAnswerRelationType=\"props.examAnswerRelationType\"\n @move-up=\"emits('move', 'up')\"\n @move-down=\"emits('move', 'down')\"\n @delete=\"emits('delete')\"\n @save=\"save\"\n @edit=\"emits('edit')\"\n @add=\"(type: any) => emits('add', type)\"\n @onShowRichText=\"showRichText = true\"\n />\n </SubjectLayout>\n </div>\n</template>\n"],"names":["props","__props","emits","__emit","attrs","useAttrs","answers","ref","title","analysis","rowTitle","showRichText","richText","scaleQuestionList","span","computed","Math","ceil","value","length","addAnswer","push","deleteRichText","save","ElMessage","error","msg","forEach","v","i","String","fromCharCode","split","filter","examRichTextContent","onMounted","answerList","join","ns","useNamespace","index","splice"],"mappings":"quDAWA,MAAMA,EAAQC,EAcRC,EAAQC,EAERC,EAAQC,IAERC,EAAUC,EAEX,CAAC,CACJC,MAAO,IACN,CACDA,MAAO,IACN,CACDA,MAAO,IACN,CACDA,MAAO,IACN,CACDA,MAAO,MAGHA,EAAQD,EAAI,IACZE,GAAWF,EAAI,IACfG,GAAWH,EAAI,IACfI,GAAeJ,GAAI,GACnBK,GAAWL,EAAI,IACfM,GAAoBN,EAAc,IAClCO,GAAOC,GAAS,IAAMC,KAAKC,KAAK,IAAMX,EAAQY,MAAMC,OAAS,MACnE,SAASC,KACsB,IAAzBd,EAAQY,MAAMC,QAGlBb,EAAQY,MAAMG,KAAK,CACjBb,MAAO,IACR,CAUH,SAASc,KACPX,GAAaO,OAAQ,EACrBN,GAASM,MAAQ,EAAA,CAGnB,SAASK,KACH,IAACf,EAAMU,MAET,YADAM,EAAUC,MAAM,aAGlB,IAAIC,EAAM,GACVpB,EAAQY,MAAMS,SAAQ,CAACC,EAAGC,KACnBD,EAAEpB,QACLkB,GAAO,KAAKI,OAAOC,aAAa,GAAKF,SAAE,IAIvCH,EACFF,EAAUC,MAAMC,GAIbhB,GAASQ,OAKIL,GAAAK,MAAQR,GAASQ,MAAMc,MAAM,MAAMC,WAAYJ,IAEjE3B,EAAM,OAAQ,CACZM,MAAOA,EAAMU,MACbZ,QAASA,EAAQY,MACjBT,SAAUA,GAASS,MACnBL,kBAAmBA,GAAkBK,MACrCgB,oBAAqBvB,GAAaO,MAAQN,GAASM,MAAQ,MAX3DM,EAAUC,MAAM,WAYjB,CA0BHU,GAvBA,WACMnC,EAAMQ,QACRA,EAAMU,MAAQlB,EAAMQ,OAGlBR,EAAMoC,YAAcpC,EAAMoC,WAAWjB,SACvCb,EAAQY,MAAQlB,EAAMoC,YAGpBpC,EAAMS,WACRA,GAASS,MAAQlB,EAAMS,UAGrBT,EAAMa,oBACRA,GAAkBK,MAAQlB,EAAMa,kBAChCH,GAASQ,MAAQL,GAAkBK,MAAMmB,KAAK,OAE5CrC,EAAMkC,sBACRtB,GAASM,MAAQlB,EAAMkC,oBACvBvB,GAAaO,OAAQ,EACvB,IAII,MAAAoB,GAAKC,EAAa,2iFArExB,SAAsBC,GAChBlC,EAAQY,MAAMC,OAAS,GAGnBb,EAAAY,MAAMuB,OAAOD,EAAO,EAAC"}
|
1
|
+
{"version":3,"file":"subject-scale.vue.mjs","sources":["../../../../../../../packages/components/src/subject-list/src/components/subject-scale.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { CirclePlus, Remove } from '@element-plus/icons-vue'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport { ElMessage } from 'element-plus'\nimport SubjectAction from '../../../subject-action/src/subject-action.vue'\nimport SubjectLayout from '../../../subject-layout/src/subject-layout.vue'\nimport TinyMceEditor from '../../../tiny-mce-editor/src/tiny-mce-editor.vue'\n\ndefineOptions({\n name: 'QxsSubjectScale',\n})\nconst props = defineProps<{\n orderIndex: number\n title?: string\n isSave: boolean\n showAction?: boolean\n answerList?: any\n analysis?: string\n rowTitle?: string\n isEdit: boolean\n isSet: boolean\n scaleQuestionList?: any\n examRichTextContent?: string\n examAnswerRelationType?: number\n}>()\nconst emits = defineEmits(['move', 'save', 'delete', 'edit', 'add'])\n\nconst attrs = useAttrs()\n\nconst answers = ref<{\n title: string\n}[]>([{\n title: '',\n}, {\n title: '',\n}, {\n title: '',\n}, {\n title: '',\n}, {\n title: '',\n}])\n\nconst title = ref('')\nconst analysis = ref('')\nconst rowTitle = ref('')\nconst showRichText = ref(false)\nconst richText = ref('')\nconst scaleQuestionList = ref<string[]>([])\nconst span = computed(() => Math.ceil(24 / (answers.value.length + 1)))\nfunction addAnswer() {\n if (answers.value.length === 5) {\n return\n }\n answers.value.push({\n title: '',\n })\n}\n\nfunction deleteAnswer(index: number) {\n if (answers.value.length < 3) {\n return\n }\n answers.value.splice(index, 1)\n}\n\nfunction deleteRichText() {\n showRichText.value = false\n richText.value = ''\n}\n\nfunction save() {\n if (!title.value) {\n ElMessage.error('题目标题不能为空!')\n return\n }\n let msg = ''\n answers.value.forEach((v, i) => {\n if (!v.title) {\n msg += `选项${String.fromCharCode(65 + i)}未填写。`\n }\n })\n\n if (msg) {\n ElMessage.error(msg)\n return\n }\n\n if (!rowTitle.value) {\n ElMessage.error('行标题不能为空!')\n return\n }\n\n scaleQuestionList.value = rowTitle.value.split('\\n').filter(i => i)\n\n emits('save', {\n title: title.value,\n answers: answers.value,\n analysis: analysis.value,\n scaleQuestionList: scaleQuestionList.value,\n examRichTextContent: showRichText.value ? richText.value : '',\n })\n}\n\nfunction init() {\n if (props.title) {\n title.value = props.title\n }\n\n if (props.answerList && props.answerList.length) {\n answers.value = props.answerList\n }\n\n if (props.analysis) {\n analysis.value = props.analysis\n }\n\n if (props.scaleQuestionList) {\n scaleQuestionList.value = props.scaleQuestionList\n rowTitle.value = scaleQuestionList.value.join('\\n')\n }\n if (props.examRichTextContent) {\n richText.value = props.examRichTextContent\n showRichText.value = true\n }\n}\n\nonMounted(init)\nconst ns = useNamespace('subject-scale')\n</script>\n\n<template>\n <div :class=\"ns.e('scale-exam')\">\n <SubjectLayout :show-edit=\"isEdit\">\n <template #preview>\n <div class=\"preview\">\n <div>\n <span class=\"title\">{{ orderIndex + 1 }}.{{ title }}(量表题)</span>\n <div v-if=\"showRichText\">\n <div v-html=\"richText\" />\n </div>\n </div>\n <div class=\"answer-radio flex flex-col\">\n <el-row style=\"padding: 10px 0;\">\n <el-col :span=\"span\" />\n <el-col\n v-for=\"item in answers\"\n :key=\"item.title\"\n class=\"flex flex-center\"\n :span=\"span\"\n >\n <span>{{ item.title }}</span>\n </el-col>\n </el-row>\n <el-row\n v-for=\"item in scaleQuestionList\"\n :key=\"item\"\n style=\"padding: 10px 0;\"\n >\n <el-col :span=\"span\" class=\"flex flex-center\">\n <span>{{ item }}</span>\n </el-col>\n <el-col\n v-for=\"i in answers.length\"\n :key=\"i\"\n class=\"radio-item flex flex-center\"\n :span=\"span\"\n >\n <el-radio :disabled=\"true\" />\n </el-col>\n </el-row>\n </div>\n </div>\n </template>\n <template #edit>\n <div class=\"flex\" :class=\"[{ 'margin-bottom': showRichText }]\">\n <div class=\"label flex flex-justify-center\">\n <span>题目:</span>\n </div>\n <div style=\"flex: 1;\">\n <el-input\n v-model=\"title\"\n type=\"textarea\"\n :rows=\"2\"\n placeholder=\"【量表题】请输入问题\"\n :disabled=\"isSave\"\n />\n </div>\n </div>\n <div class=\"answer flex\">\n <div class=\"label flex flex-justify-center\">\n <span>行标题:</span>\n </div>\n <div class=\"flex\">\n <el-input\n v-model=\"rowTitle\"\n type=\"textarea\"\n placeholder=\"请输入行标题\"\n style=\"width: 160px;\"\n :rows=\"10\"\n />\n <div class=\"answer-list flex-col\">\n <div\n v-for=\"(item, index) in answers\"\n :key=\"index\"\n class=\"answer-item flex flex-items-center\"\n >\n <span class=\"order\">{{ String.fromCharCode(65 + index) }}.</span>\n <el-input\n v-model=\"item.title\"\n class=\"input\"\n show-word-limit\n :maxlength=\"10\"\n :placeholder=\"`选项${String.fromCharCode(65 + index)}`\"\n :disabled=\"isSave\"\n />\n <!-- <PlusCircleOutlined\n class=\"icon\"\n :class=\"[{ disabled: answers.length === 5 }]\"\n @click=\"addAnswer\"\n />\n <MinusCircleOutlined\n class=\"icon\"\n :class=\"[{ disabled: answers.length < 3 }]\"\n @click=\"deleteAnswer(index)\"\n /> -->\n <el-icon class=\"icon\">\n <CirclePlus\n :class=\"[{ disabled: answers.length === 5 }]\"\n @click=\"addAnswer\"\n />\n </el-icon>\n <el-icon class=\"icon\">\n <Remove\n :class=\"[{ disabled: answers.length < 3 }]\"\n @click=\"deleteAnswer(index)\"\n />\n </el-icon>\n </div>\n </div>\n </div>\n </div>\n <div class=\"flex\" style=\"margin-bottom: 20px;\">\n <div class=\"label flex flex-justify-center\">\n <span>解析:</span>\n </div>\n <div style=\"flex: 1;\">\n <el-input\n v-model=\"analysis\"\n type=\"textarea\"\n :rows=\"2\"\n placeholder=\"请输入题目解析\"\n />\n </div>\n </div>\n <div v-if=\"showRichText\" class=\"margin-bottom flex\">\n <div class=\"label flex flex-justify-center\">\n <span>富文本:</span>\n </div>\n <div style=\"flex: 1;\">\n <TinyMceEditor v-model:model-value=\"richText\" v-bind=\"attrs\" style=\"width: 100%;\" />\n <div class=\"flex flex-justify-end\">\n <el-link\n type=\"danger\"\n @click=\"deleteRichText\"\n >\n 删除富文本\n </el-link>\n </div>\n </div>\n </div>\n </template>\n <SubjectAction\n v-if=\"showAction\"\n :is-edit=\"isEdit\"\n :is-set=\"isSet\"\n :showOtherOption=\"false\"\n :examAnswerRelationType=\"props.examAnswerRelationType\"\n @move-up=\"emits('move', 'up')\"\n @move-down=\"emits('move', 'down')\"\n @delete=\"emits('delete')\"\n @save=\"save\"\n @edit=\"emits('edit')\"\n @add=\"(type: any) => emits('add', type)\"\n @onShowRichText=\"showRichText = true\"\n />\n </SubjectLayout>\n </div>\n</template>\n"],"names":["props","__props","emits","__emit","attrs","useAttrs","answers","ref","title","analysis","rowTitle","showRichText","richText","scaleQuestionList","span","computed","Math","ceil","value","length","addAnswer","push","deleteRichText","save","ElMessage","error","msg","forEach","v","i","String","fromCharCode","split","filter","examRichTextContent","onMounted","answerList","join","ns","useNamespace","index","splice"],"mappings":"quDAWA,MAAMA,EAAQC,EAcRC,EAAQC,EAERC,EAAQC,IAERC,EAAUC,EAEX,CAAC,CACJC,MAAO,IACN,CACDA,MAAO,IACN,CACDA,MAAO,IACN,CACDA,MAAO,IACN,CACDA,MAAO,MAGHA,EAAQD,EAAI,IACZE,GAAWF,EAAI,IACfG,GAAWH,EAAI,IACfI,GAAeJ,GAAI,GACnBK,GAAWL,EAAI,IACfM,GAAoBN,EAAc,IAClCO,GAAOC,GAAS,IAAMC,KAAKC,KAAK,IAAMX,EAAQY,MAAMC,OAAS,MACnE,SAASC,KACsB,IAAzBd,EAAQY,MAAMC,QAGlBb,EAAQY,MAAMG,KAAK,CACjBb,MAAO,IACR,CAUH,SAASc,KACPX,GAAaO,OAAQ,EACrBN,GAASM,MAAQ,EAAA,CAGnB,SAASK,KACH,IAACf,EAAMU,MAET,YADAM,EAAUC,MAAM,aAGlB,IAAIC,EAAM,GACVpB,EAAQY,MAAMS,SAAQ,CAACC,EAAGC,KACnBD,EAAEpB,QACLkB,GAAO,KAAKI,OAAOC,aAAa,GAAKF,SAAE,IAIvCH,EACFF,EAAUC,MAAMC,GAIbhB,GAASQ,OAKIL,GAAAK,MAAQR,GAASQ,MAAMc,MAAM,MAAMC,WAAYJ,IAEjE3B,EAAM,OAAQ,CACZM,MAAOA,EAAMU,MACbZ,QAASA,EAAQY,MACjBT,SAAUA,GAASS,MACnBL,kBAAmBA,GAAkBK,MACrCgB,oBAAqBvB,GAAaO,MAAQN,GAASM,MAAQ,MAX3DM,EAAUC,MAAM,WAYjB,CA0BHU,GAvBA,WACMnC,EAAMQ,QACRA,EAAMU,MAAQlB,EAAMQ,OAGlBR,EAAMoC,YAAcpC,EAAMoC,WAAWjB,SACvCb,EAAQY,MAAQlB,EAAMoC,YAGpBpC,EAAMS,WACRA,GAASS,MAAQlB,EAAMS,UAGrBT,EAAMa,oBACRA,GAAkBK,MAAQlB,EAAMa,kBAChCH,GAASQ,MAAQL,GAAkBK,MAAMmB,KAAK,OAE5CrC,EAAMkC,sBACRtB,GAASM,MAAQlB,EAAMkC,oBACvBvB,GAAaO,OAAQ,EACvB,IAII,MAAAoB,GAAKC,EAAa,khFArExB,SAAsBC,GAChBlC,EAAQY,MAAMC,OAAS,GAGnBb,EAAAY,MAAMuB,OAAOD,EAAO,EAAC"}
|
@@ -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 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 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:
|
1
|
+
import{defineComponent as e,ref as s,useAttrs as t,computed as n,watch as i,createElementBlock as a,openBlock as o,normalizeClass as l,unref as r,createElementVNode as d,Fragment as c,renderList as m,createBlock as u,createCommentVNode as 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 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:D}){const g=e,j=s([]),b=D,I=t();C({addSubject:M,currentList:j,uploadExcel:function(e){j.value=j.value.concat(e)},addExam:function(e){let s=1;const t=e.answers?.map((e=>({...e,title:e.answer,answerId:e.examAnswerId,isCorrect:e.isCorrect})))||[],n={...e,customId:R(),answerType:e.richTextContent?"rich_text":e.examTypeEnum,answers:t,isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1};j.value.push(n),e.pageIndex-s==1&&(k(),s++);s>1&&k()},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(){j.value.push({customId:R(),answerType:"page_end",analysis:"",scaleQuestionList:[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1,examAnswerRelationType:0})}function M(e,s=null,t=null){const n={customId:R(),answerType:e,analysis:"",scaleQuestionList:[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1,examAnswerRelationType:t};null!==s?j.value.splice(s+1,0,n):j.value.push(n)}function L(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 P(e,s){j.value[e]={...j.value[e],...s,isEdit:!1,examAnswerRelationType:s.examAnswerRelationType}}function q(e){j.value.splice(e,1),E.success("删除成功")}function Q(e,s){b("setRelation",e,s)}i((()=>g.subjectList),(e=>{e&&(j.value=[...e])}),{immediate:!0});const K=A("subject-list");return(e,s)=>(o(),a("div",{class:l(r(K).e("list-exam"))},[d("div",S,[(o(!0),a(c,null,m(r(j),((s,t)=>(o(),a("div",{key:s.customId,class:"subject-item"},[["single","multiple","sort"].includes(s.answerType)?(o(),u(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=>L(t,e),onDelete:e=>q(t),onSave:e=>P(t,e),onEdit:e=>s.isEdit=!0,onAdd:(e,s)=>M(e,t,s)}),null,16,["order-index","title","type","exam-id","isKey","is-save","customId","is-set","answer-list","analysis","least-answer-count","is-edit","show-action","exam-expand","answerCheckType","exam-rich-text-content","examAnswerRelationType","onMove","onDelete","onSave","onEdit","onAdd"])):"scale"===s.answerType?(o(),u(v,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=>L(t,e),onDelete:e=>q(t),onSave:e=>P(t,e),onEdit:e=>s.isEdit=!0,onAdd:e=>M(e,t,null)}),null,16,["order-index","title","is-save","is-set","answer-list","analysis","is-edit","scale-question-list","show-action","exam-rich-text-content","examAnswerRelationType","onMove","onDelete","onSave","onEdit","onAdd"])):"blank_fill"===s.answerType?(o(),u(w,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=>L(t,e),onDelete:e=>q(t),onSave:e=>P(t,e),onEdit:e=>s.isEdit=!0,onAdd:e=>M(e,t,null)}),null,16,["order-index","title","is-save","is-set","answer-list","analysis","show-action","is-edit","exam-answer-setting-v-o","exam-rich-text-content","examAnswerRelationType","onMove","onDelete","onSave","onEdit","onAdd"])):"text_fill"===s.answerType?(o(),u(h,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=>L(t,e),onDelete:e=>q(t),onSave:e=>P(t,e),onEdit:e=>s.isEdit=!0,onAdd:e=>M(e,t,null)}),null,16,["order-index","title","is-save","is-set","answer-list","analysis","show-action","is-edit","exam-expand","exam-answer-setting-v-o","examAnswerRelationType","exam-rich-text-content","onMove","onDelete","onSave","onEdit","onAdd"])):"rich_text"===s.answerType?(o(),u(T,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=>L(t,e),onDelete:e=>q(t),examAnswerRelationType:s.examAnswerRelationType,onSave:e=>P(t,e),onEdit:e=>s.isEdit=!0,onAdd:e=>M(e,t,null)}),null,16,["order-index","richTextContent","is-set","is-save","is-edit","show-action","onMove","onDelete","examAnswerRelationType","onSave","onEdit","onAdd"])):"page_end"===s.answerType?(o(),u(f,{"total-page":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=>L(t,e),onDelete:e=>q(t),onSave:e=>P(t,e),onEdit:e=>s.isEdit=!0,onAdd:e=>M(e,t,null)},null,8,["total-page","current-page-index","item","order-index","is-edit","is-set","is-save","examAnswerRelationType","onMove","onDelete","onSave","onEdit","onAdd"])):x("v-if",!0)])))),128))])],2))}});export{C 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}\nconst currentPageIndex = computed(() => {\n const currentPageList = currentList.value.filter((v: any) => v.answerType === 'page_end')\n return (currentId: string) => {\n const currentIndex = currentPageList.findIndex((c: any) => c.customId === currentId)\n return currentIndex !== -1 ? currentIndex + 1 : 0\n }\n})\nfunction addPageEnd() {\n currentList.value.push({\n customId: setGuid(),\n answerType: 'page_end',\n analysis: '',\n scaleQuestionList: [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n examAnswerRelationType: 0,\n })\n}\n\nfunction addSubject(type: string, index: number | null = null, examAnswerRelationType: number | null = null) {\n const newSubject = {\n customId: setGuid(),\n answerType: type,\n analysis: '',\n scaleQuestionList: [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n examAnswerRelationType,\n }\n\n if (index !== null) {\n currentList.value.splice(index + 1, 0, newSubject)\n } else {\n currentList.value.push(newSubject)\n }\n}\n\nfunction addExam(item: any) {\n const answerList = item.answers?.map((v: any) => ({\n ...v,\n title: v.answer,\n answerId: v.examAnswerId,\n isCorrect: v.isCorrect,\n })) || []\n\n // 创建新的题目对象\n const newItem = {\n ...item,\n customId: setGuid(),\n answerType: item.richTextContent ? 'rich_text' : item.examTypeEnum,\n answers: answerList,\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n }\n\n // 将新题目添加到 currentList\n currentList.value.push(newItem)\n\n // 获取刚刚添加的题目的 customId\n const newCustomId = newItem.customId\n\n // 判断是否需要添加 page_end \n if ((item.pageIndex - currentPageIndex.value(newCustomId)) === 1) {\n console.log(currentPageIndex.value(newCustomId));\n addPageEnd()\n }\n\n if (currentPageIndex.value(newCustomId) > 1) {\n addPageEnd()\n }\n}\n\nfunction uploadExcel(list: any[]) {\n currentList.value = currentList.value.concat(list)\n}\n\nfunction move(index: number, type: 'up' | 'down') {\n if (type === 'up' && index > 0) {\n const [item] = currentList.value.splice(index, 1)\n currentList.value.splice(index - 1, 0, item)\n } else if (type === 'down' && index < currentList.value.length - 1) {\n const [item] = currentList.value.splice(index, 1)\n currentList.value.splice(index + 1, 0, item)\n }\n}\n\nfunction saveSubject(index: number, item: any) {\n currentList.value[index] = {\n ...currentList.value[index],\n ...item,\n isEdit: false,\n examAnswerRelationType: item.examAnswerRelationType,\n }\n}\n\nfunction deleteSubject(index: number) {\n currentList.value.splice(index, 1)\n ElMessage.success('删除成功')\n}\n\nfunction setRelation(customId: number, examAnswers: any) {\n emits('setRelation', customId, examAnswers)\n}\n\nfunction setAnswerRelation(answerRelations: any, customId: string, customAnswerId: string) {\n const targetItem = currentList.value.find((v: any) => v.customId === customId)\n if (targetItem) {\n const targetAnswer = targetItem.answers?.find((c: any) => c.customAnswerId === customAnswerId)\n if (targetAnswer) {\n targetAnswer.answerRelations = answerRelations\n }\n }\n}\n\nwatch(() => props.subjectList, (newList: any) => {\n if (newList) {\n currentList.value = [...newList]\n }\n}, { immediate: true })\n\nconst ns = useNamespace('subject-list')\n</script>\n\n<template>\n <div :class=\"ns.e('list-exam')\">\n <div class=\"subject-list-wrapper\">\n <div v-for=\"(item, index) in currentList\" :key=\"item.customId\" class=\"subject-item\">\n <template v-if=\"['single', 'multiple', 'sort'].includes(item.answerType)\">\n <SubjectSingle \n v-bind=\"attrs\" \n :order-index=\"index\" \n :title=\"item.title\" \n :type=\"item.answerType\"\n :exam-id=\"item.examId\"\n :isKey=\"item.isKey\" \n :is-save=\"!item.isRealCanDel\" \n :customId=\"item.customId\" \n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\" \n :analysis=\"item.analysis\" \n :least-answer-count=\"item.leastAnswerCount\"\n :is-edit=\"item.isEdit || false\" \n :show-action=\"!isPreview\" \n :exam-expand=\"item.examExpand\"\n :answerCheckType=\"item.answerCheckType\" \n :exam-rich-text-content=\"item.examRichTextContent\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n @setRelation=\"setRelation\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string, examAnswerRelationType: number) => addSubject(type, index, examAnswerRelationType)\" />\n </template>\n <SubjectScale v-bind=\"attrs\" v-else-if=\"item.answerType === 'scale'\" :order-index=\"index\" :title=\"item.title\"\n :is-save=\"!item.isRealCanDel\" :is-set=\"item.hasSet || false\" :answer-list=\"item.answers\"\n :analysis=\"item.analysis\" :is-edit=\"item.isEdit || false\" :scale-question-list=\"item.scaleQuestionList\"\n :show-action=\"!isPreview\" :exam-rich-text-content=\"item.examRichTextContent\"\n :examAnswerRelationType=\"item.examAnswerRelationType\" @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\" @save=\"(item: any) => saveSubject(index, item)\" @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\" />\n <SubjectBlankFill v-bind=\"attrs\" v-else-if=\"item.answerType === 'blank_fill'\" :order-index=\"index\"\n :title=\"item.title\" :is-save=\"!item.isRealCanDel\" :is-set=\"item.hasSet || false\" :answer-list=\"item.answers\"\n :analysis=\"item.analysis\" :show-action=\"!isPreview\" :is-edit=\"item.isEdit || false\"\n :exam-answer-setting-v-o=\"item.examAnswerSettingVO || {}\" :exam-rich-text-content=\"item.examRichTextContent\"\n :examAnswerRelationType=\"item.examAnswerRelationType\" @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\" @save=\"(item: any) => saveSubject(index, item)\" @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\" />\n <SubjectTextFill v-bind=\"attrs\" v-else-if=\"item.answerType === 'text_fill'\" :order-index=\"index\"\n :title=\"item.title\" :is-save=\"!item.isRealCanDel\" :is-set=\"item.hasSet || false\" :answer-list=\"item.answers\"\n :analysis=\"item.analysis\" :show-action=\"!isPreview\" :is-edit=\"item.isEdit || false\"\n :exam-expand=\"item.examExpand\" :exam-answer-setting-v-o=\"item.examAnswerSettingVO || {}\"\n :examAnswerRelationType=\"item.examAnswerRelationType\" :exam-rich-text-content=\"item.examRichTextContent\"\n @move=\"(type: 'up' | 'down') => move(index, type)\" @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\" @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\" />\n <SubjectRichText v-bind=\"attrs\" v-else-if=\"item.answerType === 'rich_text'\" :order-index=\"index\"\n :richTextContent=\"item.richTextContent\" :is-set=\"item.hasSet || false\" :is-save=\"!item.isRealCanDel\"\n :is-edit=\"item.isEdit || false\" :show-action=\"!isPreview\" @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\" :examAnswerRelationType=\"item.examAnswerRelationType\"\n @save=\"(item: any) => saveSubject(index, item)\" @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\" />\n <SubjectPageEnd v-else-if=\"item.answerType === 'page_end'\" :total-page=\"totalPageIndex()\" :key=\"index\"\n :current-page-index=\"currentPageIndex(item.customId)\" :item=\"item\" :order-index=\"index\"\n :is-edit=\"item.isEdit || false\" :is-set=\"item.hasSet || false\" :is-save=\"!item.isRealCanDel\"\n :examAnswerRelationType=\"item.examAnswerRelationType\" @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\" @save=\"(item: any) => saveSubject(index, item)\" @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\" />\n </div>\n </div>\n </div>\n</template>\n"],"names":["props","__props","currentList","ref","emits","__emit","attrs","useAttrs","__expose","addSubject","uploadExcel","list","value","concat","addExam","item","answerList","answers","map","v","title","answer","answerId","examAnswerId","isCorrect","newItem","customId","setGuid","answerType","richTextContent","examTypeEnum","isSave","isEdit","isRealCanDel","hasSet","push","newCustomId","pageIndex","currentPageIndex","console","log","addPageEnd","setAnswerRelation","answerRelations","customAnswerId","targetItem","find","targetAnswer","c","computed","currentPageList","filter","currentId","currentIndex","findIndex","analysis","scaleQuestionList","examAnswerRelationType","type","index","newSubject","splice","move","length","saveSubject","deleteSubject","ElMessage","success","setRelation","examAnswers","watch","subjectList","newList","immediate","ns","useNamespace"],"mappings":"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"}
|
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}\nconst currentPageIndex = computed(() => {\n const currentPageList = currentList.value.filter((v: any) => v.answerType === 'page_end')\n return (currentId: string) => {\n const currentIndex = currentPageList.findIndex((c: any) => c.customId === currentId)\n return currentIndex !== -1 ? currentIndex + 1 : 0\n }\n})\nfunction addPageEnd() {\n currentList.value.push({\n customId: setGuid(),\n answerType: 'page_end',\n analysis: '',\n scaleQuestionList: [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n examAnswerRelationType: 0,\n })\n}\n\nfunction addSubject(type: string, index: number | null = null, examAnswerRelationType: number | null = null) {\n const newSubject = {\n customId: setGuid(),\n answerType: type,\n analysis: '',\n scaleQuestionList: [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n examAnswerRelationType,\n }\n\n if (index !== null) {\n currentList.value.splice(index + 1, 0, newSubject)\n } else {\n currentList.value.push(newSubject)\n }\n}\n\nfunction addExam(item: any) {\n 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 // 创建新的题目对象\n const newItem = {\n ...item,\n customId: setGuid(),\n answerType: item.richTextContent ? 'rich_text' : item.examTypeEnum,\n answers: answerList,\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n }\n\n // 将新题目添加到 currentList\n currentList.value.push(newItem)\n\n\n // 判断是否需要添加 page_end \n if (item.pageIndex - currentPageIndex === 1) {\n addPageEnd()\n currentPageIndex++\n }\n\n if (currentPageIndex > 1) {\n addPageEnd()\n }\n}\n\nfunction uploadExcel(list: any[]) {\n currentList.value = currentList.value.concat(list)\n}\n\nfunction move(index: number, type: 'up' | 'down') {\n if (type === 'up' && index > 0) {\n const [item] = currentList.value.splice(index, 1)\n currentList.value.splice(index - 1, 0, item)\n } else if (type === 'down' && index < currentList.value.length - 1) {\n const [item] = currentList.value.splice(index, 1)\n currentList.value.splice(index + 1, 0, item)\n }\n}\n\nfunction saveSubject(index: number, item: any) {\n currentList.value[index] = {\n ...currentList.value[index],\n ...item,\n isEdit: false,\n examAnswerRelationType: item.examAnswerRelationType,\n }\n}\n\nfunction deleteSubject(index: number) {\n currentList.value.splice(index, 1)\n ElMessage.success('删除成功')\n}\n\nfunction setRelation(customId: number, examAnswers: any) {\n emits('setRelation', customId, examAnswers)\n}\n\nfunction setAnswerRelation(answerRelations: any, customId: string, customAnswerId: string) {\n const targetItem = currentList.value.find((v: any) => v.customId === customId)\n if (targetItem) {\n const targetAnswer = targetItem.answers?.find((c: any) => c.customAnswerId === customAnswerId)\n if (targetAnswer) {\n targetAnswer.answerRelations = answerRelations\n }\n }\n}\n\nwatch(() => props.subjectList, (newList: any) => {\n if (newList) {\n currentList.value = [...newList]\n }\n}, { immediate: true })\n\nconst ns = useNamespace('subject-list')\n</script>\n\n<template>\n <div :class=\"ns.e('list-exam')\">\n <div class=\"subject-list-wrapper\">\n <div v-for=\"(item, index) in currentList\" :key=\"item.customId\" class=\"subject-item\">\n <template v-if=\"['single', 'multiple', 'sort'].includes(item.answerType)\">\n <SubjectSingle \n v-bind=\"attrs\" \n :order-index=\"index\" \n :title=\"item.title\" \n :type=\"item.answerType\"\n :exam-id=\"item.examId\"\n :isKey=\"item.isKey\" \n :is-save=\"!item.isRealCanDel\" \n :customId=\"item.customId\" \n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\" \n :analysis=\"item.analysis\" \n :least-answer-count=\"item.leastAnswerCount\"\n :is-edit=\"item.isEdit || false\" \n :show-action=\"!isPreview\" \n :exam-expand=\"item.examExpand\"\n :answerCheckType=\"item.answerCheckType\" \n :exam-rich-text-content=\"item.examRichTextContent\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n @setRelation=\"setRelation\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string, examAnswerRelationType: number) => addSubject(type, index, examAnswerRelationType)\" />\n </template>\n <SubjectScale v-bind=\"attrs\" v-else-if=\"item.answerType === 'scale'\" :order-index=\"index\" :title=\"item.title\"\n :is-save=\"!item.isRealCanDel\" :is-set=\"item.hasSet || false\" :answer-list=\"item.answers\"\n :analysis=\"item.analysis\" :is-edit=\"item.isEdit || false\" :scale-question-list=\"item.scaleQuestionList\"\n :show-action=\"!isPreview\" :exam-rich-text-content=\"item.examRichTextContent\"\n :examAnswerRelationType=\"item.examAnswerRelationType\" @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\" @save=\"(item: any) => saveSubject(index, item)\" @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\" />\n <SubjectBlankFill v-bind=\"attrs\" v-else-if=\"item.answerType === 'blank_fill'\" :order-index=\"index\"\n :title=\"item.title\" :is-save=\"!item.isRealCanDel\" :is-set=\"item.hasSet || false\" :answer-list=\"item.answers\"\n :analysis=\"item.analysis\" :show-action=\"!isPreview\" :is-edit=\"item.isEdit || false\"\n :exam-answer-setting-v-o=\"item.examAnswerSettingVO || {}\" :exam-rich-text-content=\"item.examRichTextContent\"\n :examAnswerRelationType=\"item.examAnswerRelationType\" @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\" @save=\"(item: any) => saveSubject(index, item)\" @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\" />\n <SubjectTextFill v-bind=\"attrs\" v-else-if=\"item.answerType === 'text_fill'\" :order-index=\"index\"\n :title=\"item.title\" :is-save=\"!item.isRealCanDel\" :is-set=\"item.hasSet || false\" :answer-list=\"item.answers\"\n :analysis=\"item.analysis\" :show-action=\"!isPreview\" :is-edit=\"item.isEdit || false\"\n :exam-expand=\"item.examExpand\" :exam-answer-setting-v-o=\"item.examAnswerSettingVO || {}\"\n :examAnswerRelationType=\"item.examAnswerRelationType\" :exam-rich-text-content=\"item.examRichTextContent\"\n @move=\"(type: 'up' | 'down') => move(index, type)\" @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\" @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\" />\n <SubjectRichText v-bind=\"attrs\" v-else-if=\"item.answerType === 'rich_text'\" :order-index=\"index\"\n :richTextContent=\"item.richTextContent\" :is-set=\"item.hasSet || false\" :is-save=\"!item.isRealCanDel\"\n :is-edit=\"item.isEdit || false\" :show-action=\"!isPreview\" @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\" :examAnswerRelationType=\"item.examAnswerRelationType\"\n @save=\"(item: any) => saveSubject(index, item)\" @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\" />\n <SubjectPageEnd v-else-if=\"item.answerType === 'page_end'\" :total-page=\"totalPageIndex()\" :key=\"index\"\n :current-page-index=\"currentPageIndex(item.customId)\" :item=\"item\" :order-index=\"index\"\n :is-edit=\"item.isEdit || false\" :is-set=\"item.hasSet || false\" :is-save=\"!item.isRealCanDel\"\n :examAnswerRelationType=\"item.examAnswerRelationType\" @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\" @save=\"(item: any) => saveSubject(index, item)\" @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\" />\n </div>\n </div>\n </div>\n</template>\n"],"names":["props","__props","currentList","ref","emits","__emit","attrs","useAttrs","__expose","addSubject","uploadExcel","list","value","concat","addExam","item","currentPageIndex","answerList","answers","map","v","title","answer","answerId","examAnswerId","isCorrect","newItem","customId","setGuid","answerType","richTextContent","examTypeEnum","isSave","isEdit","isRealCanDel","hasSet","push","pageIndex","addPageEnd","setAnswerRelation","answerRelations","customAnswerId","targetItem","find","targetAnswer","c","computed","currentPageList","filter","currentId","currentIndex","findIndex","analysis","scaleQuestionList","examAnswerRelationType","type","index","newSubject","splice","move","length","saveSubject","deleteSubject","ElMessage","success","setRelation","examAnswers","watch","subjectList","newList","immediate","ns","useNamespace"],"mappings":"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"}
|
package/lib/package.json.cjs
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";exports.version="0.0.
|
1
|
+
"use strict";exports.version="0.0.38";
|
2
2
|
//# sourceMappingURL=package.json.cjs.map
|
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("element-plus/es"),l=require("vue"),t=require("@element-plus/icons-vue"),a=require("@qxs-bns/hooks"),n=require("element-plus"),r=require("../../../subject-action/src/subject-action.vue.cjs"),s=require("../../../subject-layout/src/subject-layout.vue.cjs"),o=require("../../../tiny-mce-editor/src/tiny-mce-editor.vue.cjs");const i={class:"preview"},d={class:"title"},c={key:0},u=["innerHTML"],m={class:"answer-radio flex flex-col"},f={style:{flex:"1"}},p={class:"answer flex"},v={class:"flex"},x={class:"answer-list flex-col"},V={class:"order"},y={class:"flex",style:{"margin-bottom":"20px"}},h={style:{flex:"1"}},N={key:0,class:"margin-bottom flex"},w={style:{flex:"1"}},E={class:"flex flex-justify-end"};var k=l.defineComponent({name:"QxsSubjectScale",__name:"subject-scale",props:{orderIndex:{type:Number,required:!0},title:{type:String,required:!1},isSave:{type:Boolean,required:!0},showAction:{type:Boolean,required:!1},answerList:{type:null,required:!1},analysis:{type:String,required:!1},rowTitle:{type:String,required:!1},isEdit:{type:Boolean,required:!0},isSet:{type:Boolean,required:!0},scaleQuestionList:{type:null,required:!1},examRichTextContent:{type:String,required:!1},examAnswerRelationType:{type:Number,required:!1}},emits:["move","save","delete","edit","add"],setup(k,{emit:C}){const g=k,B=C,b=l.useAttrs(),q=l.ref([{title:""},{title:""},{title:""},{title:""},{title:""}]),S=l.ref(""),j=l.ref(""),R=l.ref(""),L=l.ref(!1),T=l.ref(""),_=l.ref([]),M=l.computed((()=>Math.ceil(24/(q.value.length+1))));function A(){5!==q.value.length&&q.value.push({title:""})}function D(){L.value=!1,T.value=""}function U(){if(!S.value)return void n.ElMessage.error("题目标题不能为空!");let e="";q.value.forEach(((l,t)=>{l.title||(e+=`选项${String.fromCharCode(65+t)}未填写。`)})),e?n.ElMessage.error(e):R.value?(_.value=R.value.split("\n").filter((e=>e)),B("save",{title:S.value,answers:q.value,analysis:j.value,scaleQuestionList:_.value,examRichTextContent:L.value?T.value:""})):n.ElMessage.error("行标题不能为空!")}l.onMounted((function(){g.title&&(S.value=g.title),g.answerList&&g.answerList.length&&(q.value=g.answerList),g.analysis&&(j.value=g.analysis),g.scaleQuestionList&&(_.value=g.scaleQuestionList,R.value=_.value.join("\n")),g.examRichTextContent&&(T.value=g.examRichTextContent,L.value=!0)}));const O=a.useNamespace("subject-scale");return(a,n)=>{const k=e.ElCol,C=e.ElRow,Q=e.ElRadio,z=e.ElInput,F=e.ElIcon,I=e.ElLink;return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(l.unref(O).e("scale-exam"))},[l.createVNode(s.default,{"show-edit":a.isEdit},{preview:l.withCtx((()=>[l.createElementVNode("div",i,[l.createElementVNode("div",null,[l.createElementVNode("span",d,l.toDisplayString(a.orderIndex+1)+"."+l.toDisplayString(l.unref(S))+"(量表题)",1),l.unref(L)?(l.openBlock(),l.createElementBlock("div",c,[l.createElementVNode("div",{innerHTML:l.unref(T)},null,8,u)])):l.createCommentVNode("v-if",!0)]),l.createElementVNode("div",m,[l.createVNode(C,{style:{padding:"10px 0"}},{default:l.withCtx((()=>[l.createVNode(k,{span:l.unref(M)},null,8,["span"]),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(q),(e=>(l.openBlock(),l.createBlock(k,{key:e.title,class:"flex flex-center",span:l.unref(M)},{default:l.withCtx((()=>[l.createElementVNode("span",null,l.toDisplayString(e.title),1)])),_:2},1032,["span"])))),128))])),_:1}),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(_),(e=>(l.openBlock(),l.createBlock(C,{key:e,style:{padding:"10px 0"}},{default:l.withCtx((()=>[l.createVNode(k,{span:l.unref(M),class:"flex flex-center"},{default:l.withCtx((()=>[l.createElementVNode("span",null,l.toDisplayString(e),1)])),_:2},1032,["span"]),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(q).length,(e=>(l.openBlock(),l.createBlock(k,{key:e,class:"radio-item flex flex-center",span:l.unref(M)},{default:l.withCtx((()=>[l.createVNode(Q,{disabled:!0})])),_:2},1032,["span"])))),128))])),_:2},1024)))),128))])])])),edit:l.withCtx((()=>[l.createElementVNode("div",{class:l.normalizeClass(["flex",[{"margin-bottom":l.unref(L)}]])},[n[10]||(n[10]=l.createElementVNode("div",{class:"label flex flex-justify-center"},[l.createElementVNode("span",null,"题目:")],-1)),l.createElementVNode("div",f,[l.createVNode(z,{modelValue:l.unref(S),"onUpdate:modelValue":n[0]||(n[0]=e=>l.isRef(S)?S.value=e:null),type:"textarea",rows:2,placeholder:"【量表题】请输入问题",disabled:a.isSave},null,8,["modelValue","disabled"])])],2),l.createElementVNode("div",p,[n[11]||(n[11]=l.createElementVNode("div",{class:"label flex flex-justify-center"},[l.createElementVNode("span",null,"行标题:")],-1)),l.createElementVNode("div",v,[l.createVNode(z,{modelValue:l.unref(R),"onUpdate:modelValue":n[1]||(n[1]=e=>l.isRef(R)?R.value=e:null),
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("element-plus/es"),l=require("vue"),t=require("@element-plus/icons-vue"),a=require("@qxs-bns/hooks"),n=require("element-plus"),r=require("../../../subject-action/src/subject-action.vue.cjs"),s=require("../../../subject-layout/src/subject-layout.vue.cjs"),o=require("../../../tiny-mce-editor/src/tiny-mce-editor.vue.cjs");const i={class:"preview"},d={class:"title"},c={key:0},u=["innerHTML"],m={class:"answer-radio flex flex-col"},f={style:{flex:"1"}},p={class:"answer flex"},v={class:"flex"},x={class:"answer-list flex-col"},V={class:"order"},y={class:"flex",style:{"margin-bottom":"20px"}},h={style:{flex:"1"}},N={key:0,class:"margin-bottom flex"},w={style:{flex:"1"}},E={class:"flex flex-justify-end"};var k=l.defineComponent({name:"QxsSubjectScale",__name:"subject-scale",props:{orderIndex:{type:Number,required:!0},title:{type:String,required:!1},isSave:{type:Boolean,required:!0},showAction:{type:Boolean,required:!1},answerList:{type:null,required:!1},analysis:{type:String,required:!1},rowTitle:{type:String,required:!1},isEdit:{type:Boolean,required:!0},isSet:{type:Boolean,required:!0},scaleQuestionList:{type:null,required:!1},examRichTextContent:{type:String,required:!1},examAnswerRelationType:{type:Number,required:!1}},emits:["move","save","delete","edit","add"],setup(k,{emit:C}){const g=k,B=C,b=l.useAttrs(),q=l.ref([{title:""},{title:""},{title:""},{title:""},{title:""}]),S=l.ref(""),j=l.ref(""),R=l.ref(""),L=l.ref(!1),T=l.ref(""),_=l.ref([]),M=l.computed((()=>Math.ceil(24/(q.value.length+1))));function A(){5!==q.value.length&&q.value.push({title:""})}function D(){L.value=!1,T.value=""}function U(){if(!S.value)return void n.ElMessage.error("题目标题不能为空!");let e="";q.value.forEach(((l,t)=>{l.title||(e+=`选项${String.fromCharCode(65+t)}未填写。`)})),e?n.ElMessage.error(e):R.value?(_.value=R.value.split("\n").filter((e=>e)),B("save",{title:S.value,answers:q.value,analysis:j.value,scaleQuestionList:_.value,examRichTextContent:L.value?T.value:""})):n.ElMessage.error("行标题不能为空!")}l.onMounted((function(){g.title&&(S.value=g.title),g.answerList&&g.answerList.length&&(q.value=g.answerList),g.analysis&&(j.value=g.analysis),g.scaleQuestionList&&(_.value=g.scaleQuestionList,R.value=_.value.join("\n")),g.examRichTextContent&&(T.value=g.examRichTextContent,L.value=!0)}));const O=a.useNamespace("subject-scale");return(a,n)=>{const k=e.ElCol,C=e.ElRow,Q=e.ElRadio,z=e.ElInput,F=e.ElIcon,I=e.ElLink;return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(l.unref(O).e("scale-exam"))},[l.createVNode(s.default,{"show-edit":a.isEdit},{preview:l.withCtx((()=>[l.createElementVNode("div",i,[l.createElementVNode("div",null,[l.createElementVNode("span",d,l.toDisplayString(a.orderIndex+1)+"."+l.toDisplayString(l.unref(S))+"(量表题)",1),l.unref(L)?(l.openBlock(),l.createElementBlock("div",c,[l.createElementVNode("div",{innerHTML:l.unref(T)},null,8,u)])):l.createCommentVNode("v-if",!0)]),l.createElementVNode("div",m,[l.createVNode(C,{style:{padding:"10px 0"}},{default:l.withCtx((()=>[l.createVNode(k,{span:l.unref(M)},null,8,["span"]),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(q),(e=>(l.openBlock(),l.createBlock(k,{key:e.title,class:"flex flex-center",span:l.unref(M)},{default:l.withCtx((()=>[l.createElementVNode("span",null,l.toDisplayString(e.title),1)])),_:2},1032,["span"])))),128))])),_:1}),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(_),(e=>(l.openBlock(),l.createBlock(C,{key:e,style:{padding:"10px 0"}},{default:l.withCtx((()=>[l.createVNode(k,{span:l.unref(M),class:"flex flex-center"},{default:l.withCtx((()=>[l.createElementVNode("span",null,l.toDisplayString(e),1)])),_:2},1032,["span"]),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(q).length,(e=>(l.openBlock(),l.createBlock(k,{key:e,class:"radio-item flex flex-center",span:l.unref(M)},{default:l.withCtx((()=>[l.createVNode(Q,{disabled:!0})])),_:2},1032,["span"])))),128))])),_:2},1024)))),128))])])])),edit:l.withCtx((()=>[l.createElementVNode("div",{class:l.normalizeClass(["flex",[{"margin-bottom":l.unref(L)}]])},[n[10]||(n[10]=l.createElementVNode("div",{class:"label flex flex-justify-center"},[l.createElementVNode("span",null,"题目:")],-1)),l.createElementVNode("div",f,[l.createVNode(z,{modelValue:l.unref(S),"onUpdate:modelValue":n[0]||(n[0]=e=>l.isRef(S)?S.value=e:null),type:"textarea",rows:2,placeholder:"【量表题】请输入问题",disabled:a.isSave},null,8,["modelValue","disabled"])])],2),l.createElementVNode("div",p,[n[11]||(n[11]=l.createElementVNode("div",{class:"label flex flex-justify-center"},[l.createElementVNode("span",null,"行标题:")],-1)),l.createElementVNode("div",v,[l.createVNode(z,{modelValue:l.unref(R),"onUpdate:modelValue":n[1]||(n[1]=e=>l.isRef(R)?R.value=e:null),type:"textarea",placeholder:"请输入行标题",style:{width:"160px"},rows:10},null,8,["modelValue"]),l.createElementVNode("div",x,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(q),((e,n)=>(l.openBlock(),l.createElementBlock("div",{key:n,class:"answer-item flex flex-items-center"},[l.createElementVNode("span",V,l.toDisplayString(String.fromCharCode(65+n))+".",1),l.createVNode(z,{modelValue:e.title,"onUpdate:modelValue":l=>e.title=l,class:"input","show-word-limit":"",maxlength:10,placeholder:`选项${String.fromCharCode(65+n)}`,disabled:a.isSave},null,8,["modelValue","onUpdate:modelValue","placeholder","disabled"]),l.createCommentVNode(' <PlusCircleOutlined\n class="icon"\n :class="[{ disabled: answers.length === 5 }]"\n @click="addAnswer"\n />\n <MinusCircleOutlined\n class="icon"\n :class="[{ disabled: answers.length < 3 }]"\n @click="deleteAnswer(index)"\n /> '),l.createVNode(F,{class:"icon"},{default:l.withCtx((()=>[l.createVNode(l.unref(t.CirclePlus),{class:l.normalizeClass([{disabled:5===l.unref(q).length}]),onClick:A},null,8,["class"])])),_:1}),l.createVNode(F,{class:"icon"},{default:l.withCtx((()=>[l.createVNode(l.unref(t.Remove),{class:l.normalizeClass([{disabled:l.unref(q).length<3}]),onClick:e=>function(e){q.value.length<3||q.value.splice(e,1)}(n)},null,8,["class","onClick"])])),_:2},1024)])))),128))])])]),l.createElementVNode("div",y,[n[12]||(n[12]=l.createElementVNode("div",{class:"label flex flex-justify-center"},[l.createElementVNode("span",null,"解析:")],-1)),l.createElementVNode("div",h,[l.createVNode(z,{modelValue:l.unref(j),"onUpdate:modelValue":n[2]||(n[2]=e=>l.isRef(j)?j.value=e:null),type:"textarea",rows:2,placeholder:"请输入题目解析"},null,8,["modelValue"])])]),l.unref(L)?(l.openBlock(),l.createElementBlock("div",N,[n[14]||(n[14]=l.createElementVNode("div",{class:"label flex flex-justify-center"},[l.createElementVNode("span",null,"富文本:")],-1)),l.createElementVNode("div",w,[l.createVNode(o.default,l.mergeProps({"model-value":l.unref(T),"onUpdate:modelValue":n[3]||(n[3]=e=>l.isRef(T)?T.value=e:null)},l.unref(b),{style:{width:"100%"}}),null,16,["model-value"]),l.createElementVNode("div",E,[l.createVNode(I,{type:"danger",onClick:D},{default:l.withCtx((()=>n[13]||(n[13]=[l.createTextVNode(" 删除富文本 ")]))),_:1})])])])):l.createCommentVNode("v-if",!0)])),default:l.withCtx((()=>[a.showAction?(l.openBlock(),l.createBlock(r.default,{key:0,"is-edit":a.isEdit,"is-set":a.isSet,showOtherOption:!1,examAnswerRelationType:g.examAnswerRelationType,onMoveUp:n[4]||(n[4]=e=>B("move","up")),onMoveDown:n[5]||(n[5]=e=>B("move","down")),onDelete:n[6]||(n[6]=e=>B("delete")),onSave:U,onEdit:n[7]||(n[7]=e=>B("edit")),onAdd:n[8]||(n[8]=e=>B("add",e)),onOnShowRichText:n[9]||(n[9]=e=>L.value=!0)},null,8,["is-edit","is-set","examAnswerRelationType"])):l.createCommentVNode("v-if",!0)])),_:1},8,["show-edit"])],2)}}});exports.default=k;
|
2
2
|
//# sourceMappingURL=subject-scale.vue.cjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"subject-scale.vue.cjs","sources":["../../../../../../../packages/components/src/subject-list/src/components/subject-scale.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { CirclePlus, Remove } from '@element-plus/icons-vue'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport { ElMessage } from 'element-plus'\nimport SubjectAction from '../../../subject-action/src/subject-action.vue'\nimport SubjectLayout from '../../../subject-layout/src/subject-layout.vue'\nimport TinyMceEditor from '../../../tiny-mce-editor/src/tiny-mce-editor.vue'\n\ndefineOptions({\n name: 'QxsSubjectScale',\n})\nconst props = defineProps<{\n orderIndex: number\n title?: string\n isSave: boolean\n showAction?: boolean\n answerList?: any\n analysis?: string\n rowTitle?: string\n isEdit: boolean\n isSet: boolean\n scaleQuestionList?: any\n examRichTextContent?: string\n examAnswerRelationType?: number\n}>()\nconst emits = defineEmits(['move', 'save', 'delete', 'edit', 'add'])\n\nconst attrs = useAttrs()\n\nconst answers = ref<{\n title: string\n}[]>([{\n title: '',\n}, {\n title: '',\n}, {\n title: '',\n}, {\n title: '',\n}, {\n title: '',\n}])\n\nconst title = ref('')\nconst analysis = ref('')\nconst rowTitle = ref('')\nconst showRichText = ref(false)\nconst richText = ref('')\nconst scaleQuestionList = ref<string[]>([])\nconst span = computed(() => Math.ceil(24 / (answers.value.length + 1)))\nfunction addAnswer() {\n if (answers.value.length === 5) {\n return\n }\n answers.value.push({\n title: '',\n })\n}\n\nfunction deleteAnswer(index: number) {\n if (answers.value.length < 3) {\n return\n }\n answers.value.splice(index, 1)\n}\n\nfunction deleteRichText() {\n showRichText.value = false\n richText.value = ''\n}\n\nfunction save() {\n if (!title.value) {\n ElMessage.error('题目标题不能为空!')\n return\n }\n let msg = ''\n answers.value.forEach((v, i) => {\n if (!v.title) {\n msg += `选项${String.fromCharCode(65 + i)}未填写。`\n }\n })\n\n if (msg) {\n ElMessage.error(msg)\n return\n }\n\n if (!rowTitle.value) {\n ElMessage.error('行标题不能为空!')\n return\n }\n\n scaleQuestionList.value = rowTitle.value.split('\\n').filter(i => i)\n\n emits('save', {\n title: title.value,\n answers: answers.value,\n analysis: analysis.value,\n scaleQuestionList: scaleQuestionList.value,\n examRichTextContent: showRichText.value ? richText.value : '',\n })\n}\n\nfunction init() {\n if (props.title) {\n title.value = props.title\n }\n\n if (props.answerList && props.answerList.length) {\n answers.value = props.answerList\n }\n\n if (props.analysis) {\n analysis.value = props.analysis\n }\n\n if (props.scaleQuestionList) {\n scaleQuestionList.value = props.scaleQuestionList\n rowTitle.value = scaleQuestionList.value.join('\\n')\n }\n if (props.examRichTextContent) {\n richText.value = props.examRichTextContent\n showRichText.value = true\n }\n}\n\nonMounted(init)\nconst ns = useNamespace('subject-scale')\n</script>\n\n<template>\n <div :class=\"ns.e('scale-exam')\">\n <SubjectLayout :show-edit=\"isEdit\">\n <template #preview>\n <div class=\"preview\">\n <div>\n <span class=\"title\">{{ orderIndex + 1 }}.{{ title }}(量表题)</span>\n <div v-if=\"showRichText\">\n <div v-html=\"richText\" />\n </div>\n </div>\n <div class=\"answer-radio flex flex-col\">\n <el-row style=\"padding: 10px 0;\">\n <el-col :span=\"span\" />\n <el-col\n v-for=\"item in answers\"\n :key=\"item.title\"\n class=\"flex flex-center\"\n :span=\"span\"\n >\n <span>{{ item.title }}</span>\n </el-col>\n </el-row>\n <el-row\n v-for=\"item in scaleQuestionList\"\n :key=\"item\"\n style=\"padding: 10px 0;\"\n >\n <el-col :span=\"span\" class=\"flex flex-center\">\n <span>{{ item }}</span>\n </el-col>\n <el-col\n v-for=\"i in answers.length\"\n :key=\"i\"\n class=\"radio-item flex flex-center\"\n :span=\"span\"\n >\n <el-radio :disabled=\"true\" />\n </el-col>\n </el-row>\n </div>\n </div>\n </template>\n <template #edit>\n <div class=\"flex\" :class=\"[{ 'margin-bottom': showRichText }]\">\n <div class=\"label flex flex-justify-center\">\n <span>题目:</span>\n </div>\n <div style=\"flex: 1;\">\n <el-input\n v-model=\"title\"\n type=\"textarea\"\n :rows=\"2\"\n placeholder=\"【量表题】请输入问题\"\n :disabled=\"isSave\"\n />\n </div>\n </div>\n <div class=\"answer flex\">\n <div class=\"label flex flex-justify-center\">\n <span>行标题:</span>\n </div>\n <div class=\"flex\">\n <el-input\n v-model.trim=\"rowTitle\"\n type=\"textarea\"\n placeholder=\"请输入行标题\"\n style=\"width: 160px;\"\n :rows=\"10\"\n />\n <div class=\"answer-list flex-col\">\n <div\n v-for=\"(item, index) in answers\"\n :key=\"index\"\n class=\"answer-item flex flex-items-center\"\n >\n <span class=\"order\">{{ String.fromCharCode(65 + index) }}.</span>\n <el-input\n v-model=\"item.title\"\n class=\"input\"\n show-word-limit\n :maxlength=\"10\"\n :placeholder=\"`选项${String.fromCharCode(65 + index)}`\"\n :disabled=\"isSave\"\n />\n <!-- <PlusCircleOutlined\n class=\"icon\"\n :class=\"[{ disabled: answers.length === 5 }]\"\n @click=\"addAnswer\"\n />\n <MinusCircleOutlined\n class=\"icon\"\n :class=\"[{ disabled: answers.length < 3 }]\"\n @click=\"deleteAnswer(index)\"\n /> -->\n <el-icon class=\"icon\">\n <CirclePlus\n :class=\"[{ disabled: answers.length === 5 }]\"\n @click=\"addAnswer\"\n />\n </el-icon>\n <el-icon class=\"icon\">\n <Remove\n :class=\"[{ disabled: answers.length < 3 }]\"\n @click=\"deleteAnswer(index)\"\n />\n </el-icon>\n </div>\n </div>\n </div>\n </div>\n <div class=\"flex\" style=\"margin-bottom: 20px;\">\n <div class=\"label flex flex-justify-center\">\n <span>解析:</span>\n </div>\n <div style=\"flex: 1;\">\n <el-input\n v-model=\"analysis\"\n type=\"textarea\"\n :rows=\"2\"\n placeholder=\"请输入题目解析\"\n />\n </div>\n </div>\n <div v-if=\"showRichText\" class=\"margin-bottom flex\">\n <div class=\"label flex flex-justify-center\">\n <span>富文本:</span>\n </div>\n <div style=\"flex: 1;\">\n <TinyMceEditor v-model:model-value=\"richText\" v-bind=\"attrs\" style=\"width: 100%;\" />\n <div class=\"flex flex-justify-end\">\n <el-link\n type=\"danger\"\n @click=\"deleteRichText\"\n >\n 删除富文本\n </el-link>\n </div>\n </div>\n </div>\n </template>\n <SubjectAction\n v-if=\"showAction\"\n :is-edit=\"isEdit\"\n :is-set=\"isSet\"\n :showOtherOption=\"false\"\n :examAnswerRelationType=\"props.examAnswerRelationType\"\n @move-up=\"emits('move', 'up')\"\n @move-down=\"emits('move', 'down')\"\n @delete=\"emits('delete')\"\n @save=\"save\"\n @edit=\"emits('edit')\"\n @add=\"(type: any) => emits('add', type)\"\n @onShowRichText=\"showRichText = true\"\n />\n </SubjectLayout>\n </div>\n</template>\n"],"names":["props","__props","emits","__emit","attrs","useAttrs","answers","ref","title","analysis","rowTitle","showRichText","richText","scaleQuestionList","span","computed","Math","ceil","value","length","addAnswer","push","deleteRichText","save","ElMessage","error","msg","forEach","v","i","String","fromCharCode","split","filter","examRichTextContent","onMounted","answerList","join","ns","useNamespace","index","splice"],"mappings":"i2CAWA,MAAMA,EAAQC,EAcRC,EAAQC,EAERC,EAAQC,EAAAA,WAERC,EAAUC,EAAAA,IAEX,CAAC,CACJC,MAAO,IACN,CACDA,MAAO,IACN,CACDA,MAAO,IACN,CACDA,MAAO,IACN,CACDA,MAAO,MAGHA,EAAQD,MAAI,IACZE,EAAWF,MAAI,IACfG,EAAWH,MAAI,IACfI,EAAeJ,OAAI,GACnBK,EAAWL,MAAI,IACfM,EAAoBN,EAAcA,IAAA,IAClCO,EAAOC,EAAAA,UAAS,IAAMC,KAAKC,KAAK,IAAMX,EAAQY,MAAMC,OAAS,MACnE,SAASC,IACsB,IAAzBd,EAAQY,MAAMC,QAGlBb,EAAQY,MAAMG,KAAK,CACjBb,MAAO,IACR,CAUH,SAASc,IACPX,EAAaO,OAAQ,EACrBN,EAASM,MAAQ,EAAA,CAGnB,SAASK,IACH,IAACf,EAAMU,MAET,YADAM,EAAAA,UAAUC,MAAM,aAGlB,IAAIC,EAAM,GACVpB,EAAQY,MAAMS,SAAQ,CAACC,EAAGC,KACnBD,EAAEpB,QACLkB,GAAO,KAAKI,OAAOC,aAAa,GAAKF,SAAE,IAIvCH,EACFF,EAAAA,UAAUC,MAAMC,GAIbhB,EAASQ,OAKIL,EAAAK,MAAQR,EAASQ,MAAMc,MAAM,MAAMC,WAAYJ,IAEjE3B,EAAM,OAAQ,CACZM,MAAOA,EAAMU,MACbZ,QAASA,EAAQY,MACjBT,SAAUA,EAASS,MACnBL,kBAAmBA,EAAkBK,MACrCgB,oBAAqBvB,EAAaO,MAAQN,EAASM,MAAQ,MAX3DM,EAAAA,UAAUC,MAAM,WAYjB,CA0BHU,EAAAA,WAvBA,WACMnC,EAAMQ,QACRA,EAAMU,MAAQlB,EAAMQ,OAGlBR,EAAMoC,YAAcpC,EAAMoC,WAAWjB,SACvCb,EAAQY,MAAQlB,EAAMoC,YAGpBpC,EAAMS,WACRA,EAASS,MAAQlB,EAAMS,UAGrBT,EAAMa,oBACRA,EAAkBK,MAAQlB,EAAMa,kBAChCH,EAASQ,MAAQL,EAAkBK,MAAMmB,KAAK,OAE5CrC,EAAMkC,sBACRtB,EAASM,MAAQlB,EAAMkC,oBACvBvB,EAAaO,OAAQ,EACvB,IAII,MAAAoB,EAAKC,eAAa,0wHArExB,SAAsBC,GAChBlC,EAAQY,MAAMC,OAAS,GAGnBb,EAAAY,MAAMuB,OAAOD,EAAO,EAAC"}
|
1
|
+
{"version":3,"file":"subject-scale.vue.cjs","sources":["../../../../../../../packages/components/src/subject-list/src/components/subject-scale.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { CirclePlus, Remove } from '@element-plus/icons-vue'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport { ElMessage } from 'element-plus'\nimport SubjectAction from '../../../subject-action/src/subject-action.vue'\nimport SubjectLayout from '../../../subject-layout/src/subject-layout.vue'\nimport TinyMceEditor from '../../../tiny-mce-editor/src/tiny-mce-editor.vue'\n\ndefineOptions({\n name: 'QxsSubjectScale',\n})\nconst props = defineProps<{\n orderIndex: number\n title?: string\n isSave: boolean\n showAction?: boolean\n answerList?: any\n analysis?: string\n rowTitle?: string\n isEdit: boolean\n isSet: boolean\n scaleQuestionList?: any\n examRichTextContent?: string\n examAnswerRelationType?: number\n}>()\nconst emits = defineEmits(['move', 'save', 'delete', 'edit', 'add'])\n\nconst attrs = useAttrs()\n\nconst answers = ref<{\n title: string\n}[]>([{\n title: '',\n}, {\n title: '',\n}, {\n title: '',\n}, {\n title: '',\n}, {\n title: '',\n}])\n\nconst title = ref('')\nconst analysis = ref('')\nconst rowTitle = ref('')\nconst showRichText = ref(false)\nconst richText = ref('')\nconst scaleQuestionList = ref<string[]>([])\nconst span = computed(() => Math.ceil(24 / (answers.value.length + 1)))\nfunction addAnswer() {\n if (answers.value.length === 5) {\n return\n }\n answers.value.push({\n title: '',\n })\n}\n\nfunction deleteAnswer(index: number) {\n if (answers.value.length < 3) {\n return\n }\n answers.value.splice(index, 1)\n}\n\nfunction deleteRichText() {\n showRichText.value = false\n richText.value = ''\n}\n\nfunction save() {\n if (!title.value) {\n ElMessage.error('题目标题不能为空!')\n return\n }\n let msg = ''\n answers.value.forEach((v, i) => {\n if (!v.title) {\n msg += `选项${String.fromCharCode(65 + i)}未填写。`\n }\n })\n\n if (msg) {\n ElMessage.error(msg)\n return\n }\n\n if (!rowTitle.value) {\n ElMessage.error('行标题不能为空!')\n return\n }\n\n scaleQuestionList.value = rowTitle.value.split('\\n').filter(i => i)\n\n emits('save', {\n title: title.value,\n answers: answers.value,\n analysis: analysis.value,\n scaleQuestionList: scaleQuestionList.value,\n examRichTextContent: showRichText.value ? richText.value : '',\n })\n}\n\nfunction init() {\n if (props.title) {\n title.value = props.title\n }\n\n if (props.answerList && props.answerList.length) {\n answers.value = props.answerList\n }\n\n if (props.analysis) {\n analysis.value = props.analysis\n }\n\n if (props.scaleQuestionList) {\n scaleQuestionList.value = props.scaleQuestionList\n rowTitle.value = scaleQuestionList.value.join('\\n')\n }\n if (props.examRichTextContent) {\n richText.value = props.examRichTextContent\n showRichText.value = true\n }\n}\n\nonMounted(init)\nconst ns = useNamespace('subject-scale')\n</script>\n\n<template>\n <div :class=\"ns.e('scale-exam')\">\n <SubjectLayout :show-edit=\"isEdit\">\n <template #preview>\n <div class=\"preview\">\n <div>\n <span class=\"title\">{{ orderIndex + 1 }}.{{ title }}(量表题)</span>\n <div v-if=\"showRichText\">\n <div v-html=\"richText\" />\n </div>\n </div>\n <div class=\"answer-radio flex flex-col\">\n <el-row style=\"padding: 10px 0;\">\n <el-col :span=\"span\" />\n <el-col\n v-for=\"item in answers\"\n :key=\"item.title\"\n class=\"flex flex-center\"\n :span=\"span\"\n >\n <span>{{ item.title }}</span>\n </el-col>\n </el-row>\n <el-row\n v-for=\"item in scaleQuestionList\"\n :key=\"item\"\n style=\"padding: 10px 0;\"\n >\n <el-col :span=\"span\" class=\"flex flex-center\">\n <span>{{ item }}</span>\n </el-col>\n <el-col\n v-for=\"i in answers.length\"\n :key=\"i\"\n class=\"radio-item flex flex-center\"\n :span=\"span\"\n >\n <el-radio :disabled=\"true\" />\n </el-col>\n </el-row>\n </div>\n </div>\n </template>\n <template #edit>\n <div class=\"flex\" :class=\"[{ 'margin-bottom': showRichText }]\">\n <div class=\"label flex flex-justify-center\">\n <span>题目:</span>\n </div>\n <div style=\"flex: 1;\">\n <el-input\n v-model=\"title\"\n type=\"textarea\"\n :rows=\"2\"\n placeholder=\"【量表题】请输入问题\"\n :disabled=\"isSave\"\n />\n </div>\n </div>\n <div class=\"answer flex\">\n <div class=\"label flex flex-justify-center\">\n <span>行标题:</span>\n </div>\n <div class=\"flex\">\n <el-input\n v-model=\"rowTitle\"\n type=\"textarea\"\n placeholder=\"请输入行标题\"\n style=\"width: 160px;\"\n :rows=\"10\"\n />\n <div class=\"answer-list flex-col\">\n <div\n v-for=\"(item, index) in answers\"\n :key=\"index\"\n class=\"answer-item flex flex-items-center\"\n >\n <span class=\"order\">{{ String.fromCharCode(65 + index) }}.</span>\n <el-input\n v-model=\"item.title\"\n class=\"input\"\n show-word-limit\n :maxlength=\"10\"\n :placeholder=\"`选项${String.fromCharCode(65 + index)}`\"\n :disabled=\"isSave\"\n />\n <!-- <PlusCircleOutlined\n class=\"icon\"\n :class=\"[{ disabled: answers.length === 5 }]\"\n @click=\"addAnswer\"\n />\n <MinusCircleOutlined\n class=\"icon\"\n :class=\"[{ disabled: answers.length < 3 }]\"\n @click=\"deleteAnswer(index)\"\n /> -->\n <el-icon class=\"icon\">\n <CirclePlus\n :class=\"[{ disabled: answers.length === 5 }]\"\n @click=\"addAnswer\"\n />\n </el-icon>\n <el-icon class=\"icon\">\n <Remove\n :class=\"[{ disabled: answers.length < 3 }]\"\n @click=\"deleteAnswer(index)\"\n />\n </el-icon>\n </div>\n </div>\n </div>\n </div>\n <div class=\"flex\" style=\"margin-bottom: 20px;\">\n <div class=\"label flex flex-justify-center\">\n <span>解析:</span>\n </div>\n <div style=\"flex: 1;\">\n <el-input\n v-model=\"analysis\"\n type=\"textarea\"\n :rows=\"2\"\n placeholder=\"请输入题目解析\"\n />\n </div>\n </div>\n <div v-if=\"showRichText\" class=\"margin-bottom flex\">\n <div class=\"label flex flex-justify-center\">\n <span>富文本:</span>\n </div>\n <div style=\"flex: 1;\">\n <TinyMceEditor v-model:model-value=\"richText\" v-bind=\"attrs\" style=\"width: 100%;\" />\n <div class=\"flex flex-justify-end\">\n <el-link\n type=\"danger\"\n @click=\"deleteRichText\"\n >\n 删除富文本\n </el-link>\n </div>\n </div>\n </div>\n </template>\n <SubjectAction\n v-if=\"showAction\"\n :is-edit=\"isEdit\"\n :is-set=\"isSet\"\n :showOtherOption=\"false\"\n :examAnswerRelationType=\"props.examAnswerRelationType\"\n @move-up=\"emits('move', 'up')\"\n @move-down=\"emits('move', 'down')\"\n @delete=\"emits('delete')\"\n @save=\"save\"\n @edit=\"emits('edit')\"\n @add=\"(type: any) => emits('add', type)\"\n @onShowRichText=\"showRichText = true\"\n />\n </SubjectLayout>\n </div>\n</template>\n"],"names":["props","__props","emits","__emit","attrs","useAttrs","answers","ref","title","analysis","rowTitle","showRichText","richText","scaleQuestionList","span","computed","Math","ceil","value","length","addAnswer","push","deleteRichText","save","ElMessage","error","msg","forEach","v","i","String","fromCharCode","split","filter","examRichTextContent","onMounted","answerList","join","ns","useNamespace","index","splice"],"mappings":"i2CAWA,MAAMA,EAAQC,EAcRC,EAAQC,EAERC,EAAQC,EAAAA,WAERC,EAAUC,EAAAA,IAEX,CAAC,CACJC,MAAO,IACN,CACDA,MAAO,IACN,CACDA,MAAO,IACN,CACDA,MAAO,IACN,CACDA,MAAO,MAGHA,EAAQD,MAAI,IACZE,EAAWF,MAAI,IACfG,EAAWH,MAAI,IACfI,EAAeJ,OAAI,GACnBK,EAAWL,MAAI,IACfM,EAAoBN,EAAcA,IAAA,IAClCO,EAAOC,EAAAA,UAAS,IAAMC,KAAKC,KAAK,IAAMX,EAAQY,MAAMC,OAAS,MACnE,SAASC,IACsB,IAAzBd,EAAQY,MAAMC,QAGlBb,EAAQY,MAAMG,KAAK,CACjBb,MAAO,IACR,CAUH,SAASc,IACPX,EAAaO,OAAQ,EACrBN,EAASM,MAAQ,EAAA,CAGnB,SAASK,IACH,IAACf,EAAMU,MAET,YADAM,EAAAA,UAAUC,MAAM,aAGlB,IAAIC,EAAM,GACVpB,EAAQY,MAAMS,SAAQ,CAACC,EAAGC,KACnBD,EAAEpB,QACLkB,GAAO,KAAKI,OAAOC,aAAa,GAAKF,SAAE,IAIvCH,EACFF,EAAAA,UAAUC,MAAMC,GAIbhB,EAASQ,OAKIL,EAAAK,MAAQR,EAASQ,MAAMc,MAAM,MAAMC,WAAYJ,IAEjE3B,EAAM,OAAQ,CACZM,MAAOA,EAAMU,MACbZ,QAASA,EAAQY,MACjBT,SAAUA,EAASS,MACnBL,kBAAmBA,EAAkBK,MACrCgB,oBAAqBvB,EAAaO,MAAQN,EAASM,MAAQ,MAX3DM,EAAAA,UAAUC,MAAM,WAYjB,CA0BHU,EAAAA,WAvBA,WACMnC,EAAMQ,QACRA,EAAMU,MAAQlB,EAAMQ,OAGlBR,EAAMoC,YAAcpC,EAAMoC,WAAWjB,SACvCb,EAAQY,MAAQlB,EAAMoC,YAGpBpC,EAAMS,WACRA,EAASS,MAAQlB,EAAMS,UAGrBT,EAAMa,oBACRA,EAAkBK,MAAQlB,EAAMa,kBAChCH,EAASQ,MAAQL,EAAkBK,MAAMmB,KAAK,OAE5CrC,EAAMkC,sBACRtB,EAASM,MAAQlB,EAAMkC,oBACvBvB,EAAaO,OAAQ,EACvB,IAII,MAAAoB,EAAKC,eAAa,ivHArExB,SAAsBC,GAChBlC,EAAQY,MAAMC,OAAS,GAGnBb,EAAAY,MAAMuB,OAAOD,EAAO,EAAC"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue"),
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue"),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:T,currentList:w,uploadExcel:function(e){w.value=w.value.concat(e)},addExam:function(e){let t=1;const n=e.answers?.map((e=>({...e,title:e.answer,answerId:e.examAnswerId,isCorrect:e.isCorrect})))||[],s={...e,customId:r.setGuid(),answerType:e.richTextContent?"rich_text":e.examTypeEnum,answers:n,isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1};w.value.push(s),e.pageIndex-t==1&&(h(),t++);t>1&&h()},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(){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)}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":e.unref(f)(r.customId),item:r,"order-index":c,"is-edit":r.isEdit||!1,"is-set":r.hasSet||!1,"is-save":!r.isRealCanDel,examAnswerRelationType:r.examAnswerRelationType,onMove:e=>A(c,e),onDelete:e=>E(c),onSave:e=>R(c,e),onEdit:e=>r.isEdit=!0,onAdd:e=>T(e,c,null)},null,8,["total-page","current-page-index","item","order-index","is-edit","is-set","is-save","examAnswerRelationType","onMove","onDelete","onSave","onEdit","onAdd"])):e.createCommentVNode("v-if",!0)])))),128))])],2))}});exports.default=u;
|
2
2
|
//# sourceMappingURL=subject-list.vue.cjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"subject-list.vue.cjs","sources":["../../../../../../packages/components/src/subject-list/src/subject-list.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport SubjectBlankFill from './components/subject-blank-fill.vue'\nimport SubjectScale from './components/subject-scale.vue'\nimport SubjectSingle from './components/subject-single.vue'\nimport SubjectTextFill from './components/subject-text-fill.vue'\nimport SubjectRichText from './components/SubjectRichText.vue'\nimport SubjectPageEnd from './components/SubjectPageEnd.vue'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport { setGuid } from '@qxs-bns/utils'\n\ndefineOptions({\n name: 'QxsSubjectList',\n})\n\nconst props = defineProps<{\n subjectList: any[]\n isPreview: boolean\n}>()\nconst currentList = ref([] as any)\nconst emits = defineEmits(['setRelation'])\n\nconst attrs = useAttrs()\n\ndefineExpose({\n addSubject,\n currentList,\n uploadExcel,\n addExam,\n setAnswerRelation,\n})\n\nfunction totalPageIndex() {\n return currentList.value.filter((v: any) => v.answerType === 'page_end').length\n}\nconst currentPageIndex = computed(() => {\n const currentPageList = currentList.value.filter((v: any) => v.answerType === 'page_end')\n return (currentId: string) => {\n const currentIndex = currentPageList.findIndex((c: any) => c.customId === currentId)\n return currentIndex !== -1 ? currentIndex + 1 : 0\n }\n})\nfunction addPageEnd() {\n currentList.value.push({\n customId: setGuid(),\n answerType: 'page_end',\n analysis: '',\n scaleQuestionList: [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n examAnswerRelationType: 0,\n })\n}\n\nfunction addSubject(type: string, index: number | null = null, examAnswerRelationType: number | null = null) {\n const newSubject = {\n customId: setGuid(),\n answerType: type,\n analysis: '',\n scaleQuestionList: [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n examAnswerRelationType,\n }\n\n if (index !== null) {\n currentList.value.splice(index + 1, 0, newSubject)\n } else {\n currentList.value.push(newSubject)\n }\n}\n\nfunction addExam(item: any) {\n const answerList = item.answers?.map((v: any) => ({\n ...v,\n title: v.answer,\n answerId: v.examAnswerId,\n isCorrect: v.isCorrect,\n })) || []\n\n // 创建新的题目对象\n const newItem = {\n ...item,\n customId: setGuid(),\n answerType: item.richTextContent ? 'rich_text' : item.examTypeEnum,\n answers: answerList,\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n }\n\n // 将新题目添加到 currentList\n currentList.value.push(newItem)\n\n // 获取刚刚添加的题目的 customId\n const newCustomId = newItem.customId\n\n // 判断是否需要添加 page_end \n if ((item.pageIndex - currentPageIndex.value(newCustomId)) === 1) {\n console.log(currentPageIndex.value(newCustomId));\n addPageEnd()\n }\n\n if (currentPageIndex.value(newCustomId) > 1) {\n addPageEnd()\n }\n}\n\nfunction uploadExcel(list: any[]) {\n currentList.value = currentList.value.concat(list)\n}\n\nfunction move(index: number, type: 'up' | 'down') {\n if (type === 'up' && index > 0) {\n const [item] = currentList.value.splice(index, 1)\n currentList.value.splice(index - 1, 0, item)\n } else if (type === 'down' && index < currentList.value.length - 1) {\n const [item] = currentList.value.splice(index, 1)\n currentList.value.splice(index + 1, 0, item)\n }\n}\n\nfunction saveSubject(index: number, item: any) {\n currentList.value[index] = {\n ...currentList.value[index],\n ...item,\n isEdit: false,\n examAnswerRelationType: item.examAnswerRelationType,\n }\n}\n\nfunction deleteSubject(index: number) {\n currentList.value.splice(index, 1)\n ElMessage.success('删除成功')\n}\n\nfunction setRelation(customId: number, examAnswers: any) {\n emits('setRelation', customId, examAnswers)\n}\n\nfunction setAnswerRelation(answerRelations: any, customId: string, customAnswerId: string) {\n const targetItem = currentList.value.find((v: any) => v.customId === customId)\n if (targetItem) {\n const targetAnswer = targetItem.answers?.find((c: any) => c.customAnswerId === customAnswerId)\n if (targetAnswer) {\n targetAnswer.answerRelations = answerRelations\n }\n }\n}\n\nwatch(() => props.subjectList, (newList: any) => {\n if (newList) {\n currentList.value = [...newList]\n }\n}, { immediate: true })\n\nconst ns = useNamespace('subject-list')\n</script>\n\n<template>\n <div :class=\"ns.e('list-exam')\">\n <div class=\"subject-list-wrapper\">\n <div v-for=\"(item, index) in currentList\" :key=\"item.customId\" class=\"subject-item\">\n <template v-if=\"['single', 'multiple', 'sort'].includes(item.answerType)\">\n <SubjectSingle \n v-bind=\"attrs\" \n :order-index=\"index\" \n :title=\"item.title\" \n :type=\"item.answerType\"\n :exam-id=\"item.examId\"\n :isKey=\"item.isKey\" \n :is-save=\"!item.isRealCanDel\" \n :customId=\"item.customId\" \n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\" \n :analysis=\"item.analysis\" \n :least-answer-count=\"item.leastAnswerCount\"\n :is-edit=\"item.isEdit || false\" \n :show-action=\"!isPreview\" \n :exam-expand=\"item.examExpand\"\n :answerCheckType=\"item.answerCheckType\" \n :exam-rich-text-content=\"item.examRichTextContent\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n @setRelation=\"setRelation\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string, examAnswerRelationType: number) => addSubject(type, index, examAnswerRelationType)\" />\n </template>\n <SubjectScale v-bind=\"attrs\" v-else-if=\"item.answerType === 'scale'\" :order-index=\"index\" :title=\"item.title\"\n :is-save=\"!item.isRealCanDel\" :is-set=\"item.hasSet || false\" :answer-list=\"item.answers\"\n :analysis=\"item.analysis\" :is-edit=\"item.isEdit || false\" :scale-question-list=\"item.scaleQuestionList\"\n :show-action=\"!isPreview\" :exam-rich-text-content=\"item.examRichTextContent\"\n :examAnswerRelationType=\"item.examAnswerRelationType\" @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\" @save=\"(item: any) => saveSubject(index, item)\" @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\" />\n <SubjectBlankFill v-bind=\"attrs\" v-else-if=\"item.answerType === 'blank_fill'\" :order-index=\"index\"\n :title=\"item.title\" :is-save=\"!item.isRealCanDel\" :is-set=\"item.hasSet || false\" :answer-list=\"item.answers\"\n :analysis=\"item.analysis\" :show-action=\"!isPreview\" :is-edit=\"item.isEdit || false\"\n :exam-answer-setting-v-o=\"item.examAnswerSettingVO || {}\" :exam-rich-text-content=\"item.examRichTextContent\"\n :examAnswerRelationType=\"item.examAnswerRelationType\" @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\" @save=\"(item: any) => saveSubject(index, item)\" @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\" />\n <SubjectTextFill v-bind=\"attrs\" v-else-if=\"item.answerType === 'text_fill'\" :order-index=\"index\"\n :title=\"item.title\" :is-save=\"!item.isRealCanDel\" :is-set=\"item.hasSet || false\" :answer-list=\"item.answers\"\n :analysis=\"item.analysis\" :show-action=\"!isPreview\" :is-edit=\"item.isEdit || false\"\n :exam-expand=\"item.examExpand\" :exam-answer-setting-v-o=\"item.examAnswerSettingVO || {}\"\n :examAnswerRelationType=\"item.examAnswerRelationType\" :exam-rich-text-content=\"item.examRichTextContent\"\n @move=\"(type: 'up' | 'down') => move(index, type)\" @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\" @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\" />\n <SubjectRichText v-bind=\"attrs\" v-else-if=\"item.answerType === 'rich_text'\" :order-index=\"index\"\n :richTextContent=\"item.richTextContent\" :is-set=\"item.hasSet || false\" :is-save=\"!item.isRealCanDel\"\n :is-edit=\"item.isEdit || false\" :show-action=\"!isPreview\" @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\" :examAnswerRelationType=\"item.examAnswerRelationType\"\n @save=\"(item: any) => saveSubject(index, item)\" @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\" />\n <SubjectPageEnd v-else-if=\"item.answerType === 'page_end'\" :total-page=\"totalPageIndex()\" :key=\"index\"\n :current-page-index=\"currentPageIndex(item.customId)\" :item=\"item\" :order-index=\"index\"\n :is-edit=\"item.isEdit || false\" :is-set=\"item.hasSet || false\" :is-save=\"!item.isRealCanDel\"\n :examAnswerRelationType=\"item.examAnswerRelationType\" @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\" @save=\"(item: any) => saveSubject(index, item)\" @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\" />\n </div>\n </div>\n </div>\n</template>\n"],"names":["props","__props","currentList","ref","emits","__emit","attrs","useAttrs","__expose","addSubject","uploadExcel","list","value","concat","addExam","item","answerList","answers","map","v","title","answer","answerId","examAnswerId","isCorrect","newItem","customId","setGuid","answerType","richTextContent","examTypeEnum","isSave","isEdit","isRealCanDel","hasSet","push","newCustomId","pageIndex","currentPageIndex","console","log","addPageEnd","setAnswerRelation","answerRelations","customAnswerId","targetItem","find","targetAnswer","c","computed","currentPageList","filter","currentId","currentIndex","findIndex","analysis","scaleQuestionList","examAnswerRelationType","type","index","newSubject","splice","move","length","saveSubject","deleteSubject","ElMessage","success","setRelation","examAnswers","watch","subjectList","newList","immediate","ns","useNamespace"],"mappings":"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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}\nconst currentPageIndex = computed(() => {\n const currentPageList = currentList.value.filter((v: any) => v.answerType === 'page_end')\n return (currentId: string) => {\n const currentIndex = currentPageList.findIndex((c: any) => c.customId === currentId)\n return currentIndex !== -1 ? currentIndex + 1 : 0\n }\n})\nfunction addPageEnd() {\n currentList.value.push({\n customId: setGuid(),\n answerType: 'page_end',\n analysis: '',\n scaleQuestionList: [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n examAnswerRelationType: 0,\n })\n}\n\nfunction addSubject(type: string, index: number | null = null, examAnswerRelationType: number | null = null) {\n const newSubject = {\n customId: setGuid(),\n answerType: type,\n analysis: '',\n scaleQuestionList: [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n examAnswerRelationType,\n }\n\n if (index !== null) {\n currentList.value.splice(index + 1, 0, newSubject)\n } else {\n currentList.value.push(newSubject)\n }\n}\n\nfunction addExam(item: any) {\n 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 // 创建新的题目对象\n const newItem = {\n ...item,\n customId: setGuid(),\n answerType: item.richTextContent ? 'rich_text' : item.examTypeEnum,\n answers: answerList,\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n }\n\n // 将新题目添加到 currentList\n currentList.value.push(newItem)\n\n\n // 判断是否需要添加 page_end \n if (item.pageIndex - currentPageIndex === 1) {\n addPageEnd()\n currentPageIndex++\n }\n\n if (currentPageIndex > 1) {\n addPageEnd()\n }\n}\n\nfunction uploadExcel(list: any[]) {\n currentList.value = currentList.value.concat(list)\n}\n\nfunction move(index: number, type: 'up' | 'down') {\n if (type === 'up' && index > 0) {\n const [item] = currentList.value.splice(index, 1)\n currentList.value.splice(index - 1, 0, item)\n } else if (type === 'down' && index < currentList.value.length - 1) {\n const [item] = currentList.value.splice(index, 1)\n currentList.value.splice(index + 1, 0, item)\n }\n}\n\nfunction saveSubject(index: number, item: any) {\n currentList.value[index] = {\n ...currentList.value[index],\n ...item,\n isEdit: false,\n examAnswerRelationType: item.examAnswerRelationType,\n }\n}\n\nfunction deleteSubject(index: number) {\n currentList.value.splice(index, 1)\n ElMessage.success('删除成功')\n}\n\nfunction setRelation(customId: number, examAnswers: any) {\n emits('setRelation', customId, examAnswers)\n}\n\nfunction setAnswerRelation(answerRelations: any, customId: string, customAnswerId: string) {\n const targetItem = currentList.value.find((v: any) => v.customId === customId)\n if (targetItem) {\n const targetAnswer = targetItem.answers?.find((c: any) => c.customAnswerId === customAnswerId)\n if (targetAnswer) {\n targetAnswer.answerRelations = answerRelations\n }\n }\n}\n\nwatch(() => props.subjectList, (newList: any) => {\n if (newList) {\n currentList.value = [...newList]\n }\n}, { immediate: true })\n\nconst ns = useNamespace('subject-list')\n</script>\n\n<template>\n <div :class=\"ns.e('list-exam')\">\n <div class=\"subject-list-wrapper\">\n <div v-for=\"(item, index) in currentList\" :key=\"item.customId\" class=\"subject-item\">\n <template v-if=\"['single', 'multiple', 'sort'].includes(item.answerType)\">\n <SubjectSingle \n v-bind=\"attrs\" \n :order-index=\"index\" \n :title=\"item.title\" \n :type=\"item.answerType\"\n :exam-id=\"item.examId\"\n :isKey=\"item.isKey\" \n :is-save=\"!item.isRealCanDel\" \n :customId=\"item.customId\" \n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\" \n :analysis=\"item.analysis\" \n :least-answer-count=\"item.leastAnswerCount\"\n :is-edit=\"item.isEdit || false\" \n :show-action=\"!isPreview\" \n :exam-expand=\"item.examExpand\"\n :answerCheckType=\"item.answerCheckType\" \n :exam-rich-text-content=\"item.examRichTextContent\"\n :examAnswerRelationType=\"item.examAnswerRelationType\"\n @setRelation=\"setRelation\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string, examAnswerRelationType: number) => addSubject(type, index, examAnswerRelationType)\" />\n </template>\n <SubjectScale v-bind=\"attrs\" v-else-if=\"item.answerType === 'scale'\" :order-index=\"index\" :title=\"item.title\"\n :is-save=\"!item.isRealCanDel\" :is-set=\"item.hasSet || false\" :answer-list=\"item.answers\"\n :analysis=\"item.analysis\" :is-edit=\"item.isEdit || false\" :scale-question-list=\"item.scaleQuestionList\"\n :show-action=\"!isPreview\" :exam-rich-text-content=\"item.examRichTextContent\"\n :examAnswerRelationType=\"item.examAnswerRelationType\" @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\" @save=\"(item: any) => saveSubject(index, item)\" @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\" />\n <SubjectBlankFill v-bind=\"attrs\" v-else-if=\"item.answerType === 'blank_fill'\" :order-index=\"index\"\n :title=\"item.title\" :is-save=\"!item.isRealCanDel\" :is-set=\"item.hasSet || false\" :answer-list=\"item.answers\"\n :analysis=\"item.analysis\" :show-action=\"!isPreview\" :is-edit=\"item.isEdit || false\"\n :exam-answer-setting-v-o=\"item.examAnswerSettingVO || {}\" :exam-rich-text-content=\"item.examRichTextContent\"\n :examAnswerRelationType=\"item.examAnswerRelationType\" @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\" @save=\"(item: any) => saveSubject(index, item)\" @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\" />\n <SubjectTextFill v-bind=\"attrs\" v-else-if=\"item.answerType === 'text_fill'\" :order-index=\"index\"\n :title=\"item.title\" :is-save=\"!item.isRealCanDel\" :is-set=\"item.hasSet || false\" :answer-list=\"item.answers\"\n :analysis=\"item.analysis\" :show-action=\"!isPreview\" :is-edit=\"item.isEdit || false\"\n :exam-expand=\"item.examExpand\" :exam-answer-setting-v-o=\"item.examAnswerSettingVO || {}\"\n :examAnswerRelationType=\"item.examAnswerRelationType\" :exam-rich-text-content=\"item.examRichTextContent\"\n @move=\"(type: 'up' | 'down') => move(index, type)\" @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\" @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\" />\n <SubjectRichText v-bind=\"attrs\" v-else-if=\"item.answerType === 'rich_text'\" :order-index=\"index\"\n :richTextContent=\"item.richTextContent\" :is-set=\"item.hasSet || false\" :is-save=\"!item.isRealCanDel\"\n :is-edit=\"item.isEdit || false\" :show-action=\"!isPreview\" @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\" :examAnswerRelationType=\"item.examAnswerRelationType\"\n @save=\"(item: any) => saveSubject(index, item)\" @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\" />\n <SubjectPageEnd v-else-if=\"item.answerType === 'page_end'\" :total-page=\"totalPageIndex()\" :key=\"index\"\n :current-page-index=\"currentPageIndex(item.customId)\" :item=\"item\" :order-index=\"index\"\n :is-edit=\"item.isEdit || false\" :is-set=\"item.hasSet || false\" :is-save=\"!item.isRealCanDel\"\n :examAnswerRelationType=\"item.examAnswerRelationType\" @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\" @save=\"(item: any) => saveSubject(index, item)\" @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\" />\n </div>\n </div>\n </div>\n</template>\n"],"names":["props","__props","currentList","ref","emits","__emit","attrs","useAttrs","__expose","addSubject","uploadExcel","list","value","concat","addExam","item","currentPageIndex","answerList","answers","map","v","title","answer","answerId","examAnswerId","isCorrect","newItem","customId","setGuid","answerType","richTextContent","examTypeEnum","isSave","isEdit","isRealCanDel","hasSet","push","pageIndex","addPageEnd","setAnswerRelation","answerRelations","customAnswerId","targetItem","find","targetAnswer","c","computed","currentPageList","filter","currentId","currentIndex","findIndex","analysis","scaleQuestionList","examAnswerRelationType","type","index","newSubject","splice","move","length","saveSubject","deleteSubject","ElMessage","success","setRelation","examAnswers","watch","subjectList","newList","immediate","ns","useNamespace"],"mappings":"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"}
|
package/package.json
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"subject-scale.vue.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/subject-list/src/components/subject-scale.vue"],"names":[],"mappings":"AA6SA,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,OAAO,CAAA;IACf,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,UAAU,CAAC,EAAE,GAAG,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,OAAO,CAAA;IACf,KAAK,EAAE,OAAO,CAAA;IACd,iBAAiB,CAAC,EAAE,GAAG,CAAA;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,sBAAsB,CAAC,EAAE,MAAM,CAAA;CAChC,CAAC;;;;;;;;;;;;;;
|
1
|
+
{"version":3,"file":"subject-scale.vue.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/subject-list/src/components/subject-scale.vue"],"names":[],"mappings":"AA6SA,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,OAAO,CAAA;IACf,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,UAAU,CAAC,EAAE,GAAG,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,OAAO,CAAA;IACf,KAAK,EAAE,OAAO,CAAA;IACd,iBAAiB,CAAC,EAAE,GAAG,CAAA;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,sBAAsB,CAAC,EAAE,MAAM,CAAA;CAChC,CAAC;;;;;;;;;;;;;;AA2mBF,wBAOG"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"subject-list.vue.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/subject-list/src/subject-list.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"subject-list.vue.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/subject-list/src/subject-list.vue"],"names":[],"mappings":"AAsPA,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,QAkCzB;AAED,iBAAS,WAAW,CAAC,IAAI,EAAE,GAAG,EAAE,QAE/B;AA8BD,iBAAS,iBAAiB,CAAC,eAAe,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,QAQxF;;;;;;;;;;;;AA0dD,wBAQG"}
|