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.
2 lines
11 KiB
2 lines
11 KiB
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[5599],{6629:function(H,I,u){var e=u(59301),b=u(93314),$=u(3113),j=Object.defineProperty,_=Object.defineProperties,w=Object.getOwnPropertyDescriptors,O=Object.getOwnPropertySymbols,B=Object.prototype.hasOwnProperty,L=Object.prototype.propertyIsEnumerable,S=(p,l,m)=>l in p?j(p,l,{enumerable:!0,configurable:!0,writable:!0,value:m}):p[l]=m,f=(p,l)=>{for(var m in l||(l={}))B.call(l,m)&&S(p,m,l[m]);if(O)for(var m of O(l))L.call(l,m)&&S(p,m,l[m]);return p},h=(p,l)=>_(p,w(l));const k=({img:p,buttonProps:l={},styles:m={},customText:N,ButtonText:W,ButtonClick:R,Buttonclass:z,ButtonTwo:A,imgStyles:J,loading:M=!1})=>e.createElement("section",{className:"tc animated fadeIn",style:f(f({},{color:"#999",margin:"100px auto",visibility:M?"hidden":"visible"}),m)},e.createElement("img",{src:p||b,style:h(f({},J),{pointerEvents:"none",userSelect:"none"})}),e.createElement("p",{className:"mt20 font14"},N||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),W&&e.createElement($.ZP,f({className:z,onClick:R},l),W),A&&A);I.Z=k},96442:function(H,I,u){u.r(I),u.d(I,{default:function(){return M}});var e=u(59301),b=u(63144),$=u(56511),j=u(53864),_={flex_box_center:"flex_box_center___IuXaZ",flex_space_between:"flex_space_between___FgiDp",flex_box_vertical_center:"flex_box_vertical_center____WBjP",flex_box_center_end:"flex_box_center_end___CPJQF",flex_box_column:"flex_box_column___ivE9u",wrap:"wrap___iwvHC",midWrap:"midWrap___JC0F2",color999:"color999___aMrEh",orderWrap:"orderWrap___gxKVG",orderIconWrap:"orderIconWrap___O1L7r",orderAsc:"orderAsc___aghh_",orderDesc:"orderDesc___q0uG2",color0152d9:"color0152d9___UuR9f",h10:"h10___dl8aJ",cursorPointer:"cursorPointer___mLanQ",orderTextWrap:"orderTextWrap___ghSqq",cardWrap:"cardWrap___Wv0mR",countWrap:"countWrap___NIkIb",type:"type___m6IRF"},w=u(6848),O=u(14491),B={flex_box_center:"flex_box_center___n5pEG",flex_space_between:"flex_space_between___L_HRa",flex_box_vertical_center:"flex_box_vertical_center___zOctL",flex_box_center_end:"flex_box_center_end___DyJfV",flex_box_column:"flex_box_column___NS2Dc",wrap:"wrap___gPCi1",createIconWrap:"createIconWrap___za5EO",createIcon:"createIcon___X8anF",leftIcon:"leftIcon___LNfFE",rightIcon:"rightIcon___viUSa",createTextWrap:"createTextWrap___Dt6o2",createText:"createText___EqVCQ",tagWrap:"tagWrap___P1scY",payWrap:"payWrap___PREW8",tagName:"tagName___xzzOb",tagJupyterWrap:"tagJupyterWrap___aiBoW",tagJupyterNameWrap:"tagJupyterNameWrap___oX9QT",tagJupyterName:"tagJupyterName___wcrcb",imgWrap:"imgWrap___AsfvG",cardBottom:"cardBottom____ghZa",bottomNameWrap:"bottomNameWrap___O6cIY",bottomName:"bottomName___s6i6n",bottomContentWrap:"bottomContentWrap___BqnnB",bottomOwnerName:"bottomOwnerName___D8FPl",bottomVisitsCount:"bottomVisitsCount___TFnc8",excellentTag:"excellentTag___IyAVX",righttag:"righttag___QMlGE",tagY:"tagY___S9fxB",tagB:"tagB___R3ZdV",text:"text___vAK5m"},L=u(99232),S=u.n(L),f=u(15826),h=u(73304),p=({data:d,number:g,params:n,setParams:i,getPaths:C})=>{const P=[{title:"\u5E8F\u53F7",dataIndex:"index",key:"index",width:55,render:(r,c,s)=>e.createElement("span",null,g+s+1)},{title:"\u5B9E\u8DF5\u8BFE\u7A0B\u540D\u79F0",dataIndex:"name",sorter:!0,sortOrder:n.sort_by==="name"?n.sort_direction==="desc"?"descend":"ascend":null,key:"name",render:r=>e.createElement(w.Z,{title:r,placement:"bottomLeft"},e.createElement("span",{className:B.text},r))},{title:"\u7BA1\u7406\u5458",dataIndex:"owner_name",key:"owner_name",width:78,ellipsis:!0,render:r=>e.createElement(w.Z,{title:r||"--",placement:"bottomLeft"},e.createElement("span",null,r||"--"))},{title:"\u5408\u4F5C\u8005",dataIndex:"members",key:"members",width:134,ellipsis:!0,render:r=>e.createElement(w.Z,{title:r.join("\u3001"),placement:"bottomLeft"},e.createElement("span",null,r.join("\u3001")))},{title:"\u5B66\u4E60\u4EBA\u6570",dataIndex:"members_count",width:80,key:"members_count",render:r=>e.createElement("span",{className:"c-grey-666"},r)},{title:"\u521B\u5EFA\u65F6\u95F4",dataIndex:"created_at",key:"created_at",sorter:!0,sortOrder:n.sort_by==="created_at"?n.sort_direction==="desc"?"descend":"ascend":null,width:110,render:r=>e.createElement("span",{className:"c-grey-666"},S()(r).format("YYYY-MM-DD"))},{title:"\u7AE0\u8282\u6570",dataIndex:"stages_count",width:70,key:"stages_count",render:r=>e.createElement("span",{className:"c-grey-666"},r)},{title:"\u5B9E\u8BAD\u6570",dataIndex:"shixuns_count",width:70,key:"shixuns_count",render:r=>e.createElement("span",{className:"c-grey-666"},r)},{title:"\u8BFE\u7A0B\u6807\u7B7E",dataIndex:"excellent",width:88,key:"excellent",align:"center",render:(r,c)=>e.createElement(e.Fragment,null,c.featured>0&&e.createElement("div",{className:B.tagY},c.featured===1&&"\u56FD\u5BB6\u4E00\u6D41",c.featured===2&&"\u519B\u961F\u4E00\u6D41",c.featured===3&&"\u7701\u7EA7\u4E00\u6D41",c.featured===4&&"\u7CBE\u54C1\u8BFE\u7A0B"),r&&e.createElement("div",{className:B.tagB},"\u5F00\u653E\u8BFE\u7A0B"),!(c!=null&&c.featured)&&!r&&e.createElement("span",{className:"c-grey-666"},"- -"))},{title:"\u64CD\u4F5C",dataIndex:"name",key:"name",width:65,align:"right",render:(r,c)=>e.createElement("span",{className:"current-primary",onClick:s=>{s.stopPropagation(),(0,f.xg)(`/paths/${c.id}`)}},"\u8BE6\u60C5")}];return e.createElement(e.Fragment,null,e.createElement(h.Gi,null,e.createElement(O.default,{style:{cursor:"pointer"},onRow:r=>({onClick:c=>{window.open(`/paths/${r.id}`,"_blank")}}),onChange:(r,c,s)=>{s.field&&(n.sort_by=s.field),s.order||(n.sort_direction="asc"),s.order==="ascend"&&(n.sort_direction="asc"),s.order==="descend"&&(n.sort_direction="desc"),s.order||(n.sort_direction="asc"),i(n),C(n)},pagination:!1,dataSource:d,columns:P})))},l=u(89392),m=u(35099),N=Object.getOwnPropertySymbols,W=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable,z=(d,g)=>{var n={};for(var i in d)W.call(d,i)&&g.indexOf(i)<0&&(n[i]=d[i]);if(d!=null&&N)for(var i of N(d))g.indexOf(i)<0&&R.call(d,i)&&(n[i]=d[i]);return n},A=(d,g,n)=>new Promise((i,C)=>{var P=s=>{try{c(n.next(s))}catch(x){C(x)}},r=s=>{try{c(n.throw(s))}catch(x){C(x)}},c=s=>s.done?i(s.value):Promise.resolve(s.value).then(P,r);c((n=n.apply(d,g)).next())});const J=d=>{var g=d,{user:n,userDetail:i,globalSetting:C,loading:P,dispatch:r}=g,c=z(g,["user","userDetail","globalSetting","loading","dispatch"]),s,x;const[y]=(0,b.useSearchParams)(),G=(0,b.useLocation)(),F=(0,e.useRef)(),[t,E]=(0,e.useState)({}),[V,q]=(0,e.useState)(0),[Q,ee]=(0,e.useState)([]),[D,te]=(0,e.useState)(),[de,_e]=(0,e.useState)(!1),[me,pe]=(0,e.useState)([{label:e.createElement("span",{className:"icon-juxingfenbu font14"}),value:1},{label:e.createElement("span",{className:"icon-liebiaofenbu font14"}),value:2}]),[T,K]=(0,e.useState)(parseInt(localStorage.getItem("PathShowtype"))||1),ae=(0,e.useRef)((0,l.throttle)(a=>Y(a),500,{trailing:!1}));(0,e.useEffect)(()=>{ae.current=(0,l.throttle)(Y,500,{trailing:!1})},[t]),(0,e.useEffect)(()=>{var a;F.current=(a=G.pathname.split("/"))==null?void 0:a[2];const o={category:y.get("category")||"",status:y.get("category")==="manage"?X.map(Z=>Z.id).includes(y.get("status"))?y.get("status"):"":(y.get("category")==="study"||y.get("category")==="collect")&&U.map(Z=>Z.id).includes(y.get("status"))?y.get("status"):"",page:1,per_page:15,sort_by:"updated_at",sort_direction:"desc",username:F.current};E(o),v(o)},[G.pathname]),(0,e.useEffect)(()=>{var a;te(((a=n.userInfo)==null?void 0:a.login)===F.current)},[(s=n.userInfo)==null?void 0:s.login,F.current]);const v=a=>A(void 0,null,function*(){const o=yield r({type:"userDetail/getPaths",payload:a});o&&(q((o==null?void 0:o.count)||0),ee((o==null?void 0:o.subjects)||[]))}),Y=a=>{var o;t.category=a,t.status="",(o=window.location.href.toString())!=null&&o.includes("category")?((0,f.jz)("category",a),(0,f.jz)("status","")):window.history.replaceState(null,"",window.location.href.indexOf("?")>-1?window.location.href+`&category=${a}`:`?category=${a}`),t.page=1,E(t),v(t)},re=a=>{var o;t.status=a,t.page=1,(o=window.location.href.toString())!=null&&o.includes("status")?(0,f.jz)("status",a):window.history.replaceState(null,"",window.location.href.indexOf("?")>-1?window.location.href+`&status=${a}`:`?status=${a}`),E(t),v(t)},ne=a=>{t.sort_direction=a,E(t),v(t)},oe=a=>{t.sort_by=a,t.sort_direction="desc",E(t),v(t)},se=(a,o)=>{t.page=a,t.per_page=o,E(t),v(t)},ue=a=>{t.search=a,t.page=1,E(t),v(t)},le=a=>{t.search=a,E(t)},ge=()=>{let a=t.category=="collect"?"\u5171\u6536\u85CF":"\u5171\u53C2\u4E0E",o="";return t.category==="collect"&&(o=""),t.category==="manage"&&(o="\u53D1\u5E03"),t.category==="study"&&(o="\u5B66\u4E60"),t.category||(o="\u5B9E\u8DF5\u8BFE\u7A0B"),`${a}${V}\u4E2A${o}`},fe=()=>t.sort_by==="updated_at"?"\u6700\u8FD1\u66F4\u65B0":t.sort_by==="created_at"?"\u6700\u65B0\u521B\u5EFA":t.sort_by==="name"?"\u540D\u79F0\u6392\u5E8F":"",ce=[{id:"",name:"\u5168\u90E8"},{id:"manage",name:`${D?"\u6211":"TA"}\u7BA1\u7406\u7684`},{id:"study",name:`${D?"\u6211":"TA"}\u5B66\u4E60\u7684`},{id:"collect",name:`${D?"\u6211":"TA"}\u6536\u85CF\u7684`},{id:"payed",name:`${D?"\u6211":"TA"}\u8D2D\u4E70\u7684`}],U=[{id:"",name:"\u5168\u90E8"},{id:"unfinished",name:"\u672A\u5B8C\u6210"},{id:"finished",name:"\u5DF2\u5B8C\u6210"}],X=[{id:"",name:"\u5168\u90E8"},{id:"editing",name:"\u7F16\u8F91\u4E2D"},{id:"applying",name:"\u5F85\u5BA1\u6838"},{id:"published",name:"\u5DF2\u53D1\u5E03"}],ie=t.category==="manage"?X:(t==null?void 0:t.category)==="study"||(t==null?void 0:t.category)==="collect"||(t==null?void 0:t.category)==="payed"?U:[];return e.createElement("div",{className:_.wrap},e.createElement(h.YG,{value:t.category,onChange:Y,tabBarExtraContent:e.createElement(h.t7,{style:{width:303},placeholder:"\u641C\u7D22\u5B9E\u8DF5\u8BFE\u7A0B",value:t.search,onChange:ue,onInputChange:le}),className:"mb25",dataSource:ce}),D&&!!t.category&&e.createElement(h.qp,{title:"\u72B6\u6001",value:t.status,onChange:re,dataSource:ie,titleWidth:28}),e.createElement("div",{className:_.midWrap},e.createElement(h.cq,{sortValue:t.sort_direction,dropValue:t.sort_by,onSort:ne,onDrop:oe}),e.createElement("div",{className:_.type},e.createElement("i",{className:T===1?`iconfont icon-fenbu ${_.cursorPointer} ${_.color0152d9}`:`iconfont icon-fenbu ${_.cursorPointer}`,onClick:()=>{K(1),localStorage.setItem("PathShowtype","1")}}),e.createElement("span",{className:_.orderDesc},e.createElement("i",{className:T===2?`iconfont icon-fenbu-2 ${_.cursorPointer} ${_.color0152d9} `:`iconfont icon-fenbu-2 ${_.cursorPointer}`,onClick:()=>{K(2),localStorage.setItem("PathShowtype","2")}}))),!(((x=n.userInfo)==null?void 0:x.identity)==="student"&&!(0,m.Ny)())&&e.createElement(h.op,{style:{marginLeft:"auto"},className:_.btn,onClick:()=>b.history.push(`/paths/new?username=${F.current}`)},"\u65B0\u5EFA\u5B9E\u8DF5\u8BFE\u7A0B")),e.createElement($.Z,{loading:P["userDetail/getPaths"],active:!0,paragraph:{rows:5}},T==1&&e.createElement(h.cQ,{dataSource:Q,right:23,col:3,wrapWidth:887,loading:!1}),T!=1&&e.createElement("div",{className:"mt10",style:{minHeight:400}},e.createElement(p,{number:(t.page-1)*t.per_page,data:Q,params:t,setParams:E,getPaths:v})),V>0&&e.createElement("div",{className:_.countWrap},e.createElement(j.Z,{showQuickJumper:!0,showSizeChanger:!0,pageSizeOptions:["10","15","50","100","200"],total:V,onChange:(a,o)=>{se(a,o)},pageSize:t.per_page,hideOnSinglePage:!0,current:t.page}))))};var M=(0,b.connect)(({user:d,userDetail:g,loading:n,globalSetting:i})=>({user:d,userDetail:g,globalSetting:i,loading:n.effects}))(J)}}]);
|