(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[727],{5966:function(K,I,e){"use strict";var p=e(22122),D=e(81253),B=e(67294),l=e(64837),m=["fieldProps","proFieldProps"],R=["fieldProps","proFieldProps"],O="text",E=function(v){var a=v.fieldProps,o=v.proFieldProps,s=(0,D.Z)(v,m);return B.createElement(l.Z,(0,p.Z)({mode:"edit",valueType:O,fieldProps:a,filedConfig:{valueType:O},proFieldProps:o},s))},U=function(v){var a=v.fieldProps,o=v.proFieldProps,s=(0,D.Z)(v,R);return B.createElement(l.Z,(0,p.Z)({mode:"edit",valueType:"password",fieldProps:a,proFieldProps:o,filedConfig:{valueType:O}},s))},T=E;T.Password=U,T.displayName="ProFormComponent",I.Z=T},79667:function(K,I,e){"use strict";var p=e(3182),D=e(57337),B=e(94043),l=e.n(B),m=e(96006),R=e(67294),O=e(9265),E=e(85893),U=function(c){var v=R.useState(),a=(0,D.Z)(v,2),o=a[0],s=a[1];return R.useEffect(function(){if(!!c.value){var f=function(){var h=(0,p.Z)(l().mark(function n(){var Z,M,C,A,r;return l().wrap(function(j){for(;;)switch(j.prev=j.next){case 0:return j.next=2,(0,m.l)({id:c.value});case 2:A=j.sent,r={key:(Z=A.data)===null||Z===void 0?void 0:Z.id,label:(M=A.data)===null||M===void 0?void 0:M.name,value:(C=A.data)===null||C===void 0?void 0:C.id},s(r);case 5:case"end":return j.stop()}},n)}));return function(){return h.apply(this,arguments)}}();f()}},[c.value]),c.value&&!o?null:(0,E.jsx)(O.Z,{initOption:o,fetchOptions:function(){var f=(0,p.Z)(l().mark(function h(n){var Z,M,C;return l().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,(0,m.tc)({name:n});case 2:if(M=r.sent,!((Z=M.data)!==null&&Z!==void 0&&Z.list)){r.next=5;break}return r.abrupt("return",(C=M.data.list)===null||C===void 0?void 0:C.map(function(S){var j={label:S.name,value:S.id,key:S.id};return j}));case 5:return r.abrupt("return",void 0);case 6:case"end":return r.stop()}},h)}));return function(h){return f.apply(this,arguments)}}(),onChange:c.onChange,style:{width:"100%"}})};I.Z=U},9265:function(K,I,e){"use strict";var p=e(11849),D=e(43358),B=e(34041),l=e(20228),m=e(11382),R=e(57337),O=e(93224),E=e(23279),U=e.n(E),T=e(67294),c=e(85893);function v(a){var o=a.fetchOptions,s=a.debounceTimeout,f=s===void 0?800:s,h=a.initOption,n=(0,O.Z)(a,["fetchOptions","debounceTimeout","initOption"]),Z=T.useState(!1),M=(0,R.Z)(Z,2),C=M[0],A=M[1],r=[],S=null;h&&(r.push(h),S=h.value);var j=T.useState(r),L=(0,R.Z)(j,2),$=L[0],b=L[1],i=T.useRef(0),t=T.useMemo(function(){var P=function(_){i.current+=1;var g=i.current;b([]),A(!0),o(_).then(function(d){g===i.current&&(b(d),A(!1))})};return U()(P,f)},[o,f]);return(0,c.jsx)(B.Z,(0,p.Z)((0,p.Z)({showSearch:!0,filterOption:!1,defaultValue:S,onSearch:t,notFoundContent:C?(0,c.jsx)(m.Z,{size:"small"}):null},n),{},{options:$}))}I.Z=v},86489:function(K,I,e){"use strict";e.r(I),e.d(I,{default:function(){return $}});var p=e(57663),D=e(71577),B=e(62350),l=e(75443),m=e(3182),R=e(402),O=e(61859),E=e(11849),U=e(47673),T=e(4107),c=e(93224),v=e(94043),a=e.n(v),o=e(79667),s=e(96006),f=e(39750),h=e(67294),n=e(34792),Z=e(48086),M=e(71975),C=e(5966),A=e(90672),r=e(85893),S=function(i){var t=(0,h.useRef)();return(0,r.jsxs)(M.a,{title:i.formTitle,formRef:t,layout:"horizontal",trigger:i.trigger,autoFocusFirstInput:!0,drawerProps:{destroyOnClose:!0},onVisibleChange:function(){var P=(0,m.Z)(a().mark(function u(_){var g,d;return a().wrap(function(F){for(;;)switch(F.prev=F.next){case 0:if(!(!_||!i.authorId)){F.next=2;break}return F.abrupt("return");case 2:return F.next=4,(0,s.l)({id:i.authorId});case 4:g=F.sent,g.data&&((d=t.current)===null||d===void 0||d.setFieldsValue(g.data));case 6:case"end":return F.stop()}},u)}));return function(u){return P.apply(this,arguments)}}(),onFinish:function(){var P=(0,m.Z)(a().mark(function u(_){var g;return a().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,(0,s.xB)((0,E.Z)((0,E.Z)({},_),{},{id:i.authorId}));case 2:if(g=y.sent,!g.code){y.next=7;break}return Z.default.success("\u63D0\u4EA4\u6210\u529F"),i.refresh&&i.refresh(),y.abrupt("return",!0);case 7:return y.abrupt("return",!1);case 8:case"end":return y.stop()}},u)}));return function(u){return P.apply(this,arguments)}}(),children:[(0,r.jsx)(C.Z,{width:"md",name:"name",label:"\u540D\u5B57",placeholder:"\u8BF7\u8F93\u5165"}),(0,r.jsx)(C.Z,{width:"md",name:"dynasty",label:"\u671D\u4EE3",placeholder:"\u8BF7\u8F93\u5165"}),(0,r.jsx)(A.Z,{fieldProps:{autoSize:!0},width:"md",name:"introduction",label:"\u4ECB\u7ECD",placeholder:"\u8BF7\u8F93\u5165"})]})},j=S,L=[{dataIndex:"id",title:"id",renderFormItem:function(i,t){var P=t.type,u=t.defaultRender,_=(0,c.Z)(t,["type","defaultRender"]);return(0,r.jsx)(T.Z,(0,E.Z)({},_),"id_"+i)}},{title:"\u540D\u5B57",dataIndex:"name",ellipsis:!0,hideInSearch:!0},{title:"\u671D\u4EE3",dataIndex:"dynasty",ellipsis:!0,hideInSearch:!0},{title:"\u540D\u5B57",dataIndex:"id",hideInTable:!0,renderFormItem:function(i,t){var P=t.type,u=t.defaultRender,_=(0,c.Z)(t,["type","defaultRender"]);return(0,r.jsx)(o.Z,(0,E.Z)({},_))}},{title:"\u72B6\u6001",dataIndex:"status",valueType:"select",valueEnum:{0:{text:"\u672A\u6821\u51C6",status:"Error"},1:{text:"\u5DF2\u6821\u51C6",status:"Success"}}},{title:"\u4F5C\u54C1\u6570\u91CF",dataIndex:"poemCnt",hideInSearch:!0,render:function(i,t){return(0,r.jsx)(O.Z.Link,{target:"_blank",href:"/poem?authorId="+t.id,children:i},t.id)}},{title:"\u64CD\u4F5C",valueType:"option",key:"option",render:function(i,t,P,u){return[(0,r.jsx)(j,{authorId:t.id,formTitle:t.title||"\u7F16\u8F91",trigger:(0,r.jsx)("a",{href:"#",children:"\u7F16\u8F91"}),refresh:function(){return u==null?void 0:u.reload()}},t.id),(0,r.jsx)(l.Z,{title:"\u786E\u5B9A\u5220\u9664\u5417?",onConfirm:(0,m.Z)(a().mark(function _(){return a().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.next=2,(0,s.xB)({id:t.id,status:-1});case 2:u==null||u.reload();case 3:case"end":return d.stop()}},_)})),okText:"Yes",cancelText:"No",children:(0,r.jsx)("a",{href:"#",children:"\u5220\u9664"})},"delete"+t.id),(0,r.jsx)(l.Z,{title:"\u786E\u5B9A\u6807\u8BB0\u5417?",onConfirm:(0,m.Z)(a().mark(function _(){return a().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.next=2,(0,s.xB)({id:t.id,status:t.status==0?1:0});case 2:u==null||u.reload();case 3:case"end":return d.stop()}},_)})),okText:"Yes",cancelText:"No",children:(0,r.jsx)("a",{href:"#",children:t.status==0?"\u6821\u51C6":"\u53D6\u6D88\u6821\u51C6"})},"mark_"+t.id)]}}],$=function(){var b=(0,h.useRef)();return(0,r.jsx)(f.ZP,{columns:L,actionRef:b,cardBordered:!0,request:(0,m.Z)(a().mark(function i(){var t,P,u,_,g,d,y=arguments;return a().wrap(function(W){for(;;)switch(W.prev=W.next){case 0:return u=y.length>0&&y[0]!==void 0?y[0]:{},_=[],g=["id","name","status"],Object.keys(u).forEach(function(x){g.includes(x)&&u[x]&&_.push({key:x,val:u[x]})}),W.next=6,(0,s.DU)({current:u.current,pageSize:u.pageSize,query:_});case 6:return d=W.sent,W.abrupt("return",{data:(t=d.data)===null||t===void 0?void 0:t.list,total:(P=d.data)===null||P===void 0?void 0:P.total});case 8:case"end":return W.stop()}},i)})),columnsState:{persistenceKey:"pro-table-singe-demos",persistenceType:"localStorage"},rowKey:"id",search:{labelWidth:"auto"},pagination:{pageSize:20},form:{syncToUrl:function(t,P){return P==="get"?(0,E.Z)((0,E.Z)({},t),{},{created_at:[t.startTime,t.endTime]}):t}},headerTitle:"\u5217\u8868",dateFormatter:"string",toolBarRender:function(){return[(0,r.jsx)(j,{trigger:(0,r.jsx)(D.Z,{type:"primary",children:"\u65B0\u5EFA"}),formTitle:"\u521B\u5EFA"},"new")]}})}},96006:function(K,I,e){"use strict";e.d(I,{l:function(){return R},DU:function(){return E},xB:function(){return T},tc:function(){return v}});var p=e(11849),D=e(3182),B=e(94043),l=e.n(B),m=e(4614);function R(o,s){return O.apply(this,arguments)}function O(){return O=(0,D.Z)(l().mark(function o(s,f){return l().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,m.WY)("/api/luigi/author/get",(0,p.Z)({method:"GET",params:(0,p.Z)({},s)},f||{})));case 1:case"end":return n.stop()}},o)})),O.apply(this,arguments)}function E(o,s){return U.apply(this,arguments)}function U(){return U=(0,D.Z)(l().mark(function o(s,f){return l().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,m.WY)("/api/luigi/author/list",(0,p.Z)({method:"POST",headers:{"Content-Type":"application/json"},data:s},f||{})));case 1:case"end":return n.stop()}},o)})),U.apply(this,arguments)}function T(o,s){return c.apply(this,arguments)}function c(){return c=(0,D.Z)(l().mark(function o(s,f){return l().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,m.WY)("/api/luigi/author/save",(0,p.Z)({method:"POST",headers:{"Content-Type":"application/json"},data:s},f||{})));case 1:case"end":return n.stop()}},o)})),c.apply(this,arguments)}function v(o,s){return a.apply(this,arguments)}function a(){return a=(0,D.Z)(l().mark(function o(s,f){return l().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,m.WY)("/api/luigi/author/seek",(0,p.Z)({method:"GET",params:(0,p.Z)({},s)},f||{})));case 1:case"end":return n.stop()}},o)})),a.apply(this,arguments)}}}]);