12 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4843abff"],{"0cbb":function(t,e,i){},"1da2":function(t,e,i){"use strict";i("8d30")},2254:function(t,e,i){},"3ce2":function(t,e,i){},"4aa2":function(t,e,i){},"617f":function(t,e,i){"use strict";i("0cbb")},"7c16":function(t,e,i){"use strict";i("3ce2")},8643:function(t,e,i){"use strict";i("bc1c")},"8abe":function(t,e,i){},"8d30":function(t,e,i){},9357:function(t,e,i){},adfe:function(t,e,i){"use strict";i("9357")},b331:function(t,e,i){"use strict";i("8abe")},bc1c:function(t,e,i){},c80f:function(t,e,i){"use strict";i.r(e);var s=function(){var t=this,e=t._self._c;return e("div",{staticClass:"question-bank"},[e("div",{staticClass:"top"},[e("div",{staticClass:"top-left flex-items"},[e("a-icon",{staticClass:"subject-icon",attrs:{type:"menu-fold"},on:{click:t.handleShowSubjectSelect}}),[e("span",{staticClass:"subject-title only-line-1"},[e("a",{attrs:{href:"#"},on:{click:t.handleShowSubjectSelect}},[t._v(t._s(t.activeSubject.educationCategory)+t._s(t.activeSubject.name))])]),e("div",{staticClass:"subject-select-box",class:{"subject-select-box-show":t.isShowSubjectSelect},on:{mouseleave:function(e){t.isShowSubjectSelect=!1}}},[e("div",{staticClass:"type-group"},[t.activeSubject.id?e("MultiListSelect",{attrs:{data:t.$store.state.baseInfo.SubjectsArr,needAll:!1,defaultSelect:[t.activeSubject.id]},on:{callBack:t.subjectCallBack}}):t._e()],1)])]],2),e("div",{staticClass:"top-right flex-align"},[e("div",[e("a-button",{staticClass:"m-r8",attrs:{disabled:!t.ChapterId&&0==t.KnowledgePointIdList.length},on:{click:t.QuestionImport}},[t._v("试题导入")]),e("a-button",{staticClass:"m-r8",attrs:{loading:t.templateLoading,disabled:!t.activeSubject.id,type:"primary"},on:{click:t.GetQuestionTemplate}},[t._v(" 获取下载模板")]),e("a-button",{attrs:{type:"primary"},on:{click:function(e){return t.toPath("intelligencePaper")}}},[t._v("智能组题")])],1),e("a-input-search",{staticStyle:{width:"400px"},attrs:{placeholder:"搜索题干","enter-button":""},on:{search:t.onSearch}})],1)]),e("div",{staticClass:"main"},[e("div",{staticClass:"main-left"},[e("a-tabs",{attrs:{"default-active-key":"1"},on:{change:t.callback}},[e("a-tab-pane",{key:"1",attrs:{tab:"章节"}},[e("ChapterTree",{ref:"ChapterTree",attrs:{activeSubject:t.activeSubject},on:{getQuestion:t.getQuestion,clearPoints:t.clearPoints}})],1),e("a-tab-pane",{key:"2",attrs:{tab:"知识点","force-render":""}},[e("PointsTree",{ref:"PointsTree",attrs:{activeSubject:t.activeSubject},on:{getQuestion:t.getQuestion,clearChapter:t.clearChapter}})],1)],1)],1),e("div",{staticClass:"main-right"},[e("div",{staticClass:"question-list"},[e("myListSelect",{attrs:{title:"试题难度",data:t.difficultyList,defaultSelect:t.activeDifficulty,replaceFields:t.replaceFields},on:{callBack:t.difficultyCallBack},model:{value:t.activeDifficulty,callback:function(e){t.activeDifficulty=e},expression:"activeDifficulty"}}),e("myListSelect",{attrs:{title:"试题题型",data:t.questionTypeList,defaultSelect:t.activeQuestionType},on:{callBack:t.questionTypeCallBack},model:{value:t.activeQuestionType,callback:function(e){t.activeQuestionType=e},expression:"activeQuestionType"}}),e("a-spin",{attrs:{spinning:t.spinning}},[[t._l(t.questionData,(function(i,s){return t.questionData.length>0?e("div",{key:i.id,staticClass:"question-item m16"},[e("QuestionItem",{ref:"QuestionItem"+s,refInFor:!0,attrs:{data:i},scopedSlots:t._u([{key:"default",fn:function(a){return[e("div",{staticClass:"flex-align bordr-bottom-gray p-8"},[e("div",[e("span",{staticClass:"m-r36"},[t._v("题型:"+t._s(i.disciplineQuestionType))]),e("span",{staticClass:"m-r36"},[t._v("难度:"+t._s(i.difficulty))])]),e("div",{staticClass:"flex"},[0!=i.questionConvertState?e("span",[e("a-icon",{staticClass:"blue-hover m-r8",attrs:{type:"undo"},on:{click:t._QuestionGetList}})],1):t._e(),0!=i.questionConvertState?[e("a-tooltip",[i.questionConvertState>1?e("template",{slot:"title"},[t._v(" "+t._s(i.convertFailMessage)+" ")]):t._e(),e("div",{staticClass:"flex m-r8",staticStyle:{display:"block"}},[e("span",[t._v("替换状态:")]),1==i.questionConvertState?e("span",{staticStyle:{color:"orange"}},[t._v("转换中")]):t._e(),2==i.questionConvertState?e("span",{staticStyle:{color:"red"}},[t._v("转换失败")]):t._e(),3==i.questionConvertState?e("span",{staticStyle:{color:"red"}},[t._v("解析替换失败")]):t._e()])],2)]:t._e(),e("a-upload",{attrs:{showUploadList:!1,customRequest:e=>t.customRequest(e,i.id,s)}},[e("a",{staticClass:"m-r16"},[t._v("上传替换")])]),e("a",{staticClass:"m-r16",on:{click:function(e){return t.questionDown(i)}}},[t._v("下载")]),e("a",{staticClass:"m-r16",on:{click:function(e){return t.toEdit(i,s)}}},[t._v("纠错")]),e("a",{staticClass:"m-r16",on:{click:function(e){return t.toggle(s)}}},[t._v("详情")]),e("a",{directives:[{name:"show",rawName:"v-show",value:!i.inbox,expression:"!item.inbox"}],staticClass:"m-r16",on:{click:function(e){return t.addToTest(i)}}},[t._v("加入试卷")]),e("a",{directives:[{name:"show",rawName:"v-show",value:i.inbox,expression:"item.inbox"}],staticClass:"m-r16",on:{click:function(e){return t.delFromTest(i)}}},[t._v("移出试卷")])],2)])]}}],null,!0)})],1):t._e()})),0===t.questionData.length?e("a-empty"):t._e()]],2),e("div",{staticClass:"paging-box"},[e("oPagination",{attrs:{pagination:t.pagination},on:{change:t.handleChange}})],1)],1)])]),e("QuestionImport",{ref:"QuestionImport"}),e("div",{staticClass:"basket",on:{click:t.showDrawer}},[e("div",{staticClass:"basket-inner"},[t.$store.state.storage.testBox.length>0?e("div",{staticClass:"basket-dot"},[t._v(t._s(t.dotNum))]):t._e(),t._v(" 试题篮 ")])]),e("TestBasket",{ref:"TestBasket"})],1)},a=[],n=(i("14d9"),i("d58c")),o=function(){var t=this,e=t._self._c;return e("div",[e("div",{staticClass:"edition"},[e("div",{staticClass:"flex-align",on:{click:t.handleShowDropdown}},[e("span",{staticClass:"edition-name only-line-1"},[t._v(t._s(t.activeBookVersion.name))]),e("span",[e("a-icon",{staticClass:"edition-icon",attrs:{type:t.iconCaret}})],1)]),e("div",{staticClass:"drop-down",class:{"drop-down-show":t.isShowDropdown},on:{mouseleave:t.hideSropdown}},[e("div",{staticClass:"drop-down-content"},t._l(t.bookVersions,(function(i,s){return e("div",{key:s,class:["drop-down-item",{"active-btn":i.id==t.activeKey}],on:{click:function(e){return t.editionClick(i)}}},[t._v(t._s(i.name))])})),0)])]),e("div",{staticClass:"tree-box"},[e("a-spin",{attrs:{spinning:t.spinning}},[t.treeData.length>0?e("a-tree",{attrs:{treeData:t.treeData,"load-data":t.onLoadData,"replace-fields":t.replaceFields,selectedKeys:[t.ChapterId]},on:{select:t.onSelect},scopedSlots:t._u([{key:"custom",fn:function(i){return[e("div",{staticClass:"custom-box"},[e("a-tooltip",{attrs:{overlayClassName:"custom-title",placement:"top",title:i.title,"get-popup-container":t.getPopupContainer}},[e("span",[t._v(t._s(t.fontSplice(i.title)))])]),e("span",{staticClass:"toolbar"},[e("a-popover",{attrs:{placement:"right"}},[e("template",{slot:"content"},[e("div",{staticClass:"blue-hover",staticStyle:{"margin-bottom":"8px"},on:{click:function(e){return t.showModal("add",i)}}},[e("a-icon",{staticStyle:{"margin-right":"8px"},attrs:{type:"plus"}}),t._v("添加目录 ")],1),e("div",{staticClass:"blue-hover",staticStyle:{"margin-bottom":"8px"},on:{click:function(e){return t.showModal("edit",i)}}},[e("a-icon",{staticStyle:{"margin-right":"8px"},attrs:{type:"form"}}),t._v("修改名称 ")],1),e("div",{staticClass:"blue-hover",on:{click:function(e){return t._ChapterDelete(i)}}},[e("a-icon",{staticStyle:{"margin-right":"8px"},attrs:{type:"close"}}),t._v("删除目录 ")],1)]),e("a-icon",{staticClass:"blue-hover tool-icon",attrs:{type:"ellipsis"}})],2)],1)],1)]}}],null,!1,3787476803)}):e("a-empty")],1)],1),e("EditChapterMenus",{ref:"EditChapterMenus"})],1)},l=[],c=i("4ec3"),r=function(){var t=this,e=t._self._c;return e("div",[e("a-modal",{attrs:{visible:t.visible,confirmLoading:t.confirmLoading,width:"700px",maskClosable:!1,destroyOnClose:!0,width:900},on:{ok:t.handOK,cancel:t.handCancle}},[e("div",{attrs:{slot:"title"},slot:"title"},[t._v(" "+t._s("add"===t.type?"创建子":"edit"===t.type&&"编辑")+"章节 ")]),e("div",{staticClass:"modal-box"},[e("a-spin",{attrs:{spinning:t.spinning}},[e("a-form",{attrs:{form:t.form,layout:"horizontal"},on:{submit:t.handOK}},[e("a-form-item",{attrs:{label:"目录名称:","label-col":{span:3},"wrapper-col":{span:20}}},[e("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["name",{rules:[{required:!0,message:"此项为必填!"}],initialValue:"edit"==t.type?t.record.name:""}],expression:"[\n 'name',\n {rules: [{ required: true, message: '此项为必填!' },\n ],initialValue:type=='edit'?record.name:''}\n ]"}],attrs:{placeholder:"请输入"}})],1),e("a-form-item",{attrs:{label:"备注:","label-col":{span:3},"wrapper-col":{span:20}}},[e("Editor",{model:{value:t.detail,callback:function(e){t.detail=e},expression:"detail"}})],1)],1)],1)],1)])],1)},d=[],h=i("ceb0"),p={components:{Editor:h["a"]},data(){return{confirmLoading:!1,spinning:!1,visible:!1,form:this.$form.createForm(this),type:"",record:{},detail:""}},mounted(){},methods:{showModal(t,e){if("edit"===t){this.spinning=!0;let t={id:e.id};Object(c["g"])(t).then(t=>{console.log(t,"详情"),this.spinning=!1,this.detail=t.remark}).catch(t=>{this.spinning=!1})}console.log(e,"record"),this.record=e,this.visible=!0,this.type=t},handOK(t){t.preventDefault(),this.form.validateFields((t,e)=>{if(!t){if(this.confirmLoading=!0,"add"===this.type){let t={...e,remark:this.detail,textBookId:this.$parent.activeBookVersion.id,parentId:this.record.id};Object(c["c"])(t).then(t=>{this.$message.success("创建成功!"),this.confirmLoading=!1,console.log(this.record,"this.record55555"),this.$parent.loadChild(this.record),this.handCancle()}).catch(t=>{this.confirmLoading=!1})}if("edit"===this.type){let t={...e,remark:this.detail},i={id:this.record.id};Object(c["i"])(t,i).then(t=>{this.$message.success("修改成功!"),this.confirmLoading=!1,this.record.dataRef.title=e.name,this.record.dataRef.name=e.name,this.handCancle()}).catch(t=>{this.confirmLoading=!1})}}})},handCancle(){this.visible=!1,this.record={},this.detail=""}}},u=p,g=(i("adfe"),i("2877")),m=Object(g["a"])(u,r,d,!1,null,"4172a407",null),f=m.exports,v=i("b893"),b={components:{EditChapterMenus:f},props:["activeSubject"],data(){return{spinning:!1,replaceFields:{key:"id",title:"name"},activeKey:"",treeData:[],bookVersions:[],activeBookVersion:{},ChapterId:"",isShowDropdown:!1,iconCaret:"caret-right"}},watch:{activeSubject(t){console.log(t,"66666"),this.bookVersions=[],this.activeBookVersion={},this._TextbookGetList(),this.$emit("getQuestion")},activeBookVersion(t){console.log(t),this._ChapterGetList()}},created(){},mounted(){},methods:{getPopupContainer(t){return t.parentElement},fontSplice(t){return t.length>10?t.slice(0,10)+"...":t},clearChapter(){this.ChapterId&&(console.log("章节清了"),this.ChapterId="")},_ChapterDelete(t){console.log(t,"record");let e=this;this.$confirm({okText:"确认",cancelText:"取消",mask:!1,title:`您确认要删除"${t.name}"章节吗?`,onOk(){console.log(t.id,"record.id"),console.log(e.ChapterId,"ChapterId"),e.spinning=!0;let i={id:t.id};Object(c["e"])(i).then(i=>{console.log(t.dataRef,"record.dataRef"),console.log(e.treeData,"_this.treeData"),Object(v["i"])(t.dataRef,e.treeData),e.treeData=[...e.treeData],e.$message.success("删除成功!"),t.id===e.ChapterId&&e.$emit("getQuestion"),e.spinning=!1}).catch(t=>{e.spinning=!1})}})},showModal(t,e={}){this.$refs.EditChapterMenus.showModal(t,e)},onLoadData(t){return console.log(t,"treeNode"),new Promise(e=>{if(t.dataRef.children)return void e();this.spinning=!0;let i={ParentId:t.dataRef.id,TextbookId:this.activeBookVersion.id,KeyWord:"",SkipCount:0,MaxResultCount:99999};Object(c["h"])(i).then(i=>{t.dataRef.children=i.items.map(t=>{t.hasChild||(t.isLeaf=!0);let e={key:t.id,title:t.name,scopedSlots:{title:"custom"},...t};return e}),this.treeData=[...this.treeData],this.spinning=!1,e()}).catch(t=>{this.spinning=!1})})},_ChapterGetList(){this.spinning=!0;let t={ParentId:"",TextbookId:this.activeBookVersion.id,KeyWord:"",SkipCount:0,MaxResultCount:99999};Object(c["h"])(t).then(t=>{console.log(t,"章节树"),this.treeData=t.items.map(t=>{t.hasChild||(t.isLeaf=!0);let e={key:t.id,title:t.name,scopedSlots:{title:"custom"},...t};return e}),this.spinning=!1,console.log(this.treeData,"this.treeData ")}).catch(t=>{this.spinning=!1})},loadChild(t){console.log(t,"record66666"),this.spinning=!0;let e={ParentId:t.id||"",TextbookId:this.activeBookVersion.id,KeyWord:"",SkipCount:0,MaxResultCount:99999};Object(c["h"])(e).then(e=>{console.log(e,"子节点66"),e.totalCount>0&&(t.dataRef.isLeaf=!1),t.dataRef.children=e.items.map(t=>{t.hasChild||(t.isLeaf=!0);let e={key:t.id,title:t.name,scopedSlots:{title:"custom"},...t};return e}),this.treeData=[...this.treeData],console.log(this.treeData,"treeData"),this.spinning=!1}).catch(t=>{this.spinning=!1})},_TextbookGetList(){if(!this.activeSubject.id)return;let t={DisciplineId:this.activeSubject.id,IsActive:!0,SkipCount:0,MaxResultCount:99999};Object(c["Ob"])(t).then(t=>{console.log(t,"学科下的教材版本"),this.bookVersions=t.items,!this.activeBookVersion.id&&t.items.length>0&&(console.log("进这了",t.items[0]),this.activeBookVersion=t.items[0],this.activeKey=t.items[0].id,this._ChapterGetList())})},editionClick(t){console.log(t,"activeBookVersion"),this.activeKey=t.id,this.activeBookVersion=t,this.hideSropdown()},onSelect(t){console.log(t,"selectedKeys");let e={ChapterId:t[0]||""};this.ChapterId=e.ChapterId,this.$emit("getQuestion",e),this.$emit("clearPoints")},handleShowDropdown(t){t.preventDefault(),this.isShowDropdown=!this.isShowDropdown,this.isShowDropdown?this.iconCaret="caret-down":this.iconCaret="caret-right"},hideSropdown(){this.isShowDropdown=!1,this.iconCaret="caret-right"}}},y=b,C=(i("8643"),Object(g["a"])(y,o,l,!1,null,"4319d7d8",null)),S=C.exports,x=function(){var t=this,e=t._self._c;return e("div",[e("div",{staticClass:"tree-box"},[e("a-spin",{attrs:{spinning:t.spinning}},[t.treeData.length>0?e("a-tree",{attrs:{treeData:t.treeData,"load-data":t.onLoadData,"replace-fields":t.replaceFields,selectedKeys:t.KnowledgePointIdList},on:{select:t.onSelect},scopedSlots:t._u([{key:"custom",fn:function(i){return[e("div",{staticClass:"custom-box"},[e("a-tooltip",{attrs:{overlayClassName:"custom-title",placement:"top",title:i.title,"get-popup-container":t.getPopupContainer}},[e("span",[t._v(t._s(t.fontSplice(i.title)))])]),e("span",{staticClass:"toolbar"},[e("a-popover",{attrs:{placement:"right"}},[e("template",{slot:"content"},[e("div",{staticClass:"blue-hover",staticStyle:{"margin-bottom":"8px"},on:{click:function(e){return t.showModal("add",i)}}},[e("a-icon",{staticStyle:{"margin-right":"8px"},attrs:{type:"plus"}}),t._v("添加目录 ")],1),e("div",{staticClass:"blue-hover",staticStyle:{"margin-bottom":"8px"},on:{click:function(e){return t.showModal("edit",i)}}},[e("a-icon",{staticStyle:{"margin-right":"8px"},attrs:{type:"form"}}),t._v("修改名称 ")],1),e("div",{staticClass:"blue-hover",on:{click:function(e){return t._KnowledgePointGetDelete(i)}}},[e("a-icon",{staticStyle:{"margin-right":"8px"},attrs:{type:"close"}}),t._v("删除目录 ")],1)]),e("a-icon",{staticClass:"blue-hover tool-icon",attrs:{type:"ellipsis"}})],2)],1)],1)]}}],null,!1,3241740690)}):e("a-empty")],1)],1),e("EditPointsMenus",{ref:"EditPointsMenus"})],1)},_=[],k=function(){var t=this,e=t._self._c;return e("div",[e("a-modal",{attrs:{visible:t.visible,confirmLoading:t.confirmLoading,width:"700px",maskClosable:!1,destroyOnClose:!0,width:900},on:{ok:t.handOK,cancel:t.handCancle}},[e("div",{attrs:{slot:"title"},slot:"title"},[t._v(" "+t._s("add"===t.type?"创建子":"edit"===t.type&&"编辑")+"知识点 ")]),e("div",{staticClass:"modal-box"},[e("a-spin",{attrs:{spinning:t.spinning}},[e("a-form",{attrs:{form:t.form,layout:"horizontal"},on:{submit:t.handOK}},[e("a-form-item",{attrs:{label:"目录名称:","label-col":{span:3},"wrapper-col":{span:20}}},[e("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["name",{rules:[{required:!0,message:"此项为必填!"}],initialValue:"edit"==t.type?t.record.name:""}],expression:"[\n 'name',\n {rules: [{ required: true, message: '此项为必填!' },\n ],initialValue:type=='edit'?record.name:''}\n ]"}],attrs:{placeholder:"请输入"}})],1)],1)],1)],1)])],1)},w=[],I={components:{Editor:h["a"]},data(){return{confirmLoading:!1,spinning:!1,visible:!1,form:this.$form.createForm(this),type:"",record:{},detail:""}},mounted(){},methods:{showModal(t,e){console.log(e,"record"),this.record=e,this.visible=!0,this.type=t},handOK(t){t.preventDefault(),this.form.validateFields((t,e)=>{if(!t){if(this.confirmLoading=!0,"add"===this.type){let t={...e,disciplineId:this.$parent.activeSubject.id,parentId:this.record.id};Object(c["S"])(t).then(t=>{this.$message.success("创建成功!"),this.confirmLoading=!1,console.log(this.record,"this.record55555"),this.$parent.loadChild(this.record),this.handCancle()}).catch(t=>{this.confirmLoading=!1})}if("edit"===this.type){let t={...e},i={id:this.record.id};Object(c["V"])(t,i).then(t=>{this.$message.success("修改成功!"),this.confirmLoading=!1,this.record.dataRef.title=e.name,this.record.dataRef.name=e.name,this.handCancle()}).catch(t=>{this.confirmLoading=!1})}}})},handCancle(){console.log("添加了进这了"),this.visible=!1,this.record={},this.detail=""}}},L=I,D=(i("e7be"),Object(g["a"])(L,k,w,!1,null,"7d2ca5b4",null)),$=D.exports,j={props:["activeSubject"],components:{EditPointsMenus:$},data(){return{replaceFields:{key:"id",title:"name"},spinning:!1,treeData:[],KnowledgePointIdList:[]}},watch:{activeSubject(t){console.log(t,"66666"),this._KnowledgePointGetList()}},mounted(){},methods:{getPopupContainer(t){return t.parentElement},fontSplice(t){return t.length>10?t.slice(0,10)+"...":t},clearPoints(){0!=this.KnowledgePointIdList.length&&(console.log("知识点清了"),this.KnowledgePointIdList=[])},_KnowledgePointGetDelete(t){console.log(t,"record");let e=this;this.$confirm({okText:"确认",cancelText:"取消",mask:!1,title:`您确认要删除"${t.name}"知识点吗?`,onOk(){console.log(t.id,"record.id"),console.log(e.KnowledgePointIdList,"KnowledgePointIdList"),e.spinning=!0;let i={id:t.id};Object(c["T"])(i).then(i=>{console.log(t.dataRef,"record.dataRef"),console.log(e.treeData,"_this.treeData"),Object(v["i"])(t.dataRef,e.treeData),e.treeData=[...e.treeData],e.$message.success("删除成功!");let s=e.KnowledgePointIdList.indexOf(t.id);if(s>-1){e.KnowledgePointIdList.splice(s,1);let t={KnowledgePointIdList:e.KnowledgePointIdList};e.$emit("getQuestion",t)}e.spinning=!1}).catch(t=>{e.spinning=!1})}})},showModal(t,e={}){this.$refs.EditPointsMenus.showModal(t,e)},_KnowledgePointGetList(){this.spinning=!0;let t={ParentId:"",DisciplineId:this.activeSubject.id,KeyWord:"",SkipCount:0,MaxResultCount:99999};Object(c["U"])(t).then(t=>{console.log(t,"知识点章节树"),this.treeData=t.items.map(t=>{t.hasChild||(t.isLeaf=!0);let e={key:t.id,title:t.name,scopedSlots:{title:"custom"},...t};return e}),this.spinning=!1,console.log(this.treeData,"this.treeData ")}).catch(t=>{this.spinning=!1})},onLoadData(t){return console.log(t,"treeNode"),new Promise(e=>{if(t.dataRef.children)return void e();this.spinning=!0;let i={ParentId:t.dataRef.id,DisciplineId:this.activeSubject.id,KeyWord:"",SkipCount:0,MaxResultCount:99999};Object(c["U"])(i).then(i=>{t.dataRef.children=i.items.map(t=>{t.hasChild||(t.isLeaf=!0);let e={key:t.id,title:t.name,scopedSlots:{title:"custom"},...t};return e}),this.treeData=[...this.treeData],this.spinning=!1,e()}).catch(t=>{this.spinning=!1})})},loadChild(t){console.log(t,"record66666"),this.spinning=!0;let e={ParentId:t.id||"",DisciplineId:this.activeSubject.id,KeyWord:"",SkipCount:0,MaxResultCount:99999};Object(c["U"])(e).then(e=>{console.log(e,"子节点66"),e.totalCount>0&&(t.dataRef.isLeaf=!1),t.dataRef.children=e.items.map(t=>{t.hasChild||(t.isLeaf=!0);let e={key:t.id,title:t.name,scopedSlots:{title:"custom"},...t};return e}),this.treeData=[...this.treeData],console.log(this.treeData,"treeData"),this.spinning=!1}).catch(t=>{this.spinning=!1})},onSelect(t){console.log(t,"selectedKeys");let e={KnowledgePointIdList:t};this.KnowledgePointIdList=e.KnowledgePointIdList,this.$emit("getQuestion",e),this.$emit("clearChapter")}}},K=j,T=(i("b331"),Object(g["a"])(K,x,_,!1,null,"23a23943",null)),O=T.exports,P=function(){var t=this,e=t._self._c;return e("div",{staticClass:"type-group"},[e("div",{staticClass:"type-item"},[e("div",{staticClass:"type-name"},[t._v(t._s(t.title)+":")]),e("div",{staticClass:"type-list"},[t.data.length>0?[t.needAll?e("div",{class:{"type-list-item":!0,"item-active":t.selectedKeys.indexOf("")>-1},on:{click:function(e){return t.allSelect("")}}},[t._v(" 全部 ")]):t._e(),t._l(t.data,(function(i,s){return e("div",{key:s,class:{"type-list-item":!0,"item-active":t.selectedKeys.indexOf(i.id)>-1},on:{click:function(e){return t.itemClick(i.id)}}},[t._v(" "+t._s(i.name)+" ")])}))]:t._e(),0==t.data.length?[e("span",{staticStyle:{"margin-left":"16px"}},[t._v(" 无 ")])]:t._e()],2)])])},Q=[],B={props:{value:{default:""},title:{type:String,default:"title"},data:{type:Array,default:()=>[]},type:{type:String,default:"1"},defaultSelect:{type:Array,default:()=>[]},needAll:{type:Boolean,default:!0},replaceFields:{type:Array,default:()=>[]}},data(){return{selectedKeys:[...this.defaultSelect]}},watch:{value:{handler(t,e){console.log(t,"改变了"),this.selectedKeys=t},deep:!0},data(t){console.log(t,"nVal题型"),this.replaceFields.length>0&&(this.data=Object(v["a"])(t,this.replaceFields))}},mounted(){},methods:{sendData(){let t=JSON.parse(JSON.stringify(this.selectedKeys));this.$emit("input",this.selectedKeys),this.$emit("callBack",t)},allSelect(t){this.selectedKeys=[t],this.sendData()},itemClick(t){let e=this.selectedKeys.indexOf("");if(e>-1&&this.selectedKeys.splice(e,1),1==this.type)this.selectedKeys.pop(),this.selectedKeys.push(t);else{let e=this.selectedKeys.indexOf(t);e>-1?this.selectedKeys.splice(e,1):this.selectedKeys.push(t),0===this.selectedKeys.length&&(this.selectedKeys=[""])}this.sendData()}}},q=B,M=(i("1da2"),Object(g["a"])(q,P,Q,!1,null,"65cc9d27",null)),R=M.exports,G=function(){var t=this,e=t._self._c;return e("div",{staticClass:"type-group"},t._l(t.data,(function(i){return e("div",{staticClass:"type-item"},[e("div",{staticClass:"type-name"},[t._v(t._s(i.title)+":")]),e("div",{staticClass:"type-list"},[i.data.length>0?[t.needAll?e("div",{class:{"type-list-item":!0,"item-active":t.selectedKeys.indexOf("")>-1},on:{click:function(e){return t.allSelect("")}}},[t._v(" 全部 ")]):t._e(),t._l(i.data,(function(s,a){return e("div",{key:a,class:{"type-list-item":!0,"item-active":t.selectedKeys.indexOf(s.id)>-1},on:{click:function(e){return t.itemClick(s.id,i,s)}}},[t._v(" "+t._s(s.name)+" ")])}))]:t._e(),0==i.data.length?[e("span",{staticStyle:{"margin-left":"16px"}},[t._v(" 无 ")])]:t._e()],2)])})),0)},V=[],N={props:{data:{type:Array,default:()=>[]},type:{type:String,default:"1"},defaultSelect:{type:Array,default:()=>[]},needAll:{type:Boolean,default:!0}},data(){return{selectedKeys:[...this.defaultSelect]}},methods:{sendData(t){let e=JSON.parse(JSON.stringify(t));this.$emit("callBack",e)},allSelect(t){this.selectedKeys=[t],this.sendData()},itemClick(t,e,i){console.log(e),console.log(i);let s=this.selectedKeys.indexOf("");if(s>-1&&this.selectedKeys.splice(s,1),1==this.type)this.selectedKeys.pop(),this.selectedKeys.push(t);else{let e=this.selectedKeys.indexOf(t);e>-1?this.selectedKeys.splice(e,1):this.selectedKeys.push(t)}this.sendData(i),console.log(this.selectedKeys,"selectedKeys")}}},z=N,F=(i("7c16"),Object(g["a"])(z,G,V,!1,null,"6ab36d9b",null)),E=F.exports,A=function(){var t=this,e=t._self._c;return e("div",[e("a-modal",{attrs:{title:"试题导入",visible:t.visible,confirmLoading:t.confirmLoading,width:"700px",maskClosable:!1,width:900},on:{ok:t.handleOk,cancel:t.handleCancel}},[e("template",{slot:"footer"},[e("a-button",{key:"back",on:{click:t.handleCancel}},[t._v(" 取消 ")]),e("a-button",{key:"submit",attrs:{loading:t.loading,type:"primary"},on:{click:t.sureUpload}},[t._v(" 上传 ")])],1),e("div",{staticClass:"modal-box"},[e("a-spin",{attrs:{spinning:t.spinning}},[t.visible?e("a-upload-dragger",{attrs:{name:"formFile",multiple:!0,showUploadList:!1,action:t.TIP+"/api/services/File/File/Upload?md5="+t.md5,accept:".doc,.docx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,.txt",beforeUpload:t.beforeUpload},on:{change:t.handleChange}},[e("p",{staticClass:"ant-upload-drag-icon"},[e("a-icon",{attrs:{type:"inbox"}})],1),e("p",{staticClass:"ant-upload-text"},[t._v("点击或将文件拖拽到这里上传")]),e("p",{staticClass:"ant-upload-hint"},[t._v(" 支持扩展名:.doc .docx .txt... ")])]):t._e()],1),e("p",{staticStyle:{"margin-top":"16px"}},[t._v("已选文件:"+t._s(t.fileData.name||"无"))])],1)],2)],1)},U=[],W={components:{},data(){return{loading:!1,spinning:!1,md5:"",TIP:"http://219.153.208.30:8180",confirmLoading:!1,visible:!1,form:this.$form.createForm(this),type:"",detail:"",fileData:{}}},mounted(){},methods:{showModal(t){console.log(t,"type"),this.visible=!0,this.type=t},beforeUpload(t,e){return console.log(t,"file"),console.log(e,"fileList"),this.fileData=t,!1},handleChange(t){const e=t.file.status;if("uploading"!==e&&console.log(t.file,t.fileList),"done"===e){console.log(t,"info");let e=null,i="";this.$parent.ChapterId&&(e=0,i=this.$parent.ChapterId),this.$parent.KnowledgePointIdList.length>0&&(e=1,i=this.$parent.KnowledgePointIdList[0]);let s={fileId:t.file.response.result,disciplineId:this.$parent.activeSubject.id,targetId:i,targetType:e};console.log(s,"params"),this.spinning=!0,Object(c["nb"])(s).then(t=>{this.$message.success("上传成功!"),this.spinning=!1,this.$router.push({name:"questionImportList"})}).catch(t=>{this.$message.error("上传失败,请重新上传!"),this.spinning=!1})}else"error"===e&&this.$message.error(t.file.name+" 文件上传失败.")},sureUpload(){"{}"!==JSON.stringify(this.fileData)?(this.loading=!0,this.spinning=!0,Object(v["d"])(this.fileData).then(t=>{let e=null,i="";this.$parent.ChapterId&&(e=0,i=this.$parent.ChapterId),this.$parent.KnowledgePointIdList.length>0&&(e=1,i=this.$parent.KnowledgePointIdList[0]);let s={fileId:t,disciplineId:this.$parent.activeSubject.id,targetId:i,targetType:e};console.log(s,"params"),Object(c["nb"])(s).then(t=>{this.$message.success("上传成功!"),this.spinning=!1,this.loading=!1,this.$router.push({name:"questionImportList"})}).catch(t=>{this.$message.error("上传失败,请重新上传!"),this.spinning=!1,this.loading=!1})}).catch(t=>{this.loading=!1})):this.$message.error("请选择上传的文件!")},handleOk(t){this.visible=!1,this.$router.push({name:"questionImportList"})},handleCancel(t){this.fileData={},this.visible=!1,this.spinning=!1,this.loading=!1}}},J=W,X=Object(g["a"])(J,A,U,!1,null,"583b2d02",null),H=X.exports,Y=function(){var t=this,e=t._self._c;return e("div",[e("a-drawer",{attrs:{placement:"right",closable:!1,visible:t.visible,"after-visible-change":t.afterVisibleChange,bodyStyle:{padding:0}},on:{close:t.onClose}},[e("span",{staticClass:"d-title",attrs:{slot:"title"},slot:"title"},[t._v(" 我的试卷 ")]),e("div",{staticClass:"border-box",staticStyle:{columns:"#333333","font-weight":"bold"}},[t._v("题卡")]),e("div",{staticClass:"border-box flex-items"},[e("span",{staticClass:"text-title",staticStyle:{width:"50px"}},[t._v("标题:")]),e("a-input",{staticStyle:{flex:"1"},attrs:{placeholder:"请输入试卷标题"},model:{value:t.testName,callback:function(e){t.testName=e},expression:"testName"}})],1),e("div",{staticClass:"border-box flex-items"},[e("span",{staticClass:"text-title",staticStyle:{width:"80px"}},[t._v("考试时间:")]),e("a-input-number",{staticStyle:{flex:"1"},attrs:{id:"inputNumber",min:0},model:{value:t.testTime,callback:function(e){t.testTime=e},expression:"testTime"}}),e("span",[t._v("分钟")])],1),e("div",{staticClass:"border-box gray-text"},[t._v(" 共"+t._s(t.$store.state.storage.testBox.length)+"题 ")]),t._l(t.groupQuestion,(function(i){return e("div",[e("div",{staticClass:"border-box flex-align"},[e("div",{staticClass:"text-title"},[t._v(t._s(i.name)),e("span",{staticClass:"gray-text"},[t._v("("+t._s(i.data.length)+"题)")])]),e("a",{on:{click:function(e){return t.delByQuestiontype(i)}}},[t._v("移除")])]),t._l(i.dataGroup,(function(s){return e("div",{staticClass:"border-box flex-align"},[e("div",{staticClass:"d-left nly-line-1"},[t._v(t._s(s.name))]),e("div",{staticClass:"flex"},[e("div",{staticClass:"m-r8"},[e("span",{staticClass:"blue-text"},[t._v(t._s(s.data.length))]),t._v("题")]),e("a",{on:{click:function(e){return t.delBySubject(s,i)}}},[t._v("移除")])])])}))],2)})),e("a-button",{staticClass:"preview-btn",attrs:{loading:t.loading},on:{click:t._PaperCreate}},[t._v(" 创建试卷 ")])],2)],1)},Z=[],tt={data(){return{loading:!1,visible:!1,testName:"",testTime:""}},computed:{groupQuestion(){let t=Object(v["g"])(this.$store.state.storage.testBox,"disciplineQuestionTypeId","disciplineQuestionType");return t=t.map(t=>(t.dataGroup=Object(v["g"])(t.data,"disciplineId","discipline"),t)),console.log(t,"arr"),t}},mounted(){},methods:{_PaperCreate(){if(!this.testName)return void this.$message.error("请填写试卷名称!");if(!this.testTime)return void this.$message.error("请填写考试时间!");let t=this.$store.state.storage.testBox;if(0==t.length)return void this.$message.error("试卷试题不能为空!");this.loading=!0,console.log(t,"testBox");let e=[],i=[];t.forEach(t=>{-1==e.indexOf(t.disciplineId)&&e.push(t.disciplineId);let s={questionId:t.id,disciplineQuestionTypeId:t.disciplineQuestionTypeId,singleScore:0};i.push(s)}),console.log(e,"disciplines"),console.log(i,"paperQuestions");let s={name:this.testName,examTime:60*this.testTime*1e3,disciplines:e,paperQuestions:i};console.log(s,"data"),Object(c["X"])(s).then(t=>{this.$message.success("创建成功!"),this.loading=!1,this.visible=!1,this.$storage.remove("testBox"),this.testName="",this.testTime="",this.$router.push({name:"examPaperPreview",query:{examId:t}})}).catch(t=>{this.loading=!1})},delByQuestiontype(t){let e=this.$store.state.storage.testBox;e=e.filter(e=>e.disciplineQuestionTypeId!=t.type),this.$storage.set("testBox",e)},delBySubject(t,e){console.log(t,"subject");let i=this.$store.state.storage.testBox;i=i.filter(i=>i.disciplineQuestionTypeId!=e.type&&i.disciplineId!=t.type),this.$storage.set("testBox",i)},afterVisibleChange(t){console.log("visible",t)},showDrawer(){this.visible=!0},onClose(){this.visible=!1},toPath(){this.$router.push({name:"examPaperPreview"})}}},et=tt,it=(i("617f"),Object(g["a"])(et,Y,Z,!1,null,"b9cc4faa",null)),st=it.exports,at=i("fd9b"),nt=i("cb11"),ot={mixins:[n["a"]],components:{ChapterTree:S,PointsTree:O,myListSelect:R,QuestionImport:H,TestBasket:st,QuestionItem:at["a"],MultiListSelect:E,oPagination:nt["a"]},data(){return{spinning:!1,templateLoading:!1,replaceFields:[["id","value"]],activeSubject:{},difficultyList:[],activeDifficulty:[""],questionTypeList:[],activeQuestionType:[""],questionData:[],ChapterId:"",KnowledgePointIdList:[],KeyWord:"",isShowSubjectSelect:!1}},created(){this.$store.dispatch("GetDifficulty",!0).then(t=>{this.difficultyList=t,console.log(this.difficultyList,"this.difficultyList")}),this.$store.dispatch("DisciplineGetList",!0).then(t=>{t.length>0&&(this.activeSubject=t[0].data.length>0?t[0].data[0]:{},this.$refs.ChapterTree._TextbookGetList(this.activeSubject),this._DisciplineQuestionTypeGetList())})},computed:{dotNum(){let t=this.$store.state.storage.testBox.length>99?"99+":this.$store.state.storage.testBox.length;return t},textBox(){return this.$store.state.storage.testBox}},watch:{textBox(t){console.log(t,"nVal"),this.questionData=this.questionData.map(e=>{let i=t.filter(t=>t.id==e.id);return i.length>0?e.inbox=!0:e.inbox=!1,e})}},mounted(){this.checkSoruceToken()},methods:{checkSoruceToken(){const t=Object(v["f"])("token");if(t){const e=localStorage.getItem("sourceToken");localStorage.setItem("isSource","1"),e!==t&&this.$router.push({name:"login"})}},customRequest(t,e,i){console.log(i,"index"),this.$refs["QuestionItem"+i][0].showLoading(!0),Object(v["d"])(t.file).then(t=>{let s={questionId:e,fileId:t};console.log(s,"values"),Object(c["mb"])(s).then(t=>{console.log(t,"替换成功"),this.$message.success("替换成功"),this.$refs["QuestionItem"+i][0].showLoading(!1),this._QuestionGetList()}).catch(t=>{this.$refs["QuestionItem"+i][0].showLoading(!1)})}).catch(t=>{this.$refs["QuestionItem"+i][0].showLoading(!1)})},questionDown(t){console.log(t,"record");let e={id:t.id};Object(c["lb"])(e).then(t=>{Object(v["c"])(t,"试题.docx")})},GetQuestionTemplate(){this.templateLoading=!0;let t={disciplineId:this.activeSubject.id};Object(c["J"])(t).then(t=>{Object(v["c"])(t,"试题标记说明举例.docx"),this.templateLoading=!1}).catch(t=>{this.templateLoading=!1})},delFromTest(t){t.inbox=!1;let e=this.$storage.get("testBox"),i=e.findIndex(e=>e.id==t.id);console.log(i,"index"),e.splice(i,1),this.$storage.set("testBox",e),console.log(this.$store.state.storage.testBox,"$store.state.storage.testBox")},addToTest(t){t.inbox=!0,console.log(t,"item");let e=this.$storage.get("testBox");e.push(t),this.$storage.set("testBox",e),console.log(this.$storage.get("testBox"),"localStorage.getItem(key)"),console.log(this.$store.state.storage.testBox,"$store.state.storage.testBox")},clearChapter(){this.$nextTick(()=>{this.$refs.ChapterTree.clearChapter()})},clearPoints(){this.$nextTick(()=>{this.$refs.PointsTree.clearPoints()})},getQuestion(t={}){this.ChapterId=t.ChapterId||"",this.KnowledgePointIdList=t.KnowledgePointIdList||[],this.pagination.current=1,this._QuestionGetList(),console.log(this.ChapterId,"this.ChapterId"),console.log(this.KnowledgePointIdList,"this.KnowledgePointIdList")},_QuestionGetList(t={}){this.spinning=!0;let e={DisciplineId:this.activeSubject.id,DisciplineQuestionTypeId:this.activeQuestionType[0],Difficulty:this.activeDifficulty[0],IsActive:null,KnowledgePointIdList:this.KnowledgePointIdList,ChapterId:this.ChapterId,IncludeChildChapter:!0,IncludeAncestor:!1,KeyWord:this.KeyWord,SkipCount:(this.pagination.current-1)*this.pagination.pageSize,MaxResultCount:this.pagination.pageSize,...t};Object(c["kb"])(e).then(t=>{console.log(t,"试题列表");let e=this.$storage.get("testBox");this.questionData=t.items.map(t=>{let i=e.filter(e=>e.id==t.id);return i.length>0?t.inbox=!0:t.inbox=!1,t}),this.pagination.total=t.totalCount,this.spinning=!1}).catch(t=>{this.spinning=!1})},_DisciplineQuestionTypeGetList(){this.activeQuestionType=[""];let t={disciplineId:this.activeSubject.id};Object(c["s"])(t).then(t=>{console.log(t,"学科题型"),this.questionTypeList=t})},difficultyCallBack(t){console.log(t,"难度回调"),this.activeDifficulty=[t[0]],this._QuestionGetList()},questionTypeCallBack(t){console.log(t,"题型回调"),this.activeQuestionType=[t[0]],this._QuestionGetList()},toggle(t){this.$refs["QuestionItem"+t][0].toggle()},toEdit(t,e){this.$refs["QuestionItem"+e][0].toEdit(2)},onSearch(t){this.KeyWord=t;const e={...this.pagination};e.current=1,this.pagination=e,this._QuestionGetList()},callback(t){console.log(t)},QuestionImport(){this.$refs.QuestionImport.showModal()},toPath(t){this.$router.push({name:t})},showDrawer(){this.$refs.TestBasket.showDrawer()},subjectCallBack(t){console.log(t,"选中的学科"),this.activeDifficulty=[""],this.activeSubject=t,this._DisciplineQuestionTypeGetList()},handleChange(t){this._QuestionGetList()},handleShowSubjectSelect(t){t.preventDefault(),this.isShowSubjectSelect=!this.isShowSubjectSelect}}},lt=ot,ct=(i("d7a4"),Object(g["a"])(lt,s,a,!1,null,"694ffeb4",null));e["default"]=ct.exports},cb11:function(t,e,i){"use strict";var s=function(){var t=this,e=t._self._c;return e("div",[e("a-pagination",{staticClass:"my-pagination",attrs:{total:t.pagination.total,showTotal:t.pagination.showTotal,showSizeChanger:t.pagination.showSizeChanger,defaultPageSize:15,pageSizeOptions:t.pagination.pageSizeOptions},on:{showSizeChange:t.sizeChange,change:t.currentChange},model:{value:t.pagination.current,callback:function(e){t.$set(t.pagination,"current",e)},expression:"pagination.current"}})],1)},a=[],n={props:["pagination"],data(){return{}},watch:{pagination:{handler(t,e){console.log(t,"newVal")},deep:!0}},methods:{sizeChange(t,e){console.log(t,e,"page, pageSize"),this.pagination.current=t,this.pagination.pageSize=e,this.$emit("change")},currentChange(t,e){console.log(t,e,"current, size"),this.pagination.current=t,this.pagination.pageSize=e,this.$emit("change")}}},o=n,l=i("2877"),c=Object(l["a"])(o,s,a,!1,null,"8753c054",null);e["a"]=c.exports},d58c:function(t,e,i){"use strict";i.d(e,"a",(function(){return s}));const s={data(){return{pagination:{current:1,total:0,defaultPageSize:15,pageSize:15,showTotal:t=>`共 ${t} 条数据`,showSizeChanger:!0,pageSizeOptions:["15","20","30","50","100"],onShowSizeChange:(t,e)=>{console.log(t,e),this.pagination.pageSize=e,this.pagination.current=t}}}},methods:{TableChange(t){const e={...this.pagination};e.current=t.current,this.pagination=e}}}},d7a4:function(t,e,i){"use strict";i("2254")},e7be:function(t,e,i){"use strict";i("4aa2")}}]);
- //# sourceMappingURL=chunk-4843abff.98c7513e.js.map
|