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__User__Detail__Projects__...

1 line
7.2 KiB

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[4736],{75814:function(e,a,n){n.r(a),n.d(a,{default:function(){return D}});var t=n(7557),o=n.n(t),c=n(41498),s=n.n(c),r=n(79800),i=n.n(r),l=n(39647),_=n.n(l),u=n(59301),d=n(49389),p=n(61621),m=n(58421),h="wrap___tNiRV",x="cardWrap___HHTqe",f="countWrap___zGG_l",g=n(18889),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(67554),b=n(37712),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(13767),I=n(6848),S=n(91689),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(940),W=n(83287),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=e.user,r=(e.userDetail,e.globalSetting,e.loading),l=e.dispatch,g=(_()(e,T),(0,d.useSearchParams)()),v=i()(g,1)[0],j=(0,d.useLocation)(),I=(0,u.useState)({}),S=i()(I,2),D=S[0],Z=S[1],z=(0,u.useRef)(),C=(0,u.useState)(0),q=i()(C,2),V=q[0],E=q[1],F=(0,u.useState)([]),G=i()(F,2),O=G[0],P=G[1],R=(0,u.useState)(),A=i()(R,2),J=A[0],M=A[1];(0,u.useEffect)((function(){var e;z.current=null===(e=j.pathname.split("/"))||void 0===e?void 0:e[2];var a={category:v.get("category")||"",status:v.get("status")||"",page:1,per_page:15,sort_by:"updated_on",sort_direction:"desc",username:z.current};Z(a),U(a)}),[j.pathname]),(0,u.useEffect)((function(){var e;M((null===(e=c.userInfo)||void 0===e?void 0:e.login)===z.current)}),[null===(a=c.userInfo)||void 0===a?void 0:a.login,z.current]);var U=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,l({type:"userDetail/getProjects",payload:a});case 2:(n=e.sent)&&(E(n.count||0),P(n.projects||[]));case 4:case"end":return e.stop()}}),e)})));return function(a){return e.apply(this,arguments)}}(),X=[{id:"",name:"全部"},{id:"manage",name:"".concat(J?"我":"TA","管理的")},{id:"study",name:"".concat(J?"我":"TA","学习的")}];return(0,b.jsxs)("div",{className:h,children:[(0,b.jsx)(k.YG,{value:D.category,onChange:function(e){var a;D.category=e,D.status="",D.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)),Z(D),U(D)},className:"mb25",dataSource:X}),J&&(0,b.jsx)(k.qp,{title:"状态",value:D.status,onChange:function(e){var a;D.status=e,D.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)),Z(D),U(D)},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:D.sort_direction,dropValue:D.sort_by,onSort:function(e){D.sort_direction=e,Z(D),U(D)},onDrop:function(e){D.sort_by=e,D.sort_direction="desc",Z(D),U(D)}}),(0,b.jsxs)(p.Z,{loading:r["userDetail/getProjects"],active:!0,paragraph:{rows:5},children:[(0,b.jsxs)("div",{className:x,children:[1===D.page&&J&&!D.category&&(0,b.jsx)(w,{url:"".concat(null===(n=c.navigationInfo)||void 0===n||null===(n=n.top)||void 0===n?void 0:n.old_url,"/projects/deposit/new"),name:"新建开发项目",dispatch:l}),!O.length&&D.category&&(0,b.jsx)(N.Z,{}),(0,b.jsx)(y,{data:O,old_url:null===(t=c.navigationInfo)||void 0===t||null===(t=t.top)||void 0===t?void 0:t.old_url})]}),V>15&&(0,b.jsx)("div",{className:f,children:(0,b.jsx)(m.Z,{showQuickJumper:!0,showSizeChanger:!1,total:V,onChange:function(e){return function(e){D.page=e,Z(D),U(D)}(e)},pageSize:16,current:D.page})})]})]})}))}}]);