forked from Gitlink/forgeplus
1 line
7.3 KiB
JavaScript
1 line
7.3 KiB
JavaScript
(this.webpackJsonp=this.webpackJsonp||[]).push([[122],{"0WPJ":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n("q1tI"),o=l(a),u=l(n("uaeZ"));function l(e){return e&&e.__esModule?e:{default:e}}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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}var s=function(e){function t(){return c(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}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),r(t,[{key:"render",value:function(){var e=this.props,t=e.user,n=e.current_user,r=e.match,a=e.fetchUser;return t&&t.login&&o.default.createElement(u.default,{userType:"watch_users",login:t.login,current_user:n,fetchUser:a,match:r})}}]),t}(a.Component);t.default=s},Xd6l:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=s(n("2/Rp")),a=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();n("L/Qf");var o=n("q1tI"),u=s(o),l=n("sYIF"),c=n("eO8H"),i=s(n("KJct"));function s(e){return e&&e.__esModule?e:{default:e}}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(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}n("6V0J");var d=function(e){function t(){var e,n,a;f(this,t);for(var o=arguments.length,s=Array(o),d=0;d<o;d++)s[d]=arguments[d];return n=a=p(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),a.renderList=function(e,t,n,a,o,s){if(e&&e.length>0)return e.map((function(e,f){return u.default.createElement("div",{className:"pull-left "+t,key:f},u.default.createElement("div",{className:"pbt25 grid-item mlr10 border-b-line"},u.default.createElement("div",null,u.default.createElement("a",{href:"/"+e.login,className:"show-user-link"},u.default.createElement("img",{className:"avatar-60",src:(0,l.getImageUrl)("/"+e.image_url),alt:""}))),u.default.createElement("div",{className:"ml12"},u.default.createElement("div",null,u.default.createElement(c.Link,{to:"/"+e.login,className:"font-16 text-primary task-hide max-w-200",style:{display:"block"},title:e.name},e.name)),u.default.createElement("div",{className:"font-12 text-gray grid-item pb5"},u.default.createElement("i",{className:"iconfont icon-shijian user-join-time"}),u.default.createElement("span",{className:"ml4"},"点赞列表"===a?"点赞":"关注列表"===a?"关注":"fork","时间:",e.format_time)),n&&n.login===e.login?u.default.createElement(r.default,{type:"default"},"当前用户"):u.default.createElement(i.default,{is_watch:e.is_watch,notReset:s,id:e.login,successFunc:o}))))}))},p(a,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),a(t,[{key:"render",value:function(){var e=this.props,t=e.users,n=e.userClass,r=e.current_user,a=e.type_title,o=e.successFunc,u=e.notReset,l=e.title_type;return this.renderList(t,n,r,a,o,u,l)}}]),t}(o.Component);t.default=d},uaeZ:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=d(n("W9HT")),a=d(n("NUBc")),o=d(n("5rEg")),u=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();n("04bd"),n("YQTV"),n("1vPl");var l=n("q1tI"),c=d(l),i=n("eO8H"),s=d(n("vDqi")),f=d(n("2CTR")),p=d(n("Xd6l"));function d(e){return e&&e.__esModule?e:{default:e}}var m=o.default.Search,h=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.componentDidMount=function(){n.get_watchers()},n.get_watchers=function(){var e=n.props,t=e.userType,r="/users/"+e.match.params.username+"/"+t+".json",a=n.state,o=a.page,u=a.limit,l=a.search;n.setState({isSpin:!0}),s.default.get(r,{params:{page:o,limit:u,search:l}}).then((function(e){e&&e.data&&n.setState({users:e.data.users,total:e.data.count,isSpin:!1})})).catch((function(e){n.setState({isSpin:!1})}))},n.changePage=function(e){n.state.page=e,n.get_watchers()},n.changeSearchValue=function(e){n.setState({search:e.target.value})},n.successFunc=function(){var e=n.props.fetchUser;n.get_watchers(),e&&e()},n.state={page:1,limit:30,users:void 0,search:void 0,total:void 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),u(t,[{key:"render",value:function(){var e=this.state,t=e.users,n=e.isSpin,o=e.total,u=e.search,l=e.limit,s=e.page,d=this.props,h=d.userType,y=d.login,b=d.current_user,g=b&&y===b.login?"我":"TA",_=o&&o>l?c.default.createElement("div",{className:"edu-txt-center pt30 mb30"},c.default.createElement(a.default,{simple:!0,defaultCurrent:s,total:o,pageSize:l,onChange:this.changePage})):"";return c.default.createElement(r.default,{spinning:n},c.default.createElement("div",{className:"minH-670"},c.default.createElement("div",{className:"grid-item pb20 bbt"},c.default.createElement("h3",{style:{marginBottom:"0px"}},c.default.createElement(i.Link,{to:"/"+y},c.default.createElement("i",{className:"iconfont icon-zuojiantou color-grey-9 font-16 mr8"})),"watch_users"===h?g+"关注的":"关注"+g+"的"),c.default.createElement("div",{className:"text-right"},c.default.createElement(m,{placeholder:"输入名称进行搜索",enterButton:"搜索",size:"large",onSearch:this.get_watchers,className:"list-r-Search",value:u,onChange:this.changeSearchValue}))),t&&t.length>0?c.default.createElement("div",{className:"w-100 inline-block"},c.default.createElement(p.default,{users:t,userClass:"w-33",type_title:"关注列表",current_user:b,successFunc:this.successFunc,notReset:"watch_users"!==h||"我"!==g,title_type:g})):c.default.createElement(f.default,{_html:"暂时没有数据~"}),c.default.createElement("div",{className:"w-100"},_)))}}]),t}(l.Component);t.default=h}}]); |