"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[330],{57759:function(ae,B,t){var W=t(59530),u=t(55375),o=t(68872),I=t(80876),g=t(86074),L=function(c){var m=c.onUploadComplete,P=c.uploadTxt,M=c.form_name,O=function(A){m&&m(A)};return(0,g.jsx)(g.Fragment,{children:(0,g.jsx)(I.Z,{label:P,name:M,icon:null,fieldProps:{fileList:[],listType:"picture-card",showUploadList:!1,customRequest:function(A){var D=new FormData;D.append("doc",A.file),console.log(D),(0,W.request)(u.FH+"/common/doc/upload?doctype=1",{method:"post",data:D,Headers:{Authorization:sessionStorage.getItem("token"),"X-Requested-With":null}}).then(function(C){O(C.data.filename)}).catch(function(C){console.log(C),o.ZP.error("\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u6587\u4EF6\u7C7B\u578B\uFF0C\u5982\u6709\u7591\u95EE\uFF0C\u8BF7\u54A8\u8BE2\u7BA1\u7406\u5458")})}}})})};B.Z=L},67562:function(ae,B,t){var W=t(5574),u=t.n(W),o=t(71167),I=t.n(o),g=t(40190),L=t(62435),d=t(86074),c=function(P){var M=P.defaultValue,O=P.placeholder,S=P.onChange,A=(0,L.useState)(M),D=u()(A,2),C=D[0],p=D[1],f=function(Y){p(Y),S(Y)};return(0,L.useEffect)(function(){if(M){var e=M.replace(/<[^>]*>/g,"");f(e?M:"")}},[M]),(0,d.jsx)("div",{children:(0,d.jsx)(I(),{bounds:document.body,modules:{toolbar:[["bold","italic","underline","strike"],["blockquote","code-block"],[{list:"ordered"},{list:"bullet"}],[{indent:"-1"},{indent:"+1"}],[{size:["small",!1,"large","huge"]}],[{header:[1,2,3,4,5,6,!1]}],[{color:[]},{background:[]}],[{align:[]}],["clean"],["link","image","video"]]},value:C,onChange:f,theme:"snow",placeholder:O})})};B.Z=c},67119:function(ae,B,t){var W=t(59530),u=t(55375),o=t(68872),I=t(32443),g=t(86074),L=function(c){var m=c.onUploadComplete,P=c.uploadTxt,M=c.image_type,O=c.form_name,S=c.image_length,A=c.multiple,D=function(p){m&&m(p)};return(0,g.jsx)(g.Fragment,{children:(0,g.jsx)(I.Z,{label:P,name:O,icon:null,title:P,fieldProps:{maxCount:S,multiple:A,fileList:[],listType:"picture-card",showUploadList:!1,customRequest:function(p){var f=new FormData;f.append("image",p.file),console.log(f),(0,W.request)(u.FH+"/common/image/upload?imgtype="+M,{method:"post",data:f,Headers:{Authorization:sessionStorage.getItem("token"),"X-Requested-With":null}}).then(function(e){D(e.data.filename)}).catch(function(e){console.log(e),o.ZP.error("\u4E0A\u4F20\u5931\u8D25")})}}})})};B.Z=L},46791:function(ae,B,t){t.r(B),t.d(B,{default:function(){return Te}});var W=t(5574),u=t.n(W),o=t(62435),I=t(59530),g=t(28459),L=t(15009),d=t.n(L),c=t(99289),m=t.n(c),P=t(67211),M=t(64317),O=t(98163),S=t(66309),A=t(14726),D=t(86738),C=t(68872),p=t(39680),f=t(55375),e=t(86074),Y={label:"name",value:"id",children:"childs"},de=function(r){var h=r.dispatch,y=r.openModel,z=r.getId,v=(0,o.useRef)(),N=(0,o.useState)([]),K=u()(N,2),V=K[0],w=K[1],$=(0,o.useState)(0),k=u()($,2),q=k[0],Z=k[1],b=(0,o.useState)(1),ee=u()(b,2),G=ee[0],U=ee[1],H=(0,o.useState)(10),X=u()(H,2),te=X[0],J=X[1],ne=function(s){z(s)};return(0,o.useEffect)(function(){y.openModal||v.current.reload()},[y.openModal]),(0,e.jsx)(e.Fragment,{children:(0,e.jsx)(g.ZP,{theme:{token:{colorPrimary:"#4FBE70",colorLink:"#4FBE70"}},children:(0,e.jsx)(P.Z,{size:"small",bordered:!0,scroll:{x:1300},actionRef:v,dataSource:V,columns:[{title:"ID",dataIndex:"id",width:100,search:!1},{title:"\u6587\u7AE0\u540D",dataIndex:"title",width:400},{title:"\u6240\u5C5E\u680F\u76EE",dataIndex:"section_name",search:!1},{title:"\u6240\u5C5E\u680F\u76EE",dataIndex:"section_id",hidden:!0,valueType:"select",renderFormItem:function(){return(0,e.jsx)(M.Z,{width:"lg",fieldProps:{fieldNames:Y},request:function(){var s=m()(d()().mark(function a(Q){return d()().wrap(function(T){for(;;)switch(T.prev=T.next){case 0:return T.abrupt("return",(0,p.DGC)({page:1,pagesize:100,keyword:Q.keyWords}).then(function(i){return i.data.sections}));case 1:case"end":return T.stop()}},a)}));return function(a){return s.apply(this,arguments)}}(),placeholder:"\u8BF7\u9009\u62E9\u6240\u5C5E\u680F\u76EE"})}},{title:"\u5C01\u9762\u56FE",dataIndex:"cover_img",search:!1,render:function(s,a){return(0,e.jsx)(e.Fragment,{children:(0,e.jsx)(O.Z,{src:"".concat(f.VO).concat(a.cover_img),width:40,height:40})})}},{title:"\u7F6E\u9876",dataIndex:"stick_top",search:!1,render:function(s,a){return(0,e.jsx)(e.Fragment,{children:(0,e.jsx)(e.Fragment,{children:a.stick_top===1?(0,e.jsx)(S.Z,{color:"green",children:"\u7F6E\u9876"}):(0,e.jsx)(S.Z,{children:"\u672A\u7F6E\u9876"})})})}},{title:"\u70ED\u95E8",dataIndex:"hot",search:!1,render:function(s,a){return(0,e.jsx)(e.Fragment,{children:(0,e.jsx)(e.Fragment,{children:a.hot===1?(0,e.jsx)(S.Z,{children:"\u666E\u901A"}):(0,e.jsx)(S.Z,{color:"red",children:"\u70ED\u95E8\u63A8\u8350"})})})}},{title:"\u4F5C\u8005",dataIndex:"author",search:!1},{title:"\u64CD\u4F5C",width:300,key:"option",valueType:"option",fixed:"right",render:function(s,a,Q){return[(0,e.jsx)(A.ZP,{type:"link",onClick:function(){ne(a.id),h({type:"openModel/getOpenModal",payload:!0})},children:"\u7F16\u8F91"},"1"),(0,e.jsx)(D.Z,{title:"\u662F\u5426\u5220\u9664",onConfirm:function(T){(0,p.bb3)({id:a.id}).then(function(i){C.ZP.success("\u5220\u9664\u6210\u529F"),v.current.reload()})},okText:"\u5220\u9664",cancelText:"\u53D6\u6D88",children:(0,e.jsx)("a",{children:"\u5220\u9664"},"delete")})]}}],rowKey:"id",pagination:{current:G,pageSize:te,showSizeChanger:!0,total:q,pageSizeOptions:[9,18,27,99],onChange:function(s,a){U(s),J(a)},onShowSizeChange:function(s,a){U(s),J(a)}},request:m()(d()().mark(function E(){var s,a=arguments;return d()().wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return s=a.length>0&&a[0]!==void 0?a[0]:{},R.abrupt("return",(0,p.jCA)({page:G,pagesize:te,sort:"id",sortby:"desc",keyword:s.name,section_id:s.section_id}).then(function(T){w(T.data.articles),Z(T.data.total)}));case 2:case"end":return R.stop()}},E)})),headerTitle:"\u6587\u7AE0\u5217\u8868",toolBarRender:function(){return[(0,e.jsx)(A.ZP,{type:"primary",onClick:function(){h({type:"openModel/getOpenModal",payload:!0})},children:"\u6DFB\u52A0\u6587\u7AE0"})]}})})})},ue=(0,I.connect)(function(j){var r=j.openModel;return{openModel:r}})(de),ce=t(97269),re=t(5966),he=t(52688),me=t(8214),pe=t(19109),fe=t(97462),le=t(21134),ge=t(17788),ve=t(86250),Ee=t(42075),se=t(71230),_=t(15746),xe=t(22015),Me=t(23323),ie=t(67119),Ce=t(57759),je=t(67562),ye=t(52677),Fe=t.n(ye),Ze=function(r,h){var y=!1;return y=r.includes(h),y},Pe=function(r,h){return r.every(function(y){return Fe()(y)===h})},Ue={label:"name",value:"id"},Oe={label:"name",value:"id",children:"childs"},Se=function(r){var h=r.dispatch,y=r.dictModel,z=r.openModel,v=r.id,N=(0,o.useRef)(),K=(0,o.useState)(!1),V=u()(K,2),w=V[0],$=V[1],k=(0,o.useState)(null),q=u()(k,2),Z=q[0],b=q[1];(0,o.useEffect)(function(){$(z.openModal)},[z.openModal]);var ee=(0,o.useState)(""),G=u()(ee,2),U=G[0],H=G[1],X=function(l){H(l)},te=(0,o.useState)(!1),J=u()(te,2),ne=J[0],E=J[1],s=(0,o.useState)(""),a=u()(s,2),Q=a[0],R=a[1],T=function(l){R(l)};return(0,e.jsx)(e.Fragment,{children:(0,e.jsx)(g.ZP,{theme:{token:{colorPrimary:"#4FBE70"}},children:(0,e.jsx)(ge.Z,{open:w,title:v?"\u7F16\u8F91\u6587\u7AE0":"\u6DFB\u52A0\u6587\u7AE0",centered:!0,maskClosable:!1,footer:null,destroyOnClose:!0,width:1e3,onCancel:function(){h({type:"openModel/getOpenModal",payload:!1})},children:(0,e.jsxs)(ce.A,{formRef:N,request:m()(d()().mark(function i(){var l;return d()().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:if(!v){x.next=10;break}return x.next=3,(0,p.USp)({id:v});case 3:return l=x.sent,H(l.data.cover_img),l.data.section_arr=[l.data.section_name],b(l.data),x.abrupt("return",l.data);case 10:return b(null),H(""),x.abrupt("return",{title:"",cover_img:"",doc_url:"",section_id:null,content:"",stick_top:0,hot:0,author:""});case 13:case"end":return x.stop()}},i)})),submitter:{searchConfig:{resetText:"\u53D6\u6D88",submitText:"\u4FDD\u5B58"},render:function(l,n){return(0,e.jsxs)(ve.Z,{justify:"flex-end",children:[" ",(0,e.jsx)(Ee.Z,{children:n})]})},onReset:function(){b(null),h({type:"openModel/getOpenModal",payload:!1})}},onFinish:function(){var i=m()(d()().mark(function l(n){var x,oe;return d()().wrap(function(F){for(;;)switch(F.prev=F.next){case 0:if(n.cover_img=U||"",!v){F.next=11;break}return n.id=v,Pe(n.section_arr,"string")?n.section_id=Z==null?void 0:Z.section_id:(n.section_id=n.section_arr.length>0?n.section_arr[n.section_arr.length-1]:0,delete n.section_arr),F.next=6,(0,p.XcO)(n);case 6:x=F.sent,C.ZP.success("\u63D0\u4EA4\u6210\u529F"),h({type:"openModel/getOpenModal",payload:!1}),F.next=18;break;case 11:return n.section_id=n.section_arr.length>0?n.section_arr[n.section_arr.length-1]:0,delete n.section_arr,F.next=15,(0,p.qMy)(n);case 15:oe=F.sent,C.ZP.success("\u63D0\u4EA4\u6210\u529F"),h({type:"openModel/getOpenModal",payload:!1});case 18:case"end":return F.stop()}},l)}));return function(l){return i.apply(this,arguments)}}(),children:[(0,e.jsx)(re.Z,{label:"\u6587\u7AE0\u6807\u9898",name:"title",placeholder:"\u8BF7\u8F93\u5165\u6587\u7AE0\u6807\u9898",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u7AE0\u6807\u9898"}]}),(0,e.jsx)(se.Z,{gutter:[16,16],children:Z?(0,e.jsxs)(_.Z,{span:24,style:{display:"flex"},children:[(0,e.jsx)(ie.Z,{multiple:!1,form_name:"cover_img",image_length:1,uploadTxt:"\u4E0A\u4F20\u5C01\u9762\u56FE",image_type:3,onUploadComplete:X}),U?(0,e.jsx)(O.Z,{src:"".concat(f.VO).concat(U),style:{marginLeft:"16px",marginTop:"32px",width:"100px",height:"100px"}}):(0,e.jsx)(O.Z,{src:"".concat(f.VO).concat(Z==null?void 0:Z.cover_img),style:{marginLeft:"16px",marginTop:"32px",width:"100px",height:"100px"}})]}):(0,e.jsx)(e.Fragment,{children:(0,e.jsxs)(_.Z,{span:24,style:{display:"flex"},children:[(0,e.jsx)(ie.Z,{multiple:!1,form_name:"cover_img",image_length:1,uploadTxt:"\u4E0A\u4F20\u5C01\u9762\u56FE",image_type:3,onUploadComplete:X}),U?(0,e.jsxs)(_.Z,{span:8,children:[" ",(0,e.jsx)(O.Z,{src:"".concat(f.VO).concat(U),style:{marginTop:"32px",width:"100px",height:"100px"}})," "]}):""]})})}),(0,e.jsx)(he.Z,{fieldProps:{checked:ne,checkedChildren:"\u5173\u95ED\u4E0A\u4F20\u6587\u4EF6",unCheckedChildren:"\u5F00\u542F\u4E0A\u4F20\u6587\u4EF6",onChange:function(l){E(l)}}}),ne&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ce.Z,{form_name:"doc_url",uploadTxt:"\u4E0A\u4F20\u6587\u4EF6",onUploadComplete:T}),(0,e.jsxs)(xe.Z.Paragraph,{copyable:!0,children:["\u94FE\u63A5\uFF1A","".concat(f.VO).concat(Q)]})]}),(0,e.jsx)(me.Z,{label:"\u680F\u76EE/\u9891\u9053",name:"section_arr",fieldProps:{fieldNames:Oe,changeOnSelect:!0},placeholder:"\u8BF7\u9009\u62E9\u680F\u76EE/\u9891\u9053",request:function(l){return(0,p.DGC)({page:1,pagesize:100,keyword:l.keyWords}).then(function(n){return n.data.sections})}}),(0,e.jsx)(se.Z,{gutter:[16,16],children:(0,e.jsx)(_.Z,{span:24,children:(0,e.jsx)(Me.Z.Item,{name:"content",label:"\u6587\u7AE0\u5185\u5BB9",rules:[{required:!0}],children:(0,e.jsx)(pe.i$,{children:function(){return(0,e.jsx)(fe.Z,{name:["content"],children:function(n,x){var oe=n.content;return(0,e.jsx)(je.Z,{placeholder:"\u8BF7\u8F93\u5165\u6587\u7AE0\u5185\u5BB9",defaultValue:oe,onChange:function(F){x.formRef.current.setFieldsValue({content:F})}})}})}})})})}),(0,e.jsx)(le.Z,{name:"stick_top",label:"\u662F\u5426\u7F6E\u9876",request:m()(d()().mark(function i(){return d()().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",[{label:"\u662F",value:1},{label:"\u5426",value:2}]);case 1:case"end":return n.stop()}},i)})),rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u662F\u5426\u7F6E\u9876"}]}),(0,e.jsx)(le.Z,{name:"hot",label:"\u6210\u4E3A\u70ED\u95E8",request:m()(d()().mark(function i(){return d()().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",[{label:"\u666E\u901A",value:1},{label:"\u70ED\u95E8\u63A8\u8350",value:2}]);case 1:case"end":return n.stop()}},i)})),rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u662F\u5426\u6210\u4E3A\u70ED\u95E8"}]}),(0,e.jsx)(re.Z,{name:"author",label:"\u4F5C\u8005",placeholder:"\u8BF7\u8F93\u5165\u4F5C\u8005"})]})})})})},Ae=(0,I.connect)(function(j){var r=j.dictModel,h=j.openModel;return{dictModel:r,openModel:h}})(Se),De=function(r){var h=r.dispatch,y=r.openModel,z=(0,o.useState)(0),v=u()(z,2),N=v[0],K=v[1],V=function($){K($)};return(0,o.useEffect)(function(){y.openModal||K(0)},[y.openModal]),(0,e.jsx)(e.Fragment,{children:(0,e.jsxs)(g.ZP,{theme:{token:{colorPrimary:"#4FBE70"}},children:[(0,e.jsx)(ue,{getId:V}),(0,e.jsx)(Ae,{id:N})]})})},Te=(0,I.connect)(function(j){var r=j.openModel;return{openModel:r}})(De)}}]);