(this.webpackJsonph5=this.webpackJsonph5||[]).push([[30],{1155:function(e,t,a){"use strict";a(50);var s=a(29),o=(a(104),a(60)),n=(a(260),a(92)),i=(a(170),a(18)),r=a(8),l=a(7),c=a(10),p=a(9),m=a(11),d=(a(103),a(47)),u=a(0),h=a.n(u),v=(a(265),a(544),a(28)),f=a(6),g=a.n(f),y=a(752),_=a.n(y),b=a(171),k=d.a.Search,x={poll:"\u95ee\u5377",normal:"\u666e\u901a\u4f5c\u4e1a",group:"\u5206\u7ec4\u4f5c\u4e1a",exercise:"\u8bd5\u5377",gtask:"\u6bd5\u8bbe\u4efb\u52a1",gtopic:"\u6bd5\u8bbe\u9009\u9898"},w=function(e){function t(e){var a;return Object(r.a)(this,t),(a=Object(c.a)(this,Object(p.a)(t).call(this,e))).onCheckBoxChange=function(e){a.setState({checkBoxValues:e}),0!=e.length&&a.setState({isChecked:""})},a.fetchAll=function(e){a.props.match.params.coursesId;var t=e||a.state.page,s=a.state,o=s.nav_my,n=s.search,i=a.props.object_type,r="/question_banks/bank_list.json?page=".concat(t,"&limit=").concat(20,"&object_type=").concat(i||"","&search=").concat(n||"","&filter=").concat(o);a.setState({loading:!0}),g.a.get(r).then((function(e){e.data&&a.setState({is_teacher:e.data.is_teacher}),e.data.object_list&&0!=e.data.object_list.length?a.setState({object_list:1==t?e.data.object_list:a.state.object_list.concat(e.data.object_list),page:t,loading:!1,hasMore:20==e.data.object_list.length}):a.setState({object_list:1==t?[]:a.state.object_list,page:t,loading:!1,hasMore:!1})})).catch((function(e){}))},a.openSelectBank=function(){a.setState({search:"",flag:!0},(function(){a.fetchAll()}))},a.closeSelectBank=function(){a.setState({flag:!1,nav_my:"myself",search:"",page:1,checkBoxValues:[],isChecked:"",is_teacher:void 0,hometypepvisible:!1})},a.changeNav=function(e){a.setState({nav_my:e},(function(){a.fetchAll(1)}))},a.onSearchChange=function(e){a.setState({search:e.target.value})},a.onSave=function(){var e=a.state.checkBoxValues,t=a.props.object_type;if(0!=e.length){a.setState({hometypepvisible:!0});var s=a.props.match.params.coursesId;a.setState({loading:!0}),g.a.post("/question_banks/save_banks.json",{object_type:t,bank_id:e,course_id:s}).then((function(t){0==t.data.status?(a.props.useBankSuccess&&a.props.useBankSuccess(e,t.data.object_ids),a.props.showNotification("\u9898\u5e93\u9009\u7528\u6210\u529f"),a.closeSelectBank(),a.props.updataleftNavfun(),a.setState({hometypepvisible:!1,checkBoxValues:[]})):(a.setState({hometypepvisible:!1,checkBoxValues:[]}),a.props.showNotification(t.data.message))})).catch((function(e){a.setState({hometypepvisible:!1,checkBoxValues:[]})}))}else a.setState({isChecked:"\u8bf7\u5148\u9009\u62e9"+x[t]})},a.getotiku=function(e){window.open(e,"_blank")},a.state={flag:!1,nav_my:"myself",search:"",page:1,checkBoxValues:[],isChecked:"",is_teacher:void 0,hometypepvisible:!1},a}return Object(m.a)(t,e),Object(l.a)(t,[{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var e=this,t=this.state,a=t.flag,r=t.nav_my,l=t.loading,c=t.hasMore,p=t.object_list,m=t.search,d=t.checkBoxValues,u=t.isChecked,f=t.page,g=t.is_teacher,y=this.props.object_type,w=h.a.createElement(i.a,{type:"loading",style:{fontSize:24},spin:!0});return h.a.createElement("a",null,h.a.createElement("style",null,"\n .bankModal .task-hide {\n max-width: 290px;\n }\n .d_middle{\n justify-content: center;\n align-items: center;\n display: -webkit-flex;\n }\n .setImgW .edu-nodata-img{\n width: 170px !important;\n }\n .bankwidth{\n\t\t\t\t\twidth:32% !important;\n\t\t\t\t\toverflow:hidden;\n\t\t\t\t\ttext-overflow:ellipsis;\n\t\t\t\t\twhite-space:nowrap\n }\n .bankwidth76{\n\t\t\t\t\twidth:76px !important;\n\t\t\t\t\toverflow:hidden;\n\t\t\t\t\ttext-overflow:ellipsis;\n\t\t\t\t\twhite-space:nowrap;\n\t\t\t\t\ttext-align: center;\n }\n .bankwidth2{\n\t\t\t\t\twidth:24% !important;\n\t\t\t\t\toverflow:hidden;\n\t\t\t\t\ttext-overflow:ellipsis;\n\t\t\t\t\twhite-space:nowrap\n }\n .with58{\n width:58% !important;\n Margin-left:15px\n }\n .with63{\n width: 60% !important;\n box-sizing: border-box;\n margin-left: 15px;\n }\n "),!0===a?h.a.createElement("style",null,"\n body {\n\t\t\t\t\t\t\t overflow: hidden !important;\n\t\t\t\t\t\t\t}\n "):"",this.props.user&&!0===this.props.user.main_site?h.a.createElement(v.A,{style:"blue",className:"mr30 font-16",onClick:function(){return e.openSelectBank()}},"\u95ee\u5377"==x[y]?"\u95ee\u5377\u9009\u7528":"\u8bd5\u5377"==x[y]?"\u8bd5\u5377\u9009\u7528":"\u9898\u5e93\u9009\u7528"):"",!0===a?h.a.createElement(s.a,{title:"\u9898\u5e93\u9009\u7528",visible:a,closable:!1,width:"800px",footer:null,keyboard:!1,destroyOnClose:!0,centered:!0},h.a.createElement("div",{className:"newupload_conbox clearfix bankModal"},h.a.createElement(o.a,{indicator:w,spinning:this.state.hometypepvisible,className:"newnext-loading",color:"#4AC7FF",size:"large"},h.a.createElement("div",{className:"clearfix mb30"},h.a.createElement("ul",{className:"fl mt2 bankNav"},h.a.createElement("li",{className:"myself"===r?"active":"",onClick:function(){return e.changeNav("myself")}},h.a.createElement("a",null,"\u6211\u7684\u9898\u5e93")),h.a.createElement("li",{className:"myself"===r?"":"active",onClick:function(){return e.changeNav("public")}},h.a.createElement("a",null,"\u516c\u5171\u9898\u5e93"))),h.a.createElement(k,{placeholder:"\u8f93\u5165\u6807\u9898\u3001\u9002\u7528\u8bfe\u7a0b\u8fdb\u884c\u641c\u7d22",className:"searchView fr",style:{width:"268px",height:"30px"},onSearch:function(){return e.fetchAll(1)},onChange:this.onSearchChange,value:m})),p&&0==p.length&&1==f?"":"myself"===r?h.a.createElement("p",{className:"color-grey-6 mb25 edu-txt-center"},"\u9009\u7528\u5bf9\u8c61\uff1a\u4f60\u5728\u8bfe\u5802",x[y],"\u5217\u8868\u4e2d\u5df2",h.a.createElement("span",{className:"color-orange-tip"},"\u201c\u52a0\u5165\u9898\u5e93\u201d"),"\u7684",x[y]):h.a.createElement("p",{className:"color-grey-6 mb25 edu-txt-center"},"\u9009\u7528\u5bf9\u8c61\uff1a\u9898\u5e93\u4e2d\u5df2\u8bbe\u7f6e\u6210\u516c\u5171\u5c5e\u6027\u7684\u6240\u6709",x[y]),"myself"!=r&&0==g?h.a.createElement("div",{style:{height:"230px"},className:"d_middle edu-txt-center"},h.a.createElement("div",null,h.a.createElement("p",{className:"font-16 mb20 color-grey-3"},"\u901a\u8fc7\u804c\u4e1a\u8ba4\u8bc1\u7684\u6559\u5e08\u624d\u80fd\u8bbf\u95ee\u516c\u5171\u9898\u5e93"),h.a.createElement("a",{className:"white-btn edu-orangeback-btn",target:"_blank",href:"/account/certification"},"\u7acb\u5373\u8ba4\u8bc1"))):p&&0==p.length&&1==f?h.a.createElement("div",{className:"setImgW"},h.a.createElement(b.a,null)):h.a.createElement("div",{className:"edu-back-skyblue padding20",style:{height:"230px",overflowY:"auto"}},h.a.createElement(_.a,{threshold:10,initialLoad:!1,pageStart:0,loadMore:function(){return e.fetchAll(e.state.page+1)},hasMore:!l&&c,useWindow:!1},h.a.createElement(n.a.Group,{style:{width:"100%"},onChange:this.onCheckBoxChange,value:d},p&&p.map((function(t){return h.a.createElement("p",{className:"clearfix mb7",key:t.id},h.a.createElement(n.a,{className:"fl",value:t.id,key:t.id}),h.a.createElement("span",{className:"myself"===r?"fl with58":"fl with63"},h.a.createElement("label",{className:"task-hide fl",title:t.name&&30