forgeplus/public/react/build/static/js/75.431a91cf.chunk.js

1 line
12 KiB
JavaScript

(this.webpackJsonp=this.webpackJsonp||[]).push([[75],{"6V0J":function(e,t,n){},KJct:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=i(n("2/Rp")),r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],a=!0,r=!1,l=void 0;try{for(var o,u=e[Symbol.iterator]();!(a=(o=u.next()).done)&&(n.push(o.value),!t||n.length!==t);a=!0);}catch(e){r=!0,l=e}finally{try{!a&&u.return&&u.return()}finally{if(r)throw l}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};n("L/Qf");var l=n("q1tI"),o=i(l),u=i(n("vDqi"));function i(e){return e&&e.__esModule?e:{default:e}}n("6V0J"),t.default=function(e){var t=e.is_watch,n=e.fontClass,i=e.starText,s=e.is_block,c=e.id,d=e.successFunc,f=e.notReset,m=(0,l.useState)(!1),p=r(m,2),h=p[0],v=p[1],E=(0,l.useState)(t),y=r(E,2),g=y[0],_=y[1];return o.default.createElement(a.default,{type:g?"default":"primary",ghost:!g,block:s,loading:h,onClick:function(){return e=g,v(!0),void(0,u.default)({method:e?"delete":"post",url:"/watchers/"+(e?"unfollow":"follow")+".json",params:{target_type:"user",id:c}}).then((function(e){e&&0===e.data.status&&(d&&d(),f&&_(!g)),v(!1)})).catch((function(e){v(!1)}));var e}},g?o.default.createElement("span",{className:""},o.default.createElement("i",{className:"iconfont icon-shixing font-15 text-yellow mr-4"}),o.default.createElement("span",{className:n||"font-12"},"已关注")):o.default.createElement("span",{className:""},o.default.createElement("i",{className:"iconfont icon-kongxing font-15"}),o.default.createElement("span",{className:n},i||"关注")))}},PA6o:function(e,t,n){},RrAk:function(e,t,n){},xjFL:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=h(n("W9HT")),r=h(n("BvKs")),l=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},o=function(){function e(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)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}();n("04bd"),n("2WkQ");var u=n("q1tI"),i=h(u),s=n("eO8H"),c=h(n("KJct")),d=h(n("vDqi")),f=n("sYIF");n("RrAk"),n("7dqz"),n("PA6o");var m=h(n("CnBM")),p=h(n("HUFq"));function h(e){return e&&e.__esModule?e:{default:e}}(0,m.default)({loader:function(){return Promise.all([n.e(2),n.e(21),n.e(132)]).then(n.t.bind(null,"ceR+",7))},loading:p.default});var v=(0,m.default)({loader:function(){return Promise.all([n.e(0),n.e(1),n.e(2),n.e(63)]).then(n.t.bind(null,"aah+",7))},loading:p.default}),E=(0,m.default)({loader:function(){return n.e(137).then(n.t.bind(null,"A5Ec",7))},loading:p.default}),y=(0,m.default)({loader:function(){return Promise.all([n.e(2),n.e(15),n.e(19),n.e(141),n.e(64)]).then(n.t.bind(null,"oe+v",7))},loading:p.default}),g=(0,m.default)({loader:function(){return Promise.all([n.e(0),n.e(1),n.e(2),n.e(15),n.e(26)]).then(n.t.bind(null,"Dmw4",7))},loading:p.default}),_=(0,m.default)({loader:function(){return Promise.all([n.e(0),n.e(1),n.e(2),n.e(54)]).then(n.t.bind(null,"EEGS",7))},loading:p.default}),b=(0,m.default)({loader:function(){return Promise.all([n.e(0),n.e(1),n.e(108)]).then(n.t.bind(null,"vTxG",7))},loading:p.default}),w=(0,m.default)({loader:function(){return Promise.all([n.e(0),n.e(1),n.e(122)]).then(n.t.bind(null,"0WPJ",7))},loading:p.default}),N=(0,m.default)({loader:function(){return Promise.all([n.e(0),n.e(1),n.e(121)]).then(n.t.bind(null,"bkQV",7))},loading:p.default}),k=(0,m.default)({loader:function(){return n.e(114).then(n.t.bind(null,"oeDK",7))},loading:p.default}),S=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.renderPath=function(e){var t=n.props.match.params.username;e==="/"+t?n.setState({menuKey:"0",route_type:void 0}):e==="/"+t+"/statistics"?n.setState({menuKey:"1",route_type:void 0}):e.indexOf("/"+t+"/projects")>-1?n.setState({menuKey:"2",route_type:void 0}):e.indexOf("/"+t+"/notice")>-1?n.setState({menuKey:"3",route_type:void 0}):e.indexOf("/"+t+"/devops")>-1?n.setState({menuKey:"4",route_type:void 0}):e==="/"+t+"/organizes"?n.setState({menuKey:"5",route_type:void 0}):e==="/"+t+"/following"?n.setState({menuKey:void 0,route_type:"following"}):e==="/"+t+"/followers"?n.setState({menuKey:void 0,route_type:"followers"}):n.setState({menuKey:void 0,route_type:void 0})},n.componentDidMount=function(){n.fetchUser();var e=n.props.location.pathname;n.renderPath(e)},n.componentDidUpdate=function(e){var t=n.props.match.params.username,a=e.match.params.username;a&&t&&a!==t&&n.fetchUser();var r=n.props.location.pathname,l=e.location.pathname;l&&r&&l!==r&&n.renderPath(r),n.props.history.listen((function(){(document.body.scrollTop||document.documentElement.scrollTop>0)&&window.scrollTo(0,0)}))},n.fetchUser=function(){n.setState({isSpin:!0});var e=n.props.current_user,t="/users/"+(n.props.match.params.username||e&&e.login)+".json";d.default.get(t).then((function(e){var t=e.data&&e.data.undo_events;n.setState({user:e.data,isSpin:!1,undo_events:t})})).catch((function(e){n.setState({isSpin:!1})}))},n.change_devops_type=function(e){var t=n.state.user;n.setState({project_type:e,route_type:void 0}),n.props.history.push("/"+(t&&t.login)+"/devops/"+e)},n.undo_link=function(){var e=n.state.user;n.setState({route_type:void 0,project_type:"notice"},(function(){n.props.history.push("/"+(e&&e.login)+"/notice"),n.fetchUser()}))},n.route_link=function(e){n.setState({route_type:e})},n.organize_link=function(){var e=n.state.user;n.setState({route_type:void 0,project_type:"organizes"}),n.props.history.push("/"+(e&&e.login)+"/organizes")},n.resetUser=function(){var e=n.props.resetUserInfo;n.fetchUser(),e&&e()},n.deleteUndoEvent=function(e){var t=n.state.undo_events-e;n.setState({undo_events:t})},n.state={isSpin:!1,user:void 0,project_type:void 0,route_type:void 0,undo_events:0,menuKey:"0"},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"render",value:function(){var e=this,t=this.props.current_user,n=this.props.match.params.username,o=this.state,u=o.user,d=o.isSpin,m=o.route_type,p=o.undo_events,h=o.menuKey;return i.default.createElement("div",{className:"newMain clearfix"},i.default.createElement(a.default,{spinning:d},i.default.createElement("div",{className:"new-content-flex"},i.default.createElement("div",{className:"list-left",style:{border:"none"}},i.default.createElement("div",{className:"bgcF"},i.default.createElement("div",{className:"list-l-Menu text-center",style:{padding:"20px 25px"}},i.default.createElement("span",{className:"headimg"},i.default.createElement("img",{src:(0,f.getImageUrl)("/"+(u&&u.image_url)),alt:""}),i.default.createElement("span",null,u&&1===u.gender?i.default.createElement("i",{className:"iconfont icon-nan1"}):i.default.createElement("i",{className:"iconfont icon-nv1"}))),i.default.createElement("div",{className:"text-center mt15 font-24 task-hide",title:u&&u.username},u&&u.username),i.default.createElement("div",{className:"userDescription"},u&&u.description),i.default.createElement("div",null,t&&u&&u.login!==t.login&&i.default.createElement("div",{className:"user-info-star-button "},i.default.createElement(c.default,{is_block:!0,is_watch:u.is_watch,id:u.login,fontClass:"font-14 ml5",starText:"关注TA",notReset:!0}))),i.default.createElement("div",{className:"focusBox"},i.default.createElement(s.Link,{to:"/"+(u&&u.login)+"/following",className:"with50 text-center pull-left "+("following"===m?"text-primary":""),onClick:function(){return e.route_link("following")}},i.default.createElement("div",null,t&&u&&u.login===t.login?"我关注的":"TA关注的"),i.default.createElement("span",null,u&&u.watching_count)),i.default.createElement(s.Link,{to:"/"+(u&&u.login)+"/followers",onClick:function(){return e.route_link("followers")},className:"with50 text-center pull-left "+("followers"===m?"text-primary":"")},i.default.createElement("div",null,t&&u&&u.login===t.login?"关注我的":"关注TA的"),i.default.createElement("span",null,u&&u.watched_count))),u&&(u.province||u.custom_department||u.email)?i.default.createElement("div",{className:"infoBox"},u.province&&i.default.createElement("div",null,i.default.createElement("i",{className:"iconfont icon-weizhi"}),i.default.createElement("span",null,u.province),i.default.createElement("span",{title:u.city},u.city)),u.custom_department&&i.default.createElement("div",null,i.default.createElement("i",{className:"iconfont icon-danwei"}),i.default.createElement("span",{title:u.custom_department},u.custom_department)),u.email&&i.default.createElement("div",null,i.default.createElement("i",{className:"iconfont icon-youxiangrenzheng"}),i.default.createElement("span",{title:u.email},u.email))):""))),i.default.createElement("div",{className:"list-right"},!m&&h&&i.default.createElement(r.default,{selectedKeys:[h],mode:"horizontal",className:"infosRightMenu"},i.default.createElement(r.default.Item,{key:"0"},i.default.createElement(s.Link,{to:"/"+(u&&u.login)},i.default.createElement("i",{className:"iconfont icon-gailan"}),"概览")),i.default.createElement(r.default.Item,{key:"1"},i.default.createElement(s.Link,{to:"/"+(u&&u.login)+"/statistics"},i.default.createElement("i",{className:"iconfont icon-shujutongji"}),"数据统计")),i.default.createElement(r.default.Item,{key:"2"},i.default.createElement(s.Link,{to:"/"+(u&&u.login)+"/projects"},i.default.createElement("i",{className:"iconfont icon-xiangmu"}),"项目")),t&&u&&u.login===t.login?i.default.createElement(r.default.Item,{key:"3"},i.default.createElement(s.Link,{to:"/"+(u&&u.login)+"/notice"},i.default.createElement("i",{className:"iconfont icon-daibanshixiang"}),"待办事项",p&&p>0?i.default.createElement("span",{className:"menuNum"},"(",p,")"):"")):"",t&&t.login&&t.login===n?i.default.createElement(r.default.Item,{key:"4"},i.default.createElement(s.Link,{to:"/"+(u&&u.login)+"/devops/CIService"},i.default.createElement("i",{className:"iconfont icon-gongzuoliu1"}),"DevOps工作流")):"",i.default.createElement(r.default.Item,{key:"5"},i.default.createElement(s.Link,{to:"/"+(u&&u.login)+"/organizes"},i.default.createElement("i",{className:"iconfont icon-zuzhi"}),"组织",u&&u.user_org_count&&u.user_org_count>0?i.default.createElement("span",{className:"menuNum"},"(",u.user_org_count,")"):""))),u&&i.default.createElement(s.Switch,this.props,i.default.createElement(s.Route,{path:"/:username/following",render:function(){return i.default.createElement(w,l({},e.props,e.state,{userType:"watchers",fetchUser:e.fetchUser}))}}),i.default.createElement(s.Route,{path:"/:username/notice",render:function(){return i.default.createElement(k,l({},e.props,e.state,{deleteUndoEvent:e.deleteUndoEvent}))}}),i.default.createElement(s.Route,{path:"/:username/followers",render:function(){return i.default.createElement(N,l({},e.props,e.state,{userType:"fan_users",fetchUser:e.fetchUser}))}}),i.default.createElement(s.Route,{path:"/:username/devops/CDService",render:function(){return i.default.createElement(E,l({},e.props,e.state))}}),i.default.createElement(s.Route,{path:"/:username/devops/CIService",render:function(){return i.default.createElement(v,l({},e.props,e.state))}}),i.default.createElement(s.Route,{path:"/:username/projects",render:function(){return i.default.createElement(_,l({},e.props,e.state))}}),i.default.createElement(s.Route,{path:"/:username/organizes",render:function(){return i.default.createElement(b,l({},e.props,e.state))}}),i.default.createElement(s.Route,{path:"/:username/statistics",render:function(t){return i.default.createElement(y,l({},e.props,e.state))}}),i.default.createElement(s.Route,{path:"/:username",render:function(t){return i.default.createElement(g,l({},e.props,e.state))}}),i.default.createElement(s.Route,{path:"/",render:function(t){return i.default.createElement(g,l({},e.props,e.state))}}))))))}}]),t}(u.Component);t.default=S}}]);