forgeplus/public/react/build/static/js/45.ceeebba3.chunk.js

1 line
12 KiB
JavaScript

(this.webpackJsonp=this.webpackJsonp||[]).push([[45],{"0Cz8":function(e,t,n){var r=n("Xi7e"),o=n("ebwN"),a=n("e4Nc");e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var i=n.__data__;if(!o||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new a(i)}return n.set(e,t),this.size=n.size,this}},"5DC0":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o,a=g(n("NUBc")),i=g(n("wCAj")),c=g(n("NJEC")),u=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,a=void 0;try{for(var i,c=e[Symbol.iterator]();!(r=(i=c.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{!r&&c.return&&c.return()}finally{if(o)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},l=(r=["{\n width:30px;\n height:30px;\n border-radius:50%;\n}"],o=["{\n width:30px;\n height:30px;\n border-radius:50%;\n}"],Object.freeze(Object.defineProperties(r,{raw:{value:Object.freeze(o)}})));n("YQTV"),n("mbEz"),n("k994");var s=n("q1tI"),f=g(s),p=n("spEH"),d=g(n("ess8")),m=g(n("Hsgt")),b=g(n("vOnD")),y=n("sYIF"),v=g(n("vDqi")),h=n("eO8H");function g(e){return e&&e.__esModule?e:{default:e}}var _=b.default.img(l),x=[{img:"images/avatars/User/g",name:"蔡世",email:"1149225589@qq.com",team:"caicaizi",role:"管理者",operation:"移除成员"}];t.default=function(e){var t=e.organizeDetail,n=(0,s.useState)(void 0),r=u(n,2),o=(r[0],r[1],(0,s.useState)(1)),l=u(o,2),b=l[0],g=l[1],j=(0,s.useState)(15),E=u(j,2),O=E[0],w=(E[1],(0,s.useState)(0)),C=u(w,2),S=C[0],z=C[1],P=(0,s.useState)(void 0),k=u(P,2),A=k[0],N=k[1],T=(0,s.useState)(x),D=u(T,2),V=D[0],I=D[1];function B(e){var n="/organizations/"+t.id+"/organization_users.json";v.default.get(n,{params:{page:b,limit:O,search:e}}).then((function(e){e&&e.data&&(I(e.data.organization_users),z(e.data.total_count))})).catch((function(e){}))}(0,s.useEffect)((function(){t&&t.id&&B(A)}),[t,A]);var R=[{title:"头像",dataIndex:"user",width:"5%",render:function(e){return e&&f.default.createElement(h.Link,{to:"/"+(e&&e.login)},f.default.createElement(_,{src:(0,y.getImageUrl)("/"+e.image_url)})," ")}},{title:"用户名",dataIndex:"user",width:"15%",render:function(e,t){return f.default.createElement(h.Link,{to:"/"+(e&&e.login)},e&&e.name)}},{title:"邮箱",dataIndex:"user",width:"25%",align:"left",render:function(e){return e&&e.mail}},{title:"所属团队",dataIndex:"team_names",width:"20%",render:function(e){var t=e&&e.length>0&&e.map((function(e,t){return e+","}));return console.log(t&&t[0]),t&&t[0].substring(0,t[0].length-1)}},{title:"操作",dataIndex:"operation",width:"15%",render:function(e,n){var r=t&&t.is_admin,o=V&&1===V.length&&n.team_names&&1===n.team_names.length&&"Owners"===n.team_names[0];return r&&!o&&f.default.createElement(c.default,{title:"是否将此成员移出组织?",okText:"是",cancelText:"否",onConfirm:function(){return e=n.user&&n.user.login,r="/organizations/"+(t&&t.id)+"/organization_users/"+e+".json",void v.default.delete(r).then((function(e){e&&e.data&&B()})).catch((function(e){}));var e,r}},f.default.createElement("a",{className:"color-red"},"移除成员"))}}];return f.default.createElement(p.WhiteBack,null,f.default.createElement(d.default,null,f.default.createElement("span",null,"组织成员管理")),f.default.createElement(p.FlexAJ,{className:"padding20-30"},f.default.createElement("div",{style:{width:"580px"}},f.default.createElement(m.default,{placeholder:"输入用户名或邮箱、团队名搜索",onSearch:function(e){N(e)}}))),f.default.createElement("div",{className:"pl30 pr30 pb30",style:{minHeight:"400px"}},f.default.createElement(i.default,{size:"small",columns:R,dataSource:V,pagination:!1,className:"teamMemberTable"}),S>O?f.default.createElement("div",{className:"edu-txt-center mt30 mb20"},f.default.createElement(a.default,{simple:!0,current:b,total:S,pageSize:O,onChange:function(e){g(e)}})):""))}},"6sVZ":function(e,t){var n=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}},"77Zs":function(e,t,n){var r=n("Xi7e");e.exports=function(){this.__data__=new r,this.size=0}},B8du:function(e,t){e.exports=function(){return!1}},DSRE:function(e,t,n){(function(e){var r=n("Kz5y"),o=n("B8du"),a=t&&!t.nodeType&&t,i=a&&"object"==typeof e&&e&&!e.nodeType&&e,c=i&&i.exports===a?r.Buffer:void 0,u=(c?c.isBuffer:void 0)||o;e.exports=u}).call(this,n("YuTi")(e))},Hsgt:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n("5rEg"));n("1vPl");var o=a(n("q1tI"));function a(e){return e&&e.__esModule?e:{default:e}}var i=r.default.Search;t.default=function(e){var t=e.placeholder,n=e.onSearch,r=e.onChange;return o.default.createElement(i,{allowClear:!0,placeholder:t,enterButton:"搜索",onSearch:n,width:"300px",onChange:r})}},JHRd:function(e,t,n){var r=n("Kz5y").Uint8Array;e.exports=r},L8xA:function(e,t){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},MMmD:function(e,t,n){var r=n("lSCD"),o=n("shjB");e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},NJEC:function(e,t,n){"use strict";n.r(t);var r=n("q1tI"),o=n("VCL8"),a=n("3S7+"),i=n("CtXQ"),c=n("2/Rp"),u=n("YMnH"),l=n("ZvpZ"),s=n("H84U");function f(e){return(f="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 p(){return(p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function b(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}function y(e,t){return!t||"object"!==f(t)&&"function"!=typeof t?v(e):t}function v(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var g=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},_=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(f,e);var t,n,o,i=b(f);function f(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f),(t=i.call(this,e)).onConfirm=function(e){t.setVisible(!1,e);var n=t.props.onConfirm;n&&n.call(v(t),e)},t.onCancel=function(e){t.setVisible(!1,e);var n=t.props.onCancel;n&&n.call(v(t),e)},t.onVisibleChange=function(e){t.props.disabled||t.setVisible(e)},t.saveTooltip=function(e){t.tooltip=e},t.renderOverlay=function(e,n){var o=t.props,a=o.okButtonProps,i=o.cancelButtonProps,u=o.title,l=o.cancelText,s=o.okText,f=o.okType,d=o.icon;return r.createElement("div",null,r.createElement("div",{className:"".concat(e,"-inner-content")},r.createElement("div",{className:"".concat(e,"-message")},d,r.createElement("div",{className:"".concat(e,"-message-title")},u)),r.createElement("div",{className:"".concat(e,"-buttons")},r.createElement(c.default,p({onClick:t.onCancel,size:"small"},i),l||n.cancelText),r.createElement(c.default,p({onClick:t.onConfirm,type:f,size:"small"},a),s||n.okText))))},t.renderConfirm=function(e){var n=e.getPrefixCls,o=t.props,i=o.prefixCls,c=o.placement,s=g(o,["prefixCls","placement"]),f=n("popover",i),d=r.createElement(u.a,{componentName:"Popconfirm",defaultLocale:l.a.Popconfirm},(function(e){return t.renderOverlay(f,e)}));return r.createElement(a.default,p({},s,{prefixCls:f,placement:c,onVisibleChange:t.onVisibleChange,visible:t.state.visible,overlay:d,ref:t.saveTooltip}))},t.state={visible:e.visible},t}return t=f,o=[{key:"getDerivedStateFromProps",value:function(e){return"visible"in e?{visible:e.visible}:"defaultVisible"in e?{visible:e.defaultVisible}:null}}],(n=[{key:"getPopupDomNode",value:function(){return this.tooltip.getPopupDomNode()}},{key:"setVisible",value:function(e,t){var n=this.props;"visible"in n||this.setState({visible:e});var r=n.onVisibleChange;r&&r(e,t)}},{key:"render",value:function(){return r.createElement(s.a,null,this.renderConfirm)}}])&&d(t.prototype,n),o&&d(t,o),f}(r.Component);_.defaultProps={transitionName:"zoom-big",placement:"top",trigger:"click",okType:"primary",icon:r.createElement(i.default,{type:"exclamation-circle",theme:"filled"}),disabled:!1},Object(o.polyfill)(_),t.default=_},"UNi/":function(e,t){e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},VaNO:function(e,t){e.exports=function(e){return this.__data__.has(e)}},b80T:function(e,t,n){var r=n("UNi/"),o=n("03A+"),a=n("Z0cm"),i=n("DSRE"),c=n("wJg7"),u=n("c6wG"),l=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=a(e),s=!n&&o(e),f=!n&&!s&&i(e),p=!n&&!s&&!f&&u(e),d=n||s||f||p,m=d?r(e.length,String):[],b=m.length;for(var y in e)!t&&!l.call(e,y)||d&&("length"==y||f&&("offset"==y||"parent"==y)||p&&("buffer"==y||"byteLength"==y||"byteOffset"==y)||c(y,b))||m.push(y);return m}},c6wG:function(e,t,n){var r=n("dD9F"),o=n("sEf8"),a=n("mdPL"),i=a&&a.isTypedArray,c=i?o(i):r;e.exports=c},dD9F:function(e,t,n){var r=n("NykK"),o=n("shjB"),a=n("ExA7"),i={};i["[object Float32Array]"]=i["[object Float64Array]"]=i["[object Int8Array]"]=i["[object Int16Array]"]=i["[object Int32Array]"]=i["[object Uint8Array]"]=i["[object Uint8ClampedArray]"]=i["[object Uint16Array]"]=i["[object Uint32Array]"]=!0,i["[object Arguments]"]=i["[object Array]"]=i["[object ArrayBuffer]"]=i["[object Boolean]"]=i["[object DataView]"]=i["[object Date]"]=i["[object Error]"]=i["[object Function]"]=i["[object Map]"]=i["[object Number]"]=i["[object Object]"]=i["[object RegExp]"]=i["[object Set]"]=i["[object String]"]=i["[object WeakMap]"]=!1,e.exports=function(e){return a(e)&&o(e.length)&&!!i[r(e)]}},fmRc:function(e,t,n){var r=n("Xi7e"),o=n("77Zs"),a=n("L8xA"),i=n("gCq4"),c=n("VaNO"),u=n("0Cz8");function l(e){var t=this.__data__=new r(e);this.size=t.size}l.prototype.clear=o,l.prototype.delete=a,l.prototype.get=i,l.prototype.has=c,l.prototype.set=u,e.exports=l},gCq4:function(e,t){e.exports=function(e){return this.__data__.get(e)}},k994:function(e,t,n){"use strict";n.r(t);n("SchZ"),n("Aosp"),n("L/Qf")},kekF:function(e,t){e.exports=function(e,t){return function(n){return e(t(n))}}},mdPL:function(e,t,n){(function(e){var r=n("WFqU"),o=t&&!t.nodeType&&t,a=o&&"object"==typeof e&&e&&!e.nodeType&&e,i=a&&a.exports===o&&r.process,c=function(){try{var e=a&&a.require&&a.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=c}).call(this,n("YuTi")(e))},sEf8:function(e,t){e.exports=function(e){return function(t){return e(t)}}},zZ0H:function(e,t){e.exports=function(e){return e}}}]);