forked from Gitlink/forgeplus
1 line
9.5 KiB
JavaScript
1 line
9.5 KiB
JavaScript
(this.webpackJsonp=this.webpackJsonp||[]).push([[77],{"4k9F":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,l,r=_(a("2/Rp")),u=_(a("fyUT")),i=_(a("PArb")),c=_(a("kaz8")),o=_(a("9yH6")),d=_(a("Vl3Y")),f=_(a("5rEg")),s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},m=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var a=[],n=!0,l=!1,r=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){l=!0,r=e}finally{try{!n&&i.return&&i.return()}finally{if(l)throw r}}return a}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},p=(n=["{\n padding:20px 30px;\n}"],l=["{\n padding:20px 30px;\n}"],Object.freeze(Object.defineProperties(n,{raw:{value:Object.freeze(l)}})));a("L/Qf"),a("QCje"),a("qNb/"),a("MKzF"),a("K4yd"),a("tULf"),a("1vPl");var v=a("q1tI"),h=_(v),g=a("spEH"),y=_(a("ess8")),E=_(a("vOnD")),b=_(a("tlJt")),x=_(a("vDqi")),w=_(a("kksi")),O=a("sYIF");function _(e){return e&&e.__esModule?e:{default:e}}var k=f.default.TextArea,N=E.default.div(p),j={display:"block",height:"30px",lineHeight:"30px"};t.default=d.default.create()((0,v.forwardRef)((function(e){var t=e.form,a=e.organizeDetail,n=e.showNotification,l=e.history,p=e.current_user,E=e.updateFunc,_=(0,v.useState)(void 0),C=m(_,2),P=C[0],S=C[1],z=(0,v.useState)(!1),I=m(z,2),T=I[0],q=I[1],A=(0,v.useState)(void 0),F=m(A,2),U=F[0],L=F[1],M=(0,v.useState)(!1),D=m(M,2),J=D[0],B=D[1],G=(0,v.useState)(!1),H=m(G,2),Q=H[0],R=H[1],Y=(0,v.useState)(0),V=m(Y,2),W=V[0],Z=V[1],K=t.getFieldDecorator,X=t.validateFields,$=t.setFieldsValue;(0,v.useEffect)((function(){a&&($(s({},a,{max_repo_creation:-1===a.max_repo_creation?"":a.max_repo_creation})),S(a.avatar_url),Z(a.description?a.description.length:0))}),[a]);var ee=(0,v.useCallback)((function(e,t,a,n,l,r,u){return h.default.createElement("div",null,h.default.createElement("span",{className:l?"required":""},e),h.default.createElement(d.default.Item,{help:u},K(t,{rules:a,validateFirst:!0,valuePropName:r?"checked":"value"})(n)))}),[]);return h.default.createElement("div",null,h.default.createElement(g.WhiteBack,null,h.default.createElement(y.default,null,"基本设置"),h.default.createElement(N,null,h.default.createElement(d.default,null,ee("组织账号:","name",[{required:!0,message:"请输入组织账号"},{validator:function(e,t,a){t||a(),t&&!t.match(/^[a-zA-Z][a-zA-Z0-9_-]{3,19}$/)&&a("只能使用以字母开头,包含字母、数字、下划线、横杠等,长度4到20个字符"),a()}}],h.default.createElement(f.default,{placeholder:"请输入组织账号",disabled:!0}),!0),ee("组织名称:","nickname",[{required:!0,message:"请输入组织名称"}],h.default.createElement(f.default,{placeholder:"请输入组织名称",maxLength:100}),!0),h.default.createElement("div",{className:"pr"},h.default.createElement("span",{className:"toprightNum"},W,"/200"),ee("组织描述:","description",[],h.default.createElement(k,{placeholder:"请输入组织名称",maxLength:200,onChange:function(e){Z(e.target.value?e.target.value.length:0)}}))),ee("官方网站:","website",[],h.default.createElement(f.default,{placeholder:"请输入官方网站"})),ee("所在地区:","location",[],h.default.createElement(f.default,{placeholder:"请输入城市"})),ee("可见性:","visibility",[],h.default.createElement(o.default.Group,null,h.default.createElement(o.default,{value:"common",style:j},"公开"),h.default.createElement(o.default,{value:"limited",style:j},"受限",h.default.createElement("span",null,"(仅对登录用户可见)")),h.default.createElement(o.default,{value:"privacy",style:j},"私有",h.default.createElement("span",null,"(仅对组织成员可见)")))),ee("权限:","repo_admin_change_team_access",[],h.default.createElement(c.default,{style:j},"项目管理员可以添加或移除团队的访问权限"),!1,!0),h.default.createElement(i.default,null),ee("最大仓库数:","max_repo_creation",[],h.default.createElement(u.default,{value:"-1",style:{width:"350px"}}),!1,!1,"当输入栏为空时,默认数量无限制"),h.default.createElement("p",null,"选择头像:"),h.default.createElement(b.default,{url:(0,O.getImageUrl)("/"+P),getImage:function(e){q(!0),S(e)}}),h.default.createElement(r.default,{type:"primary",onClick:function(){X((function(e,t){if(!e){var r="/organizations/"+a.id+".json";x.default.patch(r,s({},t,{image:T?P:void 0})).then((function(e){e&&e.data&&(n("组织信息更新成功!"),t.name!==a.name&&(console.log("false111"),l.push("/"+t.name+"/setting")),E&&E(t.name,t.description))})).catch((function(e){}))}}))}},"更新仓库设置")))),h.default.createElement(g.WhiteBack,{className:"padding20 mt20"},h.default.createElement("div",{className:"warningBox"},h.default.createElement("div",{className:"warningTitle"},"删除当前组织"),h.default.createElement("div",{className:"warningContent"},h.default.createElement("p",{className:"font-16 mb15"},"删除操作会永久清除该组织的信息,并且不可恢复!"),h.default.createElement(g.FlexAJ,null,h.default.createElement("div",null,h.default.createElement("span",{className:"required"},"密码:"),h.default.createElement(f.default,{type:"password",placeholder:"请输入当前用户的登录密码",style:{width:"350px"},value:U,onChange:function(e){return L(e.target.value)}}),J&&h.default.createElement("span",{className:"color-red ml10"},"请输入密码")),h.default.createElement("a",{className:"warningDelete",onClick:function(){U?(B(!1),R(!0)):B(!0)}},"删除组织"),h.default.createElement(w.default,{visible:Q,okText:"确定",cancelText:"取消",onCancel:function(){return R(!1)},onOk:function(){return function(e){var t="/organizations/"+a.id+".json";x.default.delete(t,{params:{password:e}}).then((function(e){e&&e.data&&l.push("/"+(p&&p.login)+"/organizes")})),R(!1)}(U)}},h.default.createElement("p",{className:"font-16 edu-txt-center"},"确定要删除当前组织吗?")))))))})))},PArb:function(e,t,a){"use strict";a.r(t);var n=a("q1tI"),l=a("TSYQ"),r=a.n(l),u=a("H84U");function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e}).apply(this,arguments)}function c(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}var o=function(e,t){var a={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(a[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(n=Object.getOwnPropertySymbols(e);l<n.length;l++)t.indexOf(n[l])<0&&Object.prototype.propertyIsEnumerable.call(e,n[l])&&(a[n[l]]=e[n[l]])}return a};t.default=function(e){return n.createElement(u.a,null,(function(t){var a,l=t.getPrefixCls,u=e.prefixCls,d=e.type,f=void 0===d?"horizontal":d,s=e.orientation,m=void 0===s?"center":s,p=e.className,v=e.children,h=e.dashed,g=o(e,["prefixCls","type","orientation","className","children","dashed"]),y=l("divider",u),E=m.length>0?"-".concat(m):m,b=r()(p,y,"".concat(y,"-").concat(f),(c(a={},"".concat(y,"-with-text").concat(E),v),c(a,"".concat(y,"-dashed"),!!h),a));return n.createElement("div",i({className:b},g,{role:"separator"}),v&&n.createElement("span",{className:"".concat(y,"-inner-text")},v))}))}},kksi:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(a("kLXV"));a("k3Gp");var l=r(a("q1tI"));function r(e){return e&&e.__esModule?e:{default:e}}t.default=function(e){var t=e.visible,a=e.okText,r=e.cancelText,u=e.onOk,i=e.onCancel,c=e.children;return l.default.createElement(n.default,{visible:t,okText:a,onCancel:i,onOk:u,cancelText:r,title:"提示",closable:!1,centered:!0},c)}},"qNb/":function(e,t,a){"use strict";a.r(t);a("SchZ"),a("txnC")},tlJt:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=d(a("8z0m")),l=d(a("CtXQ")),r=d(a("tsqr")),u=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var a=[],n=!0,l=!1,r=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){l=!0,r=e}finally{try{!n&&i.return&&i.return()}finally{if(l)throw r}}return a}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};a("7W5+"),a("2oDE"),a("8/o9");var i=a("q1tI"),c=d(i),o=a("sYIF");function d(e){return e&&e.__esModule?e:{default:e}}t.default=function(e){var t=e.getImage,a=e.url,d=(0,i.useState)(void 0),f=u(d,2),s=f[0],m=f[1];return(0,i.useEffect)((function(){a&&m(a)}),[a]),c.default.createElement(n.default,{name:"file",listType:"picture-card",className:"avatar-uploader",showUploadList:!1,action:(0,o.getUploadActionUrl)(),beforeUpload:function(e){var t="image/jpeg"===e.type||"image/png"===e.type;t||r.default.error("上传的图片只能是JPG或者PNG格式!");var a=e.size/1024/1024<2;return a||r.default.error("上传的图片不能超过2MB!"),t&&a},onChange:function(e){var a,n,l;e&&e.file&&"done"===e.file.status&&(a=e.file.originFileObj,n=function(e){return m(e)},(l=new FileReader).addEventListener("load",(function(){return n(l.result)})),l.readAsDataURL(a),l.onload=function(e){t&&t(e.target.result)})}},s?c.default.createElement("img",{src:s,alt:"avatar",style:{width:"100%"}}):c.default.createElement("div",null,c.default.createElement(l.default,{type:"plus"}),c.default.createElement("div",{className:"ant-upload-text"},"点击上传")))}},txnC:function(e,t,a){}}]); |