/* empty css                */import{n as u}from"./vueComponentNormalizer.9ef17bb1.js";var d=function(){var s,t=this,i=t.$createElement,e=t._self._c||i;return e("div",{staticClass:"aq-card-inner"},[e("div",{staticClass:"gy-area-title"},[t._v("\u7B54\u9898\u5361")]),[1,3].includes(t.mode)?e("div",{staticClass:"tips-card"},[t._m(2),t._m(3)]):e("div",{staticClass:"tips-card"},[t._m(0),t.mode!==5?e("div",{staticClass:"tips-item"},[t._v(" \u6807\u8BB0 "),e("div",{staticClass:"color-card flag"})]):t._e(),t._m(1)]),t.mode===1?e("div",{staticStyle:{display:"flex","justify-content":"space-between",margin:"10px 0","font-size":"12px"}},[e("div",{staticClass:"gy-label"},[t._v("\u8BD5\u5377\u603B\u5206\uFF1A"+t._s(t.examScore)+" \u5206")]),e("div",{staticClass:"gy-label"},[t._v("\u60A8\u7684\u5F97\u5206\uFF1A"+t._s(t.userTotalScore)+" \u5206")])]):t._e(),e("div",{staticStyle:{overflow:"auto"}},t._l((s=t.questionList)===null||s===void 0?void 0:s.classify,function(r,l){return e("div",{key:l},[e("p",{staticStyle:{padding:"10px  0","font-weight":"bold","font-size":"14px"}},[t._v(" "+t._s(r.title)+" "),e("span",{staticStyle:{"font-size":"12px","font-weight":"normal",display:"inline-block","margin-left":"10px",color:"#999"}},[t._v(" (\u5171"+t._s(t.questionList.questions[r.title].length)+"\u9898) ")])]),[1,3].includes(t.mode)?e("div",{staticClass:"serial-list"},t._l(t.questionList.questions[r.title],function(n,a){return e("div",{key:n.id,class:["serial-item",{error:n.score>n.userScore,success:n.score<=n.userScore}],attrs:{questionInfo:n},on:{click:function(o){return t.itemOnClick(n)}}},[t._v(t._s(a+1))])}),0):e("div",{staticClass:"serial-list"},t._l(t.questionList.questions[r.title],function(n,a){return e("div",{key:n.id,class:["serial-item",{flag:t.flag.includes(n.id),success:t.localAnswers.includes(n.id)}],attrs:{questionInfo:n},on:{click:function(o){return t.itemOnClick(n)}}},[t._v(t._s(a+1))])}),0)])}),0),t.mode===5?e("div",[e("div",{staticClass:"action-btn-group"},[e("el-button",{attrs:{round:"",type:"primary"},on:{click:function(r){return t.handler("submit")}}},[t._v("\u63D0\u4EA4\u7B54\u9898")]),e("el-button",{attrs:{plain:"",round:"",type:"danger"},on:{click:function(r){return t.handler("cancel")}}},[t._v("\u9000\u51FA")])],1)]):t._e(),t.mode===1?e("div",[e("div",{staticClass:"action-btn-group"},[e("el-button",{attrs:{plain:"",round:"",type:"danger"},on:{click:function(r){return t.handler("cancel")}}},[t._v("\u9000\u51FA\u9884\u89C8")])],1)]):t._e()])},_=[function(){var s=this,t=s.$createElement,i=s._self._c||t;return i("div",{staticClass:"tips-item"},[s._v(" \u5DF2\u4F5C\u7B54 "),i("div",{staticClass:"color-card success"})])},function(){var s=this,t=s.$createElement,i=s._self._c||t;return i("div",{staticClass:"tips-item"},[s._v(" \u672A\u4F5C\u7B54 "),i("div",{staticClass:"color-card unwrite"})])},function(){var s=this,t=s.$createElement,i=s._self._c||t;return i("div",{staticClass:"tips-item"},[s._v(" \u6B63\u786E "),i("div",{staticClass:"color-card success"})])},function(){var s=this,t=s.$createElement,i=s._self._c||t;return i("div",{staticClass:"tips-item"},[s._v(" \u9519\u8BEF "),i("div",{staticClass:"color-card flag"})])}];const v={props:{questions:{},flag:{type:Array,default:()=>[]},answers:{type:Object,default:s=>({})},mode:{type:Number,default:0}},data:s=>({localAnswers:[],questionList:null,originQuestionList:null}),computed:{examScore(){return this.originQuestionList&&this.originQuestionList.length>0?this.originQuestionList.reduce((s,t)=>s+t.score,0):"\u65E0"},userTotalScore(){return this.originQuestionList&&this.originQuestionList.length>0?this.originQuestionList.reduce((s,t)=>s+t.userScore,0):"\u65E0"}},watch:{answers:{deep:!0,handler(s){this.localAnswers=s.map(t=>t.questionId)}},questions:{deep:!0,immediate:!0,handler(s){s&&(this.questionList=this.formatQuestions(s),this.originQuestionList=s)}}},methods:{handler(s){this.$emit(s)},itemOnClick(s){this.$emit("smooth",s)},formatQuestions(s){return s.reduce((i,e)=>(i.classify.findIndex(r=>r.title===e.type)===-1&&i.classify.push({title:e.type,score:e.score}),Object.keys(i.questions).includes(e.type)?i.questions[e.type].push(e):i.questions[e.type]=[e],i),{classify:[],questions:{}})}}},c={};var f=u(v,d,_,!1,p,"a1c48ade",null,null);function p(s){for(let t in c)this[t]=c[t]}const y=function(){return f.exports}();export{y as A};
