|
- (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[9999,1322,9464,1981,2869,7013,9719,2383],{1958:function(te,E,t){"use strict";t.r(E),t.d(E,{default:function(){return M}});var re=t(13062),W=t(71230),ne=t(89032),A=t(15746),ae=t(58024),C=t(91894),Y=t(86582),se=t(88983),F=t(47933),u=t(39428),ue=t(34792),I=t(48086),c=t(3182),y=t(2824),ie=t(18106),B=t(95562),N=t(78009),h=t(67294),l=t(952),p=t(1705),Z=t(48971);function L(a){return P.apply(this,arguments)}function P(){return P=(0,c.Z)((0,u.Z)().mark(function a(d){return(0,u.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,Z.WY)("/kitchen/api/printer/printer-templater",{method:"get",data:d}));case 1:case"end":return r.stop()}},a)})),P.apply(this,arguments)}function U(a){return j.apply(this,arguments)}function j(){return j=(0,c.Z)((0,u.Z)().mark(function a(d){return(0,u.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,Z.WY)("/kitchen/api/printer/printer-template",{method:"post",data:d}));case 1:case"end":return r.stop()}},a)})),j.apply(this,arguments)}function z(a){return x.apply(this,arguments)}function x(){return x=(0,c.Z)((0,u.Z)().mark(function a(d){return(0,u.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,Z.WY)("/kitchen/api/printer/printer-template",{method:"put",data:d}));case 1:case"end":return r.stop()}},a)})),x.apply(this,arguments)}function V(a){return T.apply(this,arguments)}function T(){return T=(0,c.Z)((0,u.Z)().mark(function a(d){return(0,u.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,Z.WY)("/kitchen/api/printer/del-printer-templater",{method:"post",data:d}));case 1:case"end":return r.stop()}},a)})),T.apply(this,arguments)}var e=t(85893),H=B.Z.TabPane,J=function(){var d=(0,h.useRef)(),f=(0,h.useState)([]),r=(0,y.Z)(f,2),v=r[0],G=r[1],O=(0,h.useState)(),$=(0,y.Z)(O,2),b=$[0],g=$[1],Q=(0,h.useState)(!1),D=(0,y.Z)(Q,2),X=D[0],w=D[1];(0,h.useEffect)(function(){S()},[]),(0,h.useEffect)(function(){},[b]);var S=function(){L().then(function(n){var i;G(n.data),g((i=n.data[0])===null||i===void 0?void 0:i.id)})},k=function(n){return(0,e.jsxs)(l.ZP,{onFinish:function(){var i=(0,c.Z)((0,u.Z)().mark(function m(K){var R;return(0,u.Z)().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(X){s.next=6;break}return s.next=3,z(K);case 3:s.t0=s.sent,s.next=9;break;case 6:return s.next=8,U(K);case 8:s.t0=s.sent;case 9:R=s.t0,R.data?(S(),I.default.success("\u6210\u529F")):I.default.success("\u5931\u8D25");case 11:case"end":return s.stop()}},m)}));return function(m){return i.apply(this,arguments)}}(),labelCol:{span:4},formRef:d,layout:"horizontal",initialValues:{id:n.id,title:n.title,subtitle:n.subtitle,explain:n.explain,isShowPrintTime:n.isShowPrintTime,isShowNumber:n.isShowNumber,Footer:n.Footer,type:n.type},autoFocusFirstInput:!0,children:[(0,e.jsx)(l.ZP.Item,{name:"id",hidden:!0,children:(0,e.jsx)(p.ZP,{mode:"edit"})}),(0,e.jsx)(l.ZP.Item,{name:"type",label:"\u5C0F\u7968\u7C7B\u578B",rules:[{required:!0}],children:(0,e.jsxs)(F.ZP.Group,{children:[(0,e.jsx)(F.ZP,{value:1,children:"\u6536\u94F6(\u51FA\u9910)\u5C0F\u7968"}),(0,e.jsx)(F.ZP,{value:2,children:"\u8D34\u7EB8\u5C0F\u7968"})]})}),(0,e.jsx)(l.ZP.Item,{name:"title",label:"\u6807\u9898",placeholder:"\u6807\u9898",children:(0,e.jsx)(p.ZP,{mode:"edit"})}),(0,e.jsx)(l.ZP.Item,{style:{marginTop:"-10px"},name:"subtitle",label:"\u526F\u6807\u9898",placeholder:"\u526F\u6807\u9898",children:(0,e.jsx)(p.ZP,{mode:"edit"})}),(0,e.jsx)(l.ZP.Item,{style:{marginTop:"-10px"},name:"explain",label:"\u8BF4\u660E\uFF08\u6B22\u8FCE\u8BED\uFF09",placeholder:"\u8BF4\u660E\uFF08\u6B22\u8FCE\u8BED\uFF09",children:(0,e.jsx)(p.ZP,{mode:"edit"})}),(0,e.jsx)(l.ZP.Item,{style:{marginTop:"-10px"},name:"isShowPrintTime",label:"\u662F\u5426\u663E\u793A\u65F6\u95F4",placeholder:"",children:(0,e.jsx)(p.ZP,{mode:"edit",valueType:"switch"})}),(0,e.jsx)(l.ZP.Item,{style:{marginTop:"-10px"},name:"isShowNumber",label:"\u662F\u5426\u663E\u793A\u8BA2\u5355\u53F7",placeholder:"",children:(0,e.jsx)(p.ZP,{mode:"edit",valueType:"switch"})}),(0,e.jsx)(l.ZP.Item,{style:{marginTop:"-10px"},name:"Footer",label:"\u9875\u811A",placeholder:"\u9875\u811A",children:(0,e.jsx)(p.ZP,{mode:"edit"})})]})},q=function(n){g(n)},_=function(n,i){i=="remove"?(w(!1),V([n]).then(function(m){S()})):(w(!0),ee(n))},ee=function(n){var i="\u6A21\u677F"+v.length,m=(0,Y.Z)(v);m.push({title:"\u6A21\u677F"+m.length,content:(0,e.jsx)("div",{children:" "}),id:i}),g(i),G(m)};return(0,e.jsx)(N.ZP,{children:(0,e.jsx)(B.Z,{type:"editable-card",onChange:q,activeKey:b,onEdit:_,children:v==null?void 0:v.map(function(o){return(0,e.jsx)(H,{tab:o.title,children:(0,e.jsxs)(W.Z,{children:[(0,e.jsx)(A.Z,{span:12,push:12,children:(0,e.jsx)(C.Z,{children:k(o)})}),(0,e.jsx)(A.Z,{span:12,pull:12,children:(0,e.jsx)(C.Z,{children:"\u6A21\u677F\u6837\u5F0F"})})]})},o.id)})})})},M=J}}]);
|