(this.webpackJsonp=this.webpackJsonp||[]).push([[105],{"+hnl":function(e,t,n){},MKzF:function(e,t,n){"use strict";n.r(t);n("SchZ"),n("+hnl")},kaz8:function(e,t,n){"use strict";n.r(t);var r=n("q1tI"),a=n("17x9"),o=n("VCL8"),l=n("TSYQ"),u=n.n(l),i=n("x1Ya"),c=n("Gytx"),s=n.n(c),f=n("H84U"),p=n("6CfX");function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m(){return(m=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(v=t.getOptions().map((function(e){return r.createElement(j,{prefixCls:d,key:e.value.toString(),disabled:"disabled"in e?e.disabled:o.disabled,value:e.value,checked:-1!==l.value.indexOf(e.value),onChange:e.onChange,className:"".concat(y,"-item")},e.label)})));var h=u()(y,c);return r.createElement("div",P({className:h,style:s},m),v)},t.state={value:e.value||e.defaultValue||[],registeredValues:[]},t}return t=l,a=[{key:"getDerivedStateFromProps",value:function(e){return"value"in e?{value:e.value||[]}:null}}],(n=[{key:"getChildContext",value:function(){return{checkboxGroup:{toggleOption:this.toggleOption,value:this.state.value,disabled:this.props.disabled,name:this.props.name,registerValue:this.registerValue,cancelValue:this.cancelValue}}}},{key:"shouldComponentUpdate",value:function(e,t){return!s()(this.props,e)||!s()(this.state,t)}},{key:"getOptions",value:function(){return this.props.options.map((function(e){return"string"==typeof e?{label:e,value:e}:e}))}},{key:"render",value:function(){return r.createElement(f.a,null,this.renderGroup)}}])&&V(t.prototype,n),a&&V(t,a),l}(r.Component);L.defaultProps={options:[]},L.propTypes={defaultValue:a.array,value:a.array,options:a.array.isRequired,onChange:a.func},L.childContextTypes={checkboxGroup:a.any},Object(o.polyfill)(L);var U=L;j.Group=U;t.default=j},tlJt:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=s(n("8z0m")),a=s(n("CtXQ")),o=s(n("tsqr")),l=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,a=!1,o=void 0;try{for(var l,u=e[Symbol.iterator]();!(r=(l=u.next()).done)&&(n.push(l.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{!r&&u.return&&u.return()}finally{if(a)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};n("7W5+"),n("2oDE"),n("8/o9");var u=n("q1tI"),i=s(u),c=n("sYIF");function s(e){return e&&e.__esModule?e:{default:e}}t.default=function(e){var t=e.getImage,n=e.url,s=(0,u.useState)(void 0),f=l(s,2),p=f[0],d=f[1];return(0,u.useEffect)((function(){n&&d(n)}),[n]),i.default.createElement(r.default,{name:"file",listType:"picture-card",className:"avatar-uploader",showUploadList:!1,action:(0,c.getUploadActionUrl)(),beforeUpload:function(e){var t="image/jpeg"===e.type||"image/png"===e.type;t||o.default.error("上传的图片只能是JPG或者PNG格式!");var n=e.size/1024/1024<2;return n||o.default.error("上传的图片不能超过2MB!"),t&&n},onChange:function(e){var n,r,a;e&&e.file&&"done"===e.file.status&&(n=e.file.originFileObj,r=function(e){return d(e)},(a=new FileReader).addEventListener("load",(function(){return r(a.result)})),a.readAsDataURL(n),a.onload=function(e){t&&t(e.target.result)})}},p?i.default.createElement("img",{src:p,alt:"avatar",style:{width:"100%"}}):i.default.createElement("div",null,i.default.createElement(a.default,{type:"plus"}),i.default.createElement("div",{className:"ant-upload-text"},"点击上传")))}},vnWZ:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=y(n("2/Rp")),a=y(n("kaz8")),o=y(n("9yH6")),l=y(n("5rEg")),u=y(n("Vl3Y")),i=Object.assign||function(e){for(var t=1;t4&&void 0!==arguments[4])||arguments[4];return f.default.createElement(f.default.Fragment,null,f.default.createElement("span",{className:a?"lables must ":"lables"},e),f.default.createElement(u.default.Item,null,_(t,{rules:n,validateFirst:!0})(r)))}),[]);return(0,s.useEffect)((function(){V({visibility:"common"})}),[]),f.default.createElement("div",{className:"main",style:{padding:"0px",border:"none"}},f.default.createElement("div",{className:"teamBox"},f.default.createElement("p",{className:"teamBox-title"},"新建组织"),f.default.createElement(u.default,{className:"teamBox-form"},G(f.default.createElement("span",null,"组织账号:"),"name",[{required:!0,message:"请输入组织账号"},{validator:function(e,t,n){t||n(),t&&!t.match(/^[a-zA-Z0-9][a-zA-Z0-9_-]{3,19}$/)&&n("只能使用以字母、数字开头,包含字母、数字、下划线、横杠等,长度4到20个字符"),n()}}],f.default.createElement(l.default,{addonBefore:m?v+":"+m+"/":"https://"+v+"/",placeholder:"组织账号",maxLength:100})),G(f.default.createElement("span",null,"组织名称:"),"nickname",[{required:!0,message:"请输入组织名称"}],f.default.createElement(l.default,{placeholder:"请输入组织名称",maxLength:100})),f.default.createElement("div",{className:"pr"},f.default.createElement("span",{className:"toprightNum"},S,"/200"),G("组织描述","description",[{required:!0,message:"请输入组织描述"}],f.default.createElement(l.default.TextArea,{autoSize:{minRows:3,maxRows:5},placeholder:"请输入组织描述",maxLength:200,onChange:function(e){P(e.target.value?e.target.value.length:0)}}))),G("所在地区","location",[],f.default.createElement(l.default,{placeholder:"请输入地址",maxLength:50}),!1),G("可见性","visibility",[{required:!0,message:"请选择可见性"}],f.default.createElement(o.default.Group,{name:"exposure"},f.default.createElement(o.default,{style:R,value:"common",key:1},"公开"),f.default.createElement(o.default,{style:R,value:"limited",key:2},"受限",f.default.createElement("span",{className:"color-grey-8"},"(仅对登录用户可见)")),f.default.createElement(o.default,{style:R,value:"privacy",key:3},"私有",f.default.createElement("span",{className:"color-grey-8"},"(仅对组织成员可见)")))),f.default.createElement("p",{className:"font-16 lables must"},"选择头像"),f.default.createElement(p.default,{getImage:function(e){O(e),w(!1)}}),k&&f.default.createElement("p",{className:"color-red",style:{marginTop:"-10px"}},"请上传头像"),G("权限","repo_admin_change_team_access",[],f.default.createElement(a.default,{value:"1",key:1},"项目管理员可以添加或移除团队的访问权限"),!1))),f.default.createElement("p",{className:"mt20"},f.default.createElement(r.default,{type:"primary",className:"mr30",onClick:function(){N((function(e,t){if(!e){if(!g)return void w(!0);d.default.post("/organizations.json",i({},t,{image:g})).then((function(e){e&&e.data&&(n("组织创建成功!"),y.push("/"+e.data.name))})).catch((function(e){}))}}))}},"创建组织"),f.default.createElement(r.default,{className:"grey",onClick:function(){window.history.back(-1)}},"取消")))})))}}]);