12 |
- (function(t){function e(e){for(var s,a,c=e[0],l=e[1],u=e[2],h=0,d=[];h<c.length;h++)a=c[h],Object.prototype.hasOwnProperty.call(n,a)&&n[a]&&d.push(n[a][0]),n[a]=0;for(s in l)Object.prototype.hasOwnProperty.call(l,s)&&(t[s]=l[s]);r&&r(e);while(d.length)d.shift()();return o.push.apply(o,u||[]),i()}function i(){for(var t,e=0;e<o.length;e++){for(var i=o[e],s=!0,c=1;c<i.length;c++){var l=i[c];0!==n[l]&&(s=!1)}s&&(o.splice(e--,1),t=a(a.s=i[0]))}return t}var s={},n={app:0},o=[];function a(e){if(s[e])return s[e].exports;var i=s[e]={i:e,l:!1,exports:{}};return t[e].call(i.exports,i,i.exports,a),i.l=!0,i.exports}a.m=t,a.c=s,a.d=function(t,e,i){a.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},a.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.t=function(t,e){if(1&e&&(t=a(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(a.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)a.d(i,s,function(e){return t[e]}.bind(null,s));return i},a.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return a.d(e,"a",e),e},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.p="/";var c=window["webpackJsonp"]=window["webpackJsonp"]||[],l=c.push.bind(c);c.push=e,c=c.slice();for(var u=0;u<c.length;u++)e(c[u]);var r=l;o.push([0,"chunk-vendors"]),i()})({0:function(t,e,i){t.exports=i("56d7")},1051:function(t,e,i){},2395:function(t,e,i){},3223:function(t,e,i){},4265:function(t,e,i){},"4f0c":function(t,e,i){"use strict";var s=i("4265"),n=i.n(s);n.a},"56d7":function(t,e,i){"use strict";i.r(e);i("b0c0"),i("e260"),i("e6cf"),i("cca6"),i("a79d");var s=i("a026"),n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"questionEditDialog"},[i("div",{staticClass:"title"},[i("span",[t._v("设置")]),i("i",{on:{click:t.hideSettingDialog}})]),i("div",{staticClass:"questionEditContent"},[i("div",{staticClass:"controlOption"},[i("div",{staticClass:"hrow"},[i("label",[t._v("大题号")]),i("h-select",{attrs:{hwidth:"114px",defaultOption:t.defaultBigQues,options:t.bigQuestionNos},on:{changeOption:t.changeBigNo}}),i("label",[t._v("题型标题")]),i("h-input",{attrs:{placeholder:"请输入题型标题名称",maxLength:10,ctype:"text",hwidth:"200px"},model:{value:t.commonFields.questionTypeTitle,callback:function(e){t.$set(t.commonFields,"questionTypeTitle",e)},expression:"commonFields.questionTypeTitle"}})],1),i("div",{staticClass:"hrow row2"},[i("label",[t._v("题 类")]),i("h-select",{attrs:{hwidth:"114px",placeholder:"请选择题类",options:t.questionTypes,immediate:!1,defaultOption:t.defaultQuesType},on:{changeOption:t.changeType}}),i("label",[t._v(t._s(t.isChooseAnswer?"第":"从"))]),i("h-input",{attrs:{min:t.startNoForSubjectType,max:+t.commonFields.endNo,hwidth:"30",ctype:"number"},model:{value:t.commonFields.startNo,callback:function(e){t.$set(t.commonFields,"startNo",e)},expression:"commonFields.startNo"}}),t.isChooseAnswer?t._e():[i("label",[t._v("到")]),i("h-input",{attrs:{hwidth:"30",min:+t.commonFields.startNo,ctype:"number"},model:{value:t.commonFields.endNo,callback:function(e){t.$set(t.commonFields,"endNo",e)},expression:"commonFields.endNo"}})],i("label",[t._v("题")]),t.isChooseAnswer?[i("h-select",{attrs:{hwidth:"60px",placeholder:"请选择题类",options:t.selectOptions,defaultOption:t.defaultSelectOption},on:{changeOption:t.changeChooseOption}}),i("label",[t._v("选")]),i("h-select",{attrs:{hwidth:"60px",options:[{label:"一",value:1}],defaultOption:{label:"一",value:1}}})]:t._e(),t.isSelectType?[i("label",[t._v("每题")]),i("h-input",{attrs:{min:2,max:7,hwidth:"30",ctype:"number"},on:{blur:function(e){return t.batchChangeFields("optionsCount")}},model:{value:t.dialogData.optionsCount,callback:function(e){t.$set(t.dialogData,"optionsCount",e)},expression:"dialogData.optionsCount"}}),i("label",[t._v("个选项")])]:t._e(),i("label",[t._v("每题")]),i("h-input",{attrs:{step:.5,hwidth:"30"},on:{blur:function(e){return t.batchChangeFields("score")}},model:{value:t.commonFields.score,callback:function(e){t.$set(t.commonFields,"score",e)},expression:"commonFields.score"}}),i("label",[t._v("分")]),t.isMoreSelectType?[i("label",[t._v("半对")]),i("h-input",{attrs:{step:.5,hwidth:"30"},on:{blur:function(e){return t.batchChangeFields("halfScore")}},model:{value:t.dialogData.halfScore,callback:function(e){t.$set(t.dialogData,"halfScore",e)},expression:"dialogData.halfScore"}}),i("label",[t._v("分")])]:t._e(),i("div",{staticClass:"opratorRowLength"},[i("span",{staticClass:"rowBtn add",on:{click:t.addQuestionItems}}),i("span",{staticClass:"rowBtn minus",on:{click:t.reduceQuestionItems}})]),t.isChooseAnswer&&t.isZongHe?i("subject-select",{on:{changeSubject:t.changeSubject}}):t._e()],2)]),i("div",{staticClass:"subjectListInfo"},[t.questions.length?i("ul",[t.isSelectType?t._l(t.questions,(function(e,s){return i("select-item",{key:e.questionNo,attrs:{_index:s,question:e,isMoreSelectType:t.isMoreSelectType},on:{validateOptions:t.validateOptions,changeSubject:t.changeSubject}})})):t._e(),!t.isFillInBlank&&!t.isAnswer||t.isComposition?t._e():t._l(t.questions,(function(e,s){return i("topic-question-item",{key:e.questionNo,attrs:{_index:s,questionType:t.commonFields.questionType,question:e},on:{validateOptions:t.validateOptions,setSmQuesLength:t.setSmQuesLength,changeSetSmQuesStatus:t.changeSetSmQuesStatus,setSmQuesScore:t.setSmQuesScore,addSmTopic:t.addSmTopic,removeSmTopic:t.removeSmTopic,changeSubject:t.changeSubject}})})),t.isComposition?t._l(t.questions,(function(e,s){return i("composition-item",{key:e.questionNo,attrs:{_index:s,question:e},on:{validateOptions:t.validateOptions}})})):t._e()],2):i("span",{staticClass:"tips"},[t._v("请添加题目")])]),i("div",{staticClass:"layoutOption"},[t.isSelectType?i("select-layout",{attrs:{direction:t.dialogData.direction},on:{changeDirection:t.changeDirection}}):t.isFillInBlank?i("fillinblank-layout",{attrs:{defaultColumn:t.dialogData.columns,defaultRowLineHeight:t.dialogData.rowLineHeight,defaultScoreStyle:t.dialogData.scoreStyle},on:{changeColumn:t.changeColumn,changeRowLineHeight:t.changeRowLineHeight,changeSocreLimit:t.changeSocreLimit}}):t.isAnswer?i("answer-layout",{attrs:{isHalf:t.dialogData.isAddHalf,scoreLimit:t.dialogData.scoreLimit},on:{changeScoreLimit:t.changeScoreLimit,setHasHalfScore:t.setHasHalfScore}}):t._e()],1)]),i("div",{staticClass:"questionBtns"},[i("div",{staticClass:"h_btn",on:{click:t.addQuestionsToOnlineCard}},[t._v("确定")]),i("div",{staticClass:"h_btn border",on:{click:t.hideSettingDialog}},[t._v("取消")])])])},o=[],a=(i("99af"),i("7db0"),i("4160"),i("caad"),i("a15b"),i("d81d"),i("a434"),i("b64b"),i("ac1f"),i("2532"),i("1276"),i("159b"),i("ade3")),c=i("5530"),l=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("li",{staticClass:"subjectItem"},[i("div",{staticClass:"subjectContent"},[i("span",[t._v(t._s(t.question.questionNo))]),i("span",{staticClass:"tips"},[t._v("作文")]),i("div",{staticClass:"info"},[i("label",[t._v("分数")]),i("h-input",{attrs:{hwidth:"30"},on:{blur:function(e){return t.validateOptions(t.question)}},model:{value:t.questionMap.score,callback:function(e){t.$set(t.questionMap,"score",e)},expression:"questionMap.score"}})],1)])])},u=[],r=(i("a9e3"),function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("span",{staticClass:"hgc_chooseSubject"},[i("i",[t._v("icon-notice")]),i("label",[t._v("学科")]),i("h-select",{attrs:{hwidth:"70px",defaultOption:t.defaultOption,options:t.options},on:{changeOption:t.changeOption}})],1)}),h=[],d={data:function(){return{options:[{label:"物理",id:12},{label:"化学",id:13},{label:"生物",id:14}],wenzong:[{label:"政治",id:15},{label:"历史",id:16},{label:"地理",id:17}],lizong:[{label:"物理",id:12},{label:"化学",id:13},{label:"生物",id:14}]}},created:function(){19===this.subjectId?this.options=this.wenzong:18===this.subjectId&&(this.options=this.lizong)},computed:{defaultOption:function(){return this.options[0]}},methods:{changeOption:function(t){this.$emit("changeSubject",t)}}},p=d,m=(i("5ceb"),i("2877")),f=Object(m["a"])(p,r,h,!1,null,null,null),b=f.exports,g={name:"SelectItem",props:{_index:Number,question:{type:Object}},data:function(){return{questionMap:Object(c["a"])({},this.question)}},beforeUpdate:function(){this.questionMap=Object(c["a"])({},this.question)},methods:{validateOptions:function(t){this.$emit("validateOptions",Object(c["a"])(Object(c["a"])({},t),{},{index:this._index},this.questionMap))}}},v=g,S=Object(m["a"])(v,l,u,!1,null,null,null),y=S.exports,q=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("li",{staticClass:"subjectItem"},[i("div",{staticClass:"subjectContent"},[i("span",[t._v(t._s(t.question.questionNo))]),i("span",{staticClass:"tips"},[t._v("单选")]),i("div",{staticClass:"info"},[t.$parent.isZongHe?i("subject-select",{on:{changeSubject:t.changeSubject}}):t._e(),i("label",[t._v("选项数")]),i("h-input",{attrs:{hwidth:"30"},on:{blur:function(e){return t.validateOptions(t.question)}},model:{value:t.questionMap.optionsCount,callback:function(e){t.$set(t.questionMap,"optionsCount",e)},expression:"questionMap.optionsCount"}}),i("label",[t._v("分数")]),i("h-input",{attrs:{hwidth:"30",step:.5},on:{blur:function(e){return t.validateOptions(t.question)}},model:{value:t.questionMap.score,callback:function(e){t.$set(t.questionMap,"score",e)},expression:"questionMap.score"}}),t.isMoreSelectType?[i("label",[t._v("半对分")]),i("h-input",{attrs:{hwidth:"30",step:.5},on:{blur:function(e){return t.validateOptions(t.question)}},model:{value:t.questionMap.halfScore,callback:function(e){t.$set(t.questionMap,"halfScore",e)},expression:"questionMap.halfScore"}})]:t._e()],2)])])},_=[],x={name:"SelectItem",props:{isMoreSelectType:Boolean,_index:Number,question:{type:Object}},data:function(){return{questionMap:Object(c["a"])({},this.question)}},beforeUpdate:function(){this.questionMap=Object(c["a"])({},this.question)},methods:{validateOptions:function(t){this.$emit("validateOptions",Object(c["a"])(Object(c["a"])({},t),{},{index:this._index},this.questionMap))},changeSubject:function(t){this.$emit("changeSubject",Object(c["a"])(Object(c["a"])({},t),{},{_index:this._index}))}},components:{SubjectSelect:b}},T=x,O=Object(m["a"])(T,q,_,!1,null,null,null),C=O.exports,w=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"hrow"},[i("label",[t._v("手写打分")]),i("h-select",{attrs:{hwidth:"114px",options:t.options,defaultOption:{label:"上限"+t.scoreLimit,value:t.scoreLimit}},on:{changeOption:t.changeLimit}}),i("h-checkbox",{model:{value:t.hasHalfScore,callback:function(e){t.hasHalfScore=e},expression:"hasHalfScore"}}),i("div",{staticClass:"tips"},[t._v("仅对线下阅卷打分")])],1)},j=[],N={name:"AnswerLayout",props:{scoreLimit:{type:Number,default:15},isHalf:{type:Boolean,default:!1}},data:function(){return{hasHalfScore:this.isHalf,options:[{label:"上限15",value:15},{label:"上限16",value:16},{label:"上限29",value:29},{label:"上限49",value:49}]}},methods:{changeLimit:function(t){this.$emit("changeScoreLimit",t)}},watch:{hasHalfScore:function(t){this.$emit("setHasHalfScore",t)}}},Q=N,I=Object(m["a"])(Q,w,j,!1,null,null,null),F=I.exports,k=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"hrow"},[i("label",[t._v("答题卡布局")]),i("label",[t._v("每行")]),i("h-select",{attrs:{hwidth:"114px",options:t.columns,defaultOption:{label:t.defaultColumn,value:t.defaultColumn}},on:{changeOption:t.changeColumn}}),i("label",[t._v("列")]),i("label",[t._v("行高")]),i("h-select",{attrs:{hwidth:"114px",options:t.lineHeights,defaultOption:{label:t.defaultRowLineHeight,value:t.defaultRowLineHeight}},on:{changeOption:t.changeRowLineHeight}}),i("label",[t._v("手写打分")]),i("h-select",{attrs:{hwidth:"114px",options:t.scoreStyles,defaultOption:{label:t.defaultScoreStyle?t.defaultScoreStyle:"空白方框",value:t.defaultScoreStyle}},on:{changeOption:t.changeSocreLimit}}),i("div",{staticClass:"tips"},[t._v("仅对线下阅卷打分")])],1)},D=[],$={name:"FillinblankLayout",props:{defaultColumn:{type:Number,default:1},defaultRowLineHeight:{type:Number,default:40},defaultScoreStyle:{type:String,default:""}},data:function(){return{columns:[{label:"1",value:1},{label:"2",value:2},{label:"3",value:3}],lineHeights:[{label:"25px",value:25},{label:"30px",value:30},{label:"35px",value:35},{label:"40px",value:40},{label:"45px",value:45},{label:"50px",value:50}],scoreStyles:[{label:"空白方框",value:""},{label:"2/3/5",value:"2/3/5"},{label:"2/3/4/6",value:"2/3/4/6"},{label:"2/4",value:"2/4"}]}},methods:{changeColumn:function(t){this.$emit("changeColumn",t)},changeRowLineHeight:function(t){this.$emit("changeRowLineHeight",t)},changeSocreLimit:function(t){this.$emit("changeSocreLimit",t)}}},L=$,H=Object(m["a"])(L,k,D,!1,null,null,null),E=H.exports,M=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"hrow"},[i("label",[t._v("选择排列方向")]),i("h-radio",{attrs:{value:t.direction},on:{changeDirection:t.changeDirection}})],1)},A=[],B={name:"SelectLayout",props:{direction:{type:Number,deafult:0}},methods:{changeDirection:function(t){this.$emit("changeDirection",t)}}},R=B,P=Object(m["a"])(R,M,A,!1,null,null,null),J=P.exports,K=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("li",{staticClass:"subjectItem"},[i("div",{staticClass:"subjectContent"},[i("span",[t._v(t._s(t.questionNoCalc)),17!==t.questionType?i("a",{staticClass:"light",attrs:{href:"javascript:;"},on:{click:t.addSmTopic}},[i("i",[t._v("+")]),t._v("添加小题")]):t._e()]),i("span",{staticClass:"tips"},[t._v(t._s(t.quetionLable))]),i("div",{staticClass:"info"},[t.$parent.isZongHe?i("subject-select",{on:{changeSubject:t.changeSubject}}):t._e(),t.question.smTopic.length?t._e():[i("label",[i("h-notice"),i("h-switch",{attrs:{checked:t.question.hasSmQuestion},on:{changeStatus:t.changeStatus1}})],1),i("label",[t._v("含小问")]),i("h-input",{attrs:{hwidth:"30",min:2,max:10,disabled:!t.question.hasSmQuestion,value:t.question.smQuestion.length},on:{blur:function(e){return t.setSmQuesLength(e,"topicQues")}}})],i("label",[t._v("分数")]),i("h-input",{attrs:{hwidth:"30",step:.5},on:{blur:function(e){return t.validateOptions(t.question)}},model:{value:t.score,callback:function(e){t.score=e},expression:"score"}})],2),!t.question.smTopic.length&&t.question.smQuestion.length?t._l(t.question.smQuestion,(function(e,s){return i("sm-question",{key:e.symbolKey,attrs:{score:t.score,alias:t.question.questionNo+"("+(s+1)+")",index:s},on:{setSmQuesScore:t.setSmQuesScore}})})):t._e()],2),t.question.smTopic.length?i("div",{staticClass:"smTopicList"},t._l(t.question.smTopic,(function(e,s){return i("div",{key:e.alias,staticClass:"smTopic"},[i("span",[i("i",{staticClass:"icon icon-del",on:{click:function(e){return t.removeSmTopic(s)}}}),t._v(t._s(t.question.questionNo+"."+(s+1)))]),i("span",{staticClass:"tips"},[t._v("填空")]),i("div",{staticClass:"info"},[i("label",[i("h-notice"),i("h-switch",{attrs:{_index:s},on:{changeStatus:t.changeStatus2},model:{value:e.hasSmQuestion,callback:function(i){t.$set(e,"hasSmQuestion",i)},expression:"smTopicItem.hasSmQuestion"}})],1),i("label",[t._v("含小问")]),i("h-input",{attrs:{hwidth:"30",min:2,max:10,disabled:!e.hasSmQuestion,value:e.smQuestion.length},on:{blur:function(e){return t.setSmQuesLength(e,"smTopicQues",s)}}}),i("label",[t._v("分数")]),i("h-input",{attrs:{hwidth:"30",step:.5},model:{value:e.score,callback:function(i){t.$set(e,"score",i)},expression:"smTopicItem.score"}})],1),t._l(e.smQuestion,(function(n,o){return i("sm-question",{key:n.symbolKey,attrs:{index:o,smTopicIndex:s,score:n.score,alias:e.alias+"("+(o+1)+")"},on:{setSmQuesScore:t.setSmQuesScore2}})}))],2)})),0):t._e()])},z=[],Z=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"smQuestion"},[i("span",[t._v(t._s(t.alias))]),i("div",{staticClass:"info"},[i("label",[t._v("分数")]),i("h-input",{attrs:{hwidth:"30",step:.5},on:{blur:t.setSmQuesScore},model:{value:t.scoreItem,callback:function(e){t.scoreItem=e},expression:"scoreItem"}})],1)])},U=[],V={props:{score:[Number,String],alias:String,index:Number,smTopicIndex:{type:Number,default:0}},data:function(){return{scoreItem:this.score}},methods:{setSmQuesScore:function(t){this.$emit("setSmQuesScore",{score:this.scoreItem,index:this.index,smTopicIndex:this.smTopicIndex})}}},W=V,Y=(i("ace4"),Object(m["a"])(W,Z,U,!1,null,"314b44b0",null)),G=Y.exports,X=(i("d3b7"),i("25f0"),function(t){return JSON.parse(JSON.stringify(t))}),tt=function(){return Math.random().toString(36).substr(3,10)},et={1:"单选",2:"多选",11:"不定项选择",5:"填空",7:"解答","7c":"作文",17:"选做"},it={1:"singleSelect",2:"moreSelect",11:"moreSelect",5:"fillInBlank",7:"answer","7c":"composition",17:"chooseAnswer"},st={name:"FillInBlank",props:{questionType:Number,_index:Number,question:{type:Object}},components:{SmQuestion:G,SubjectSelect:b},computed:{quetionLable:function(){return et[this.questionType]},questionNoCalc:function(){var t=this.question.questionNo,e=this._index;return 17===this.questionType?t-e+"-"+String.fromCharCode(65+e):t}},data:function(){return{score:this.question.score,defaultSmTopicItem:{score:1,hasSmQuestion:!1,smQuestion:[]}}},updated:function(){this.score=this.question.score},methods:{addSmTopic:function(){this.$emit("addSmTopic",this._index)},removeSmTopic:function(t){this.$emit("removeSmTopic",this._index,t)},changeSubject:function(t){this.$emit("changeSubject",Object(c["a"])(Object(c["a"])({},t),{},{_index:this._index}))},changeStatus1:function(t){var e=t.status,i=t.index;this.$emit("changeSetSmQuesStatus",{_index:this._index,status:e,index:i,type:"topicSmQues"})},changeStatus2:function(t){var e=t.status,i=t.index;this.$emit("changeSetSmQuesStatus",{_index:this._index,status:e,index:i,type:"smTopicSmQues"})},setSmQuesLength:function(t,e,i){var s=+t.target.value;this.$emit("setSmQuesLength",{smQuesCount:s,_index:this._index,type:e,smTopicIndex:i||0})},setSmQuesScore:function(t){var e=t.index,i=t.smTopicIndex,s=t.score;this.$emit("setSmQuesScore",{_index:this._index,index:e,smTopicIndex:i,score:s,type:"topicSmQues"})},setSmQuesScore2:function(t){var e=t.index,i=t.smTopicIndex,s=t.score;this.$emit("setSmQuesScore",{_index:this._index,index:e,smTopicIndex:i,score:s,type:"smTopicSmQues"})},validateOptions:function(t){this.$emit("validateOptions",Object(c["a"])(Object(c["a"])({},t),{},{optionsCount:+this.optionsCount,score:+this.score,index:this._index}))}}},nt=st,ot=(i("4f0c"),Object(m["a"])(nt,K,z,!1,null,"687d15c9",null)),at=ot.exports,ct={data:function(){return{singleSelectDialogFields:{optionsCount:4,direction:0,defaultItem:{optionsCount:4,type:1,score:5,marktype:0}},moreSelectDialogFields:{optionsCount:4,direction:0,halfScore:2.5,defaultItem:{optionsCount:4,type:1,score:5,marktype:0,halfScore:2.5}},fillInBlankDialogFields:{columns:1,rowLineHeight:40,scoreStyle:"",defaultItem:{hasSmQuestion:!1,type:5,score:5,scores:5,marktype:0,smTopic:[],smQuestion:[]}},answerDialogFields:{isAddHalf:!1,scoreLimit:15,defaultItem:{hasSmQuestion:!1,type:7,score:5,scores:5,marktype:0,smTopic:[],smQuestion:[]}},compositionDialogFields:{isAddHalf:!1,scoreLimit:"",defaultItem:{type:7,score:5}},chooseAnswerDialogFields:{isAddHalf:!1,scoreLimit:"",defaultItem:{hasSmQuestion:!1,type:7,score:5,scores:5,marktype:0,smTopic:[],smQuestion:[]}}}}},lt={name:"App",props:{questionData:{type:Object,default:function(){var t=guid();return{modelId:t,questions:[{optionsCount:4,questionNo:1,score:5,type:1}],commonFields:{startNo:1,endNo:1,score:5,questionType:1,bigNo:"一",questionTypeTitle:""},dialogData:{optionsCount:4,direction:0,defaultItem:{optionsCount:4,type:1,score:5}}}}}},mixins:[ct],data:function(){var t=this.questionData,e=t.commonFields,i=t.dialogData,s=t.questionsDataKey,n=t.modelId,o=(t.questionType,t.markQuestionType),a=t.isAdd,c=t.subjectId,l=this.questionData.originQuestions;o=o||1;var u={label:et[o],value:o},r=l.length,h={label:SectionToChinese(r),value:r};return{modelId:n,questionEditStatus:!0,startNoForSubjectType:1,questionsDataKey:s,questions:l,commonFields:e,dialogData:i,questionTypeFiledMap:it,bigQuestionNos:[],questionTypes:[],defaultQuesType:u,selectOptions:[{label:"二",value:2},{label:"三",value:3},{label:"四",value:4}],defaultSelectOption:h,questionChangeType:-1,questionLength:l.length,isAdd:a,subjectId:c}},components:{SelectItem:C,TopicQuestionItem:at,SelectLayout:J,FillinblankLayout:E,AnswerLayout:F,SubjectSelect:b,CompositionItem:y},mounted:function(){this.calcBigNo(),this.calcQuesTypes(),this.bindPopHideEvent(),this.calcStartNoForSubjectType()},computed:{defaultBigQues:function(){return this.bigQuestionNos[0]||{}},isSelectType:function(){return[1,2,11].includes(this.commonFields.questionType)},isMoreSelectType:function(){return[2,11].includes(this.commonFields.questionType)},isFillInBlank:function(){return 5===this.commonFields.questionType},isAnswer:function(){return[7,17,"7c"].includes(this.commonFields.questionType)},isChooseAnswer:function(){return 17===this.commonFields.questionType},isComposition:function(){return"7c"===this.commonFields.questionType},hasSmQuestionTopic:function(){return[7,17,5].includes(this.commonFields.questionType)},isZongHe:function(){return[18,19].includes(this.subjectId)}},watch:{questionLength:{handler:function(t,e){var i=e||0,s=Math.abs(t-i);log("增加的题目数量",s),s&&(t>i?this.addQuestionItems(s):this.reduceQuestionItems(s))}},"commonFields.startNo":function(t,e){if(t!==e){var i=this.commonFields.endNo;if(this.isChooseAnswer){var s=+i-+e;i=+t+s}this.questionChangeType=1,log("当前endNo,".concat(i,",当前startNo").concat(t)),this.questionLength=i-+t+1,this.isChooseAnswer&&(this.commonFields.endNo=i)}},"commonFields.endNo":function(t,e){if(t!==e){var i=this.commonFields.startNo;this.questionChangeType=-1,log("当前endNo,".concat(t,",当前startNo").concat(i)),this.questionLength=+t-+i+1}}},methods:{bindPopHideEvent:function(){var t=this;window.addEventListener("click",(function(e){var i=e.target.className;if("hSelect"===i)t.hideSelectDialog(t.$children);else{var s=t.findParent(e.target,"hSelect");s||t.hideSelectDialog(t.$children)}}),!1)},hideSelectDialog:function(t){var e=this;t.forEach((function(t){t.$children.length&&e.hideSelectDialog(t.$children),"HSelect"===t.$options.name&&t.optionsShow&&t.changeOptionsShowStatus()}))},findParent:function(t,e){var i=!1,s=t.parentNode;while(s&&"BODY"!==s.tagName){if(s.className.includes("hSelect")){i=!0;break}s=s.parentNode}return i},calcBigNo:function(){for(var t=[],e=1;e<100;e++){var i=SectionToChinese(e);t.push({label:i,value:i})}this.bigQuestionNos=t},calcQuesTypes:function(){var t=[];Object.keys(et).forEach((function(e){var i="7c"===e;t.push({label:et[e],value:i?e:+e})})),this.questionTypes=t},changeBigNo:function(t){this.commonFields.bigNo=t.value},calcStartNoForSubjectType:function(){var t=this,e=1,i=JSON.parse(localStorage.getItem("buildQuestions"))||{};for(var s in i){if(!this.isAdd&&s===this.modelId)break;e+=i[s].questions.length}this.startNoForSubjectType=e,this.isAdd&&(this.commonFields.endNo=this.startNoForSubjectType,this.$nextTick((function(){t.commonFields.startNo=t.startNoForSubjectType})))},changeDialogData:function(){var t=this.questionTypeFiledMap[this.commonFields.questionType]+"DialogFields";this.dialogData=this.copyObj(this[t])},changeType:function(t){var e=this,i=this.commonFields;i.startNo,i.endNo;this.commonFields.questionType=t.value,this.changeDialogData(),this.questions.forEach((function(t,i){e.$set(e.questions,i,Object(c["a"])(Object(c["a"])({},e.copyObj(e.dialogData.defaultItem)),{},{questionNo:e.startNoForSubjectType+i,score:t.score}))})),this.commonFields.endNo=this.startNoForSubjectType+(this.isChooseAnswer?1:0),this.$nextTick((function(){e.commonFields.startNo=e.startNoForSubjectType})),log("changeType after data:",this.questions),this.isChooseAnswer&&(this.defaultSelectOption={label:"二",value:2})},changeChooseOption:function(t){var e=t.value;this.commonFields.endNo=this.commonFields.startNo+e-1},batchChangeFields:function(t){var e=this,i="score"===t,s=this[i?"commonFields":"dialogData"][t];s&&(this.questions.forEach((function(i,n){e.$set(e.questions,n,Object(c["a"])(Object(c["a"])({},i),{},Object(a["a"])({},t,+s)))})),console.log(this.questions))},changeOptionsCount:function(){var t=this;this.questions.forEach((function(e,i){t.$set(t.questions,i,Object(c["a"])(Object(c["a"])({},e),{},{optionsCount:+t.dialogData.optionsCount}))}))},addQuestionItems:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;if("number"===typeof t){var e=this.commonFields,i=e.score,s=e.startNo,n=e.endNo,o={};this.isSelectType&&(o={optionsCount:this.dialogData.optionsCount},this.isMoreSelectType&&(o.halfScore=this.dialogData.halfScore));for(var a=!~this.questionChangeType,l=(this.questions.length,t);l>0;l--)this.questions[a?"push":"unshift"](Object(c["a"])(Object(c["a"])({},this.copyObj(this.dialogData.defaultItem)),{},{score:+i,questionNo:a?+n-l+1:+s+l-1},o));log("---",this.questions)}else this.commonFields.endNo+=1},reduceQuestionItems:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;if("number"===typeof t){var e=this.questions.length;~this.questionChangeType?this.questions.splice(0,t):this.questions.splice(e-t,e)}else{if(1===this.questionLength)return;this.commonFields.endNo-=1}},changeDirection:function(t){this.dialogData.direction=t,this.$forceUpdate()},changeColumn:function(t){this.dialogData.columns=t.value},changeRowLineHeight:function(t){this.dialogData.rowLineHeight=t.value},changeSocreLimit:function(t){this.dialogData.scoreStyle=t.value},setSmQuesLength:function(t){var e=t.smQuesCount,i=t._index,s=t.type,n=t.smTopicIndex,o=this.questions[i],a=null;a="topicQues"===s?o:o.smTopic[n];var c=a.smQuestion.length;if(c!==e){var l=Math.abs(c-e);if(c>e)a.smQuestion.splice(e,c);else{for(var u,r=[],h=0;h<l;h++)r.push({score:1,symbolKey:tt()});(u=a.smQuestion).splice.apply(u,[c,0].concat(r))}}},changeSetSmQuesStatus:function(t){var e=t._index,i=t.status,s=t.index,n=t.type,o=this.questions[e],a=null,c="topicSmQues"===n;a=c?o:o.smTopic[s],i||(a.smQuestion=[]),a.hasSmQuestion=i,log(this.questions[e])},setSmQuesScore:function(t){var e=t._index,i=t.score,s=t.index,n=t.smTopicIndex,o=t.type,a=this.questions[e],c=null,l="topicSmQues"===o;c=l?a.smQuestion[s]:a.smTopic[n].smQuestion[s],c.score=i},addSmTopic:function(t){var e=this.questions[t];if(!e.smQuestion.length){var i=this.copyObj(this.dialogData.defaultItem);e.smTopic.push(Object(c["a"])(Object(c["a"])({},i),{},{alias:e.questionNo+"."+(e.smTopic.length+1)}))}},removeSmTopic:function(t,e){var i=this.questions[t];i.smTopic.splice(e,1),i.smTopic.forEach((function(t,e){t.alias=i.questionNo+"."+(e+1)}))},setHasHalfScore:function(t){this.dialogData.isAddHalf=t},changeScoreLimit:function(t){var e=t.value;this.dialogData.scoreLimit=e},changeSubject:function(t){var e=t.id,i=t._index,s=void 0===i?"all":i;if("all"!==s){var n=this.questions[s];n.smTopic&&n.smTopic.length?n.smTopic.forEach((function(t){t.marktype=e})):n.marktype=e}else this.questions.forEach((function(t){t.marktype=e}))},validateOptions:function(t){this.dialogData.optionsCount;var e=t.optionsCount,i=(t.score,t.halfScore),s=t.index,n=["score"];e&&n.push("optionsCount"),i&&n.push("halfScore"),this.questions.splice(s,1,Object(c["a"])({},t));for(var o=0,a=n;o<a.length;o++){var l=a[o],u=this.isSameOption(l);log("isSameField-".concat(l,",").concat(u));var r="score"===l;this[r?"commonFields":"dialogData"][l]=u?t[l]:""}},isSameOption:function(t){for(var e=!0,i=0,s=this.questions.length;i<s-1;i++)if(log("compareField-".concat(t,",prevvalue-").concat(this.questions[i][t],",nextvale-").concat(this.questions[i+1][t])),+this.questions[i][t]!==+this.questions[i+1][t]){e=!1;break}return e},hideSettingDialog:function(){document.getElementById("questionEdit").style.display="none",window.QE.questionEditStatus=!1},toRenderData:function(t){var e=[];return this.hasSmQuestionTopic?t.forEach((function(t){var i=t.alias,s=t.questionNo,n=t.scores,o=[];if(n){var a=n.split(",");a.forEach((function(t){o.push({score:t})}))}if(i&&s!=i){var l=e.find((function(t){return t.questionNo===s})),u={alias:i,hasSmQuestion:!1,score:1,smQuestion:o};l?l.smTopic.push(u):(l.smTopic=[u],e.push(l))}else e.push(Object(c["a"])(Object(c["a"])({},t),{},{smQuestion:o}))})):e=t,e},validateSubmit:function(){return!!this.commonFields.questionTypeTitle||(this.$tip("题型标题还没有填写~"),!1)},addQuestionsToOnlineCard:function(){var t=this.validateSubmit();if(t){log("submit dialogData",this.dialogData),log("submit commonFields",this.commonFields),log("submit questions",this.questions),this.submitDefaultItem={questionNum:1,questionTypeId:0,fullScore:0,optionCount:0,answer:"",marktype:"0",subject:"0",alias:"",scores:""};var e=[];e=this.hasSmQuestionTopic?this.formatSubmitDataForSmTopic():this.formatSubmitData();var i=this.formatBuildQuestions(e);this.setNewQuestions(i),this.isAdd?Print.appendSubject(i,this.modelId):Print.editSubject(i,this.modelId),this.hideSettingDialog()}},formatSubmitDataForSmTopic:function(){var t,e=this,i=[],s=this.commonFields.questionType,n=s;return this.questions.forEach((function(o){var a=o.questionNo;if(t=t||a,o.smTopic.length)o.smTopic.forEach((function(t,o){var l=t.alias,u=t.score,r=t.marktype,h="";t.smQuestion.length&&(h=t.smQuestion.map((function(t){return t.score})).join(",")),i.push(Object(c["a"])(Object(c["a"])({},e.submitDefaultItem),{},{questionTypeId:parseInt(s),questionNum:a+o,fullScore:u,scores:h,alias:l,markQuestionType:n,marktype:r}))}));else{var l=o.score,u=o.marktype,r="";o.smQuestion.length&&(r=o.smQuestion.map((function(t){return t.score})).join(","));var h=Object(c["a"])(Object(c["a"])({},e.submitDefaultItem),{},{questionTypeId:parseInt(s),questionNum:a,fullScore:l,scores:r,markQuestionType:n,marktype:u});e.isChooseAnswer&&(h.groupid=t),i.push(h)}})),i},formatSubmitData:function(){var t=this,e=this.commonFields.questionType,i=e;return this.questions.map((function(s){var n=s.questionNo,o=s.optionsCount,a=s.score,l=s.marktype;return Object(c["a"])(Object(c["a"])({},t.submitDefaultItem),{},{questionNum:n,optionCount:o,questionTypeId:parseInt(e),fullScore:a,markQuestionType:i,marktype:l})}))},formatBuildQuestions:function(t){var e=localStorage.getItem("buildQuestions")?JSON.parse(localStorage.getItem("buildQuestions")):{},i=this.commonFields,s=i.bigNo,n=i.questionTypeTitle,o=i.questionType,a=Object(c["a"])({questions:t,commonFields:this.commonFields,dialogData:this.dialogData,bigTitle:s+"、"+n,questionType:parseInt(o),markQuestionType:o,originQuestions:this.copyObj(this.questions),modelId:this.modelId},this.dialogData);return e[this.modelId]=a,e},setNewQuestions:function(t){Print.questionMap=t,log("setNewQuestions",t),localStorage.setItem("buildQuestions",JSON.stringify(t))}}},ut={mixins:[lt]},rt=ut,ht=(i("7c55"),Object(m["a"])(rt,n,o,!1,null,null,null)),dt=ht.exports,pt=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"h_checkBox"},[i("div",{staticClass:"h_checkItem",class:{checked:t.value}},[i("i"),i("em",[t._v("加入0.5分")]),i("input",{attrs:{type:"checkbox"},domProps:{value:t.value},on:{change:t.changeHandle}})])])},mt=[],ft={name:"HCheckbox",props:{value:Boolean},methods:{changeHandle:function(t){this.$emit("input",t.target.checked)}}},bt=ft,gt=(i("b69f"),Object(m["a"])(bt,pt,mt,!1,null,"18372a79",null)),vt=gt.exports,St=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"hInput",class:{disabled:t.disabled},style:"width:"+t.cwidth},[i("input",t._b({attrs:{type:"text",disabled:t.disabled},domProps:{value:t.value},on:{input:t.inputHandle,focus:t.focusFn,blur:t.blurFn}},"input",t.$attrs,!1)),t.icon?i("i",{class:t.icon}):t._e()])},yt=[],qt=(i("c975"),i("5319"),{name:"HInput",inheritAttrs:!1,props:{value:[String,Number],ctype:{type:String,default:"number"},disabled:{type:Boolean,default:!1},max:{type:Number,default:200},min:{type:Number,default:0},step:{type:Number,default:1},maxLength:Number,minLenth:Number,hwidth:{type:String,default:""},icon:{type:String,default:""}},mounted:function(){},computed:{cwidth:function(){return~this.hwidth.indexOf("px")||~this.hwidth.indexOf("%")?this.hwidth:this.hwidth+"px"}},data:function(){return{inputVal:this.value}},methods:{inputHandle:function(t){},focusFn:function(){this.$emit("focus")},blurFn:function(t){var e=t.target.value;"number"===this.ctype?(e=+e.replace(/[^0-9\.]/g,""),e=Math.round(e/this.step)*this.step,e>this.max&&this.max?t.target.value=this.max:e<this.min&&this.min?t.target.value=this.min:t.target.value=e):"text"===this.ctype&&(e=e.replace(/(^\s+)|(\s+$)/g,""),this.maxLength&&e.length>this.maxLength&&(t.target.value=e.substring(0,this.maxLength))),this.$emit("input",t.target.value),this.$emit("blur",t)}}}),_t=qt,xt=Object(m["a"])(_t,St,yt,!1,null,null,null),Tt=xt.exports,Ot=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("strong",{staticClass:"hgc_notice",on:{mouseover:t.showNoticeInfo,mouseout:t.hideNoticeInfo}}),i("i",{ref:"noticeContent_"+t.symbolId,staticClass:"noticeContent"},[t._v(t._s(t.msg)+" "),i("b",{ref:"noticeTriangle_"+t.symbolId})])])},Ct=[],wt={name:"HNotice",props:{msg:{type:String,default:"小问不需要单独设置模板区域但是每小问需批阅判分"}},data:function(){var t=this._symbol();return{symbolId:t}},methods:{showNoticeInfo:function(t){var e=t.target,i=this.$refs["noticeContent_"+this.symbolId],s=this.$refs["noticeTriangle_"+this.symbolId];i.style.display="block";var n=i.offsetHeight,o=i.offsetWidth,a=e.getBoundingClientRect(),c=a.top,l=a.left;i.style.top=c-n-10+"px",i.style.left=l-o/2+"px",s.style.top=c-10+"px",s.style.left=l+"px"},hideNoticeInfo:function(){var t=this.$refs["noticeContent_"+this.symbolId];t.style.display="none"}}},jt=wt,Nt=(i("ed8d"),Object(m["a"])(jt,Ot,Ct,!1,null,"12cf78dc",null)),Qt=Nt.exports,It=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"h_radioBox"},[i("div",{staticClass:"h_radioItem",class:{checked:!t.value},on:{click:function(e){return t.selRadio(0)}}},[i("i"),i("em",[t._v("横向")])]),i("div",{staticClass:"h_radioItem",class:{checked:1===t.value},on:{click:function(e){return t.selRadio(1)}}},[i("i"),i("em",[t._v("纵向")])])])},Ft=[],kt={name:"HRadio",props:{value:Number},methods:{selRadio:function(t){this.$emit("changeDirection",t)}}},Dt=kt,$t=Object(m["a"])(Dt,It,Ft,!1,null,null,null),Lt=$t.exports,Ht=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"hSelect",style:"width:"+t.cwidth,on:{click:t.changeOptionsShowStatus}},[i("h-input",{attrs:{value:t.selectedValue,icon:t.iconClass,readonly:"",placeholder:t.placeholder}}),i("transition",{attrs:{name:"slide-fade"}},[i("ul",{directives:[{name:"show",rawName:"v-show",value:t.optionsShow,expression:"optionsShow"}],staticClass:"optionList"},t._l(t.options,(function(e){return i("li",{key:e.label,staticClass:"optionItem",on:{click:function(i){return i.stopPropagation(),t.selectCurrent(e)}}},[t._v(t._s(e.label))])})),0)])],1)},Et=[],Mt={name:"HSelect",props:{placeholder:String,defaultOption:{type:Object,default:function(){return{}}},immediate:{type:Boolean,default:!0},options:{type:Array,default:function(){return[]}},hwidth:{type:String,default:"100%"}},computed:{cwidth:function(){return~this.hwidth.indexOf("px")||~this.hwidth.indexOf("%")?this.hwidth:this.hwidth+"px"},selectedValue:function(){return this.selectedItem.label||""}},data:function(){return{optionsShow:!1,iconClass:"down",selectedItem:this.defaultOption}},mounted:function(){Object.keys(this.defaultOption).length&&this.immediate&&(this.selectedItem=this.defaultOption,this.$emit("changeOption",this.selectedItem))},watch:{defaultOption:function(t,e){Object.keys(t).length&&(this.selectedItem=t,this.$emit("changeOption",this.selectedItem))}},methods:{changeOptionsShowStatus:function(){this.optionsShow=!this.optionsShow,this.iconClass=this.optionsShow?"up":"down"},selectCurrent:function(t){this.selectedItem=t,this.$emit("changeOption",t),this.changeOptionsShowStatus()}}},At=Mt,Bt=Object(m["a"])(At,Ht,Et,!1,null,null,null),Rt=Bt.exports,Pt=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"h_switch",class:{open:t.status},on:{click:t.changeStatus}})},Jt=[],Kt={name:"HSwitch",props:{checked:{type:Boolean,default:!1},_index:{type:Number,default:0}},data:function(){return{status:this.checked}},methods:{changeStatus:function(){this.status=!this.status,this.$emit("changeStatus",{status:this.status,index:this._index})}}},zt=Kt,Zt=Object(m["a"])(zt,Pt,Jt,!1,null,null,null),Ut=Zt.exports,Vt={HInput:Tt,HSelect:Rt,HRadio:Lt,HCheck:vt,HSwitch:Ut,HNotice:Qt};for(var Wt in Vt)s["a"].component(Vt[Wt].name,Vt[Wt]);s["a"].config.productionTip=!1,s["a"].prototype.copyObj=X,s["a"].prototype.subjectId=19,s["a"].prototype._symbol=tt,s["a"].prototype.$tip=hgc_layer.msg.bind(hgc_layer),window.log=function(){},window.defaultQuestionData={modelId:guid(),questions:[{optionsCount:4,questionNo:1,score:5,type:1}],originQuestions:[{optionsCount:4,questionNo:1,score:5,type:1}],commonFields:{startNo:1,endNo:1,score:5,questionType:1,bigNo:"一",questionTypeTitle:""},questionType:1,dialogData:{optionsCount:4,direction:0,defaultItem:{optionsCount:4,type:1,score:5}}},window.QE=new s["a"]({el:"#questionEdit",components:{App:dt},data:function(){var t=this.copyObj(defaultQuestionData);return{questionEditStatus:!1,questionData:t}}})},"5ceb":function(t,e,i){"use strict";var s=i("e1ae"),n=i.n(s);n.a},"79d2":function(t,e,i){},"7c55":function(t,e,i){"use strict";var s=i("2395"),n=i.n(s);n.a},ace4:function(t,e,i){"use strict";var s=i("3223"),n=i.n(s);n.a},b69f:function(t,e,i){"use strict";var s=i("79d2"),n=i.n(s);n.a},e1ae:function(t,e,i){},ed8d:function(t,e,i){"use strict";var s=i("1051"),n=i.n(s);n.a}});
- //# sourceMappingURL=app.ae517b1b.js.map
|