You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__Textbook__Index__index.a...

1 line
13 KiB

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[4350],{68738:function(e,t,n){var i=n(7557),o=n.n(i),s=n(41498),a=n.n(s),r=n(79800),l=n.n(r),c=n(59301),u=n(13032),d=n(43418),f=n(8591),p=n(58181),m=n(96193),h=n(37712);t.Z=(0,u.connect)((function(e){return{user:e.user,classroomList:e.classroomList}}))((function(e){e.user;var t,n=e.dispatch,i=e.classroomList,s=e.getData,r=(0,c.useState)(!1),u=l()(r,2),v=u[0],x=u[1],g=(0,c.useState)(""),y=l()(g,2),_=y[0],j=y[1],w=function(){n({type:"classroomList/setActionTabs",payload:{}})},S={"教材规划":"core_material_description","主审专家":"judge","教材推荐":"textbook","师资培训":"core_teacher","课堂听课":"listening","教学论文":"paper"};return(0,h.jsx)(d.Z,{title:"规划说明",width:900,destroyOnClose:!0,maskClosable:!1,keyboard:!1,confirmLoading:v,open:"规划说明"===i.actionTabs.key,onCancel:w,onOk:a()(o()().mark((function e(){var t;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return x(!0),e.next=3,(0,p.ZP)("/api/core_materials/set_description.json",{method:"post",body:{name:S[i.actionTabs.params.name],content:_}});case 3:0==(null==(t=e.sent)?void 0:t.status)&&(f.ZP.success("保存成功"),w(),s()),x(!1);case 6:case"end":return e.stop()}}),e)}))),children:(0,h.jsx)(m.Z,{defaultvalue:null===(t=i.actionTabs.params)||void 0===t?void 0:t.content,onChange:function(e){j(e)}})})}))},94035:function(e,t,n){n.r(t),n.d(t,{default:function(){return W}});var i=n(37205),o=n.n(i),s=n(82242),a=n.n(s),r=n(7557),l=n.n(r),c=n(41498),u=n.n(c),d=n(79800),f=n.n(d),p=n(59301),m=n(13032),h=n(81228),v=n(61621),x=n(6848),g=n(95237),y=n(43604),_=n(58421),j="BannerStyle___edGBw",w="BannerStyleContent___kyb6Q",S="DivDownPlay___IUWWX",b="CustomInputStyle___qow_W",Z="list___hrLrx",C="title___inYm8",N="publisher___H8ac3",k="paramsStyle___JRtOC",P="type___yDlx4",T="typeName___YoFF3",R="type_item_active___b785N",E="type_item___Bqpts",z=n(20731),B=n(72226),L=n(17631),O=n(58181),A=n(69142),I=n(88252),D=n(46906),F=n(68738),U=n(37712),W=(0,m.connect)((function(e){var t=e.user,n=e.globalSetting,i=e.coreCurriculum;return{user:t,globalSetting:n,virtualSpaces:e.virtualSpaces,coreCurriculum:i}}))((function(e){e.coreCurriculum;var t,n,i,s,r=e.dispatch,c=(e.virtualSpaces,e.globalSetting),d=(0,p.useState)({page:1,limit:12}),W=f()(d,2),M=W[0],H=W[1],q=(0,p.useState)(0),G=f()(q,2),J=G[0],Q=G[1],V=(0,p.useState)(!0),Y=f()(V,2),X=Y[0],K=Y[1],$=(0,p.useState)(""),ee=f()($,2),te=ee[0],ne=ee[1],ie=(0,p.useState)(!1),oe=f()(ie,2),se=oe[0],ae=oe[1],re=(0,p.useState)([]),le=f()(re,2),ce=le[0],ue=le[1],de=(0,p.useState)([]),fe=f()(de,2),pe=fe[0],me=fe[1],he=(0,p.useState)("全部"),ve=f()(he,2),xe=ve[0],ge=ve[1],ye=(0,p.useState)([]),_e=f()(ye,2),je=_e[0],we=_e[1],Se=(0,p.useState)("全部"),be=f()(Se,2),Ze=be[0],Ce=be[1],Ne=(0,p.useState)(!1),ke=f()(Ne,2),Pe=ke[0],Te=ke[1],Re=(0,p.useState)(""),Ee=f()(Re,2),ze=Ee[0],Be=Ee[1];(0,p.useEffect)((function(){Le()}),[]),(0,p.useEffect)((function(){Oe(!0)}),[xe,Ze,te]);var Le=function(){var e=u()(l()().mark((function e(){var t,n,i,o;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return K(!0),e.next=3,(0,O.ZP)("/api/core_materials/material_type_name_list.json",{method:"get"});case 3:return 0==(null==(t=e.sent)?void 0:t.status)&&we(null==t||null===(n=t.data)||void 0===n?void 0:n.list),e.next=7,(0,O.ZP)("/api/core_materials/core_subject_name_list.json",{method:"get",params:{book_type:1}});case 7:0==(null==(i=e.sent)?void 0:i.status)&&me(null==i||null===(o=i.data)||void 0===o?void 0:o.list),K(!1);case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Oe=function(){var e=u()(l()().mark((function e(){var t,n,i,o,s=arguments;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=s.length>0&&void 0!==s[0]&&s[0],K(!0),t&&(M.page=1,H(a()({},M))),e.next=5,(0,O.ZP)("/api/core_materials/list.json",{method:"get",params:a()({material_type_name:Ze,keyword:te,core_subject_name:xe},M)});case 5:-1!==(null==(n=e.sent)?void 0:n.status)&&(Te(null==n?void 0:n.can_edit),ue((null==n||null===(i=n.data)||void 0===i?void 0:i.list)||[]),Q(null==n||null===(o=n.data)||void 0===o?void 0:o.count),Be(null==n?void 0:n.description)),K(!1);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ae=function(){var e=u()(l()().mark((function e(t){var n;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,O.ZP)("/api/core_materials.json",{method:"post",body:a()({},t)});case 2:-1!==(null==(n=e.sent)?void 0:n.status)&&(Oe(),Le(),ae(!1));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return(0,U.jsxs)("section",{style:{paddingBottom:"3rem"},children:[(0,U.jsx)("div",{className:j,style:{backgroundImage:"url(".concat(L.Z.IMG_SERVER,"/").concat(null==c||null===(t=c.setting)||void 0===t?void 0:t.news_banner_url,")")},children:(0,U.jsxs)("div",{className:w,children:[(0,U.jsxs)("div",{children:[(0,U.jsx)("div",{style:{color:"#fff",fontSize:".34rem",letterSpacing:".05rem",fontWeight:600},children:(0,z.Iz)("/textbook",null==c||null===(n=c.setting)||void 0===n?void 0:n.navbar)}),Pe&&(0,U.jsxs)("div",{style:{display:"flex"},children:[(0,U.jsxs)("div",{className:"".concat(S),style:{width:"1rem"},onClick:function(){return ae(!0)},children:[(0,U.jsx)("i",{className:"iconfont icon-icon_xinyong_xianxing_jijin-249",style:{marginRight:"0.05rem",fontSize:".16rem"}}),"新建"]}),(0,U.jsxs)("div",{className:"".concat(S),style:{marginLeft:".2rem",width:"1.2rem"},onClick:function(){r({type:"classroomList/setActionTabs",payload:{key:"规划说明",params:{name:"教材推荐",content:ze}}})},children:[(0,U.jsx)("i",{className:"iconfont icon-icon_xinyong_xianxing_jijin-249",style:{marginRight:"0.05rem",fontSize:".16rem"}}),"规划说明"]})]})]}),(0,U.jsx)("div",{children:(0,U.jsx)(D.t7,{placeholder:"请输入关键字进行搜索",className:b,value:te,onChange:function(e){ne(e)}})})]})}),ze&&(0,U.jsx)(A.Z,{style:{width:"12rem",margin:" .36rem auto 0 auto"},value:ze}),(0,U.jsxs)("div",{style:{width:"12rem",margin:".36rem auto 0 auto",background:"#fff",paddingBottom:".1rem"},children:[(0,U.jsx)(h.Z,{offsetTop:-20,children:(0,U.jsxs)("div",{className:k,children:[(0,U.jsxs)("div",{className:P,style:{borderBottom:"1px dashed #37AD83"},children:[(0,U.jsx)("div",{className:T,children:"课程"}),(0,U.jsx)("div",{style:{display:"flex",flexWrap:"wrap",flex:1},children:null===(i=["全部"].concat(o()(pe)))||void 0===i?void 0:i.map((function(e,t){return(0,U.jsx)("div",{className:xe==e?R:E,onClick:function(){ge(e)},children:e},t)}))})]}),(0,U.jsxs)("div",{className:P,children:[(0,U.jsx)("div",{className:T,children:"类型"}),(0,U.jsx)("div",{style:{display:"flex",flexWrap:"wrap",flex:1},children:null===(s=["全部"].concat(o()(je)))||void 0===s?void 0:s.map((function(e,t){return(0,U.jsx)("div",{className:Ze==e?R:E,onClick:function(){Ce(e)},children:e},t)}))})]})]})}),(0,U.jsxs)(v.Z,{loading:X,children:[!ce.length&&(0,U.jsx)(B.Z,{}),(0,U.jsx)("div",{style:{display:"flex",flexWrap:"wrap",marginTop:".3rem"},children:ce.map((function(e){var t=e.name,n=e.id,i=e.attachment,o=e.author,s=e.publisher;e.number,e.publication_time,e.description;return(0,U.jsxs)("div",{className:Z,onClick:function(){return m.history.push("/textbook/detail/".concat(n))},children:[(0,U.jsx)("img",{style:{border:"2px #1B8565 solid"},src:L.Z.API_SERVER+(null==i?void 0:i.url)}),(0,U.jsx)(x.Z,{title:t,children:(0,U.jsx)("div",{className:C,style:{marginTop:"-5px"},children:t})}),(0,U.jsx)(x.Z,{title:o,children:(0,U.jsx)("div",{className:N,children:o||"--"})}),(0,U.jsx)(x.Z,{title:s,children:(0,U.jsx)("div",{className:N,style:{marginTop:"-10px"},children:s||"--"})})]},n)}))})]}),(0,U.jsxs)(g.Z,{wrap:!1,align:"middle",justify:"space-between",style:{width:"12rem",margin:".2rem auto",padding:"0 .2rem"},children:[(0,U.jsxs)(y.Z,{children:["共 ",(0,U.jsx)("span",{style:{color:"#165DFF"},children:J||0})," 条数据"]}),(0,U.jsx)(y.Z,{children:(0,U.jsx)(_.Z,{showSizeChanger:!1,showQuickJumper:!0,hideOnSinglePage:!0,current:M.page,pageSize:M.limit,onChange:function(e,t){M.page=e,H(a()({},M)),Oe()},total:J||0})})]}),(0,U.jsx)(I.Z,{visible:se,title:"教材",onCancel:function(){return ae(!1)},onOk:Ae})]}),(0,U.jsx)(F.Z,{getData:Oe})]})}))},27666:function(e,t,n){var i=n(19127),o=n(16089);t.Z=function(e){let t;const n=n=>()=>{t=null,e.apply(void 0,(0,i.Z)(n))},s=function(){if(null==t){for(var e=arguments.length,i=new Array(e),s=0;s<e;s++)i[s]=arguments[s];t=(0,o.Z)(n(i))}};return s.cancel=()=>{o.Z.cancel(t),t=null},s}},81228:function(e,t,n){n.d(t,{Z:function(){return Z}});var i=n(52884),o=n(95727),s=n(65711),a=n(15861),r=n(59301),l=n(92310),c=n.n(l),u=n(29301),d=n(2738),f=n(27666),p=n(36355),m=n(83116),h=n(37613);const v=e=>{const{componentCls:t}=e;return{[t]:{position:"fixed",zIndex:e.zIndexPopup}}};var x=(0,m.Z)("Affix",(e=>{const t=(0,h.TS)(e,{zIndexPopup:e.zIndexBase+10});return[v(t)]}));function g(e){return e!==window?e.getBoundingClientRect():{top:0,bottom:window.innerHeight}}function y(e,t,n){if(void 0!==n&&t.top>e.top-n)return n+t.top}function _(e,t,n){if(void 0!==n&&t.bottom<e.bottom+n){return n+(window.innerHeight-t.bottom)}}const j=["resize","scroll","touchstart","touchmove","touchend","pageshow","load"];function w(){return"undefined"!=typeof window?window:null}var S;!function(e){e[e.None=0]="None",e[e.Prepare=1]="Prepare"}(S||(S={}));let b=function(e){(0,s.Z)(n,e);var t=(0,a.Z)(n);function n(){var e;return(0,i.Z)(this,n),(e=t.apply(this,arguments)).state={status:S.None,lastAffix:!1,prevTarget:null},e.placeholderNodeRef=(0,r.createRef)(),e.fixedNodeRef=(0,r.createRef)(),e.addListeners=()=>{const t=e.getTargetFunc(),n=null==t?void 0:t(),{prevTarget:i}=e.state;i!==n&&(j.forEach((t=>{null==i||i.removeEventListener(t,e.lazyUpdatePosition),null==n||n.addEventListener(t,e.lazyUpdatePosition)})),e.updatePosition(),e.setState({prevTarget:n}))},e.removeListeners=()=>{e.timer&&(clearTimeout(e.timer),e.timer=null);const{prevTarget:t}=e.state,n=e.getTargetFunc(),i=null==n?void 0:n();j.forEach((n=>{null==i||i.removeEventListener(n,e.lazyUpdatePosition),null==t||t.removeEventListener(n,e.lazyUpdatePosition)})),e.updatePosition.cancel(),e.lazyUpdatePosition.cancel()},e.getOffsetTop=()=>{const{offsetBottom:t,offsetTop:n}=e.props;return void 0===t&&void 0===n?0:n},e.getOffsetBottom=()=>e.props.offsetBottom,e.measure=()=>{const{status:t,lastAffix:n}=e.state,{onChange:i}=e.props,o=e.getTargetFunc();if(t!==S.Prepare||!e.fixedNodeRef.current||!e.placeholderNodeRef.current||!o)return;const s=e.getOffsetTop(),a=e.getOffsetBottom(),r=o();if(r){const t={status:S.None},o=g(e.placeholderNodeRef.current);if(0===o.top&&0===o.left&&0===o.width&&0===o.height)return;const l=g(r),c=y(o,l,s),u=_(o,l,a);void 0!==c?(t.affixStyle={position:"fixed",top:c,width:o.width,height:o.height},t.placeholderStyle={width:o.width,height:o.height}):void 0!==u&&(t.affixStyle={position:"fixed",bottom:u,width:o.width,height:o.height},t.placeholderStyle={width:o.width,height:o.height}),t.lastAffix=!!t.affixStyle,i&&n!==t.lastAffix&&i(t.lastAffix),e.setState(t)}},e.prepareMeasure=()=>{e.setState({status:S.Prepare,affixStyle:void 0,placeholderStyle:void 0})},e.updatePosition=(0,f.Z)((()=>{e.prepareMeasure()})),e.lazyUpdatePosition=(0,f.Z)((()=>{const t=e.getTargetFunc(),{affixStyle:n}=e.state;if(t&&n){const i=e.getOffsetTop(),o=e.getOffsetBottom(),s=t();if(s&&e.placeholderNodeRef.current){const t=g(s),a=g(e.placeholderNodeRef.current),r=y(a,t,i),l=_(a,t,o);if(void 0!==r&&n.top===r||void 0!==l&&n.bottom===l)return}}e.prepareMeasure()})),e}return(0,o.Z)(n,[{key:"getTargetFunc",value:function(){const{getTargetContainer:e}=this.context,{target:t}=this.props;return void 0!==t?t:null!=e?e:w}},{key:"componentDidMount",value:function(){this.timer=setTimeout(this.addListeners)}},{key:"componentDidUpdate",value:function(e){this.addListeners(),e.offsetTop===this.props.offsetTop&&e.offsetBottom===this.props.offsetBottom||this.updatePosition(),this.measure()}},{key:"componentWillUnmount",value:function(){this.removeListeners()}},{key:"render",value:function(){const{affixStyle:e,placeholderStyle:t}=this.state,{affixPrefixCls:n,rootClassName:i,children:o}=this.props,s=c()(e&&i,{[n]:!!e});let a=(0,d.Z)(this.props,["prefixCls","offsetTop","offsetBottom","target","onChange","affixPrefixCls","rootClassName"]);return r.createElement(u.Z,{onResize:this.updatePosition},r.createElement("div",Object.assign({},a,{ref:this.placeholderNodeRef}),e&&r.createElement("div",{style:t,"aria-hidden":"true"}),r.createElement("div",{className:s,ref:this.fixedNodeRef,style:e},r.createElement(u.Z,{onResize:this.updatePosition},o))))}}]),n}(r.Component);b.contextType=p.E_;var Z=(0,r.forwardRef)(((e,t)=>{const{prefixCls:n,rootClassName:i}=e,{getPrefixCls:o}=(0,r.useContext)(p.E_),s=o("affix",n),[a,l]=x(s),u=Object.assign(Object.assign({},e),{affixPrefixCls:s,rootClassName:c()(i,l)});return a(r.createElement(b,Object.assign({},u,{ref:t})))}))}}]);