You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__Messages__Private__index...

1 line
30 KiB

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[52829],{13261:function(e,t,n){var a=n(82242),r=n.n(a),i=(n(59301),n(93314)),s=n(3113),l=n(37712);t.Z=function(e){var t=e.img,n=e.buttonProps,a=void 0===n?{}:n,o=e.styles,c=void 0===o?{}:o,d=e.customText,u=e.ButtonText,p=e.ButtonClick,f=e.Buttonclass,h=e.ButtonTwo,g=e.imgStyles,m=e.loading,v=void 0!==m&&m;return(0,l.jsxs)("section",{className:"tc animated fadeIn",style:r()(r()({},{color:"#999",margin:"100px auto",visibility:v?"hidden":"visible"}),c),children:[(0,l.jsx)("img",{src:t||i,style:r()(r()({},g),{},{pointerEvents:"none",userSelect:"none"})}),(0,l.jsx)("p",{className:"mt20 font14",children:d||"暂时还没有相关数据哦!"}),u&&(0,l.jsx)(s.ZP,r()(r()({className:f,onClick:p},a),{},{children:u})),h&&h]})}},13282:function(e,t,n){n.d(t,{Z:function(){return j}});var a=n(82242),r=n.n(a),i=n(7557),s=n.n(i),l=n(41498),o=n.n(l),c=n(79800),d=n.n(c),u=n(59301),p={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},f=n(3113),h=n(38827),g=n(99095),m=n(6848),v=n(27627),x=n(91810),_=n(13261),b=n(15309),y=n(87814),w=n(37712),j=function(e){var t,n,a,i,l,c,j=e.editOffice,Z=void 0===j?"view":j,S=e.data,k=(e.theme,e.type),E=e.filename,I=e.monacoEditor,N=e.className,O=e.style,P=e.close,A=e.onClose,C=e.hasMask,T=e.disabledDownload,R=e.onImgDimensions,M=e.showNodata,$=e.recordInfo,z=(0,u.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),L=d()(z,2),B=(L[0],L[1],(0,u.useState)("")),V=d()(B,2),W=(V[0],V[1]),F=(0,u.useState)(),H=d()(F,2),D=H[0],J=H[1],G="build"===window.ENV?"/react/build":"",U=location.host.startsWith("localhost")?b.Z.PROXY_SERVER:b.Z.API_SERVER,X=(0,u.useRef)();null!==(t=S)&&void 0!==t&&t.startsWith("/api")&&"txt"!==k&&(S=b.Z.API_SERVER+S);E&&I&&(I.filename=E),(0,u.useEffect)((function(){var e,t=null===(e=document.cookie)||void 0===e||null===(e=e.replace(/\s/g,""))||void 0===e?void 0:e.split(";");null==t||t.map((function(e){var t=e.split("=");"_educoder_session"===t[0]&&W(t[1])}))}),[]),(0,u.useEffect)((function(){var e;"office"===k&&(S.indexOf("bigfilescdn.")>-1||S.indexOf("bigfiles1")>-1?J({url:S,fileType:(e=S,e.substring(e.lastIndexOf("/")+1).split(".").pop()),model:S.indexOf("model=edit")?"edit":"view"}):q())}),[k,S]);var q=function(){var e=o()(s()().mark((function e(){var t,n,a;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("data:",S),t=S,S.startsWith("http")||(t=location.origin+t),n=new URL(t).pathname.split("/").pop(),e.next=6,(0,x.gJ)({attachment_id:n});case 6:(a=e.sent).url=U+a.url,J(a);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Y=function(){S.startsWith("http")||S.startsWith("blob:")?K():(0,v.Sv)(E||"educoder",S,E)},K=function(){$&&(0,y.fc)({id:null==$?void 0:$.id,watch_type:1,course_id:null==$?void 0:$.course_id}),(0,v.Nd)(E||"educoder",decodeURIComponent(S))};return(0,w.jsxs)("div",{style:r()({},O||{}),className:"".concat(C&&p.bgBlack," ").concat(k?p.wrp:"hide"),children:[P&&(0,w.jsxs)("div",{className:p.close,ref:X,children:[!!R&&(0,w.jsx)(m.Z,{title:"点击对图片进行批注",getPopupContainer:function(){return X.current},children:(0,w.jsx)("span",{onClick:function(){A(),R()},children:(0,w.jsx)("i",{className:"icon-yulanpizhu"})})}),!T&&(0,w.jsx)(m.Z,{title:"点击下载此文件",getPopupContainer:function(){return X.current},children:(0,w.jsx)("span",{onClick:K,children:(0,w.jsx)("i",{className:"icon-quxiaozhiding"})})}),(0,w.jsx)(m.Z,{title:"关闭",getPopupContainer:function(){return X.current},children:(0,w.jsx)("span",{className:"",onClick:A,children:(0,w.jsx)("i",{className:"icon-guanbi1"})})})]}),(0,w.jsx)("div",{className:"".concat(p[N]," ").concat(N," ").concat(p.monaco," ").concat("txt"===k?"show":"hide"),children:"txt"===k&&(0,w.jsx)(w.Fragment,{children:(0,w.jsx)(g.ZP,r()({},I))})}),"audio"===k&&(0,w.jsx)("audio",{src:"".concat((null===(n=S)||void 0===n?void 0:n.indexOf("http://"))>-1||(null===(a=S)||void 0===a?void 0:a.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(S),autoPlay:!0}),"video"===k&&(0,w.jsx)(w.Fragment,{children:(null===(i=S)||void 0===i?void 0:i.indexOf("http"))>-1?(0,w.jsx)("video",{controls:!0,src:"".concat(S),autoPlay:!0}):(0,w.jsx)("video",{controls:!0,src:"data:video/mp4;base64,".concat(S),autoPlay:!0})}),"office"===k&&D&&(0,w.jsx)("iframe",{src:"".concat(G,"/office.html?key=").concat(D.key,"&url=").concat(btoa(D.url),"&callbackUrl=").concat(U+D.callbackUrl,"&fileType=").concat(D.fileType,"&title=").concat(D.title,"&model=").concat(Z,"&officeServer=").concat(b.Z.ONLYOFFICE,"&disabledDownload=").concat(!!T)}),"html"===k&&(0,w.jsx)("iframe",{src:S+"&disposition=inline"}),"pdf"===k&&(0,w.jsx)("iframe",{src:"".concat(G,"/js/pdfview/index.html?filename=").concat(E||"educoder.pdf","&url=").concat(encodeURIComponent(S),"&disabledDownload=").concat(!!T)}),"image"===k&&(0,w.jsx)("img",{src:"".concat((null===(l=S)||void 0===l?void 0:l.indexOf("http://"))>-1||(null===(c=S)||void 0===c?void 0:c.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(S)}),("other"===k||"download"===k)&&(0,w.jsx)(w.Fragment,{children:M?(0,w.jsx)(_.Z,{customText:"当前文件不支持预览,可点击下载查看",ButtonTwo:(0,w.jsx)(f.ZP,{icon:(0,w.jsx)("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:Y,disabled:T,children:"下载"})}):(0,w.jsxs)(f.ZP,{type:"primary",size:"middle",onClick:Y,disabled:T,children:[(0,w.jsx)(h.Z,{}),"点击下载"]})})]})}},82011:function(e,t,n){n.d(t,{z:function(){return w}});var a=n(82242),r=n.n(a),i=n(37205),s=n.n(i),l=n(91232),o=n.n(l),c=n(79800),d=n.n(c),u=n(59301),p=(n(86622),n(60137)),f=(n(64018),n(6419)),h=n(15309),g=n(27627),m=n(15342),v=n(1012),x=n(13282),_=n(37712),b="@▁@",y=/<pre[^>]*>/g;var w=function(e,t){e=e||"";var n=/(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?\)|(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g;return t?e.replaceAll("https://www.educoder.net","").replaceAll("https://www-cdn.educoder.net","").replaceAll("//api/attachments","/api/attachments").replace(n,(function(e,t,n,a,r,i,s){var l=t||a||i,o=n||r||s||"?";return h.Z.API_SERVER+"/api/attachments/"+l+o+"&t="+(0,g.Jn)(l,Date.now())+(e.indexOf(")")>-1?")":"&")})).replaceAll('src="(','src="').replaceAll("src='(",'src="'):e=e.replace(/(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,(function(e,t,n,a,r,i,s){var l=t||a||i,o=n||r||s||"?";return h.Z.API_SERVER+"/attachments/download/"+l+o+"&t="+(0,g.Jn)(l,Date.now())+(e.indexOf(")")>-1?")":"&")})).replace(n,(function(e,t,n,a,r,i,s){var l=t||a||i,o=n||r||s||"?";return h.Z.API_SERVER+"/api/attachments/"+l+o+"&t="+(0,g.Jn)(l,Date.now())+(e.indexOf(")")>-1?")":"&")})).replace(/\"(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,(function(e,t,n,a,r){var i=t||a,s=n||r||"";return'"'+h.Z.API_SERVER+"/api/attachments/"+i+s+i+s+"&t="+(0,g.Jn)(i,Date.now())})).replace(/\(\s+(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,(function(e,t,n,a,r){var i=t||a,s=n||r||"";return"("+h.Z.API_SERVER+"/files/uploads/"+i+s+i+s+"&t="+(0,g.Jn)(i,Date.now())})).replaceAll('src="(','src="').replaceAll("src='(",'src="').replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,"\n")};t.Z=function(e){var t=e.value,n=void 0===t?"":t,a=e.className,i=e.showTextOnly,l=e.showLines,c=e.style,g=void 0===c?{}:c,w=e.stylesPrev,j=void 0===w?{}:w,Z=e.highlightKeywords,S=e.showProgramFill,k=(e.isProgramFill,e.disabledFill),E=void 0!==k&&k,I=e.programFillValue,N=e.onFillChange,O=void 0===N?function(e){}:N,P=e.onFillBlur,A=void 0===P?function(){}:P,C=e.onFillFocus,T=void 0===C?function(){}:C,R=String(n),M=(0,u.useState)(""),$=d()(M,2),z=$[0],L=$[1],B=(0,u.useState)("office"),V=d()(B,2),W=V[0],F=V[1],H=(0,u.useState)([]),D=d()(H,2),J=D[0],G=D[1],U=(0,u.useRef)("a"+(0,v.Z)()),X={};var q=function(e){return e.replace(/<style.*?>([\s\S]+?)<\/style>/gim,(function(e,t){var n=t.replace(/(\n|\r)/g,"").split("}"),a=[];return n.map((function(e){""!=e&&a.push(".".concat(U.current," ").concat(e))})),"<style>".concat(a.join("}"),"</style>")}))},Y=(0,u.useMemo)((function(){try{R=R.replace(/\(\/attachments\/download\//g,"("+h.Z.API_SERVER+"/attachments/download/").replace(/\(\s+\/api\/attachments\/|\(\/api\/attachments\//g,"("+h.Z.API_SERVER+"/api/attachments/").replace(/\"\/api\/attachments\/|\"\/attachments\/download\//g,'"'+h.Z.API_SERVER+"/api/attachments/").replace(/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,'"'+h.Z.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,"\n")}catch(e){}if(S){var e=-1;return R=R.replaceAll("<","&lt;").replaceAll(">","&gt;").replace(/(@▁▁@|@▁@)/g,(function(t,n,a){var r;return function(e,t,n){var a=document.createElement(e===b?"input":"textarea");a.style.width="100%",a.style.height=e===b?"40px":"151px",a.rows=5,a.spellcheck=!1,a.name="edu-program-fill",a.placeholder="请输入",a.dataset.id=t;var r=Object.keys(X).length;return X[r]=a,'<span class="edu-program-fill-wrap '.concat(e===b?"":"show",'" style="width:').concat(e===b?"400px":"100%",'" title=').concat(n||"","><span>").concat(a.outerHTML,'<span class="edu-program-fill-score" style="margin:0 6px"></span></span></span>')}(t,++e,null==I||null===(r=I[e])||void 0===r?void 0:r.value.replaceAll("<","&lt;").replaceAll(">","&gt;"))})),'<pre style="background:#fff;padding:4px">'.concat(q(R||""),"</pre>")}var t=q(R);t=(0,p.ZP)(t);var n=(0,p.ez)();R.match(/\[TOC\]/)&&(t=t.replace("<p>[TOC]</p>",(0,p.Qv)()),(0,p.Iy)()),t=t.replace(/(__special_katext_id_\d+__)/g,(function(e,t){var a=n[t],r=a.type,i=a.expression;return(0,m.renderToString)(function(e){var t=document.createElement("div");return t.innerHTML=e,0===t.childNodes.length?"":t.childNodes[0].nodeValue}(i)||"",{displayMode:"block"===r,throwOnError:!1,output:"html"})})),t=t.replace(/▁/g,"▁▁▁▁▁"),(0,p.AL)();var a=document.createElement("div");return a.innerHTML=t,i?a.innerText:Z?(te(a,Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),a.innerHTML):(setTimeout((function(){return re()}),500),a.innerHTML)}),[R,Z]);(0,u.useEffect)((function(){ne.current&&ne.current.querySelectorAll(["input","textarea"]).forEach((function(e){e.oninput=K,e.onblur=Q,e.onfocus=ee}))}),[J]),(0,u.useEffect)((function(){if(null!=I&&I.length)try{var e,t=ne.current.querySelectorAll(".edu-program-fill-score"),n=ne.current.querySelectorAll('[name="edu-program-fill"]'),a=o()(n.entries());try{for(a.s();!(e=a.n()).done;){var r,i,s,l=d()(e.value,2),c=l[0],u=l[1];u.value=(null==I||null===(r=I[c])||void 0===r?void 0:r.value)||"","warning"===(null==I||null===(i=I[c])||void 0===i?void 0:i.type)?u.className="program-fill-warning":"success"===(null==I||null===(s=I[c])||void 0===s?void 0:s.type)?u.className="program-fill-success":u.className=""}}catch(e){a.e(e)}finally{a.f()}var p,f=o()(t.entries());try{for(f.s();!(p=f.n()).done;){var h,g,m=d()(p.value,2),v=m[0];m[1].innerHTML=null!=I&&null!==(h=I[v])&&void 0!==h&&h.score?"".concat(null==I||null===(g=I[v])||void 0===g?void 0:g.score,"分"):""}}catch(e){f.e(e)}finally{f.f()}G(I)}catch(e){console.log(e,"error")}}),[I]);var K=function(e){J[e.target.dataset.id]=J[e.target.dataset.id]||{},J[e.target.dataset.id].value=e.target.value,G(s()(J)),O(J,e.target.dataset.id)},Q=function(e){J[e.target.dataset.id]=J[e.target.dataset.id]||{},J[e.target.dataset.id].value=e.target.value,G(s()(J)),A(J,e.target.dataset.id)},ee=function(e){J[e.target.dataset.id]=J[e.target.dataset.id]||{},J[e.target.dataset.id].value=e.target.value,G(s()(J)),T(J,e.target.dataset.id)};function te(e,t){return e.childNodes.forEach((function(e){if(e.childNodes.length>0)te(e,t);else if("IMG"!==e.nodeName)if(e.innerHTML){var n;e.innerHTML=null===(n=e.innerHTML)||void 0===n?void 0:n.replace(new RegExp(t,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>')}else{var a=document.createElement("span");a.innerHTML=e.textContent.replace(new RegExp(t,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>'),e.replaceWith(a)}}))}var ne=(0,u.useRef)();function ae(e){var t=e.target;if("A"===t.tagName.toUpperCase()){var n=t.getAttribute("href");if(n.indexOf("office")>-1)e.preventDefault(),L(n),F("office");else if(n.indexOf("application/pdf")>-1)e.preventDefault(),L(n),F("pdf");else if(n.indexOf("text/html")>-1)e.preventDefault(),L(n),F("html");else if(n.startsWith("#")){e.preventDefault();var a=document.getElementById(n.replace("#",""));a&&a.scrollIntoView(!0)}}}p.jb.WebkitLineClamp=l,l&&(g=r()(r()({},g),p.jb));var re=function(){var e,t=null===(e=ne.current)||void 0===e?void 0:e.querySelectorAll("video");null==t||t.forEach((function(e){if(e.oncontextmenu=function(){return!1},e.src.indexOf(".m3u8")>-1)if(e.canPlayType("application/vnd.apple.mpegurl"));else if(f.ZP.isSupported()){var t=new f.ZP;t.loadSource(e.src),t.attachMedia(e)}}))};return(0,u.useEffect)((function(){if(ne.current&&Y&&Y.match(y)&&window.PR.prettyPrint(),ne.current)return ne.current.addEventListener("click",ae),function(){var e;null===(e=ne.current)||void 0===e||e.removeEventListener("click",ae),(0,p.AL)(),(0,p.Iy)()}}),[Y,ne.current,ae]),(0,u.useEffect)((function(){var e,t=function(e){e.preventDefault(),e.clipboardData.setData("text",window.getSelection().toString())};return null===(e=ne.current)||void 0===e||e.addEventListener("copy",t),function(){var e;null===(e=ne.current)||void 0===e||e.removeEventListener("copy",t)}}),[ne.current]),(0,_.jsxs)(_.Fragment,{children:[i&&(0,_.jsx)("div",{ref:ne,children:Y}),!i&&(0,_.jsx)("div",{ref:ne,style:r()({},g),className:"".concat(a||""," ").concat(E?"disabled-fill":""," markdown-body ").concat(U.current),dangerouslySetInnerHTML:{__html:Y}}),(0,_.jsx)(x.Z,{close:!0,data:z,type:null!=z&&z.length?W:"",style:r()({},j),onClose:function(){return L("")}})]})}},17026:function(e,t,n){n.r(t),n.d(t,{default:function(){return L}});var a=n(82242),r=n.n(a),i=n(79800),s=n.n(i),l=n(39647),o=n.n(l),c=n(59301),d=n(51876),u=n(61186),p=n.n(u),f=n(20834),h=n(44e3),g=n(95237),m=n(43604),v=n(28103),x=n(96865),_=n(27092),b=n(15309),y=n(13261),w=n(85573),j=n.n(w),Z=n(7557),S=n.n(Z),k=n(41498),E=n.n(k),I=n(78241),N=n(43418),O=n(8591),P=n(92832),A=n(94436),C={flex_box_center:"flex_box_center___N_gPw",flex_space_between:"flex_space_between___f_LaO",flex_box_vertical_center:"flex_box_vertical_center___silBX",flex_box_center_end:"flex_box_center_end___Nt5TD",flex_box_column:"flex_box_column___xc67X",tabs:"tabs___JYWDM",active:"active___siUX9",list:"list___IZLen",tags:"tags___V_Bdb",searchWrp:"searchWrp___MhTxO",newlight:"newlight___pybQh"},T=n(37712),R=(0,d.connect)((function(e){var t=e.messages,n=e.loading;return{messages:t,user:e.user,loading:n.effects}}))((function(e){var t,n=e.messages,a=e.loading,i=e.user,l=e.dispatch,o=(0,d.useParams)(),u=((0,d.useLocation)(),n.actionTabs,I.Z.useForm()),p=s()(u,1)[0],f=(n.recentContacts,(0,c.useState)("")),h=s()(f,2),v=h[0],_=h[1],y=(0,c.useState)([]),w=s()(y,2),Z=w[0],k=w[1],R=(0,c.useState)(!1),M=s()(R,2),$=M[0],z=M[1],L=(0,c.useState)(),B=s()(L,2),V=B[0],W=B[1];(0,c.useEffect)((function(){"写私信"===n.actionTabs.key&&F()}),[n.actionTabs.key]);var F=function(){var e=E()(S()().mark((function e(){var t,n;return S()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,l({type:"messages/getRecentContacts",payload:{id:null==i||null===(t=i.userInfo)||void 0===t?void 0:t.user_id,keyword:v}});case 2:n=e.sent,k(r()({},n));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),H=function(){var e=E()(S()().mark((function e(){var t;return S()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(""===v){e.next=5;break}return e.next=3,l({type:"messages/getUsersForPrivateMessages",payload:{keyword:v}});case 3:t=e.sent,k(r()({},t));case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,c.useEffect)((function(){H()}),[v]),(0,T.jsx)(N.Z,{centered:!0,title:"写私信",open:"写私信"===n.actionTabs.key,okText:"确定",cancelText:"取消",bodyStyle:{height:320},onOk:E()(S()().mark((function e(){var t,n,a,r,s;return S()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p.validateFields();case 2:return n=p.getFieldValue(),"/api/course_modules/".concat(o.categoryId,"/add_second_category.json"),e.next=6,(0,A.w0)({content:n.content,target_id:V,userId:null==i||null===(t=i.userInfo)||void 0===t?void 0:t.user_id});case 6:0===(a=e.sent).status&&(O.ZP.success("添加成功"),l({type:"messages/setActionTabs",payload:{}}),d.history.push("/messages/".concat(null==i||null===(r=i.userInfo)||void 0===r?void 0:r.login,"/message_detail?target_ids=").concat(null==a||null===(s=a.private_message)||void 0===s?void 0:s.receiver_id)));case 8:case"end":return e.stop()}}),e)}))),onCancel:function(){l({type:"messages/setActionTabs",payload:{}})},children:(0,T.jsxs)(I.Z,{form:p,initialValues:j()({},"name",""),children:[(0,T.jsx)(I.Z.Item,{name:"users",rules:[{required:!0,message:"请选择发送对象"}],children:(0,T.jsx)(P.Z.Search,{onFocus:function(){return z(!0)},onSearch:function(e){_(e)},placeholder:"发送给..."})}),$&&(0,T.jsx)(x.Z,{loading:a["messages/getUsersForPrivateMessages"],children:(0,T.jsxs)("aside",{className:C.searchWrp,style:{maxHeight:260,overflow:"auto"},children:[(0,T.jsx)("p",{className:"c-light-black mt10",children:""===v?"最近联系人":"搜索结果"}),null==Z||null===(t=Z.users)||void 0===t?void 0:t.map((function(e,t){return(0,T.jsxs)(g.Z,{align:"middle",className:"mt15 current",onClick:function(){W(e.id),p.setFieldsValue({users:e.name}),z(!1)},children:[(0,T.jsx)(m.Z,{flex:"58px",children:(0,T.jsx)("img",{style:{width:48,borderRadius:48},src:b.Z.IMG_SERVER+"/images/"+(null==e?void 0:e.image_url),alt:""})}),(0,T.jsx)(m.Z,{children:e.name})]},t)}))]})}),(0,T.jsx)(I.Z.Item,{rules:[{required:!0,message:"请输入发送内容"}],className:$&&"hide",name:"content",children:(0,T.jsx)(P.Z.TextArea,{rows:10,maxLength:200})})]})})})),M=n(82011),$=n(70291),z=["messages","globalSetting","loading","user","dispatch"],L=(f.Z.SubMenu,h.Z.Sider,h.Z.Content,(0,d.connect)((function(e){var t=e.messages,n=e.loading,a=e.user;return{messages:t,globalSetting:e.globalSetting,user:a,loading:n.effects}}))((function(e){var t,n,a=e.messages,i=(e.globalSetting,e.loading),l=e.user,u=e.dispatch,f=o()(e,z),h=(0,d.useParams)(),w=l.userInfo,j=(a.tidingsList,a.privateMessage),Z=(0,c.useState)({per_page:10,page:1}),S=s()(Z,2),k=S[0],E=S[1];(0,c.useEffect)((function(){k.page=1,I()}),[h.userId]);var I=function(){u({type:"messages/getPrivateMessages",payload:r()(r()({},k),h)})},N=function(e){var t;f.history.push("/users/".concat(null==e||null===(t=e.target)||void 0===t?void 0:t.login))},O=(0,c.useMemo)((function(){return(null==w?void 0:w.is_teacher)&&(null==w?void 0:w.professional_certification)}),[w]);return(0,T.jsxs)("section",{className:C.bg,children:[(0,T.jsx)("section",{className:"edu-container mt20",children:(0,T.jsxs)(g.Z,{gutter:[20,20],children:[(0,T.jsx)($.Z,{}),(0,T.jsxs)(m.Z,{flex:"1",children:[(0,T.jsxs)("aside",{className:"bg-white",children:[(0,T.jsx)("aside",{className:"pt30 pl30 pr30 font16",children:(0,T.jsxs)(g.Z,{children:[(0,T.jsx)(m.Z,{flex:"1",children:"全部私信"}),O&&(0,T.jsx)(m.Z,{children:(0,T.jsx)("span",{className:"c-blue current",onClick:function(){var e;u({type:"messages/setActionTabs",payload:{key:"写私信",bodyParams:r()(r()({},k),{},{user_id:null==l||null===(e=l.userInfo)||void 0===e?void 0:e.user_id})}})},children:"写私信"})})]})}),(0,T.jsx)(v.Z,{}),(0,T.jsx)("aside",{className:C.list,children:(0,T.jsxs)(x.Z,{active:!0,avatar:{size:40},paragraph:{rows:5},loading:i["messages/getPrivateMessages"],children:[!(null!=j&&null!==(t=j.private_messages)&&void 0!==t&&t.length)&&(0,T.jsx)(y.Z,{}),null==j||null===(n=j.private_messages)||void 0===n?void 0:n.map((function(e,t){var n,a;return(0,T.jsx)("aside",{children:(0,T.jsxs)(g.Z,{children:[(0,T.jsx)(m.Z,{flex:"58px",onClick:function(){return N(e)},children:(0,T.jsx)("img",{src:b.Z.IMG_SERVER+"/images/"+(null==e||null===(n=e.target)||void 0===n?void 0:n.image_url),alt:""})}),(0,T.jsx)(m.Z,{flex:1,children:(0,T.jsxs)(g.Z,{children:[(0,T.jsx)(m.Z,{span:24,children:(0,T.jsxs)(g.Z,{children:[(0,T.jsxs)(m.Z,{flex:"1",children:[(0,T.jsx)("span",{onClick:function(){return N(e)},children:null==e||null===(a=e.target)||void 0===a?void 0:a.name}),(0,T.jsx)("span",{className:"ml15",children:"与你的私信"}),(0,T.jsxs)("span",{className:"c-light-black mr15",children:["[",null==e?void 0:e.message_count,"条]"]}),(0,T.jsx)("span",{className:"ml15 c-light-black",children:p()(e.send_time).fromNow()})]}),(0,T.jsx)(m.Z,{children:(null==e?void 0:e.unread)&&(0,T.jsx)("span",{className:C.newlight})})]})}),(0,T.jsx)(m.Z,{span:24,onClick:function(){return function(e){var t,n;f.history.push("/messages/".concat(null==l||null===(t=l.userInfo)||void 0===t?void 0:t.login,"/message_detail?target_ids=").concat(null==e||null===(n=e.target)||void 0===n?void 0:n.id))}(e)},children:(0,T.jsx)("div",{className:"mt15",children:(0,T.jsx)(M.Z,{value:e.content||""})})})]})})]})})}))]})})]}),(0,T.jsx)("aside",{className:"tc mt20",children:!i["messages/getTidings"]&&(0,T.jsx)(_.Z,{hideOnSinglePage:!0,showSizeChanger:!1,onChange:function(e){k.page=e,E(r()({},k)),I()},current:k.page||1,total:null==j?void 0:j.count})})]})]})}),(0,T.jsx)(R,{})]})})))},70291:function(e,t,n){n.d(t,{Z:function(){return y}});var a=n(82242),r=n.n(a),i=n(79800),s=n.n(i),l=n(39647),o=n.n(l),c=n(59301),d=n(51876),u=n(20834),p=n(44e3),f=n(43604),h=n(15309),g="userInfo____uyMZ",m="navInfo___acXs6",v="actived___WhZza",x="newTip___Jdd6B",_=n(37712),b=["messages","globalSetting","loading","user","dispatch"],y=(u.Z.SubMenu,p.Z.Sider,p.Z.Content,(0,d.connect)((function(e){var t=e.messages,n=e.loading,a=e.user;return{messages:t,globalSetting:e.globalSetting,user:a,loading:n.effects}}))((function(e){var t=e.messages,n=(e.globalSetting,e.loading,e.user),a=e.dispatch,i=(o()(e,b),(0,d.useParams)()),l=n.userInfo,u=(0,d.useLocation)(),p=(t.tidingsList,t.privateMessage,t.unreadInfo),y=(0,c.useState)({per_page:10,page:1}),w=s()(y,2),j=w[0];w[1];(0,c.useEffect)((function(){Z()}),[i.userId]);var Z=function(){a({type:"messages/unreadMessageInfo",payload:r()(r()({},j),i)})};return(0,_.jsxs)(f.Z,{flex:"264px",children:[(0,_.jsxs)("aside",{className:g,children:[(0,_.jsx)("img",{className:"mt40",src:h.Z.IMG_SERVER+"/images/"+(null==l?void 0:l.image_url)}),(0,_.jsx)("p",{className:"font24 mt10",children:null==l?void 0:l.username}),(0,_.jsx)("p",{className:"mt20",children:null==l?void 0:l.user_identity})]}),(0,_.jsxs)("ul",{className:m,children:[(0,_.jsx)(d.Link,{to:"/messages/".concat(null==l?void 0:l.login,"/user_tidings"),children:(0,_.jsxs)("li",{className:u.pathname.indexOf("user_tidings")>-1&&v,children:["消息",!(null==p||!p.unread_tiding_count)&&(0,_.jsx)("span",{className:x,children:null==p?void 0:p.unread_tiding_count})]})}),(0,_.jsx)(d.Link,{to:"/messages/".concat(null==l?void 0:l.login,"/private_messages"),children:(0,_.jsxs)("li",{className:(u.pathname.indexOf("private_messages")>-1||u.pathname.indexOf("message_detail")>-1)&&v,children:["私信",!(null==p||!p.unread_message_count)&&(0,_.jsx)("span",{className:x,children:null==p?void 0:p.unread_message_count})]})})]})]})})))},60137:function(e,t,n){n.d(t,{AL:function(){return w},Iy:function(){return p},Qv:function(){return g},ez:function(){return y},jb:function(){return f}});var a=n(79800),r=n.n(a),i=n(32834),s=n.n(i),l=n(11690);var o=[],c=["<ul>"],d=new(s().Renderer),u=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function p(){o.length=0,c=["<ul>"]}var f={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function h(e,t,n,a){if(t>=e.length||e[t].level<=n)return t;var r=e[t];a.push("<li><a href='#"+r.anchor+"'>"+r.text+"</a>");var i=[];return t=h(e,++t,r.level,i),i.length>0&&(a.push("<ul>"),i.forEach((function(e){a.push(e)})),a.push("</ul>")),a.push("</li>"),t=h(e,t,n,a)}function g(){return h(o,0,0,c),c.push("</ul>"),c.join("")}var m={heading:function(e){var t=u.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[1].length,text:t[2]}},fences:function(e){var t=this.rules.block.fences.exec(e);if(t){var n=t[0],a=function(e,t){var n=e.match(/^(\s+)(?:```)/);if(null===n)return t;var a=n[1];return t.split("\n").map((function(e){var t=e.match(/^\s+/);return null===t?e:r()(t,1)[0].length>=a.length?e.slice(a.length):e})).join("\n")}(n,t[3]||""),i=t[2]?t[2].trim():t[2];if(["latex","katex","math"].indexOf(i)>=0){var s=_(),l=a;a=s,b[s]={type:"block",expression:l}}return{type:"code",raw:n,lang:i,text:a}}}},v=/(?:\${2})([^\n`]+?)(?:\${2})/gi,x=0,_=function(){return"__special_katext_id_".concat(x++,"__")},b={};function y(){return b}function w(){x=0,b={}}function j(e){return e=e.replace(v,(function(e,t){var n=_();return b[n]={type:"inline",expression:t},n}))}var Z=d.listitem;d.listitem=function(e){return Z(j(e))};var S=d.paragraph;d.paragraph=function(e){return S(j(e))};var k=d.tablecell;d.tablecell=function(e,t){return k(j(e),t)},d.code=function(e,t,n){var a=(t||"").match(/\S*/)[0];return a?["latex","katex","math"].indexOf(a)>=0?"<p class='editormd-tex'>".concat(e,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(t,'">').concat(n?e:(0,l.escape)(e,!0),"</code></pre>\n"):'<pre class="prettyprint linenums"><code>'+(n?e:(0,l.escape)(e,!0))+"</code></pre>"},d.heading=function(e,t,n){var a=this.options.headerPrefix+n.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return o.push({anchor:a,level:t,text:e}),"<h"+t+' id="'+a+'">'+e+"</h"+t+">"},s().setOptions({silent:!0,gfm:!0,pedantic:!1}),s().use({tokenizer:m,renderer:d}),t.ZP=s()},28103:function(e,t,n){n.d(t,{Z:function(){return f}});var a=n(92310),r=n.n(a),i=n(59301),s=n(36355),l=n(17313),o=n(83116),c=n(37613);const d=e=>{const{componentCls:t,sizePaddingEdgeHorizontal:n,colorSplit:a,lineWidth:r,textPaddingInline:i,orientationMargin:s,verticalMarginInline:o}=e;return{[t]:Object.assign(Object.assign({},(0,l.Wf)(e)),{borderBlockStart:`${r}px solid ${a}`,"&-vertical":{position:"relative",top:"-0.06em",display:"inline-block",height:"0.9em",marginInline:o,marginBlock:0,verticalAlign:"middle",borderTop:0,borderInlineStart:`${r}px solid ${a}`},"&-horizontal":{display:"flex",clear:"both",width:"100%",minWidth:"100%",margin:`${e.dividerHorizontalGutterMargin}px 0`},[`&-horizontal${t}-with-text`]:{display:"flex",alignItems:"center",margin:`${e.dividerHorizontalWithTextGutterMargin}px 0`,color:e.colorTextHeading,fontWeight:500,fontSize:e.fontSizeLG,whiteSpace:"nowrap",textAlign:"center",borderBlockStart:`0 ${a}`,"&::before, &::after":{position:"relative",width:"50%",borderBlockStart:`${r}px solid transparent`,borderBlockStartColor:"inherit",borderBlockEnd:0,transform:"translateY(50%)",content:"''"}},[`&-horizontal${t}-with-text-left`]:{"&::before":{width:100*s+"%"},"&::after":{width:100-100*s+"%"}},[`&-horizontal${t}-with-text-right`]:{"&::before":{width:100-100*s+"%"},"&::after":{width:100*s+"%"}},[`${t}-inner-text`]:{display:"inline-block",paddingBlock:0,paddingInline:i},"&-dashed":{background:"none",borderColor:a,borderStyle:"dashed",borderWidth:`${r}px 0 0`},[`&-horizontal${t}-with-text${t}-dashed`]:{"&::before, &::after":{borderStyle:"dashed none none"}},[`&-vertical${t}-dashed`]:{borderInlineStartWidth:r,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},[`&-plain${t}-with-text`]:{color:e.colorText,fontWeight:"normal",fontSize:e.fontSize},[`&-horizontal${t}-with-text-left${t}-no-default-orientation-margin-left`]:{"&::before":{width:0},"&::after":{width:"100%"},[`${t}-inner-text`]:{paddingInlineStart:n}},[`&-horizontal${t}-with-text-right${t}-no-default-orientation-margin-right`]:{"&::before":{width:"100%"},"&::after":{width:0},[`${t}-inner-text`]:{paddingInlineEnd:n}}})}};var u=(0,o.Z)("Divider",(e=>{const t=(0,c.TS)(e,{dividerHorizontalWithTextGutterMargin:e.margin,dividerHorizontalGutterMargin:e.marginLG,sizePaddingEdgeHorizontal:0});return[d(t)]}),(e=>({textPaddingInline:"1em",orientationMargin:.05,verticalMarginInline:e.marginXS}))),p=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(n[a[r]]=e[a[r]])}return n};var f=e=>{const{getPrefixCls:t,direction:n,divider:a}=i.useContext(s.E_),{prefixCls:l,type:o="horizontal",orientation:c="center",orientationMargin:d,className:f,rootClassName:h,children:g,dashed:m,plain:v,style:x}=e,_=p(e,["prefixCls","type","orientation","orientationMargin","className","rootClassName","children","dashed","plain","style"]),b=t("divider",l),[y,w]=u(b),j=c.length>0?`-${c}`:c,Z=!!g,S="left"===c&&null!=d,k="right"===c&&null!=d,E=r()(b,null==a?void 0:a.className,w,`${b}-${o}`,{[`${b}-with-text`]:Z,[`${b}-with-text${j}`]:Z,[`${b}-dashed`]:!!m,[`${b}-plain`]:!!v,[`${b}-rtl`]:"rtl"===n,[`${b}-no-default-orientation-margin-left`]:S,[`${b}-no-default-orientation-margin-right`]:k},f,h),I=i.useMemo((()=>"number"==typeof d?d:/^\d+$/.test(d)?Number(d):d),[d]),N=Object.assign(Object.assign({},S&&{marginLeft:I}),k&&{marginRight:I});return y(i.createElement("div",Object.assign({className:E,style:Object.assign(Object.assign({},null==a?void 0:a.style),x)},_,{role:"separator"}),g&&"vertical"!==o&&i.createElement("span",{className:`${b}-inner-text`,style:N},g)))}},44e3:function(e,t,n){var a=n(84966),r=n(23088);const i=a.ZP;i.Header=a.h4,i.Footer=a.$_,i.Content=a.VY,i.Sider=r.Z,t.Z=i}}]);