build/static/js/111.9864971f.chunk.js

1 line
26 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(this.webpackJsonp=this.webpackJsonp||[]).push([[111,8],{"1Man":function(e,t,a){"use strict";a.r(t);var n=a("+oHS"),c=a.n(n),l=a("OWCx"),r=a.n(l),o=a("5PDf"),i=a.n(o),s=a("fHi0"),u=a.n(s),d=a("RXMP"),m=a.n(d),f=a("qjzJ"),g=a.n(f),p=a("HnXd"),v=a.n(p),h=a("LYCE"),b=a.n(h),E=a("EcSs"),w=a.n(E),y=(a("+L6B"),a("2/Rp")),_=(a("OaEy"),a("2fM7")),j=(a("y8nQ"),a("Vl3Y")),x=(a("5NDa"),a("5rEg")),C=(a("sPJy"),a("bE4q")),N=(a("miYZ"),a("tsqr")),O=a("04Ix"),I=a.n(O),S=a("zLi2"),B=a.n(S),k=a("HU8g"),q=a.n(k),M=a("5tqG"),L=a.n(M),D=a("X25t"),U=a.n(D),V=a("o+MX"),z=a.n(V),R=a("FLGM"),T=a.n(R),F=a("cDcd"),P=a.n(F),K=a("sYIF"),A=a("p7gc"),H=(a("T2oS"),a("W9HT")),G=a("SPx3"),J=a.n(G),Y=a("a0dU"),X=a.n(Y),$=a("STz3"),W=a.n($),Z=a("ZbhI"),Q=a.n(Z),ee=a("mnMc"),te=a.n(ee),ae=a("LuXi"),ne=(a("Vg4E"),a("Po8q")),ce=a.n(ne),le=a("vDqi"),re=a.n(le);a("Glsh");var oe=function(e){var t=e.value,a=e.setValue,n=e.uploadUrl,c=e.videoUploadUrl,l=Object(F.useState)(null),r=B()(l,2),o=r[0],i=r[1],s=Object(F.useState)(!1),u=B()(s,2),d=u[0],m=u[1];Object(F.useEffect)((function(){t&&a&&a(t)}),[]);var f={placeholder:"请输入内容...",MENU_CONF:{uploadImage:{server:n,headers:{Authorization:ce.a.load("autologin_trustie")},withCredentials:!0,fieldName:"file",maxFileSize:20971520,allowedFileTypes:["image/jpeg","image/png","image/gif","image/webp","image/svg+xml","image/bmp"],customInsert:function(e,t){var a=e.url;t(a,"图片",a)},onBeforeUpload:function(e){var t=W()(e)[0],a=t.type,n=t.name,c=["image/jpeg","image/png","image/gif","image/webp","image/svg+xml","image/bmp"],l=n&&n.split(".")[1];return-1!==Q()(c).call(c,a)&&"tiff"!==l?e:(N.a.error("只能上传jpg、jpeg、webp、png、svg、gif、bmp格式的图片!"),!1)},onError:function(e,t){var a;N.a.error(z()(a="".concat(e.name," 上传出错, ")).call(a,t))}},uploadVideo:{customUpload:function(e,t){return J()(X.a.mark((function a(){var l,r;return X.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(te()(l=e.type).call(l,"video")){a.next=4;break}return a.abrupt("return",N.a.error("请上传视频格式的文件!"));case 4:if(!(e.size/1024/1024>200)){a.next=6;break}return a.abrupt("return",N.a.error("请上传200M以内的文件"));case 6:(r=new FormData).append("file",e),m(!0),re.a.post(c||n,r,{headers:{Authorization:ce.a.load("autologin_trustie")}}).then((function(e){m(!1),e&&e.data&&200===e.data.code?t(e.data.url):N.a.error(e&&e.data&&e.data.msg)}));case 10:case"end":return a.stop()}}),a)})))()}}}};return Object(F.useEffect)((function(){return function(){null!==o&&(o.destroy(),i(null))}}),[o]),P.a.createElement("div",{style:{border:"1px solid #ccc",zIndex:100,video:{maxWidth:"100%"}}},P.a.createElement(H.a,{spinning:d,tip:"上传中,请耐心等待"},P.a.createElement(ae.b,{editor:o,defaultConfig:{excludeKeys:["todo","fullScreen"]},mode:"default",style:{borderBottom:"1px solid #ccc"}}),P.a.createElement(ae.a,{defaultConfig:f,value:t,onCreated:i,onChange:function(e){return a&&a(e.getHtml())},mode:"default",style:{height:"500px",overflowY:"hidden"}})))},ie=a("tlJt"),se=(a("10VC"),a("c2x/"),a("J66h")),ue=a("TxSN"),de=a("UUzw");function me(e,t){var a=c()(e);if(r.a){var n=r()(e);t&&(n=i()(n).call(n,(function(t){return u()(e,t).enumerable}))),a.push.apply(a,n)}return a}function fe(e){for(var t=1;t<arguments.length;t++){var a,n,c=null!=arguments[t]?arguments[t]:{};t%2?m()(a=me(Object(c),!0)).call(a,(function(t){I()(e,t,c[t])})):g.a?v()(e,g()(c)):m()(n=me(Object(c))).call(n,(function(t){b()(e,t,u()(c,t))}))}return e}t.default=j.a.create()((function(e){var t=e.history,a=e.id,n=e.role,c=e.current_user,l=(e.temp,e.form),r=l.getFieldDecorator,o=l.validateFields,i=l.setFieldsValue,s=l.setFields,u=e.match.params,d=u.deptId,m=u.id,f=e.location.pathname,g=Object(F.useState)(new q.a(e.location.search.substring(1)).get("type")),p=B()(g,2),v=p[0],h=p[1],b=Object(F.useState)(void 0),E=B()(b,2),O=E[0],I=E[1],S=Object(F.useState)(void 0),k=B()(S,2),M=k[0],D=k[1],V=Object(F.useState)(void 0),R=B()(V,2),H=R[0],G=R[1],J=Object(F.useState)(!1),Y=B()(J,2),X=Y[0],$=Y[1],W=Object(F.useState)(!1),Z=B()(W,2),Q=Z[0],ee=Z[1],te=e.data.sectionCmsTitle;return Object(F.useEffect)((function(){(n&&"None"===n.role||c&&!c.login)&&t.push("/zone/".concat(d))}),[n]),Object(F.useEffect)((function(){a&&Object(ue.p)(a).then((function(e){e&&G(e.data.rows)}))}),[a]),Object(F.useEffect)((function(){f&&(L()(f).call(f,"/edit")?(ee(!0),Object(ue.u)(m).then((function(e){if(e&&e.data){var t=e.data.data,a=t.name,n=t.summary,c=t.cmsDir,l=t.content,r=t.headImg,o=t.editorType,s=t.keywords;h("rich_editor"===o?"richEditor":"mdEditor"),i({name:a,summary:n,dirId:c&&c.id,content:se.Base64.decode(l),headImg:r,keywords:s}),D(r),I(se.Base64.decode(l))}}))):ee(!1))}),[f]),P.a.createElement("div",{className:"boxmain pt30 newsCreateBox pb100"},P.a.createElement(C.a,{separator:">"},P.a.createElement(C.a.Item,{href:"/zone/".concat(d,"/news")},te),P.a.createElement(C.a.Item,null,Q?"编辑":"新建","文章")),P.a.createElement("div",{className:"formBox"},P.a.createElement(j.a,w()({},{labelCol:{span:2},wrapperCol:{span:14}},{onSubmit:function(e){e.preventDefault(),o((function(e,a){var n="richEditor"===v&&"<p><br></p>"===a.content;if(e||n)n&&s({content:{value:a.content,errors:[new Error("请输入内容!")]}});else{var c;a.keywords&&(a.keywords=U()(c=a.keywords).call(c,"",",")),$(!0);var l=fe(fe({},a),{},{editorType:"richEditor"===v?"rich_editor":"markdown_editor",headImg:M,content:se.Base64.encode(a.content)});if(Q)return delete l.editorType,Object(ue.K)(m,l).then((function(e){var a,n=e.data,c=n.code,l=n.msg;$(!1),200===c?(N.a.success("提交成功"),t.push(z()(a="/zone/".concat(d,"/newdetail/")).call(a,m))):N.a.error(l||"提交失败,请联系管理员!")})).catch((function(e){$(!1)}));Object(ue.b)(a.dirId,l).then((function(e){var a,n=e.data,c=n.code,l=n.msg,r=n.data;$(!1),200===c?(N.a.success("提交成功"),t.push(z()(a="/zone/".concat(d,"/newdetail/")).call(a,r))):N.a.error(l||"提交失败,请联系管理员!")})).catch((function(e){$(!1)}))}}))}}),P.a.createElement(j.a.Item,{label:"标题"},r("name",{rules:[{required:!0,message:"请输入文章标题!"},{type:"string",max:200,message:"最大长度200"},{pattern:/^[^<>[\]/\\]+$/,message:"不能输入特殊字符:< > [ ] / \\"}]})(P.a.createElement(x.a,{placeholder:"请输入文章标题",maxLength:200,width:"220px"}))),P.a.createElement(j.a.Item,{label:"概览"},r("summary",{rules:[{required:!0,message:"请输入概览!"},{type:"string",max:200,message:"最大长度200"}]})(P.a.createElement(x.a.TextArea,{placeholder:"请输入概览",maxLength:200,width:"220px"}))),P.a.createElement(j.a.Item,{label:"栏目"},r("dirId",{rules:[{required:!0,message:"请选择文章所属栏目!"}]})(P.a.createElement(_.a,{placeholder:"请选择文章所属栏目"},H&&T()(H).call(H,(function(e){return P.a.createElement(_.a.Option,{key:e.id,value:e.id},e.name)}))))),P.a.createElement(j.a.Item,{label:"文章标签"},r("keywords",{rules:[{type:"string",max:30,message:"请精简文章标签最大长度30"}]})(P.a.createElement(x.a,{placeholder:"请输入关键词作为文章标签,使用逗号分隔",maxLength:30,width:"220px"}))),P.a.createElement(j.a.Item,{label:"内容",wrapperCol:{span:21}},r("content",{rules:[{required:!0,message:"请输入内容!"}]})("richEditor"===v?P.a.createElement(oe,{uploadUrl:"".concat(de.b,"/file/common/upload"),videoUploadUrl:"".concat(de.b,"/file/common/upload?type=cms"),setValue:function(e){i({content:e})}}):P.a.createElement(A.a,{placeholder:"请输入详细介绍",height:500,className:"editNewsMd",initValue:O,onChange:function(e){i({content:e})},imageExpand:!1}))),P.a.createElement(j.a.Item,{label:"首图",extra:"建议图片比例宽为32上传jpg、jpeg、webp、png、svg、gif、bmp格式的图片"},P.a.createElement(ie.a,{maxSize:5,getImageUrl:function(e){return D(e)},url:M||void 0,action:Object(K.o)("/api/cms/common/upload")})),P.a.createElement(j.a.Item,{wrapperCol:{offset:2}},P.a.createElement(y.a,{className:"mr20 themeBut",onClick:function(){t.go(-1)}},"取消"),P.a.createElement(y.a,{type:"primary",htmlType:"submit",loading:X,className:"themeBut"},"提交")))))}))},Glsh:function(e,t,a){},eXKH:function(e,t,a){},ex8r:function(e,t,a){},p7gc:function(e,t,a){"use strict";var n=a("UtpJ"),c=a.n(n),l=a("O0yt"),r=a.n(l),o=a("Dcj1"),i=a.n(o),s=a("6UaR"),u=a.n(s),d=a("zLi2"),m=a.n(d),f=a("IeeE"),g=a.n(f),p=a("RKTd"),v=a.n(p),h=a("pPxq"),b=a.n(h),E=a("o+MX"),w=a.n(E),y=a("FLGM"),_=a.n(y),j=a("BfIq"),x=a.n(j),C=a("BF1V"),N=a.n(C),O=a("0lTi"),I=a.n(O),S=a("lHQ6"),B=a.n(S),k=a("ZbhI"),q=a.n(k),M=a("UF4K"),L=a.n(M),D=a("xlHU"),U=a.n(D),V=a("5tqG"),z=a.n(V),R=a("cDcd"),T=a.n(R),F=a("sYIF"),P=a("bdgK"),K=a("vDqi"),A=a.n(K);function H(e,t){var a=void 0!==r.a&&i()(e)||e["@@iterator"];if(!a){if(u()(e)||(a=function(e,t){var a;if(e){if("string"==typeof e)return G(e,t);var n=c()(a=Object.prototype.toString.call(e)).call(a,8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?I()(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?G(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){a&&(e=a);var n=0,l=function(){};return{s:l,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},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(){a=a.call(e)},n:function(){var e=a.next();return s=e.done,e},e:function(e){d=!0,o=e},f:function(){try{s||null==a.return||a.return()}finally{if(d)throw o}}}}function G(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=new Array(t);a<t;a++)n[a]=e[a];return n}a("pb8e"),a("ex8r"),a("p77/"),a("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,a){window.sessionStorage.removeItem(e+t);var n="#e_tip_"+a;"content"==e?J("#e_tips_"+a).html(" "):J(n).html(" ")}function W(e,t,a){var n=window.sessionStorage.getItem("content"+t);if(null!==n&&n!==e.getValue()){J("#e_tips_"+a).data("editor",e);var c='您上次有已保存的数据,是否<a style="cursor: pointer;" class="link-color-blue" onclick="md_rec_data(\'content\',\''+t+"','"+a+'\')">恢复</a> ? / <a style="cursor: pointer;" class="link-color-blue" onclick="md_clear_data(\'content\',\''+t+"','"+a+"')\">不恢复</a>";J("#e_tips_"+a).html(c)}return g()((function(){var n,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,""!==v()(n=e.getValue()).call(n)){!function(e,t,a){window.sessionStorage.setItem("content"+t,a)}(0,t,e.getValue());var i="#e_tips_"+a,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,a){null!==window.sessionStorage.getItem(e+t)&&(J("#e_tips_"+a).data("editor").setValue(window.sessionStorage.getItem(e+t)),$(e,t,a))},t.a=function(e){var t,a,n=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,p=void 0===g||g,v=e.placeholder,h=void 0===v?"":v,b=e.width,E=void 0===b?"100%":b,y=e.height,j=void 0===y?400:y,C=e.initValue,O=void 0===C?"":C,S=(e.emoji,e.watch),k=void 0===S||S,M=(e.showNullButton,e.showResizeBar),D=void 0!==M&&M,V=e.startInit,K=void 0===V||V,G=(e.forMember,e.isCanAtme),J=void 0!==G&&G,$=e.isQuoteIssue,Z=void 0!==$&&$,Q=e.changeAtWhoLoginList,ee=e.owner,te=e.projectsId,ae=e.isFocus,ne=void 0===ae||ae,ce=e.showLatexButton,le=void 0===ce||ce,re=Object(R.useRef)(),oe=Object(R.useRef)(),ie=Object(R.useState)(),se=m()(ie,2),ue=se[0],de=se[1],me=Object(R.useState)(!1),fe=m()(me,2),ge=fe[0],pe=fe[1],ve=Object(R.useState)([]),he=m()(ve,2),be=he[0],Ee=he[1],we=Object(R.useState)([]),ye=m()(we,2),_e=ye[0],je=ye[1],xe=Object(R.useState)([]),Ce=m()(xe,2),Ne=Ce[0],Oe=Ce[1],Ie=Object(R.useRef)([]),Se=Object(R.useRef)(!1),Be="mdEditor_".concat(n),ke="mdEditors_".concat(n),qe="e_tips_mdEditor_".concat(n),Me=Object(R.useState)([]),Le=m()(Me,2),De=Le[0],Ue=Le[1],Ve=Object(R.useState)(!1),ze=m()(Ve,2),Re=ze[0],Te=ze[1],Fe=Object(R.useState)([]),Pe=m()(Fe,2),Ke=Pe[0],Ae=Pe[1],He=Object(R.useRef)(!1),Ge=Object(R.useRef)([]);function Je(e){var t;A.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&&Ue(t.data.issues);var a=t.data.issues;Ae(a&&a.length>0?a:void 0)}}))}Object(R.useEffect)((function(){var e;J&&A.a.get(w()(e="/".concat(ee,"/")).call(e,te,"/members.json")).then((function(e){0!==e.data.total_count&&(Oe(e.data.users),je(e.data.users))})),document.addEventListener("click",(function(){Se.current=!1,pe(!1),He.current=!1,Te(!1)})),Z&&Je()}),[]);var Ye=T.a.createElement("div",{id:"quoteDiv",className:"quoteDiv"},Ke&&_()(Ke).call(Ke,(function(e,t){return T.a.createElement("li",{className:"quote ".concat(0===t&&"active"),onClick:function(){return function(e){var t,a,n,c;He.current=!1,Te(!1);var l=ue.cm,r=l.doc.getCursor(),o=r.line,i=r.ch,s=x()(t=l.getRange({line:o,ch:0},{line:o,ch:i})).call(t,"#");l.replaceRange(w()(a=w()(n=w()(c="[#".concat(e.subject,"](/")).call(c,ee,"/")).call(n,te,"/issues/")).call(a,e.project_issues_index,") "),{line:o,ch:s},{line:o,ch:i}),l.focus();var u=new N.a(Ge.current);u.add(e.project_issues_index),Ge.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}},T.a.createElement("span",{style:{minWidth:"40px"}},T.a.createElement("span",{className:"issueIndex",title:e.project_issues_index},"#",e.project_issues_index)),T.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,a=ue.cm.getValue();if(e.shiftKey&&"Digit2"===e.code&&(Se.current=!0,pe(!0),document.getElementById("at_who_list").style.top=B()(t.getPropertyValue("top").replace("px",""))+62+"px",document.getElementById("at_who_list").style.left=B()(t.getPropertyValue("left").replace("px",""))+20+"px"),e.ctrlKey&&"KeyZ"===e.code&&0!==Ne.length){if(O){var n=[];_()(Ne).call(Ne,(function(e){var t;-1!=q()(O).call(O,e.username)&&"@"===O.charAt(q()(O).call(O,e.username)-1)&&q()(O).call(O,"@".concat(e.username))===q()(a).call(a,"@".concat(e.username))&&(n[n.length]=w()(t="[@".concat(e.username,"](/")).call(t,e.login,")"))})),0!=n.length&&_()(n).call(n,(function(e){a=a.replace(e,"")}))}-1!=q()(a).call(a,"@")&&_()(Ne).call(Ne,(function(e){if(-1!=q()(a).call(a,e.username)&&"@"===a.charAt(q()(a).call(a,e.username)-1)){var t=new N.a(Ie.current);t.add(e.login),Ie.current=I()(t),Ee(I()(t))}}))}e.shiftKey&&"Digit3"===e.code&&Z&&(He.current=!0,Te(!0),document.getElementById("quoteDiv").style.top=B()(t.getPropertyValue("top").replace("px",""))+62+"px",document.getElementById("quoteDiv").style.left=B()(t.getPropertyValue("left").replace("px",""))+20+"px")}Object(R.useEffect)((function(){if(We)if(He.current){var e=document.getElementById("quoteDiv"),t=document.getElementsByClassName("quote");We.addKeyMap({Up:function(){for(var a,n=0;n<t.length;n++)"quote active"===t[n].className&&(a=n);a>0&&(a<=t.length-4&&(e.scrollTop-=40),t[a].className="quote",t[a-1].className="quote active")},Down:function(){for(var a,n=0;n<t.length;n++)"quote active"===t[n].className&&(a=n);a<t.length-1&&(a>=3&&(e.scrollTop+=40),t[a].className="quote",t[a+1].className="quote active")},Enter:function(){document.getElementsByClassName("quote active")[0]&&document.getElementsByClassName("quote active")[0].click()}})}else We.removeKeyMap()}),[Re]),Object(R.useEffect)((function(){Q&&Q(be)}),[be]);var $e=T.a.createElement("div",{className:"at_who_list",id:"at_who_list"},_e&&_()(_e).call(_e,(function(e,t){return T.a.createElement("div",{key:t,className:"at_who ".concat(0===t&&"active"),onClick:function(){!function(e){var t;Se.current=!1,pe(!1);var a=ue.cm,n=a.doc.getCursor(),c=n.line,l=n.ch,r=x()(t=a.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)})),a.replaceRange("[@"+e+"]"+"(/".concat(o,") "),{line:c,ch:r},{line:c,ch:l}),a.focus();var i=new N.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&&T.a.createElement("img",{src:Object(F.i)("/".concat(e.image_url)),alt:""}),T.a.createElement("span",null,e.username))})));Object(R.useEffect)((function(){!ue&&K&&window.editormd(Be,{width:E,height:j,path:Object(F.m)("/editormd/lib/"),markdown:O,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(F.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,a,n){e.replaceSelection("<br/>")},"null-button":function(e,t,a,n){""===n&&e.setCursor(a.line,a.ch+1),e.replaceSelection("▁")},fullScreen:function(e,t,a,n){t.addClass("none")},"inline-latex":function(e,t,a,n){e.replaceSelection("$"+n+"$"),e.setCursor(a.line,a.ch+2),e.focus()},latex:function(e,t,a,n){e.replaceSelection("$$\n\n"+n+"$$"),e.setCursor(a.line+1,0),e.focus()}},lang:{toolbar:{latex:"多行公式","line-break":"换行",fullScreen:"开启全屏"}},onload:function(){de(this)}})}),[Be,ue,K]);var We=ue&&ue.cm;return Object(R.useEffect)((function(){Se.current?We.addKeyMap({Up:function(){for(var e,t=document.getElementById("at_who_list"),a=document.getElementsByClassName("at_who"),n=0;n<a.length;n++)"at_who active"===a[n].className&&(e=n);e>0&&(e<=a.length-4&&(t.scrollTop-=40),a[e].className="at_who",a[e-1].className="at_who active")},Down:function(){for(var e,t=document.getElementById("at_who_list"),a=document.getElementsByClassName("at_who"),n=0;n<a.length;n++)"at_who active"===a[n].className&&(e=n);e<a.length-1&&(e>=3&&(t.scrollTop+=40),a[e].className="at_who",a[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(),a=t.line,n=t.ch;e.replaceRange("\n",{line:a,ch:n},{line:a,ch:n}),pe(!1),Se.current=!1}}}):We&&We.removeKeyMap()}),[ge]),Object(R.useEffect)((function(){if(Se.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=B()(e.getPropertyValue("left").replace("px",""))+t+"px"}}),[_e]),Object(R.useEffect)((function(){if(We){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=W(ue,"MDEditor__".concat(Be),Be)),(J||Z)&&ue.cm.on("focus",(function(){document.addEventListener("keydown",Xe)})),(J||Z)&&ue.cm.on("blur",(function(){document.removeEventListener("keydown",Xe)})),ue.cm.on("change",(function(e){var t=e.getValue();if(t){var a=t.match(/alert\((.*?)\)/g);if(a&&a.length>0)for(var n=0;n<a.length;n++)t=t.replace(a[n],"")}if(c&&c(t),He.current){var l=e.doc.getCursor(),r=l.line,o=l.ch,i=We.getRange({line:r,ch:0},{line:r,ch:o});-1===q()(i).call(i,"#")||" "===(i=i.substring(x()(i).call(i,"#")+1))?(Te(!1),He.current=!1):Je(i)}if(Se.current){var s,u=e.doc.getCursor(),d=u.line,m=u.ch,f=We.getRange({line:d,ch:0},{line:d,ch:m});-1===q()(f).call(f,"@")?(pe(!1),Se.current=!1):(f=f.substring(x()(f).call(f,"@")+1))?A.a.get(w()(s="/".concat(ee,"/")).call(s,te,"/members.json"),{params:{search:f}}).then((function(e){e&&e.data&&0!==e.data.total_count?je(e.data.users):je(void 0)})):je(Ne)}if(function(e,t,a){if(0!=a.length){var n,c=ue.cm,l=c.getValue();if(O){var r=[];_()(t).call(t,(function(t){var a,n,c,o,i,s,u,d,m=t.username;m=t.project_issues_index,-1!=q()(O).call(O,m)&&O.charAt(q()(O).call(O,m)-1)===e&&q()(O).call(O,w()(a="".concat(e)).call(a,m))===q()(l).call(l,w()(n="".concat(e)).call(n,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 L.a;_()(n=I()(a)).call(n,(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)&&(Ge.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()(U()(o).call(o))).call(d,(function(t){var a,n,r,i,d=w()(a=w()(n=w()(r=w()(i="[".concat(e)).call(i,t,"](/")).call(r,ee,"/")).call(n,te,"/issues/")).call(a,o.get(t),")");if(z()(f).call(f,d)&&c.setSelection({line:s,ch:x()(f).call(f,e)-1},{line:s,ch:u}),-1===q()(l).call(l,d)){var m=new N.a(Ge.current);m.delete(o.get(t)),Ge.current=I()(m)}})):_()(m=I()(U()(o).call(o))).call(m,(function(t){var a,n,c,r,i=w()(a=w()(n=w()(c=w()(r="[".concat(e)).call(r,t,"](/")).call(c,ee,"/")).call(n,te,"/issues/")).call(a,o.get(t),")");if(-1===q()(l).call(l,i)){var s=new N.a(Ge.current);s.delete(o.get(t)),Ge.current=I()(s)}}))}}("#",De,Ge.current),0!=Ie.current.length){var g,p=ue.cm,v=p.getValue();if(O){var h=[];_()(Ne).call(Ne,(function(e){var t;-1!=q()(O).call(O,e.username)&&"@"===O.charAt(q()(O).call(O,e.username)-1)&&q()(O).call(O,"@".concat(e.username))===q()(v).call(v,"@".concat(e.username))&&(h[h.length]=w()(t="[@".concat(e.username,"](/")).call(t,e.login,")"))})),0!=h.length&&_()(h).call(h,(function(e){v=v.replace(e,"")}))}var b=new L.a;_()(g=I()(Ie.current)).call(g,(function(e){_()(Ne).call(Ne,(function(t){t.login===e&&b.set(t.username,t.login)}))}));var E=p.doc.getCursor(),y=E.line,j=E.ch;-1===q()(v).call(v,"@")&&(Ie.current=[],Ee([]));var C,S,B=p.getRange({line:y,ch:0},{line:y,ch:j}),k=p.getLine(y);k&&-1!==q()(k).call(k,"@")?_()(C=I()(U()(b).call(b))).call(C,(function(e){var t,a=w()(t="[@".concat(e,"](/")).call(t,b.get(e),")");if(z()(B).call(B,a)&&p.setSelection({line:y,ch:x()(B).call(B,"@")-1},{line:y,ch:j}),-1===q()(v).call(v,a)){var n=new N.a(Ie.current);n.delete(b.get(e)),Ie.current=I()(n),Ee(I()(n))}})):_()(S=I()(U()(b).call(b))).call(S,(function(e){var t,a=w()(t="[@".concat(e,"](/")).call(t,b.get(e),")");if(-1===q()(v).call(v,a)){var n=new N.a(Ie.current);n.delete(b.get(e)),Ie.current=I()(n),Ee(I()(n))}}))}})),e=function(){var e;return re.current&&(e=new P.default((function(e){var t,a=H(e);try{for(a.s();!(t=a.n()).done;){var n=t.value;(n.target.offsetHeight>0||n.target.offsetWidth>0)&&(ue.resize(),ue.cm.refresh(),ne&&ue.cm.focus())}}catch(e){a.e(e)}finally{a.f()}}))).observe(re.current),e}(),function(){f||clearInterval(t),e&&e.unobserve(re.current)}}}),[We]),Object(R.useEffect)((function(){ue&&null!=O&&O!==ue.getValue()&&ue.setValue(O.toString())}),[ue,O,Be]),Object(R.useEffect)((function(){if(oe.current){var e=function(e){c=!0,l=e.pageY},t=function(){c=!1},a=function(e){if(c){var t=e.pageY-l;t<0&&(t=0),t>300&&(t=300);var a=j+t+"px";ue.resize("",a)}},n=oe.current,c=!1,l=0;return n.addEventListener("mousedown",e),document.addEventListener("mousemove",a),document.addEventListener("mouseup",t),function(){n.removeEventListener("mousedown",e),document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",t)}}}),[ue,oe]),T.a.createElement(R.Fragment,null,T.a.createElement("div",{ref:re,className:w()(t=w()(a="df editormd-editing ".concat(u," ")).call(a,p&&"editormd-image-click-expand"," ")).call(t,Re||ge?"quoteBox":""," ")},T.a.createElement("div",{className:"edu-back-greyf5 radius4 editormd ".concat(i?"error":""),id:Be},Re&&Ye,ge&&$e,T.a.createElement("textarea",{style:{display:"none"},id:ke,name:"content"}),T.a.createElement("div",{className:"CodeMirror cm-s-defualt",style:{display:"none"}}))),D?T.a.createElement("a",{ref:oe,className:"editor-resize"}):null,T.a.createElement("div",{className:"fr rememberTip"},!0===f?null:T.a.createElement("div",{id:qe,className:"edu-txt-right color-grey-cd font-12"})))}},tlJt:function(e,t,a){"use strict";a("DZo9");var n=a("8z0m"),c=(a("Pwec"),a("CtXQ")),l=(a("miYZ"),a("tsqr")),r=a("zLi2"),o=a.n(r),i=a("cDcd"),s=a.n(i),u=a("sYIF"),d=a("Po8q"),m=a.n(d);t.a=function(e){var t=e.getImage,a=e.url,r=e.getImageId,d=e.maxSize,f=void 0===d?2:d,g=e.action,p=void 0===g?Object(u.l)():g,v=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),j=_[0],x=_[1];return Object(i.useEffect)((function(){w(a)}),[a]),s.a.createElement(n.a,{name:"file",listType:"picture-card",className:"avatar-uploader",showUploadList:!1,action:p,beforeUpload:function(e){var t="image/jpeg"===e.type||"image/png"===e.type;t||l.a.error("上传的图片只能是JPG或者PNG格式!");var a=e.size/1024/1024<f;return a||l.a.error("上传的图片不能超过".concat(f,"MB!")),t&&a&&x(!0),t&&a},onChange:function(e){var a,n,c;e&&e.file&&"done"===e.file.status&&(x(!1),r&&r(e.file.response.id),v&&v(e.file.response.url),a=e.file.originFileObj,n=function(e){return w(e)},(c=new FileReader).addEventListener("load",(function(){return n(c.result)})),c.readAsDataURL(a),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:j?"loading":"plus"}),s.a.createElement("div",{className:"ant-upload-text"},"点击上传")))}}}]);