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
11 KiB
1 lines
11 KiB
(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[816],{54679:function(re,L,e){"use strict";e.d(L,{Z:function(){return q}});var x=e(3182),O=e(57337),T=e(94043),a=e.n(T),$=e(96006),I=e(67294),u=e(11849),K=e(43358),U=e(34041),Q=e(20228),R=e(11382),V=e(93224),A=e(23279),d=e.n(A),o=e(85893);function C(z){var P=z.fetchOptions,N=z.debounceTimeout,w=N===void 0?800:N,W=z.initOption,E=(0,V.Z)(z,["fetchOptions","debounceTimeout","initOption"]),Y=I.useState(!1),b=(0,O.Z)(Y,2),G=b[0],g=b[1],y=[],j=null;W&&(y.push(W),j=W.value);var M=I.useState(y),m=(0,O.Z)(M,2),D=m[0],S=m[1],J=I.useRef(0),_=I.useMemo(function(){var X=function(r){J.current+=1;var te=J.current;S([]),g(!0),P(r).then(function(k){te===J.current&&(S(k),g(!1))})};return d()(X,w)},[P,w]);return(0,o.jsx)(U.Z,(0,u.Z)((0,u.Z)({showSearch:!0,filterOption:!1,defaultValue:j,onSearch:_,notFoundContent:G?(0,o.jsx)(R.Z,{size:"small"}):null},E),{},{options:D}))}var F=C,i=function(P){var N=I.useState(),w=(0,O.Z)(N,2),W=w[0],E=w[1];return I.useEffect(function(){if(!!P.value){var Y=function(){var b=(0,x.Z)(a().mark(function G(){var g,y,j,M,m;return a().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:return S.next=2,(0,$.l)({id:P.value});case 2:M=S.sent,m={key:(g=M.data)===null||g===void 0?void 0:g.id,label:(y=M.data)===null||y===void 0?void 0:y.name,value:(j=M.data)===null||j===void 0?void 0:j.id},E(m);case 5:case"end":return S.stop()}},G)}));return function(){return b.apply(this,arguments)}}();Y()}},[P.value]),P.value&&!W?null:(0,o.jsx)(F,{initOption:W,fetchOptions:function(){var Y=(0,x.Z)(a().mark(function b(G){var g,y,j;return a().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return m.next=2,(0,$.Jr)({name:G});case 2:if(y=m.sent,!((g=y.data)!==null&&g!==void 0&&g.list)){m.next=5;break}return m.abrupt("return",(j=y.data.list)===null||j===void 0?void 0:j.map(function(D){var S={label:D.name,value:D.id,key:D.id};return S}));case 5:return m.abrupt("return",void 0);case 6:case"end":return m.stop()}},b)}));return function(b){return Y.apply(this,arguments)}}(),onChange:P.onChange,style:{width:"100%"}})},q=i},2599:function(re,L,e){"use strict";e.r(L),e.d(L,{default:function(){return ae}});var x=e(62350),O=e(75443),T=e(3182),a=e(11849),$=e(93224),I=e(94043),u=e.n(I),K=e(54679),U=e(4614);function Q(f,s){return R.apply(this,arguments)}function R(){return R=(0,T.Z)(u().mark(function f(s,n){return u().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,U.WY)("/api/luigi/poem/detail",(0,a.Z)({method:"GET",params:(0,a.Z)({},s)},n||{})));case 1:case"end":return t.stop()}},f)})),R.apply(this,arguments)}function V(f,s){return A.apply(this,arguments)}function A(){return A=(0,T.Z)(u().mark(function f(s,n){return u().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,U.WY)("/api/luigi/poem/list",(0,a.Z)({method:"POST",headers:{"Content-Type":"application/json"},data:s},n||{})));case 1:case"end":return t.stop()}},f)})),A.apply(this,arguments)}function d(f,s){return o.apply(this,arguments)}function o(){return o=(0,T.Z)(u().mark(function f(s,n){return u().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,U.WY)("/api/luigi/poem/save",(0,a.Z)({method:"POST",headers:{"Content-Type":"application/json"},data:s},n||{})));case 1:case"end":return t.stop()}},f)})),o.apply(this,arguments)}var C=e(37006),F=e(67294),i=e(13062),q=e(71230),z=e(89032),P=e(15746),N=e(47673),w=e(4107),W=e(9715),E=e(22712),Y=e(34792),b=e(48086),G=e(57663),g=e(71577),y=e(28991),j={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M696 480H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"minus-circle",theme:"outlined"},M=j,m=e(27029),D=function(s,n){return F.createElement(m.Z,(0,y.Z)((0,y.Z)({},s),{},{ref:n,icon:M}))};D.displayName="MinusCircleOutlined";var S=F.forwardRef(D),J=e(49101),_=e(71975),X=e(5966),ee=e(90672),r=e(85893),te=function(s){var n=(0,F.useRef)();return(0,r.jsxs)(_.a,{title:s.formTitle,formRef:n,layout:"horizontal",trigger:(0,r.jsx)(g.Z,{type:"primary",children:s.triggerText}),autoFocusFirstInput:!0,drawerProps:{destroyOnClose:!0},onVisibleChange:function(){var h=(0,T.Z)(u().mark(function t(c){var Z,l;return u().wrap(function(B){for(;;)switch(B.prev=B.next){case 0:if(!(!c||!s.poemId)){B.next=2;break}return B.abrupt("return");case 2:return B.next=4,Q({id:s.poemId});case 4:Z=B.sent,Z.data&&((l=n.current)===null||l===void 0||l.setFieldsValue(Z.data));case 6:case"end":return B.stop()}},t)}));return function(t){return h.apply(this,arguments)}}(),onFinish:function(){var h=(0,T.Z)(u().mark(function t(c){var Z;return u().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,d((0,a.Z)((0,a.Z)({},c),{},{id:s.poemId}));case 2:if(Z=p.sent,!Z.code){p.next=7;break}return b.default.success("\u63D0\u4EA4\u6210\u529F"),s.refresh&&s.refresh(),p.abrupt("return",!0);case 7:return p.abrupt("return",!1);case 8:case"end":return p.stop()}},t)}));return function(t){return h.apply(this,arguments)}}(),children:[(0,r.jsx)(X.Z,{width:"md",name:"title",label:"\u6807\u9898",placeholder:"\u8BF7\u8F93\u5165"}),(0,r.jsx)(E.Z.Item,{style:{width:"40%"},label:(0,r.jsx)("span",{children:"\u4F5C\u8005"}),name:"authorId",shouldUpdate:!0,children:(0,r.jsx)(K.Z,{})}),(0,r.jsx)(ee.Z,{fieldProps:{autoSize:!0},width:"md",name:"content",label:"\u5185\u5BB9",placeholder:"\u8BF7\u8F93\u5165"}),(0,r.jsx)(X.Z,{width:"md",name:"line",label:"\u9996\u884C",placeholder:"\u8BF7\u8F93\u5165"}),(0,r.jsx)(ee.Z,{fieldProps:{autoSize:!0},width:"md",name:"translation",label:"\u7FFB\u8BD1",placeholder:"\u8BF7\u8F93\u5165"}),(0,r.jsx)(E.Z.List,{name:"noteList",children:function(t,c,Z){var l=c.add,p=c.remove,B=Z.errors;return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(E.Z.Item,{label:"\u6CE8\u89E3",required:!1,children:[t.map(function(v){return(0,r.jsxs)(q.Z,{style:{marginBottom:"20px"},justify:"space-between",children:[(0,r.jsx)(P.Z,{span:10,children:(0,r.jsx)(E.Z.Item,(0,a.Z)((0,a.Z)({},v),{},{label:"\u5F15\u6587",name:[v.name,"citation"],validateTrigger:["onChange","onBlur"],rules:[{required:!0,whitespace:!0,message:"\u5F15\u6587\u4E0D\u80FD\u4E3A\u7A7A"}],noStyle:!0,children:(0,r.jsx)(w.Z,{placeholder:"\u5F15\u6587"})}))}),(0,r.jsx)(P.Z,{span:10,children:(0,r.jsx)(E.Z.Item,(0,a.Z)((0,a.Z)({},v),{},{label:"\u6CE8\u91CA",name:[v.name,"annotation"],validateTrigger:["onChange","onBlur"],rules:[{required:!0,whitespace:!0,message:"\u6CE8\u91CA\u4E0D\u80FD\u4E3A\u7A7A"}],noStyle:!0,children:(0,r.jsx)(w.Z,{placeholder:"\u6CE8\u91CA"})}))}),t.length>0?(0,r.jsx)(S,{className:"dynamic-delete-button",onClick:function(){return p(v.name)}}):null]},v.key)}),(0,r.jsxs)(E.Z.Item,{children:[(0,r.jsx)(g.Z,{type:"dashed",onClick:function(){return l()},style:{width:"60%"},icon:(0,r.jsx)(J.Z,{}),children:"\u6DFB\u52A0\u6CE8\u89E3"}),(0,r.jsx)(E.Z.ErrorList,{errors:B})]})]})})}})]})},k=te,ne=[{dataIndex:"id",title:"id"},{title:"\u6807\u9898",dataIndex:"title",ellipsis:!0,tip:"\u6807\u9898\u8FC7\u957F\u4F1A\u81EA\u52A8\u6536\u7F29",formItemProps:{rules:[{required:!0,message:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879"}]}},{title:"\u72B6\u6001",dataIndex:"status",valueType:"select",valueEnum:{0:{text:"\u672A\u6821\u51C6",status:"Error"},1:{text:"\u5DF2\u6821\u51C6",status:"Success"}}},{title:"\u4F5C\u8005",dataIndex:"authorName",hideInSearch:!0},{title:"\u4F5C\u8005",dataIndex:"authorId",hideInTable:!0,formItemProps:{rules:[{required:!0,message:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879"}]},renderFormItem:function(s,n){var h=n.type,t=n.defaultRender,c=(0,$.Z)(n,["type","defaultRender"]);return(0,r.jsx)(K.Z,(0,a.Z)({},c))}},{title:"\u64CD\u4F5C",valueType:"option",key:"option",render:function(s,n,h,t){return[(0,r.jsx)(k,{poemId:n.id,formTitle:n.title||"\u7F16\u8F91",triggerText:"\u7F16\u8F91",refresh:function(){return t==null?void 0:t.reload()}},n.id),(0,r.jsx)(O.Z,{title:"\u786E\u5B9A\u5220\u9664\u5417?",onConfirm:(0,T.Z)(u().mark(function c(){return u().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,d({id:n.id,status:-1});case 2:t==null||t.reload();case 3:case"end":return l.stop()}},c)})),okText:"Yes",cancelText:"No",children:(0,r.jsx)("a",{href:"#",children:"\u5220\u9664"})},"delete"+n.id),(0,r.jsx)(O.Z,{title:"\u786E\u5B9A\u6807\u8BB0\u5417?",onConfirm:(0,T.Z)(u().mark(function c(){return u().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,d({id:n.id,status:n.status==0?1:0});case 2:t==null||t.reload();case 3:case"end":return l.stop()}},c)})),okText:"Yes",cancelText:"No",children:(0,r.jsx)("a",{href:"#",children:n.status==0?"\u6821\u51C6":"\u53D6\u6D88\u6821\u51C6"})},"mark_"+n.id)]}}],ae=function(){var f=(0,F.useRef)();return(0,r.jsx)(C.ZP,{columns:ne,actionRef:f,cardBordered:!0,request:(0,T.Z)(u().mark(function s(){var n,h,t,c,Z,l,p=arguments;return u().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return t=p.length>0&&p[0]!==void 0?p[0]:{},c=[],Z=["authorId","title","status","id"],Object.keys(t).forEach(function(H){Z.includes(H)&&t[H]&&c.push({key:H,val:t[H]})}),v.next=6,V({current:t.current,pageSize:t.pageSize,query:c});case 6:return l=v.sent,v.abrupt("return",{data:(n=l.data)===null||n===void 0?void 0:n.list,total:(h=l.data)===null||h===void 0?void 0:h.total});case 8:case"end":return v.stop()}},s)})),columnsState:{persistenceKey:"pro-table-singe-demos",persistenceType:"localStorage"},rowKey:"id",search:{labelWidth:"auto"},pagination:{pageSize:20},form:{syncToUrl:function(n,h){return h==="get"?(0,a.Z)((0,a.Z)({},n),{},{created_at:[n.startTime,n.endTime]}):n}},headerTitle:"\u5217\u8868",dateFormatter:"string",toolBarRender:function(){return[(0,r.jsx)(k,{triggerText:"\u65B0\u5EFA",formTitle:"\u521B\u5EFA"},"new")]}})}},96006:function(re,L,e){"use strict";e.d(L,{l:function(){return I},DU:function(){return K},xB:function(){return Q},Jr:function(){return V}});var x=e(11849),O=e(3182),T=e(94043),a=e.n(T),$=e(4614);function I(d,o){return u.apply(this,arguments)}function u(){return u=(0,O.Z)(a().mark(function d(o,C){return a().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",(0,$.WY)("/api/luigi/author/get",(0,x.Z)({method:"GET",params:(0,x.Z)({},o)},C||{})));case 1:case"end":return i.stop()}},d)})),u.apply(this,arguments)}function K(d,o){return U.apply(this,arguments)}function U(){return U=(0,O.Z)(a().mark(function d(o,C){return a().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",(0,$.WY)("/api/luigi/author/list",(0,x.Z)({method:"POST",headers:{"Content-Type":"application/json"},data:o},C||{})));case 1:case"end":return i.stop()}},d)})),U.apply(this,arguments)}function Q(d,o){return R.apply(this,arguments)}function R(){return R=(0,O.Z)(a().mark(function d(o,C){return a().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",(0,$.WY)("/api/luigi/author/save",(0,x.Z)({method:"POST",headers:{"Content-Type":"application/json"},data:o},C||{})));case 1:case"end":return i.stop()}},d)})),R.apply(this,arguments)}function V(d,o){return A.apply(this,arguments)}function A(){return A=(0,O.Z)(a().mark(function d(o,C){return a().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",(0,$.WY)("/api/luigi/author/seek",(0,x.Z)({method:"GET",params:(0,x.Z)({},o)},C||{})));case 1:case"end":return i.stop()}},d)})),A.apply(this,arguments)}}}]);
|
|
|