|
- (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[7093],{13102:function(ie,B,r){"use strict";r.r(B),r.d(B,{default:function(){return ee}});var de=r(57663),R=r(71577),l=r(39428),p=r(3182),oe=r(62350),V=r(24565),ce=r(34792),o=r(48086),T=r(2824),fe=r(402),G=r(56256),j=r(67294),Y=r(28790),k=r(85224),J=r(49101),N=r(16894),pe=r(71194),z=r(50146),he=r(9715),y=r(55843),ve=r(47673),C=r(4107),me=r(43358),U=r(34041),t=r(85893),K=function(d){var v=U.Z.Option,a=U.Z.OptGroup;return(0,t.jsx)(z.Z,{title:d.values.id?"\u7F16\u8F91":"\u65B0\u5EFA",width:640,visible:d.createModalVisible,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){d.onCancel()},maskClosable:!1,destroyOnClose:!0,children:(0,t.jsxs)(y.Z,{layout:"vertical",preserve:!1,initialValues:d.values,onFinish:d.onFinish,children:[(0,t.jsx)(y.Z.Item,{name:"id",hidden:!0,children:(0,t.jsx)(C.Z,{})}),(0,t.jsx)(y.Z.Item,{label:"\u4EA7\u54C1\u540D\u79F0",name:"name",rules:[{required:!0,max:50}],children:(0,t.jsx)(C.Z,{})}),(0,t.jsx)(y.Z.Item,{label:"\u4EA7\u54C1\u6807\u8BC6",name:"code",rules:[{required:!0,max:50}],children:(0,t.jsx)(C.Z,{})}),(0,t.jsx)(y.Z.Item,{label:"\u5907\u6CE8",name:"remark",rules:[{required:!1,max:50}],children:(0,t.jsx)(C.Z,{})}),(0,t.jsx)(y.Z.Item,{children:(0,t.jsx)(R.Z,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})})},H=K,S=r(48971),P=r(96690);function L(c){return w.apply(this,arguments)}function w(){return w=(0,p.Z)((0,l.Z)().mark(function c(d){return(0,l.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,S.WY)((0,P.w)()+"/api/product/page",{method:"POST",data:d}));case 1:case"end":return a.stop()}},c)})),w.apply(this,arguments)}function Q(c){return A.apply(this,arguments)}function A(){return A=(0,p.Z)((0,l.Z)().mark(function c(d){return(0,l.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,S.WY)((0,P.w)()+"/api/product/add",{method:"POST",data:d}));case 1:case"end":return a.stop()}},c)})),A.apply(this,arguments)}function D(c){return F.apply(this,arguments)}function F(){return F=(0,p.Z)((0,l.Z)().mark(function c(d){return(0,l.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,S.WY)((0,P.w)()+"\u200B/api/product/delete",{method:"POST",data:d}));case 1:case"end":return a.stop()}},c)})),F.apply(this,arguments)}function X(c){return $.apply(this,arguments)}function $(){return $=(0,p.Z)((0,l.Z)().mark(function c(d){return(0,l.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,S.WY)((0,P.w)()+"\u200B/api/product/update",{method:"POST",data:d}));case 1:case"end":return a.stop()}},c)})),$.apply(this,arguments)}function ye(c){return I.apply(this,arguments)}function I(){return I=_asyncToGenerator(_regeneratorRuntime().mark(function c(d){return _regeneratorRuntime().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",request(getDataBaseUrl()+"\u200B/api/product/updatestatus",{method:"POST",data:d}));case 1:case"end":return a.stop()}},c)})),I.apply(this,arguments)}var Z="message",q=G.Z.Paragraph,Ze=G.Z.Text,_=function(){var d=(0,j.useState)(!1),v=(0,T.Z)(d,2),a=v[0],g=v[1],m=(0,j.useRef)(),re=(0,j.useState)(),M=(0,T.Z)(re,2),ae=M[0],O=M[1],te=(0,j.useState)([]),W=(0,T.Z)(te,2),x=W[0],b=W[1],ne=[{title:"\u4E3B\u952E",dataIndex:"id",hideInSearch:!0,hideInTable:!0,tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key"},{title:"\u4EA7\u54C1\u540D\u79F0",dataIndex:"name",valueType:"textarea"},{title:"\u4EA7\u54C1\u6807\u8BC6",dataIndex:"code",valueType:"textarea"},{title:"\u4EA7\u54C1key",dataIndex:"key",valueType:"textarea",render:function(n){return(0,t.jsx)(q,{style:{display:"inline"},copyable:!0,children:n})}},{title:"\u5907\u6CE8",dataIndex:"remark",valueType:"textarea",width:450},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",fixed:"right",width:450,render:function(n,u){return[(0,t.jsx)("a",{onClick:function(){g(!0),O(u)},children:" \u66F4\u65B0"},"config"),(0,t.jsx)(V.Z,{type:"primary",title:"\u786E\u8BA4\u5220\u9664\u5417\uFF1F",okText:"\u662F",cancelText:"\u5426",onConfirm:function(){D([u.id]).then(function(e){o.default.success("\u5220\u9664\u6210\u529F\uFF0C\u5373\u5C06\u5237\u65B0"),m.current.reloadAndRest()})},onCancel:function(){},children:(0,t.jsx)("a",{href:"#",children:"\u5220\u9664"})},"primary")]}}],ue=function(){var f=(0,p.Z)((0,l.Z)().mark(function n(u){return(0,l.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,o.default.loading("\u6B63\u5728\u6DFB\u52A0",Z),e.next=4,Q(JSON.stringify(u)).then(function(s){return o.default.destroy(Z),s.succeeded?(o.default.success("\u6DFB\u52A0\u6210\u529F"),m.current.reloadAndRest(),!0):(o.default.error(s.errors),!1)});case 4:e.next=10;break;case 6:return e.prev=6,e.t0=e.catch(0),o.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),e.abrupt("return",!1);case 10:case"end":return e.stop()}},n,null,[[0,6]])}));return function(u){return f.apply(this,arguments)}}(),se=function(){var f=(0,p.Z)((0,l.Z)().mark(function n(u){return(0,l.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,o.default.loading("\u6B63\u5728\u4FEE\u6539",Z),o.default.destroy(Z),e.next=5,X(JSON.stringify(u)).then(function(s){return o.default.destroy(Z),s.succeeded?(o.default.success("\u4FEE\u6539\u6210\u529F"),m.current.reloadAndRest(),!0):(o.default.error(s.errors),!1)});case 5:e.next=11;break;case 7:return e.prev=7,e.t0=e.catch(0),o.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),e.abrupt("return",!1);case 11:case"end":return e.stop()}},n,null,[[0,7]])}));return function(u){return f.apply(this,arguments)}}(),le=function(){var f=(0,p.Z)((0,l.Z)().mark(function n(u){var i;return(0,l.Z)().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.prev=0,o.default.loading("\u6B63\u5728\u5220\u9664"),i=[],u.forEach(function(h){i.push(h.id)}),s.next=6,D(i).then(function(h){return h.data?(o.default.success("\u5220\u9664\u6210\u529F"),m.current.reloadAndRest(),!0):(o.default.error(h.errors),!1)});case 6:s.next=12;break;case 8:return s.prev=8,s.t0=s.catch(0),o.default.error("\u5220\u9664\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),s.abrupt("return",!1);case 12:case"end":return s.stop()}},n,null,[[0,8]])}));return function(u){return f.apply(this,arguments)}}();return(0,t.jsxs)(Y.ZP,{host:!0,header:{title:"",breadcrumb:{}},children:[(0,t.jsx)(N.ZP,{actionRef:m,rowKey:"id",pagination:{defaultPageSize:10},search:{labelWidth:120},toolBarRender:function(){return[(0,t.jsxs)(R.Z,{type:"primary",onClick:function(){g(!0)},children:[(0,t.jsx)(J.Z,{})," \u65B0\u5EFA"]},"primary")]},request:function(){var f=(0,p.Z)((0,l.Z)().mark(function n(u){var i,e;return(0,l.Z)().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return i=[],e=0,h.next=4,L(u).then(function(E){i=E.data.data,e=E.data.total});case 4:return h.abrupt("return",{data:i,success:!0,total:e});case 5:case"end":return h.stop()}},n)}));return function(n){return f.apply(this,arguments)}}(),columns:ne,rowSelection:{onChange:function(n,u){b(u)}}}),(x==null?void 0:x.length)>0&&(0,t.jsx)(k.Z,{extra:(0,t.jsxs)("div",{children:["\u5DF2\u9009\u62E9"," ",(0,t.jsx)("a",{style:{fontWeight:600},children:x.length})," ","\u9879 \xA0\xA0"]}),children:(0,t.jsx)(R.Z,{onClick:(0,p.Z)((0,l.Z)().mark(function f(){var n,u;return(0,l.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,le(x);case 2:b([]),(n=m.current)===null||n===void 0||(u=n.reloadAndRest)===null||u===void 0||u.call(n);case 4:case"end":return e.stop()}},f)})),children:"\u5220\u9664"})}),(0,t.jsx)(H,{onFinish:function(){var f=(0,p.Z)((0,l.Z)().mark(function n(u){var i;return(0,l.Z)().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:i=!1,u.id?i=se(u):i=ue(u),i&&(g(!1),O(void 0)),m.current.reloadAndRest();case 4:case"end":return s.stop()}},n)}));return function(n){return f.apply(this,arguments)}}(),onCancel:function(){g(!1),O(void 0)},createModalVisible:a,values:ae||{}})]})},ee=_}}]);
|