|
|
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[38447],{37574:function(e,n,t){t.d(n,{Z:function(){return v}});var i=t(82242),r=t.n(i),o=t(7557),a=t.n(o),l=t(41498),s=t.n(l),c=t(79800),u=t.n(c),d=t(59301),p=t(84686),h=t(79311),f=t(65363),m=(t(68594),{editor_css:"editor_css___cm3Z8"}),x=t(37712),v=(0,f.connect)((function(e){return{user:e.user}}))((function(e){var n=e.defaultvalue,t=e.onChange,i=e.style,o=e.user,l=e.placeholder,c=2097152,f=(0,d.useRef)(null),v=(0,d.useState)(null),g=u()(v,2),_=g[0],j=g[1],w=(0,d.useState)(""),y=u()(w,2),k=y[0],b=y[1];(0,d.useEffect)((function(){b(n)}),[n]),(0,d.useEffect)((function(){t(k)}),[k]);var S={placeholder:l||"请输入内容...",MENU_CONF:{}};S.MENU_CONF.uploadImage={customUpload:function(e,n){return s()(a()().mark((function t(){var i,r;return a()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(i=new FormData).append("file",e),t.next=4,(0,h.ZP)("/api/attachments.json",{method:"post",body:i},!0);case 4:r=t.sent,n(null==r?void 0:r.url,"","");case 6:case"end":return t.stop()}}),t)})))()}},S.MENU_CONF.uploadVideo={customUpload:function(e,n){return s()(a()().mark((function t(){var i,r,l,s,u,d,p,m,x,v,g,_,j,w;return a()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=e.size,r=Math.ceil(i/c),t.prev=2,t.next=5,(0,h.ZP)("/api/attachments/multipart_upload_start",{method:"POST",body:{fileName:e.name,chunkCount:r,user_id:null==o||null===(l=o.userInfo)||void 0===l?void 0:l.user_id}});case 5:if(0===(null==(u=t.sent)?void 0:u.status)){t.next=8;break}throw new Error;case 8:d=u.upload_id,f.current=new AbortController,p=[],0,m=a()().mark((function n(){var t,r,o,l;return a()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:t=x*c,r=Math.min(t+c,i),o=e.slice(t,r),(l=new FormData).append("chunk",o),l.append("fileName",e.name),l.append("chunkIndex",(x+1).toString()),l.append("uploadId",d),p.push((function(){return(0,h.ZP)("/api/attachments/multipart_upload",{method:"POST",body:l,signal:f.current.signal},!0).then((function(e){}))}));case 9:case"end":return n.stop()}}),n)})),x=0;case 14:if(!(x<r)){t.next=19;break}return t.delegateYield(m(),"t0",16);case 16:x++,t.next=14;break;case 19:v=0,g=4,console.log(p,"promises");case 22:if(!(v<p.length)){t.next=31;break}if(!((j=null===(_=p.slice(v,v+g))||void 0===_?void 0:_.map((function(e){return e()}))).length>0)){t.next=29;break}return t.next=27,Promise.all(j);case 27:t.sent,v+=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:r,uploadId:d,user_id:null==o||null===(s=o.userInfo)||void 0===s?void 0:s.user_id}});case 33:w=t.sent,n(null==w?void 0:w.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]])})))()}};return(0,d.useEffect)((function(){return function(){null!=_&&(_.destroy(),j(null))}}),[_]),(0,x.jsx)(x.Fragment,{children:(0,x.jsxs)("div",{className:null==m?void 0:m.editor_css,style:{border:"1px solid #ccc",zIndex:100},children:[(0,x.jsx)(p.o,{editor:_,defaultConfig:{},mode:"default",style:{borderBottom:"1px solid #ccc"}}),(0,x.jsx)(p.M,{defaultConfig:S,value:k,onCreated:j,onChange:function(e){var n;!function(e){return""==e||new RegExp("^[ ]+$").test(e)}((n=e.getHtml(),n.replace(/<[^<p>]+>/g,"").replace(/<[</p>$]+>/g,"").replace(/ /gi,"").replace(/<[^<br/>]+>/g,"")))?b(e.getHtml()):b("")},mode:"default",style:r()({height:"500px",overflowY:"hidden"},i)})]})})}))},89637:function(e,n,t){t.r(n),t.d(n,{default:function(){return fe}});var i=t(7557),r=t.n(i),o=t(82242),a=t.n(o),l=t(41498),s=t.n(l),c=t(79800),u=t.n(c),d=t(59301),p=t(65363),h=t(43418),f=t(95237),m=t(71418),x="wrap___NZWPs",v="content___OLcvS",g="name____Thh2",_="list___F7fxl",j="head___ffJpn",w="models___kudCc",y="btns___CQDPq",k="rowsHead___oC1SU",b="time___r7Qed",S="rowsBody___ZNF9c",C=t(79311),Z=t(54178),N=t(23599),F=t(9070),P=t(38296),E=t(27627),T=t(82100),z=t.n(T),R=t(29186),O=t.n(R),D=t(4811),I=t.n(D),B=t(34577),L=t.n(B),A=t(80619),M=t.n(A),V=t(47074),K=t.n(V),H=t(78241),U=t(8591),q=t(3113),X=t(6848),W=t(38854),$=t(57809),J=t(73782),Q=t(97334),G=t(43604),Y=t(59028),ee=t(85160),ne=t(12378),te=t(20570),ie={flex_box_center:"flex_box_center___dw6yv",flex_space_between:"flex_space_between___bkc32",flex_box_vertical_center:"flex_box_vertical_center___jDpm2",flex_box_center_end:"flex_box_center_end___g9JOB",flex_box_column:"flex_box_column___ngIjI","diagram-component":"diagram-component___fHDp0",rightmodal:"rightmodal___Fwj_F",title:"title___YZZgl",button:"button___yQKxh",linetitles:"linetitles___CFVw5",line:"line___hSEjG",additem:"additem___cy1wv",lebels:"lebels___E2znG",describe:"describe___emw2X",describetitle:"describetitle___bgNOs",ehover:"ehover____RCDx",dhover:"dhover___IP_3b",header:"header___PCDQg",headeractivite:"headeractivite___x56tJ"},re=t(13261),oe=t(15309),ae=t(12911),le=t.n(ae),se=t(37574),ce=t(37712),ue=function(e){M()(t,e);var n=K()(t);function t(){return z()(this,t),n.apply(this,arguments)}return O()(t,[{key:"isFixed",value:function(e){return e.node.isSelected}},{key:"doLayout",value:function(e){var n=this;this._isObserving||(this._isObserving=!0,this.diagram.addModelChangedListener((function(e){(""!==e.modelChange||e.change===ne.Vk.Transaction&&"StartingFirstTransaction"===e.propertyName)&&(n.network=null)})));var i=this.network;null===i?this.network=i=this.makeNetwork(e):this.diagram.nodes.each((function(e){var n=i.findVertex(e);null!==n&&(n.bounds=e.actualBounds)})),I()(L()(t.prototype),"doLayout",this).call(this,e),this.network=i}}]),t}(ne.hD),de=["#3CDAA3","#9C41DE","#F84F90","#30A7F1","#6656FF"],pe=["根节点","课件知识单元","实训知识单元","文本知识单元","知识点"],he=(0,p.connect)((function(e){var n=e.virtualSpaces;return{globalSetting:e.globalSetting,virtualSpaces:n}}))((function(e){e.globalSetting,e.dispatch;var n,t,i=e.virtualSpaces,o=(0,p.useParams)(),l=(0,d.useRef)(),c=(0,d.useState)(!1),x=u()(c,2),v=x[0],g=x[1],_=(0,d.useState)(!1),j=u()(_,2),w=j[0],y=j[1],k=(0,d.useState)(!1),b=u()(k,2),S=b[0],Z=b[1],F=(0,d.useState)(!1),E=u()(F,2),T=E[0],z=E[1],R=(0,d.useState)(!0),O=u()(R,2),D=O[0],I=O[1],B=(0,d.useState)(!1),L=u()(B,2),A=L[0],M=L[1],V=(0,d.useState)({}),K=u()(V,2),ae=K[0],he=K[1],fe=H.Z.useForm(),me=u()(fe,1)[0],xe=(0,d.useState)(!1),ve=u()(xe,2),ge=ve[0],_e=ve[1],je=(0,d.useState)(!0),we=u()(je,2),ye=we[0],ke=we[1],be=(0,d.useState)({index:"",name:"",add:!1}),Se=u()(be,2),Ce=Se[0],Ze=Se[1],Ne=(0,d.useState)({}),Fe=u()(Ne,2),Pe=Fe[0],Ee=Fe[1],Te=(0,d.useRef)(null),ze=(0,d.useState)(!1),Re=u()(ze,2),Oe=Re[0],De=Re[1],Ie=(0,d.useState)(!1),Be=u()(Ie,2),Le=Be[0],Ae=Be[1],Me=(0,d.useState)([]),Ve=u()(Me,2),Ke=Ve[0],He=Ve[1],Ue=(0,d.useState)([]),qe=u()(Ue,2),Xe=qe[0],We=qe[1],$e=(0,d.useState)([]),Je=u()($e,2),Qe=Je[0],Ge=Je[1],Ye=(0,d.useState)(""),en=u()(Ye,2),nn=en[0],tn=en[1],rn=(0,d.useState)(!0),on=u()(rn,2),an=on[0],ln=on[1],sn=(0,d.useState)(),cn=u()(sn,2),un=cn[0],dn=cn[1],pn=(0,d.useState)([]),hn=u()(pn,2),fn=hn[0],mn=hn[1],xn=(0,d.useState)(!1),vn=u()(xn,2),gn=vn[0],_n=vn[1],jn=(0,d.useState)(!1),wn=u()(jn,2),yn=wn[0],kn=wn[1],bn=(0,d.useRef)(),Sn=(0,d.useRef)(),Cn=(0,d.useState)(!1),Zn=u()(Cn,2),Nn=Zn[0],Fn=Zn[1],Pn=(0,d.useState)({left:0,top:0,bottom:0,right:0}),En=u()(Pn,2),Tn=En[0],zn=En[1],Rn=(0,d.useRef)(null),On=i.virtualSpacesDetails,Dn=(null==On?void 0:On.is_member)||(0,P.Ny)(),In=(0,d.useState)(!1),Bn=u()(In,2),Ln=Bn[0],An=Bn[1],Mn=(0,d.useState)(600),Vn=u()(Mn,2),Kn=(Vn[0],Vn[1]);(0,d.useEffect)((function(){Ee({}),qn()}),[o,D]),(0,d.useEffect)((function(){Hn(),U.ZP.config({getContainer:function(){return Te.current},top:100})}),[]);var Hn=function(){if(!Sn.current){var e=ne.bx.make,n=new ne.S0("myDiagramDiv",{"commandHandler.copiesTree":!1,"commandHandler.copiesParentKey":!1,"commandHandler.deletesTree":!1,"draggingTool.dragsTree":!1,"undoManager.isEnabled":!1,doubleClick:!1});Sn.current=n;var t=ne.bx.make(ne.FF);t.angle=0,t.arrangement=ne.FF.ArrangementFixedRoots,n.layout=t,n.nodeTemplate=e(ne.NB,"Vertical",{selectionObjectName:"TEXT"},e(ne.al,{name:"TEXT",minSize:new ne.$u(30,15)},new ne.KX("text","text").makeTwoWay(),new ne.KX("scale","scale").makeTwoWay(),new ne.KX("font","font").makeTwoWay()),e(ne.bn,"LineH",{stretch:ne.bx.Horizontal,strokeWidth:3,height:3,portId:"",fromSpot:ne.z6.LeftRightSides,toSpot:ne.z6.LeftRightSides},new ne.KX("stroke","brush"),new ne.KX("fromSpot","dir",(function(e){return Jn(e,!0)})),new ne.KX("toSpot","dir",(function(e){return Jn(e,!1)}))),new ne.KX("location","loc",ne.E9.parse).makeTwoWay(ne.E9.stringify),new ne.KX("locationSpot","dir",(function(e){return Jn(e,!1)})),{click:function(e,n){if(Dn)he(null==n?void 0:n.data),zn({left:0,top:0,bottom:0,right:0});else{var t,i;if(null==n||null===(t=n.data)||void 0===t||!t.url)return;window.open(null==n||null===(i=n.data)||void 0===i?void 0:i.url)}}}),n.allowDoubleClick=!1,n.allowSelect="single",n.commandHandler.canDeleteSelection=!1,n.commandHandler.canUndo=!1,n.toolManager.clickSelectingTool.canStartMulti=!1,n.linkTemplate=e(ne.rU,{curve:ne.rU.Bezier,fromShortLength:-2,toShortLength:-2,selectable:!1},e(ne.bn,{strokeWidth:3},new ne.KX("stroke","toNode",(function(e){return e.data.brush?e.data.brush:"black"})).ofObject()))}};function Un(e){Sn.current.model=ne.Hn.fromJson(JSON.stringify({class:"go.TreeModel",nodeDataArray:e.map((function(e){return e.brush=de[e.unit_type],e}))}))}function qn(){return Xn.apply(this,arguments)}function Xn(){return(Xn=s()(r()().mark((function e(){var n,t,i,l,s,c;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=D?"/api/knowledge_graphs/tree.json":"/api/knowledge_graphs/map.json",e.next=3,(0,C.ZP)(n,{method:"get",params:{type:2,identifier:o.virtual_spacesId}});case 3:0===(t=e.sent).status&&(s=null==t||null===(i=t.nodeData)||void 0===i?void 0:i.map((function(e,n){return a()(a()({},e),{},{bgcolor:de[e.unit_type],parent:e.parent_id})})),Ee(a()(a()({},t),{},{nodeData:s})),D?(Un(s),setTimeout((function(){Qn()}),300)):Qn(),(null==(c=null==t||null===(l=t.nodeData)||void 0===l?void 0:l.filter((function(e){return e.id===ae.id})))?void 0:c.length)>0&&he(a()({},null==c?void 0:c[0])));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Wn={onRemove:function(){He([])},beforeUpload:function(e){if(console.log(e),(null==e?void 0:e.size)>52428800)return U.ZP.info("文件超过50M,不符合上传要求"),!1;var n=[];return n.push(e),He([].concat(n)),!1},fileList:Ke,accept:".xls,.xlsx"},$n=(0,d.useMemo)((function(){return function e(n){return n.map((function(n){var t=n.title,i=t.indexOf(nn),r=t.substring(0,i),o=t.slice(i+nn.length),a=i>-1?(0,ce.jsxs)("span",{children:[r,(0,ce.jsx)("span",{style:{color:"#f50"},children:nn}),o]}):(0,ce.jsx)("span",{children:t});return n.children?{title:a,key:n.key,children:e(n.children)}:{title:a,key:n.key}}))}(Xe)}),[nn,Xe]);function Jn(e,n){return"left"===e?n?ne.z6.Left:ne.z6.Right:n?ne.z6.Right:ne.z6.Left}function Qn(){var e,n,t,i;Kn(600),null===(e=Sn.current)||void 0===e||null===(n=e.zoomToFit)||void 0===n||n.call(e),null===(t=bn.current)||void 0===t||null===(i=t.zoomToFit)||void 0===i||i.call(t)}return(0,ce.jsxs)("div",{ref:Te,style:{paddingBottom:20,background:"#FFF",position:"relative",height:"100vh"},children:[(0,ce.jsxs)(m.Z,{spinning:A,children:[(null==Pe?void 0:Pe.is_root)&&(0,ce.jsx)(re.Z,{ButtonClick:s()(r()().mark((function e(){var n;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return M(!0),e.next=3,(0,C.ZP)("/api/knowledge_graphs/set_root.json",{method:"post",body:{type:2,identifier:o.virtual_spacesId}});case 3:n=e.sent,M(!1),0===n.status&&qn();case 6:case"end":return e.stop()}}),e)}))),buttonProps:{type:"primary"},ButtonText:Dn&&"新增节点",ButtonTwo:Dn&&(0,ce.jsx)(q.ZP,{style:{marginLeft:20},onClick:function(){Ae(!0)},type:"primary",children:"文件导入"}),styles:{margin:"auto",paddingTop:100}}),!(null!=Pe&&Pe.is_root)&&(0,ce.jsxs)("div",{style:{height:60,border:"1px solid #e7e7e7",display:"flex"},children:[(0,ce.jsxs)("div",{onClick:function(){I(!0),he({})},className:D?ie.headeractivite:ie.header,children:[(0,ce.jsxs)("div",{children:[" ",(0,ce.jsx)("i",{className:"iconfont icon-zhishishu"})]}),(0,ce.jsx)("div",{children:"知识树"})]}),(0,ce.jsxs)("div",{onClick:function(){I(!1),he({})},className:D?ie.header:ie.headeractivite,children:[(0,ce.jsxs)("div",{children:[" ",(0,ce.jsx)("i",{className:"iconfont icon-guanxitu"})]}),(0,ce.jsx)("div",{children:"关系图"})]}),(0,ce.jsxs)("div",{onClick:function(){var e,n,t,i,r=D?Sn.current.viewportBounds.width:bn.current.viewportBounds.width,o=D?Sn.current.viewportBounds.height:bn.current.viewportBounds.height;null===(e=Sn.current)||void 0===e||null===(n=e.zoomToRect)||void 0===n||n.call(e,new ne.UL(1,1,r/1.1,o/1.1)),null===(t=bn.current)||void 0===t||null===(i=t.zoomToRect)||void 0===i||i.call(t,new ne.UL(1,1,r/1.1,o/1.1))},className:ie.header,children:[(0,ce.jsxs)("div",{children:[" ",(0,ce.jsx)("i",{className:"iconfont icon-fangda3"})]}),(0,ce.jsx)("div",{children:"放大"})]}),(0,ce.jsxs)("div",{onClick:function(){var e,n,t,i,r=D?Sn.current.viewportBounds.width:bn.current.viewportBounds.width,o=D?Sn.current.viewportBounds.height:bn.current.viewportBounds.height;null===(e=Sn.current)||void 0===e||null===(n=e.zoomToRect)||void 0===n||n.call(e,new ne.UL(1,1,1.1*r,1.1*o)),null===(t=bn.current)||void 0===t||null===(i=t.zoomToRect)||void 0===i||i.call(t,new ne.UL(1,1,1.1*r,1.1*o))},className:ie.header,children:[(0,ce.jsxs)("div",{children:[" ",(0,ce.jsx)("i",{className:"iconfont icon-suoxiao3"})]}),(0,ce.jsx)("div",{children:"缩小"})]}),(0,ce.jsxs)("div",{onClick:function(){var e,n,t,i;Kn(600),null===(e=Sn.current)||void 0===e||null===(n=e.zoomToFit)||void 0===n||n.call(e),null===(t=bn.current)||void 0===t||null===(i=t.zoomToFit)||void 0===i||i.call(t)},className:ie.header,children:[(0,ce.jsxs)("div",{children:[" ",(0,ce.jsx)("i",{className:"iconfont icon-zishiying"})]}),(0,ce.jsx)("div",{children:"最佳适应"})]}),(0,ce.jsxs)("div",{onClick:s()(r()().mark((function e(){var n,t;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return kn(!0),e.next=3,(0,C.ZP)("/api/knowledge_graphs.json",{method:"get",params:{type:2,identifier:o.virtual_spacesId}});case 3:0===(n=e.sent).status&&(mn(null==n?void 0:n.list),We(null==n?void 0:n.knowledge_graphs),Ge(null==n||null===(t=n.list)||void 0===t?void 0:t.map((function(e){return e.key}))));case 5:case"end":return e.stop()}}),e)}))),className:ie.header,children:[(0,ce.jsxs)("div",{children:[" ",(0,ce.jsx)("i",{className:"iconfont icon-chazhao"})]}),(0,ce.jsx)("div",{children:"查找"})]}),Dn&&(0,ce.jsxs)("div",{onClick:function(){Ae(!0)},className:ie.header,children:[(0,ce.jsxs)("div",{children:[" ",(0,ce.jsx)("i",{className:"iconfont icon-daoru"})]}),(0,ce.jsx)("div",{children:"导入"})]}),(0,ce.jsxs)("div",{style:{flex:1,textAlign:"end",lineHeight:"60px"},children:[Dn&&(0,ce.jsx)(X.Z,{title:"清空所有数据",getPopupContainer:function(){return Te.current},children:(0,ce.jsx)("i",{onClick:function(){var e;h.Z.confirm({title:"提示",icon:null,centered:!0,getContainer:function(){return Te.current},content:"请确定是否将知识图谱所有的数据清空,恢复空状态,清空后数据不可恢复!本次清空不会影响到课程章节内容,仅作用于知识图谱的数据。",onOk:(e=s()(r()().mark((function e(){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,C.ZP)("/api/knowledge_graphs/delete_all.json",{method:"DELETE",body:{type:2,identifier:o.virtual_spacesId}});case 2:0===e.sent.status&&(qn(),he({}));case 4:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)})})},className:"iconfont icon-shanchu14 ".concat(ie.dhover)})}),Dn&&(0,ce.jsx)(W.Z,{getPopupContainer:function(){return Te.current},menu:{items:[{key:"1",style:{width:100},label:(0,ce.jsx)("a",{href:"".concat(oe.Z.API_SERVER,"/api/knowledge_graphs/export.xlsx?identifier=").concat(o.virtual_spacesId,"&type=2"),children:"导出Excel"})},{key:"2",label:(0,ce.jsx)("a",{href:"".concat(oe.Z.API_SERVER,"/api/knowledge_graphs/export.json?identifier=").concat(o.virtual_spacesId,"&type=2"),children:"导出Word"})}]},children:(0,ce.jsx)("i",{style:{marginLeft:30},className:"iconfont icon-xiazai6 ".concat(ie.ehover)})}),(0,ce.jsx)("i",{onClick:function(){(0,te.vp)()?(De(!1),(0,te.BU)()):(De(!0),(0,te.Dj)(Te.current)),Qn()},style:{marginLeft:30,marginRight:20},className:"iconfont ".concat(Oe?"icon-tuichuquanping3":"icon-quanping4"," ").concat(ie.ehover)})]})]}),(0,ce.jsxs)("div",{className:"relative",children:[!D&&(0,ce.jsx)(ee.FI,{ref:l,divClassName:"diagram-component",style:{backgroundColor:"#fff",height:Oe?"calc(100vh - 100px)":540,visibility:null!=Pe&&Pe.is_root?"hidden":"visible"},initDiagram:function(){var e=ne.bx.make,n=e(ne.S0,{allowSelect:!1,"undoManager.isEnabled":!0,initialAutoScale:ne.S0.Uniform,contentAlignment:ne.z6.Center,layout:e(ue,{defaultSpringLength:30,defaultElectricalCharge:100}),SelectionMoved:function(e){return e.diagram.layout.invalidateLayout()},model:e(ne.FJ,{linkKeyProperty:"key",makeUniqueKeyFunction:function(e,n){for(var t=n.key||1;e.findNodeDataForKey(t);)t++;return n.key=t,t},makeUniqueLinkKeyFunction:function(e,n){for(var t=n.key||-1;e.findLinkDataForKey(t);)t--;return n.key=t,t}})});return n.toolManager.draggingTool.doMouseMove=function(){ne.h1.prototype.doMouseMove.call(this),this.isActive&&this.diagram.layout.doLayout(!0)},n.nodeTemplate=e(ne.NB,"Auto",{minSize:new ne.$u(100,100)},e(ne.bn,"Circle",{stroke:"white",spot1:new ne.z6(0,0,5,5),spot2:new ne.z6(1,1,-5,-5)},new ne.KX("fill","bgcolor")),e(ne.al,{font:"bold 10pt helvetica, bold arial, sans-serif",stroke:"white",textAlign:"center",maxSize:new ne.$u(100,NaN)},new ne.KX("text","text")),{click:function(e,n){if(Dn)he(null==n?void 0:n.data),zn({left:0,top:0,bottom:0,right:0});else{var t,i;if(null==n||null===(t=n.data)||void 0===t||!t.url)return;window.open(null==n||null===(i=n.data)||void 0===i?void 0:i.url)}}}),n.linkTemplate=e(ne.rU,{layerName:"Background"},e(ne.bn,{stroke:"black"}),e(ne.bn,{toArrow:"standard",stroke:null}),e(ne.s_,"Auto",e(ne.bn,{fill:e(ne.BD,"Radial",{0:"rgb(240, 240, 240)",.3:"rgb(240, 240, 240)",1:"rgba(240, 240, 240, 0)"}),stroke:null}),e(ne.al,{textAlign:"center",font:"10pt helvetica, arial, sans-serif",stroke:"#555555",margin:4},new ne.KX("text","text")))),n.doubleClick=!1,n.allowDoubleClick=!1,n.allowSelect="single",n.commandHandler.canDeleteSelection=!1,n.commandHandler.canUndo=!1,n.allowInsert=!1,n.toolManager.clickSelectingTool.canStartMulti=!1,bn.current=n,n},nodeDataArray:null==Pe?void 0:Pe.nodeData,linkDataArray:null==Pe?void 0:Pe.linkData}),(0,ce.jsx)("div",{id:"myDiagramDiv",style:{height:Oe?"calc(100vh - 100px)":540,width:"100%",visibility:null!=Pe&&Pe.is_root?"hidden":D?"visible":"hidden",position:D?"relative":"absolute"}})]}),(0,ce.jsx)("div",{children:!(null!=Pe&&Pe.is_root)&&pe.map((function(e,n){return(0,ce.jsxs)("span",{style:{marginLeft:0===n&&20,marginRight:30},children:[(0,ce.jsx)("span",{style:{marginRight:6,width:16,height:8,background:de[n],display:"inline-flex",borderRadius:4}}),(0,ce.jsx)("span",{style:{color:"#9096A3"},children:e})]})}))})]}),(0,ce.jsx)("div",{style:{zIndex:1e3},children:(0,ce.jsx)(le(),{disabled:Nn,bounds:Tn,onStart:function(e,n){return function(e,n){var t,i=window.document.documentElement,r=i.clientWidth,o=i.clientHeight,a=null===(t=Rn.current)||void 0===t?void 0:t.getBoundingClientRect();zn({left:-a.left+n.x,right:r-(a.right-n.x),top:-a.top+n.y,bottom:o-(a.bottom-n.y)-70})}(0,n)},children:(0,ce.jsx)("div",{ref:Rn,style:{position:"fixed",cursor:"move",right:0,top:Oe?60:260,zIndex:12},children:(0,ce.jsx)("div",{onMouseOver:function(){Nn&&Fn(!ye)},onMouseOut:function(){Fn(!0)},children:ae.id&&(0,ce.jsx)("div",{className:ie.rightmodal,children:(0,ce.jsxs)(m.Z,{spinning:A,children:[(0,ce.jsxs)("div",{style:{display:"flex"},children:[(0,ce.jsxs)("div",{className:ie.title,children:[ae.text," ",(0,ce.jsx)("i",{onClick:function(){g(!0),me.setFieldsValue({name:ae.text})},className:"iconfont icon-bianji3",style:{marginLeft:14,color:"#666666",cursor:"pointer"}})]}),(0,ce.jsx)("div",{children:(0,ce.jsx)("i",{style:{cursor:"pointer"},onClick:function(){var e,n;he({}),null===(e=Sn.current)||void 0===e||e.clearSelection(),null===(n=bn.current)||void 0===n||n.clearSelection()},className:"iconfont icon-danchuangguanbi"})})]}),(0,ce.jsxs)("div",{style:{marginTop:25},children:[(0,ce.jsxs)("span",{className:ie.button,onClick:function(){ae.unit_type>=4||0===ae.unit_type?0===ae.unit_type?U.ZP.info("根节点暂不支持插入知识点"):U.ZP.info("知识点为最小单位暂不支持插入知识点"):(me.setFieldsValue({name:""}),Z(!0))},children:[(0,ce.jsx)("i",{style:{marginRight:8},className:"iconfont icon-charuzhishidian1"})," 插入知识点"]}),(0,ce.jsxs)("span",{className:ie.button,onClick:function(){ae.unit_type>=4?U.ZP.info("知识点为最小单位暂不支持插入知识单元"):(me.setFieldsValue({name:"",unit_type:3,url:""}),z(!0))},children:[(0,ce.jsx)("i",{style:{marginRight:8},className:"iconfont icon-charuzhishidanyuan"})," 插入知识单元"]}),(0,ce.jsxs)("span",{className:ie.button,onClick:function(){var e;h.Z.confirm({icon:null,title:"提示",centered:!0,getContainer:function(){return Te.current},content:"删除该节点会导致它的子节点一并删除,删除节点不会影响到课程章节内容,删除后,数据不可恢复请确认是否删除",onOk:(e=s()(r()().mark((function e(){var n;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return M(!0),e.next=3,(0,C.ZP)("/api/knowledge_graphs/".concat(ae.id,".json"),{method:"DELETE"});case 3:n=e.sent,M(!1),0===(null==n?void 0:n.status)&&(he({}),qn());case 6:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)})})},children:[(0,ce.jsx)("i",{style:{marginRight:8},className:"iconfont icon-shanchujiedian"})," 删除节点"]}),(0,ce.jsxs)("span",{className:ie.button,onClick:s()(r()().mark((function e(){var n,t;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return _e(!0),e.next=3,(0,C.ZP)("/api/knowledge_graphs.json",{method:"get",params:{type:2,identifier:o.virtual_spacesId}});case 3:0===(n=e.sent).status&&(mn(null==n?void 0:n.list),We(null==n?void 0:n.knowledge_graphs),Ge(null==n||null===(t=n.list)||void 0===t?void 0:t.map((function(e){return e.key}))));case 5:case"end":return e.stop()}}),e)}))),children:[(0,ce.jsx)("i",{style:{marginRight:8},className:"iconfont icon-guanxi"})," 关系"]})]}),(0,ce.jsxs)("div",{style:{marginTop:20},children:[(0,ce.jsxs)("div",{className:ie.linetitles,children:[(0,ce.jsx)("span",{className:ie.line}),"属性"]}),4!=ae.unit_type&&ae.unit_type>0&&(0,ce.jsxs)("div",{style:{paddingLeft:8},children:[(0,ce.jsx)("label",{className:ie.lebels,children:"类型"}),(0,ce.jsxs)($.default,{size:"large",getPopupContainer:function(){return Te.current},style:{width:"100%",marginTop:6},value:ae.unit_type,onChange:function(){var e=s()(r()().mark((function e(n){var t;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ae.unit_type=n,he(a()({},ae)),M(!0),e.next=5,(0,C.ZP)("/api/knowledge_graphs/".concat(ae.id,".json"),{method:"put",body:{type:2,unit_type:n}});case 5:t=e.sent,M(!1),0===t.status&&(g(!1),qn());case 8:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),placeholder:"请选择类型",children:[(0,ce.jsx)($.default.Option,{value:1,children:"课件"}),(0,ce.jsx)($.default.Option,{value:3,children:"文本"}),(0,ce.jsx)($.default.Option,{value:2,children:"实训"})]})]}),(0,ce.jsxs)("div",{style:{paddingLeft:8,marginTop:15},children:[(0,ce.jsx)("label",{className:ie.lebels,style:{display:"flex"},children:"跳转地址"}),(0,ce.jsx)(J.Z,{size:"large",value:ae.url,onChange:function(e){ae.url=e.target.value,he(a()({},ae))},disabled:ye,onBlur:function(){var e=s()(r()().mark((function e(n){var t;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Fn(!1),!n.target.value){e.next=6;break}if(new RegExp(/^(https?:\/\/)?([\w.-]+)\.([a-z]{2,})(\/\S*)?$/,"i").test(n.target.value)){e.next=6;break}return U.ZP.info("请输入正确的跳转地址"),e.abrupt("return");case 6:return M(!0),e.next=9,(0,C.ZP)("/api/knowledge_graphs/".concat(ae.id,".json"),{method:"put",body:{type:2,url:n.target.value}});case 9:t=e.sent,M(!1),ke(!0),0===t.status&&(g(!1),qn());case 13:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),style:{width:"81%",marginTop:6}}),(0,ce.jsx)("i",{onClick:function(){ke(!1)},className:"iconfont icon-bianji3",style:{marginLeft:12,marginRight:20,color:"#666666",cursor:"pointer"}}),(0,ce.jsx)("span",{className:ie.button,style:{marginRight:0},onClick:function(){ae.url?window.open(ae.url):U.ZP.info("链接不能为空")},children:"跳转"})]})]}),(0,ce.jsxs)("div",{style:{marginTop:20},children:[(0,ce.jsxs)("div",{className:ie.linetitles,children:[(0,ce.jsx)("span",{className:ie.line}),"关系"]}),null==ae||null===(n=ae.relations)||void 0===n?void 0:n.map((function(e,n){return(0,ce.jsxs)("div",{style:{display:"flex",paddingLeft:8},children:[(0,ce.jsxs)("div",{className:ie.multi_ellipsis1,children:["与节点“",(0,ce.jsx)("span",{style:{fontWeight:600,color:"#000000"},children:e.name}),"”为",e.relation,"关系"]}),(0,ce.jsx)("div",{style:{width:"10%",textAlign:"end"},children:(0,ce.jsx)("i",{onClick:function(){var t;h.Z.confirm({icon:null,title:"提示",getContainer:function(){return Te.current},centered:!0,content:"请确认是否将节点之间的关系解绑",onOk:(t=s()(r()().mark((function t(){var i,o;return r()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return M(!0),t.next=3,(0,C.ZP)("/api/knowledge_graphs/".concat(null==ae?void 0:ae.id,"/delete_relation.json"),{method:"POST",body:{relation_id:e.relation_id}});case 3:i=t.sent,M(!1),0===i.status&&(null===(o=ae.relations)||void 0===o||o.splice(n,1),he(a()({},ae)),qn());case 6:case"end":return t.stop()}}),t)}))),function(){return t.apply(this,arguments)})})},className:"".concat(ie.dhover," iconfont icon-shanchu10")})})]})}))]}),(0,ce.jsxs)("div",{style:{marginTop:20},children:[(0,ce.jsxs)("div",{className:ie.linetitles,children:[(0,ce.jsx)("span",{className:ie.line}),"描述",(0,ce.jsx)("div",{style:{flex:1,textAlign:"end"},children:(0,ce.jsxs)("span",{onClick:function(){Ze({add:!0,name:""}),me.setFieldsValue({describe:""})},className:ie.additem,children:[(0,ce.jsx)("i",{style:{fontSize:12},className:"iconfont icon-tianjiashitixiaojiahao"})," 添加"]})})]}),(0,ce.jsx)("div",{style:{height:200,overflow:"auto"},children:null===(t=ae.descriptions)||void 0===t?void 0:t.map((function(e,n){return(0,ce.jsxs)("div",{className:ie.describe,children:[(0,ce.jsxs)("div",{className:ie.describetitle,children:[(0,ce.jsxs)("div",{style:{fontSize:14,color:"#000000",fontWeight:500},children:["描述",n+1]}),(0,ce.jsxs)("div",{children:[(0,ce.jsx)("i",{onClick:function(){Ze({index:n,name:e}),me.setFieldsValue({describe:e})},style:{marginRight:10},className:"iconfont icon-bianji-moren ".concat(ie.ehover)}),(0,ce.jsx)("i",{onClick:function(){var e;h.Z.confirm({icon:null,title:"提示",getContainer:function(){return Te.current},centered:!0,content:"删除描述后,数据不可恢复,请确认是否删除",onOk:(e=s()(r()().mark((function e(){var t,i;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return null===(t=ae.descriptions)||void 0===t||t.splice(n,1),he(a()({},ae)),M(!0),e.next=5,(0,C.ZP)("/api/knowledge_graphs/".concat(ae.id,".json"),{method:"put",body:{type:2,descriptions:ae.descriptions}});case 5:i=e.sent,M(!1),0===i.status&&(g(!1),qn());case 8:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)})})},className:"iconfont icon-shanchutimu ".concat(ie.dhover)})]})]}),(0,ce.jsx)(N.Z,{value:e||""})]})}))})]})]})})})})})}),(0,ce.jsx)(h.Z,{open:v,centered:!0,title:"编辑",getContainer:function(){return Te.current},onCancel:function(){return g(!1)},okButtonProps:{loading:w},onOk:function(){me.submit()},children:(0,ce.jsx)(H.Z,{size:"large",form:me,onFinish:function(){var e=s()(r()().mark((function e(n){var t;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return y(!0),e.next=3,(0,C.ZP)("/api/knowledge_graphs/".concat(ae.id,".json"),{method:"put",body:{type:2,name:n.name}});case 3:t=e.sent,y(!1),0===t.status&&(D&&(ae.text=n.name,he(ae)),g(!1),U.ZP.info("修改成功"),qn());case 6:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:(0,ce.jsx)(H.Z.Item,{name:"name",label:"名称",rules:[{required:!0,validator:function(e,n){var t;return(null==n||null===(t=n.replaceAll(" ",""))||void 0===t?void 0:t.length)>0?Promise.resolve():Promise.reject("请输入名称")}}],children:(0,ce.jsx)(J.Z,{maxLength:30})})})}),(0,ce.jsx)(h.Z,{open:S,centered:!0,title:"插入知识点",getContainer:function(){return Te.current},onCancel:function(){return Z(!1)},okButtonProps:{loading:w},onOk:function(){me.submit()},children:(0,ce.jsx)(H.Z,{size:"large",form:me,onFinish:function(){var e=s()(r()().mark((function e(n){var t;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return y(!0),e.next=3,(0,C.ZP)("/api/knowledge_graphs.json",{method:"post",body:a()(a()({},n),{},{unit_type:4,type:2,identifier:o.virtual_spacesId,parent_id:ae.id})});case 3:t=e.sent,y(!1),0===t.status&&(Z(!1),qn(),U.ZP.info("插入知识点成功"));case 6:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:(0,ce.jsx)(H.Z.Item,{name:"name",label:"知识点名称",rules:[{required:!0,validator:function(e,n){var t;return(null==n||null===(t=n.replaceAll(" ",""))||void 0===t?void 0:t.length)>0?Promise.resolve():Promise.reject("请输入知识点名称")}}],children:(0,ce.jsx)(J.Z,{maxLength:20})})})}),(0,ce.jsx)(h.Z,{open:T,centered:!0,width:550,title:"插入知识单元",getContainer:function(){return Te.current},onCancel:function(){return z(!1)},okButtonProps:{loading:w},onOk:function(){me.submit()},children:(0,ce.jsxs)(H.Z,{size:"large",form:me,labelCol:{span:5},onFinish:function(){var e=s()(r()().mark((function e(n){var t;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,C.ZP)("/api/knowledge_graphs.json",{method:"post",body:a()(a()({},n),{},{type:2,identifier:o.virtual_spacesId,parent_id:ae.id})});case 2:t=e.sent,y(!1),0===t.status&&(z(!1),qn(),U.ZP.info("插入知识单元成功"));case 5:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:[(0,ce.jsx)(H.Z.Item,{name:"name",label:"知识单元名称",rules:[{required:!0,validator:function(e,n){var t;return(null==n||null===(t=n.replaceAll(" ",""))||void 0===t?void 0:t.length)>0?Promise.resolve():Promise.reject("请输入知识单元名称")}}],children:(0,ce.jsx)(J.Z,{placeholder:"请输入知识单元名称",maxLength:20})}),(0,ce.jsx)(H.Z.Item,{name:"unit_type",label:"类型",children:(0,ce.jsxs)($.default,{getPopupContainer:function(){return Te.current},placeholder:"请选择类型",children:[(0,ce.jsx)($.default.Option,{value:1,children:"课件"}),(0,ce.jsx)($.default.Option,{value:3,children:"文本"}),(0,ce.jsx)($.default.Option,{value:2,children:"实训"})]})}),(0,ce.jsx)(H.Z.Item,{name:"url",label:"跳转地址",rules:[{pattern:new RegExp(/^(https?:\/\/)?([\w.-]+)\.([a-z]{2,})(\/\S*)?$/,"i"),message:"请输入正确的地址"}],children:(0,ce.jsx)(J.Z,{placeholder:"请输入点击该节点跳转的链接地址"})})]})}),ge&&(0,ce.jsxs)(h.Z,{open:ge,centered:!0,width:550,title:"添加关系",getContainer:function(){return Te.current},onCancel:function(){dn(""),_e(!1)},okButtonProps:{loading:w},onOk:function(){un?(_e(!1),_n(!0),me.setFieldsValue({relation:1}),tn("")):U.ZP.info("请先选择节点")},children:[(0,ce.jsx)(J.Z.Search,{size:"large",onChange:function(e){var n=e.target.value,t=fn.filter((function(e){return e.title.indexOf(n)>-1})).map((function(e){return e.key}));Ge(t),ln(!0),tn(e.target.value)}}),(0,ce.jsx)(Q.Z,{onExpand:function(e){Ge(e),ln(!1)},style:{maxHeight:300,height:300,marginTop:20,overflow:"auto"},onSelect:function(e){console.log("---",e),dn(null==e?void 0:e[0])},expandedKeys:Qe,defaultExpandAll:!0,autoExpandParent:an,treeData:$n})]}),(Ce.name||Ce.add)&&(0,ce.jsx)(h.Z,{open:Ce.name||Ce.add,title:"描述",width:900,getContainer:function(){return Te.current},centered:!0,onCancel:function(){Ze("")},okButtonProps:{loading:w},onOk:function(){me.submit()},children:(0,ce.jsx)(H.Z,{form:me,onFinish:function(){var e=s()(r()().mark((function e(n){var t;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return y(!0),Ce.add?(ae.descriptions.push(n.describe),he(a()({},ae))):(ae.descriptions[Ce.index]=n.describe,he(a()({},ae))),e.next=4,(0,C.ZP)("/api/knowledge_graphs/".concat(ae.id,".json"),{method:"put",body:{type:2,descriptions:ae.descriptions}});case 4:t=e.sent,y(!1),Ze(""),0===t.status&&(g(!1),qn());case 8:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:(0,ce.jsx)(H.Z.Item,{name:"describe",style:{marginBottom:-10},rules:[{required:!0,validator:function(e,n){var t;return(null==n||null===(t=n.replaceAll(" ",""))||void 0===t?void 0:t.length)>0?Promise.resolve():Promise.reject("请输入描述内容")}}],children:(0,ce.jsx)(se.Z,{placeholder:"请在此输入内容,最大限制为65000个字符",defaultValue:Ce.name,onChange:function(e){}})})})}),(0,ce.jsxs)(h.Z,{title:"文件导入",open:Le,centered:!0,okButtonProps:{loading:w},onCancel:function(){Ae(!1),He([])},onOk:s()(r()().mark((function e(){var n,t,i;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=new FormData,!(Ke.length>0)){e.next=5;break}n.append("file",Ke[0]),e.next=7;break;case 5:return U.ZP.warning("请选择文件"),e.abrupt("return");case 7:return y(!0),n.append("ec_year_id",o.ec_year_id),n.append("identifier",o.virtual_spacesId),n.append("type","2"),e.next=13,(0,C.ZP)("/api/knowledge_graphs/import.json",{method:"post",body:n},!0);case 13:t=e.sent,y(!1),0===(null==t?void 0:t.status)&&((null==t||null===(i=t.fail)||void 0===i?void 0:i.length)>0&&h.Z.confirm({icon:null,title:"导入失败",content:(0,ce.jsxs)("span",{children:["检测到本次导入存在不符合要求的数据,点击下载",(0,ce.jsx)("a",{href:"".concat(oe.Z.API_SERVER).concat(null==t?void 0:t.url),download:"失败数据.xlsx",children:"导入失败的数据"}),"查看"]})}),He([]),(null==t?void 0:t.success)>0&&U.ZP.info("添加成功"),qn(),Ae(!1));case 16:case"end":return e.stop()}}),e)}))),children:[!(null!=Pe&&Pe.is_root)&&(0,ce.jsx)("div",{style:{marginBottom:30,color:"#333333"},children:"检测当前已存数据,导入后原数据将会被删除,按照最新导入的 为主,如继续导入,请按照下方步骤进行"}),(0,ce.jsxs)("p",{style:{color:"#5F6368"},children:["步骤1:",(0,ce.jsx)("span",{style:{color:"#000000"},children:"下载"}),(0,ce.jsx)("a",{href:"".concat(oe.Z.API_SERVER,"/api/knowledge_graphs/down_template.json"),download:"模版.xlsx",children:"知识图谱导入模版"})]}),(0,ce.jsx)(f.Z,{children:(0,ce.jsxs)(G.Z,{style:{color:"#5F6368"},children:["步骤2:",(0,ce.jsx)("span",{style:{color:"#000000"},children:"上传填写好的《知识图谱导入模版》"})]})}),(0,ce.jsx)(f.Z,{style:{marginTop:10,marginLeft:50},children:(0,ce.jsx)(Y.Z,a()(a()({},Wn),{},{children:(0,ce.jsxs)("span",{style:{padding:"0px 16px",color:"#3061D0",cursor:"pointer",height:32,alignItems:"center",display:"inline-flex",borderRadius:2,border:"1px solid #BACFFE",background:"#F6F7F9 linear-gradient(180deg, #FFFFFF 0%, #F6F7F9 100%)",boxShadow:"0px 2px 4px 0px #E0DFE1, inset 0px 1px 3px 0px rgba(255,255,255,0.5)"},children:[(0,ce.jsx)("i",{style:{fontSize:12,marginRight:6},className:"iconfont icon-tianjiashitixiaojiahao"})," 选择文件"]})}))})]}),(0,ce.jsx)(h.Z,{open:gn,title:"添加关系",width:500,getContainer:function(){return Te.current},centered:!0,onCancel:function(){_n(!1),me.setFieldsValue({relation:null})},okButtonProps:{loading:w},onOk:function(){me.submit()},children:(0,ce.jsx)(H.Z,{form:me,onFinish:function(){var e=s()(r()().mark((function e(n){var t;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return y(!0),e.next=3,(0,C.ZP)("/api/knowledge_graphs/".concat(ae.id,"/relation.json"),{method:"post",body:a()({type:2,parent_id:un},n)});case 3:t=e.sent,y(!1),0===t.status&&(U.ZP.info("关联成功"),qn(),dn(""),_n(!1),me.setFieldsValue({relation:null}));case 6:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:(0,ce.jsx)(H.Z.Item,{name:"relation",label:"类型",children:(0,ce.jsxs)($.default,{getPopupContainer:function(){return Te.current},placeholder:"请选择类型",children:[(0,ce.jsx)($.default.Option,{value:1,children:"关联"}),(0,ce.jsx)($.default.Option,{value:2,children:"后序"})]})})})}),yn&&(0,ce.jsxs)(h.Z,{open:yn,centered:!0,width:550,title:"查找",getContainer:function(){return Te.current},onCancel:function(){dn(""),kn(!1)},okButtonProps:{loading:w},onOk:function(){var e,n,t,i,r,o,a,l;kn(!1),null===(e=Sn.current)||void 0===e||e.clearSelection(),null===(n=bn.current)||void 0===n||n.clearSelection();var s=null===(t=bn.current)||void 0===t||null===(i=t.findNodeForKey)||void 0===i?void 0:i.call(t,un),c=null===(r=Sn.current)||void 0===r||null===(o=r.findNodeForKey)||void 0===o?void 0:o.call(r,un);null===(a=Sn.current)||void 0===a||null===(a=a.commandHandler)||void 0===a||a.scrollToPart(c),null===(l=bn.current)||void 0===l||null===(l=l.commandHandler)||void 0===l||l.scrollToPart(s),s&&(s.isSelected=!0,Dn&&(zn({left:0,top:0,bottom:0,right:0}),he(s.data))),c&&(c.isSelected=!0,Dn&&(zn({left:0,top:0,bottom:0,right:0}),he(c.data))),dn(""),tn("")},children:[(0,ce.jsx)(J.Z.Search,{size:"large",allowClear:!0,onChange:function(e){var n=e.target.value,t=fn.filter((function(e){return e.title.indexOf(n)>-1})).map((function(e){return e.key}));Ge(t),t.length<=0?An(!0):An(!1),ln(!0),tn(e.target.value)}}),Ln?(0,ce.jsx)(re.Z,{}):(0,ce.jsx)(Q.Z,{onExpand:function(e){Ge(e),ln(!1)},style:{maxHeight:400,height:400,marginTop:20,overflow:"auto"},onSelect:function(e){dn(null==e?void 0:e[0])},expandedKeys:Qe,defaultExpandAll:!0,autoExpandParent:an,treeData:$n})]})]})})),fe=(0,p.connect)((function(e){var n=e.virtualSpaces;return{globalSetting:e.globalSetting,virtualSpaces:n}}))((function(e){e.globalSetting,e.dispatch;var n,t=e.virtualSpaces,i=(0,p.useSearchParams)(),o=u()(i,1)[0],l=(0,d.useState)(!0),c=u()(l,2),T=c[0],z=c[1],R=(0,d.useState)(!1),O=u()(R,2),D=O[0],I=O[1],B=(0,d.useState)(!1),L=u()(B,2),A=L[0],M=L[1],V=(0,d.useState)({}),K=u()(V,2),H=K[0],U=K[1],q=(0,d.useState)(""),X=u()(q,2),W=X[0],$=X[1],J=(0,d.useState)(""),Q=u()(J,2),G=Q[0],Y=Q[1],ee=(0,d.useState)((null==o?void 0:o.get("active"))||"position_and_target"),ne=u()(ee,2),te=ne[0],ie=ne[1],re=t.virtualSpacesDetails,oe=(0,p.useParams)(),ae=(null==re?void 0:re.is_member)||(0,P.Ny)();(0,d.useEffect)((function(){le()}),[te]);var le=function(){var e=s()(r()().mark((function e(){var n;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return z(!0),e.next=3,(0,C.ZP)("/api/virtual_classrooms/".concat(oe.virtual_spacesId,"/knowledge_systems/show.json"),{method:"get",params:{column:te}});case 3:-1!==(null==(n=e.sent)?void 0:n.status)&&(U(a()({},n)),$((null==n?void 0:n[te])||""),Y((null==n?void 0:n[te])||"")),z(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ue=function(){var e=s()(r()().mark((function e(){var n,t;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return I(!0),(n={})[te]=W,e.next=5,(0,C.ZP)("/api/virtual_classrooms/".concat(oe.virtual_spacesId,"/knowledge_systems/edit.json"),{method:"put",body:n});case 5:-1!==(null==(t=e.sent)?void 0:t.status)&&(le(),M(!1)),I(!1);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,ce.jsxs)("section",{className:x,children:[(0,ce.jsx)(Z.YG,{value:te,onChange:function(e){e!==te&&(ie(e),M(!1))},tabBarExtraContent:ae&&(0,ce.jsxs)(ce.Fragment,{children:["position_and_target"===te&&(0,ce.jsxs)(Z.op,{onClick:function(){return M(!0)},children:[" ",(0,ce.jsx)("i",{className:"iconfont icon-bianji7 font14 mr5"}),"编辑"]}),"desc"===te&&(0,ce.jsxs)(f.Z,{align:"middle",children:[(0,ce.jsxs)(Z.op,{onClick:function(){return M(!0)},children:[" ",(0,ce.jsx)("i",{className:"iconfont icon-bianji7 font14 mr5"}),"编辑说明"]}),(0,ce.jsxs)(Z.op,{onClick:function(){p.history.push("/".concat(E.AS,"/").concat(oe.virtual_spacesId,"/knowledge/add"))},className:"ml20",children:[" ",(0,ce.jsx)("i",{className:"iconfont icon-tianjiashitixiaojiahao font14 mr5"}),"新增知识点模块"]})]}),"knowledge_graph"===te&&(0,ce.jsxs)(Z.op,{onClick:function(){return M(!0)},children:[" ",(0,ce.jsx)("i",{className:"iconfont icon-bianji7 font14 mr5"}),"编辑知识图谱"]})]}),dataSource:[{id:"position_and_target",name:"课程定位与目标"},{id:"desc",name:"课程知识点"},{id:"knowledge_graph",name:"知识图谱描述"},{id:"knowledge",name:"知识图谱"}]}),(0,ce.jsxs)(m.Z,{spinning:T,children:["desc"!==te&&(0,ce.jsx)("div",{className:"knowledge"!==te&&"mt20",children:A?(0,ce.jsxs)(ce.Fragment,{children:[(0,ce.jsx)(se.Z,{defaultvalue:G,onChange:function(e){$(e)}}),(0,ce.jsx)(Z.QD,{confirmTitle:"保存",confirmLoading:D,confirmClick:ue,cancelClick:function(){M(!1),$(H[te]||"")},cancelTitle:"取消",className:"mb25 mt20"})]}):(0,ce.jsx)(N.Z,{value:W})}),"knowledge"===te&&(0,ce.jsx)(he,{}),"desc"===te&&(0,ce.jsxs)("div",{className:v,children:[!!W&&(0,ce.jsxs)("div",{className:g,children:[(0,ce.jsx)("aside",{children:"说明"}),(0,ce.jsx)(N.Z,{value:W})]}),null==H||null===(n=H.subject_modules)||void 0===n?void 0:n.map((function(e){var n=e.members,t=n.module_content,i=n.module_name,o=n.subject_module_id;return(0,ce.jsxs)("div",{className:_,children:[(0,ce.jsxs)("div",{className:j,children:[(0,ce.jsx)("div",{className:w,children:i}),ae&&(0,ce.jsxs)("div",{className:y,children:[(0,ce.jsx)("div",{onClick:function(){return p.history.push("/".concat(E.AS,"/").concat(oe.virtual_spacesId,"/knowledge/").concat(o,"/edit"))},children:(0,ce.jsxs)("span",{className:"primary-hover",children:[(0,ce.jsx)("i",{className:"iconfont icon-bianji7 font14 mr5"}),"编辑"]})}),(0,ce.jsx)("div",{onClick:function(){return e=o,n=i,void h.Z.confirm({title:"提示",okText:"确定删除",okButtonProps:{danger:!0},icon:!1,className:F.Z.CustomTipsModalCss,cancelText:"取消",content:(0,ce.jsxs)("div",{children:[(0,ce.jsxs)("div",{children:["确认删除 ",n," 吗?"]}),(0,ce.jsx)("div",{className:"mt10",children:"删除后,将无法恢复,请谨慎操作"})]}),onOk:(t=s()(r()().mark((function n(){var t;return r()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,C.ZP)("/api/virtual_classrooms/".concat(oe.virtual_spacesId,"/knowledge_systems/").concat(e,"/del_content.json"),{method:"delete"});case 2:-1!==(null==(t=n.sent)?void 0:t.status)&&le();case 4:case"end":return n.stop()}}),n)}))),function(){return t.apply(this,arguments)})});var e,n,t},children:(0,ce.jsxs)("span",{className:"delete-hover",children:[" ",(0,ce.jsx)("i",{className:"iconfont icon-piliangshanchubeifen font14 mr5"}),"删除"]})})]})]}),(0,ce.jsxs)("div",{className:k,children:[(0,ce.jsx)("div",{children:"知识点"}),(0,ce.jsx)("div",{children:"主要内容"}),(0,ce.jsx)("div",{children:"能力目标"}),(0,ce.jsx)("div",{className:b,children:"学时"}),(0,ce.jsx)("div",{style:{marginRight:0},children:"教案"})]}),null==t?void 0:t.map((function(e,n){var t=e.knowledge_point,i=e.content,r=e.target,o=e.class_hour,a=e.lesson_plan;return(0,ce.jsxs)("div",{className:S,children:[(0,ce.jsx)("div",{children:t}),(0,ce.jsx)("pre",{children:i}),(0,ce.jsx)("pre",{children:r}),(0,ce.jsx)("div",{className:b,children:o}),(0,ce.jsx)("div",{style:{marginRight:0},children:(0,ce.jsx)(N.Z,{value:a})})]},n)}))]},o)}))]}),(0,ce.jsxs)(h.Z,{title:"编辑说明",destroyOnClose:!0,open:"desc"===te&&A,onOk:ue,centered:!0,onCancel:function(){M(!1),$(H[te]||"")},confirmLoading:D,width:686,okText:"确认",cancelText:"取消",wrapClassName:F.Z.CustomCss,children:[(0,ce.jsx)("div",{children:"说明:"}),(0,ce.jsx)(se.Z,{defaultvalue:G,onChange:function(e){$(e)}})]})]})]})}))},20570:function(e,n,t){function i(e){try{e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullScreen&&e.webkitRequestFullScreen()}catch(e){console.log(e,":e")}}function r(){window.top.document.webkitExitFullscreen?window.top.document.webkitExitFullscreen():document.exitFullscreen?window.top.document.exitFullscreen():document.msExitFullscreen?window.top.document.msExitFullscreen():document.mozCancelFullScreen&&window.top.document.mozCancelFullScreen()}t.d(n,{BU:function(){return r},Dj:function(){return i},gH:function(){return o},vp:function(){return a}});var o=function(){return document.webkitExitFullscreen?"webkitfullscreenchange":document.exitFullscreen?"fullscreenchange":document.msExitFullscreen?"msfullscreenchange":document.mozCancelFullScreen?"mozfullscreenchange":void 0};function a(){var e=window.top.document.fullscreenElement||window.top.document.mozFullscreenElement||window.top.document.webkitFullscreenElement;document.fullscreenEnabled||document.mozFullscreenEnabled||document.webkitFullscreenEnabled;return console.log("fullscreenElement",e),null!=e}},9070:function(e,n){n.Z={flex_box_center:"flex_box_center___vG4eV",flex_space_between:"flex_space_between___qVVxe",flex_box_vertical_center:"flex_box_vertical_center___P8Z8s",flex_box_center_end:"flex_box_center_end___VMme3",flex_box_column:"flex_box_column___VMHwm",dropdownmenus:"dropdownmenus___oVzoj",popupClassNames:"popupClassNames___OcZq7",selectdown:"selectdown___mmcA8"}}}]); |