2 lines
7.1 KiB
JavaScript
2 lines
7.1 KiB
JavaScript
(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[44171],{8212:function(C,f,s){"use strict";s.d(f,{Z:function(){return W}});var P=s(28991),p=s(67294),A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"}}]},name:"edit",theme:"outlined"},I=A,b=s(27029),M=function(T,y){return p.createElement(b.Z,(0,P.Z)((0,P.Z)({},T),{},{ref:y,icon:I}))};M.displayName="EditOutlined";var W=p.forwardRef(M)},99026:function(C){C.exports={root:"root___5nrfZ",colorWeak:"colorWeak___kupbm","ant-layout":"ant-layout___1DD9B",globalSpin:"globalSpin___3uQ9r","ant-table":"ant-table___1sDrd","ant-table-thead":"ant-table-thead___2H8Ay","ant-table-tbody":"ant-table-tbody___2ZNQk",formBox:"formBox___Vglm1",hrefModal:"hrefModal___1AVcP",hoverClick:"hoverClick___2HAJP",shop:"shop___3b4U5"}},44171:function(C,f,s){"use strict";s.r(f),s.d(f,{default:function(){return J}});var P=s(71194),p=s(50146),A=s(66456),I=s(5322),b=s(57663),M=s(71577),W=s(48736),x=s(27049),T=s(34792),y=s(48086),ta=s(47673),k=s(4107),Z=s(67294),B=s(8212),H=s(28216),w=s(89256),F=s(56173),S=s(30672),$=s(99026),O=s.n($),n=s(85893),K,R,sa=k.Z.TextArea,J=(K=(0,H.$j)(L=>{var r=L.commondesign,c=L.globaldesign;return{commondesign:r,globaldesign:c}}),K(R=class extends Z.PureComponent{constructor(){super(...arguments);this.state={visible:!1,navList:[{name:"\u9996\u9875",href:{name:"\u9996\u9875",url:"/",data:'{"data":{"designId":"home","url":"/"},"hrefType":"page","openMode":"_blank"}'},iconImg:"",nid:0}],showEdit:99},this.updataDomCallBack=r=>{for(var c=this,_=this.props.commondesign,m=_.MagicNav,v=m.element,u=m.callback,D=m.callClose,U=_.designId,l='<div class="navContent">',E=0,N=r.list.length;E<N;E++){var g=r.list[E];l+='<li ><a href="'.concat(g.href.url,'"><div class="mgicon" style="background-image: url(').concat(g.iconImg,')"></div> <p class="mgtext">').concat(g.name,"</p></a></li>")}l+="</div>",v.css({height:"auto"}),v.html(l),v.attr("data-MagicNav",JSON.stringify(r)),v.attr("data-audition",r.audition.join(","))},this.show=r=>{r?(r=JSON.parse(r),this.setState({navList:r.list})):this.setState({navList:[{name:"\u9996\u9875",href:{name:"\u9996\u9875",url:"/",data:'{"data":{"designId":"home","url":"/"},"hrefType":"page","openMode":"_blank"}'},iconImg:"",nid:0}]}),this.setState({visible:!0,showEdit:99})},this.cancelEvent=()=>{var r=this,c=this.props.dispatch;c({type:"commondesign/setState",payload:{MagicNav:{visible:!1,callback:()=>{},callClose:()=>{}}}})}}componentDidMount(){var r=this.props.commondesign,c=r.MagicNav,_=c.visible,m=c.element,v=c.callback,u=c.callClose;this.setState({visible:_});var D=m.attr("data-MagicNav");this.show(D)}render(){var r=this,c=r.props,_=c.dispatch,m=c.commondesign,v=m.MagicNav.callback,u=r.state,D=u.visible,U=u.showEdit,l=u.navList,E=(0,S.lw)((0,S.Kd)()),N=o=>{var a={list:l},e=[];Array.from(l).forEach(t=>{var i=t.href.url||"";i.indexOf("/common/audition.html")>-1&&e.push((0,w.jS)("courseWareId",i))}),a.audition=e,r.updataDomCallBack(a),v&&v(a),this.cancelEvent()},g=()=>{this.cancelEvent()},z=()=>{if(l.length>=20)return y.ZP.warning("\u5BFC\u822A\u4E0D\u80FD\u8D85\u8FC720\u4E2A"),!1;for(var o={},a=0,e=l.length;a<e;a++){var t=l[a];o["n"+t.nid]=!0}for(var i=l.length,d=0,h=l.length;d<h;d++)o["n"+d]||(i=d);this.setState({navList:[...l,{name:"\u5BFC\u822A\u540D\u79F0",href:{name:"\u5BFC\u822A\u94FE\u63A5",url:""},iconImg:"",after:"",nid:i}]})},V=(o,a,e)=>{this.setState({showEdit:e})},Q=(o,a,e)=>{l[e].name=o.target.value,this.setState({showEdit:99,navList:l})},na=o=>{var a=o.courseWareType+"",e=o.courseWareId,t="",i=!1;switch(a){case"1":i=!0;break;case"2":i=!0;break;case"3":i=!0;break;case"4":i=!0;break;case"5":i=!0;break;default:i=!1}return t=i?"/liveclass/wap/livecourse.html?cwid=".concat(e):"/views/wap/course_wap.html?cwid=".concat(e),t},G=(o,a,e)=>{_({type:"commondesign/setState",payload:{Href:{visible:!0,type:{course:!0,information:!0,link:!0,dialog:!0,page:!0,member:!0,shop:!0,forum:!0,question:!0},typex:!1,callback:t=>{var i=t.data,d=(0,F.wS)(t,r),h=d.url,j=l[e].href;j.name=i.title||i.courseName||i.typeName||i.courseWareName||i.classifyName||i.vipName||i.shopName||i.name||h,j.url=h,j.data=JSON.stringify(t),this.setState({navList:[...l]})}}}})},X=(o,a,e)=>{window.fileBoxApi.fileSelect({title:E.formatMessage({id:"explorer.selectImage"}),type:"file",single:!0,allowExt:"jpg,jpeg,png",callback:function(i){var d=i.data||{},h=d.selectIds.length?d.selectItems||[]:[];h.length&&(l[e].iconImg=h[0].path,r.setState({navList:[...l]}))}})},Y=(o,a,e)=>{var t=l.splice(e,1)[0];l.splice(e-1,0,t),this.setState({navList:[...l]})},q=(o,a,e)=>{var t=l.splice(e,1)[0];l.splice(e+1,0,t),this.setState({navList:[...l]})},aa=(o,a,e)=>{l.splice(e,1),this.setState({navList:[...l]})},ea=[{title:"\u5BFC\u822A\u56FE\u6807",key:"iconImg",render:(o,a,e)=>(0,n.jsxs)("div",{className:O().hoverClick,onClick:t=>X(t,a,e),children:[(0,n.jsx)("div",{className:"place",style:{backgroundImage:"url(".concat(a.iconImg,")")},children:a.iconImg?"":"\u65E0\u56FE"}),(0,n.jsx)(B.Z,{})]})},{title:"\u5BFC\u822A\u540D\u79F0",key:"name",width:"20%",render:(o,a,e)=>(0,n.jsx)("div",{className:O().hoverClick,children:U==e?(0,n.jsx)(k.Z,{onBlur:t=>Q(t,a,e),autoFocus:!0,defaultValue:a.name,maxLength:6}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{onClick:t=>V(t,a,e),title:a.name,className:"name",children:a.name?a.name:"\u672A\u547D\u540D"}),(0,n.jsx)(B.Z,{})]})})},{title:"\u94FE\u63A5",key:"href",width:"35%",render:(o,a,e)=>(0,n.jsxs)("div",{className:O().hoverClick,children:[(0,n.jsx)("span",{children:(0,n.jsx)("span",{onClick:t=>G(t,a,e),title:a.href.name,className:"name",style:{maxWidth:140},children:a.href.name?a.href.name:"\u5BFC\u822A\u94FE\u63A5"})}),(0,n.jsx)(B.Z,{})]})},{title:"\u64CD\u4F5C",key:"action",render:(o,a,e)=>(0,n.jsxs)("div",{className:"actionBox",children:[e!=0?(0,n.jsx)("a",{onClick:t=>Y(t,a,e),children:"\u4E0A\u79FB"}):(0,n.jsx)("span",{className:"disabled",children:"\u4E0A\u79FB"}),(0,n.jsx)(x.Z,{type:"vertical"}),e!=l.length-1?(0,n.jsx)("a",{onClick:t=>q(t,a,e),children:"\u4E0B\u79FB"}):(0,n.jsx)("span",{className:"disabled",children:"\u4E0B\u79FB"}),(0,n.jsx)(x.Z,{type:"vertical"}),a.nid==0?(0,n.jsx)("span",{className:"disabled",children:"\u5220\u9664"}):(0,n.jsx)("a",{onClick:t=>aa(t,a,e),children:"\u5220\u9664"})]})}];return(0,n.jsx)(p.Z,{title:"\u91D1\u521A\u533A",visible:D,onOk:N,width:680,onCancel:g,maskClosable:!1,className:O().hrefModal,children:(0,n.jsx)("div",{className:"divRow",children:(0,n.jsxs)("div",{className:"content magicNavBox",style:{padding:"0 20px"},children:[(0,n.jsx)("div",{style:{textAlign:"right",marginBottom:16},children:(0,n.jsx)(M.Z,{onClick:z,children:"+ \u6DFB\u52A0"})}),(0,n.jsx)(I.Z,{rowKey:o=>o.nid,columns:ea,dataSource:l,pagination:!1})]})})})}})||R)}}]);
|