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.
1 line
7.2 KiB
1 line
7.2 KiB
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[4736],{2187:function(e,a,n){n.r(a),n.d(a,{default:function(){return D}});var t=n(17061),o=n.n(t),c=n(17156),s=n.n(c),r=n(27424),i=n.n(r),l=n(70215),_=n.n(l),u=n(67294),d=n(88275),p=n(4310),m=n(34435),h="wrap___tNiRV",x="cardWrap___HHTqe",f="countWrap___zGG_l",g=n(4393),v={flex_box_center:"flex_box_center___JwugP",flex_space_between:"flex_space_between___Noq8b",flex_box_vertical_center:"flex_box_vertical_center___HCspq",flex_box_center_end:"flex_box_center_end___SVOIs",flex_box_column:"flex_box_column___mhoeu",wrap:"wrap____klhy",lockWrap:"lockWrap___onzlV",lockIcon:"lockIcon___nMIxN",topWrap:"topWrap___cwznr",bottomWrap:"bottomWrap___q9x5h",bottom:"bottom___mzMmr",bottomIconSpan:"bottomIconSpan___iUkhS",public:"public___Eb0Z9",borderFF6800:"borderFF6800____0Dfx",publicIcon:"publicIcon___r8mDR",publicText:"publicText___BuBKE",lockText:"lockText___xpO23",createIconWrap:"createIconWrap___a7ovS",createIcon:"createIcon___eai3X",leftIcon:"leftIcon___coXUA",rightIcon:"rightIcon___oJVkv",createTextWrap:"createTextWrap___Ddqkm",createText:"createText___Lri5K",title:"title___wDXDf",img:"img___MTAfi",teacherName:"teacherName___yP9fk",school:"school___GvxFu",color989898:"color989898___i5Xca",teacherUsers:"teacherUsers___rO2tG",sign:"sign___Ow0aN"},j=n(7303),b=n(85893),w=function(e){var a=e.url,n=e.name,t=e.dispatch;return(0,b.jsx)("a",{href:a,className:v.wrap,onClick:function(){(0,j.tJ)(t)&&d.history.push(a)},children:(0,b.jsx)(g.Z,{className:"animated fadeIn",children:(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:v.createIconWrap,children:(0,b.jsx)("div",{className:v.createIcon,children:(0,b.jsx)("i",{className:"iconfont icon-xiangmu2"})})}),(0,b.jsx)("div",{className:v.createTextWrap,children:n})]})})})},N=n(82982),I=n(83062),S=n(59758),y=function(e){var a=e.data,n=e.old_url;return(0,b.jsx)(u.Fragment,{children:a&&a.map((function(e,a){var t,o,c;return(0,b.jsx)("a",{className:v.wrap,href:"".concat(n).concat(e.project_url),onClick:function(){e.can_visited&&(window.location.href="".concat(n).concat(e.project_url))},children:(0,b.jsxs)(g.Z,{className:"animated fadeIn ".concat(v.cardWrap),children:[e.is_public&&(0,b.jsx)("span",{className:v.sign,children:"公开"}),!e.can_visited&&(0,b.jsxs)("div",{className:v.lockWrap,children:[(0,b.jsx)("div",{className:"mt80 mb25",children:(0,b.jsx)("i",{className:"iconfont icon-guansuo ".concat(v.lockIcon)})}),(0,b.jsx)("p",{className:v.lockText,children:"非成员不能访问"})]}),(0,b.jsxs)("div",{className:v.topWrap,children:[(0,b.jsx)(I.Z,{title:e.name,children:(0,b.jsx)("p",{className:v.title,children:e.name})}),(0,b.jsx)("span",{children:(0,b.jsx)("img",{className:v.img,alt:"用户",height:"50",width:"50",src:"".concat(S.Z.IMG_SERVER,"/images/").concat(null===(t=e.owner)||void 0===t?void 0:t.avatar_url)})}),(0,b.jsx)("p",{className:v.teacherName,children:(0,b.jsx)("span",{title:null===(o=e.owner)||void 0===o?void 0:o.real_name,children:null===(c=e.owner)||void 0===c?void 0:c.real_name})}),(0,b.jsx)("p",{className:v.school,children:(0,b.jsx)("span",{className:v.color989898,children:null==e?void 0:e.owner.school_name})})]}),(0,b.jsx)("div",{className:v.bottomWrap,children:(0,b.jsxs)("div",{className:v.bottom,children:[e.members_count>0&&(0,b.jsx)(I.Z,{placement:"bottom",title:"成员",children:(0,b.jsxs)("span",{className:v.bottomIconSpan,children:[(0,b.jsx)("i",{className:"iconfont icon-chengyuan font12"}),e.members_count]})}),e.issues_count>0&&(0,b.jsx)(I.Z,{placement:"bottom",title:"issues数",children:(0,b.jsxs)("span",{className:v.bottomIconSpan,children:[(0,b.jsx)("i",{className:"iconfont icon-issue font12"}),e.issues_count]})}),e.changesets_count>0&&(0,b.jsx)(I.Z,{placement:"bottom",title:"版本库",children:(0,b.jsxs)("span",{className:v.bottomIconSpan,children:[(0,b.jsx)("i",{className:"iconfont icon-banbenku font12"}),e.changesets_count]})})]})})]})},e.id)}))})},k=n(82749),W=n(29427),T=["user","userDetail","globalSetting","loading","dispatch"],D=(0,d.connect)((function(e){var a=e.user,n=e.userDetail,t=e.loading;return{user:a,userDetail:n,globalSetting:e.globalSetting,loading:t.effects}}))((function(e){var a,n,t,c,r,l=e.user,g=(e.userDetail,e.globalSetting,e.loading),v=e.dispatch,j=(_()(e,T),(0,d.useSearchParams)()),I=i()(j,1)[0],S=(0,d.useLocation)(),D=(0,u.useState)({}),Z=i()(D,2),z=Z[0],C=Z[1],q=(0,u.useRef)(),V=(0,u.useState)(0),E=i()(V,2),F=E[0],G=E[1],O=(0,u.useState)([]),P=i()(O,2),R=P[0],A=P[1],J=(0,u.useState)(),M=i()(J,2),U=M[0],X=M[1];(0,u.useEffect)((function(){var e;q.current=null===(e=S.pathname.split("/"))||void 0===e?void 0:e[2];var a={category:I.get("category")||"",status:I.get("status")||"",page:1,per_page:15,sort_by:"updated_on",sort_direction:"desc",username:q.current};C(a),H(a)}),[S.pathname]),(0,u.useEffect)((function(){var e;X((null===(e=l.userInfo)||void 0===e?void 0:e.login)===q.current)}),[null===(a=l.userInfo)||void 0===a?void 0:a.login,q.current]);var H=function(){var e=s()(o()().mark((function e(a){var n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v({type:"userDetail/getProjects",payload:a});case 2:(n=e.sent)&&(G(n.count||0),A(n.projects||[]));case 4:case"end":return e.stop()}}),e)})));return function(a){return e.apply(this,arguments)}}(),B=[{id:"",name:"全部"},{id:"manage",name:"".concat(U?"我":"TA","管理的")},{id:"study",name:"".concat(U?"我":"TA","学习的")}];return(0,b.jsxs)("div",{className:h,children:[(0,b.jsx)(k.YG,{value:z.category,onChange:function(e){var a;z.category=e,z.status="",z.page=1,null!==(a=window.location.href.toString())&&void 0!==a&&a.includes("category")?((0,W.jz)("category",e),(0,W.jz)("status","")):window.history.replaceState(null,"",window.location.href.indexOf("?")>-1?window.location.href+"&category=".concat(e):"?category=".concat(e)),C(z),H(z)},className:"mb25",dataSource:B}),U&&(0,b.jsx)(k.qp,{title:"状态",value:z.status,onChange:function(e){var a;z.status=e,z.page=1,null!==(a=window.location.href.toString())&&void 0!==a&&a.includes("status")?(0,W.jz)("status",e):window.history.replaceState(null,"",window.location.href.indexOf("?")>-1?window.location.href+"&status=".concat(e):"?status=".concat(e)),C(z),H(z)},dataSource:[{id:"",name:"全部"},{id:"publicly",name:"公开"},{id:"personal",name:"私有"}],titleWidth:28}),(0,b.jsx)(k.cq,{dataSource:[{id:"updated_on",name:"最新动态"},{id:"created_on",name:"最新创建"}],sortValue:z.sort_direction,dropValue:z.sort_by,onSort:function(e){z.sort_direction=e,C(z),H(z)},onDrop:function(e){z.sort_by=e,z.sort_direction="desc",C(z),H(z)}}),(0,b.jsxs)(p.Z,{loading:g["userDetail/getProjects"],active:!0,paragraph:{rows:5},children:[(0,b.jsxs)("div",{className:x,children:[1===z.page&&U&&!z.category&&(0,b.jsx)(w,{url:"".concat(null===(n=l.navigationInfo)||void 0===n||null===(t=n.top)||void 0===t?void 0:t.old_url,"/projects/deposit/new"),name:"新建开发项目",dispatch:v}),!R.length&&z.category&&(0,b.jsx)(N.Z,{}),(0,b.jsx)(y,{data:R,old_url:null===(c=l.navigationInfo)||void 0===c||null===(r=c.top)||void 0===r?void 0:r.old_url})]}),F>15&&(0,b.jsx)("div",{className:f,children:(0,b.jsx)(m.Z,{showQuickJumper:!0,showSizeChanger:!1,total:F,onChange:function(e){return function(e){z.page=e,C(z),H(z)}(e)},pageSize:16,current:z.page})})]})]})}))}}]); |