diff --git a/p__CoreCurriculum__Lists__Knowledge__index.async.js b/p__CoreCurriculum__Lists__Knowledge__index.async.js index e037896633..628f8d2359 100644 --- a/p__CoreCurriculum__Lists__Knowledge__index.async.js +++ b/p__CoreCurriculum__Lists__Knowledge__index.async.js @@ -1 +1 @@ -"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[95934],{30038:function(e,n,t){var o=t(82242),i=t.n(o),l=(t(59301),t(93314)),c=t(3113),a=t(37712);n.Z=function(e){var n=e.img,t=e.buttonProps,o=void 0===t?{}:t,r=e.styles,s=void 0===r?{}:r,d=e.customText,u=e.ButtonText,m=e.ButtonClick,h=e.Buttonclass,p=e.ButtonTwo,f=e.imgStyles,v=e.loading,x=void 0!==v&&v;return(0,a.jsxs)("section",{className:"tc animated fadeIn",style:i()(i()({},{color:"#999",margin:"100px auto",visibility:x?"hidden":"visible"}),s),children:[(0,a.jsx)("img",{src:n||l,style:i()({},f)}),(0,a.jsx)("p",{className:"mt20 font14",children:d||"暂时还没有相关数据哦!"}),u&&(0,a.jsx)(c.ZP,i()(i()({className:h,onClick:m},o),{},{children:u})),p&&p]})}},22775:function(e,n,t){t.d(n,{Z:function(){return w}});var o=t(82242),i=t.n(o),l=t(7557),c=t.n(l),a=t(41498),r=t.n(a),s=t(79800),d=t.n(s),u=t(59301),m={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},h=t(3113),p=t(98915),f=t(59554),v=t(6848),x=t(88123),g=t(5168),j=t(30038),y=t(80548),_=t(37712),w=function(e){var n,t,o,l,a,s,w,b=e.editOffice,Z=void 0===b?"view":b,C=e.data,k=(e.theme,e.type),P=e.filename,I=e.monacoEditor,N=e.className,A=e.style,E=e.close,S=e.onClose,R=e.hasMask,F=e.disabledDownload,T=e.onImgDimensions,O=e.showNodata,K=(0,u.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),B=d()(K,2),M=(B[0],B[1],(0,u.useState)("")),L=d()(M,2),D=(L[0],L[1]),U=(0,u.useState)(),V=d()(U,2),W=V[0],q=V[1],z="build"===window.ENV?"/react/build":"",Y=location.host.startsWith("localhost")?y.Z.PROXY_SERVER:y.Z.API_SERVER;console.log("disabledDownload---",F);var J=(0,u.useRef)();null!==(n=C)&&void 0!==n&&n.startsWith("/api")&&"txt"!==k&&(C=y.Z.API_SERVER+C),P&&(I.filename=P),(0,u.useEffect)((function(){var e,n=null===(e=document.cookie)||void 0===e||null===(e=e.replace(/\s/g,""))||void 0===e?void 0:e.split(";");null==n||n.map((function(e){var n=e.split("=");"_educoder_session"===n[0]&&D(n[1])}))}),[]),(0,u.useEffect)((function(){"office"===k&&X()}),[k,C]);var X=function(){var e=r()(c()().mark((function e(){var n,t,o;return c()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("data:",C),n=C,C.startsWith("http")||(n=location.origin+n),t=new URL(n).pathname.split("/").pop(),e.next=6,(0,g.gJ)({attachment_id:t});case 6:o=e.sent,q(o);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),H=function(){C.startsWith("http")||C.startsWith("blob:")?G():(0,x.Sv)(P||"educoder",C,P)},G=function(){(0,x.Nd)(P||"educoder",decodeURIComponent(C))};return console.log(C,"data"),(0,_.jsxs)("div",{style:i()({},A||{}),className:"".concat(R&&m.bgBlack," ").concat(k?m.wrp:"hide"),children:[E&&(0,_.jsxs)("div",{className:m.close,ref:J,children:[!!T&&(0,_.jsx)(v.Z,{title:"点击对图片进行批注",getPopupContainer:function(){return J.current},children:(0,_.jsx)("span",{onClick:function(){S(),T()},children:(0,_.jsx)("i",{className:"icon-yulanpizhu"})})}),!F&&(0,_.jsx)(v.Z,{title:"点击下载此文件",getPopupContainer:function(){return J.current},children:(0,_.jsx)("span",{onClick:G,children:(0,_.jsx)("i",{className:"icon-quxiaozhiding"})})}),(0,_.jsx)(v.Z,{title:"关闭",getPopupContainer:function(){return J.current},children:(0,_.jsx)("span",{className:"",onClick:S,children:(0,_.jsx)("i",{className:"icon-guanbi1"})})})]}),(0,_.jsx)("div",{className:"".concat(m[N]," ").concat(N," ").concat(m.monaco," ").concat("txt"===k?"show":"hide"),children:"txt"===k&&(0,_.jsx)(f.ZP,i()({},I))}),"audio"===k&&(0,_.jsx)("audio",{src:(null===(t=C)||void 0===t?void 0:t.indexOf("http"))>-1||null!==(o=C)&&void 0!==o&&o.startsWith("/api")?C:"data:image/png;base64,".concat(C),autoPlay:!0}),"video"===k&&(0,_.jsx)(_.Fragment,{children:(null===(l=C)||void 0===l?void 0:l.indexOf("http"))>-1||null!==(a=C)&&void 0!==a&&a.startsWith("/api")?(0,_.jsx)("video",{controls:!0,src:"".concat(C),autoPlay:!0}):(0,_.jsx)("video",{controls:!0,src:"data:video/mp4;base64,".concat(C),autoPlay:!0})}),"office"===k&&W&&(0,_.jsx)("iframe",{src:"".concat(z,"/office.html?key=").concat(W.key,"&url=").concat(Y+W.url,"&callbackUrl=").concat(Y+W.callbackUrl,"&fileType=").concat(W.fileType,"&title=").concat(W.title,"&model=").concat(Z,"&officeServer=").concat(y.Z.ONLYOFFICE,"&disabledDownload=").concat(!!F)}),"html"===k&&(0,_.jsx)("iframe",{src:C+"&disposition=inline"}),"pdf"===k&&(0,_.jsx)("iframe",{src:"".concat(z,"/js/pdfview/index.html?url=").concat(C,"&disabledDownload=").concat(!!F)}),"image"===k&&(0,_.jsx)("img",{src:(null===(s=C)||void 0===s?void 0:s.indexOf("http"))>-1||null!==(w=C)&&void 0!==w&&w.startsWith("/api")?C:"data:image/png;base64,".concat(C)}),("other"===k||"download"===k)&&(0,_.jsx)(_.Fragment,{children:O?(0,_.jsx)(j.Z,{customText:"当前文件不支持预览,可点击下载查看",ButtonTwo:(0,_.jsx)(h.ZP,{icon:(0,_.jsx)("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:H,children:"下载"})}):(0,_.jsxs)(h.ZP,{type:"primary",size:"middle",onClick:H,children:[(0,_.jsx)(p.Z,{}),"点击下载"]})})]})}},53635:function(e,n,t){var o=t(82242),i=t.n(o),l=t(39647),c=t.n(l),a=t(59527),r=(t(59301),t(37712)),s=["value","scrollId","onChange"];n.Z=function(e){e.value;var n=e.scrollId,t=e.onChange,o=c()(e,s);return(0,r.jsx)("div",{id:n||"",children:(0,r.jsx)(a.Z,i()(i()({},o),{},{onChange:function(e,n){null!=n&&n.length?t(e,n):t(e)}}))})}},59527:function(e,n,t){var o=t(82242),i=t.n(o),l=t(7557),c=t.n(l),a=t(41498),r=t.n(a),s=t(79800),d=t.n(s),u=t(59301),m=t(84686),h=t(78092),p=t(3634),f=(t(5903),t(37712));n.Z=(0,p.connect)((function(e){return{user:e.user}}))((function(e){var n=e.defaultvalue,t=e.onChange,o=e.style,l=e.user,a=e.placeholder,s=2097152,p=(0,u.useRef)(null),v=(0,u.useState)(null),x=d()(v,2),g=x[0],j=x[1],y=(0,u.useState)(""),_=d()(y,2),w=_[0],b=_[1];(0,u.useEffect)((function(){b(n)}),[n]),(0,u.useEffect)((function(){t(w)}),[w]);var Z={placeholder:a||"请输入内容...",MENU_CONF:{}};return Z.MENU_CONF.uploadImage={customUpload:function(e,n){return r()(c()().mark((function t(){var o,i;return c()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(o=new FormData).append("file",e),t.next=4,(0,h.ZP)("/api/attachments.json",{method:"post",body:o},!0);case 4:i=t.sent,n(null==i?void 0:i.url,"","");case 6:case"end":return t.stop()}}),t)})))()}},Z.MENU_CONF.uploadVideo={customUpload:function(e,n){return r()(c()().mark((function t(){var o,i,a,r,d,u,m,f,v,x,g,j,y,_;return c()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=e.size,i=Math.ceil(o/s),t.prev=2,t.next=5,(0,h.ZP)("/api/attachments/multipart_upload_start",{method:"POST",body:{fileName:e.name,chunkCount:i,user_id:null==l||null===(a=l.userInfo)||void 0===a?void 0:a.user_id}});case 5:if(0===(null==(d=t.sent)?void 0:d.status)){t.next=8;break}throw new Error;case 8:u=d.upload_id,p.current=new AbortController,m=[],0,f=c()().mark((function n(){var t,i,l,a;return c()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:t=v*s,i=Math.min(t+s,o),l=e.slice(t,i),(a=new FormData).append("chunk",l),a.append("fileName",e.name),a.append("chunkIndex",(v+1).toString()),a.append("uploadId",u),m.push((function(){return(0,h.ZP)("/api/attachments/multipart_upload",{method:"POST",body:a,signal:p.current.signal},!0).then((function(e){}))}));case 9:case"end":return n.stop()}}),n)})),v=0;case 14:if(!(v0)){t.next=29;break}return t.next=27,Promise.all(y);case 27:t.sent,x+=g;case 29:t.next=22;break;case 31:return t.next=33,(0,h.ZP)("/api/attachments/multipart_upload_end",{method:"POST",body:{fileName:e.name,chunkCount:i,uploadId:u,user_id:null==l||null===(r=l.userInfo)||void 0===r?void 0:r.user_id}});case 33:_=t.sent,n(null==_?void 0:_.object,""),t.next=39;break;case 37:t.prev=37,t.t1=t.catch(2);case 39:case"end":return t.stop()}}),t,null,[[2,37]])})))()}},(0,u.useEffect)((function(){return function(){null!=g&&(g.destroy(),j(null))}}),[g]),(0,f.jsx)(f.Fragment,{children:(0,f.jsxs)("div",{style:{border:"1px solid #ccc",zIndex:100},children:[(0,f.jsx)(m.o,{editor:g,defaultConfig:{},mode:"default",style:{borderBottom:"1px solid #ccc"}}),(0,f.jsx)(m.M,{defaultConfig:Z,value:w,onCreated:j,onChange:function(e){return b(e.getHtml())},mode:"default",style:i()({height:"500px",overflowY:"hidden"},o)})]})})}))},70814:function(e,n,t){t.r(n),t.d(n,{default:function(){return J}});var o=t(39647),i=t.n(o),l=t(82242),c=t.n(l),a=t(7557),r=t.n(a),s=t(41498),d=t.n(s),u=t(79800),m=t.n(u),h=t(59301),p=t(3634),f=t(78241),v=t(8591),x=t(48826),g=t(71418),j=t(95237),y=t(43604),_=t(6848),w=t(74997),b=t(43418),Z=t(1056),C=t(57809),k=t(8254),P="MultiLine___SPvvW",I="KnowledgePicTitle___SEXux",N="KnowledgeBg___zh7Lf",A="KnowledgePic___RgY_d",E="KnowledgePicItem___gDE5F",S="KnowledgePicItemActive___EBNoq",R="KnowledgeCenterLeft___MYhOP",F="KnowledgeCenterRight___FFATX",T="DivStyle___Fbh9g",O="KnowledgeCenterRightTitle___KGPCt",K="KnowledgeCenter___tUnBE",B="KnowledgeListItem___On_RK",M="KnowledgeListItemActive___BqCcM",L=t(53635),D=t(80548),U=t(88123),V=t(78092),W=t(22775),q=t(19654),z=t(37712),Y=["key","name"],J=(0,p.connect)((function(e){return{coreCurriculum:e.coreCurriculum,user:e.user,loading:e.loading.effects}}))((function(e){var n,t,o,l,a,s,u=e.coreCurriculum,J=(e.user,e.dispatch),X=e.loading,H=(0,p.useParams)(),G=(0,h.useState)({}),Q=m()(G,2),$=Q[0],ee=Q[1],ne=f.Z.useForm(),te=m()(ne,1)[0],oe=f.Z.useForm(),ie=m()(oe,1)[0],le=f.Z.useForm(),ce=m()(le,1)[0],ae=u.isShowModalName,re=u.KnowledgeModules,se=u.CoreDetail,de=u.KnowledgePoints,ue=u.KnowledgePointInfo,me=(0,h.useState)(!1),he=m()(me,2),pe=he[0],fe=he[1],ve=(0,h.useRef)(null),xe=(0,h.useState)({content:"",type:""}),ge=m()(xe,2),je=ge[0],ye=ge[1],_e=(0,h.useRef)(),we=(0,h.useState)(!1),be=m()(we,2),Ze=be[0],Ce=be[1],ke={beforeUpload:function(e){var n=e.size/1024/1024;return 0==n?(v.ZP.error("".concat(e.name," 无法上传。").concat(0==n?"文件内容不能为空":"超过图片大小限制(2MB)")),x.Z.LIST_IGNORE):Promise.resolve()},action:"".concat(D.Z.API_SERVER,"/api/attachments.json"),onRemove:(s=d()(r()().mark((function e(n){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,V.ZP)("/api/attachments/".concat(n.response.id,".json"),{method:"delete"});case 2:e.sent;case 3:case"end":return e.stop()}}),e)}))),function(e){return s.apply(this,arguments)})},Pe={maxCount:1,accept:".xlsx, .xls",beforeUpload:function(e){var n=e.size/1024/1024;return 0==n?(v.ZP.error("".concat(e.name," 无法上传。").concat(0==n?"文件内容不能为空":"超过图片大小限制(2MB)")),x.Z.LIST_IGNORE):Promise.reject()}},Ie=function(){var e=d()(r()().mark((function e(n){var t,o;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,V.ZP)("/api/attachments/".concat(n,"/detail.json"),{method:"get"});case 2:if(-1===(null==(t=e.sent)?void 0:t.status)){e.next=10;break}if("txt"!==t.file_type){e.next=9;break}return e.next=7,(0,V.ZP)(t.url,{method:"get",headers:{"Content-Type":"application/xml"}});case 7:o=e.sent,_e.current=o;case 9:ye({type:t.file_type,content:t.url+"&nocredentials=true"});case 10:Ce(!0);case 11:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),Ne=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];J({type:"coreCurriculum/save",payload:{isShowModalName:e}}),0==e.length&&(te.resetFields(),ie.resetFields(),ce.resetFields(),ee({}),fe(!1))},Ae=function(){var e=d()(r()().mark((function e(){var n,t,o;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,J({type:"coreCurriculum/getKnowledgeCharts",payload:{coreId:null==H?void 0:H.coreId}});case 2:null!=(t=e.sent)&&null!==(n=t.data)&&void 0!==n&&null!==(n=n.module_names)&&void 0!==n&&null!==(n=n[0])&&void 0!==n&&n.id?Ee(null==t||null===(o=t.data)||void 0===o||null===(o=o.module_names)||void 0===o||null===(o=o[0])||void 0===o?void 0:o.id):J({type:"coreCurriculum/save",payload:{KnowledgePoints:null,KnowledgePointInfo:null}});case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ee=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null==de?void 0:de.id;J({type:"coreCurriculum/getKnowledgeChartsPoint",payload:{coreId:null==H?void 0:H.coreId,chart_module_id:e}})};return(0,h.useEffect)((function(){!function(){var e=Math.PI/180*45;ve.current=document.querySelector(".".concat(A," .").concat(S));var n,t=document.querySelectorAll(".".concat(A," .").concat(E)),o=document.querySelector(".".concat(A)),i=document.querySelector(".".concat(I)),l=t.length,c=360/l,a=0;if(l>13&&(o.style.height="750px",o.style.width="750px"),n=(l>13?750:o.clientWidth)/2-20,null!=ve&&ve.current){var r,s=null==ve||null===(r=ve.current)||void 0===r?void 0:r.style["--pieceDeg"];a=0==s?e:s-e>0?-Math.abs(s-e):Math.abs(s-e),o.style.transform="rotate(".concat(a,"rad)"),i.style.transform="rotate(".concat(-a,"rad)"),console.log(a,s,e)}for(var d=0;d0?null==re?void 0:re.module_names:[{id:null,position:0,module_name:""}]})}),[ae]),(0,z.jsx)(g.Z,{spinning:!!X["coreCurriculum/getKnowledgeChartsPoint"],children:(0,z.jsxs)(j.Z,{className:"".concat(N),wrap:!1,justify:"center",children:[(0,z.jsxs)(y.Z,{style:{position:"relative"},children:[(0,z.jsxs)("div",{className:A,children:[(0,z.jsx)(_.Z,{title:null==se?void 0:se.name,children:(0,z.jsx)("div",{className:"".concat(I),children:null==se?void 0:se.name})}),null==re||null===(n=re.module_names)||void 0===n?void 0:n.map((function(e,n){return(0,z.jsx)("div",{className:"".concat(E," ").concat((null==de?void 0:de.id)==e.id?S:""),onClick:function(){J({type:"coreCurriculum/save",payload:{KnowledgePoints:e,KnowledgePointInfo:null}})},children:(0,z.jsx)(_.Z,{title:null==e?void 0:e.module_name,children:(0,z.jsxs)("div",{className:P,children:[(0,z.jsxs)("div",{children:["模块",(null==e?void 0:e.position)+1,":"]}),null==e?void 0:e.module_name]})})},e.id)}))]}),(0,z.jsx)("img",{src:"data:image/png;base64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bHctz3DjyeoDCqKatRSRn80ydKlEFC6BAQWpmtnOCV9qtqlGuPFk9UGuQe5K6QP/uxSJLFgC/xNEk2yuuYe+A2tQPsYO1sWA1f4jKJ6yLuXgZFmGTpffIAHs9F/IIt5kzQKHT3HXlRYjnkwhh3oEPwb+EaSmrCTnzm5TV9cLnnlExftXkMa+5QRukeNuYvk/LIhjQrNm53W6Qax4Ms0/guRdm5gHA7pzDexClE3kE5T27Ln7xIw5clNhPGVex7lzO9Pj14xcDOLu+cFTnLLQHOOuSS1uzJGb7C8Hy19OvZjizQAAAABJRU5ErkJggg==",width:104,height:76,style:{opacity:de?1:0,position:"absolute",top:"20px",right:"-10px",transition:".3s"}})]}),(0,z.jsx)(y.Z,{className:"ml20",style:{minWidth:612},children:(0,z.jsxs)(j.Z,{wrap:!1,children:[(0,z.jsx)(y.Z,{children:de&&(0,z.jsx)("div",{className:R,children:(0,z.jsx)(w.Z,{className:K,ghost:!0,activeKey:(null==de?void 0:de.position)+1,children:(0,z.jsx)(w.Z.Panel,{showArrow:!1,header:"模块".concat((null==de?void 0:de.position)+1,":").concat(null==de?void 0:de.module_name),extra:(0,q.Ny)()&&(0,z.jsxs)(j.Z,{gutter:10,align:"middle",style:{minWidth:50},children:[(0,z.jsx)(_.Z,{title:"编辑",children:(0,z.jsx)(y.Z,{className:"current",onClick:function(e){fe(!0),Ne(["编辑模块"]),te.setFieldsValue(c()({},re))},children:(0,z.jsx)("i",{className:"iconfont icon-bianji-moren font14",style:{color:"#fff"}})})}),(0,z.jsx)(_.Z,{title:"删除",children:(0,z.jsx)(y.Z,{className:"current",onClick:function(){var e,n=b.Z.confirm({title:"提示",icon:null,content:"确认删除".concat(null==de?void 0:de.module_name,"知识模块吗?删除知识模块会同时删除知识模块下的知识点内容,请谨慎操作。"),okText:"确定删除",cancelText:"取消",onOk:(e=d()(r()().mark((function e(){var t;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,V.ZP)("/api/core_subjects/".concat(null==H?void 0:H.coreId,"/core_subject_knowledge_charts/").concat(de.id,".json"),{method:"delete"});case 2:0==(null==(t=e.sent)?void 0:t.status)&&(v.ZP.success("删除成功"),Ae(),n.destroy());case 4:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)}),onCancel:function(){return n.destroy()}})},children:(0,z.jsx)("i",{className:"iconfont icon-shanchutimu font14",style:{color:"#fff"}})})})]}),children:null==de||null===(t=de.chart_knowledge_point_info)||void 0===t?void 0:t.map((function(e,n){return(0,z.jsxs)(j.Z,{align:"middle",justify:"space-between",className:"".concat((null==ue?void 0:ue.id)==e.id?M:""," ").concat(B),wrap:!1,children:[(0,z.jsx)(y.Z,{style:{width:200},onClick:function(){J({type:"coreCurriculum/save",payload:{KnowledgePointInfo:e}})},children:null==e?void 0:e.knowledge_point}),(0,q.Ny)()&&(0,z.jsxs)(j.Z,{gutter:10,align:"middle",children:[(0,z.jsx)(_.Z,{title:"编辑",children:(0,z.jsx)(y.Z,{className:"current",onClick:function(n){var t;ie.setFieldsValue(c()(c()({},e),{},{chart_module_id:null==de?void 0:de.id,chart_knowledge_point_id:null==e?void 0:e.id,attachment_ids:(null==e||null===(t=e.attachments)||void 0===t?void 0:t.map((function(e){return{uid:e.id,name:e.title,status:"done",response:{id:e.id}}})))||[]})),ee(e),fe(!0),Ne(["编辑知识点"])},children:(0,z.jsx)("i",{className:"iconfont icon-bianji-moren font14"})})}),(0,z.jsx)(_.Z,{title:"删除",children:(0,z.jsx)(y.Z,{className:"current",onClick:function(){var n,t=b.Z.confirm({title:"提示",icon:null,content:"确认删除".concat(null==de?void 0:de.module_name,"知识点吗?删除知识模块会同时删除知识点下的要点、能力目标、课程教案,请谨慎操作。"),okText:"确定删除",cancelText:"取消",onOk:(n=d()(r()().mark((function n(){var o;return r()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,V.ZP)("/api/core_subjects/".concat(H.coreId,"/core_subject_knowledge_charts/del_chart_knowledge.json"),{method:"delete",body:{chart_knowledge_point_id:null==e?void 0:e.id}});case 2:0==(null==(o=n.sent)?void 0:o.status)&&(v.ZP.success("删除成功"),Ee(),t.destroy());case 4:case"end":return n.stop()}}),n)}))),function(){return n.apply(this,arguments)}),onCancel:function(){return t.destroy()}})},children:(0,z.jsx)("i",{className:"iconfont icon-shanchutimu font14"})})})]})]},n)}))},(null==de?void 0:de.position)+1)})})}),(0,z.jsx)(y.Z,{children:ue&&(0,z.jsxs)("div",{className:F,children:[(null==ue?void 0:ue.content)&&(0,z.jsxs)("div",{className:T,children:[(0,z.jsx)("div",{className:O,children:"主要内容"}),(0,z.jsx)("div",{dangerouslySetInnerHTML:{__html:null==ue?void 0:ue.content}})]}),(null==ue?void 0:ue.target)&&(0,z.jsxs)("div",{className:T,children:[(0,z.jsx)("div",{className:O,children:"教学目标"}),(0,z.jsx)("div",{dangerouslySetInnerHTML:{__html:null==ue?void 0:ue.target}})]}),(null==ue||null===(o=ue.attachments)||void 0===o?void 0:o.length)>0&&(0,z.jsxs)("div",{className:T,children:[(0,z.jsx)("div",{className:O,children:"课程教案"}),null==ue||null===(l=ue.attachments)||void 0===l?void 0:l.map((function(e){return(0,z.jsxs)(j.Z,{gutter:10,wrap:!1,align:"middle",children:[(0,z.jsx)(y.Z,{children:(0,z.jsx)("div",{style:{width:8,height:8,background:"#3061D0",borderRadius:"50%"}})}),(0,z.jsx)(y.Z,{children:(0,z.jsx)("a",{onClick:function(){Ie(null==e?void 0:e.id)},children:null==e?void 0:e.title})})]})}))]})]})})]})}),(0,z.jsx)(b.Z,{title:pe?"编辑模块":"新建模块",open:(null==ae?void 0:ae.includes("新建模块"))||(null==ae?void 0:ae.includes("编辑模块")),destroyOnClose:!0,centered:!0,width:771,forceRender:!0,onCancel:function(){return Ne()},confirmLoading:!!X["coreCurriculum/postKnowledgeCharts"],okText:pe?"确认修改":"确定新增",onOk:function(){te.submit()},children:(0,z.jsx)(f.Z,{form:te,style:{maxHeight:700},size:"large",initialValues:{},onFinish:function(){var e=d()(r()().mark((function e(n){var t,o;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log(n),e.next=3,J({type:"coreCurriculum/postKnowledgeCharts",payload:{module_names:null===(t=n.module_names)||void 0===t?void 0:t.map((function(e,n){return c()(c()({},e),{},{position:n})})),coreId:null==H?void 0:H.coreId}});case 3:0==(null==(o=e.sent)?void 0:o.status)&&(v.ZP.success(pe?"修改成功":"新增成功"),Ne(),Ae());case 5:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:(0,z.jsx)(f.Z.List,{name:"module_names",children:function(e,n){var t=n.add,o=n.remove,l=n.move;return(0,z.jsx)(z.Fragment,{children:e.map((function(e,n){var a=e.key,r=e.name,s=i()(e,Y);return(0,z.jsxs)(j.Z,{gutter:20,children:[(0,z.jsx)(f.Z.Item,c()(c()({},s),{},{name:[r,"id"],hidden:!0})),(0,z.jsx)(f.Z.Item,c()(c()({},s),{},{name:[r,"position"],hidden:!0})),(0,z.jsx)(y.Z,{style:{width:550},children:(0,z.jsx)(f.Z.Item,c()(c()({},s),{},{name:[r,"module_name"],label:"模块名称",rules:[{required:!0,message:"请输入模块名称"}],children:(0,z.jsx)(Z.Z,{})}))}),te.getFieldValue("module_names").length>1&&(0,z.jsx)(y.Z,{style:{paddingTop:"10px"},children:(0,z.jsx)("i",{className:"iconfont icon-shanjian current ",style:{color:"green"},onClick:function(){return o(r)}})}),(0,z.jsx)(y.Z,{style:{paddingTop:"10px"},children:(0,z.jsx)("i",{className:"iconfont icon-tianjiatimu current ",style:{color:"red"},onClick:function(){return t({id:null,module_name:"",position:n+1})}})}),0!=n&&(0,z.jsx)(y.Z,{style:{paddingTop:"10px"},children:(0,z.jsx)("i",{className:"iconfont icon-shangyi2 current",onClick:function(){return l(n,n-1)}})}),te.getFieldValue("module_names").length-1!=n&&(0,z.jsx)(y.Z,{style:{paddingTop:"10px"},children:(0,z.jsx)("i",{className:"iconfont icon-xiayi2 current",onClick:function(){return l(n,n+1)}})})]},a)}))})}})})}),(0,z.jsx)(b.Z,{title:pe?"编辑知识点":"新增知识点",open:(null==ae?void 0:ae.includes("新增知识点"))||(null==ae?void 0:ae.includes("编辑知识点")),destroyOnClose:!0,centered:!0,width:1200,forceRender:!0,onCancel:function(){return Ne()},confirmLoading:!!X["coreCurriculum/postKnowledgeChartsPoint"],okText:pe?"确认修改":"确定新增",onOk:function(){ie.submit()},children:(0,z.jsxs)(f.Z,{form:ie,labelCol:{span:2},colon:!1,style:{maxHeight:700},size:"large",initialValues:{},onFinish:function(){var e=d()(r()().mark((function e(n){var t,o;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log(n),n.attachment_ids=(null===(t=n.attachment_ids)||void 0===t?void 0:t.map((function(e){var n;return null==e||null===(n=e.response)||void 0===n?void 0:n.id})))||[],e.next=4,J({type:pe?"coreCurriculum/putKnowledgeChartsPoint":"coreCurriculum/postKnowledgeChartsPoint",payload:c()(c()({},n),{},{coreId:null==H?void 0:H.coreId})});case 4:0==(null==(o=e.sent)?void 0:o.status)&&(v.ZP.success(pe?"修改成功":"新增成功"),Ne(),Ee());case 6:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:[(0,z.jsx)(f.Z.Item,{name:"chart_knowledge_point_id",hidden:!0}),(0,z.jsx)(f.Z.Item,{name:"chart_module_id",label:"所属模块",rules:[{required:!0,message:"请选择所属模块"}],children:(0,z.jsx)(C.default,{showSearch:!0,placeholder:"请选择所属模块",optionFilterProp:"children",filterOption:function(e,n){var t;return(null!==(t=null==n?void 0:n.children)&&void 0!==t?t:"").includes(e)},children:null==re||null===(a=re.module_names)||void 0===a?void 0:a.map((function(e){return(0,z.jsx)(C.default.Option,{value:e.id,children:e.module_name},e.id)}))})}),(0,z.jsx)(f.Z.Item,{name:"knowledge_point",label:"知识点名称",rules:[{required:!0,message:"请输入知识点名称"}],children:(0,z.jsx)(Z.Z,{placeholder:"请输入知识点名称"})}),(0,z.jsx)(f.Z.Item,{name:"content",label:"要点",children:(0,z.jsx)(L.Z,{defaultvalue:$.content,style:{height:"300px"}})}),(0,z.jsx)(f.Z.Item,{name:"target",label:"能力目标",children:(0,z.jsx)(L.Z,{defaultvalue:$.target,style:{height:"300px"}})}),(0,z.jsx)(f.Z.Item,{name:"attachment_ids",label:"课程教案",valuePropName:"fileList",getValueFromEvent:function(e){return Array.isArray(e)?e:null==e?void 0:e.fileList},children:(0,z.jsx)(x.Z,c()(c()({},ke),{},{children:(0,z.jsx)(k.op,{style:{borderRadius:"2px"},icon:(0,z.jsx)("i",{className:"iconfont icon-shangchuan3"}),children:"上传"})}))})]})}),(0,z.jsx)(b.Z,{title:"批量上传知识图谱",open:null==ae?void 0:ae.includes("批量导入"),destroyOnClose:!0,centered:!0,width:1200,forceRender:!0,onCancel:function(){return Ne()},okText:"确定新增",onOk:function(){ce.submit()},children:(0,z.jsxs)(f.Z,{form:ce,labelCol:{span:2},colon:!1,style:{maxHeight:700},size:"large",initialValues:{},onFinish:function(){var e=d()(r()().mark((function e(n){var t,o,i,l,c,a,s;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(o=new FormData).append("file",null==n||null===(t=n.file)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.originFileObj),e.next=4,(0,V.ZP)("/api/core_subjects/".concat(null==H?void 0:H.coreId,"/core_subject_knowledge_charts/batch_import.json"),{method:"post",body:o},!0);case 4:0==(null==(i=e.sent)?void 0:i.status)&&(s=b.Z.confirm({title:"上传结果",icon:null,content:(0,z.jsxs)("div",{children:["成功上传",null==i||null===(l=i.data)||void 0===l||null===(l=l.result)||void 0===l?void 0:l.success,"条数据。",(null==i||null===(c=i.data)||void 0===c||null===(c=c.result)||void 0===c||null===(c=c.fail)||void 0===c?void 0:c.length)>0&&"有部分失败数据,请点击下方按钮下载失败数据文件。",(0,z.jsx)(j.Z,{align:"middle",justify:"center",children:(null==i||null===(a=i.data)||void 0===a||null===(a=a.result)||void 0===a||null===(a=a.fail)||void 0===a?void 0:a.length)>0&&(0,z.jsx)(k.op,{style:{borderRadius:"2px"},openLoading:!0,onClick:function(){(0,U.FH)("",(0,U.NY)({url:"".concat(D.Z.API_SERVER,"/api/core_subjects/").concat(null==H?void 0:H.coreId,"/core_subject_knowledge_charts/get_fail_data.xlsx"),query:{}}))},children:"下载失败数据"})})]}),okText:"确定",cancelText:"取消",onOk:function(){s.destroy(),Ne()},onCancel:function(){return s.destroy()}}),Ae());case 6:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:[(0,z.jsx)(f.Z.Item,{name:"file",label:"上传文件",rules:[{required:!0,message:"请上传文件"}],valuePropName:"fileList",getValueFromEvent:function(e){return Array.isArray(e)?e:null==e?void 0:e.fileList},children:(0,z.jsx)(x.Z,c()(c()({},Pe),{},{children:(0,z.jsx)(k.op,{style:{borderRadius:"2px"},icon:(0,z.jsx)("i",{className:"iconfont icon-shangchuan3"}),children:"选择文件"})}))}),(0,z.jsxs)("div",{style:{marginLeft:"80px"},children:["注意",(0,z.jsx)("div",{children:"1、仅支持上传.xlsx 或 .xls类型的文件"}),(0,z.jsxs)("div",{children:["2、需按照指定模板上传数据。",(0,z.jsx)("a",{onClick:function(){return(0,U.FH)("",(0,U.NY)({url:"".concat(D.Z.API_SERVER,"/api/core_subjects/download_knowledge_chart_template.json"),query:{}}))},children:"点击下载模板"})]})]})]})}),(0,z.jsx)(b.Z,{title:"文件预览",open:Ze,destroyOnClose:!0,centered:!0,width:1200,footer:null,onCancel:function(){Ce(!1),ye({content:"",type:""})},children:(0,z.jsx)("div",{style:{height:700,overflow:"hidden",position:"relative"},children:(0,z.jsx)(W.Z,{data:null==je?void 0:je.content,type:null==je?void 0:je.type,disabledDownload:!(0,q.bg)(),style:{position:"absolute",zIndex:1,alignItems:"flex-start"},monacoEditor:{value:_e.current,language:"txt",onChange:function(){},options:{readOnly:!0,fontSize:14,minimap:{enabled:!1}}},onClose:function(){return ye({content:"",type:""})}})})})]})})}))}}]); \ No newline at end of file +"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[95934],{30038:function(e,n,t){var o=t(82242),i=t.n(o),l=(t(59301),t(93314)),c=t(3113),a=t(37712);n.Z=function(e){var n=e.img,t=e.buttonProps,o=void 0===t?{}:t,r=e.styles,s=void 0===r?{}:r,d=e.customText,u=e.ButtonText,m=e.ButtonClick,h=e.Buttonclass,p=e.ButtonTwo,f=e.imgStyles,v=e.loading,x=void 0!==v&&v;return(0,a.jsxs)("section",{className:"tc animated fadeIn",style:i()(i()({},{color:"#999",margin:"100px auto",visibility:x?"hidden":"visible"}),s),children:[(0,a.jsx)("img",{src:n||l,style:i()({},f)}),(0,a.jsx)("p",{className:"mt20 font14",children:d||"暂时还没有相关数据哦!"}),u&&(0,a.jsx)(c.ZP,i()(i()({className:h,onClick:m},o),{},{children:u})),p&&p]})}},22775:function(e,n,t){t.d(n,{Z:function(){return w}});var o=t(82242),i=t.n(o),l=t(7557),c=t.n(l),a=t(41498),r=t.n(a),s=t(79800),d=t.n(s),u=t(59301),m={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},h=t(3113),p=t(98915),f=t(59554),v=t(6848),x=t(88123),g=t(5168),j=t(30038),y=t(80548),_=t(37712),w=function(e){var n,t,o,l,a,s,w,b=e.editOffice,Z=void 0===b?"view":b,C=e.data,k=(e.theme,e.type),P=e.filename,I=e.monacoEditor,N=e.className,A=e.style,E=e.close,S=e.onClose,R=e.hasMask,F=e.disabledDownload,T=e.onImgDimensions,O=e.showNodata,K=(0,u.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),B=d()(K,2),M=(B[0],B[1],(0,u.useState)("")),L=d()(M,2),D=(L[0],L[1]),U=(0,u.useState)(),V=d()(U,2),W=V[0],q=V[1],z="build"===window.ENV?"/react/build":"",Y=location.host.startsWith("localhost")?y.Z.PROXY_SERVER:y.Z.API_SERVER;console.log("disabledDownload---",F);var J=(0,u.useRef)();null!==(n=C)&&void 0!==n&&n.startsWith("/api")&&"txt"!==k&&(C=y.Z.API_SERVER+C),P&&(I.filename=P),(0,u.useEffect)((function(){var e,n=null===(e=document.cookie)||void 0===e||null===(e=e.replace(/\s/g,""))||void 0===e?void 0:e.split(";");null==n||n.map((function(e){var n=e.split("=");"_educoder_session"===n[0]&&D(n[1])}))}),[]),(0,u.useEffect)((function(){"office"===k&&X()}),[k,C]);var X=function(){var e=r()(c()().mark((function e(){var n,t,o;return c()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("data:",C),n=C,C.startsWith("http")||(n=location.origin+n),t=new URL(n).pathname.split("/").pop(),e.next=6,(0,g.gJ)({attachment_id:t});case 6:o=e.sent,q(o);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),H=function(){C.startsWith("http")||C.startsWith("blob:")?G():(0,x.Sv)(P||"educoder",C,P)},G=function(){(0,x.Nd)(P||"educoder",decodeURIComponent(C))};return console.log(C,"data"),(0,_.jsxs)("div",{style:i()({},A||{}),className:"".concat(R&&m.bgBlack," ").concat(k?m.wrp:"hide"),children:[E&&(0,_.jsxs)("div",{className:m.close,ref:J,children:[!!T&&(0,_.jsx)(v.Z,{title:"点击对图片进行批注",getPopupContainer:function(){return J.current},children:(0,_.jsx)("span",{onClick:function(){S(),T()},children:(0,_.jsx)("i",{className:"icon-yulanpizhu"})})}),!F&&(0,_.jsx)(v.Z,{title:"点击下载此文件",getPopupContainer:function(){return J.current},children:(0,_.jsx)("span",{onClick:G,children:(0,_.jsx)("i",{className:"icon-quxiaozhiding"})})}),(0,_.jsx)(v.Z,{title:"关闭",getPopupContainer:function(){return J.current},children:(0,_.jsx)("span",{className:"",onClick:S,children:(0,_.jsx)("i",{className:"icon-guanbi1"})})})]}),(0,_.jsx)("div",{className:"".concat(m[N]," ").concat(N," ").concat(m.monaco," ").concat("txt"===k?"show":"hide"),children:"txt"===k&&(0,_.jsx)(f.ZP,i()({},I))}),"audio"===k&&(0,_.jsx)("audio",{src:(null===(t=C)||void 0===t?void 0:t.indexOf("http"))>-1||null!==(o=C)&&void 0!==o&&o.startsWith("/api")?C:"data:image/png;base64,".concat(C),autoPlay:!0}),"video"===k&&(0,_.jsx)(_.Fragment,{children:(null===(l=C)||void 0===l?void 0:l.indexOf("http"))>-1||null!==(a=C)&&void 0!==a&&a.startsWith("/api")?(0,_.jsx)("video",{controls:!0,src:"".concat(C),autoPlay:!0}):(0,_.jsx)("video",{controls:!0,src:"data:video/mp4;base64,".concat(C),autoPlay:!0})}),"office"===k&&W&&(0,_.jsx)("iframe",{src:"".concat(z,"/office.html?key=").concat(W.key,"&url=").concat(Y+W.url,"&callbackUrl=").concat(Y+W.callbackUrl,"&fileType=").concat(W.fileType,"&title=").concat(W.title,"&model=").concat(Z,"&officeServer=").concat(y.Z.ONLYOFFICE,"&disabledDownload=").concat(!!F)}),"html"===k&&(0,_.jsx)("iframe",{src:C+"&disposition=inline"}),"pdf"===k&&(0,_.jsx)("iframe",{src:"".concat(z,"/js/pdfview/index.html?url=").concat(C,"&disabledDownload=").concat(!!F)}),"image"===k&&(0,_.jsx)("img",{src:(null===(s=C)||void 0===s?void 0:s.indexOf("http"))>-1||null!==(w=C)&&void 0!==w&&w.startsWith("/api")?C:"data:image/png;base64,".concat(C)}),("other"===k||"download"===k)&&(0,_.jsx)(_.Fragment,{children:O?(0,_.jsx)(j.Z,{customText:"当前文件不支持预览,可点击下载查看",ButtonTwo:(0,_.jsx)(h.ZP,{icon:(0,_.jsx)("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:H,children:"下载"})}):(0,_.jsxs)(h.ZP,{type:"primary",size:"middle",onClick:H,children:[(0,_.jsx)(p.Z,{}),"点击下载"]})})]})}},53635:function(e,n,t){var o=t(82242),i=t.n(o),l=t(39647),c=t.n(l),a=t(59527),r=(t(59301),t(37712)),s=["value","scrollId","onChange"];n.Z=function(e){e.value;var n=e.scrollId,t=e.onChange,o=c()(e,s);return(0,r.jsx)("div",{id:n||"",children:(0,r.jsx)(a.Z,i()(i()({},o),{},{onChange:function(e,n){null!=n&&n.length?t(e,n):t(e)}}))})}},59527:function(e,n,t){var o=t(82242),i=t.n(o),l=t(7557),c=t.n(l),a=t(41498),r=t.n(a),s=t(79800),d=t.n(s),u=t(59301),m=t(84686),h=t(78092),p=t(3634),f=(t(5903),t(37712));n.Z=(0,p.connect)((function(e){return{user:e.user}}))((function(e){var n=e.defaultvalue,t=e.onChange,o=e.style,l=e.user,a=e.placeholder,s=2097152,p=(0,u.useRef)(null),v=(0,u.useState)(null),x=d()(v,2),g=x[0],j=x[1],y=(0,u.useState)(""),_=d()(y,2),w=_[0],b=_[1];(0,u.useEffect)((function(){b(n)}),[n]),(0,u.useEffect)((function(){t(w)}),[w]);var Z={placeholder:a||"请输入内容...",MENU_CONF:{}};return Z.MENU_CONF.uploadImage={customUpload:function(e,n){return r()(c()().mark((function t(){var o,i;return c()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(o=new FormData).append("file",e),t.next=4,(0,h.ZP)("/api/attachments.json",{method:"post",body:o},!0);case 4:i=t.sent,n(null==i?void 0:i.url,"","");case 6:case"end":return t.stop()}}),t)})))()}},Z.MENU_CONF.uploadVideo={customUpload:function(e,n){return r()(c()().mark((function t(){var o,i,a,r,d,u,m,f,v,x,g,j,y,_;return c()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=e.size,i=Math.ceil(o/s),t.prev=2,t.next=5,(0,h.ZP)("/api/attachments/multipart_upload_start",{method:"POST",body:{fileName:e.name,chunkCount:i,user_id:null==l||null===(a=l.userInfo)||void 0===a?void 0:a.user_id}});case 5:if(0===(null==(d=t.sent)?void 0:d.status)){t.next=8;break}throw new Error;case 8:u=d.upload_id,p.current=new AbortController,m=[],0,f=c()().mark((function n(){var t,i,l,a;return c()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:t=v*s,i=Math.min(t+s,o),l=e.slice(t,i),(a=new FormData).append("chunk",l),a.append("fileName",e.name),a.append("chunkIndex",(v+1).toString()),a.append("uploadId",u),m.push((function(){return(0,h.ZP)("/api/attachments/multipart_upload",{method:"POST",body:a,signal:p.current.signal},!0).then((function(e){}))}));case 9:case"end":return n.stop()}}),n)})),v=0;case 14:if(!(v0)){t.next=29;break}return t.next=27,Promise.all(y);case 27:t.sent,x+=g;case 29:t.next=22;break;case 31:return t.next=33,(0,h.ZP)("/api/attachments/multipart_upload_end",{method:"POST",body:{fileName:e.name,chunkCount:i,uploadId:u,user_id:null==l||null===(r=l.userInfo)||void 0===r?void 0:r.user_id}});case 33:_=t.sent,n(null==_?void 0:_.object,""),t.next=39;break;case 37:t.prev=37,t.t1=t.catch(2);case 39:case"end":return t.stop()}}),t,null,[[2,37]])})))()}},(0,u.useEffect)((function(){return function(){null!=g&&(g.destroy(),j(null))}}),[g]),(0,f.jsx)(f.Fragment,{children:(0,f.jsxs)("div",{style:{border:"1px solid #ccc",zIndex:100},children:[(0,f.jsx)(m.o,{editor:g,defaultConfig:{},mode:"default",style:{borderBottom:"1px solid #ccc"}}),(0,f.jsx)(m.M,{defaultConfig:Z,value:w,onCreated:j,onChange:function(e){return b(e.getHtml())},mode:"default",style:i()({height:"500px",overflowY:"hidden"},o)})]})})}))},70814:function(e,n,t){t.r(n),t.d(n,{default:function(){return J}});var o=t(39647),i=t.n(o),l=t(82242),c=t.n(l),a=t(7557),r=t.n(a),s=t(41498),d=t.n(s),u=t(79800),m=t.n(u),h=t(59301),p=t(3634),f=t(78241),v=t(8591),x=t(48826),g=t(71418),j=t(95237),y=t(43604),_=t(6848),w=t(74997),b=t(43418),Z=t(1056),C=t(57809),k=t(8254),P="MultiLine___SPvvW",I="KnowledgePicTitle___SEXux",N="KnowledgeBg___zh7Lf",A="KnowledgePic___RgY_d",E="KnowledgePicItem___gDE5F",S="KnowledgePicItemActive___EBNoq",R="KnowledgeCenterLeft___MYhOP",F="KnowledgeCenterRight___FFATX",T="DivStyle___Fbh9g",O="KnowledgeCenterRightTitle___KGPCt",K="KnowledgeCenter___tUnBE",B="KnowledgeListItem___On_RK",M="KnowledgeListItemActive___BqCcM",L=t(53635),D=t(80548),U=t(88123),V=t(78092),W=t(22775),q=t(19654),z=t(37712),Y=["key","name"],J=(0,p.connect)((function(e){return{coreCurriculum:e.coreCurriculum,user:e.user,loading:e.loading.effects}}))((function(e){var n,t,o,l,a,s,u=e.coreCurriculum,J=(e.user,e.dispatch),X=e.loading,H=(0,p.useParams)(),G=(0,h.useState)({}),Q=m()(G,2),$=Q[0],ee=Q[1],ne=f.Z.useForm(),te=m()(ne,1)[0],oe=f.Z.useForm(),ie=m()(oe,1)[0],le=f.Z.useForm(),ce=m()(le,1)[0],ae=u.isShowModalName,re=u.KnowledgeModules,se=u.CoreDetail,de=u.KnowledgePoints,ue=u.KnowledgePointInfo,me=(0,h.useState)(!1),he=m()(me,2),pe=he[0],fe=he[1],ve=(0,h.useRef)(null),xe=(0,h.useState)({content:"",type:""}),ge=m()(xe,2),je=ge[0],ye=ge[1],_e=(0,h.useRef)(),we=(0,h.useState)(!1),be=m()(we,2),Ze=be[0],Ce=be[1],ke={beforeUpload:function(e){var n=e.size/1024/1024;return 0==n?(v.ZP.error("".concat(e.name," 无法上传。").concat(0==n?"文件内容不能为空":"超过图片大小限制(2MB)")),x.Z.LIST_IGNORE):Promise.resolve()},action:"".concat(D.Z.API_SERVER,"/api/attachments.json"),onRemove:(s=d()(r()().mark((function e(n){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,V.ZP)("/api/attachments/".concat(n.response.id,".json"),{method:"delete"});case 2:e.sent;case 3:case"end":return e.stop()}}),e)}))),function(e){return s.apply(this,arguments)})},Pe={maxCount:1,accept:".xlsx, .xls",beforeUpload:function(e){var n=e.size/1024/1024;return 0==n?(v.ZP.error("".concat(e.name," 无法上传。").concat(0==n?"文件内容不能为空":"超过图片大小限制(2MB)")),x.Z.LIST_IGNORE):Promise.reject()}},Ie=function(){var e=d()(r()().mark((function e(n){var t,o;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,V.ZP)("/api/attachments/".concat(n,"/detail.json"),{method:"get"});case 2:if(-1===(null==(t=e.sent)?void 0:t.status)){e.next=10;break}if("txt"!==t.file_type){e.next=9;break}return e.next=7,(0,V.ZP)(t.url,{method:"get",headers:{"Content-Type":"application/xml"}});case 7:o=e.sent,_e.current=o;case 9:ye({type:t.file_type,content:t.url+"&nocredentials=true"});case 10:Ce(!0);case 11:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),Ne=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];J({type:"coreCurriculum/save",payload:{isShowModalName:e}}),0==e.length&&(te.resetFields(),ie.resetFields(),ce.resetFields(),ee({}),fe(!1))},Ae=function(){var e=d()(r()().mark((function e(){var n,t,o;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,J({type:"coreCurriculum/getKnowledgeCharts",payload:{coreId:null==H?void 0:H.coreId}});case 2:null!=(t=e.sent)&&null!==(n=t.data)&&void 0!==n&&null!==(n=n.module_names)&&void 0!==n&&null!==(n=n[0])&&void 0!==n&&n.id&&Ee(null==t||null===(o=t.data)||void 0===o||null===(o=o.module_names)||void 0===o||null===(o=o[0])||void 0===o?void 0:o.id);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ee=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null==de?void 0:de.id;J({type:"coreCurriculum/getKnowledgeChartsPoint",payload:{coreId:null==H?void 0:H.coreId,chart_module_id:e}})};return(0,h.useEffect)((function(){!function(){var e=Math.PI/180*45;ve.current=document.querySelector(".".concat(A," .").concat(S));var n,t=document.querySelectorAll(".".concat(A," .").concat(E)),o=document.querySelector(".".concat(A)),i=document.querySelector(".".concat(I)),l=t.length,c=360/l,a=0;if(l>13&&(o.style.height="750px",o.style.width="750px"),n=(l>13?750:o.clientWidth)/2-20,null!=ve&&ve.current){var r,s=null==ve||null===(r=ve.current)||void 0===r?void 0:r.style["--pieceDeg"];a=0==s?e:s-e>0?-Math.abs(s-e):Math.abs(s-e),o.style.transform="rotate(".concat(a,"rad)"),i.style.transform="rotate(".concat(-a,"rad)"),console.log(a,s,e)}for(var d=0;d0?null==re?void 0:re.module_names:[{id:null,position:0,module_name:""}]})}),[ae]),(0,z.jsx)(g.Z,{spinning:!!X["coreCurriculum/getKnowledgeChartsPoint"],children:(0,z.jsxs)(j.Z,{className:"".concat(N),wrap:!1,justify:"center",children:[(0,z.jsxs)(y.Z,{style:{position:"relative"},children:[(0,z.jsxs)("div",{className:A,children:[(0,z.jsx)(_.Z,{title:null==se?void 0:se.name,children:(0,z.jsx)("div",{className:"".concat(I),children:null==se?void 0:se.name})}),null==re||null===(n=re.module_names)||void 0===n?void 0:n.map((function(e,n){return(0,z.jsx)("div",{className:"".concat(E," ").concat((null==de?void 0:de.id)==e.id?S:""),onClick:function(){J({type:"coreCurriculum/save",payload:{KnowledgePoints:e,KnowledgePointInfo:null}})},children:(0,z.jsx)(_.Z,{title:null==e?void 0:e.module_name,children:(0,z.jsxs)("div",{className:P,children:[(0,z.jsxs)("div",{children:["模块",(null==e?void 0:e.position)+1,":"]}),null==e?void 0:e.module_name]})})},e.id)}))]}),(0,z.jsx)("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGgAAABMCAYAAACBIfKBAAAAAXNSR0IArs4c6QAABvxJREFUeF7tnXtsFEUcx3+/ubtS5K2IxvioWoTSdmfvWl8YifiXaDSKwUgQub1iNRpU/EODJuY0GsV31BLT2NtDjDEgiUbU4ANqfEBM73Z2C1pseRijxEditAWBu90xC6hYWw6OfUzb6b+3M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m53W6Qax4Ms0/guRdm5gHA7pzDexClE3kE5T27Ln7xIw5clNhPGVex7lzO9Pj14xcDOLu+cFTnLLQHOOuSS1uzJGb7C8Hy19OvZjizQAAAABJRU5ErkJggg==",width:104,height:76,style:{opacity:de?1:0,position:"absolute",top:"20px",right:"-10px",transition:".3s"}})]}),(0,z.jsx)(y.Z,{className:"ml20",style:{minWidth:612},children:(0,z.jsxs)(j.Z,{wrap:!1,children:[(0,z.jsx)(y.Z,{children:de&&(0,z.jsx)("div",{className:R,children:(0,z.jsx)(w.Z,{className:K,ghost:!0,activeKey:(null==de?void 0:de.position)+1,children:(0,z.jsx)(w.Z.Panel,{showArrow:!1,header:"模块".concat((null==de?void 0:de.position)+1,":").concat(null==de?void 0:de.module_name),extra:(0,q.Ny)()&&(0,z.jsxs)(j.Z,{gutter:10,align:"middle",style:{minWidth:50},children:[(0,z.jsx)(_.Z,{title:"编辑",children:(0,z.jsx)(y.Z,{className:"current",onClick:function(e){fe(!0),Ne(["编辑模块"]),te.setFieldsValue(c()({},re))},children:(0,z.jsx)("i",{className:"iconfont icon-bianji-moren font14",style:{color:"#fff"}})})}),(0,z.jsx)(_.Z,{title:"删除",children:(0,z.jsx)(y.Z,{className:"current",onClick:function(){var e,n=b.Z.confirm({title:"提示",icon:null,content:"确认删除".concat(null==de?void 0:de.module_name,"知识模块吗?删除知识模块会同时删除知识模块下的知识点内容,请谨慎操作。"),okText:"确定删除",cancelText:"取消",onOk:(e=d()(r()().mark((function e(){var t;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,V.ZP)("/api/core_subjects/".concat(null==H?void 0:H.coreId,"/core_subject_knowledge_charts/").concat(de.id,".json"),{method:"delete"});case 2:0==(null==(t=e.sent)?void 0:t.status)&&(v.ZP.success("删除成功"),J({type:"coreCurriculum/save",payload:{KnowledgePoints:null,KnowledgePointInfo:null}}),Ae(),n.destroy());case 4:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)}),onCancel:function(){return n.destroy()}})},children:(0,z.jsx)("i",{className:"iconfont icon-shanchutimu font14",style:{color:"#fff"}})})})]}),children:null==de||null===(t=de.chart_knowledge_point_info)||void 0===t?void 0:t.map((function(e,n){return(0,z.jsxs)(j.Z,{align:"middle",justify:"space-between",className:"".concat((null==ue?void 0:ue.id)==e.id?M:""," ").concat(B),wrap:!1,children:[(0,z.jsx)(y.Z,{style:{width:200},onClick:function(){J({type:"coreCurriculum/save",payload:{KnowledgePointInfo:e}})},children:null==e?void 0:e.knowledge_point}),(0,q.Ny)()&&(0,z.jsxs)(j.Z,{gutter:10,align:"middle",children:[(0,z.jsx)(_.Z,{title:"编辑",children:(0,z.jsx)(y.Z,{className:"current",onClick:function(n){var t;ie.setFieldsValue(c()(c()({},e),{},{chart_module_id:null==de?void 0:de.id,chart_knowledge_point_id:null==e?void 0:e.id,attachment_ids:(null==e||null===(t=e.attachments)||void 0===t?void 0:t.map((function(e){return{uid:e.id,name:e.title,status:"done",response:{id:e.id}}})))||[]})),ee(e),fe(!0),Ne(["编辑知识点"])},children:(0,z.jsx)("i",{className:"iconfont icon-bianji-moren font14"})})}),(0,z.jsx)(_.Z,{title:"删除",children:(0,z.jsx)(y.Z,{className:"current",onClick:function(){var n,t=b.Z.confirm({title:"提示",icon:null,content:"确认删除".concat(null==de?void 0:de.module_name,"知识点吗?删除知识模块会同时删除知识点下的要点、能力目标、课程教案,请谨慎操作。"),okText:"确定删除",cancelText:"取消",onOk:(n=d()(r()().mark((function n(){var o;return r()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,V.ZP)("/api/core_subjects/".concat(H.coreId,"/core_subject_knowledge_charts/del_chart_knowledge.json"),{method:"delete",body:{chart_knowledge_point_id:null==e?void 0:e.id}});case 2:0==(null==(o=n.sent)?void 0:o.status)&&(v.ZP.success("删除成功"),Ee(),t.destroy());case 4:case"end":return n.stop()}}),n)}))),function(){return n.apply(this,arguments)}),onCancel:function(){return t.destroy()}})},children:(0,z.jsx)("i",{className:"iconfont icon-shanchutimu font14"})})})]})]},n)}))},(null==de?void 0:de.position)+1)})})}),(0,z.jsx)(y.Z,{children:ue&&(0,z.jsxs)("div",{className:F,children:[(null==ue?void 0:ue.content)&&(0,z.jsxs)("div",{className:T,children:[(0,z.jsx)("div",{className:O,children:"主要内容"}),(0,z.jsx)("div",{dangerouslySetInnerHTML:{__html:null==ue?void 0:ue.content}})]}),(null==ue?void 0:ue.target)&&(0,z.jsxs)("div",{className:T,children:[(0,z.jsx)("div",{className:O,children:"教学目标"}),(0,z.jsx)("div",{dangerouslySetInnerHTML:{__html:null==ue?void 0:ue.target}})]}),(null==ue||null===(o=ue.attachments)||void 0===o?void 0:o.length)>0&&(0,z.jsxs)("div",{className:T,children:[(0,z.jsx)("div",{className:O,children:"课程教案"}),null==ue||null===(l=ue.attachments)||void 0===l?void 0:l.map((function(e){return(0,z.jsxs)(j.Z,{gutter:10,wrap:!1,align:"middle",children:[(0,z.jsx)(y.Z,{children:(0,z.jsx)("div",{style:{width:8,height:8,background:"#3061D0",borderRadius:"50%"}})}),(0,z.jsx)(y.Z,{children:(0,z.jsx)("a",{onClick:function(){Ie(null==e?void 0:e.id)},children:null==e?void 0:e.title})})]})}))]})]})})]})}),(0,z.jsx)(b.Z,{title:pe?"编辑模块":"新建模块",open:(null==ae?void 0:ae.includes("新建模块"))||(null==ae?void 0:ae.includes("编辑模块")),destroyOnClose:!0,centered:!0,width:771,forceRender:!0,onCancel:function(){return Ne()},confirmLoading:!!X["coreCurriculum/postKnowledgeCharts"],okText:pe?"确认修改":"确定新增",onOk:function(){te.submit()},children:(0,z.jsx)(f.Z,{form:te,style:{maxHeight:700},size:"large",initialValues:{},onFinish:function(){var e=d()(r()().mark((function e(n){var t,o;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log(n),e.next=3,J({type:"coreCurriculum/postKnowledgeCharts",payload:{module_names:null===(t=n.module_names)||void 0===t?void 0:t.map((function(e,n){return c()(c()({},e),{},{position:n})})),coreId:null==H?void 0:H.coreId}});case 3:0==(null==(o=e.sent)?void 0:o.status)&&(v.ZP.success(pe?"修改成功":"新增成功"),Ne(),Ae());case 5:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:(0,z.jsx)(f.Z.List,{name:"module_names",children:function(e,n){var t=n.add,o=n.remove,l=n.move;return(0,z.jsx)(z.Fragment,{children:e.map((function(e,n){var a=e.key,r=e.name,s=i()(e,Y);return(0,z.jsxs)(j.Z,{gutter:20,children:[(0,z.jsx)(f.Z.Item,c()(c()({},s),{},{name:[r,"id"],hidden:!0})),(0,z.jsx)(f.Z.Item,c()(c()({},s),{},{name:[r,"position"],hidden:!0})),(0,z.jsx)(y.Z,{style:{width:550},children:(0,z.jsx)(f.Z.Item,c()(c()({},s),{},{name:[r,"module_name"],label:"模块名称",rules:[{required:!0,message:"请输入模块名称"}],children:(0,z.jsx)(Z.Z,{})}))}),te.getFieldValue("module_names").length>1&&(0,z.jsx)(y.Z,{style:{paddingTop:"10px"},children:(0,z.jsx)("i",{className:"iconfont icon-shanjian current ",style:{color:"green"},onClick:function(){return o(r)}})}),(0,z.jsx)(y.Z,{style:{paddingTop:"10px"},children:(0,z.jsx)("i",{className:"iconfont icon-tianjiatimu current ",style:{color:"red"},onClick:function(){return t({id:null,module_name:"",position:n+1})}})}),0!=n&&(0,z.jsx)(y.Z,{style:{paddingTop:"10px"},children:(0,z.jsx)("i",{className:"iconfont icon-shangyi2 current",onClick:function(){return l(n,n-1)}})}),te.getFieldValue("module_names").length-1!=n&&(0,z.jsx)(y.Z,{style:{paddingTop:"10px"},children:(0,z.jsx)("i",{className:"iconfont icon-xiayi2 current",onClick:function(){return l(n,n+1)}})})]},a)}))})}})})}),(0,z.jsx)(b.Z,{title:pe?"编辑知识点":"新增知识点",open:(null==ae?void 0:ae.includes("新增知识点"))||(null==ae?void 0:ae.includes("编辑知识点")),destroyOnClose:!0,centered:!0,width:1200,forceRender:!0,onCancel:function(){return Ne()},confirmLoading:!!X["coreCurriculum/postKnowledgeChartsPoint"],okText:pe?"确认修改":"确定新增",onOk:function(){ie.submit()},children:(0,z.jsxs)(f.Z,{form:ie,labelCol:{span:2},colon:!1,style:{maxHeight:700},size:"large",initialValues:{},onFinish:function(){var e=d()(r()().mark((function e(n){var t,o;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log(n),n.attachment_ids=(null===(t=n.attachment_ids)||void 0===t?void 0:t.map((function(e){var n;return null==e||null===(n=e.response)||void 0===n?void 0:n.id})))||[],e.next=4,J({type:pe?"coreCurriculum/putKnowledgeChartsPoint":"coreCurriculum/postKnowledgeChartsPoint",payload:c()(c()({},n),{},{coreId:null==H?void 0:H.coreId})});case 4:0==(null==(o=e.sent)?void 0:o.status)&&(v.ZP.success(pe?"修改成功":"新增成功"),Ne(),Ee());case 6:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:[(0,z.jsx)(f.Z.Item,{name:"chart_knowledge_point_id",hidden:!0}),(0,z.jsx)(f.Z.Item,{name:"chart_module_id",label:"所属模块",rules:[{required:!0,message:"请选择所属模块"}],children:(0,z.jsx)(C.default,{showSearch:!0,placeholder:"请选择所属模块",optionFilterProp:"children",filterOption:function(e,n){var t;return(null!==(t=null==n?void 0:n.children)&&void 0!==t?t:"").includes(e)},children:null==re||null===(a=re.module_names)||void 0===a?void 0:a.map((function(e){return(0,z.jsx)(C.default.Option,{value:e.id,children:e.module_name},e.id)}))})}),(0,z.jsx)(f.Z.Item,{name:"knowledge_point",label:"知识点名称",rules:[{required:!0,message:"请输入知识点名称"}],children:(0,z.jsx)(Z.Z,{placeholder:"请输入知识点名称"})}),(0,z.jsx)(f.Z.Item,{name:"content",label:"要点",children:(0,z.jsx)(L.Z,{defaultvalue:$.content,style:{height:"300px"}})}),(0,z.jsx)(f.Z.Item,{name:"target",label:"能力目标",children:(0,z.jsx)(L.Z,{defaultvalue:$.target,style:{height:"300px"}})}),(0,z.jsx)(f.Z.Item,{name:"attachment_ids",label:"课程教案",valuePropName:"fileList",getValueFromEvent:function(e){return Array.isArray(e)?e:null==e?void 0:e.fileList},children:(0,z.jsx)(x.Z,c()(c()({},ke),{},{children:(0,z.jsx)(k.op,{style:{borderRadius:"2px"},icon:(0,z.jsx)("i",{className:"iconfont icon-shangchuan3"}),children:"上传"})}))})]})}),(0,z.jsx)(b.Z,{title:"批量上传知识图谱",open:null==ae?void 0:ae.includes("批量导入"),destroyOnClose:!0,centered:!0,width:1200,forceRender:!0,onCancel:function(){return Ne()},okText:"确定新增",onOk:function(){ce.submit()},children:(0,z.jsxs)(f.Z,{form:ce,labelCol:{span:2},colon:!1,style:{maxHeight:700},size:"large",initialValues:{},onFinish:function(){var e=d()(r()().mark((function e(n){var t,o,i,l,c,a,s;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(o=new FormData).append("file",null==n||null===(t=n.file)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.originFileObj),e.next=4,(0,V.ZP)("/api/core_subjects/".concat(null==H?void 0:H.coreId,"/core_subject_knowledge_charts/batch_import.json"),{method:"post",body:o},!0);case 4:0==(null==(i=e.sent)?void 0:i.status)&&(s=b.Z.confirm({title:"上传结果",icon:null,content:(0,z.jsxs)("div",{children:["成功上传",null==i||null===(l=i.data)||void 0===l||null===(l=l.result)||void 0===l?void 0:l.success,"条数据。",(null==i||null===(c=i.data)||void 0===c||null===(c=c.result)||void 0===c||null===(c=c.fail)||void 0===c?void 0:c.length)>0&&"有部分失败数据,请点击下方按钮下载失败数据文件。",(0,z.jsx)(j.Z,{align:"middle",justify:"center",children:(null==i||null===(a=i.data)||void 0===a||null===(a=a.result)||void 0===a||null===(a=a.fail)||void 0===a?void 0:a.length)>0&&(0,z.jsx)(k.op,{style:{borderRadius:"2px"},openLoading:!0,onClick:function(){(0,U.FH)("",(0,U.NY)({url:"".concat(D.Z.API_SERVER,"/api/core_subjects/").concat(null==H?void 0:H.coreId,"/core_subject_knowledge_charts/get_fail_data.xlsx"),query:{}}))},children:"下载失败数据"})})]}),okText:"确定",cancelText:"取消",onOk:function(){s.destroy(),Ne()},onCancel:function(){return s.destroy()}}),Ae());case 6:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:[(0,z.jsx)(f.Z.Item,{name:"file",label:"上传文件",rules:[{required:!0,message:"请上传文件"}],valuePropName:"fileList",getValueFromEvent:function(e){return Array.isArray(e)?e:null==e?void 0:e.fileList},children:(0,z.jsx)(x.Z,c()(c()({},Pe),{},{children:(0,z.jsx)(k.op,{style:{borderRadius:"2px"},icon:(0,z.jsx)("i",{className:"iconfont icon-shangchuan3"}),children:"选择文件"})}))}),(0,z.jsxs)("div",{style:{marginLeft:"80px"},children:["注意",(0,z.jsx)("div",{children:"1、仅支持上传.xlsx 或 .xls类型的文件"}),(0,z.jsxs)("div",{children:["2、需按照指定模板上传数据。",(0,z.jsx)("a",{onClick:function(){return(0,U.FH)("",(0,U.NY)({url:"".concat(D.Z.API_SERVER,"/api/core_subjects/download_knowledge_chart_template.json"),query:{}}))},children:"点击下载模板"})]})]})]})}),(0,z.jsx)(b.Z,{title:"文件预览",open:Ze,destroyOnClose:!0,centered:!0,width:1200,footer:null,onCancel:function(){Ce(!1),ye({content:"",type:""})},children:(0,z.jsx)("div",{style:{height:700,overflow:"hidden",position:"relative"},children:(0,z.jsx)(W.Z,{data:null==je?void 0:je.content,type:null==je?void 0:je.type,disabledDownload:!(0,q.bg)(),style:{position:"absolute",zIndex:1,alignItems:"flex-start"},monacoEditor:{value:_e.current,language:"txt",onChange:function(){},options:{readOnly:!0,fontSize:14,minimap:{enabled:!1}}},onClose:function(){return ye({content:"",type:""})}})})})]})})}))}}]); \ No newline at end of file