@qxs-bns/components 0.0.25 → 0.0.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- var r="0.0.25";export{r as version};
1
+ var r="0.0.26";export{r as version};
2
2
  //# sourceMappingURL=package.json.js.map
@@ -1,2 +1,2 @@
1
- import{ElPopover as e,ElLink as t,ElCheckbox as l,ElButton as a,ElIcon as n,ElDialog as o,ElRadioGroup as i,ElRadio as u}from"element-plus/es";import{defineComponent as s,ref as d,createElementBlock as c,openBlock as r,normalizeClass as p,unref as m,createElementVNode as f,createVNode as y,createBlock as v,createCommentVNode as _,withCtx as k,createTextVNode as h,isRef as b,Fragment as w}from"vue";import{Edit as g,Delete as C,Top as x,Bottom as V}from"@element-plus/icons-vue";import{useNamespace as j}from"@qxs-bns/hooks";import O from"../../subject-type/src/subject-type.vue.js";const S={key:0,class:"has-set"},T={key:1,class:"flex flex-justify-end",style:{width:"100%"}};var A=s({name:"QxsSubjectAction",__name:"subject-action",props:{isEdit:{type:Boolean},isSet:{type:Boolean,default:!1},isKey:{type:Boolean,default:!1},answerCheckType:{type:Number,default:2},showOtherOption:{type:Boolean,default:!0},examAnswerRelationType:{type:Number,default:null},pageEnd:{type:Boolean,default:!1}},emits:["moveUp","moveDown","delete","save","edit","add","onShowRichText","setKey","setAnswerSetting"],setup(s,{emit:A}){const B=s,E=d(B.isKey),U=d(!1),K=A,R=d(B.answerCheckType),z=j("subject-action");function D(){U.value=!1,K("setAnswerSetting",R)}function N(e,t){K("add",e,t?B.examAnswerRelationType:null)}return(d,j)=>{const A=t,B=e,q=l,Q=n,F=a,G=u,H=i,I=o;return r(),c("div",{class:p(m(z).e("action-exam"))},[f("div",{class:p(["action flex flex-justify-between",[{active:s.isEdit}]])},[y(B,{trigger:"click"},{reference:k((()=>[y(A,{type:"primary"},{default:k((()=>j[13]||(j[13]=[h(" +在此题后加入新题 ")]))),_:1})])),default:k((()=>[y(O,{onSelect:N})])),_:1}),s.showOtherOption?(r(),v(A,{key:0,type:"primary",onClick:j[0]||(j[0]=e=>K("onShowRichText"))},{default:k((()=>j[14]||(j[14]=[h(" +添加题目描述(图文) ")]))),_:1})):_("v-if",!0),s.showOtherOption?(r(),v(A,{key:1,type:"primary",onClick:j[1]||(j[1]=e=>U.value=!0)},{default:k((()=>j[15]||(j[15]=[h(" 答题设置 ")]))),_:1})):_("v-if",!0),s.showOtherOption?(r(),v(q,{key:2,modelValue:m(E),"onUpdate:modelValue":j[2]||(j[2]=e=>b(E)?E.value=e:null),label:"核心题",onChange:j[3]||(j[3]=e=>K("setKey",m(E)))},null,8,["modelValue"])):_("v-if",!0),f("div",null,[s.isSet?(r(),c("div",S," *此题设置了跳题逻辑 ")):(r(),c("div",T,[s.isEdit?(r(),c(w,{key:1},[y(F,{class:"btn-margin",onClick:j[8]||(j[8]=e=>K("delete"))},{default:k((()=>j[20]||(j[20]=[h(" 删除 ")]))),_:1}),y(F,{type:"primary",onClick:j[9]||(j[9]=e=>K("save"))},{default:k((()=>j[21]||(j[21]=[h(" 完成编辑 ")]))),_:1})],64)):(r(),c(w,{key:0},[s.pageEnd?_("v-if",!0):(r(),v(F,{key:0,class:"btn-margin",onClick:j[4]||(j[4]=e=>K("edit"))},{icon:k((()=>[y(Q,null,{default:k((()=>[y(m(g))])),_:1})])),default:k((()=>[j[16]||(j[16]=h(" 编辑 "))])),_:1})),y(F,{class:"btn-margin",onClick:j[5]||(j[5]=e=>K("delete"))},{icon:k((()=>[y(Q,null,{default:k((()=>[y(m(C))])),_:1})])),default:k((()=>[j[17]||(j[17]=h(" 删除 "))])),_:1}),y(F,{class:"btn-margin",onClick:j[6]||(j[6]=e=>K("moveUp"))},{icon:k((()=>[y(Q,null,{default:k((()=>[y(m(x))])),_:1})])),default:k((()=>[j[18]||(j[18]=h(" 上移 "))])),_:1}),y(F,{class:"btn-margin",onClick:j[7]||(j[7]=e=>K("moveDown"))},{icon:k((()=>[y(Q,null,{default:k((()=>[y(m(V))])),_:1})])),default:k((()=>[j[19]||(j[19]=h(" 下移 "))])),_:1})],64))]))]),y(I,{modelValue:m(U),"onUpdate:modelValue":j[12]||(j[12]=e=>b(U)?U.value=e:null),title:"答题设置",class:"customize-dialog"},{footer:k((()=>[y(F,{class:"customize-button",type:"primary",plain:"",onClick:j[11]||(j[11]=e=>U.value=!1)},{default:k((()=>j[25]||(j[25]=[h(" 取消 ")]))),_:1}),y(F,{class:"customize-button",type:"primary",plain:"",onClick:D},{default:k((()=>j[26]||(j[26]=[h(" 保存 ")]))),_:1})])),default:k((()=>[y(H,{modelValue:m(R),"onUpdate:modelValue":j[10]||(j[10]=e=>b(R)?R.value=e:null),class:"vertical-radio-group"},{default:k((()=>[y(G,{value:1},{default:k((()=>j[22]||(j[22]=[h("必须全部都是支持选项,方可下一步")]))),_:1}),y(G,{value:2},{default:k((()=>j[23]||(j[23]=[h("无需判断是否是支持选项")]))),_:1}),y(G,{value:3},{default:k((()=>j[24]||(j[24]=[h("包含全部支持选项,即可下一步")]))),_:1})])),_:1},8,["modelValue"])])),_:1},8,["modelValue"])],2)],2)}}});export{A as default};
1
+ import{ElPopover as e,ElLink as t,ElCheckbox as l,ElButton as a,ElIcon as n,ElDialog as o,ElRadioGroup as i,ElRadio as u}from"element-plus/es";import{defineComponent as s,ref as d,createElementBlock as c,openBlock as r,normalizeClass as p,unref as f,createElementVNode as m,createCommentVNode as y,createVNode as v,createBlock as k,withCtx as _,createTextVNode as h,isRef as b,Fragment as w}from"vue";import{Edit as g,Delete as C,Top as x,Bottom as V}from"@element-plus/icons-vue";import{useNamespace as j}from"@qxs-bns/hooks";import O from"../../subject-type/src/subject-type.vue.js";const S={key:0,class:"flex flex-justify-between"},E={key:0,class:"has-set"},T={key:1,class:"flex flex-justify-end",style:{width:"100%"}};var A=s({name:"QxsSubjectAction",__name:"subject-action",props:{isEdit:{type:Boolean},isSet:{type:Boolean,default:!1},isKey:{type:Boolean,default:!1},answerCheckType:{type:Number,default:2},showOtherOption:{type:Boolean,default:!0},examAnswerRelationType:{type:Number,default:null},pageEnd:{type:Boolean,default:!1}},emits:["moveUp","moveDown","delete","save","edit","add","onShowRichText","setKey","setAnswerSetting"],setup(s,{emit:A}){const B=s,U=d(B.isKey),K=d(!1),R=A,z=d(B.answerCheckType),D=j("subject-action");function N(){K.value=!1,R("setAnswerSetting",z)}function q(e,t){R("add",e,t?B.examAnswerRelationType:null)}return(d,j)=>{const A=t,B=e,Q=l,F=n,G=a,H=u,I=i,J=o;return r(),c("div",{class:p(f(D).e("action-exam"))},[m("div",{class:p(["action",[{active:s.isEdit}]])},[s.isEdit?(r(),c("div",S,[v(B,{trigger:"click"},{reference:_((()=>[v(A,{type:"primary"},{default:_((()=>j[13]||(j[13]=[h(" +在此题后加入新题 ")]))),_:1})])),default:_((()=>[v(O,{onSelect:q})])),_:1}),s.showOtherOption?(r(),k(A,{key:0,type:"primary",onClick:j[0]||(j[0]=e=>R("onShowRichText"))},{default:_((()=>j[14]||(j[14]=[h(" +添加题目描述(图文) ")]))),_:1})):y("v-if",!0),s.showOtherOption?(r(),k(A,{key:1,type:"primary",onClick:j[1]||(j[1]=e=>K.value=!0)},{default:_((()=>j[15]||(j[15]=[h(" 答题设置 ")]))),_:1})):y("v-if",!0),s.showOtherOption?(r(),k(Q,{key:2,modelValue:f(U),"onUpdate:modelValue":j[2]||(j[2]=e=>b(U)?U.value=e:null),label:"核心题",onChange:j[3]||(j[3]=e=>R("setKey",f(U)))},null,8,["modelValue"])):y("v-if",!0)])):y("v-if",!0),m("div",null,[s.isSet?(r(),c("div",E," *此题设置了跳题逻辑 ")):(r(),c("div",T,[s.isEdit?(r(),c(w,{key:1},[v(G,{class:"btn-margin",onClick:j[8]||(j[8]=e=>R("delete"))},{default:_((()=>j[20]||(j[20]=[h(" 删除 ")]))),_:1}),v(G,{type:"primary",onClick:j[9]||(j[9]=e=>R("save"))},{default:_((()=>j[21]||(j[21]=[h(" 完成编辑 ")]))),_:1})],64)):(r(),c(w,{key:0},[s.pageEnd?y("v-if",!0):(r(),k(G,{key:0,class:"btn-margin",onClick:j[4]||(j[4]=e=>R("edit"))},{icon:_((()=>[v(F,null,{default:_((()=>[v(f(g))])),_:1})])),default:_((()=>[j[16]||(j[16]=h(" 编辑 "))])),_:1})),v(G,{class:"btn-margin",onClick:j[5]||(j[5]=e=>R("delete"))},{icon:_((()=>[v(F,null,{default:_((()=>[v(f(C))])),_:1})])),default:_((()=>[j[17]||(j[17]=h(" 删除 "))])),_:1}),v(G,{class:"btn-margin",onClick:j[6]||(j[6]=e=>R("moveUp"))},{icon:_((()=>[v(F,null,{default:_((()=>[v(f(x))])),_:1})])),default:_((()=>[j[18]||(j[18]=h(" 上移 "))])),_:1}),v(G,{class:"btn-margin",onClick:j[7]||(j[7]=e=>R("moveDown"))},{icon:_((()=>[v(F,null,{default:_((()=>[v(f(V))])),_:1})])),default:_((()=>[j[19]||(j[19]=h(" 下移 "))])),_:1})],64))]))]),v(J,{modelValue:f(K),"onUpdate:modelValue":j[12]||(j[12]=e=>b(K)?K.value=e:null),title:"答题设置",class:"customize-dialog"},{footer:_((()=>[v(G,{class:"customize-button",type:"primary",plain:"",onClick:j[11]||(j[11]=e=>K.value=!1)},{default:_((()=>j[25]||(j[25]=[h(" 取消 ")]))),_:1}),v(G,{class:"customize-button",type:"primary",plain:"",onClick:N},{default:_((()=>j[26]||(j[26]=[h(" 保存 ")]))),_:1})])),default:_((()=>[v(I,{modelValue:f(z),"onUpdate:modelValue":j[10]||(j[10]=e=>b(z)?z.value=e:null),class:"vertical-radio-group"},{default:_((()=>[v(H,{value:1},{default:_((()=>j[22]||(j[22]=[h("必须全部都是支持选项,方可下一步")]))),_:1}),v(H,{value:2},{default:_((()=>j[23]||(j[23]=[h("无需判断是否是支持选项")]))),_:1}),v(H,{value:3},{default:_((()=>j[24]||(j[24]=[h("包含全部支持选项,即可下一步")]))),_:1})])),_:1},8,["modelValue"])])),_:1},8,["modelValue"])],2)],2)}}});export{A as default};
2
2
  //# sourceMappingURL=subject-action.vue.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"subject-action.vue.js","sources":["../../../../../../packages/components/src/subject-action/src/subject-action.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { Bottom, Delete, Edit, Top } from '@element-plus/icons-vue'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport SubjectType from '../../subject-type/src/subject-type.vue'\n\ndefineOptions({\n name: 'QxsSubjectAction',\n})\nconst props = defineProps({\n isEdit: {\n type: Boolean,\n },\n isSet: {\n type: Boolean,\n default: false,\n },\n isKey: {\n type: Boolean,\n default: false,\n },\n answerCheckType: {\n type: Number,\n default: 2\n },\n showOtherOption: {\n type: Boolean,\n default: true,\n },\n examAnswerRelationType: {\n type: Number,\n default: null\n },\n pageEnd: {\n type: Boolean,\n default: false\n }\n})\nconst isKey = ref(props.isKey)\nconst showAnswerSetting = ref(false)\nconst emits = defineEmits(['moveUp', 'moveDown', 'delete', 'save', 'edit', 'add', 'onShowRichText', 'setKey', 'setAnswerSetting'])\nconst answerType = ref(props.answerCheckType)\nconst ns = useNamespace('subject-action')\n\nfunction onSaveSetting() {\n showAnswerSetting.value = false\n emits('setAnswerSetting', answerType)\n}\n\nfunction selectExam(type:string, canSet: boolean) {\n emits('add', type, canSet? props.examAnswerRelationType: null)\n}\n</script>\n\n<template>\n <div :class=\"ns.e('action-exam')\">\n <div class=\"action flex flex-justify-between\" :class=\"[{ active: isEdit }]\">\n <el-popover trigger=\"click\">\n <template #reference>\n <el-link type=\"primary\">\n +在此题后加入新题\n </el-link>\n </template>\n <SubjectType @select=\"selectExam\" />\n </el-popover>\n <el-link type=\"primary\" @click=\"emits('onShowRichText')\" v-if=\"showOtherOption\">\n +添加题目描述(图文)\n </el-link>\n <el-link type=\"primary\" @click=\"showAnswerSetting = true\" v-if=\"showOtherOption\">\n 答题设置\n </el-link>\n <el-checkbox v-model=\"isKey\" label=\"核心题\" @change=\"emits('setKey', isKey)\" v-if=\"showOtherOption\"/>\n <div>\n <div v-if=\"isSet\" class=\"has-set\">\n *此题设置了跳题逻辑\n </div>\n <div v-else class=\"flex flex-justify-end\" style=\"width: 100%;\">\n <template v-if=\"!isEdit\">\n <el-button class=\"btn-margin\" @click=\"emits('edit')\" v-if=\"!pageEnd\">\n <template #icon>\n <el-icon>\n <Edit />\n </el-icon>\n </template>\n 编辑\n </el-button>\n <el-button class=\"btn-margin\" @click=\"emits('delete')\">\n <template #icon>\n <el-icon>\n <Delete />\n </el-icon>\n </template>\n 删除\n </el-button>\n <el-button class=\"btn-margin\" @click=\"emits('moveUp')\">\n <template #icon>\n <el-icon>\n <Top />\n </el-icon>\n </template>\n 上移\n </el-button>\n <el-button class=\"btn-margin\" @click=\"emits('moveDown')\">\n <template #icon>\n <el-icon>\n <Bottom />\n </el-icon>\n </template>\n 下移\n </el-button>\n </template>\n <template v-else>\n <el-button class=\"btn-margin\" @click=\"emits('delete')\">\n 删除\n </el-button>\n <el-button type=\"primary\" @click=\"emits('save')\">\n 完成编辑\n </el-button>\n </template>\n </div>\n </div>\n <el-dialog\n v-model=\"showAnswerSetting\"\n title=\"答题设置\"\n class=\"customize-dialog\"\n >\n <el-radio-group v-model=\"answerType\" class=\"vertical-radio-group\">\n <el-radio :value=\"1\">必须全部都是支持选项,方可下一步</el-radio>\n <el-radio :value=\"2\">无需判断是否是支持选项</el-radio>\n <el-radio :value=\"3\">包含全部支持选项,即可下一步</el-radio>\n </el-radio-group>\n <template #footer>\n <el-button\n class=\"customize-button\"\n type=\"primary\"\n plain\n @click=\"showAnswerSetting = false\"\n >\n 取消\n </el-button>\n <el-button\n class=\"customize-button\"\n type=\"primary\"\n plain\n @click=\"onSaveSetting\"\n >\n 保存\n </el-button>\n </template>\n </el-dialog>\n </div>\n </div>\n</template>\n"],"names":["props","__props","isKey","ref","showAnswerSetting","emits","__emit","answerType","answerCheckType","ns","useNamespace","onSaveSetting","value","selectExam","type","canSet","examAnswerRelationType"],"mappings":"2lCAQA,MAAMA,EAAQC,EA6BRC,EAAQC,EAAIH,EAAME,OAClBE,EAAoBD,GAAI,GACxBE,EAAQC,EACRC,EAAaJ,EAAIH,EAAMQ,iBACvBC,EAAKC,EAAa,kBAExB,SAASC,IACPP,EAAkBQ,OAAQ,EAC1BP,EAAM,mBAAoBE,EAAU,CAG7B,SAAAM,EAAWC,EAAaC,GAChCV,EAAM,MAAOS,EAAMC,EAAQf,EAAMgB,uBAAwB,KAAI"}
