1 line
22 KiB
JavaScript
1 line
22 KiB
JavaScript
(this.webpackJsonp=this.webpackJsonp||[]).push([[101,14,22],{"0X2M":function(e,t,n){"use strict";var a=n("Q3sF"),c=n("xcSo"),l=Array.prototype;e.exports=function(e){var t=e.lastIndexOf;return e===l||a(l,e)&&t===l.lastIndexOf?c:t}},BfIq:function(e,t,n){e.exports=n("k2Gq")},OG05:function(e,t,n){"use strict";var a=n("pevS"),c=n("hVCs");a({target:"Array",proto:!0,forced:c!==[].lastIndexOf},{lastIndexOf:c})},V2mB:function(e,t,n){"use strict";n.r(t);var a=n("+oHS"),c=n.n(a),l=n("OWCx"),r=n.n(l),o=n("5PDf"),i=n.n(o),s=n("fHi0"),u=n.n(s),d=n("RXMP"),m=n.n(d),f=n("qjzJ"),g=n.n(f),v=n("HnXd"),p=n.n(v),h=n("LYCE"),b=n.n(h),E=(n("+L6B"),n("2/Rp")),w=(n("5NDa"),n("5rEg")),y=n("04Ix"),_=n.n(y),x=n("zLi2"),j=n.n(x),C=(n("y8nQ"),n("Vl3Y")),O=n("cDcd"),N=n.n(O),I=n("ess8"),B=n("p7gc"),S=(n("tlJt"),n("sYIF"),n("vDqi")),k=n.n(S);function q(e,t){var n=c()(e);if(r.a){var a=r()(e);t&&(a=i()(a).call(a,(function(t){return u()(e,t).enumerable}))),n.push.apply(n,a)}return n}function L(e){for(var t=1;t<arguments.length;t++){var n,a,c=null!=arguments[t]?arguments[t]:{};t%2?m()(n=q(Object(c),!0)).call(n,(function(t){_()(e,t,c[t])})):g.a?p()(e,g()(c)):m()(a=q(Object(c))).call(a,(function(t){b()(e,t,u()(c,t))}))}return e}t.default=C.a.create()(Object(O.forwardRef)((function(e){var t=e.form,n=e.organizeDetail,a=e.match.params.OIdentifier,c=t.getFieldDecorator,l=t.validateFields,r=t.setFieldsValue,o=(t.getFieldsValue,Object(O.useState)("")),i=j()(o,2),s=i[0],u=i[1],d=Object(O.useState)(""),m=j()(d,2),f=(m[0],m[1],Object(O.useState)(void 0)),g=j()(f,2),v=(g[0],g[1]);return Object(O.useEffect)((function(){n&&(u(n.memo),r(L({},n)),v(n.news_banner_id))}),[n]),N.a.createElement("div",{style:{border:"1px solid #eee"}},N.a.createElement(I.a,null,N.a.createElement("span",null,"组织首页管理")),N.a.createElement(C.a,{style:{padding:"20px 30px 30px 30px"}},N.a.createElement(C.a.Item,{label:"新闻动态原文链接"},c("news_url",{rules:[]})(N.a.createElement(w.a,{placeholder:"请输入新闻动态原文链接",maxLength:50}))),N.a.createElement(C.a.Item,{label:"新闻动态标题"},c("news_title",{rules:[]})(N.a.createElement(w.a,{placeholder:"请输入新闻动态标题",maxLength:45}))),N.a.createElement(C.a.Item,{label:"新闻动态内容"},c("news_content",{rules:[]})(N.a.createElement(w.a,{placeholder:"请输入新闻动态内容",maxLength:200}))),N.a.createElement("p",{class:"mt30"},"组织介绍"),N.a.createElement(B.a,{placeholder:"请输入组织介绍",height:300,mdID:"teamdescription",initValue:s,onChange:function(e){u(e)}}),N.a.createElement(E.a,{type:"primary",onClick:function(){l((function(t,n){if(!t){var c="/organizations/".concat(a,"/update_other.json");k.a.post(c,L(L({},n),{},{memo:s})).then((function(t){t&&e.showNotification("组织首页更新成功!")})).catch((function(e){}))}}))}},"确定")))})))},eXKH:function(e,t,n){},ex8r:function(e,t,n){},hVCs:function(e,t,n){"use strict";var a=n("oLk2"),c=n("pCEo"),l=n("x9K+"),r=n("x08Q"),o=n("n2Hk"),i=Math.min,s=[].lastIndexOf,u=!!s&&1/[1].lastIndexOf(1,-0)<0,d=o("lastIndexOf"),m=u||!d;e.exports=m?function(e){if(u)return a(s,this,arguments)||0;var t=c(this),n=r(t);if(0===n)return-1;var o=n-1;for(arguments.length>1&&(o=i(o,l(arguments[1]))),o<0&&(o=n+o);o>=0;o--)if(o in t&&t[o]===e)return o||0;return-1}:s},k2Gq:function(e,t,n){"use strict";var a=n("0X2M");e.exports=a},"p77/":function(e,t,n){},p7gc:function(e,t,n){"use strict";var a=n("UtpJ"),c=n.n(a),l=n("O0yt"),r=n.n(l),o=n("Dcj1"),i=n.n(o),s=n("6UaR"),u=n.n(s),d=n("zLi2"),m=n.n(d),f=n("IeeE"),g=n.n(f),v=n("RKTd"),p=n.n(v),h=n("pPxq"),b=n.n(h),E=n("o+MX"),w=n.n(E),y=n("FLGM"),_=n.n(y),x=n("BfIq"),j=n.n(x),C=n("BF1V"),O=n.n(C),N=n("0lTi"),I=n.n(N),B=n("lHQ6"),S=n.n(B),k=n("ZbhI"),q=n.n(k),L=n("UF4K"),D=n.n(L),M=n("xlHU"),R=n.n(M),V=n("5tqG"),F=n.n(V),P=n("cDcd"),U=n.n(P),z=n("sYIF"),A=n("bdgK"),K=n("vDqi"),T=n.n(K);function G(e,t){var n=void 0!==r.a&&i()(e)||e["@@iterator"];if(!n){if(u()(e)||(n=function(e,t){if(e){var n;if("string"==typeof e)return H(e,t);var a=c()(n={}.toString.call(e)).call(n,8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?I()(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?H(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var a=0,l=function(){};return{s:l,n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,d=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){d=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(d)throw o}}}}function H(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}n("pb8e"),n("ex8r"),n("p77/"),n("eXKH");var J=window.$,Y=["bold","italic","del","|","list-ul","list-ol","|","code","code-block","link","|","image","table","|","line-break","watch","clear","emoji","fullscreen"],X=["bold","italic","del","|","list-ul","list-ol","|","code","code-block","link","|","inline-latex","latex","|","image","table","|","line-break","watch","clear","emoji","fullscreen"];function $(e,t,n){window.sessionStorage.removeItem(e+t);var a="#e_tip_"+n;"content"==e?J("#e_tips_"+n).html(" "):J(a).html(" ")}function Q(e,t,n){var a=window.sessionStorage.getItem("content"+t);if(null!==a&&a!==e.getValue()){J("#e_tips_"+n).data("editor",e);var c='您上次有已保存的数据,是否<a style="cursor: pointer;" class="link-color-blue" onclick="md_rec_data(\'content\',\''+t+"','"+n+'\')">恢复</a> ? / <a style="cursor: pointer;" class="link-color-blue" onclick="md_clear_data(\'content\',\''+t+"','"+n+"')\">不恢复</a>";J("#e_tips_"+n).html(c)}return g()((function(){var a,c=new Date,l=c.getHours(),r=c.getMinutes(),o=c.getSeconds();if(l=l<10?"0"+l:l,r=r<10?"0"+r:r,o=o<10?"0"+o:o,""!==p()(a=e.getValue()).call(a)){!function(e,t,n){window.sessionStorage.setItem("content"+t,n)}(0,t,e.getValue());var i="#e_tips_"+n,s=" 数据已于 "+l+":"+r+":"+o+" 保存 ",u=J(i).html();u&&" "!==u&&!1===b()(u).call(u," 数据已于 ")?J(i).html(u.split(" (")[0]+" (".concat(s,")")):J(i).html(s)}}),1e4)}window.md_clear_data=$,window.md_rec_data=function(e,t,n){null!==window.sessionStorage.getItem(e+t)&&(J("#e_tips_"+n).data("editor").setValue(window.sessionStorage.getItem(e+t)),$(e,t,n))},t.a=function(e){var t,n,a=e.mdID,c=e.onChange,l=e.onCMBeforeChange,r=e.onCMBlur,o=e.error,i=void 0!==o&&o,s=e.className,u=void 0===s?"":s,d=e.noStorage,f=void 0!==d&&d,g=e.imageExpand,v=void 0===g||g,p=e.placeholder,h=void 0===p?"":p,b=e.width,E=void 0===b?"100%":b,y=e.height,x=void 0===y?400:y,C=e.initValue,N=void 0===C?"":C,B=(e.emoji,e.watch),k=void 0===B||B,L=(e.showNullButton,e.showResizeBar),M=void 0!==L&&L,V=e.startInit,K=void 0===V||V,H=(e.forMember,e.isCanAtme),J=void 0!==H&&H,$=e.isQuoteIssue,W=void 0!==$&&$,Z=e.changeAtWhoLoginList,ee=e.owner,te=e.projectsId,ne=e.isFocus,ae=void 0===ne||ne,ce=e.showLatexButton,le=void 0===ce||ce,re=Object(P.useRef)(),oe=Object(P.useRef)(),ie=Object(P.useState)(),se=m()(ie,2),ue=se[0],de=se[1],me=Object(P.useState)(!1),fe=m()(me,2),ge=fe[0],ve=fe[1],pe=Object(P.useState)([]),he=m()(pe,2),be=he[0],Ee=he[1],we=Object(P.useState)([]),ye=m()(we,2),_e=ye[0],xe=ye[1],je=Object(P.useState)([]),Ce=m()(je,2),Oe=Ce[0],Ne=Ce[1],Ie=Object(P.useRef)([]),Be=Object(P.useRef)(!1),Se="mdEditor_".concat(a),ke="mdEditors_".concat(a),qe="e_tips_mdEditor_".concat(a),Le=Object(P.useState)([]),De=m()(Le,2),Me=De[0],Re=De[1],Ve=Object(P.useState)(!1),Fe=m()(Ve,2),Pe=Fe[0],Ue=Fe[1],ze=Object(P.useState)([]),Ae=m()(ze,2),Ke=Ae[0],Te=Ae[1],Ge=Object(P.useRef)(!1),He=Object(P.useRef)([]);function Je(e){var t;T.a.get(w()(t="/v1/".concat(ee,"/")).call(t,te,"/issues"),{params:{only_name:!0,keyword:e,sort_direction:"desc",sort_by:"issues.created_on",limit:500,page:1}}).then((function(t){if(t){!e&&Re(t.data.issues);var n=t.data.issues;Te(n&&n.length>0?n:void 0)}}))}Object(P.useEffect)((function(){var e;J&&T.a.get(w()(e="/".concat(ee,"/")).call(e,te,"/members.json")).then((function(e){0!==e.data.total_count&&(Ne(e.data.users),xe(e.data.users))})),document.addEventListener("click",(function(){Be.current=!1,ve(!1),Ge.current=!1,Ue(!1)})),W&&Je()}),[]);var Ye=U.a.createElement("div",{id:"quoteDiv",className:"quoteDiv"},Ke&&_()(Ke).call(Ke,(function(e,t){return U.a.createElement("li",{className:"quote ".concat(0===t&&"active"),onClick:function(){return function(e){var t,n,a,c;Ge.current=!1,Ue(!1);var l=ue.cm,r=l.doc.getCursor(),o=r.line,i=r.ch,s=j()(t=l.getRange({line:o,ch:0},{line:o,ch:i})).call(t,"#");l.replaceRange(w()(n=w()(a=w()(c="[#".concat(e.subject,"](/")).call(c,ee,"/")).call(a,te,"/issues/")).call(n,e.project_issues_index,") "),{line:o,ch:s},{line:o,ch:i}),l.focus();var u=new O.a(He.current);u.add(e.project_issues_index),He.current=I()(u)}(e)},onMouseOver:function(){return e=t,document.getElementsByClassName("quote active")[0]&&(document.getElementsByClassName("quote active")[0].className="quote"),void(document.getElementsByClassName("quote")[e]&&(document.getElementsByClassName("quote")[e].className="quote active"));var e}},U.a.createElement("span",{style:{minWidth:"40px"}},U.a.createElement("span",{className:"issueIndex",title:e.project_issues_index},"#",e.project_issues_index)),U.a.createElement("span",{className:"issueName task-hide"},e.subject))})));function Xe(e){var t=document.getElementsByClassName("CodeMirror cm-s-default CodeMirror-wrap")[0].firstChild.style,n=ue.cm.getValue();if(e.shiftKey&&"Digit2"===e.code&&(Be.current=!0,ve(!0),document.getElementById("at_who_list").style.top=S()(t.getPropertyValue("top").replace("px",""))+62+"px",document.getElementById("at_who_list").style.left=S()(t.getPropertyValue("left").replace("px",""))+20+"px"),e.ctrlKey&&"KeyZ"===e.code&&0!==Oe.length){if(N){var a=[];_()(Oe).call(Oe,(function(e){var t;-1!=q()(N).call(N,e.username)&&"@"===N.charAt(q()(N).call(N,e.username)-1)&&q()(N).call(N,"@".concat(e.username))===q()(n).call(n,"@".concat(e.username))&&(a[a.length]=w()(t="[@".concat(e.username,"](/")).call(t,e.login,")"))})),0!=a.length&&_()(a).call(a,(function(e){n=n.replace(e,"")}))}-1!=q()(n).call(n,"@")&&_()(Oe).call(Oe,(function(e){if(-1!=q()(n).call(n,e.username)&&"@"===n.charAt(q()(n).call(n,e.username)-1)){var t=new O.a(Ie.current);t.add(e.login),Ie.current=I()(t),Ee(I()(t))}}))}e.shiftKey&&"Digit3"===e.code&&W&&(Ge.current=!0,Ue(!0),document.getElementById("quoteDiv").style.top=S()(t.getPropertyValue("top").replace("px",""))+62+"px",document.getElementById("quoteDiv").style.left=S()(t.getPropertyValue("left").replace("px",""))+20+"px")}Object(P.useEffect)((function(){if(Qe)if(Ge.current){var e=document.getElementById("quoteDiv"),t=document.getElementsByClassName("quote");Qe.addKeyMap({Up:function(){for(var n,a=0;a<t.length;a++)"quote active"===t[a].className&&(n=a);n>0&&(n<=t.length-4&&(e.scrollTop-=40),t[n].className="quote",t[n-1].className="quote active")},Down:function(){for(var n,a=0;a<t.length;a++)"quote active"===t[a].className&&(n=a);n<t.length-1&&(n>=3&&(e.scrollTop+=40),t[n].className="quote",t[n+1].className="quote active")},Enter:function(){document.getElementsByClassName("quote active")[0]&&document.getElementsByClassName("quote active")[0].click()}})}else Qe.removeKeyMap()}),[Pe]),Object(P.useEffect)((function(){Z&&Z(be)}),[be]);var $e=U.a.createElement("div",{className:"at_who_list",id:"at_who_list"},_e&&_()(_e).call(_e,(function(e,t){return U.a.createElement("div",{key:t,className:"at_who ".concat(0===t&&"active"),onClick:function(){!function(e){var t;Be.current=!1,ve(!1);var n=ue.cm,a=n.doc.getCursor(),c=a.line,l=a.ch,r=j()(t=n.getRange({line:c,ch:0},{line:c,ch:l})).call(t,"@"),o=void 0;_()(_e).call(_e,(function(t){t.username===e&&(o=t.login)})),n.replaceRange("[@"+e+"]"+"(/".concat(o,") "),{line:c,ch:r},{line:c,ch:l}),n.focus();var i=new O.a(Ie.current);i.add(o),Ie.current=I()(i),Ee(I()(i))}(e.username)},onMouseOver:function(){!function(e){document.getElementsByClassName("at_who active")[0]&&(document.getElementsByClassName("at_who active")[0].className="at_who"),document.getElementsByClassName("at_who")[e]&&(document.getElementsByClassName("at_who")[e].className="at_who active")}(t)}},e.image_url&&U.a.createElement("img",{src:Object(z.i)("/".concat(e.image_url)),alt:""}),U.a.createElement("span",null,e.username))})));Object(P.useEffect)((function(){!ue&&K&&window.editormd(Se,{width:E,height:x,path:Object(z.m)("/editormd/lib/"),markdown:N,syncScrolling:"single",tex:!0,tocm:!0,emoji:!0,taskList:!0,codeFold:!0,searchReplace:!0,htmlDecode:"style,script,iframe",sequenceDiagram:!0,autoFocus:!1,watch:k,saveHTMLToTextarea:!0,dialogMaskOpacity:.6,placeholder:h,imageUpload:!0,imageFormats:["jpg","jpeg","gif","png","bmp","webp","JPG","JPEG","GIF","PNG","BMP","WEBP"],imageUploadURL:Object(z.l)(),toolbarIcons:function(){return le?X:Y},toolbarIconsClass:{"line-break":"fa-minus",fullScreen:"iconfont icon-fangdaicon font-14"},toolbarCustomIcons:{"inline-latex":"<a title='行内公式' class='latex' ><i name='inline-latex' class='fa iconfont icon-hangneigongshi font-14'></i></a>",latex:"<a title='多行公式' class='latex' ><i name='latex' class='fa iconfont icon-duohanggongshi font-16'></i></a>","null-button":"<a class='pr' title='增加填空'><i class='border-left'><span></span></i><span name='null-button' class='fa fillTip'>点击插入填空项</span><i class='iconfont fa icon-edit font-16' name='null-button'></i></a>"},toolbarHandlers:{"line-break":function(e,t,n,a){e.replaceSelection("<br/>")},"null-button":function(e,t,n,a){""===a&&e.setCursor(n.line,n.ch+1),e.replaceSelection("▁")},fullScreen:function(e,t,n,a){t.addClass("none")},"inline-latex":function(e,t,n,a){e.replaceSelection("$"+a+"$"),e.setCursor(n.line,n.ch+2),e.focus()},latex:function(e,t,n,a){e.replaceSelection("$$\n\n"+a+"$$"),e.setCursor(n.line+1,0),e.focus()}},lang:{toolbar:{latex:"多行公式","line-break":"换行",fullScreen:"开启全屏"}},onload:function(){de(this)}})}),[Se,ue,K]);var Qe=ue&&ue.cm;return Object(P.useEffect)((function(){Be.current?Qe.addKeyMap({Up:function(){for(var e,t=document.getElementById("at_who_list"),n=document.getElementsByClassName("at_who"),a=0;a<n.length;a++)"at_who active"===n[a].className&&(e=a);e>0&&(e<=n.length-4&&(t.scrollTop-=40),n[e].className="at_who",n[e-1].className="at_who active")},Down:function(){for(var e,t=document.getElementById("at_who_list"),n=document.getElementsByClassName("at_who"),a=0;a<n.length;a++)"at_who active"===n[a].className&&(e=a);e<n.length-1&&(e>=3&&(t.scrollTop+=40),n[e].className="at_who",n[e+1].className="at_who active")},Enter:function(){if(document.getElementsByClassName("at_who active")[0])document.getElementsByClassName("at_who active")[0].click();else{var e=ue.cm,t=e.doc.getCursor(),n=t.line,a=t.ch;e.replaceRange("\n",{line:n,ch:a},{line:n,ch:a}),ve(!1),Be.current=!1}}}):Qe&&Qe.removeKeyMap()}),[ge]),Object(P.useEffect)((function(){if(Be.current&&_e){var e=document.getElementsByClassName("CodeMirror cm-s-default CodeMirror-wrap")[0].firstChild.style,t="添加评论..."===h?80:10;document.getElementById("at_who_list").style.left=S()(e.getPropertyValue("left").replace("px",""))+t+"px"}}),[_e]),Object(P.useEffect)((function(){if(Qe){var e,t=null;return r&&ue.cm.on("blur",(function(){r(ue.getValue())})),l&&ue.cm.on("beforeChange",(function(e,t){l(e,t)})),f||(t=Q(ue,"MDEditor__".concat(Se),Se)),(J||W)&&ue.cm.on("focus",(function(){document.addEventListener("keydown",Xe)})),(J||W)&&ue.cm.on("blur",(function(){document.removeEventListener("keydown",Xe)})),ue.cm.on("change",(function(e){var t=e.getValue();if(c&&c(t),Ge.current){var n=e.doc.getCursor(),a=n.line,l=n.ch,r=Qe.getRange({line:a,ch:0},{line:a,ch:l});-1===q()(r).call(r,"#")||" "===(r=r.substring(j()(r).call(r,"#")+1))?(Ue(!1),Ge.current=!1):Je(r)}if(Be.current){var o,i=e.doc.getCursor(),s=i.line,u=i.ch,d=Qe.getRange({line:s,ch:0},{line:s,ch:u});-1===q()(d).call(d,"@")?(ve(!1),Be.current=!1):(d=d.substring(j()(d).call(d,"@")+1))?T.a.get(w()(o="/".concat(ee,"/")).call(o,te,"/members.json"),{params:{search:d}}).then((function(e){e&&e.data&&0!==e.data.total_count?xe(e.data.users):xe(void 0)})):xe(Oe)}if(function(e,t,n){if(0!=n.length){var a,c=ue.cm,l=c.getValue();if(N){var r=[];_()(t).call(t,(function(t){var n,a,c,o,i,s,u,d,m=t.username;m=t.project_issues_index,-1!=q()(N).call(N,m)&&N.charAt(q()(N).call(N,m)-1)===e&&q()(N).call(N,w()(n="".concat(e)).call(n,m))===q()(l).call(l,w()(a="".concat(e)).call(a,m))&&(r[r.length]=w()(c=w()(o="[".concat(e)).call(o,m,"](/")).call(c,m,")"),r[r.length]=w()(i=w()(s=w()(u=w()(d="[".concat(e)).call(d,m,"](")).call(u,ee,"/")).call(s,te,"/issues/")).call(i,m,")"))})),0!=r.length&&_()(r).call(r,(function(e){l=l.replace(e,"")}))}var o=new D.a;_()(a=I()(n)).call(a,(function(e){_()(t).call(t,(function(t){t.project_issues_index===e&&o.set(t.project_issues_index,t.project_issues_index)}))}));var i=c.doc.getCursor(),s=i.line,u=i.ch;-1===q()(l).call(l,e)&&(He.current=[]);var d,m,f=c.getRange({line:s,ch:0},{line:s,ch:u}),g=c.getLine(s);g&&-1!==q()(g).call(g,e)?_()(d=I()(R()(o).call(o))).call(d,(function(t){var n,a,r,i,d=w()(n=w()(a=w()(r=w()(i="[".concat(e)).call(i,t,"](/")).call(r,ee,"/")).call(a,te,"/issues/")).call(n,o.get(t),")");if(F()(f).call(f,d)&&c.setSelection({line:s,ch:j()(f).call(f,e)-1},{line:s,ch:u}),-1===q()(l).call(l,d)){var m=new O.a(He.current);m.delete(o.get(t)),He.current=I()(m)}})):_()(m=I()(R()(o).call(o))).call(m,(function(t){var n,a,c,r,i=w()(n=w()(a=w()(c=w()(r="[".concat(e)).call(r,t,"](/")).call(c,ee,"/")).call(a,te,"/issues/")).call(n,o.get(t),")");if(-1===q()(l).call(l,i)){var s=new O.a(He.current);s.delete(o.get(t)),He.current=I()(s)}}))}}("#",Me,He.current),0!=Ie.current.length){var m,f=ue.cm,g=f.getValue();if(N){var v=[];_()(Oe).call(Oe,(function(e){var t;-1!=q()(N).call(N,e.username)&&"@"===N.charAt(q()(N).call(N,e.username)-1)&&q()(N).call(N,"@".concat(e.username))===q()(g).call(g,"@".concat(e.username))&&(v[v.length]=w()(t="[@".concat(e.username,"](/")).call(t,e.login,")"))})),0!=v.length&&_()(v).call(v,(function(e){g=g.replace(e,"")}))}var p=new D.a;_()(m=I()(Ie.current)).call(m,(function(e){_()(Oe).call(Oe,(function(t){t.login===e&&p.set(t.username,t.login)}))}));var h=f.doc.getCursor(),b=h.line,E=h.ch;-1===q()(g).call(g,"@")&&(Ie.current=[],Ee([]));var y,x,C=f.getRange({line:b,ch:0},{line:b,ch:E}),B=f.getLine(b);B&&-1!==q()(B).call(B,"@")?_()(y=I()(R()(p).call(p))).call(y,(function(e){var t,n=w()(t="[@".concat(e,"](/")).call(t,p.get(e),")");if(F()(C).call(C,n)&&f.setSelection({line:b,ch:j()(C).call(C,"@")-1},{line:b,ch:E}),-1===q()(g).call(g,n)){var a=new O.a(Ie.current);a.delete(p.get(e)),Ie.current=I()(a),Ee(I()(a))}})):_()(x=I()(R()(p).call(p))).call(x,(function(e){var t,n=w()(t="[@".concat(e,"](/")).call(t,p.get(e),")");if(-1===q()(g).call(g,n)){var a=new O.a(Ie.current);a.delete(p.get(e)),Ie.current=I()(a),Ee(I()(a))}}))}})),e=function(){var e;return re.current&&(e=new A.default((function(e){var t,n=G(e);try{for(n.s();!(t=n.n()).done;){var a=t.value;(a.target.offsetHeight>0||a.target.offsetWidth>0)&&(ue.resize(),ue.cm.refresh(),ae&&ue.cm.focus())}}catch(e){n.e(e)}finally{n.f()}}))).observe(re.current),e}(),function(){f||clearInterval(t),e&&e.unobserve(re.current)}}}),[Qe]),Object(P.useEffect)((function(){ue&&null!=N&&N!==ue.getValue()&&ue.setValue(N.toString())}),[ue,N,Se]),Object(P.useEffect)((function(){if(oe.current){var e=function(e){c=!0,l=e.pageY},t=function(){c=!1},n=function(e){if(c){var t=e.pageY-l;t<0&&(t=0),t>300&&(t=300);var n=x+t+"px";ue.resize("",n)}},a=oe.current,c=!1,l=0;return a.addEventListener("mousedown",e),document.addEventListener("mousemove",n),document.addEventListener("mouseup",t),function(){a.removeEventListener("mousedown",e),document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",t)}}}),[ue,oe]),U.a.createElement(P.Fragment,null,U.a.createElement("div",{ref:re,className:w()(t=w()(n="df editormd-editing ".concat(u," ")).call(n,v&&"editormd-image-click-expand"," ")).call(t,Pe||ge?"quoteBox":""," ")},U.a.createElement("div",{className:"edu-back-greyf5 radius4 editormd ".concat(i?"error":""),id:Se},Pe&&Ye,ge&&$e,U.a.createElement("textarea",{style:{display:"none"},id:ke,name:"content"}),U.a.createElement("div",{className:"CodeMirror cm-s-defualt",style:{display:"none"}}))),M?U.a.createElement("a",{ref:oe,className:"editor-resize"}):null,U.a.createElement("div",{className:"fr rememberTip"},!0===f?null:U.a.createElement("div",{id:qe,className:"edu-txt-right color-grey-cd font-12"})))}},pb8e:function(e,t,n){},tlJt:function(e,t,n){"use strict";n("DZo9");var a=n("8z0m"),c=(n("Pwec"),n("CtXQ")),l=(n("miYZ"),n("tsqr")),r=n("zLi2"),o=n.n(r),i=n("cDcd"),s=n.n(i),u=n("sYIF"),d=n("Po8q"),m=n.n(d);t.a=function(e){var t=e.getImage,n=e.url,r=e.getImageId,d=e.maxSize,f=void 0===d?2:d,g=e.action,v=void 0===g?Object(u.l)():g,p=e.getImageUrl,h=Object(i.useState)(void 0),b=o()(h,2),E=b[0],w=b[1],y=Object(i.useState)(!1),_=o()(y,2),x=_[0],j=_[1];return Object(i.useEffect)((function(){w(n)}),[n]),s.a.createElement(a.a,{name:"file",listType:"picture-card",className:"avatar-uploader",showUploadList:!1,action:v,beforeUpload:function(e){var t="image/jpeg"===e.type||"image/png"===e.type;t||l.a.error("上传的图片只能是JPG或者PNG格式!");var n=e.size/1024/1024<f;return n||l.a.error("上传的图片不能超过".concat(f,"MB!")),t&&n&&j(!0),t&&n},onChange:function(e){var n,a,c;e&&e.file&&"done"===e.file.status&&(j(!1),r&&r(e.file.response.id),p&&p(e.file.response.url),n=e.file.originFileObj,a=function(e){return w(e)},(c=new FileReader).addEventListener("load",(function(){return a(c.result)})),c.readAsDataURL(n),c.onload=function(e){t&&t(e.target.result)})},accept:".png,.jpg,.jpeg",withCredentials:!0,headers:{Authorization:m.a.load("autologin_trustie")}},E?s.a.createElement("img",{src:E,alt:"avatar",style:{width:"100%"}}):s.a.createElement("div",null,s.a.createElement(c.a,{type:x?"loading":"plus"}),s.a.createElement("div",{className:"ant-upload-text"},"点击上传")))}},xcSo:function(e,t,n){"use strict";n("OG05");var a=n("wY6U");e.exports=a("Array","lastIndexOf")}}]); |