forked from Gitlink/forgeplus
1 line
6.0 KiB
JavaScript
1 line
6.0 KiB
JavaScript
(this.webpackJsonp=this.webpackJsonp||[]).push([[96],{Hsgt:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=l(a("5rEg"));a("1vPl");var r=l(a("q1tI"));function l(e){return e&&e.__esModule?e:{default:e}}var u=n.default.Search;t.default=function(e){var t=e.placeholder,a=e.onSearch,n=e.onChange;return r.default.createElement(u,{allowClear:!0,placeholder:t,enterButton:"搜索",onSearch:a,width:"300px",onChange:n})}},"Ie+W":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=s(a("2/Rp")),r=s(a("CtXQ")),l=s(a("lrIw")),u=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,i=e[Symbol.iterator]();!(n=(u=i.next()).done)&&(a.push(u.value),!t||a.length!==t);n=!0);}catch(e){r=!0,l=e}finally{try{!n&&i.return&&i.return()}finally{if(r)throw l}}return a}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};a("L/Qf"),a("2oDE"),a("bipt");var i=a("q1tI"),o=s(i),c=s(a("vDqi")),d=a("sYIF");function s(e){return e&&e.__esModule?e:{default:e}}var f=l.default.Option;t.default=function(e){var t=e.getID,a=e.login,s=e.showNotification,m=(0,i.useState)(void 0),h=u(m,2),p=h[0],v=h[1],g=(0,i.useState)(void 0),E=u(g,2),y=E[0],w=E[1],b=(0,i.useState)(void 0),I=u(b,2),S=I[0],_=I[1];return(0,i.useEffect)((function(){c.default.get("/users/list.json",{params:{search:S}}).then((function(e){var t,a;e&&(t=e.data.users,a=t&&t.map((function(e,t){return o.default.createElement(f,{key:t,value:""+e.user_id,login:""+e.login,name:e.username},o.default.createElement("img",{className:"user_img radius",width:"28",height:"28",src:(0,d.getImageUrl)("/"+(e&&e.image_url)),alt:""}),o.default.createElement("span",{className:"ml10",style:{verticalAlign:"middle"}},e.username,o.default.createElement("span",{className:"color-grey ml10"},"(",e.login,")")))})),w(a))})).catch((function(e){console.log(e)}))}),[S]),o.default.createElement("div",{className:"addPanel"},o.default.createElement(l.default,{dataSource:y,value:S,style:{width:300},onChange:function(e){_(e)},onSelect:function(e,t){v(a?e:t.props.login),_(t.props.name)},placeholder:"搜索需要添加的用户...",allowClear:!0}),o.default.createElement(n.default,{type:"primary",ghost:!0,onClick:function(){y&&y.length>0?(t&&t(p),_(void 0)):s("请选择存在的用户!")},className:"ml15"},o.default.createElement(r.default,{type:"plus",size:"16"}),"添加成员"))}},X3Qn:function(e,t,a){},"aQ+q":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,r,l=b(a("W9HT")),u=b(a("NUBc")),i=b(a("wCAj")),o=b(a("NJEC")),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,i=e[Symbol.iterator]();!(n=(u=i.next()).done)&&(a.push(u.value),!t||a.length!==t);n=!0);}catch(e){r=!0,l=e}finally{try{!n&&i.return&&i.return()}finally{if(r)throw l}}return a}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},d=(n=["{\n width:30px;\n height:30px;\n border-radius:50%;\n}"],r=["{\n width:30px;\n height:30px;\n border-radius:50%;\n}"],Object.freeze(Object.defineProperties(n,{raw:{value:Object.freeze(r)}})));a("04bd"),a("YQTV"),a("mbEz"),a("k994");var s=a("q1tI"),f=b(s),m=a("spEH"),h=b(a("ess8")),p=b(a("Hsgt")),v=b(a("Ie+W"));a("X3Qn");var g=b(a("vOnD")),E=a("sYIF"),y=b(a("vDqi")),w=a("eO8H");function b(e){return e&&e.__esModule?e:{default:e}}var I=g.default.img(d);t.default=function(e){var t=(0,s.useState)(1),a=c(t,2),n=a[0],r=a[1],d=(0,s.useState)(0),g=c(d,2),b=g[0],S=g[1],_=(0,s.useState)(void 0),x=c(_,2),N=x[0],j=x[1],C=(0,s.useState)(!1),O=c(C,2),z=O[0],k=O[1],A=(0,s.useState)(void 0),M=c(A,2),T=M[0],q=M[1],D=(0,s.useState)(void 0),H=c(D,2),P=H[0],Q=H[1],J=e.match.params,W=J.OIdentifier,B=J.groupId;function F(){k(!0);var e="/organizations/"+W+"/teams/"+B+"/team_users.json";y.default.get(e,{params:{page:n,search:P,identify:T,limit:15}}).then((function(e){e&&e.data&&(j(e.data.team_users),S(e.data.total_count))})).catch((function(e){})),k(!1)}(0,s.useEffect)((function(){F()}),[n,P,T]);var U=[{title:"头像",dataIndex:"Img",width:"7%",render:function(e,t){return f.default.createElement(I,{src:(0,E.getImageUrl)("/"+t.user.image_url)})}},{title:"用户名",dataIndex:"name",width:"13%",align:"center",render:function(e,t){return f.default.createElement(w.Link,{to:"/"+t.user.login},t.user.name)}},{title:"邮箱",dataIndex:"email",width:"25%",render:function(e,t){return t.user.mail}},{title:"操作",dataIndex:"operation",width:"15%",render:function(e,t){return f.default.createElement(o.default,{title:"确认移除成员吗?",onConfirm:function(){return function(e){k(!0);var t="/organizations/"+W+"/teams/"+B+"/team_users/"+e+".json";e&&y.default.delete(t).then((function(e){e&&e.data&&(r(1),Q(void 0),q(void 0),F())})).catch((function(e){})),k(!1)}(t.user.login)},okText:"确认",cancelText:"取消"},f.default.createElement("a",{className:"color-red"},"移除成员"))}}];return f.default.createElement(l.default,{spinning:z},f.default.createElement(m.WhiteBack,{style:{minHeight:"400px"}},f.default.createElement(h.default,null,f.default.createElement("span",null,"团队成员管理"),f.default.createElement(v.default,{getID:function(e){!function(e){k(!0);var t="/organizations/"+W+"/teams/"+B+"/team_users.json";e&&y.default.post(t,{username:e}).then((function(e){e&&e.data&&(r(1),Q(void 0),q(void 0),F())})).catch((function(e){}));k(!1)}(e)},showNotification:e.showNotification})),f.default.createElement(m.FlexAJ,{className:"padding20-30"},f.default.createElement("div",{style:{width:"580px"}},f.default.createElement(p.default,{placeholder:"输入用户名或邮箱、团队名搜索",value:P,onSearch:function(e){return Q(e)}}))),f.default.createElement("div",{className:"pl30 pr30 pb30"},f.default.createElement(i.default,{size:"small",columns:U,dataSource:N,pagination:!1,className:"teamMemberTable"}),b>15?f.default.createElement("div",{className:"edu-txt-center mt30 mb20"},f.default.createElement(u.default,{simple:!0,defaultCurrent:n,total:b,pageSize:15,onChange:function(e){return r(e)}})):"")))}}}]); |