forked from Gitlink/forgeplus
1 line
20 KiB
JavaScript
1 line
20 KiB
JavaScript
(this.webpackJsonp=this.webpackJsonp||[]).push([[70],{"+hnl":function(e,t,n){},MKzF:function(e,t,n){"use strict";n.r(t);n("SchZ"),n("+hnl")},e6dI:function(e,t,n){},kaz8:function(e,t,n){"use strict";n.r(t);var r=n("q1tI"),a=n("17x9"),o=n("VCL8"),c=n("TSYQ"),l=n.n(c),i=n("x1Ya"),u=n("Gytx"),s=n.n(u),f=n("H84U"),d=n("6CfX");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 m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(){return(y=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 h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(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 b(e,t){return(b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(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=O(e);if(t){var a=O(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return k(this,n)}}function k(e,t){return!t||"object"!==p(t)&&"function"!=typeof t?E(e):t}function E(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function O(e){return(O=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var x=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 a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n},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&&b(e,t)}(c,e);var t,n,a,o=g(c);function c(){var e;return h(this,c),(e=o.apply(this,arguments)).saveCheckbox=function(t){e.rcCheckbox=t},e.renderCheckbox=function(t){var n,a=t.getPrefixCls,o=E(e),c=o.props,u=o.context,s=c.prefixCls,f=c.className,d=c.children,p=c.indeterminate,h=c.style,v=c.onMouseEnter,b=c.onMouseLeave,g=x(c,["prefixCls","className","children","indeterminate","style","onMouseEnter","onMouseLeave"]),k=u.checkboxGroup,O=a("checkbox",s),C=y({},g);k&&(C.onChange=function(){g.onChange&&g.onChange.apply(g,arguments),k.toggleOption({label:d,value:c.value})},C.name=k.name,C.checked=-1!==k.value.indexOf(c.value),C.disabled=c.disabled||k.disabled);var S=l()(f,(m(n={},"".concat(O,"-wrapper"),!0),m(n,"".concat(O,"-wrapper-checked"),C.checked),m(n,"".concat(O,"-wrapper-disabled"),C.disabled),n)),N=l()(m({},"".concat(O,"-indeterminate"),p));return r.createElement("label",{className:S,style:h,onMouseEnter:v,onMouseLeave:b},r.createElement(i.a,y({},C,{prefixCls:O,className:N,ref:e.saveCheckbox})),void 0!==d&&r.createElement("span",null,d))},e}return t=c,(n=[{key:"componentDidMount",value:function(){var e=this.props.value,t=(this.context||{}).checkboxGroup,n=void 0===t?{}:t;n.registerValue&&n.registerValue(e),Object(d.a)("checked"in this.props||(this.context||{}).checkboxGroup||!("value"in this.props),"Checkbox","`value` is not validate prop, do you mean `checked`?")}},{key:"shouldComponentUpdate",value:function(e,t,n){return!s()(this.props,e)||!s()(this.state,t)||!s()(this.context.checkboxGroup,n.checkboxGroup)}},{key:"componentDidUpdate",value:function(e){var t=e.value,n=this.props.value,r=(this.context||{}).checkboxGroup,a=void 0===r?{}:r;n!==t&&a.registerValue&&a.cancelValue&&(a.cancelValue(t),a.registerValue(n))}},{key:"componentWillUnmount",value:function(){var e=this.props.value,t=(this.context||{}).checkboxGroup,n=void 0===t?{}:t;n.cancelValue&&n.cancelValue(e)}},{key:"focus",value:function(){this.rcCheckbox.focus()}},{key:"blur",value:function(){this.rcCheckbox.blur()}},{key:"render",value:function(){return r.createElement(f.a,null,this.renderCheckbox)}}])&&v(t.prototype,n),a&&v(t,a),c}(r.Component);C.__ANT_CHECKBOX=!0,C.defaultProps={indeterminate:!1},C.contextTypes={checkboxGroup:a.any},Object(o.polyfill)(C);var S=C,N=n("BGR+");function _(e){return(_="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 j(){return(j=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 w(e){return function(e){if(Array.isArray(e))return P(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return P(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return P(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function P(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function T(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 V(e,t){return(V=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function I(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=G(e);if(t){var a=G(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return M(this,n)}}function M(e,t){return!t||"object"!==_(t)&&"function"!=typeof t?A(e):t}function A(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function G(e){return(G=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var R=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 a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n},B=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&&V(e,t)}(c,e);var t,n,a,o=I(c);function c(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),(t=o.call(this,e)).cancelValue=function(e){t.setState((function(t){return{registeredValues:t.registeredValues.filter((function(t){return t!==e}))}}))},t.registerValue=function(e){t.setState((function(t){var n=t.registeredValues;return{registeredValues:[].concat(w(n),[e])}}))},t.toggleOption=function(e){var n=t.state.registeredValues,r=t.state.value.indexOf(e.value),a=w(t.state.value);-1===r?a.push(e.value):a.splice(r,1),"value"in t.props||t.setState({value:a});var o=t.props.onChange;if(o){var c=t.getOptions();o(a.filter((function(e){return-1!==n.indexOf(e)})).sort((function(e,t){return c.findIndex((function(t){return t.value===e}))-c.findIndex((function(e){return e.value===t}))})))}},t.renderGroup=function(e){var n=e.getPrefixCls,a=A(t),o=a.props,c=a.state,i=o.prefixCls,u=o.className,s=o.style,f=o.options,d=R(o,["prefixCls","className","style","options"]),p=n("checkbox",i),m="".concat(p,"-group"),y=Object(N.a)(d,["children","defaultValue","value","onChange","disabled"]),h=o.children;f&&f.length>0&&(h=t.getOptions().map((function(e){return r.createElement(S,{prefixCls:p,key:e.value.toString(),disabled:"disabled"in e?e.disabled:o.disabled,value:e.value,checked:-1!==c.value.indexOf(e.value),onChange:e.onChange,className:"".concat(m,"-item")},e.label)})));var v=l()(m,u);return r.createElement("div",j({className:v,style:s},y),h)},t.state={value:e.value||e.defaultValue||[],registeredValues:[]},t}return t=c,a=[{key:"getDerivedStateFromProps",value:function(e){return"value"in e?{value:e.value||[]}:null}}],(n=[{key:"getChildContext",value:function(){return{checkboxGroup:{toggleOption:this.toggleOption,value:this.state.value,disabled:this.props.disabled,name:this.props.name,registerValue:this.registerValue,cancelValue:this.cancelValue}}}},{key:"shouldComponentUpdate",value:function(e,t){return!s()(this.props,e)||!s()(this.state,t)}},{key:"getOptions",value:function(){return this.props.options.map((function(e){return"string"==typeof e?{label:e,value:e}:e}))}},{key:"render",value:function(){return r.createElement(f.a,null,this.renderGroup)}}])&&T(t.prototype,n),a&&T(t,a),c}(r.Component);B.defaultProps={options:[]},B.propTypes={defaultValue:a.array,value:a.array,options:a.array.isRequired,onChange:a.func},B.childContextTypes={checkboxGroup:a.any},Object(o.polyfill)(B);var D=B;S.Group=D;t.default=S},mz8h:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=s(n("kLXV")),a=s(n("2/Rp")),o=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,a=!1,o=void 0;try{for(var c,l=e[Symbol.iterator]();!(r=(c=l.next()).done)&&(n.push(c.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{!r&&l.return&&l.return()}finally{if(a)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},c=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};t.default=function(e){f(c({},e,{type:"delete"}))},t.Confirm=function(e){f(c({},e,{type:"confirm"}))},n("k3Gp"),n("L/Qf");var l=n("q1tI"),i=s(l),u=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n("i8i4"));function s(e){return e&&e.__esModule?e:{default:e}}function f(e){var t=e.type,n=e.afterClose,r=document.createElement("div");function a(){n&&n(),u.unmountComponentAtNode(r)&&r.parentNode&&r.parentNode.removeChild(r)}document.body.appendChild(r),setTimeout((function(){u.render(function(t){return"delete"===t?i.default.createElement(d,c({title:"删除",contentTitle:"确定要删除吗?",okText:"确认删除"},e,{afterClose:a,contentTitle:i.default.createElement(i.default.Fragment,null,i.default.createElement("i",{className:"red-circle iconfont icon-shanchu_tc_icon mr3"}),e.contentTitle)})):i.default.createElement(d,c({title:"选择",afterClose:a},e))}(t),r)}))}function d(e){var t=e.onCancel,n=e.onOk,c=e.title,u=e.contentTitle,s=e.content,f=e.okText,d=e.cancelText,p=e.afterClose,m=e.className,y=(0,l.useState)(!0),h=o(y,2),v=h[0],b=h[1];function g(){b(!1),t&&t()}return i.default.createElement(r.default,{visible:v,onCancel:g,afterClose:p,title:c,className:"myself-modal "+m,centered:!0,footer:[i.default.createElement(a.default,{type:"default",key:"back",onClick:g},d),i.default.createElement(a.default,{className:"foot-submit",key:"submit",onClick:function(){b(!1),n&&n()}},f)]},i.default.createElement("div",null,u&&i.default.createElement("p",{className:"content-title"},u),i.default.createElement("p",{className:"content-descibe"},s)))}n("e6dI"),d.defaultProps={okText:"确认",cancelText:"取消",className:"",inputId:"copyText",onCancel:function(){},onOk:function(){},title:"提示",contentTitle:"",content:"",afterClose:function(){}}},yQCu:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=m(n("NUBc")),a=m(n("kaz8")),o=m(n("BvKs")),c=m(n("KrTs")),l=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,a=!1,o=void 0;try{for(var c,l=e[Symbol.iterator]();!(r=(c=l.next()).done)&&(n.push(c.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{!r&&l.return&&l.return()}finally{if(a)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};n("YQTV"),n("MKzF"),n("2WkQ"),n("JvnM");var i=n("q1tI"),u=m(i),s=(n("eO8H"),m(n("vDqi"))),f=m(n("mz8h")),d=m(n("2CTR")),p=n("FCV+");function m(e){return e&&e.__esModule?e:{default:e}}n("69Ao"),n("j4F2"),t.default=function(e){var t=e.current_user,n=e.resetUserInfo,m=e.location,y=e.mygetHelmetapi,h=e.history,v=m&&m.query&&m.query.noticeType,b=(0,i.useState)("atme"===v?"2":"0"),g=l(b,2),k=g[0],E=g[1],O=(0,i.useState)(0),x=l(O,2),C=x[0],S=x[1],N=(0,i.useState)(!1),_=l(N,2),j=_[0],w=_[1],P=(0,i.useState)(!1),T=l(P,2),V=T[0],I=T[1],M=(0,i.useState)(),A=l(M,2),G=A[0],R=A[1],B=(0,i.useState)(),D=l(B,2),z=D[0],F=D[1],L=(0,i.useState)([]),U=l(L,2),q=U[0],H=U[1],K=(0,i.useState)(),Q=l(K,2),J=Q[0],X=Q[1],Y=(0,i.useState)(1),W=l(Y,2),Z=W[0],$=W[1],ee=(0,i.useState)(),te=l(ee,2),ne=te[0],re=te[1];function ae(){var e={type:"0"===k?"notification":"2"===k?"atme":"",status:ne||"",limit:15,page:Z};t&&s.default.get("/users/"+t.login+"/messages.json",{params:e}).then((function(e){e&&e.data&&(R(e.data.unread_notification),F(e.data.unread_atme),H(e.data.messages),X(e.data.total_count))}))}function oe(e){if(e&&t){var n={type:"0"===k?"notification":"2"===k?"atme":"",ids:e};s.default.post("/users/"+t.login+"/messages/read.json",n).then((function(e){if(200===e.status){ae();var t=Math.ceil((J-1)/15);$(Z>=t?t:Z)}}))}}function ce(e){var t=0,n=q.slice();n.map((function(n){n.id===e.target.value&&(n.checkedBatch=e.target.checked),n.checkedBatch&&t++})),H(n),S(t),I(t===q.length)}function le(e){var n=[];e||q.map((function(e){e.checkedBatch&&n.push(e.id)})),(0,f.default)({title:"1"===k?"删除私信用户":e?"删除消息":"批量删除",contentTitle:"1"===k?"您确定要删除与 xxx 的聊天吗?":e?"您确定要删除这条@我消息吗?":"您确定要删除选中的"+C+"条消息吗?",content:"1"===k?"此操作将删除与xxx的聊天框和xxx的所有聊天记录,请进行确认以防数据的丢失":e?"此操作将删除这条消息,请进行确认以防数据的丢失":"此操作将删除选中的"+C+"条消息,请进行确认以防数据的丢失",onOk:function(){var r={type:"0"===k?"notification":"2"===k?"atme":"",ids:e||n};s.default.delete("/users/"+t.login+"/messages.json",{data:r}).then((function(e){if(200===e.status){ae();var t=Math.ceil((J-1)/15);$(Z>=t?t:Z),S(0),I(!1)}}))}})}function ie(e){e.notification_url&&(window.open(""+e.notification_url),oe([e.id]))}return(0,i.useEffect)((function(){var e=y&&y.common&&y.common.notice;t&&t.login?e||h.push("/settings/profile"):h.push("/explore")}),[y]),(0,i.useEffect)((function(){E("atme"===v?"2":"0")}),[v]),(0,i.useEffect)((function(){n()}),[G,z]),(0,i.useEffect)((function(){ae()}),[k,ne,Z,t]),u.default.createElement("div",{className:"notice01"},u.default.createElement("div",{className:"sshHead"},u.default.createElement(o.default,{mode:"horizontal",selectedKeys:k,onClick:function(e){E(e.key),$(1),re(),"2"!=e.key&&w(!1)}},u.default.createElement(o.default.Item,{key:"0"},u.default.createElement(c.default,{count:G,title:""},"系统通知")),u.default.createElement(o.default.Item,{key:"2"},u.default.createElement(c.default,{count:z},"@我"))),"0"===k&&G>0||"2"===k&&z>0?u.default.createElement("button",{className:"but25",onClick:function(){oe([-1])}},"所有","0"===k?"系统通知":"1"===k?"私信":"@我","一键已读"):""),u.default.createElement("div",{className:j?"invisible ":"visible"},u.default.createElement("div",{className:"vertical-center-style"},1===ne||q&&q.length>0?u.default.createElement(a.default,{checked:ne,onChange:function(e){return e.target.checked?re(1):re()}},"仅看未读","1"===k?"私信(12)":"0"===k?"消息("+G+")":"消息("+z+")"):""),"2"===k&&q&&q.length>0?u.default.createElement("button",{className:"batchDeleteBut",onClick:function(){w(!0)}},"批量删除"):""),q&&0===q.length?u.default.createElement(d.default,{_html:"暂无相关消息"}):"",q&&q.length>0&&u.default.createElement("div",{className:j?"visible":"invisible"},u.default.createElement("div",{className:"vertical-center-style"},u.default.createElement(a.default,{onChange:function(e){I(e.target.checked),S(e.target.checked?q.length:0);var t=q.slice();t.map((function(t){t.checkedBatch=e.target.checked})),H(t)},checked:V},"全选")," 已选择 ",u.default.createElement("span",{className:"numberSpan"},C)," 项"),u.default.createElement("div",null,u.default.createElement("button",{onClick:function(){w(!1),S(0);var e=q.slice();e.map((function(e){e.checkedBatch=!1})),H(e),I(!1)}},"取消")," ",u.default.createElement("button",{className:"deleteBut",onClick:C>0?function(){return le()}:function(){}},"删除"))),q&&q.map((function(e){return"0"===k?u.default.createElement("div",{className:"mynotice-content vertical-center-style",key:e.id},u.default.createElement("div",{className:"mynotice-cont stretch-style"},1===e.status?u.default.createElement(c.default,{color:"#FA2020"}):u.default.createElement("span",{className:"system-notice-blank"}),u.default.createElement("i",{className:"iconfont "+p.noticeSourceType[e.source]}),u.default.createElement("span",{className:"sysNotice-length "+(e.notification_url?"highlightSpan":""),onClick:function(){ie(e)},dangerouslySetInnerHTML:{__html:e.content}})),u.default.createElement("div",{className:"mynotice-cont vertical-center-style float-left-little"},u.default.createElement("span",{className:1===e.status?"timeSpan":""},e.time_ago),1===e.status&&u.default.createElement("span",{className:"invisable-read",onClick:function(){return oe([e.id])}},"标记为已读"))):"2"===k?u.default.createElement("div",{className:"mynotice-content vertical-center-style "+(j?"batchDel":""),key:e.id},u.default.createElement("div",{className:"mynotice-cont vertical-center-style"},u.default.createElement(a.default,{value:e.id,className:j?"visible-checkbox":"invisible-checkbox",onChange:ce,checked:e.checkedBatch}),e.sender&&u.default.createElement("img",{src:"https://testforgeplus.trustie.net//"+e.sender.image_url,className:"currentImg",onClick:function(){window.open("/"+(e.sender&&e.sender.login))}}),u.default.createElement("div",{className:"atme-notice-text stretch-style "+(e.notification_url&&"highlightSpan"),onClick:function(){ie(e)}},1===e.status?u.default.createElement(c.default,{color:"#FA2020"}):u.default.createElement("span",{className:"system-notice-blank"}),e.sender&&u.default.createElement("span",{className:"atme-length",dangerouslySetInnerHTML:{__html:"<b class = 'atme-notice-name'>"+e.sender.name+"</b> "+e.content+" 中@我"}}))),u.default.createElement("div",{className:"mynotice-cont vertical-center-style"},u.default.createElement("span",{className:j||1!==e.status?"":"timeSpan"},e.time_ago),!j&&1===e.status&&u.default.createElement("span",{className:"invisable-read",onClick:function(){return oe([e.id])}},"标记为已读")," ",!j&&u.default.createElement("span",{className:"invisable-read float-left-little",onClick:function(){return le([e.id])}},"删除"))):void 0})),!j&&u.default.createElement("div",{className:"paging"},u.default.createElement(r.default,{simple:!0,current:Z,pageSize:15,onChange:function(e){$(e)},total:J,hideOnSinglePage:!0})))}}}]); |