build/static/js/73.ea14dfdf.chunk.js

1 line
18 KiB
JavaScript

(this.webpackJsonp=this.webpackJsonp||[]).push([[73],{Hsgt:function(e,t,n){"use strict";n("5NDa");var r=n("5rEg"),o=n("cDcd"),a=n.n(o),c=r.a.Search;t.a=function(e){var t=e.placeholder,n=e.onSearch,r=e.onChange;return a.a.createElement(c,{allowClear:!0,placeholder:t,enterButton:"搜索",onSearch:n,width:"300px",onChange:r})}},"Ie+W":function(e,t,n){"use strict";n("+L6B");var r=n("2/Rp"),o=n("zLi2"),a=n.n(o),c=(n("O3gP"),n("lrIw")),i=n("FLGM"),l=n.n(i),s=n("cDcd"),u=n.n(s),p=n("vDqi"),f=n.n(p),m=n("sYIF"),d=c.a.Option;t.a=function(e){var t=e.getID,n=e.login,o=e.showNotification,i=Object(s.useState)(void 0),p=a()(i,2),h=p[0],b=p[1],y=Object(s.useState)(void 0),v=a()(y,2),g=v[0],O=v[1],E=Object(s.useState)(void 0),w=a()(E,2),j=w[0],x=w[1];return Object(s.useEffect)((function(){f.a.get("/users/list.json",{params:{search:j}}).then((function(e){var t,n;e&&(n=(t=e.data.users)&&l()(t).call(t,(function(e,t){return u.a.createElement(d,{key:t,value:"".concat(e.user_id),login:"".concat(e.login),name:e.username},u.a.createElement("img",{className:"user_img radius",width:"28",height:"28",src:Object(m.h)("/".concat(e&&e.image_url)),alt:""}),u.a.createElement("span",{className:"ml10",style:{verticalAlign:"middle"}},e.username,u.a.createElement("span",{className:"color-grey ml10"},"(",e.login,")")))})),O(n))})).catch((function(e){}))}),[j]),u.a.createElement("div",{className:"addPanel"},u.a.createElement(c.a,{dataSource:g,value:j,style:{width:250},onChange:function(e){x(e)},onSelect:function(e,t){b(n?e:t.props.login),x(t.props.name)},placeholder:"搜索需要添加的用户...",allowClear:!0}),u.a.createElement(r.a,{type:"primary",ghost:!0,onClick:function(){g&&g.length>0&&j?(t&&t(h),x(void 0),b(void 0)):o("请选择存在的用户!")},className:"ml15"},u.a.createElement("i",{className:"iconfont icon-tianjiafangda mr3"}),"添加成员"))}},NJEC:function(e,t,n){"use strict";var r=n("cDcd"),o=n("VCL8"),a=n("3S7+"),c=n("CtXQ"),i=n("2/Rp"),l=n("YMnH"),s=n("ZvpZ"),u=n("H84U");function p(e){return(p="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 f(){return(f=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 m(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 d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e,t){return!t||"object"!==p(t)&&"function"!=typeof t?b(e):t}function b(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var v=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&&d(e,t)}(p,e);var t,n,o,c=function(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=y(e);if(t){var o=y(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h(this,n)}}(p);function p(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,p),(t=c.call(this,e)).onConfirm=function(e){t.setVisible(!1,e);var n=t.props.onConfirm;n&&n.call(b(t),e)},t.onCancel=function(e){t.setVisible(!1,e);var n=t.props.onCancel;n&&n.call(b(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,c=o.cancelButtonProps,l=o.title,s=o.cancelText,u=o.okText,p=o.okType,m=o.icon;return r.createElement("div",null,r.createElement("div",{className:"".concat(e,"-inner-content")},r.createElement("div",{className:"".concat(e,"-message")},m,r.createElement("div",{className:"".concat(e,"-message-title")},l)),r.createElement("div",{className:"".concat(e,"-buttons")},r.createElement(i.a,f({onClick:t.onCancel,size:"small"},c),s||n.cancelText),r.createElement(i.a,f({onClick:t.onConfirm,type:p,size:"small"},a),u||n.okText))))},t.renderConfirm=function(e){var n=e.getPrefixCls,o=t.props,c=o.prefixCls,i=o.placement,u=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}(o,["prefixCls","placement"]),p=n("popover",c),m=r.createElement(l.a,{componentName:"Popconfirm",defaultLocale:s.a.Popconfirm},(function(e){return t.renderOverlay(p,e)}));return r.createElement(a.a,f({},u,{prefixCls:p,placement:i,onVisibleChange:t.onVisibleChange,visible:t.state.visible,overlay:m,ref:t.saveTooltip}))},t.state={visible:e.visible},t}return t=p,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(u.a,null,this.renderConfirm)}}])&&m(t.prototype,n),o&&m(t,o),p}(r.Component);v.defaultProps={transitionName:"zoom-big",placement:"top",trigger:"click",okType:"primary",icon:r.createElement(c.a,{type:"exclamation-circle",theme:"filled"}),disabled:!1},Object(o.polyfill)(v),t.a=v},"O/iA":function(e,t,n){var r=n("SE3x");"string"==typeof r&&(r=[[e.i,r,""]]);n("aET+")(r,{hmr:!0,transform:void 0}),r.locals&&(e.exports=r.locals)},O3gP:function(e,t,n){"use strict";n("cIOH"),n("O/iA"),n("OaEy"),n("5NDa")},P2fV:function(e,t,n){"use strict";n("cIOH"),n("Q9mQ"),n("+L6B")},SE3x:function(e,t,n){(t=n("JPst")(!1)).push([e.i,"/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */\n/* stylelint-disable no-duplicate-selectors */\n/* stylelint-disable */\n/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors,string-no-newline */\n.ant-select-auto-complete {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n color: rgba(0, 0, 0, 0.65);\n font-size: 14px;\n font-variant: tabular-nums;\n line-height: 1.5;\n list-style: none;\n font-feature-settings: 'tnum';\n}\n.ant-select-auto-complete.ant-select .ant-select-selection {\n border: 0;\n box-shadow: none;\n}\n.ant-select-auto-complete.ant-select .ant-select-selection__rendered {\n height: 100%;\n margin-right: 0;\n margin-left: 0;\n line-height: 32px;\n}\n.ant-select-auto-complete.ant-select .ant-select-selection__placeholder {\n margin-right: 12px;\n margin-left: 12px;\n}\n.ant-select-auto-complete.ant-select .ant-select-selection--single {\n height: auto;\n}\n.ant-select-auto-complete.ant-select .ant-select-search--inline {\n position: static;\n float: left;\n}\n.ant-select-auto-complete.ant-select-allow-clear .ant-select-selection:hover .ant-select-selection__rendered {\n margin-right: 0 !important;\n}\n.ant-select-auto-complete.ant-select .ant-input {\n height: 32px;\n line-height: 1.5;\n background: transparent;\n border-width: 1px;\n}\n.ant-select-auto-complete.ant-select .ant-input:focus,\n.ant-select-auto-complete.ant-select .ant-input:hover {\n border-color: #6e90ff;\n border-right-width: 1px !important;\n}\n.ant-select-auto-complete.ant-select .ant-input[disabled] {\n color: rgba(0, 0, 0, 0.25);\n background-color: #f5f5f5;\n cursor: not-allowed;\n opacity: 1;\n background-color: transparent;\n}\n.ant-select-auto-complete.ant-select .ant-input[disabled]:hover {\n border-color: #d9d9d9;\n border-right-width: 1px !important;\n}\n.ant-select-auto-complete.ant-select-lg .ant-select-selection__rendered {\n line-height: 40px;\n}\n.ant-select-auto-complete.ant-select-lg .ant-input {\n height: 40px;\n padding-top: 6px;\n padding-bottom: 6px;\n}\n.ant-select-auto-complete.ant-select-sm .ant-select-selection__rendered {\n line-height: 24px;\n}\n.ant-select-auto-complete.ant-select-sm .ant-input {\n height: 24px;\n padding-top: 1px;\n padding-bottom: 1px;\n}\n.ant-input-group > .ant-select-auto-complete .ant-select-search__field.ant-input-affix-wrapper {\n display: inline;\n float: none;\n}\n",""]),e.exports=t},X3Qn:function(e,t,n){},"aQ+q":function(e,t,n){"use strict";n.r(t),n("T2oS");var r,o=n("W9HT"),a=(n("DjyN"),n("NUBc")),c=(n("g9YV"),n("wCAj")),i=(n("P2fV"),n("NJEC")),l=n("zLi2"),s=n.n(l),u=n("YdDX"),p=n.n(u),f=n("o+MX"),m=n.n(f),d=n("cDcd"),h=n.n(d),b=n("spEH"),y=n("ess8"),v=n("Hsgt"),g=n("Ie+W"),O=(n("X3Qn"),n("vOnD")),E=n("sYIF"),w=n("vDqi"),j=n.n(w),x=n("2iEm"),S=O.a.img(r||(r=p()(["{\n width:30px;\n height:30px;\n border-radius:50%;\n}"])));t.default=function(e){var t=Object(d.useState)(1),n=s()(t,2),r=n[0],l=n[1],u=Object(d.useState)(0),p=s()(u,2),f=p[0],O=p[1],w=Object(d.useState)(void 0),_=s()(w,2),C=_[0],P=_[1],N=Object(d.useState)(!1),k=s()(N,2),D=k[0],R=k[1],T=Object(d.useState)(void 0),I=s()(T,2),V=I[0],z=I[1],H=Object(d.useState)(void 0),L=s()(H,2),A=L[0],B=L[1],M=e.match.params,F=M.OIdentifier,J=M.groupId;function Q(){var e;R(!0);var t=m()(e="/organizations/".concat(F,"/teams/")).call(e,J,"/team_users.json");j.a.get(t,{params:{page:r,search:A,identify:V,limit:15}}).then((function(e){e&&e.data&&(P(e.data.team_users),O(e.data.total_count))})).catch((function(e){})),R(!1)}Object(d.useEffect)((function(){Q()}),[r,A,V]);var X=[{title:"头像",dataIndex:"Img",width:"7%",render:function(e,t){return h.a.createElement(S,{src:Object(E.h)("/".concat(t.user.image_url))})}},{title:"用户名",dataIndex:"name",width:"13%",align:"center",render:function(e,t){return h.a.createElement(x.a,{to:"/".concat(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 h.a.createElement(i.a,{title:"确认移除成员吗?",onConfirm:function(){return function(e){var t,n;R(!0);var r=m()(t=m()(n="/organizations/".concat(F,"/teams/")).call(n,J,"/team_users/")).call(t,e,".json");e&&j.a.delete(r).then((function(e){e&&e.data&&(l(1),B(void 0),z(void 0),Q())})).catch((function(e){})),R(!1)}(t.user.login)},okText:"确认",cancelText:"取消"},h.a.createElement("a",{className:"color-red"},"移除成员"))}}];return h.a.createElement(o.a,{spinning:D},h.a.createElement(b.r,{style:{minHeight:"400px"}},h.a.createElement(y.a,null,h.a.createElement("span",null,"团队成员管理"),h.a.createElement(g.a,{getID:function(e){!function(e){var t;R(!0);var n=m()(t="/organizations/".concat(F,"/teams/")).call(t,J,"/team_users.json");e&&j.a.post(n,{username:e}).then((function(e){e&&e.data&&(l(1),B(void 0),z(void 0),Q())})).catch((function(e){})),R(!1)}(e)},showNotification:e.showNotification})),h.a.createElement(b.j,{className:"padding20-30"},h.a.createElement("div",{style:{width:"580px"}},h.a.createElement(v.a,{placeholder:"输入用户名或邮箱、团队名搜索",value:A,onSearch:function(e){return B(e)}}))),h.a.createElement("div",{className:"pl30 pr30 pb30"},h.a.createElement(c.a,{size:"small",columns:X,dataSource:C,pagination:!1,className:"teamMemberTable"}),f>15?h.a.createElement("div",{className:"edu-txt-center mt30 mb20"},h.a.createElement(a.a,{simple:!0,defaultCurrent:r,total:f,pageSize:15,onChange:function(e){return l(e)}})):"")))}},lrIw:function(e,t,n){"use strict";n.d(t,"a",(function(){return C}));var r=n("cDcd"),o=n("i+PK"),a=n("eHJ2"),c=n.n(a);function i(e){return(i="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 l(){return(l=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 s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var d=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&&p(e,t)}(a,e);var t,n,o=function(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=m(e);if(t){var o=m(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return f(this,n)}}(a);function a(){var e;return s(this,a),(e=o.apply(this,arguments)).saveRef=function(t){var n=e.props.children.ref;"function"==typeof n&&n(t)},e}return t=a,(n=[{key:"render",value:function(){return r.cloneElement(this.props.children,l(l({},this.props),{ref:this.saveRef}),null)}}])&&u(t.prototype,n),a}(r.Component),h=n("5rEg"),b=n("2fM7"),y=n("H84U");function v(e){return(v="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 g(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O(){return(O=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 E(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function w(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 j(e,t){return(j=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function x(e,t){return!t||"object"!==v(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function S(e){return(S=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _(e){return e&&e.type&&(e.type.isSelectOption||e.type.isSelectOptGroup)}var C=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&&j(e,t)}(i,e);var t,n,a=function(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=S(e);if(t){var o=S(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return x(this,n)}}(i);function i(){var e;return E(this,i),(e=a.apply(this,arguments)).saveSelect=function(t){e.select=t},e.getInputElement=function(){var t=e.props.children,n=t&&r.isValidElement(t)&&t.type!==o.b?r.Children.only(e.props.children):r.createElement(h.a,null),a=O({},n.props);return delete a.children,r.createElement(d,a,n)},e.renderAutoComplete=function(t){var n,a,i=t.getPrefixCls,l=e.props,s=l.prefixCls,u=l.size,p=l.className,f=void 0===p?"":p,m=l.notFoundContent,d=l.optionLabelProp,h=l.dataSource,y=l.children,E=i("select",s),w=c()((g(n={},"".concat(E,"-lg"),"large"===u),g(n,"".concat(E,"-sm"),"small"===u),g(n,f,!!f),g(n,"".concat(E,"-show-search"),!0),g(n,"".concat(E,"-auto-complete"),!0),n)),j=r.Children.toArray(y);return a=j.length&&_(j[0])?y:h?h.map((function(e){if(r.isValidElement(e))return e;switch(v(e)){case"string":return r.createElement(o.b,{key:e},e);case"object":return r.createElement(o.b,{key:e.value},e.text);default:throw new Error("AutoComplete[dataSource] only supports type `string[] | Object[]`.")}})):[],r.createElement(b.a,O({},e.props,{className:w,mode:b.a.SECRET_COMBOBOX_MODE_DO_NOT_USE,optionLabelProp:d,getInputElement:e.getInputElement,notFoundContent:m,ref:e.saveSelect}),a)},e}return t=i,(n=[{key:"focus",value:function(){this.select.focus()}},{key:"blur",value:function(){this.select.blur()}},{key:"render",value:function(){return r.createElement(y.a,null,this.renderAutoComplete)}}])&&w(t.prototype,n),i}(r.Component);C.Option=o.b,C.OptGroup=o.a,C.defaultProps={transitionName:"slide-up",optionLabelProp:"children",choiceTransitionName:"zoom",showSearch:!1,filterOption:!1}}}]);