|
- (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[3326],{64716:function(se,E,t){"use strict";t.r(E),t.d(E,{default:function(){return M}});var ue=t(13062),Y=t(71230),le=t(89032),S=t(15746),ie=t(58024),A=t(91894),w=t(86582),oe=t(88983),P=t(47933),l=t(39428),de=t(34792),I=t(48086),h=t(3182),me=t(71194),B=t(50146),y=t(2824),ce=t(18106),G=t(25499),L=t(28790),p=t(67294),o=t(952),m=t(59914),N=t(57119),Z=t(48971);function O(a){return F.apply(this,arguments)}function F(){return F=(0,h.Z)((0,l.Z)().mark(function a(d){return(0,l.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,Z.WY)("/storemanagement/api/Printer/GetPrinterTemplater",{method:"get",data:d}));case 1:case"end":return n.stop()}},a)})),F.apply(this,arguments)}function U(a){return T.apply(this,arguments)}function T(){return T=(0,h.Z)((0,l.Z)().mark(function a(d){return(0,l.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,Z.WY)("/storemanagement/api/Printer/AddPrinterTemplate",{method:"post",data:d}));case 1:case"end":return n.stop()}},a)})),T.apply(this,arguments)}function z(a){return g.apply(this,arguments)}function g(){return g=(0,h.Z)((0,l.Z)().mark(function a(d){return(0,l.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,Z.WY)("/storemanagement/api/Printer/UpdatePrinterTemplate",{method:"put",data:d}));case 1:case"end":return n.stop()}},a)})),g.apply(this,arguments)}function V(a){return j.apply(this,arguments)}function j(){return j=(0,h.Z)((0,l.Z)().mark(function a(d){return(0,l.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,Z.WY)("/storemanagement/api/Printer/DelPrinterTemplater",{method:"DELETE",data:d}));case 1:case"end":return n.stop()}},a)})),j.apply(this,arguments)}var e=t(85893),H=G.Z.TabPane,J=function(){var d=(0,p.useRef)(),f=(0,p.useState)([]),n=(0,y.Z)(f,2),v=n[0],D=n[1],Q=(0,p.useState)(),$=(0,y.Z)(Q,2),b=$[0],x=$[1],X=(0,p.useState)(!1),K=(0,y.Z)(X,2),k=K[0],q=K[1],_=B.Z.confirm;(0,p.useEffect)(function(){C()},[]),(0,p.useEffect)(function(){},[b]);var C=function(){O().then(function(r){var s;D(r.data),x((s=r.data[0])===null||s===void 0?void 0:s.id)})},pe=function(){B.Z.destroyAll()},ee=function(r){return(0,e.jsxs)(o.ZP,{onFinish:function(){var s=(0,h.Z)((0,l.Z)().mark(function c(R){var W;return(0,l.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(k){u.next=6;break}return u.next=3,z(R);case 3:u.t0=u.sent,u.next=9;break;case 6:return u.next=8,U(R);case 8:u.t0=u.sent;case 9:W=u.t0,W.data?(C(),I.default.success("\u6210\u529F")):I.default.success("\u5931\u8D25");case 11:case"end":return u.stop()}},c)}));return function(c){return s.apply(this,arguments)}}(),labelCol:{span:4},formRef:d,layout:"horizontal",initialValues:{id:r.id,title:r.title,subtitle:r.subtitle,explain:r.explain,isShowPrintTime:r.isShowPrintTime,isShowNumber:r.isShowNumber,Footer:r.Footer,type:r.type},autoFocusFirstInput:!0,children:[(0,e.jsx)(o.ZP.Item,{name:"id",hidden:!0,children:(0,e.jsx)(m.ZP,{mode:"edit"})}),(0,e.jsx)(o.ZP.Item,{name:"type",label:"\u5C0F\u7968\u7C7B\u578B",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u5C0F\u7968\u7C7B\u578B"}],children:(0,e.jsxs)(P.ZP.Group,{children:[(0,e.jsx)(P.ZP,{value:1,children:"\u6536\u94F6(\u51FA\u9910)\u5C0F\u7968"}),(0,e.jsx)(P.ZP,{value:2,children:"\u8D34\u7EB8\u5C0F\u7968"})]})}),(0,e.jsx)(o.ZP.Item,{name:"title",label:"\u6807\u9898",placeholder:"\u6807\u9898",children:(0,e.jsx)(m.ZP,{mode:"edit"})}),(0,e.jsx)(o.ZP.Item,{style:{marginTop:"-10px"},name:"subtitle",label:"\u526F\u6807\u9898",placeholder:"\u526F\u6807\u9898",children:(0,e.jsx)(m.ZP,{mode:"edit"})}),(0,e.jsx)(o.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)(m.ZP,{mode:"edit"})}),(0,e.jsx)(o.ZP.Item,{style:{marginTop:"-10px"},name:"isShowPrintTime",label:"\u662F\u5426\u663E\u793A\u65F6\u95F4",placeholder:"",children:(0,e.jsx)(m.ZP,{mode:"edit",valueType:"switch"})}),(0,e.jsx)(o.ZP.Item,{style:{marginTop:"-10px"},name:"isShowNumber",label:"\u662F\u5426\u663E\u793A\u8BA2\u5355\u53F7",placeholder:"",children:(0,e.jsx)(m.ZP,{mode:"edit",valueType:"switch"})}),(0,e.jsx)(o.ZP.Item,{style:{marginTop:"-10px"},name:"Footer",label:"\u9875\u811A",placeholder:"\u9875\u811A",children:(0,e.jsx)(m.ZP,{mode:"edit"})})]})},te=function(r){x(r)},ne=function(r,s){s=="remove"?ae(r):(q(!0),re(r))},re=function(r){var s="\u6A21\u677F"+v.length,c=(0,w.Z)(v);c.push({title:"\u6A21\u677F"+c.length,content:(0,e.jsx)("div",{children:" "}),id:s}),x(s),D(c)},ae=function(r){setTimeout(function(){_({icon:(0,e.jsx)(N.Z,{}),content:"\u786E\u5B9A\u5220\u9664\u5417",onOk:function(){V([r]).then(function(c){C()})},onCancel:function(){console.log("Cancel")}})})};return(0,e.jsx)(L.ZP,{header:{title:"",breadcrumb:{}},children:(0,e.jsx)(G.Z,{type:"editable-card",onChange:te,activeKey:b,onEdit:ne,children:v==null?void 0:v.map(function(i){return(0,e.jsx)(H,{tab:i.title,children:(0,e.jsxs)(Y.Z,{children:[(0,e.jsx)(S.Z,{span:12,push:12,children:(0,e.jsx)(A.Z,{children:ee(i)})}),(0,e.jsx)(S.Z,{span:12,pull:12,children:(0,e.jsx)(A.Z,{children:"\u6A21\u677F\u6837\u5F0F"})})]})},i.id)})})})},M=J}}]);
|