1 line
3.6 KiB
JavaScript
1 line
3.6 KiB
JavaScript
(this.webpackJsonp=this.webpackJsonp||[]).push([[155],{eWQA:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=p(a("W9HT")),r=p(a("NUBc")),l=p(a("VXEj")),u=p(a("NJEC")),o=p(a("lrIw")),c=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var a=[],n=!0,r=!1,l=void 0;try{for(var u,o=e[Symbol.iterator]();!(n=(u=o.next()).done)&&(a.push(u.value),!t||a.length!==t);n=!0);}catch(e){r=!0,l=e}finally{try{!n&&o.return&&o.return()}finally{if(r)throw l}}return a}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};a("04bd"),a("YQTV"),a("LXko"),a("k994"),a("bipt");var i=a("q1tI"),f=p(i),d=p(a("vDqi")),s=a("spEH"),m=p(a("ess8"));function p(e){return e&&e.__esModule?e:{default:e}}var h=o.default.Option;t.default=function(e){var t=(0,i.useState)(!1),a=c(t,2),p=a[0],E=a[1],v=(0,i.useState)(void 0),j=c(v,2),g=j[0],y=j[1],w=(0,i.useState)(1),S=c(w,2),_=S[0],b=S[1],k=(0,i.useState)(0),x=c(k,2),I=x[0],N=x[1],C=(0,i.useState)(void 0),z=c(C,2),T=z[0],A=z[1],J=(0,i.useState)(""),O=c(J,2),B=O[0],H=O[1],M=(0,i.useState)(void 0),V=c(M,2),W=V[0],q=V[1],L=e.match.params,Q=L.OIdentifier,X=L.groupId;function D(){E(!0);var e="/organizations/"+Q+"/teams/"+X+"/team_projects.json";d.default.get(e,{params:{page:_,limit:15}}).then((function(e){e&&e.data&&(y(e.data.team_projects),N(e.data.total_count))})).catch((function(e){})),E(!1)}return(0,i.useEffect)((function(){D()}),[_]),(0,i.useEffect)((function(){var e="/organizations/"+Q+"/projects/search.json";d.default.get(e,{params:{search:B}}).then((function(e){var t,a;e&&e.data&&(t=e.data.projects,a=t&&t.map((function(e,t){return f.default.createElement(h,{key:t,value:""+e.id,searchValue:""+e.name},e.name)})),q(a))})).catch((function(e){}))}),[B]),f.default.createElement(n.default,{spinning:p},f.default.createElement(s.WhiteBack,{className:"mb30"},f.default.createElement(m.default,null,f.default.createElement(s.FlexAJ,{style:{width:"100%"}},f.default.createElement("span",null,"团队项目管理"),f.default.createElement("div",null,f.default.createElement(o.default,{style:{width:300},placeholder:"搜索项目...",onChange:function(e){H(e||"")},onSelect:function(e){A(e),H(e)},allowClear:!0},W),f.default.createElement(s.Blueline,{className:"ml30",onClick:function(){return function(){if(T){E(!0);var t="/organizations/"+Q+"/teams/"+X+"/team_projects.json";d.default.post(t,{repo_name:T}).then((function(e){e&&e.data.id&&(b(1),D()),E(!1)})).catch((function(e){E(!1)}))}else e.showNotification("请选择要添加的项目!")}()}},"+ 添加项目")))),f.default.createElement("div",{className:"padding20-30",style:{paddingTop:"0px",minHeight:"400px"}},f.default.createElement(l.default,{itemLayout:"horizontal",dataSource:g,renderItem:function(e){return f.default.createElement(l.default.Item,{extra:f.default.createElement(u.default,{title:"确认移除项目吗?",onConfirm:function(){return function(e){E(!0);var t="/organizations/"+Q+"/teams/"+X+"/team_projects/"+e+".json";d.default.delete(t).then((function(e){e&&e.data.status>-1&&(b(1),D())})).catch((function(e){})),E(!1)}(e.project.identifier)},okText:"确认",cancelText:"取消"},f.default.createElement("a",{className:"color-red"},"移除"))},f.default.createElement(l.default.Item.Meta,{title:f.default.createElement("a",{href:"/"+e.project.owner_login+"/"+e.project.identifier},e.project.owner_name,"/",e.project.name)}))}})),I>15?f.default.createElement("div",{className:"edu-txt-center mt30 mb20"},f.default.createElement(r.default,{simple:!0,defaultCurrent:_,total:I,pageSize:15,onChange:function(e){b(e)}})):""))}}}]); |