build/static/js/115.c2bc19f7.chunk.js

1 line
15 KiB
JavaScript

(this.webpackJsonp=this.webpackJsonp||[]).push([[115],{"92iN":function(e,t,n){},"O/iA":function(e,t,n){var a=n("SE3x");"string"==typeof a&&(a=[[e.i,a,""]]);n("aET+")(a,{hmr:!0,transform:void 0}),a.locals&&(e.exports=a.locals)},O3gP:function(e,t,n){"use strict";n("cIOH"),n("O/iA"),n("OaEy"),n("5NDa")},Omli:function(e,t,n){"use strict";var a=n("zLi2"),r=n.n(a),o=(n("O3gP"),n("lrIw")),c=n("FLGM"),l=n.n(c),i=n("cDcd"),s=n.n(i),u=n("sYIF"),p=n("vDqi"),f=n.n(p),m=o.a.Option;t.a=function(e){var t=e.getUser,n=e.placeholder,a=e.width,c=(e.value,e.userList),p=void 0===c?[]:c,d=Object(i.useState)(void 0),b=r()(d,2),h=b[0],y=b[1];function g(e){f.a.get("/users/list.json",{params:{search:e}}).then((function(e){e&&v(e.data.users)})).catch((function(e){}))}function v(e){var t=e&&l()(e).call(e,(function(e,t){return s.a.createElement(m,{key:t,value:"".concat(e.user_id),login:"".concat(e.login),name:e.username},s.a.createElement("img",{className:"user_img radius",width:"28",height:"28",src:Object(u.i)("/".concat(e&&e.image_url)),alt:""}),s.a.createElement("span",{className:"ml10",style:{"vertical-align":"middle"}},e.username,s.a.createElement("span",{className:"color-grey ml10"},"(",e.login,")")))}));y(t)}return Object(i.useEffect)((function(){p&&p.length?v(p):g()}),[]),s.a.createElement("div",{className:"addPanel"},s.a.createElement(o.a,{getPopupContainer:function(e){return e.parentNode},dataSource:h,style:{width:a||300},onSearch:function(e){g(e)},onSelect:function(e,n){g(n.props.name),t(n.props.login)},placeholder:n||"搜索需要添加的用户...",allowClear:!0,optionLabelProp:"name"}))}},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},dXeK:function(e,t,n){"use strict";n.r(t),n("DjyN");var a=n("NUBc"),r=(n("+L6B"),n("2/Rp")),o=(n("5NDa"),n("5rEg")),c=(n("miYZ"),n("tsqr")),l=n("zLi2"),i=n.n(l),s=n("FLGM"),u=n.n(s),p=n("o+MX"),f=n.n(p),m=n("WxoT"),d=n.n(m),b=n("cDcd"),h=n.n(b),y=n("2CTR"),g=n("vDqi"),v=n.n(g),E=(n("92iN"),n("Omli")),O=n("spEH");t.default=function(e){var t=Object(b.useState)(1),n=i()(t,2),l=n[0],s=n[1],p=Object(b.useState)(void 0),m=i()(p,2),g=m[0],S=m[1],_=Object(b.useState)(void 0),j=i()(_,2),w=j[0],N=j[1],C=Object(b.useState)(void 0),x=i()(C,2),k=x[0],P=x[1],T=Object(b.useState)(1),R=i()(T,2),D=R[0],L=(R[1],Object(b.useState)({})),I=i()(L,2),A=I[0],H=I[1],z=Object(b.useState)(void 0),M=i()(z,2),G=M[0],J=M[1],F=Object(b.useState)({}),U=i()(F,2),B=U[0],q=U[1],X=Object(b.useState)(void 0),K=i()(X,2),V=K[0],Y=K[1],W=Object(b.useState)(void 0),Z=i()(W,2),$=Z[0],Q=Z[1],ee=Object(b.useState)(void 0),te=i()(ee,2),ne=te[0],ae=te[1],re=Object(b.useState)([]),oe=i()(re,2),ce=oe[0],le=oe[1],ie=e.current_user,se=ie.user_id,ue=ie.login,pe=ie.open_blockchain,fe=e.current_user,me=e.user,de=e.match.params.username;function be(e,t){var n=JSON.parse(d()(B));n[e]=t,q(n)}return Object(b.useEffect)((function(){(de&&fe&&fe.login!==de||!pe)&&e.history.push("/".concat(de))}),[fe,de]),Object(b.useEffect)((function(){v.a.get("/users/blockchain/balance.json",{params:{user_id:se,limit:10,page:l,keyword:ne}}).then((function(e){if(e&&e.data){var t=e.data.projects,n=[],a=0;u()(t).call(t,(function(e){e.id?n.unshift(e):a++})),a&&n.push({balance:a}),P(n),S(e.data.total_count)}}))}),[w,l,ne]),Object(b.useEffect)((function(){if(me){var e,t=me.username,n=me.login;document.title=f()(e="贡献确权-".concat(t,"/")).call(e,n)}}),[me]),Object(b.useEffect)((function(){v.a.get("/users/list.json").then((function(e){e&&le(e.data.users)}))}),[]),h.a.createElement("div",{className:"mt15 contribution"},h.a.createElement("div",{className:"contHead clearfix"},h.a.createElement(o.a.Search,{className:"fr",style:{width:"auto"},placeholder:"请输入项目名称进行搜索",allowClear:!0,onSearch:function(e){s(1),ae(e)}})),D?h.a.createElement("div",{className:"contributionTable mt25"},k&&k.length>0&&h.a.createElement("div",{className:"flexCenterCont tableHeadTri mb5"},h.a.createElement("div",{className:"tableColumn1"},"项目名称"),h.a.createElement("div",{className:"tableColumn2"},"token总量"),h.a.createElement("div",{className:"tableColumn3"},"目标转账用户"),h.a.createElement("div",{className:"tableColumn4"},"转账token数额"),h.a.createElement("div",{className:"tableColumn5"},"操作")),(k&&!k.length||!k)&&h.a.createElement(y.a,{_html:"暂无数据"}),k&&u()(k).call(k,(function(e){return e.id?h.a.createElement("div",{key:e.id,className:"flexCenterCont transferAccount"},h.a.createElement("div",{className:"tableColumn1"},e.name),h.a.createElement("div",{className:"tableColumn2"},e.balance),h.a.createElement("div",{className:"tableColumn3"},h.a.createElement(E.a,{getUser:function(t){!function(e,t){var n=JSON.parse(d()(A));n[e]=t,H(n)}(e.id,t)},width:"100%",placeholder:"搜索转账目标用户",userList:ce}),$===e.id&&G&&h.a.createElement("div",{className:"errorTipTri"},G)),h.a.createElement("div",{className:"tableColumn4"},h.a.createElement(o.a,{value:B[e.id],onChange:function(t){be(e.id,t.target.value)},placeholder:"请输入token数额"}),$===e.id&&V&&h.a.createElement("div",{className:"errorTipTri"},V)),h.a.createElement("div",{className:"tableColumn5"},h.a.createElement(r.a,{className:"confirmTransfer",onClick:function(){!function(e,t,n){J(void 0),Y(void 0),Q(e);var a=A[e],r=B[e];a&&r?!/^[1-9]+[0-9]*]*$/.test(r)||r>n?Y("转账token数额必须为不超过token总数的正整数"):v.a.post("/users/blockchain/transfer",{owner_login:ue,project_identifier:t,user_id:se,transfer_amount:r,transfer_login:a,payer_id:se,project_id:e}).then((function(t){t&&t.data&&2===t.data.status&&(be(e,void 0),N(Math.random()),c.a.success("转账成功"))})):(!a&&J("请确定目标转账用户"),r||Y("请输入token数额"))}(e.id,e.identifier,e.balance)}},"确认"))):h.a.createElement("div",{className:"flexCenterCont transferAccount deleteRepo"},e.balance,"个项目被删除")}))):h.a.createElement("div",{className:"contributionTable mt20 record"},h.a.createElement(O.j,{className:"contributionRecordItem font-15"},h.a.createElement("span",null,h.a.createElement("span",{className:"themeSpan"},"蒋宇航"),"在",h.a.createElement("span",{className:"themeSpan"},"GilLink/确实开源"),"给你转账了1000个tiken"),h.a.createElement("span",{className:"tableHeadTri"},"6小时前")),h.a.createElement(O.j,{className:"contributionRecordItem font-15"},h.a.createElement("span",null,h.a.createElement("span",{className:"themeSpan"},"蒋宇航"),"在",h.a.createElement("span",{className:"themeSpan"},"GilLink/确实开源"),"给你转账了1000个tiken"),h.a.createElement("span",{className:"tableHeadTri"},"6小时前"))),g>10&&h.a.createElement("div",{className:"mt20 paginationTri mb50"},h.a.createElement(a.a,{simple:!0,current:l,pageSize:10,total:g,onChange:function(e){s(e),window.scrollTo(0,0)}})))}},lrIw:function(e,t,n){"use strict";n.d(t,"a",(function(){return C}));var a=n("cDcd"),r=n("i+PK"),o=n("eHJ2"),c=n.n(o);function l(e){return(l="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 i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}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 a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}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"!==l(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)}(o,e);var t,n,r=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,a=m(e);if(t){var r=m(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return f(this,n)}}(o);function o(){var e;return s(this,o),(e=r.apply(this,arguments)).saveRef=function(t){var n=e.props.children.ref;"function"==typeof n&&n(t)},e}return t=o,(n=[{key:"render",value:function(){return a.cloneElement(this.props.children,i(i({},this.props),{ref:this.saveRef}),null)}}])&&u(t.prototype,n),o}(a.Component),b=n("5rEg"),h=n("2fM7"),y=n("H84U");function g(e){return(g="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 v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E(){return(E=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function O(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function S(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function _(e,t){return(_=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function j(e,t){return!t||"object"!==g(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 w(e){return(w=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function N(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&&_(e,t)}(l,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,a=w(e);if(t){var r=w(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return j(this,n)}}(l);function l(){var e;return O(this,l),(e=o.apply(this,arguments)).saveSelect=function(t){e.select=t},e.getInputElement=function(){var t=e.props.children,n=t&&a.isValidElement(t)&&t.type!==r.b?a.Children.only(e.props.children):a.createElement(b.a,null),o=E({},n.props);return delete o.children,a.createElement(d,o,n)},e.renderAutoComplete=function(t){var n,o,l=t.getPrefixCls,i=e.props,s=i.prefixCls,u=i.size,p=i.className,f=void 0===p?"":p,m=i.notFoundContent,d=i.optionLabelProp,b=i.dataSource,y=i.children,O=l("select",s),S=c()((v(n={},"".concat(O,"-lg"),"large"===u),v(n,"".concat(O,"-sm"),"small"===u),v(n,f,!!f),v(n,"".concat(O,"-show-search"),!0),v(n,"".concat(O,"-auto-complete"),!0),n)),_=a.Children.toArray(y);return o=_.length&&N(_[0])?y:b?b.map((function(e){if(a.isValidElement(e))return e;switch(g(e)){case"string":return a.createElement(r.b,{key:e},e);case"object":return a.createElement(r.b,{key:e.value},e.text);default:throw new Error("AutoComplete[dataSource] only supports type `string[] | Object[]`.")}})):[],a.createElement(h.a,E({},e.props,{className:S,mode:h.a.SECRET_COMBOBOX_MODE_DO_NOT_USE,optionLabelProp:d,getInputElement:e.getInputElement,notFoundContent:m,ref:e.saveSelect}),o)},e}return t=l,(n=[{key:"focus",value:function(){this.select.focus()}},{key:"blur",value:function(){this.select.blur()}},{key:"render",value:function(){return a.createElement(y.a,null,this.renderAutoComplete)}}])&&S(t.prototype,n),l}(a.Component);C.Option=r.b,C.OptGroup=r.a,C.defaultProps={transitionName:"slide-up",optionLabelProp:"children",choiceTransitionName:"zoom",showSearch:!1,filterOption:!1}}}]);