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.

2 lines
8.2 KiB

3 years ago
(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,hide