1
+ {"version":3,"file":"subject-action.vue.js","sources":["../../../../../../packages/components/src/subject-action/src/subject-action.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { Bottom, Delete, Edit, Top } from '@element-plus/icons-vue'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport SubjectType from '../../subject-type/src/subject-type.vue'\n\ndefineOptions({\n name: 'QxsSubjectAction',\n})\nconst props = defineProps({\n isEdit: {\n type: Boolean,\n },\n isSet: {\n type: Boolean,\n default: false,\n },\n isKey: {\n type: Boolean,\n default: false,\n },\n answerCheckType: {\n type: Number,\n default: 2\n },\n showOtherOption: {\n type: Boolean,\n default: true,\n },\n examAnswerRelationType: {\n type: Number,\n default: null\n },\n pageEnd: {\n type: Boolean,\n default: false\n }\n})\nconst isKey = ref(props.isKey)\nconst showAnswerSetting = ref(false)\nconst emits = defineEmits(['moveUp', 'moveDown', 'delete', 'save', 'edit', 'add', 'onShowRichText', 'setKey', 'setAnswerSetting'])\nconst answerType = ref(props.answerCheckType)\nconst ns = useNamespace('subject-action')\n\nfunction onSaveSetting() {\n showAnswerSetting.value = false\n emits('setAnswerSetting', answerType)\n}\n\nfunction selectExam(type:string, canSet: boolean) {\n emits('add', type, canSet? props.examAnswerRelationType: null)\n}\n</script>\n\n<template>\n <div :class=\"ns.e('action-exam')\">\n <div class=\"action\" :class=\"[{ active: isEdit }]\">\n <div v-if=\"isEdit\" class=\"flex flex-justify-between\">\n <el-popover trigger=\"click\">\n <template #reference>\n <el-link type=\"primary\">\n +在此题后加入新题\n </el-link>\n </template>\n <SubjectType @select=\"selectExam\" />\n </el-popover>\n <el-link type=\"primary\" @click=\"emits('onShowRichText')\" v-if=\"showOtherOption\">\n +添加题目描述(图文)\n </el-link>\n <el-link type=\"primary\" @click=\"showAnswerSetting = true\" v-if=\"showOtherOption\">\n 答题设置\n </el-link>\n <el-checkbox v-model=\"isKey\" label=\"核心题\" @change=\"emits('setKey', isKey)\" v-if=\"showOtherOption\"/>\n </div>\n <div>\n <div v-if=\"isSet\" class=\"has-set\">\n *此题设置了跳题逻辑\n </div>\n <div v-else class=\"flex flex-justify-end\" style=\"width: 100%;\">\n <template v-if=\"!isEdit\">\n <el-button class=\"btn-margin\" @click=\"emits('edit')\" v-if=\"!pageEnd\">\n <template #icon>\n <el-icon>\n <Edit />\n </el-icon>\n </template>\n 编辑\n </el-button>\n <el-button class=\"btn-margin\" @click=\"emits('delete')\">\n <template #icon>\n <el-icon>\n <Delete />\n </el-icon>\n </template>\n 删除\n </el-button>\n <el-button class=\"btn-margin\" @click=\"emits('moveUp')\">\n <template #icon>\n <el-icon>\n <Top />\n </el-icon>\n </template>\n 上移\n </el-button>\n <el-button class=\"btn-margin\" @click=\"emits('moveDown')\">\n <template #icon>\n <el-icon>\n <Bottom />\n </el-icon>\n </template>\n 下移\n </el-button>\n </template>\n <template v-else>\n <el-button class=\"btn-margin\" @click=\"emits('delete')\">\n 删除\n </el-button>\n <el-button type=\"primary\" @click=\"emits('save')\">\n 完成编辑\n </el-button>\n </template>\n </div>\n </div>\n <el-dialog\n v-model=\"showAnswerSetting\"\n title=\"答题设置\"\n class=\"customize-dialog\"\n >\n <el-radio-group v-model=\"answerType\" class=\"vertical-radio-group\">\n <el-radio :value=\"1\">必须全部都是支持选项,方可下一步</el-radio>\n <el-radio :value=\"2\">无需判断是否是支持选项</el-radio>\n <el-radio :value=\"3\">包含全部支持选项,即可下一步</el-radio>\n </el-radio-group>\n <template #footer>\n <el-button\n class=\"customize-button\"\n type=\"primary\"\n plain\n @click=\"showAnswerSetting = false\"\n >\n 取消\n </el-button>\n <el-button\n class=\"customize-button\"\n type=\"primary\"\n plain\n @click=\"onSaveSetting\"\n >\n 保存\n </el-button>\n </template>\n </el-dialog>\n </div>\n </div>\n</template>\n"],"names":["props","__props","isKey","ref","showAnswerSetting","emits","__emit","answerType","answerCheckType","ns","useNamespace","onSaveSetting","value","selectExam","type","canSet","examAnswerRelationType"],"mappings":"uoCAQA,MAAMA,EAAQC,EA6BRC,EAAQC,EAAIH,EAAME,OAClBE,EAAoBD,GAAI,GACxBE,EAAQC,EACRC,EAAaJ,EAAIH,EAAMQ,iBACvBC,EAAKC,EAAa,kBAExB,SAASC,IACPP,EAAkBQ,OAAQ,EAC1BP,EAAM,mBAAoBE,EAAU,CAG7B,SAAAM,EAAWC,EAAaC,GAChCV,EAAM,MAAOS,EAAMC,EAAQf,EAAMgB,uBAAwB,KAAI"}
@@ -1 +1 @@
1
- {"version":3,"file":"subject-scale.vue.js","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 => 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":"kuDAWA,MAAMA,EAAQC,EAcRC,EAAQC,EAERC,EAAQC,IAERC,EAAUC,EAEX,CAAC,CACJC,MAAO,IACN,CACDA,MAAO,IACN,CACDA,MA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BC,GAChBlC,EAAQY,MAAMC,OAAS,GAGnBb,EAAAY,MAAMuB,OAAOD,EAAO,EAAC"}
1
+ {"version":3,"file":"subject-scale.vue.js","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":"kuDAWA,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,2 +1,2 @@
1
- import{ElCheckbox as e,ElRadio as l,ElInput as t,ElSelect as a,ElOption as i,ElIcon as s,ElLink as n,ElDialog as r,ElButton as o,ElMessage as u}from"element-plus/es";import{defineComponent as d,useAttrs as m,ref as c,computed as p,watch as v,onMounted as y,createElementBlock as f,openBlock as x,normalizeClass as w,unref as h,createVNode as C,createSlots as g,withCtx as b,createBlock as k,createCommentVNode as S,createElementVNode as V,createTextVNode as A,toDisplayString as T,Fragment as q,renderList as R,isRef as j,mergeProps as _}from"vue";import{CirclePlus as I,Remove as E}from"@element-plus/icons-vue";import{useNamespace as U}from"@qxs-bns/hooks";import B from"../../../subject-action/src/subject-action.vue.js";import L from"../../../subject-layout/src/subject-layout.vue.js";import $ from"../../../tiny-mce-editor/src/tiny-mce-editor.vue.js";import{setGuid as K}from"@qxs-bns/utils";const z={class:"preview"},M={class:"title"},N={key:0},D={key:1},H={key:0},O=["innerHTML"],Q={class:"preview-answer"},F={class:"order"},G={class:"order"},J={style:{flex:"1"}},P={class:"margin-bottom flex flex-items-center"},W={class:"margin-bottom answer-list"},X={class:"order"},Y={key:0,class:"margin-bottom flex flex-items-center"},Z={style:{flex:"1"}},ee={key:1,class:"flex"},le={style:{flex:"1"}},te={key:2,class:"margin-bottom flex"},ae={style:{flex:"1"}},ie={class:"flex flex-justify-end"};var se=d({name:"QxsSubjectSingle",__name:"subject-single",props:{orderIndex:{type:Number,required:!0},title:{type:String,required:!1},isSave:{type:Boolean,required:!0},showAction:{type:Boolean,required:!1},type:{type:String,required:!0},isEdit:{type:Boolean,required:!0},isSet:{type:Boolean,required:!0},answerList:{type:null,required:!1},leastAnswerCount:{type:Number,required:!1},analysis:{type:String,required:!1},examExpand:{type:String,required:!1},examRichTextContent:{type:String,required:!1},showAnalysis:{type:Boolean,required:!1},examAnswerRelationType:{type:Number,required:!1},customId:{type:String,required:!1},isKey:{type:Boolean,required:!0},answerCheckType:{type:Number,required:!0}},emits:["move","save","delete","edit","add","setRelation"],setup(d,{emit:se}){const ne=d,re=se,oe=m(),ue=c(0),de=c(ne.isKey),me=c(2),ce=c([{title:"",isCorrect:!1},{title:"",isCorrect:!1},{title:"",isCorrect:!1},{title:"",isCorrect:!1},{title:"",isCorrect:!1}]),pe=c(),ve=c(""),ye=c(""),fe=c(!1),xe=c(""),we=c(0),he=c(!1),Ce=c(""),ge=p((()=>"single"===ne.type?"单选题":"multiple"===ne.type?"多选题":"排序题")),be=c([]),ke=p((()=>{const e=[];for(let l=ce.value.length;l>1;l--)e.push({label:`至少选择${l}项`,value:l});return e.reverse()}));function Se(){ne.isSave||ce.value.push({title:"",isCorrect:!1,customAnswerId:K()})}function Ve(){fe.value=!1,xe.value=""}function Ae(){if(!ve.value)return void u.error("题目标题不能为空!");let e="",l=!1,t=null,a=0;if("multiple"===ne.type||"single"===ne.type?ce.value.forEach(((i,s)=>{i.title||(e+=`选项${String.fromCharCode(65+s)}未填写。`),i.isCorrect&&(l=!0,a++),i.resultItem&&(t=1),i.answerRelations?.length&&(t=2)})):"sort"===ne.type&&be.value.length&&(l=!0),e)return void u.error(e);if(new Set(ce.value.map((e=>e.title))).size===ce.value.length){if("multiple"===ne.type){if(1===a)return void u.error("请至少设置两个正确答案");if(l&&a<pe.value)return void u.error("至少选几项与正确答案数不符")}re("save",{title:ve.value,answers:ce.value.map(((e,l)=>({...e,orderIndex:l+1}))),examExpand:be.value.map((e=>e.charCodeAt(0)-65+1)).join(","),analysis:ye.value,isSetCorrectAnswer:l,leastAnswerCount:pe.value,examRichTextContent:fe.value?xe.value:"",examAnswerRelationType:t,isKey:de.value,answerCheckType:me.value})}else u.error("选项不能重复")}function Te(){he.value=!1,Ce.value=""}function qe(){he.value=!1}function Re(e){de.value=e}function je(e){me.value=e}function _e(e,l){re("add",e,l?ne.examAnswerRelationType:null)}v((()=>ne.isEdit),(()=>{ne.isEdit&&(we.value=(new Date).getTime())}));const Ie=U("subject-single");return y((function(){if(ne.title&&(ve.value=ne.title),ne.answerCheckType&&(me.value=ne.answerCheckType),ne.answerList&&ne.answerList.length&&(ce.value=ne.answerList.map((e=>({...e,customAnswerId:e.examAnswerId||K()})))),ne.leastAnswerCount&&(pe.value=ne.leastAnswerCount),ne.examExpand&&ne.examExpand){const e=ne.examExpand.split(",");be.value=e.map((e=>{const l=ne.answerList.find((l=>l.answerId?.toString()===e));return l?String.fromCharCode(65+l.orderIndex-1):e})).filter(Boolean)}ne.analysis&&(ye.value=ne.analysis),ne.examRichTextContent&&(xe.value=ne.examRichTextContent,fe.value=!0)})),(u,d)=>{const m=e,c=l,p=t,v=i,y=a,U=s,K=n,se=o,we=r;return x(),f("div",{class:w(h(Ie).e("single-exam"))},[C(L,{"show-edit":u.isEdit},g({preview:b((()=>[V("div",z,[V("div",null,[V("span",M,[A(T(u.orderIndex+1)+"."+T(h(ve))+" ",1),"single"===u.type?(x(),f("span",N,"(单选题)")):["multiple","sort"].includes(u.type)?(x(),f("span",D," ("+T(h(ge))+T(h(pe)?`至少选${h(pe)}项${"sort"===u.type?"并排序":""}`:"")+") ",1)):S("v-if",!0)])]),h(fe)?(x(),f("div",H,[V("div",{innerHTML:h(xe)},null,8,O)])):S("v-if",!0),V("div",Q,["sort"===u.type?(x(!0),f(q,{key:0},R(h(ce),((e,l)=>(x(),k(m,{key:l,class:"radio",disabled:!0},{default:b((()=>[V("span",F,T(String.fromCharCode(65+l))+". ",1),A(" "+T(e.title),1)])),_:2},1024)))),128)):(x(!0),f(q,{key:1},R(h(ce),((e,l)=>(x(),k(c,{key:l,class:"radio",value:"disabled",disabled:""},{default:b((()=>[V("span",G,T(String.fromCharCode(65+l))+". ",1),A(" "+T(e.title)+" "+T(e.isCorrect?"(支持选项)":"")+" "+T(e.resultItem?"(已设置结果项)":"(未设置结果项)")+" "+T(e.answerRelations?.length?"(已设置关联)":"(未设置关联)"),1)])),_:2},1024)))),128))])])])),default:b((()=>[u.showAction?(x(),k(B,{key:0,"is-edit":u.isEdit,"is-set":u.isSet,isKey:h(de),examAnswerRelationType:ne.examAnswerRelationType,answerCheckType:h(me),onMoveUp:d[5]||(d[5]=e=>re("move","up")),onMoveDown:d[6]||(d[6]=e=>re("move","down")),onDelete:d[7]||(d[7]=e=>re("delete")),onSave:Ae,onEdit:d[8]||(d[8]=e=>re("edit")),onAdd:_e,onOnShowRichText:d[9]||(d[9]=e=>fe.value=!0),onSetKey:Re,onSetAnswerSetting:je},null,8,["is-edit","is-set","isKey","examAnswerRelationType","answerCheckType"])):S("v-if",!0)])),_:2},[u.isEdit?{name:"edit",fn:b((()=>[V("div",{class:w(["flex",[{"margin-bottom":h(fe)}]])},[d[12]||(d[12]=V("div",{class:"label flex flex-justify-center"},[V("span",null,"题目:")],-1)),V("div",J,[C(p,{modelValue:h(ve),"onUpdate:modelValue":d[0]||(d[0]=e=>j(ve)?ve.value=e:null),type:"textarea",rows:2,placeholder:`【${h(ge)}】请输入问题`,disabled:u.isSave,"show-word-limit":"",maxlength:"200",class:"margin-bottom"},null,8,["modelValue","placeholder","disabled"])])],2),V("div",P,[d[13]||(d[13]=V("div",{class:"label flex flex-justify-center"},[V("span",null,"设置:")],-1)),["multiple","sort"].includes(u.type)?(x(),k(y,{key:0,modelValue:h(pe),"onUpdate:modelValue":d[1]||(d[1]=e=>j(pe)?pe.value=e:null),style:{width:"150px"},placeholder:"至少选择几项",disabled:u.isSave},{default:b((()=>[(x(!0),f(q,null,R(h(ke),(e=>(x(),k(v,{key:e.value,value:e.value,label:e.label},null,8,["value","label"])))),128))])),_:1},8,["modelValue","disabled"])):S("v-if",!0)]),V("div",W,[(x(!0),f(q,null,R(h(ce),((e,l)=>(x(),f("div",{key:l,class:"answer-item flex flex-items-center"},[V("span",X,T(String.fromCharCode(65+l))+".",1),C(p,{modelValue:e.title,"onUpdate:modelValue":l=>e.title=l,class:"input","show-word-limit":"",maxlength:"100",placeholder:`选项${String.fromCharCode(65+l)}`,disabled:u.isSave},null,8,["modelValue","onUpdate:modelValue","placeholder","disabled"]),["single","multiple"].includes(u.type)?(x(),k(m,{key:0,modelValue:e.isCorrect,"onUpdate:modelValue":l=>e.isCorrect=l,class:w([{"is-correct":e.isCorrect}]),disabled:u.isSave,style:{"margin-left":"10px"},onChange:l=>function(e,l){"single"===ne.type?(l&&ce.value.forEach((l=>{l!==e&&(l.isCorrect=!1)})),e.isCorrect=l):"multiple"===ne.type&&(e.isCorrect=l)}(e,l)},{default:b((()=>[...d[14]||(d[14]=[A(" 支持选项 ")])])),_:2},1032,["modelValue","onUpdate:modelValue","class","disabled","onChange"])):S("v-if",!0),C(U,{class:"icon"},{default:b((()=>[C(h(I),{class:w([{disabled:u.isSave}]),onClick:Se},null,8,["class"])])),_:1}),C(U,{class:"icon"},{default:b((()=>[C(h(E),{class:w([{disabled:h(ce).length<3||u.isSave}]),onClick:e=>function(e){ce.value.length<3||ne.isSave||ce.value.splice(e,1)}(l)},null,8,["class","onClick"])])),_:2},1024),1===u.examAnswerRelationType?(x(),k(K,{key:1,type:"primary",class:"margin-left-10",onClick:e=>{return t=l,ue.value=t,void(he.value=!0);var t}},{default:b((()=>[V("span",null,T(e.resultItem?"编辑结果":"添加结果"),1)])),_:2},1032,["onClick"])):S("v-if",!0),2===u.examAnswerRelationType?(x(),k(K,{key:2,type:"primary",class:"margin-left-10",onClick:l=>function(e){re("setRelation",ne.customId,e)}(e)},{default:b((()=>[V("span",null,T(e.answerRelations?.length?`关联了${e.answerRelations?.length}项`:"关联检查"),1)])),_:2},1032,["onClick"])):S("v-if",!0)])))),128))]),"sort"===u.type?(x(),f("div",Y,[d[15]||(d[15]=V("div",{class:"label flex flex-justify-end"},[V("span",null,"排序答案:")],-1)),V("div",Z,[C(y,{modelValue:h(be),"onUpdate:modelValue":d[2]||(d[2]=e=>j(be)?be.value=e:null),mode:"multiple",style:{width:"360px"},placeholder:"请按顺序选择排序答案","show-arrow":!0},{default:b((()=>[S(' :options="[...Array(answers.length)].map((_, i) => ({ value: String.fromCharCode(65 + i) }))" '),(x(!0),f(q,null,R(h(ce),((e,l)=>(x(),k(v,{key:l,label:e.title,value:String.fromCharCode(65+l)},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])])):S("v-if",!0),u.showAnalysis?(x(),f("div",ee,[d[16]||(d[16]=V("div",{class:"label flex flex-justify-center"},[V("span",null,"解析:")],-1)),V("div",le,[C(p,{modelValue:h(ye),"onUpdate:modelValue":d[3]||(d[3]=e=>j(ye)?ye.value=e:null),type:"textarea",rows:2,placeholder:"请输入题目解析"},null,8,["modelValue"])])])):S("v-if",!0),h(fe)?(x(),f("div",te,[d[18]||(d[18]=V("div",{class:"label flex flex-justify-center"},[V("span",null,"富文本:")],-1)),V("div",ae,[C($,_({"model-value":h(xe),"onUpdate:modelValue":d[4]||(d[4]=e=>j(xe)?xe.value=e:null)},h(oe),{style:{width:"100%"}}),null,16,["model-value"]),V("div",ie,[C(K,{type:"danger",onClick:Ve},{default:b((()=>d[17]||(d[17]=[A(" 删除富文本 ")]))),_:1})])])])):S("v-if",!0)])),key:"0"}:void 0]),1032,["show-edit"]),C(we,{modelValue:h(he),"onUpdate:modelValue":d[11]||(d[11]=e=>j(he)?he.value=e:null),title:"添加结果",class:"customize-dialog"},{footer:b((()=>[C(se,{class:"customize-button",type:"primary",plain:"",onClick:Te},{default:b((()=>d[19]||(d[19]=[A(" 取消 ")]))),_:1}),C(se,{class:"customize-button",type:"primary",plain:"",onClick:qe},{default:b((()=>d[20]||(d[20]=[A(" 保存 ")]))),_:1})])),default:b((()=>[(x(),k($,_({key:h(ue),"model-value":h(ce)[h(ue)].resultItem,"onUpdate:modelValue":d[10]||(d[10]=e=>h(ce)[h(ue)].resultItem=e)},h(oe),{style:{width:"100%"}}),null,16,["model-value"]))])),_:1},8,["modelValue"])],2)}}});export{se as default};
1
+ import{ElCheckbox as e,ElRadio as l,ElInput as t,ElSelect as a,ElOption as i,ElIcon as s,ElLink as n,ElDialog as r,ElButton as o,ElMessage as u}from"element-plus/es";import{defineComponent as d,useAttrs as m,ref as c,computed as p,watch as v,onMounted as y,createElementBlock as f,openBlock as x,normalizeClass as w,unref as h,createVNode as C,createSlots as g,withCtx as b,createBlock as k,createCommentVNode as S,createElementVNode as A,createTextVNode as V,toDisplayString as T,Fragment as R,renderList as q,isRef as j,mergeProps as I}from"vue";import{CirclePlus as _,Remove as E}from"@element-plus/icons-vue";import{useNamespace as U}from"@qxs-bns/hooks";import B from"../../../subject-action/src/subject-action.vue.js";import L from"../../../subject-layout/src/subject-layout.vue.js";import $ from"../../../tiny-mce-editor/src/tiny-mce-editor.vue.js";import{setGuid as K}from"@qxs-bns/utils";const N={class:"preview"},z={class:"title"},M={key:0},D={key:1},H={key:0},O=["innerHTML"],Q={class:"preview-answer"},F={class:"order"},G={class:"order"},J={style:{flex:"1"}},P={class:"margin-bottom flex flex-items-center"},W={class:"margin-bottom answer-list"},X={class:"order"},Y={key:0,class:"margin-bottom flex flex-items-center"},Z={style:{flex:"1"}},ee={key:1,class:"flex"},le={style:{flex:"1"}},te={key:2,class:"margin-bottom flex"},ae={style:{flex:"1"}},ie={class:"flex flex-justify-end"};var se=d({name:"QxsSubjectSingle",__name:"subject-single",props:{orderIndex:{type:Number,required:!0},title:{type:String,required:!1},isSave:{type:Boolean,required:!0},showAction:{type:Boolean,required:!1},type:{type:String,required:!0},isEdit:{type:Boolean,required:!0},isSet:{type:Boolean,required:!0},answerList:{type:null,required:!1},leastAnswerCount:{type:Number,required:!1},analysis:{type:String,required:!1},examExpand:{type:String,required:!1},examRichTextContent:{type:String,required:!1},showAnalysis:{type:Boolean,required:!1},examAnswerRelationType:{type:Number,required:!1},customId:{type:Number,required:!1},examId:{type:Number,required:!1},isKey:{type:Boolean,required:!0},answerCheckType:{type:Number,required:!0}},emits:["move","save","delete","edit","add","setRelation"],setup(d,{emit:se}){const ne=d,re=se,oe=m(),ue=c(0),de=c(ne.isKey),me=c(2),ce=c([{title:"",isCorrect:!1},{title:"",isCorrect:!1},{title:"",isCorrect:!1},{title:"",isCorrect:!1},{title:"",isCorrect:!1}]),pe=c(),ve=c(""),ye=c(""),fe=c(!1),xe=c(""),we=c(0),he=c(!1),Ce=c(""),ge=p((()=>"single"===ne.type?"单选题":"multiple"===ne.type?"多选题":"排序题")),be=c([]),ke=p((()=>{const e=[];for(let l=ce.value.length;l>1;l--)e.push({label:`至少选择${l}项`,value:l});return e.reverse()}));function Se(){ne.isSave||ce.value.push({title:"",isCorrect:!1,customAnswerId:K()})}function Ae(){fe.value=!1,xe.value=""}function Ve(){if(!ve.value)return void u.error("题目标题不能为空!");let e="",l=!1,t=null,a=0;if("multiple"===ne.type||"single"===ne.type?ce.value.forEach(((i,s)=>{i.title||(e+=`选项${String.fromCharCode(65+s)}未填写。`),i.isCorrect&&(l=!0,a++),i.resultItem&&(t=1),i.answerRelations?.length&&(t=2)})):"sort"===ne.type&&be.value.length&&(l=!0),e)return void u.error(e);if(new Set(ce.value.map((e=>e.title))).size===ce.value.length){if("multiple"===ne.type){if(1===a)return void u.error("请至少设置两个正确答案");if(l&&a<pe.value)return void u.error("至少选几项与正确答案数不符")}re("save",{title:ve.value,answers:ce.value.map(((e,l)=>({...e,orderIndex:l+1}))),examExpand:be.value.map((e=>e.charCodeAt(0)-65+1)).join(","),analysis:ye.value,isSetCorrectAnswer:l,leastAnswerCount:pe.value,examRichTextContent:fe.value?xe.value:"",examAnswerRelationType:t,isKey:de.value,answerCheckType:me.value})}else u.error("选项不能重复")}function Te(){he.value=!1,Ce.value=""}function Re(){he.value=!1}function qe(e){de.value=e}function je(e){me.value=e}function Ie(e,l){re("add",e,l?ne.examAnswerRelationType:null)}v((()=>ne.isEdit),(()=>{ne.isEdit&&(we.value=(new Date).getTime())}));const _e=U("subject-single");return y((function(){if(ne.title&&(ve.value=ne.title),ne.answerCheckType&&(me.value=ne.answerCheckType),ne.answerList&&ne.answerList.length&&(ce.value=ne.answerList.map((e=>({...e,customAnswerId:e.examAnswerId||K()})))),ne.leastAnswerCount&&(pe.value=ne.leastAnswerCount),ne.examExpand&&ne.examExpand){const e=ne.examExpand.split(",");be.value=e.map((e=>{const l=ne.answerList.find((l=>l.answerId?.toString()===e));return l?String.fromCharCode(65+l.orderIndex-1):e})).filter(Boolean)}ne.analysis&&(ye.value=ne.analysis),ne.examRichTextContent&&(xe.value=ne.examRichTextContent,fe.value=!0)})),(u,d)=>{const m=e,c=l,p=t,v=i,y=a,U=s,K=n,se=o,we=r;return x(),f("div",{class:w(h(_e).e("single-exam"))},[C(L,{"show-edit":u.isEdit},g({preview:b((()=>[A("div",N,[A("div",null,[A("span",z,[V(T(u.orderIndex+1)+"."+T(h(ve))+" ",1),"single"===u.type?(x(),f("span",M,"(单选题)")):["multiple","sort"].includes(u.type)?(x(),f("span",D," ("+T(h(ge))+T(h(pe)?`至少选${h(pe)}项${"sort"===u.type?"并排序":""}`:"")+") ",1)):S("v-if",!0)])]),h(fe)?(x(),f("div",H,[A("div",{innerHTML:h(xe)},null,8,O)])):S("v-if",!0),A("div",Q,["sort"===u.type?(x(!0),f(R,{key:0},q(h(ce),((e,l)=>(x(),k(m,{key:l,class:"radio",disabled:!0},{default:b((()=>[A("span",F,T(String.fromCharCode(65+l))+". ",1),V(" "+T(e.title),1)])),_:2},1024)))),128)):(x(!0),f(R,{key:1},q(h(ce),((e,l)=>(x(),k(c,{key:l,class:"radio",value:"disabled",disabled:""},{default:b((()=>[A("span",G,T(String.fromCharCode(65+l))+". ",1),V(" "+T(e.title)+" "+T(e.isCorrect?"(支持选项)":"")+" "+T(e.resultItem&&1===u.examAnswerRelationType?"(已设置结果项)":"(未设置结果项)")+" "+T(e.answerRelations?.length&&2===u.examAnswerRelationType?"(已设置关联)":"(未设置关联)"),1)])),_:2},1024)))),128))])])])),default:b((()=>[u.showAction?(x(),k(B,{key:0,"is-edit":u.isEdit,"is-set":u.isSet,isKey:h(de),examAnswerRelationType:ne.examAnswerRelationType,answerCheckType:h(me),onMoveUp:d[5]||(d[5]=e=>re("move","up")),onMoveDown:d[6]||(d[6]=e=>re("move","down")),onDelete:d[7]||(d[7]=e=>re("delete")),onSave:Ve,onEdit:d[8]||(d[8]=e=>re("edit")),onAdd:Ie,onOnShowRichText:d[9]||(d[9]=e=>fe.value=!0),onSetKey:qe,onSetAnswerSetting:je},null,8,["is-edit","is-set","isKey","examAnswerRelationType","answerCheckType"])):S("v-if",!0)])),_:2},[u.isEdit?{name:"edit",fn:b((()=>[A("div",{class:w(["flex",[{"margin-bottom":h(fe)}]])},[d[12]||(d[12]=A("div",{class:"label flex flex-justify-center"},[A("span",null,"题目:")],-1)),A("div",J,[C(p,{modelValue:h(ve),"onUpdate:modelValue":d[0]||(d[0]=e=>j(ve)?ve.value=e:null),type:"textarea",rows:2,placeholder:`【${h(ge)}】请输入问题`,disabled:u.isSave,"show-word-limit":"",maxlength:"200",class:"margin-bottom"},null,8,["modelValue","placeholder","disabled"])])],2),A("div",P,[d[13]||(d[13]=A("div",{class:"label flex flex-justify-center"},[A("span",null,"设置:")],-1)),["multiple","sort"].includes(u.type)?(x(),k(y,{key:0,modelValue:h(pe),"onUpdate:modelValue":d[1]||(d[1]=e=>j(pe)?pe.value=e:null),style:{width:"150px"},placeholder:"至少选择几项",disabled:u.isSave},{default:b((()=>[(x(!0),f(R,null,q(h(ke),(e=>(x(),k(v,{key:e.value,value:e.value,label:e.label},null,8,["value","label"])))),128))])),_:1},8,["modelValue","disabled"])):S("v-if",!0)]),A("div",W,[(x(!0),f(R,null,q(h(ce),((e,l)=>(x(),f("div",{key:l,class:"answer-item flex flex-items-center"},[A("span",X,T(String.fromCharCode(65+l))+".",1),C(p,{modelValue:e.title,"onUpdate:modelValue":l=>e.title=l,class:"input","show-word-limit":"",maxlength:"100",placeholder:`选项${String.fromCharCode(65+l)}`,disabled:u.isSave},null,8,["modelValue","onUpdate:modelValue","placeholder","disabled"]),["single","multiple"].includes(u.type)?(x(),k(m,{key:0,modelValue:e.isCorrect,"onUpdate:modelValue":l=>e.isCorrect=l,class:w([{"is-correct":e.isCorrect}]),disabled:u.isSave,style:{"margin-left":"10px"},onChange:l=>function(e,l){"single"===ne.type?(l&&ce.value.forEach((l=>{l!==e&&(l.isCorrect=!1)})),e.isCorrect=l):"multiple"===ne.type&&(e.isCorrect=l)}(e,l)},{default:b((()=>[...d[14]||(d[14]=[V(" 支持选项 ")])])),_:2},1032,["modelValue","onUpdate:modelValue","class","disabled","onChange"])):S("v-if",!0),C(U,{class:"icon"},{default:b((()=>[C(h(_),{class:w([{disabled:u.isSave}]),onClick:Se},null,8,["class"])])),_:1}),C(U,{class:"icon"},{default:b((()=>[C(h(E),{class:w([{disabled:h(ce).length<3||u.isSave}]),onClick:e=>function(e){ce.value.length<3||ne.isSave||ce.value.splice(e,1)}(l)},null,8,["class","onClick"])])),_:2},1024),1===u.examAnswerRelationType?(x(),k(K,{key:1,type:"primary",class:"margin-left-10",onClick:e=>{return t=l,ue.value=t,void(he.value=!0);var t}},{default:b((()=>[A("span",null,T(e.resultItem?"编辑结果":"添加结果"),1)])),_:2},1032,["onClick"])):S("v-if",!0),2===u.examAnswerRelationType?(x(),k(K,{key:2,type:"primary",class:"margin-left-10",onClick:l=>function(e){re("setRelation",ne.examId,ne.customId,e)}(e)},{default:b((()=>[A("span",null,T(e.answerRelations?.length?`关联了${e.answerRelations?.length}项`:"关联检查"),1)])),_:2},1032,["onClick"])):S("v-if",!0)])))),128))]),"sort"===u.type?(x(),f("div",Y,[d[15]||(d[15]=A("div",{class:"label flex flex-justify-end"},[A("span",null,"排序答案:")],-1)),A("div",Z,[C(y,{modelValue:h(be),"onUpdate:modelValue":d[2]||(d[2]=e=>j(be)?be.value=e:null),mode:"multiple",style:{width:"360px"},placeholder:"请按顺序选择排序答案","show-arrow":!0},{default:b((()=>[S(' :options="[...Array(answers.length)].map((_, i) => ({ value: String.fromCharCode(65 + i) }))" '),(x(!0),f(R,null,q(h(ce),((e,l)=>(x(),k(v,{key:l,label:e.title,value:String.fromCharCode(65+l)},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])])):S("v-if",!0),u.showAnalysis?(x(),f("div",ee,[d[16]||(d[16]=A("div",{class:"label flex flex-justify-center"},[A("span",null,"解析:")],-1)),A("div",le,[C(p,{modelValue:h(ye),"onUpdate:modelValue":d[3]||(d[3]=e=>j(ye)?ye.value=e:null),type:"textarea",rows:2,placeholder:"请输入题目解析"},null,8,["modelValue"])])])):S("v-if",!0),h(fe)?(x(),f("div",te,[d[18]||(d[18]=A("div",{class:"label flex flex-justify-center"},[A("span",null,"富文本:")],-1)),A("div",ae,[C($,I({"model-value":h(xe),"onUpdate:modelValue":d[4]||(d[4]=e=>j(xe)?xe.value=e:null)},h(oe),{style:{width:"100%"}}),null,16,["model-value"]),A("div",ie,[C(K,{type:"danger",onClick:Ae},{default:b((()=>d[17]||(d[17]=[V(" 删除富文本 ")]))),_:1})])])])):S("v-if",!0)])),key:"0"}:void 0]),1032,["show-edit"]),C(we,{modelValue:h(he),"onUpdate:modelValue":d[11]||(d[11]=e=>j(he)?he.value=e:null),title:"添加结果",class:"customize-dialog"},{footer:b((()=>[C(se,{class:"customize-button",type:"primary",plain:"",onClick:Te},{default:b((()=>d[19]||(d[19]=[V(" 取消 ")]))),_:1}),C(se,{class:"customize-button",type:"primary",plain:"",onClick:Re},{default:b((()=>d[20]||(d[20]=[V(" 保存 ")]))),_:1})])),default:b((()=>[(x(),k($,I({key:h(ue),"model-value":h(ce)[h(ue)].resultItem,"onUpdate:modelValue":d[10]||(d[10]=e=>h(ce)[h(ue)].resultItem=e)},h(oe),{style:{width:"100%"}}),null,16,["model-value"]))])),_:1},8,["modelValue"])],2)}}});export{se as default};
2
2
  //# sourceMappingURL=subject-single.vue.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"subject-single.vue.js","sources":["../../../../../../../packages/components/src/subject-list/src/components/subject-single.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { CirclePlus, Remove } from '@element-plus/icons-vue'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport SubjectAction from '../../../subject-action/src/subject-action.vue'\nimport SubjectLayout from '../../../subject-layout/src/subject-layout.vue'\nimport TinyMceEditor from '../../../tiny-mce-editor/src/tiny-mce-editor.vue'\nimport { setGuid } from '@qxs-bns/utils'\n\ndefineOptions({\n name: 'QxsSubjectSingle',\n})\nconst props = defineProps<{\n orderIndex: number\n title?: string\n isSave: boolean\n showAction?: boolean\n type: 'single' | 'multiple' | 'sort'\n isEdit: boolean\n isSet: boolean\n answerList?: any\n leastAnswerCount?: number\n analysis?: string\n examExpand?: string\n examRichTextContent?: string\n showAnalysis?: boolean\n examAnswerRelationType?: number\n customId?: string\n isKey: boolean\n answerCheckType: number\n}>()\nconst emits = defineEmits(['move', 'save', 'delete', 'edit', 'add', 'setRelation'])\n\nconst attrs = useAttrs()\n\nconst answersIndex = ref(0)\nconst isKey = ref(props.isKey)\nconst answerCheckType = ref(2)\nconst answers = ref<{\n title: string\n isCorrect: boolean\n orderIndex?: number\n resultItem?: string\n customAnswerId?: string\n answerRelations?: {\n relationExamId: number\n relationAnswers: {\n relationAnswerId: number\n relationAnswerIndex: number\n }[]\n }[]\n}[]>([{\n title: '',\n isCorrect: false,\n}, {\n title: '',\n isCorrect: false,\n}, {\n title: '',\n isCorrect: false,\n}, {\n title: '',\n isCorrect: false,\n}, {\n title: '',\n isCorrect: false,\n}])\n\nconst leastAnswerCount = ref()\nconst title = ref('')\nconst analysis = ref('')\nconst showRichText = ref(false)\nconst richText = ref('')\nconst startTime = ref(0)\nconst showRichContent = ref(false)\nconst resultItem = ref<string>('')\nconst titlePlaceholder = computed(() => {\n if (props.type === 'single') {\n return '单选题'\n }\n else if (props.type === 'multiple') {\n return '多选题'\n }\n else {\n return '排序题'\n }\n})\n\nconst orderList = ref<string[]>([])\n\nconst leastAnswerOptions = computed(() => {\n const items = []\n const length = answers.value.length\n for (let count = length; count > 1; count--) {\n items.push({\n label: `至少选择${count}项`,\n value: count,\n })\n }\n return items.reverse()\n})\nfunction addAnswer() {\n if (props.isSave) {\n return\n }\n answers.value.push({\n title: '',\n isCorrect: false,\n customAnswerId: setGuid()\n })\n}\n\nfunction deleteAnswer(index: number) {\n if (answers.value.length < 3 || props.isSave) {\n return\n }\n answers.value.splice(index, 1)\n}\n\nfunction setCorrect(it: any, event: any) {\n if (props.type === 'single') {\n // 单选题:确保只有一个正确答案\n if (event) {\n answers.value.forEach((answer) => {\n if (answer !== it) {\n answer.isCorrect = false\n }\n })\n }\n it.isCorrect = event\n } else if (props.type === 'multiple') {\n // 多选题:可以有多个正确答案\n it.isCorrect = event\n }\n}\nfunction setRelation(item: any) {\n emits('setRelation', props.customId, item)\n}\n\nfunction deleteRichText() {\n showRichText.value = false\n richText.value = ''\n}\n\nfunction save() {\n if (!title.value) {\n ElMessage.error('题目标题不能为空!')\n return\n }\n let msg = ''\n let isSetCorrectAnswer = false\n let examAnswerRelationType = null\n let correctAnswerCount = 0\n if (props.type === 'multiple' || props.type === 'single') {\n answers.value.forEach((v: any, i: number) => {\n if (!v.title) {\n msg += `选项${String.fromCharCode(65 + i)}未填写。`\n }\n if (v.isCorrect) {\n isSetCorrectAnswer = true\n correctAnswerCount++\n }\n if (v.resultItem) {\n examAnswerRelationType = 1\n }\n if (v.answerRelations?.length) {\n examAnswerRelationType = 2\n }\n })\n }\n else if (props.type === 'sort') {\n // 如果设置了正确答案\n if (orderList.value.length) {\n isSetCorrectAnswer = true\n }\n }\n if (msg) {\n ElMessage.error(msg)\n return\n }\n\n const uniqueAnswer = new Set(answers.value.map((item: any) => item.title))\n\n if (uniqueAnswer.size !== answers.value.length) {\n ElMessage.error('选项不能重复')\n return\n }\n\n if (props.type === 'multiple') {\n if (correctAnswerCount === 1) {\n ElMessage.error('请至少设置两个正确答案')\n return\n }\n\n if (isSetCorrectAnswer && correctAnswerCount < leastAnswerCount.value) {\n ElMessage.error('至少选几项与正确答案数不符')\n return\n }\n }\n\n emits('save', {\n title: title.value,\n answers: answers.value.map((item: any, index: number) => {\n return { ...item, orderIndex: index + 1 }\n }),\n examExpand: orderList.value.map((i: string) => i.charCodeAt(0) - 65 + 1).join(','),\n analysis: analysis.value,\n isSetCorrectAnswer,\n leastAnswerCount: leastAnswerCount.value,\n examRichTextContent: showRichText.value ? richText.value : '',\n examAnswerRelationType,\n isKey: isKey.value,\n answerCheckType: answerCheckType.value\n })\n}\n\nfunction init() {\n if (props.title) {\n title.value = props.title\n }\n // const customId = props.id || setGuid()\n\n if (props.answerCheckType) {\n answerCheckType.value = props.answerCheckType\n }\n\n if (props.answerList && props.answerList.length) {\n answers.value = props.answerList.map((item: any) => {\n return { ...item, customAnswerId: item.examAnswerId || setGuid() }\n })\n }\n\n if (props.leastAnswerCount) {\n leastAnswerCount.value = props.leastAnswerCount\n }\n\n if (props.examExpand) {\n // 设置正确答案 props.examExpand里是答案id\n if (props.examExpand) {\n const correctAnswerIdList = props.examExpand.split(',')\n\n // 遍历 correctAnswerIdList,直接在 props.answerList 中查找对应的 orderIndex 并转换成字母\n orderList.value = correctAnswerIdList.map((id: string) => {\n const answer = props.answerList.find((item: any) => item.answerId?.toString() === id)\n return answer ? String.fromCharCode(65 + answer.orderIndex - 1) : id\n }).filter(Boolean) // 过滤掉任何可能的空字符串\n }\n }\n\n if (props.analysis) {\n analysis.value = props.analysis\n }\n\n if (props.examRichTextContent) {\n richText.value = props.examRichTextContent\n showRichText.value = true\n }\n}\n\nfunction onCloseResult() {\n showRichContent.value = false\n resultItem.value = ''\n}\n\nfunction onOpenResult(i: number) {\n answersIndex.value = i\n // console.log(answers.value[i].resultItem, 1);\n // resultItem.value = answers.value[i].resultItem || ''\n showRichContent.value = true\n}\n\nfunction onSaveResult() {\n // answers.value[answersIndex.value].resultItem = resultItem.value || ''\n showRichContent.value = false\n}\n\nfunction setKey(key: boolean) {\n isKey.value = key\n}\n\nfunction setAnswerSetting(type: number) {\n answerCheckType.value = type\n}\n\nfunction add(type: string, canSet: boolean) {\n emits('add', type, canSet? props.examAnswerRelationType: null)\n}\n// 监听isEdit\nwatch(() => props.isEdit, () => {\n if (props.isEdit) {\n startTime.value = new Date().getTime()\n }\n})\nconst ns = useNamespace('subject-single')\n\nonMounted(init)\n</script>\n\n<template>\n <div :class=\"ns.e('single-exam')\">\n <SubjectLayout\n :show-edit=\"isEdit\"\n >\n <template #preview>\n <div class=\"preview\">\n <div>\n <span class=\"title\">\n {{ orderIndex + 1 }}.{{ title }}\n <span v-if=\"type === 'single'\">(单选题)</span>\n <span v-else-if=\"['multiple', 'sort'].includes(type)\">\n ({{ titlePlaceholder }}{{ leastAnswerCount ? `至少选${leastAnswerCount}项${type === 'sort' ? '并排序' : ''}` : '' }})\n </span>\n </span>\n </div>\n <div v-if=\"showRichText\">\n <div v-html=\"richText\" />\n </div>\n <div class=\"preview-answer\">\n <template v-if=\"type === 'sort'\">\n <el-checkbox\n v-for=\"(item, index) in answers\"\n :key=\"index\"\n class=\"radio\"\n :disabled=\"true\"\n >\n <span class=\"order\">\n {{ String.fromCharCode(65 + index) }}.\n </span>\n {{ item.title }}\n </el-checkbox>\n </template>\n <template v-else>\n <el-radio\n v-for=\"(item, index) in answers\"\n :key=\"index\"\n class=\"radio\"\n value=\"disabled\"\n disabled\n >\n <span class=\"order\">\n {{ String.fromCharCode(65 + index) }}.\n </span>\n {{ item.title }} \n {{ item.isCorrect ? '(支持选项)' : '' }} \n {{ item.resultItem? '(已设置结果项)' : '(未设置结果项)' }} \n {{ item.answerRelations?.length ? '(已设置关联)' : '(未设置关联)' }}\n </el-radio>\n </template>\n </div>\n </div>\n </template>\n <template v-if=\"isEdit\" #edit>\n <div class=\"flex\" :class=\"[{ 'margin-bottom': showRichText }]\">\n <div class=\"label flex flex-justify-center\">\n <span>题目:</span>\n </div>\n <div style=\"flex: 1;\">\n <el-input\n v-model=\"title\"\n type=\"textarea\"\n :rows=\"2\"\n :placeholder=\"`【${titlePlaceholder}】请输入问题`\"\n :disabled=\"isSave\"\n show-word-limit\n maxlength=\"200\"\n class=\"margin-bottom\"\n />\n </div>\n </div>\n <div class=\"margin-bottom flex flex-items-center\">\n <div class=\"label flex flex-justify-center\">\n <span>设置:</span>\n </div>\n <el-select\n v-if=\"['multiple', 'sort'].includes(type)\"\n v-model=\"leastAnswerCount\"\n style=\"width: 150px;\"\n placeholder=\"至少选择几项\"\n :disabled=\"isSave\"\n >\n <el-option\n v-for=\"item in leastAnswerOptions\"\n :key=\"item.value\"\n :value=\"item.value\"\n :label=\"item.label\"\n >\n </el-option>\n </el-select>\n </div>\n <div class=\"margin-bottom answer-list\">\n <div\n v-for=\"(item, index) in answers\"\n :key=\"index\"\n class=\"answer-item flex flex-items-center\"\n >\n <span class=\"order\">{{ String.fromCharCode(65 + index) }}.</span>\n <el-input\n v-model=\"item.title\"\n class=\"input\"\n show-word-limit\n maxlength=\"100\"\n :placeholder=\"`选项${String.fromCharCode(65 + index)}`\"\n :disabled=\"isSave\"\n />\n <el-checkbox\n v-if=\"['single', 'multiple'].includes(type)\"\n v-model=\"item.isCorrect\"\n :class=\"[{ 'is-correct': item.isCorrect }]\"\n :disabled=\"isSave\"\n style=\"margin-left: 10px;\"\n @change=\"(event) => setCorrect(item, event)\"\n >\n 支持选项 \n </el-checkbox>\n <el-icon class=\"icon\">\n <CirclePlus\n :class=\"[{ disabled: isSave }]\"\n @click=\"addAnswer\"\n />\n </el-icon>\n <el-icon class=\"icon\">\n <Remove\n :class=\"[{ disabled: answers.length < 3 || isSave }]\"\n @click=\"deleteAnswer(index)\"\n />\n </el-icon>\n <el-link\n v-if=\"examAnswerRelationType === 1\"\n type=\"primary\"\n class=\"margin-left-10\"\n @click=\"onOpenResult(index)\"\n >\n <span>{{ item.resultItem ? '编辑结果' : '添加结果' }}</span>\n </el-link>\n <el-link\n v-if=\"examAnswerRelationType === 2\"\n type=\"primary\"\n class=\"margin-left-10\"\n @click=\"setRelation(item)\"\n >\n <span>{{ item.answerRelations?.length ? `关联了${item.answerRelations?.length}项` : '关联检查' }}</span>\n </el-link>\n </div>\n </div>\n <div v-if=\"type === 'sort'\" class=\"margin-bottom flex flex-items-center\">\n <div class=\"label flex flex-justify-end\">\n <span>排序答案:</span>\n </div>\n <div style=\"flex: 1;\">\n <el-select\n v-model=\"orderList\"\n mode=\"multiple\"\n style=\"width: 360px;\"\n placeholder=\"请按顺序选择排序答案\"\n :show-arrow=\"true\"\n >\n <!-- :options=\"[...Array(answers.length)].map((_, i) => ({ value: String.fromCharCode(65 + i) }))\" -->\n <el-option\n v-for=\"(item, index) in answers\"\n :key=\"index\"\n :label=\"item.title\"\n :value=\"String.fromCharCode(65 + index)\"\n />\n </el-select>\n </div>\n </div>\n <div\n v-if=\"showAnalysis\"\n class=\"flex\"\n >\n <div class=\"label flex flex-justify-center\">\n <span>解析:</span>\n </div>\n <div style=\"flex: 1;\">\n <el-input\n v-model=\"analysis\"\n type=\"textarea\"\n :rows=\"2\"\n placeholder=\"请输入题目解析\"\n />\n </div>\n </div>\n <div v-if=\"showRichText\" class=\"margin-bottom flex\">\n <div class=\"label flex flex-justify-center\">\n <span>富文本:</span>\n </div>\n <div style=\"flex: 1;\">\n <TinyMceEditor v-model:model-value=\"richText\" v-bind=\"attrs\" style=\"width: 100%;\" />\n <div class=\"flex flex-justify-end\">\n <el-link\n type=\"danger\"\n @click=\"deleteRichText\"\n >\n 删除富文本\n </el-link>\n </div>\n </div>\n </div>\n </template>\n <SubjectAction\n v-if=\"showAction\"\n :is-edit=\"isEdit\"\n :is-set=\"isSet\"\n :isKey=\"isKey\"\n :examAnswerRelationType=\"props.examAnswerRelationType\"\n :answerCheckType=\"answerCheckType\"\n @move-up=\"emits('move', 'up')\"\n @move-down=\"emits('move', 'down')\"\n @delete=\"emits('delete')\"\n @save=\"save\"\n @edit=\"emits('edit')\"\n @add=\"add\"\n @onShowRichText=\"showRichText = true\"\n @setKey=\"setKey\"\n @setAnswerSetting=\"setAnswerSetting\"\n />\n </SubjectLayout>\n <el-dialog\n v-model=\"showRichContent\"\n title=\"添加结果\"\n class=\"customize-dialog\"\n >\n <TinyMceEditor\n :key=\"answersIndex\"\n v-model:model-value=\"(answers[answersIndex].resultItem as string)\" \n v-bind=\"attrs\"\n style=\"width: 100%;\" />\n <template #footer>\n <el-button\n class=\"customize-button\"\n type=\"primary\"\n plain\n @click=\"onCloseResult\"\n >\n 取消\n </el-button>\n <el-button\n class=\"customize-button\"\n type=\"primary\"\n plain\n @click=\"onSaveResult\"\n >\n 保存\n </el-button>\n </template>\n </el-dialog>\n </div>\n</template>\n"],"names":["props","__props","emits","__emit","attrs","useAttrs","answersIndex","ref","isKey","answerCheckType","answers","title","isCorrect","leastAnswerCount","analysis","showRichText","richText","startTime","showRichContent","resultItem","titlePlaceholder","computed","type","orderList","leastAnswerOptions","items","count","value","length","push","label","reverse","addAnswer","isSave","customAnswerId","setGuid","deleteRichText","save","ElMessage","error","msg","isSetCorrectAnswer","examAnswerRelationType","correctAnswerCount","forEach","v","i","String","fromCharCode","answerRelations","Set","map","item","size","index","orderIndex","examExpand","charCodeAt","join","examRichTextContent","onCloseResult","onSaveResult","setKey","key","setAnswerSetting","add","canSet","watch","isEdit","Date","getTime","ns","useNamespace","onMounted","answerList","examAnswerId","correctAnswerIdList","split","id","answer","find","answerId","toString","filter","Boolean","it","event","splice","customId"],"mappings":"0nEAWA,MAAMA,GAAQC,EAmBRC,GAAQC,GAERC,GAAQC,IAERC,GAAeC,EAAI,GACnBC,GAAQD,EAAIP,GAAMQ,OAClBC,GAAkBF,EAAI,GACtBG,GAAUH,EAaX,CAAC,CACJI,MAAO,GACPC,WAAW,GACV,CACDD,MAAO,GACPC,WAAW,GACV,CACDD,MAAO,GACPC,WAAW,GACV,CACDD,MAAO,GACPC,WAAW,GACV,CACDD,MAAO,GACPC,WAAW,KAGPC,GAAmBN,IACnBI,GAAQJ,EAAI,IACZO,GAAWP,EAAI,IACfQ,GAAeR,GAAI,GACnBS,GAAWT,EAAI,IACfU,GAAYV,EAAI,GAChBW,GAAkBX,GAAI,GACtBY,GAAaZ,EAAY,IACzBa,GAAmBC,GAAS,IACb,WAAfrB,GAAMsB,KACD,MAEe,aAAftB,GAAMsB,KACN,MAGA,QAILC,GAAYhB,EAAc,IAE1BiB,GAAqBH,GAAS,KAClC,MAAMI,EAAQ,GAEd,IAAA,IAASC,EADMhB,GAAQiB,MAAMC,OACJF,EAAQ,EAAGA,IAClCD,EAAMI,KAAK,CACTC,MAAO,OAAOJ,KACdC,MAAOD,IAGX,OAAOD,EAAMM,SAAQ,IAEvB,SAASC,KACHhC,GAAMiC,QAGVvB,GAAQiB,MAAME,KAAK,CACjBlB,MAAO,GACPC,WAAW,EACXsB,eAAgBC,KACjB,CA8BH,SAASC,KACPrB,GAAaY,OAAQ,EACrBX,GAASW,MAAQ,EAAA,CAGnB,SAASU,KACH,IAAC1B,GAAMgB,MA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AMsB,OAEf+D,EAAGzE,UAAY0E,EACjB,gXArBF,SAAsBhC,GAChB5C,GAAQiB,MAAMC,OAAS,GAAK5B,GAAMiC,QAG9BvB,GAAAiB,MAAM4D,OAAOjC,EAAO,EAAC,sJAoJTR,IACpBxC,GAAaqB,MAAQmB,OAGrB5B,GAAgBS,OAAQ,GAJ1B,IAAsBmB,0MAjItB,SAAqBM,GACblD,GAAA,cAAeF,GAAMwF,SAAUpC,EAAI"}
1
+ {"version":3,"file":"subject-single.vue.js","sources":["../../../../../../../packages/components/src/subject-list/src/components/subject-single.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { CirclePlus, Remove } from '@element-plus/icons-vue'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport SubjectAction from '../../../subject-action/src/subject-action.vue'\nimport SubjectLayout from '../../../subject-layout/src/subject-layout.vue'\nimport TinyMceEditor from '../../../tiny-mce-editor/src/tiny-mce-editor.vue'\nimport { setGuid } from '@qxs-bns/utils'\n\ndefineOptions({\n name: 'QxsSubjectSingle',\n})\nconst props = defineProps<{\n orderIndex: number\n title?: string\n isSave: boolean\n showAction?: boolean\n type: 'single' | 'multiple' | 'sort'\n isEdit: boolean\n isSet: boolean\n answerList?: any\n leastAnswerCount?: number\n analysis?: string\n examExpand?: string\n examRichTextContent?: string\n showAnalysis?: boolean\n examAnswerRelationType?: number\n customId?: number\n examId?: number\n isKey: boolean\n answerCheckType: number\n}>()\nconst emits = defineEmits(['move', 'save', 'delete', 'edit', 'add', 'setRelation'])\n\nconst attrs = useAttrs()\n\nconst answersIndex = ref(0)\nconst isKey = ref(props.isKey)\nconst answerCheckType = ref(2)\nconst answers = ref<{\n title: string\n isCorrect: boolean\n orderIndex?: number\n resultItem?: string\n customAnswerId?: string\n answerRelations?: {\n relationExamId: number\n relationAnswers: {\n relationAnswerId: number\n relationAnswerIndex: number\n }[]\n }[]\n}[]>([{\n title: '',\n isCorrect: false,\n}, {\n title: '',\n isCorrect: false,\n}, {\n title: '',\n isCorrect: false,\n}, {\n title: '',\n isCorrect: false,\n}, {\n title: '',\n isCorrect: false,\n}])\n\nconst leastAnswerCount = ref()\nconst title = ref('')\nconst analysis = ref('')\nconst showRichText = ref(false)\nconst richText = ref('')\nconst startTime = ref(0)\nconst showRichContent = ref(false)\nconst resultItem = ref<string>('')\nconst titlePlaceholder = computed(() => {\n if (props.type === 'single') {\n return '单选题'\n }\n else if (props.type === 'multiple') {\n return '多选题'\n }\n else {\n return '排序题'\n }\n})\n\nconst orderList = ref<string[]>([])\n\nconst leastAnswerOptions = computed(() => {\n const items = []\n const length = answers.value.length\n for (let count = length; count > 1; count--) {\n items.push({\n label: `至少选择${count}项`,\n value: count,\n })\n }\n return items.reverse()\n})\nfunction addAnswer() {\n if (props.isSave) {\n return\n }\n answers.value.push({\n title: '',\n isCorrect: false,\n customAnswerId: setGuid()\n })\n}\n\nfunction deleteAnswer(index: number) {\n if (answers.value.length < 3 || props.isSave) {\n return\n }\n answers.value.splice(index, 1)\n}\n\nfunction setCorrect(it: any, event: any) {\n if (props.type === 'single') {\n // 单选题:确保只有一个正确答案\n if (event) {\n answers.value.forEach((answer) => {\n if (answer !== it) {\n answer.isCorrect = false\n }\n })\n }\n it.isCorrect = event\n } else if (props.type === 'multiple') {\n // 多选题:可以有多个正确答案\n it.isCorrect = event\n }\n}\nfunction setRelation(item: any) {\n emits('setRelation', props.examId, props.customId, item)\n}\n\nfunction deleteRichText() {\n showRichText.value = false\n richText.value = ''\n}\n\nfunction save() {\n if (!title.value) {\n ElMessage.error('题目标题不能为空!')\n return\n }\n let msg = ''\n let isSetCorrectAnswer = false\n let examAnswerRelationType = null\n let correctAnswerCount = 0\n if (props.type === 'multiple' || props.type === 'single') {\n answers.value.forEach((v: any, i: number) => {\n if (!v.title) {\n msg += `选项${String.fromCharCode(65 + i)}未填写。`\n }\n if (v.isCorrect) {\n isSetCorrectAnswer = true\n correctAnswerCount++\n }\n if (v.resultItem) {\n examAnswerRelationType = 1\n }\n if (v.answerRelations?.length) {\n examAnswerRelationType = 2\n }\n })\n }\n else if (props.type === 'sort') {\n // 如果设置了正确答案\n if (orderList.value.length) {\n isSetCorrectAnswer = true\n }\n }\n if (msg) {\n ElMessage.error(msg)\n return\n }\n\n const uniqueAnswer = new Set(answers.value.map((item: any) => item.title))\n\n if (uniqueAnswer.size !== answers.value.length) {\n ElMessage.error('选项不能重复')\n return\n }\n\n if (props.type === 'multiple') {\n if (correctAnswerCount === 1) {\n ElMessage.error('请至少设置两个正确答案')\n return\n }\n\n if (isSetCorrectAnswer && correctAnswerCount < leastAnswerCount.value) {\n ElMessage.error('至少选几项与正确答案数不符')\n return\n }\n }\n\n emits('save', {\n title: title.value,\n answers: answers.value.map((item: any, index: number) => {\n return { ...item, orderIndex: index + 1 }\n }),\n examExpand: orderList.value.map((i: string) => i.charCodeAt(0) - 65 + 1).join(','),\n analysis: analysis.value,\n isSetCorrectAnswer,\n leastAnswerCount: leastAnswerCount.value,\n examRichTextContent: showRichText.value ? richText.value : '',\n examAnswerRelationType,\n isKey: isKey.value,\n answerCheckType: answerCheckType.value\n })\n}\n\nfunction init() {\n if (props.title) {\n title.value = props.title\n }\n // const customId = props.id || setGuid()\n\n if (props.answerCheckType) {\n answerCheckType.value = props.answerCheckType\n }\n\n if (props.answerList && props.answerList.length) {\n answers.value = props.answerList.map((item: any) => {\n return { ...item, customAnswerId: item.examAnswerId || setGuid() }\n })\n }\n\n if (props.leastAnswerCount) {\n leastAnswerCount.value = props.leastAnswerCount\n }\n\n if (props.examExpand) {\n // 设置正确答案 props.examExpand里是答案id\n if (props.examExpand) {\n const correctAnswerIdList = props.examExpand.split(',')\n\n // 遍历 correctAnswerIdList,直接在 props.answerList 中查找对应的 orderIndex 并转换成字母\n orderList.value = correctAnswerIdList.map((id: string) => {\n const answer = props.answerList.find((item: any) => item.answerId?.toString() === id)\n return answer ? String.fromCharCode(65 + answer.orderIndex - 1) : id\n }).filter(Boolean) // 过滤掉任何可能的空字符串\n }\n }\n\n if (props.analysis) {\n analysis.value = props.analysis\n }\n\n if (props.examRichTextContent) {\n richText.value = props.examRichTextContent\n showRichText.value = true\n }\n}\n\nfunction onCloseResult() {\n showRichContent.value = false\n resultItem.value = ''\n}\n\nfunction onOpenResult(i: number) {\n answersIndex.value = i\n // console.log(answers.value[i].resultItem, 1);\n // resultItem.value = answers.value[i].resultItem || ''\n showRichContent.value = true\n}\n\nfunction onSaveResult() {\n // answers.value[answersIndex.value].resultItem = resultItem.value || ''\n showRichContent.value = false\n}\n\nfunction setKey(key: boolean) {\n isKey.value = key\n}\n\nfunction setAnswerSetting(type: number) {\n answerCheckType.value = type\n}\n\nfunction add(type: string, canSet: boolean) {\n emits('add', type, canSet? props.examAnswerRelationType: null)\n}\n// 监听isEdit\nwatch(() => props.isEdit, () => {\n if (props.isEdit) {\n startTime.value = new Date().getTime()\n }\n})\nconst ns = useNamespace('subject-single')\n\nonMounted(init)\n</script>\n\n<template>\n <div :class=\"ns.e('single-exam')\">\n <SubjectLayout\n :show-edit=\"isEdit\"\n >\n <template #preview>\n <div class=\"preview\">\n <div>\n <span class=\"title\">\n {{ orderIndex + 1 }}.{{ title }}\n <span v-if=\"type === 'single'\">(单选题)</span>\n <span v-else-if=\"['multiple', 'sort'].includes(type)\">\n ({{ titlePlaceholder }}{{ leastAnswerCount ? `至少选${leastAnswerCount}项${type === 'sort' ? '并排序' : ''}` : '' }})\n </span>\n </span>\n </div>\n <div v-if=\"showRichText\">\n <div v-html=\"richText\" />\n </div>\n <div class=\"preview-answer\">\n <template v-if=\"type === 'sort'\">\n <el-checkbox\n v-for=\"(item, index) in answers\"\n :key=\"index\"\n class=\"radio\"\n :disabled=\"true\"\n >\n <span class=\"order\">\n {{ String.fromCharCode(65 + index) }}.\n </span>\n {{ item.title }}\n </el-checkbox>\n </template>\n <template v-else>\n <el-radio\n v-for=\"(item, index) in answers\"\n :key=\"index\"\n class=\"radio\"\n value=\"disabled\"\n disabled\n >\n <span class=\"order\">\n {{ String.fromCharCode(65 + index) }}.\n </span>\n {{ item.title }} \n {{ item.isCorrect ? '(支持选项)' : '' }} \n {{ item.resultItem && examAnswerRelationType === 1? '(已设置结果项)' : '(未设置结果项)' }} \n {{ item.answerRelations?.length && examAnswerRelationType === 2 ? '(已设置关联)' : '(未设置关联)' }}\n </el-radio>\n </template>\n </div>\n </div>\n </template>\n <template v-if=\"isEdit\" #edit>\n <div class=\"flex\" :class=\"[{ 'margin-bottom': showRichText }]\">\n <div class=\"label flex flex-justify-center\">\n <span>题目:</span>\n </div>\n <div style=\"flex: 1;\">\n <el-input\n v-model=\"title\"\n type=\"textarea\"\n :rows=\"2\"\n :placeholder=\"`【${titlePlaceholder}】请输入问题`\"\n :disabled=\"isSave\"\n show-word-limit\n maxlength=\"200\"\n class=\"margin-bottom\"\n />\n </div>\n </div>\n <div class=\"margin-bottom flex flex-items-center\">\n <div class=\"label flex flex-justify-center\">\n <span>设置:</span>\n </div>\n <el-select\n v-if=\"['multiple', 'sort'].includes(type)\"\n v-model=\"leastAnswerCount\"\n style=\"width: 150px;\"\n placeholder=\"至少选择几项\"\n :disabled=\"isSave\"\n >\n <el-option\n v-for=\"item in leastAnswerOptions\"\n :key=\"item.value\"\n :value=\"item.value\"\n :label=\"item.label\"\n >\n </el-option>\n </el-select>\n </div>\n <div class=\"margin-bottom answer-list\">\n <div\n v-for=\"(item, index) in answers\"\n :key=\"index\"\n class=\"answer-item flex flex-items-center\"\n >\n <span class=\"order\">{{ String.fromCharCode(65 + index) }}.</span>\n <el-input\n v-model=\"item.title\"\n class=\"input\"\n show-word-limit\n maxlength=\"100\"\n :placeholder=\"`选项${String.fromCharCode(65 + index)}`\"\n :disabled=\"isSave\"\n />\n <el-checkbox\n v-if=\"['single', 'multiple'].includes(type)\"\n v-model=\"item.isCorrect\"\n :class=\"[{ 'is-correct': item.isCorrect }]\"\n :disabled=\"isSave\"\n style=\"margin-left: 10px;\"\n @change=\"(event: any) => setCorrect(item, event)\"\n >\n 支持选项 \n </el-checkbox>\n <el-icon class=\"icon\">\n <CirclePlus\n :class=\"[{ disabled: isSave }]\"\n @click=\"addAnswer\"\n />\n </el-icon>\n <el-icon class=\"icon\">\n <Remove\n :class=\"[{ disabled: answers.length < 3 || isSave }]\"\n @click=\"deleteAnswer(index)\"\n />\n </el-icon>\n <el-link\n v-if=\"examAnswerRelationType === 1\"\n type=\"primary\"\n class=\"margin-left-10\"\n @click=\"onOpenResult(index)\"\n >\n <span>{{ item.resultItem ? '编辑结果' : '添加结果' }}</span>\n </el-link>\n <el-link\n v-if=\"examAnswerRelationType === 2\"\n type=\"primary\"\n class=\"margin-left-10\"\n @click=\"setRelation(item)\"\n >\n <span>{{ item.answerRelations?.length ? `关联了${item.answerRelations?.length}项` : '关联检查' }}</span>\n </el-link>\n </div>\n </div>\n <div v-if=\"type === 'sort'\" class=\"margin-bottom flex flex-items-center\">\n <div class=\"label flex flex-justify-end\">\n <span>排序答案:</span>\n </div>\n <div style=\"flex: 1;\">\n <el-select\n v-model=\"orderList\"\n mode=\"multiple\"\n style=\"width: 360px;\"\n placeholder=\"请按顺序选择排序答案\"\n :show-arrow=\"true\"\n >\n <!-- :options=\"[...Array(answers.length)].map((_, i) => ({ value: String.fromCharCode(65 + i) }))\" -->\n <el-option\n v-for=\"(item, index) in answers\"\n :key=\"index\"\n :label=\"item.title\"\n :value=\"String.fromCharCode(65 + index)\"\n />\n </el-select>\n </div>\n </div>\n <div\n v-if=\"showAnalysis\"\n class=\"flex\"\n >\n <div class=\"label flex flex-justify-center\">\n <span>解析:</span>\n </div>\n <div style=\"flex: 1;\">\n <el-input\n v-model=\"analysis\"\n type=\"textarea\"\n :rows=\"2\"\n placeholder=\"请输入题目解析\"\n />\n </div>\n </div>\n <div v-if=\"showRichText\" class=\"margin-bottom flex\">\n <div class=\"label flex flex-justify-center\">\n <span>富文本:</span>\n </div>\n <div style=\"flex: 1;\">\n <TinyMceEditor v-model:model-value=\"richText\" v-bind=\"attrs\" style=\"width: 100%;\" />\n <div class=\"flex flex-justify-end\">\n <el-link\n type=\"danger\"\n @click=\"deleteRichText\"\n >\n 删除富文本\n </el-link>\n </div>\n </div>\n </div>\n </template>\n <SubjectAction\n v-if=\"showAction\"\n :is-edit=\"isEdit\"\n :is-set=\"isSet\"\n :isKey=\"isKey\"\n :examAnswerRelationType=\"props.examAnswerRelationType\"\n :answerCheckType=\"answerCheckType\"\n @move-up=\"emits('move', 'up')\"\n @move-down=\"emits('move', 'down')\"\n @delete=\"emits('delete')\"\n @save=\"save\"\n @edit=\"emits('edit')\"\n @add=\"add\"\n @onShowRichText=\"showRichText = true\"\n @setKey=\"setKey\"\n @setAnswerSetting=\"setAnswerSetting\"\n />\n </SubjectLayout>\n <el-dialog\n v-model=\"showRichContent\"\n title=\"添加结果\"\n class=\"customize-dialog\"\n >\n <TinyMceEditor\n :key=\"answersIndex\"\n v-model:model-value=\"(answers[answersIndex].resultItem as string)\" \n v-bind=\"attrs\"\n style=\"width: 100%;\" />\n <template #footer>\n <el-button\n class=\"customize-button\"\n type=\"primary\"\n plain\n @click=\"onCloseResult\"\n >\n 取消\n </el-button>\n <el-button\n class=\"customize-button\"\n type=\"primary\"\n plain\n @click=\"onSaveResult\"\n >\n 保存\n </el-button>\n </template>\n </el-dialog>\n </div>\n</template>\n"],"names":["props","__props","emits","__emit","attrs","useAttrs","answersIndex","ref","isKey","answerCheckType","answers","title","isCorrect","leastAnswerCount","analysis","showRichText","richText","startTime","showRichContent","resultItem","titlePlaceholder","computed","type","orderList","leastAnswerOptions","items","count","value","length","push","label","reverse","addAnswer","isSave","customAnswerId","setGuid","deleteRichText","save","ElMessage","error","msg","isSetCorrectAnswer","examAnswerRelationType","correctAnswerCount","forEach","v","i","String","fromCharCode","answerRelations","Set","map","item","size","index","orderIndex","examExpand","charCodeAt","join","examRichTextContent","onCloseResult","onSaveResult","setKey","key","setAnswerSetting","add","canSet","watch","isEdit","Date","getTime","ns","useNamespace","onMounted","answerList","examAnswerId","correctAnswerIdList","split","id","answer","find","answerId","toString","filter","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eF,GAAMwF,OAAQxF,GAAMyF,SAAUrC,EAAI"}
@@ -1,2 +1,2 @@
1
- import{defineComponent as e,ref as t,useAttrs as s,watch as n,createElementBlock as i,openBlock as a,normalizeClass as o,unref as l,createElementVNode as r,Fragment as d,renderList as c,createBlock as x,createCommentVNode as m,mergeProps as u}from"vue";import p from"./components/subject-blank-fill.vue.js";import w from"./components/subject-scale.vue.js";import v from"./components/subject-single.vue.js";import y from"./components/subject-text-fill.vue.js";import h from"./components/SubjectRichText.vue.js";import T from"./components/SubjectPageEnd.vue.js";import{useNamespace as f}from"@qxs-bns/hooks";import{setGuid as A}from"@qxs-bns/utils";import{ElMessage as R}from"element-plus/es";const E={class:"subject-list-wrapper"};var S=e({name:"QxsSubjectList",__name:"subject-list",props:{subjectList:{type:Array,required:!0},isPreview:{type:Boolean,required:!0}},emits:["setRelation"],setup(e,{expose:S,emit:C}){const g=e,D=t([]),j=C,b=s();function _(){let e=0,t=!1;return D.value.map(((s,n,i)=>{"page_end"===s.answerType&&(e++,t=n===i.length-1)})),t?e:e+1}function k(e,t,s){console.log(t,"index"),t||0===t?D.value.splice(t+1,0,{customId:A(),answerType:e,analysis:"",scaleQuestionList:[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1,examAnswerRelationType:s}):D.value.push({customId:A(),answerType:e,analysis:"",scaleQuestionList:[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1,examAnswerRelationType:s})}function I(e,t){if("up"===t&&e>0){const[t]=D.value.splice(e,1);D.value.splice(e-1,0,t)}else if("down"===t&&e<D.value.length-1){const[t]=D.value.splice(e,1);D.value.splice(e+1,0,t)}}function M(e,t){for(let s=0;s<D.value.length;s++)e===s&&(D.value[e]={...D.value[e],...t,isEdit:!1})}function L(e){D.value.splice(e,1),R.success("删除成功")}function P(e,t){j("setRelation",e,t)}S({addSubject:k,currentList:D,uploadExcel:function(e){D.value=D.value.concat(e)},addExam:function(e){const t=[];e.answers?.map((e=>{t.push({...e,title:e.answer,answerId:e.examAnswerId,isCorrect:e.isCorrect})})),D.value.push({...e,customId:e.examId||A(),answerType:e.richTextContent?"rich_text":e.examTypeEnum,answers:t,isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1})},setAnswerRelation:function(e,t,s){e.length&&D.value.forEach((n=>{n.customId===t&&n.answer.forEach((t=>{t.customAnswerId===s&&(t.answerRelations=e)}))}))}}),n((()=>g.subjectList),(e=>{e&&(D.value=[...e])}),{immediate:!0});const q=f("subject-list");return(e,t)=>(a(),i("div",{class:o(l(q).e("list-exam"))},[r("div",E,[(a(!0),i(d,null,c(l(D),((t,s)=>(a(),i("div",{key:s+t.examId||t.title},[["single","multiple","sort"].includes(t.answerType)?(a(),x(v,u({key:0,ref_for:!0},l(b),{"order-index":s,title:t.title,type:t.answerType,isKey:t.isKey,"is-save":!t.isRealCanDel,customId:t.customId,"is-set":t.hasSet||!1,"answer-list":t.answers,analysis:t.analysis,"least-answer-count":t.leastAnswerCount,"is-edit":t.isEdit||!1,"show-action":!e.isPreview,"exam-expand":t.examExpand,answerCheckType:t.answerCheckType,"exam-rich-text-content":t.examRichTextContent,examAnswerRelationType:t.examAnswerRelationType,onSetRelation:P,onMove:e=>I(s,e),onDelete:e=>L(s),onSave:e=>M(s,e),onEdit:e=>t.isEdit=!0,onAdd:(e,t)=>k(e,s,t)}),null,16,["order-index","title","type","isKey","is-save","customId","is-set","answer-list","analysis","least-answer-count","is-edit","show-action","exam-expand","answerCheckType","exam-rich-text-content","examAnswerRelationType","onMove","onDelete","onSave","onEdit","onAdd"])):"scale"===t.answerType?(a(),x(w,u({key:1,ref_for:!0},l(b),{"order-index":s,title:t.title,"is-save":!t.isRealCanDel,"is-set":t.hasSet||!1,"answer-list":t.answers,analysis:t.analysis,"is-edit":t.isEdit||!1,"scale-question-list":t.scaleQuestionList,"show-action":!e.isPreview,"exam-rich-text-content":t.examRichTextContent,examAnswerRelationType:t.examAnswerRelationType,onMove:e=>I(s,e),onDelete:e=>L(s),onSave:e=>M(s,e),onEdit:e=>t.isEdit=!0,onAdd:e=>k(e,s,null)}),null,16,["order-index","title","is-save","is-set","answer-list","analysis","is-edit","scale-question-list","show-action","exam-rich-text-content","examAnswerRelationType","onMove","onDelete","onSave","onEdit","onAdd"])):"blank_fill"===t.answerType?(a(),x(p,u({key:2,ref_for:!0},l(b),{"order-index":s,title:t.title,"is-save":!t.isRealCanDel,"is-set":t.hasSet||!1,"answer-list":t.answers,analysis:t.analysis,"show-action":!e.isPreview,"is-edit":t.isEdit||!1,"exam-answer-setting-v-o":t.examAnswerSettingVO||{},"exam-rich-text-content":t.examRichTextContent,examAnswerRelationType:t.examAnswerRelationType,onMove:e=>I(s,e),onDelete:e=>L(s),onSave:e=>M(s,e),onEdit:e=>t.isEdit=!0,onAdd:e=>k(e,s,null)}),null,16,["order-index","title","is-save","is-set","answer-list","analysis","show-action","is-edit","exam-answer-setting-v-o","exam-rich-text-content","examAnswerRelationType","onMove","onDelete","onSave","onEdit","onAdd"])):"text_fill"===t.answerType?(a(),x(y,u({key:3,ref_for:!0},l(b),{"order-index":s,title:t.title,"is-save":!t.isRealCanDel,"is-set":t.hasSet||!1,"answer-list":t.answers,analysis:t.analysis,"show-action":!e.isPreview,"is-edit":t.isEdit||!1,"exam-expand":t.examExpand,"exam-answer-setting-v-o":t.examAnswerSettingVO||{},examAnswerRelationType:t.examAnswerRelationType,"exam-rich-text-content":t.examRichTextContent,onMove:e=>I(s,e),onDelete:e=>L(s),onSave:e=>M(s,e),onEdit:e=>t.isEdit=!0,onAdd:e=>k(e,s,null)}),null,16,["order-index","title","is-save","is-set","answer-list","analysis","show-action","is-edit","exam-expand","exam-answer-setting-v-o","examAnswerRelationType","exam-rich-text-content","onMove","onDelete","onSave","onEdit","onAdd"])):"rich_text"===t.answerType?(a(),x(h,u({key:4,ref_for:!0},l(b),{"order-index":s,richTextContent:t.richTextContent,"is-set":t.hasSet||!1,"is-save":!t.isRealCanDel,"is-edit":t.isEdit||!1,"show-action":!e.isPreview,onMove:e=>I(s,e),onDelete:e=>L(s),examAnswerRelationType:t.examAnswerRelationType,onSave:e=>M(s,e),onEdit:e=>t.isEdit=!0,onAdd:e=>k(e,s,null)}),null,16,["order-index","richTextContent","is-set","is-save","is-edit","show-action","onMove","onDelete","examAnswerRelationType","onSave","onEdit","onAdd"])):"page_end"===t.answerType?(a(),x(T,{"total-page":_(),key:s,"current-page-index":(e=>{const t=D.value.filter((e=>"page_end"===e.answerType));let s=0;return t.forEach(((t,n)=>{e===t.id&&(s=n+1)})),s})(t.id),item:t,"order-index":s,"is-edit":t.isEdit||!1,"is-set":t.hasSet||!1,"is-save":!t.isRealCanDel,examAnswerRelationType:t.examAnswerRelationType,onMove:e=>I(s,e),onDelete:e=>L(s),onSave:e=>M(s,e),onEdit:e=>t.isEdit=!0,onAdd:e=>k(e,s,null)},null,8,["total-page","current-page-index","item","order-index","is-edit","is-set","is-save","examAnswerRelationType","onMove","onDelete","onSave","onEdit","onAdd"])):m("v-if",!0)])))),128))])],2))}});export{S as default};
1
+ import{defineComponent as e,ref as t,useAttrs as s,watch as n,createElementBlock as i,openBlock as a,normalizeClass as o,unref as l,createElementVNode as r,Fragment as d,renderList as c,createBlock as x,createCommentVNode as m,mergeProps as u}from"vue";import p from"./components/subject-blank-fill.vue.js";import w from"./components/subject-scale.vue.js";import v from"./components/subject-single.vue.js";import y from"./components/subject-text-fill.vue.js";import h from"./components/SubjectRichText.vue.js";import T from"./components/SubjectPageEnd.vue.js";import{useNamespace as f}from"@qxs-bns/hooks";import{setGuid as A}from"@qxs-bns/utils";import{ElMessage as R}from"element-plus/es";const E={class:"subject-list-wrapper"};var S=e({name:"QxsSubjectList",__name:"subject-list",props:{subjectList:{type:Array,required:!0},isPreview:{type:Boolean,required:!0}},emits:["setRelation"],setup(e,{expose:S,emit:g}){const C=e,D=t([]),j=g,b=s();function _(){let e=0,t=!1;return D.value.map(((s,n,i)=>{"page_end"===s.answerType&&(e++,t=n===i.length-1)})),t?e:e+1}function k(e,t,s){console.log(t,"index"),t||0===t?D.value.splice(t+1,0,{customId:A(),answerType:e,analysis:"",scaleQuestionList:[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1,examAnswerRelationType:s}):D.value.push({customId:A(),answerType:e,analysis:"",scaleQuestionList:[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1,examAnswerRelationType:s})}function I(e,t){if("up"===t&&e>0){const[t]=D.value.splice(e,1);D.value.splice(e-1,0,t)}else if("down"===t&&e<D.value.length-1){const[t]=D.value.splice(e,1);D.value.splice(e+1,0,t)}}function M(e,t){for(let s=0;s<D.value.length;s++)e===s&&(D.value[e]={...D.value[e],...t,isEdit:!1})}function L(e){D.value.splice(e,1),R.success("删除成功")}function P(e,t){j("setRelation",e,t)}S({addSubject:k,currentList:D,uploadExcel:function(e){D.value=D.value.concat(e)},addExam:function(e){const t=[];e.answers?.map((e=>{t.push({...e,title:e.answer,answerId:e.examAnswerId,isCorrect:e.isCorrect})})),D.value.push({...e,customId:A(),answerType:e.richTextContent?"rich_text":e.examTypeEnum,answers:t,isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1})},setAnswerRelation:function(e,t,s){console.log(e,t,s,111),console.log(D.value,222),e.length&&D.value.forEach((n=>{n.customId===t&&n.answer.forEach((t=>{t.customAnswerId===s&&(t.answerRelations=e)}))}))}}),n((()=>C.subjectList),(e=>{e&&(D.value=[...e])}),{immediate:!0});const q=f("subject-list");return(e,t)=>(a(),i("div",{class:o(l(q).e("list-exam"))},[r("div",E,[(a(!0),i(d,null,c(l(D),((t,s)=>(a(),i("div",{key:s+t.examId||t.title},[["single","multiple","sort"].includes(t.answerType)?(a(),x(v,u({key:0,ref_for:!0},l(b),{"order-index":s,title:t.title,type:t.answerType,"exam-id":t.examId,isKey:t.isKey,"is-save":!t.isRealCanDel,customId:t.customId,"is-set":t.hasSet||!1,"answer-list":t.answers,analysis:t.analysis,"least-answer-count":t.leastAnswerCount,"is-edit":t.isEdit||!1,"show-action":!e.isPreview,"exam-expand":t.examExpand,answerCheckType:t.answerCheckType,"exam-rich-text-content":t.examRichTextContent,examAnswerRelationType:t.examAnswerRelationType,onSetRelation:P,onMove:e=>I(s,e),onDelete:e=>L(s),onSave:e=>M(s,e),onEdit:e=>t.isEdit=!0,onAdd:(e,t)=>k(e,s,t)}),null,16,["order-index","title","type","exam-id","isKey","is-save","customId","is-set","answer-list","analysis","least-answer-count","is-edit","show-action","exam-expand","answerCheckType","exam-rich-text-content","examAnswerRelationType","onMove","onDelete","onSave","onEdit","onAdd"])):"scale"===t.answerType?(a(),x(w,u({key:1,ref_for:!0},l(b),{"order-index":s,title:t.title,"is-save":!t.isRealCanDel,"is-set":t.hasSet||!1,"answer-list":t.answers,analysis:t.analysis,"is-edit":t.isEdit||!1,"scale-question-list":t.scaleQuestionList,"show-action":!e.isPreview,"exam-rich-text-content":t.examRichTextContent,examAnswerRelationType:t.examAnswerRelationType,onMove:e=>I(s,e),onDelete:e=>L(s),onSave:e=>M(s,e),onEdit:e=>t.isEdit=!0,onAdd:e=>k(e,s,null)}),null,16,["order-index","title","is-save","is-set","answer-list","analysis","is-edit","scale-question-list","show-action","exam-rich-text-content","examAnswerRelationType","onMove","onDelete","onSave","onEdit","onAdd"])):"blank_fill"===t.answerType?(a(),x(p,u({key:2,ref_for:!0},l(b),{"order-index":s,title:t.title,"is-save":!t.isRealCanDel,"is-set":t.hasSet||!1,"answer-list":t.answers,analysis:t.analysis,"show-action":!e.isPreview,"is-edit":t.isEdit||!1,"exam-answer-setting-v-o":t.examAnswerSettingVO||{},"exam-rich-text-content":t.examRichTextContent,examAnswerRelationType:t.examAnswerRelationType,onMove:e=>I(s,e),onDelete:e=>L(s),onSave:e=>M(s,e),onEdit:e=>t.isEdit=!0,onAdd:e=>k(e,s,null)}),null,16,["order-index","title","is-save","is-set","answer-list","analysis","show-action","is-edit","exam-answer-setting-v-o","exam-rich-text-content","examAnswerRelationType","onMove","onDelete","onSave","onEdit","onAdd"])):"text_fill"===t.answerType?(a(),x(y,u({key:3,ref_for:!0},l(b),{"order-index":s,title:t.title,"is-save":!t.isRealCanDel,"is-set":t.hasSet||!1,"answer-list":t.answers,analysis:t.analysis,"show-action":!e.isPreview,"is-edit":t.isEdit||!1,"exam-expand":t.examExpand,"exam-answer-setting-v-o":t.examAnswerSettingVO||{},examAnswerRelationType:t.examAnswerRelationType,"exam-rich-text-content":t.examRichTextContent,onMove:e=>I(s,e),onDelete:e=>L(s),onSave:e=>M(s,e),onEdit:e=>t.isEdit=!0,onAdd:e=>k(e,s,null)}),null,16,["order-index","title","is-save","is-set","answer-list","analysis","show-action","is-edit","exam-expand","exam-answer-setting-v-o","examAnswerRelationType","exam-rich-text-content","onMove","onDelete","onSave","onEdit","onAdd"])):"rich_text"===t.answerType?(a(),x(h,u({key:4,ref_for:!0},l(b),{"order-index":s,richTextContent:t.richTextContent,"is-set":t.hasSet||!1,"is-save":!t.isRealCanDel,"is-edit":t.isEdit||!1,"show-action":!e.isPreview,onMove:e=>I(s,e),onDelete:e=>L(s),examAnswerRelationType:t.examAnswerRelationType,onSave:e=>M(s,e),onEdit:e=>t.isEdit=!0,onAdd:e=>k(e,s,null)}),null,16,["order-index","richTextContent","is-set","is-save","is-edit","show-action","onMove","onDelete","examAnswerRelationType","onSave","onEdit","onAdd"])):"page_end"===t.answerType?(a(),x(T,{"total-page":_(),key:s,"current-page-index":(e=>{const t=D.value.filter((e=>"page_end"===e.answerType));let s=0;return t.forEach(((t,n)=>{e===t.id&&(s=n+1)})),s})(t.id),item:t,"order-index":s,"is-edit":t.isEdit||!1,"is-set":t.hasSet||!1,"is-save":!t.isRealCanDel,examAnswerRelationType:t.examAnswerRelationType,onMove:e=>I(s,e),onDelete:e=>L(s),onSave:e=>M(s,e),onEdit:e=>t.isEdit=!0,onAdd:e=>k(e,s,null)},null,8,["total-page","current-page-index","item","order-index","is-edit","is-set","is-save","examAnswerRelationType","onMove","onDelete","onSave","onEdit","onAdd"])):m("v-if",!0)])))),128))])],2))}});export{S as default};
2
2
  //# sourceMappingURL=subject-list.vue.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"subject-list.vue.js","sources":["../../../../../../packages/components/src/subject-list/src/subject-list.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// import isEqual from 'lodash/isEqual'\nimport SubjectBlankFill from './components/subject-blank-fill.vue'\nimport SubjectScale from './components/subject-scale.vue'\nimport SubjectSingle from './components/subject-single.vue'\nimport SubjectTextFill from './components/subject-text-fill.vue'\nimport SubjectRichText from './components/SubjectRichText.vue'\nimport SubjectPageEnd from './components/SubjectPageEnd.vue'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport { setGuid } from '@qxs-bns/utils'\n\ndefineOptions({\n name: 'QxsSubjectList',\n})\n\nconst props = defineProps<{\n subjectList: any[]\n isPreview: boolean\n}>()\nconst currentList = ref([] as any)\nconst emits = defineEmits(['setRelation'])\n\nconst attrs = useAttrs()\n\ndefineExpose({\n addSubject,\n currentList,\n uploadExcel,\n addExam,\n setAnswerRelation,\n})\n\nfunction totalPageIndex() {\n let totalPageIndex = 0\n let isLastPageIndex = false\n currentList.value.map((v: any, i: number, arr: any) => {\n if (v.answerType === 'page_end') {\n totalPageIndex++\n isLastPageIndex = i === arr.length - 1\n }\n })\n // 假设最后是一个分页器认为是最后一页\n return isLastPageIndex ? totalPageIndex : totalPageIndex + 1\n}\n\nfunction currentPageIndex() {\n return (currentId: any) => {\n const currentPageList = currentList.value.filter(\n (v: any) => v.answerType === 'page_end'\n )\n let currentIndex = 0\n currentPageList.forEach((c: any, i: number) => {\n if (currentId === c.id) {\n currentIndex = i + 1\n }\n })\n return currentIndex\n }\n}\n\nfunction addSubject(type: string, index: number, examAnswerRelationType: number | null) {\n console.log(index, 'index')\n if (index || index === 0) {\n currentList.value.splice(index + 1, 0, {\n customId: setGuid(),\n answerType: type,\n analysis: '',\n scaleQuestionList: [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n examAnswerRelationType: examAnswerRelationType,\n })\n }\n else {\n currentList.value.push({\n customId: setGuid(),\n answerType: type,\n analysis: '',\n scaleQuestionList: [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n examAnswerRelationType: examAnswerRelationType,\n })\n }\n}\n\nfunction addExam(item: any) {\n const answerList: any[] = []\n item.answers?.map((v: any) => {\n answerList.push({\n ...v,\n title: v.answer,\n answerId: v.examAnswerId,\n isCorrect: v.isCorrect,\n })\n })\n currentList.value.push({\n ...item,\n customId: item.examId || setGuid(),\n answerType: item.richTextContent ? 'rich_text' : item.examTypeEnum,\n answers: answerList,\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n })\n}\nfunction uploadExcel(list: any[]) {\n currentList.value = currentList.value.concat(list)\n}\n\nfunction move(index: number, type: 'up' | 'down') {\n if (type === 'up' && index > 0) {\n const [item] = currentList.value.splice(index, 1)\n currentList.value.splice(index - 1, 0, item)\n }\n else if (type === 'down' && index < currentList.value.length - 1) {\n const [item] = currentList.value.splice(index, 1)\n currentList.value.splice(index + 1, 0, item)\n }\n}\n\nfunction saveSubject(index: number, item: any) {\n for (let idx = 0; idx < currentList.value.length; idx++) {\n if (index === idx) {\n currentList.value[index] =\n {\n ...currentList.value[index],\n ...item,\n isEdit: false,\n }\n }\n }\n}\n\nfunction deleteSubject(index: number) {\n currentList.value.splice(index, 1)\n ElMessage.success('删除成功')\n}\n\nfunction setRelation(examId: string, examAnswers: any) {\n emits('setRelation', examId, examAnswers)\n}\n\nfunction setAnswerRelation(answerRelations: any, customId: string, customAnswerId: string,) {\n // 给examId设置答案关联\n if (answerRelations.length) {\n currentList.value.forEach((c: any) => {\n if (c.customId === customId) {\n c.answer.forEach((c: any) => {\n if (c.customAnswerId === customAnswerId) {\n c.answerRelations = answerRelations\n }\n })\n }\n })\n }\n}\nwatch(() => props.subjectList, (newList: any) => {\n if (newList) {\n currentList.value = [...newList]\n }\n}, { immediate: true })\nconst ns = useNamespace('subject-list')\n</script>\n\n<template>\n <div :class=\"ns.e('list-exam')\">\n <div class=\"subject-list-wrapper\">\n <div v-for=\"(item, index) in currentList\" :key=\"index + item.examId || item.title\">\n <template v-if=\"['single', 'multiple', 'sort'].includes(item.answerType)\">\n <SubjectSingle v-bind=\"attrs\" :order-index=\"index\" :title=\"item.title\" :type=\"item.answerType\"\n :isKey=\"item.isKey\" :is-save=\"!item.isRealCanDel\" :customId=\"item.customId\" :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\" :analysis=\"item.analysis\" :least-answer-count=\"item.leastAnswerCount\"\n :is-edit=\"item.isEdit || false\" :show-action=\"!isPreview\" :exam-expand=\"item.examExpand\"\n :answerCheckType=\"item.answerCheckType\" :exam-rich-text-content=\"item.examRichTextContent\"\n :examAnswerRelationType=\"item.examAnswerRelationType\" @setRelation=\"setRelation\"\n @move=\"(type: 'up' | 'down') => move(index, type)\" @delete=\"deleteSubject(index)\"\n @save=\"item => saveSubject(index, item)\" @edit=\"item.isEdit = true\"\n @add=\"(type, examAnswerRelationType) => addSubject(type, index, examAnswerRelationType)\" />\n </template>\n <SubjectScale v-bind=\"attrs\" v-else-if=\"item.answerType === 'scale'\" :order-index=\"index\" :title=\"item.title\"\n :is-save=\"!item.isRealCanDel\" :is-set=\"item.hasSet || false\" :answer-list=\"item.answers\"\n :analysis=\"item.analysis\" :is-edit=\"item.isEdit || false\" :scale-question-list=\"item.scaleQuestionList\"\n :show-action=\"!isPreview\" :exam-rich-text-content=\"item.examRichTextContent\"\n :examAnswerRelationType=\"item.examAnswerRelationType\" @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\" @save=\"(item: any) => saveSubject(index, item)\" @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\" />\n <SubjectBlankFill v-bind=\"attrs\" v-else-if=\"item.answerType === 'blank_fill'\" :order-index=\"index\"\n :title=\"item.title\" :is-save=\"!item.isRealCanDel\" :is-set=\"item.hasSet || false\" :answer-list=\"item.answers\"\n :analysis=\"item.analysis\" :show-action=\"!isPreview\" :is-edit=\"item.isEdit || false\"\n :exam-answer-setting-v-o=\"item.examAnswerSettingVO || {}\" :exam-rich-text-content=\"item.examRichTextContent\"\n :examAnswerRelationType=\"item.examAnswerRelationType\" @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\" @save=\"(item: any) => saveSubject(index, item)\" @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\" />\n <SubjectTextFill v-bind=\"attrs\" v-else-if=\"item.answerType === 'text_fill'\" :order-index=\"index\"\n :title=\"item.title\" :is-save=\"!item.isRealCanDel\" :is-set=\"item.hasSet || false\" :answer-list=\"item.answers\"\n :analysis=\"item.analysis\" :show-action=\"!isPreview\" :is-edit=\"item.isEdit || false\"\n :exam-expand=\"item.examExpand\" :exam-answer-setting-v-o=\"item.examAnswerSettingVO || {}\"\n :examAnswerRelationType=\"item.examAnswerRelationType\" :exam-rich-text-content=\"item.examRichTextContent\"\n @move=\"(type: 'up' | 'down') => move(index, type)\" @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\" @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\" />\n <SubjectRichText v-bind=\"attrs\" v-else-if=\"item.answerType === 'rich_text'\" :order-index=\"index\"\n :richTextContent=\"item.richTextContent\" :is-set=\"item.hasSet || false\" :is-save=\"!item.isRealCanDel\"\n :is-edit=\"item.isEdit || false\" :show-action=\"!isPreview\" @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\" :examAnswerRelationType=\"item.examAnswerRelationType\"\n @save=\"(item: any) => saveSubject(index, item)\" @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\" />\n <SubjectPageEnd v-else-if=\"item.answerType === 'page_end'\" :total-page=\"totalPageIndex()\" :key=\"index\"\n :current-page-index=\"currentPageIndex()(item.id)\" :item=\"item\" :order-index=\"index\"\n :is-edit=\"item.isEdit || false\" :is-set=\"item.hasSet || false\" :is-save=\"!item.isRealCanDel\"\n :examAnswerRelationType=\"item.examAnswerRelationType\" @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\" @save=\"(item: any) => saveSubject(index, item)\" @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\" />\n </div>\n </div>\n </div>\n</template>\n"],"names":["props","__props","currentList","ref","emits","__emit","attrs","useAttrs","totalPageIndex","isLastPageIndex","value","map","v","i","arr","answerType","length","addSubject","type","index","examAnswerRelationType","console","log","splice","customId","setGuid","analysis","scaleQuestionList","isSave","isEdit","isRealCanDel","hasSet","push","move","item","saveSubject","idx","deleteSubject","ElMessage","success","setRelation","examId","examAnswers","__expose","uploadExcel","list","concat","addExam","answerList","answers","title","answer","answerId","examAnswerId","isCorrect","richTextContent","examTypeEnum","setAnswerRelation","answerRelations","customAnswerId","forEach","c","watch","subjectList","newList","immediate","ns","useNamespace","currentId","currentPageList","filter","currentIndex","id"],"mappings":"k5BAeA,MAAMA,EAAQC,EAIRC,EAAcC,EAAI,IAClBC,EAAQC,EAERC,EAAQC,IAUd,SAASC,IACP,IAAIA,EAAiB,EACjBC,GAAkB,EAQf,OAPPP,EAAYQ,MAAMC,KAAI,CAACC,EAAQC,EAAWC,KACnB,aAAjBF,EAAEG,aACJP,IACkBC,EAAAI,IAAMC,EAAIE,OAAS,EAAA,IAIlCP,EAAkBD,EAAiBA,EAAiB,CAAA,CAkBpD,SAAAS,EAAWC,EAAcC,EAAeC,GACvCC,QAAAC,IAAIH,EAAO,SACfA,GAAmB,IAAVA,EACXjB,EAAYQ,MAAMa,OAAOJ,EAAQ,EAAG,EAAG,CACrCK,SAAUC,IACVV,WAAYG,EACZQ,SAAU,GACVC,kBAAmB,GACnBC,QAAQ,EACRC,QAAQ,EACRC,cAAc,EACdC,QAAQ,EACRX,2BAIFlB,EAAYQ,MAAMsB,KAAK,CACrBR,SAAUC,IACVV,WAAYG,E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AQ,EACRC,cAAc,EACdC,QAAQ,GACT,EAhFD0B,kBAuHO,SAAkBC,EAAsBlC,EAAkBmC,GAE7DD,EAAgB1C,QACNd,EAAAQ,MAAMkD,SAASC,IACrBA,EAAErC,WAAaA,GACfqC,EAAAV,OAAOS,SAASC,IACZA,EAAEF,iBAAmBA,IACvBE,EAAEH,gBAAkBA,EAAA,GAEvB,GAGP,IAEFI,GAAM,IAAM9D,EAAM+D,cAAcC,IAC1BA,IACU9D,EAAAQ,MAAQ,IAAIsD,GAAO,GAEhC,CAAEC,WAAW,IACV,MAAAC,EAAKC,EAAa,isHAzHf,CAACC,IACA,MAAAC,EAAkBnE,EAAYQ,MAAM4D,QACvC1D,GAA4B,aAAjBA,EAAEG,aAEhB,IAAIwD,EAAe,EAMZ,OALSF,EAAAT,SAAQ,CAACC,EAAQhD,KAC3BuD,IAAcP,EAAEW,KAClBD,EAAe1D,EAAI,EAAA,IAGhB0D,CAAA"}
1
+ {"version":3,"file":"subject-list.vue.js","sources":["../../../../../../packages/components/src/subject-list/src/subject-list.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// import isEqual from 'lodash/isEqual'\nimport SubjectBlankFill from './components/subject-blank-fill.vue'\nimport SubjectScale from './components/subject-scale.vue'\nimport SubjectSingle from './components/subject-single.vue'\nimport SubjectTextFill from './components/subject-text-fill.vue'\nimport SubjectRichText from './components/SubjectRichText.vue'\nimport SubjectPageEnd from './components/SubjectPageEnd.vue'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport { setGuid } from '@qxs-bns/utils'\n\ndefineOptions({\n name: 'QxsSubjectList',\n})\n\nconst props = defineProps<{\n subjectList: any[]\n isPreview: boolean\n}>()\nconst currentList = ref([] as any)\nconst emits = defineEmits(['setRelation'])\n\nconst attrs = useAttrs()\n\ndefineExpose({\n addSubject,\n currentList,\n uploadExcel,\n addExam,\n setAnswerRelation,\n})\n\nfunction totalPageIndex() {\n let totalPageIndex = 0\n let isLastPageIndex = false\n currentList.value.map((v: any, i: number, arr: any) => {\n if (v.answerType === 'page_end') {\n totalPageIndex++\n isLastPageIndex = i === arr.length - 1\n }\n })\n // 假设最后是一个分页器认为是最后一页\n return isLastPageIndex ? totalPageIndex : totalPageIndex + 1\n}\n\nfunction currentPageIndex() {\n return (currentId: any) => {\n const currentPageList = currentList.value.filter(\n (v: any) => v.answerType === 'page_end'\n )\n let currentIndex = 0\n currentPageList.forEach((c: any, i: number) => {\n if (currentId === c.id) {\n currentIndex = i + 1\n }\n })\n return currentIndex\n }\n}\n\nfunction addSubject(type: string, index: number, examAnswerRelationType: number | null) {\n console.log(index, 'index')\n if (index || index === 0) {\n currentList.value.splice(index + 1, 0, {\n customId: setGuid(),\n answerType: type,\n analysis: '',\n scaleQuestionList: [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n examAnswerRelationType: examAnswerRelationType,\n })\n }\n else {\n currentList.value.push({\n customId: setGuid(),\n answerType: type,\n analysis: '',\n scaleQuestionList: [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n examAnswerRelationType: examAnswerRelationType,\n })\n }\n}\n\nfunction addExam(item: any) {\n const answerList: any[] = []\n item.answers?.map((v: any) => {\n answerList.push({\n ...v,\n title: v.answer,\n answerId: v.examAnswerId,\n isCorrect: v.isCorrect,\n })\n })\n currentList.value.push({\n ...item,\n customId: setGuid(),\n answerType: item.richTextContent ? 'rich_text' : item.examTypeEnum,\n answers: answerList,\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n })\n}\nfunction uploadExcel(list: any[]) {\n currentList.value = currentList.value.concat(list)\n}\n\nfunction move(index: number, type: 'up' | 'down') {\n if (type === 'up' && index > 0) {\n const [item] = currentList.value.splice(index, 1)\n currentList.value.splice(index - 1, 0, item)\n }\n else if (type === 'down' && index < currentList.value.length - 1) {\n const [item] = currentList.value.splice(index, 1)\n currentList.value.splice(index + 1, 0, item)\n }\n}\n\nfunction saveSubject(index: number, item: any) {\n for (let idx = 0; idx < currentList.value.length; idx++) {\n if (index === idx) {\n currentList.value[index] =\n {\n ...currentList.value[index],\n ...item,\n isEdit: false,\n }\n }\n }\n}\n\nfunction deleteSubject(index: number) {\n currentList.value.splice(index, 1)\n ElMessage.success('删除成功')\n}\n\nfunction setRelation(examId: string, examAnswers: any) {\n emits('setRelation', examId, examAnswers)\n}\n\nfunction setAnswerRelation(answerRelations: any, customId: string, customAnswerId: string,) {\n // 给examId设置答案关联\n console.log(answerRelations, customId, customAnswerId, 111);\n console.log(currentList.value, 222);\n if (answerRelations.length) {\n currentList.value.forEach((c: any) => {\n if (c.customId === customId) {\n c.answer.forEach((c: any) => {\n if (c.customAnswerId === customAnswerId) {\n c.answerRelations = answerRelations\n }\n })\n }\n })\n }\n}\nwatch(() => props.subjectList, (newList: any) => {\n if (newList) {\n currentList.value = [...newList]\n }\n}, { immediate: true })\nconst ns = useNamespace('subject-list')\n</script>\n\n<template>\n <div :class=\"ns.e('list-exam')\">\n <div class=\"subject-list-wrapper\">\n <div v-for=\"(item, index) in currentList\" :key=\"index + item.examId || item.title\">\n <template v-if=\"['single', 'multiple', 'sort'].includes(item.answerType)\">\n <SubjectSingle \n v-bind=\"attrs\" \n :order-index=\"index\" \n :title=\"item.title\" \n :type=\"item.answerType\"\n :exam-id=\"item.examId\"\n :isKey=\"item.isKey\" \n :is-save=\"!item.isRealCanDel\" \n :customId=\"item.customId\" \n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\" \n :analysis=\"item.analysis\" \n :least-answer-count=\"item.leastAnswerCount\"\n :is-edit=\"item.isEdit || false\" \n :show-action=\"!isPreview\" \n :exam-expand=\"item.examExpand\"\n :answerCheckType=\"item.answerCheckType\" \n :exam-rich-text-content=\"item.examRichTextContent\"\n :examAnswerRelationType=\"item.examAnswerRelationType\" \n @setRelation=\"setRelation\"\n @move=\"(type: 'up' | 'down') => move(index, type)\" \n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\" \n @edit=\"item.isEdit = true\"\n @add=\"(type: string, examAnswerRelationType: number) => addSubject(type, index, examAnswerRelationType)\" />\n </template>\n <SubjectScale v-bind=\"attrs\" v-else-if=\"item.answerType === 'scale'\" :order-index=\"index\" :title=\"item.title\"\n :is-save=\"!item.isRealCanDel\" :is-set=\"item.hasSet || false\" :answer-list=\"item.answers\"\n :analysis=\"item.analysis\" :is-edit=\"item.isEdit || false\" :scale-question-list=\"item.scaleQuestionList\"\n :show-action=\"!isPreview\" :exam-rich-text-content=\"item.examRichTextContent\"\n :examAnswerRelationType=\"item.examAnswerRelationType\" @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\" @save=\"(item: any) => saveSubject(index, item)\" @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\" />\n <SubjectBlankFill v-bind=\"attrs\" v-else-if=\"item.answerType === 'blank_fill'\" :order-index=\"index\"\n :title=\"item.title\" :is-save=\"!item.isRealCanDel\" :is-set=\"item.hasSet || false\" :answer-list=\"item.answers\"\n :analysis=\"item.analysis\" :show-action=\"!isPreview\" :is-edit=\"item.isEdit || false\"\n :exam-answer-setting-v-o=\"item.examAnswerSettingVO || {}\" :exam-rich-text-content=\"item.examRichTextContent\"\n :examAnswerRelationType=\"item.examAnswerRelationType\" @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\" @save=\"(item: any) => saveSubject(index, item)\" @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\" />\n <SubjectTextFill v-bind=\"attrs\" v-else-if=\"item.answerType === 'text_fill'\" :order-index=\"index\"\n :title=\"item.title\" :is-save=\"!item.isRealCanDel\" :is-set=\"item.hasSet || false\" :answer-list=\"item.answers\"\n :analysis=\"item.analysis\" :show-action=\"!isPreview\" :is-edit=\"item.isEdit || false\"\n :exam-expand=\"item.examExpand\" :exam-answer-setting-v-o=\"item.examAnswerSettingVO || {}\"\n :examAnswerRelationType=\"item.examAnswerRelationType\" :exam-rich-text-content=\"item.examRichTextContent\"\n @move=\"(type: 'up' | 'down') => move(index, type)\" @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\" @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\" />\n <SubjectRichText v-bind=\"attrs\" v-else-if=\"item.answerType === 'rich_text'\" :order-index=\"index\"\n :richTextContent=\"item.richTextContent\" :is-set=\"item.hasSet || false\" :is-save=\"!item.isRealCanDel\"\n :is-edit=\"item.isEdit || false\" :show-action=\"!isPreview\" @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\" :examAnswerRelationType=\"item.examAnswerRelationType\"\n @save=\"(item: any) => saveSubject(index, item)\" @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\" />\n <SubjectPageEnd v-else-if=\"item.answerType === 'page_end'\" :total-page=\"totalPageIndex()\" :key=\"index\"\n :current-page-index=\"currentPageIndex()(item.id)\" :item=\"item\" :order-index=\"index\"\n :is-edit=\"item.isEdit || false\" :is-set=\"item.hasSet || false\" :is-save=\"!item.isRealCanDel\"\n :examAnswerRelationType=\"item.examAnswerRelationType\" @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\" @save=\"(item: any) => saveSubject(index, item)\" @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\" />\n </div>\n </div>\n </div>\n</template>\n"],"names":["props","__props","currentList","ref","emits","__emit","attrs","useAttrs","totalPageIndex","isLastPageIndex","value","map","v","i","arr","answerType","length","addSubject","type","index","examAnswerRelationType","console","log","splice","customId","setGuid","analysis","scaleQuestionList","isSave","isEdit","isRealCanDel","hasSet","push","move","item","saveSubject","idx","deleteSubject","ElMessage","success","setRelation","examId","examAnswers","__expose","uploadExcel","list","concat","addExam","answerList","answers","title","answer","answerId","examAnswerId","isCorrect","richTextContent","examTypeEnum","setAnswerRelation","answerRelations","customAnswerId","forEach","c","watch","subjectList","newList","immedi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D,KAC3BuD,IAAcP,EAAEW,KAClBD,EAAe1D,EAAI,EAAA,IAGhB0D,CAAA"}
@@ -1,2 +1,2 @@
1
- "use strict";exports.version="0.0.25";
1
+ "use strict";exports.version="0.0.26";
2
2
  //# sourceMappingURL=package.json.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("element-plus/es"),t=require("vue"),o=require("@element-plus/icons-vue"),a=require("@qxs-bns/hooks"),l=require("../../subject-type/src/subject-type.vue.js");const n={key:0,class:"has-set"},c={key:1,class:"flex flex-justify-end",style:{width:"100%"}};var r=t.defineComponent({name:"QxsSubjectAction",__name:"subject-action",props:{isEdit:{type:Boolean},isSet:{type:Boolean,default:!1},isKey:{type:Boolean,default:!1},answerCheckType:{type:Number,default:2},showOtherOption:{type:Boolean,default:!0},examAnswerRelationType:{type:Number,default:null},pageEnd:{type:Boolean,default:!1}},emits:["moveUp","moveDown","delete","save","edit","add","onShowRichText","setKey","setAnswerSetting"],setup(r,{emit:i}){const d=r,u=t.ref(d.isKey),s=t.ref(!1),p=i,f=t.ref(d.answerCheckType),m=a.useNamespace("subject-action");function x(){s.value=!1,p("setAnswerSetting",f)}function V(e,t){p("add",e,t?d.examAnswerRelationType:null)}return(a,i)=>{const d=e.ElLink,C=e.ElPopover,h=e.ElCheckbox,N=e.ElIcon,w=e.ElButton,k=e.ElRadio,y=e.ElRadioGroup,v=e.ElDialog;return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(t.unref(m).e("action-exam"))},[t.createElementVNode("div",{class:t.normalizeClass(["action flex flex-justify-between",[{active:r.isEdit}]])},[t.createVNode(C,{trigger:"click"},{reference:t.withCtx((()=>[t.createVNode(d,{type:"primary"},{default:t.withCtx((()=>i[13]||(i[13]=[t.createTextVNode(" +在此题后加入新题 ")]))),_:1})])),default:t.withCtx((()=>[t.createVNode(l.default,{onSelect:V})])),_:1}),r.showOtherOption?(t.openBlock(),t.createBlock(d,{key:0,type:"primary",onClick:i[0]||(i[0]=e=>p("onShowRichText"))},{default:t.withCtx((()=>i[14]||(i[14]=[t.createTextVNode(" +添加题目描述(图文) ")]))),_:1})):t.createCommentVNode("v-if",!0),r.showOtherOption?(t.openBlock(),t.createBlock(d,{key:1,type:"primary",onClick:i[1]||(i[1]=e=>s.value=!0)},{default:t.withCtx((()=>i[15]||(i[15]=[t.createTextVNode(" 答题设置 ")]))),_:1})):t.createCommentVNode("v-if",!0),r.showOtherOption?(t.openBlock(),t.createBlock(h,{key:2,modelValue:t.unref(u),"onUpdate:modelValue":i[2]||(i[2]=e=>t.isRef(u)?u.value=e:null),label:"核心题",onChange:i[3]||(i[3]=e=>p("setKey",t.unref(u)))},null,8,["modelValue"])):t.createCommentVNode("v-if",!0),t.createElementVNode("div",null,[r.isSet?(t.openBlock(),t.createElementBlock("div",n," *此题设置了跳题逻辑 ")):(t.openBlock(),t.createElementBlock("div",c,[r.isEdit?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(w,{class:"btn-margin",onClick:i[8]||(i[8]=e=>p("delete"))},{default:t.withCtx((()=>i[20]||(i[20]=[t.createTextVNode(" 删除 ")]))),_:1}),t.createVNode(w,{type:"primary",onClick:i[9]||(i[9]=e=>p("save"))},{default:t.withCtx((()=>i[21]||(i[21]=[t.createTextVNode(" 完成编辑 ")]))),_:1})],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[r.pageEnd?t.createCommentVNode("v-if",!0):(t.openBlock(),t.createBlock(w,{key:0,class:"btn-margin",onClick:i[4]||(i[4]=e=>p("edit"))},{icon:t.withCtx((()=>[t.createVNode(N,null,{default:t.withCtx((()=>[t.createVNode(t.unref(o.Edit))])),_:1})])),default:t.withCtx((()=>[i[16]||(i[16]=t.createTextVNode(" 编辑 "))])),_:1})),t.createVNode(w,{class:"btn-margin",onClick:i[5]||(i[5]=e=>p("delete"))},{icon:t.withCtx((()=>[t.createVNode(N,null,{default:t.withCtx((()=>[t.createVNode(t.unref(o.Delete))])),_:1})])),default:t.withCtx((()=>[i[17]||(i[17]=t.createTextVNode(" 删除 "))])),_:1}),t.createVNode(w,{class:"btn-margin",onClick:i[6]||(i[6]=e=>p("moveUp"))},{icon:t.withCtx((()=>[t.createVNode(N,null,{default:t.withCtx((()=>[t.createVNode(t.unref(o.Top))])),_:1})])),default:t.withCtx((()=>[i[18]||(i[18]=t.createTextVNode(" 上移 "))])),_:1}),t.createVNode(w,{class:"btn-margin",onClick:i[7]||(i[7]=e=>p("moveDown"))},{icon:t.withCtx((()=>[t.createVNode(N,null,{default:t.withCtx((()=>[t.createVNode(t.unref(o.Bottom))])),_:1})])),default:t.withCtx((()=>[i[19]||(i[19]=t.createTextVNode(" 下移 "))])),_:1})],64))]))]),t.createVNode(v,{modelValue:t.unref(s),"onUpdate:modelValue":i[12]||(i[12]=e=>t.isRef(s)?s.value=e:null),title:"答题设置",class:"customize-dialog"},{footer:t.withCtx((()=>[t.createVNode(w,{class:"customize-button",type:"primary",plain:"",onClick:i[11]||(i[11]=e=>s.value=!1)},{default:t.withCtx((()=>i[25]||(i[25]=[t.createTextVNode(" 取消 ")]))),_:1}),t.createVNode(w,{class:"customize-button",type:"primary",plain:"",onClick:x},{default:t.withCtx((()=>i[26]||(i[26]=[t.createTextVNode(" 保存 ")]))),_:1})])),default:t.withCtx((()=>[t.createVNode(y,{modelValue:t.unref(f),"onUpdate:modelValue":i[10]||(i[10]=e=>t.isRef(f)?f.value=e:null),class:"vertical-radio-group"},{default:t.withCtx((()=>[t.createVNode(k,{value:1},{default:t.withCtx((()=>i[22]||(i[22]=[t.createTextVNode("必须全部都是支持选项,方可下一步")]))),_:1}),t.createVNode(k,{value:2},{default:t.withCtx((()=>i[23]||(i[23]=[t.createTextVNode("无需判断是否是支持选项")]))),_:1}),t.createVNode(k,{value:3},{default:t.withCtx((()=>i[24]||(i[24]=[t.createTextVNode("包含全部支持选项,即可下一步")]))),_:1})])),_:1},8,["modelValue"])])),_:1},8,["modelValue"])],2)],2)}}});exports.default=r;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("element-plus/es"),t=require("vue"),o=require("@element-plus/icons-vue"),a=require("@qxs-bns/hooks"),l=require("../../subject-type/src/subject-type.vue.js");const c={key:0,class:"flex flex-justify-between"},n={key:0,class:"has-set"},r={key:1,class:"flex flex-justify-end",style:{width:"100%"}};var i=t.defineComponent({name:"QxsSubjectAction",__name:"subject-action",props:{isEdit:{type:Boolean},isSet:{type:Boolean,default:!1},isKey:{type:Boolean,default:!1},answerCheckType:{type:Number,default:2},showOtherOption:{type:Boolean,default:!0},examAnswerRelationType:{type:Number,default:null},pageEnd:{type:Boolean,default:!1}},emits:["moveUp","moveDown","delete","save","edit","add","onShowRichText","setKey","setAnswerSetting"],setup(i,{emit:d}){const u=i,s=t.ref(u.isKey),m=t.ref(!1),p=d,f=t.ref(u.answerCheckType),x=a.useNamespace("subject-action");function V(){m.value=!1,p("setAnswerSetting",f)}function C(e,t){p("add",e,t?u.examAnswerRelationType:null)}return(a,d)=>{const u=e.ElLink,N=e.ElPopover,h=e.ElCheckbox,k=e.ElIcon,w=e.ElButton,y=e.ElRadio,v=e.ElRadioGroup,B=e.ElDialog;return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(t.unref(x).e("action-exam"))},[t.createElementVNode("div",{class:t.normalizeClass(["action",[{active:i.isEdit}]])},[i.isEdit?(t.openBlock(),t.createElementBlock("div",c,[t.createVNode(N,{trigger:"click"},{reference:t.withCtx((()=>[t.createVNode(u,{type:"primary"},{default:t.withCtx((()=>d[13]||(d[13]=[t.createTextVNode(" +在此题后加入新题 ")]))),_:1})])),default:t.withCtx((()=>[t.createVNode(l.default,{onSelect:C})])),_:1}),i.showOtherOption?(t.openBlock(),t.createBlock(u,{key:0,type:"primary",onClick:d[0]||(d[0]=e=>p("onShowRichText"))},{default:t.withCtx((()=>d[14]||(d[14]=[t.createTextVNode(" +添加题目描述(图文) ")]))),_:1})):t.createCommentVNode("v-if",!0),i.showOtherOption?(t.openBlock(),t.createBlock(u,{key:1,type:"primary",onClick:d[1]||(d[1]=e=>m.value=!0)},{default:t.withCtx((()=>d[15]||(d[15]=[t.createTextVNode(" 答题设置 ")]))),_:1})):t.createCommentVNode("v-if",!0),i.showOtherOption?(t.openBlock(),t.createBlock(h,{key:2,modelValue:t.unref(s),"onUpdate:modelValue":d[2]||(d[2]=e=>t.isRef(s)?s.value=e:null),label:"核心题",onChange:d[3]||(d[3]=e=>p("setKey",t.unref(s)))},null,8,["modelValue"])):t.createCommentVNode("v-if",!0)])):t.createCommentVNode("v-if",!0),t.createElementVNode("div",null,[i.isSet?(t.openBlock(),t.createElementBlock("div",n," *此题设置了跳题逻辑 ")):(t.openBlock(),t.createElementBlock("div",r,[i.isEdit?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(w,{class:"btn-margin",onClick:d[8]||(d[8]=e=>p("delete"))},{default:t.withCtx((()=>d[20]||(d[20]=[t.createTextVNode(" 删除 ")]))),_:1}),t.createVNode(w,{type:"primary",onClick:d[9]||(d[9]=e=>p("save"))},{default:t.withCtx((()=>d[21]||(d[21]=[t.createTextVNode(" 完成编辑 ")]))),_:1})],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[i.pageEnd?t.createCommentVNode("v-if",!0):(t.openBlock(),t.createBlock(w,{key:0,class:"btn-margin",onClick:d[4]||(d[4]=e=>p("edit"))},{icon:t.withCtx((()=>[t.createVNode(k,null,{default:t.withCtx((()=>[t.createVNode(t.unref(o.Edit))])),_:1})])),default:t.withCtx((()=>[d[16]||(d[16]=t.createTextVNode(" 编辑 "))])),_:1})),t.createVNode(w,{class:"btn-margin",onClick:d[5]||(d[5]=e=>p("delete"))},{icon:t.withCtx((()=>[t.createVNode(k,null,{default:t.withCtx((()=>[t.createVNode(t.unref(o.Delete))])),_:1})])),default:t.withCtx((()=>[d[17]||(d[17]=t.createTextVNode(" 删除 "))])),_:1}),t.createVNode(w,{class:"btn-margin",onClick:d[6]||(d[6]=e=>p("moveUp"))},{icon:t.withCtx((()=>[t.createVNode(k,null,{default:t.withCtx((()=>[t.createVNode(t.unref(o.Top))])),_:1})])),default:t.withCtx((()=>[d[18]||(d[18]=t.createTextVNode(" 上移 "))])),_:1}),t.createVNode(w,{class:"btn-margin",onClick:d[7]||(d[7]=e=>p("moveDown"))},{icon:t.withCtx((()=>[t.createVNode(k,null,{default:t.withCtx((()=>[t.createVNode(t.unref(o.Bottom))])),_:1})])),default:t.withCtx((()=>[d[19]||(d[19]=t.createTextVNode(" 下移 "))])),_:1})],64))]))]),t.createVNode(B,{modelValue:t.unref(m),"onUpdate:modelValue":d[12]||(d[12]=e=>t.isRef(m)?m.value=e:null),title:"答题设置",class:"customize-dialog"},{footer:t.withCtx((()=>[t.createVNode(w,{class:"customize-button",type:"primary",plain:"",onClick:d[11]||(d[11]=e=>m.value=!1)},{default:t.withCtx((()=>d[25]||(d[25]=[t.createTextVNode(" 取消 ")]))),_:1}),t.createVNode(w,{class:"customize-button",type:"primary",plain:"",onClick:V},{default:t.withCtx((()=>d[26]||(d[26]=[t.createTextVNode(" 保存 ")]))),_:1})])),default:t.withCtx((()=>[t.createVNode(v,{modelValue:t.unref(f),"onUpdate:modelValue":d[10]||(d[10]=e=>t.isRef(f)?f.value=e:null),class:"vertical-radio-group"},{default:t.withCtx((()=>[t.createVNode(y,{value:1},{default:t.withCtx((()=>d[22]||(d[22]=[t.createTextVNode("必须全部都是支持选项,方可下一步")]))),_:1}),t.createVNode(y,{value:2},{default:t.withCtx((()=>d[23]||(d[23]=[t.createTextVNode("无需判断是否是支持选项")]))),_:1}),t.createVNode(y,{value:3},{default:t.withCtx((()=>d[24]||(d[24]=[t.createTextVNode("包含全部支持选项,即可下一步")]))),_:1})])),_:1},8,["modelValue"])])),_:1},8,["modelValue"])],2)],2)}}});exports.default=i;
2
2
  //# sourceMappingURL=subject-action.vue.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"subject-action.vue.js","sources":["../../../../../../packages/components/src/subject-action/src/subject-action.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { Bottom, Delete, Edit, Top } from '@element-plus/icons-vue'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport SubjectType from '../../subject-type/src/subject-type.vue'\n\ndefineOptions({\n name: 'QxsSubjectAction',\n})\nconst props = defineProps({\n isEdit: {\n type: Boolean,\n },\n isSet: {\n type: Boolean,\n default: false,\n },\n isKey: {\n type: Boolean,\n default: false,\n },\n answerCheckType: {\n type: Number,\n default: 2\n },\n showOtherOption: {\n type: Boolean,\n default: true,\n },\n examAnswerRelationType: {\n type: Number,\n default: null\n },\n pageEnd: {\n type: Boolean,\n default: false\n }\n})\nconst isKey = ref(props.isKey)\nconst showAnswerSetting = ref(false)\nconst emits = defineEmits(['moveUp', 'moveDown', 'delete', 'save', 'edit', 'add', 'onShowRichText', 'setKey', 'setAnswerSetting'])\nconst answerType = ref(props.answerCheckType)\nconst ns = useNamespace('subject-action')\n\nfunction onSaveSetting() {\n showAnswerSetting.value = false\n emits('setAnswerSetting', answerType)\n}\n\nfunction selectExam(type:string, canSet: boolean) {\n emits('add', type, canSet? props.examAnswerRelationType: null)\n}\n</script>\n\n<template>\n <div :class=\"ns.e('action-exam')\">\n <div class=\"action flex flex-justify-between\" :class=\"[{ active: isEdit }]\">\n <el-popover trigger=\"click\">\n <template #reference>\n <el-link type=\"primary\">\n +在此题后加入新题\n </el-link>\n </template>\n <SubjectType @select=\"selectExam\" />\n </el-popover>\n <el-link type=\"primary\" @click=\"emits('onShowRichText')\" v-if=\"showOtherOption\">\n +添加题目描述(图文)\n </el-link>\n <el-link type=\"primary\" @click=\"showAnswerSetting = true\" v-if=\"showOtherOption\">\n 答题设置\n </el-link>\n <el-checkbox v-model=\"isKey\" label=\"核心题\" @change=\"emits('setKey', isKey)\" v-if=\"showOtherOption\"/>\n <div>\n <div v-if=\"isSet\" class=\"has-set\">\n *此题设置了跳题逻辑\n </div>\n <div v-else class=\"flex flex-justify-end\" style=\"width: 100%;\">\n <template v-if=\"!isEdit\">\n <el-button class=\"btn-margin\" @click=\"emits('edit')\" v-if=\"!pageEnd\">\n <template #icon>\n <el-icon>\n <Edit />\n </el-icon>\n </template>\n 编辑\n </el-button>\n <el-button class=\"btn-margin\" @click=\"emits('delete')\">\n <template #icon>\n <el-icon>\n <Delete />\n </el-icon>\n </template>\n 删除\n </el-button>\n <el-button class=\"btn-margin\" @click=\"emits('moveUp')\">\n <template #icon>\n <el-icon>\n <Top />\n </el-icon>\n </template>\n 上移\n </el-button>\n <el-button class=\"btn-margin\" @click=\"emits('moveDown')\">\n <template #icon>\n <el-icon>\n <Bottom />\n </el-icon>\n </template>\n 下移\n </el-button>\n </template>\n <template v-else>\n <el-button class=\"btn-margin\" @click=\"emits('delete')\">\n 删除\n </el-button>\n <el-button type=\"primary\" @click=\"emits('save')\">\n 完成编辑\n </el-button>\n </template>\n </div>\n </div>\n <el-dialog\n v-model=\"showAnswerSetting\"\n title=\"答题设置\"\n class=\"customize-dialog\"\n >\n <el-radio-group v-model=\"answerType\" class=\"vertical-radio-group\">\n <el-radio :value=\"1\">必须全部都是支持选项,方可下一步</el-radio>\n <el-radio :value=\"2\">无需判断是否是支持选项</el-radio>\n <el-radio :value=\"3\">包含全部支持选项,即可下一步</el-radio>\n </el-radio-group>\n <template #footer>\n <el-button\n class=\"customize-button\"\n type=\"primary\"\n plain\n @click=\"showAnswerSetting = false\"\n >\n 取消\n </el-button>\n <el-button\n class=\"customize-button\"\n type=\"primary\"\n plain\n @click=\"onSaveSetting\"\n >\n 保存\n </el-button>\n </template>\n </el-dialog>\n </div>\n </div>\n</template>\n"],"names":["props","__props","isKey","ref","showAnswerSetting","emits","__emit","answerType","answerCheckType","ns","useNamespace","onSaveSetting","value","selectExam","type","canSet","examAnswerRelationType"],"mappings":"ixBAQA,MAAMA,EAAQC,EA6BRC,EAAQC,EAAAA,IAAIH,EAAME,OAClBE,EAAoBD,OAAI,GACxBE,EAAQC,EACRC,EAAaJ,EAAAA,IAAIH,EAAMQ,iBACvBC,EAAKC,eAAa,kBAExB,SAASC,IACPP,EAAkBQ,OAAQ,EAC1BP,EAAM,mBAAoBE,EAAU,CAG7B,SAAAM,EAAWC,EAAaC,GAChCV,EAAM,MAAOS,EAAMC,EAAQf,EAAMgB,uBAAwB,KAAI"}
1
+ {"version":3,"file":"subject-action.vue.js","sources":["../../../../../../packages/components/src/subject-action/src/subject-action.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { Bottom, Delete, Edit, Top } from '@element-plus/icons-vue'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport SubjectType from '../../subject-type/src/subject-type.vue'\n\ndefineOptions({\n name: 'QxsSubjectAction',\n})\nconst props = defineProps({\n isEdit: {\n type: Boolean,\n },\n isSet: {\n type: Boolean,\n default: false,\n },\n isKey: {\n type: Boolean,\n default: false,\n },\n answerCheckType: {\n type: Number,\n default: 2\n },\n showOtherOption: {\n type: Boolean,\n default: true,\n },\n examAnswerRelationType: {\n type: Number,\n default: null\n },\n pageEnd: {\n type: Boolean,\n default: false\n }\n})\nconst isKey = ref(props.isKey)\nconst showAnswerSetting = ref(false)\nconst emits = defineEmits(['moveUp', 'moveDown', 'delete', 'save', 'edit', 'add', 'onShowRichText', 'setKey', 'setAnswerSetting'])\nconst answerType = ref(props.answerCheckType)\nconst ns = useNamespace('subject-action')\n\nfunction onSaveSetting() {\n showAnswerSetting.value = false\n emits('setAnswerSetting', answerType)\n}\n\nfunction selectExam(type:string, canSet: boolean) {\n emits('add', type, canSet? props.examAnswerRelationType: null)\n}\n</script>\n\n<template>\n <div :class=\"ns.e('action-exam')\">\n <div class=\"action\" :class=\"[{ active: isEdit }]\">\n <div v-if=\"isEdit\" class=\"flex flex-justify-between\">\n <el-popover trigger=\"click\">\n <template #reference>\n <el-link type=\"primary\">\n +在此题后加入新题\n </el-link>\n </template>\n <SubjectType @select=\"selectExam\" />\n </el-popover>\n <el-link type=\"primary\" @click=\"emits('onShowRichText')\" v-if=\"showOtherOption\">\n +添加题目描述(图文)\n </el-link>\n <el-link type=\"primary\" @click=\"showAnswerSetting = true\" v-if=\"showOtherOption\">\n 答题设置\n </el-link>\n <el-checkbox v-model=\"isKey\" label=\"核心题\" @change=\"emits('setKey', isKey)\" v-if=\"showOtherOption\"/>\n </div>\n <div>\n <div v-if=\"isSet\" class=\"has-set\">\n *此题设置了跳题逻辑\n </div>\n <div v-else class=\"flex flex-justify-end\" style=\"width: 100%;\">\n <template v-if=\"!isEdit\">\n <el-button class=\"btn-margin\" @click=\"emits('edit')\" v-if=\"!pageEnd\">\n <template #icon>\n <el-icon>\n <Edit />\n </el-icon>\n </template>\n 编辑\n </el-button>\n <el-button class=\"btn-margin\" @click=\"emits('delete')\">\n <template #icon>\n <el-icon>\n <Delete />\n </el-icon>\n </template>\n 删除\n </el-button>\n <el-button class=\"btn-margin\" @click=\"emits('moveUp')\">\n <template #icon>\n <el-icon>\n <Top />\n </el-icon>\n </template>\n 上移\n </el-button>\n <el-button class=\"btn-margin\" @click=\"emits('moveDown')\">\n <template #icon>\n <el-icon>\n <Bottom />\n </el-icon>\n </template>\n 下移\n </el-button>\n </template>\n <template v-else>\n <el-button class=\"btn-margin\" @click=\"emits('delete')\">\n 删除\n </el-button>\n <el-button type=\"primary\" @click=\"emits('save')\">\n 完成编辑\n </el-button>\n </template>\n </div>\n </div>\n <el-dialog\n v-model=\"showAnswerSetting\"\n title=\"答题设置\"\n class=\"customize-dialog\"\n >\n <el-radio-group v-model=\"answerType\" class=\"vertical-radio-group\">\n <el-radio :value=\"1\">必须全部都是支持选项,方可下一步</el-radio>\n <el-radio :value=\"2\">无需判断是否是支持选项</el-radio>\n <el-radio :value=\"3\">包含全部支持选项,即可下一步</el-radio>\n </el-radio-group>\n <template #footer>\n <el-button\n class=\"customize-button\"\n type=\"primary\"\n plain\n @click=\"showAnswerSetting = false\"\n >\n 取消\n </el-button>\n <el-button\n class=\"customize-button\"\n type=\"primary\"\n plain\n @click=\"onSaveSetting\"\n >\n 保存\n </el-button>\n </template>\n </el-dialog>\n </div>\n </div>\n</template>\n"],"names":["props","__props","isKey","ref","showAnswerSetting","emits","__emit","answerType","answerCheckType","ns","useNamespace","onSaveSetting","value","selectExam","type","canSet","examAnswerRelationType"],"mappings":"6zBAQA,MAAMA,EAAQC,EA6BRC,EAAQC,EAAAA,IAAIH,EAAME,OAClBE,EAAoBD,OAAI,GACxBE,EAAQC,EACRC,EAAaJ,EAAAA,IAAIH,EAAMQ,iBACvBC,EAAKC,eAAa,kBAExB,SAASC,IACPP,EAAkBQ,OAAQ,EAC1BP,EAAM,mBAAoBE,EAAU,CAG7B,SAAAM,EAAWC,EAAaC,GAChCV,EAAM,MAAOS,EAAMC,EAAQf,EAAMgB,uBAAwB,KAAI"}