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__Preface__Index__index.as...

1 line
5.9 KiB

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[92756],{75819:function(n,e,i){i.r(e),i.d(e,{default:function(){return en}});var t=i(82242),s=i.n(t),l=i(7557),c=i.n(l),a=i(37205),r=i.n(a),o=i(41498),u=i.n(o),d=i(79800),_=i.n(d),p=i(39647),m=i.n(p),v=i(59301),h=i(2753),f=i(80608),x=i(71418),j=i(43418),g=i(8591),y=i(6848),N=i(95237),w=i(43604),S=i(86859),k="page___Gcmac",C="center___N9qD8",Z="paramsStyle___iDChv",b="type___woWqs",D="type_item_active___zMf9e",R="type_item___Vk0gB",P="BannerStyle___wAus6",I="BannerStyleContent___JwXxj",z="DivDownPlay___jcm9Z",E="CustomInputStyle___xNo9j",M="listwrap___T7D1l",V="list___PQsZ5",G="list_img___PLy0R",T="type_name___Dr9S4",q="list_content___dreze",B="content_title___soAMR",J="content_desc___PMqjw",W="imgContent___rsNO1",A="updateContent___T7pPJ",F="iconUpdate___i4lVr",H="deleteContent___HsGat",O="iconDetele___Vwrcv",Q=i(75916),U=i(41852),L=i(78270),X=i(6638),K=i(71681),Y=i(27876),$=i(37712),nn=["globalSetting","dispatch","user"],en=(0,f.connect)((function(n){return{user:n.user,globalSetting:n.globalSetting}}))((function(n){var e,i=n.globalSetting,t=(n.dispatch,n.user),l=(m()(n,nn),(0,v.useState)({keyword:"",company:"全部拓展类型",is_ai:!1,page:1,limit:10})),a=_()(l,2),o=a[0],d=a[1],p=(0,v.useState)([]),en=_()(p,2),tn=en[0],sn=en[1],ln=(0,v.useState)([]),cn=_()(ln,2),an=cn[0],rn=cn[1],on=(0,v.useState)(0),un=_()(on,2),dn=un[0],_n=un[1],pn=(0,v.useState)(!1),mn=_()(pn,2),vn=mn[0],hn=mn[1];(0,v.useEffect)((function(){xn()}),[o]),(0,v.useEffect)((function(){fn()}),[]);var fn=function(){var n=u()(c()().mark((function n(){var e;return c()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,U.H8)({is_ai:!1});case 2:0==(e=n.sent).status&&sn(["全部拓展类型"].concat(r()(null==e?void 0:e.preface_expansions_types)));case 4:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}(),xn=function(){var n=u()(c()().mark((function n(){var e,i;return c()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return hn(!0),(e=s()({},o)).company="全部拓展类型"==o.company?"":o.company,n.next=5,(0,L.ZD)(e);case 5:0==(null==(i=n.sent)?void 0:i.status)?(_n(null==i?void 0:i.total_count),rn(null==i?void 0:i.list),hn(!1)):hn(!1);case 7:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}();return(0,$.jsxs)("section",{className:k,children:[(0,$.jsx)("div",{className:P,style:{backgroundImage:"url(".concat(K.Z.IMG_SERVER,"/").concat(null==i||null===(e=i.setting)||void 0===e?void 0:e.news_banner_url,")")},children:(0,$.jsxs)("div",{className:I,children:[(0,$.jsxs)("div",{children:[(0,$.jsx)("div",{style:{color:"#fff",fontSize:".34rem",letterSpacing:".05rem",fontWeight:600},children:"前沿拓展"}),(0,Q.Ny)()&&(0,$.jsxs)("div",{className:"".concat(z),onClick:function(){f.history.push("/preface/new")},children:[(0,$.jsx)("i",{className:"iconfont icon-icon_xinyong_xianxing_jijin-249",style:{marginRight:"0.05rem",fontSize:".16rem"}}),"新建前沿拓展"]})]}),(0,$.jsx)("div",{children:(0,$.jsx)(h.t7,{placeholder:"请输入关键词搜索",className:E,value:null==o?void 0:o.keyword,onChange:function(n){var e;d(s()(s()({},o),{},{keyword:null===(e=decodeURIComponent(n))||void 0===e?void 0:e.trim(),page:1}))}})})]})}),(0,$.jsxs)("div",{className:C,children:[(0,$.jsx)("div",{className:Z,children:(0,$.jsx)("div",{className:b,children:(0,$.jsx)("div",{style:{display:"flex",flexWrap:"wrap",flex:1},children:null==tn?void 0:tn.map((function(n,e){return(0,$.jsx)("div",{className:(null==o?void 0:o.company)==n?D:R,onClick:function(){o.company=n,d(s()({},o))},children:n},e)}))})})}),(0,$.jsx)(x.Z,{spinning:vn,children:(0,$.jsxs)("div",{style:{width:"12rem",margin:".38rem auto 0"},children:[(null==an?void 0:an.length)>0?(0,$.jsx)("div",{className:M,children:null==an?void 0:an.map((function(n,e){var i,s;return(0,$.jsx)("div",{onClick:function(){(0,Y.xg)("".concat(null==n?void 0:n.url))},children:(0,$.jsxs)("div",{className:V,style:{marginRight:(1+e)%2==0?0:".37rem"},children:[(0,$.jsx)("img",{src:K.Z.IMG_SERVER+(null==n?void 0:n.attachment_url),className:G}),([1,2].includes(null==t||null===(i=t.userInfo)||void 0===i?void 0:i.role)||(null==n?void 0:n.user_id)==(null==t||null===(s=t.userInfo)||void 0===s?void 0:s.user_id))&&(0,$.jsxs)("div",{className:W,children:[(0,$.jsxs)("span",{className:A,onClick:function(e){e.stopPropagation(),f.history.push("/preface/".concat(n.id,"/edit"))},children:[(0,$.jsx)("i",{className:"iconfont icon-bianji-moren ".concat(F)}),"编辑"]}),(0,$.jsxs)("span",{className:H,onClick:function(e){var i;e.stopPropagation(),j.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"提示",content:(0,$.jsx)("div",{children:"确认删除该前沿拓展吗?"}),onOk:(i=u()(c()().mark((function e(){return c()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(0,L.Z)(n.id).then((function(n){0==(null==n?void 0:n.status)&&(g.ZP.success("删除成功"),xn(),fn())}));case 1:case"end":return e.stop()}}),e)}))),function(){return i.apply(this,arguments)})})},children:[(0,$.jsx)("i",{className:"iconfont icon-shanchu13 ".concat(O)}),"删除"]})]}),(0,$.jsx)("div",{className:T,children:null==n?void 0:n.type_name}),(0,$.jsxs)("div",{className:q,children:[(0,$.jsx)(y.Z,{title:(null==n?void 0:n.title)||"--",children:(0,$.jsx)("div",{className:B,children:(null==n?void 0:n.title)||"--"})}),(0,$.jsx)(y.Z,{title:(null==n?void 0:n.description)||"--",children:(0,$.jsx)("div",{className:J,children:(null==n?void 0:n.description)||"--"})})]})]})},null==n?void 0:n.id)}))}):(0,$.jsx)(X.Z,{}),(null==an?void 0:an.length)>0&&(0,$.jsxs)(N.Z,{align:"middle",justify:"space-between",style:{margin:".2rem auto 1.5rem"},children:[(0,$.jsxs)(w.Z,{children:["共 ",(0,$.jsx)("span",{style:{color:"#165DFF"},children:dn||0})," 条数据"]}),(0,$.jsx)(w.Z,{children:(0,$.jsx)(S.Z,{showSizeChanger:!1,showQuickJumper:!0,current:o.page,pageSize:o.limit,onChange:function(n,e){return d(s()(s()({},o),{},{page:n,limit:e}))},total:dn||0})})]})]})})]})]})}))}}]);