您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

2 行
7.2 KiB

  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[3324,1322],{7696:function(ue,D,r){"use strict";r.r(D),r.d(D,{default:function(){return q}});var le=r(57663),R=r(71577),se=r(62350),G=r(24565),j=r(2824),s=r(39428),oe=r(34792),v=r(48086),m=r(3182),V=r(49101),p=r(67294),k=r(78009),W=r(16894),ie=r(71194),M=r(50146),de=r(9715),y=r(55843),ce=r(47673),T=r(4107),he=r(43358),w=r(34041),a=r(85893),Y=function(e){var l,n,t=w.Z.Option,h=w.Z.OptGroup;return(0,a.jsx)(M.Z,{title:e!=null&&(l=e.values)!==null&&l!==void 0&&l.id?"\u7F16\u8F91":"\u65B0\u5EFA",width:640,visible:e==null?void 0:e.createModalVisible,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){e==null||e.onCancel()},destroyOnClose:!0,maskClosable:!1,children:(0,a.jsxs)(y.Z,{layout:"vertical",preserve:!1,initialValues:e==null?void 0:e.values,onFinish:e==null?void 0:e.onFinish,children:[(0,a.jsx)(y.Z.Item,{name:"id",hidden:!0,children:(0,a.jsx)(T.Z,{})}),(0,a.jsx)(y.Z.Item,{name:"name",label:"\u5DE5\u827A\u540D\u79F0",rules:[{required:!0,max:64,whitespace:!0}],children:(0,a.jsx)(T.Z,{placeholder:"\u8BF7\u8F93\u5165\u5DE5\u827A\u540D\u79F0"})}),(0,a.jsx)(y.Z.Item,{name:"status",label:"\u72B6\u6001",defaultValue:e==null||(n=e.values)===null||n===void 0?void 0:n.status,rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u72B6\u6001"}],children:(0,a.jsxs)(w.Z,{placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001",children:[(0,a.jsx)(t,{value:"0",children:"\u6B63\u5E38"}),(0,a.jsx)(t,{value:"1",children:"\u505C\u7528"})]})}),(0,a.jsxs)(y.Z.Item,{children:[(0,a.jsx)(R.Z,{htmlType:"button",style:{float:"right",left:10},onClick:e.onCancel,children:"\u53D6\u6D88"}),(0,a.jsx)(R.Z,{type:"primary",htmlType:"submit",style:{float:"right"},children:"\u4FDD\u5B58"})]})]})})},U=Y,S=r(48971);function J(u){return $.apply(this,arguments)}function $(){return $=(0,m.Z)((0,s.Z)().mark(function u(e){return(0,s.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,S.WY)("/kitchen/api/goodstechnology/getGoodstechnologypage",{method:"Post",data:e}));case 1:case"end":return n.stop()}},u)})),$.apply(this,arguments)}function K(u){return I.apply(this,arguments)}function I(){return I=(0,m.Z)((0,s.Z)().mark(function u(e){return(0,s.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,S.WY)("/kitchen/api/goodstechnology/addgoodstechnology",{method:"Post",data:e}));case 1:case"end":return n.stop()}},u)})),I.apply(this,arguments)}function N(u){return x.apply(this,arguments)}function x(){return x=(0,m.Z)((0,s.Z)().mark(function u(e){return(0,s.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,S.WY)("/kitchen/api/goodstechnology/updategoodstechnology",{method:"Post",data:e}));case 1:case"end":return n.stop()}},u)})),x.apply(this,arguments)}function z(u){return A.apply(this,arguments)}function A(){return A=(0,m.Z)((0,s.Z)().mark(function u(e){return(0,s.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,S.WY)("/kitchen/api/goodstechnology/deletegoodstechnology",{method:"Post",data:e}));case 1:case"end":return n.stop()}},u)})),A.apply(this,arguments)}var H=function(){var u=(0,m.Z)((0,s.Z)().mark(function e(l){return(0,s.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,K(JSON.stringify(l)).then(function(h){h.data?v.default.success("\u6DFB\u52A0\u6210\u529F"):v.default.error(h.errors)});case 3:return t.abrupt("return",!0);case 6:return t.prev=6,t.t0=t.catch(0),v.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),t.abrupt("return",!1);case 10:case"end":return t.stop()}},e,null,[[0,6]])}));return function(l){return u.apply(this,arguments)}}(),L=function(){var u=(0,m.Z)((0,s.Z)().mark(function e(l){return(0,s.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,z(l).then(function(h){h.data?v.default.success("\u5220\u9664\u6210\u529F"):v.default.error(h.errors)}),t.abrupt("return",!0);case 5:t.prev=5,t.t0=t.catch(0),v.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5");case 8:case"end":return t.stop()}},e,null,[[0,5]])}));return function(l){return u.apply(this,arguments)}}(),Q=function(){var u=(0,m.Z)((0,s.Z)().mark(function e(l){return(0,s.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,N(l).then(function(h){h.data?v.default.success("\u4FEE\u6539\u6210\u529F"):v.default.error(h.errors)}),t.abrupt("return",!0);case 5:return t.prev=5,t.t0=t.catch(0),v.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),t.abrupt("return",!1);case 9:case"end":return t.stop()}},e,null,[[0,5]])}));return function(l){return u.apply(this,arguments)}}(),X=function(){var e=(0,p.useState)(!1),l=(0,j.Z)(e,2),n=l[0],t=l[1],h=(0,p.useState)(!1),B=(0,j.Z)(h,2),fe=B[0],_=B[1],Z=(0,p.useRef)(),ee=(0,p.useState)(),E=(0,j.Z)(ee,2),te=E[0],F=E[1],ne=(0,p.useState)([]),P=(0,j.Z)(ne,2),ve=P[0],re=P[1],ae=[{title:"\u4E3B\u952E",dataIndex:"id",tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key",hideInSearch:!0,hideInTable:!0,render:function(f,c){return(0,a.jsx)("a",{onClick:function(){F(c),_(!0)},children:f})}},{title:"\u540D\u79F0",dataIndex:"name",valueType:"textarea",ellipsis:!0,search:!1},{title:"\u72B6\u6001",dataIndex:"status",hideInForm:!0,search:!1,valueEnum:{0:{text:"\u6B63\u5E38",status:"Processing"},1:{text:"\u505C\u7528",status:"Success"}}},{title:"\u521B\u5EFA\u65F6\u95F4",dataIndex:"createAt",valueType:"date",hideInSearch:!0},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(f,c){return[(0,a.jsx)("a",{onClick:function(){var d,o;t(!0),F(c),(d=Z.current)===null||d===void 0||(o=d.reloadAndRest)===null||o===void 0||o.call(d)},children:"\u66F4\u65B0"},"config"),(0,a.jsx)(G.Z,{type:"primary",title:"\u786E\u8BA4\u5220\u9664\u5417\uFF1F",okText:"\u662F",cancelText:"\u5426",onConfirm:function(){var d;L([c.id]),(d=Z.current)===null||d===void 0||d.reloadAndRest()},onCancel:function(){},children:(0,a.jsx)("a",{href:"#",children:"\u5220\u9664"})},"primary")]}}];return(0,a.jsxs)(k.ZP,{children:[(0,a.jsx)(W.ZP,{headerTitle:"\u5DE5\u827A",actionRef:Z,rowKey:"id",search:{labelWidth:120},columns:ae,toolBarRender:function(){return[(0,a.jsxs)(R.Z,{type:"primary",onClick:function(){t(!0),F({})},children:[(0,a.jsx)(V.Z,{})," \u65B0\u5EFA"]},"primary")]},request:function(){var g=(0,m.Z)((0,s.Z)().mark(function f(c){var i,d;return(0,s.Z)().wrap(function(C){for(;;)switch(C.prev=C.next){case 0:return i=[],d=0,C.next=4,J(c).then(function(O){i=O.data.data,i.forEach(function(b){b.status=b.status.toString()}),d=O.data.total});case 4:return C.abrupt("return",{data:i,success:!0,total:d});case 5:case"end":return C.stop()}},f)}));return function(f){return g.apply(this,arguments)}}(),rowSelection:{onChange:function(f,c){re(c)}}}),(0,a.jsx)(U,{onFinish:function(){var g=(0,m.Z)((0,s.Z)().mark(function f(c){var i;return(0,s.Z)().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(i=!1,!c.id){o.next=7;break}return o.next=4,Q(c);case 4:i=o.sent,o.next=10;break;case 7:return o.next=9,H(c);case 9:i=o.sent;case 10:i&&(t(!1),Z.current&&Z.current.reload());case 11:case"end":return o.stop()}},f)}));return function(f){return g.apply(this,arguments)}}(),onCancel:function(){F(void 0),t(!1)},createModalVisible:n,values:te||{}})]})},q=X}}]);