You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1 lines
8.2 KiB

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