"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[3759],{63937:function(j,T,e){e.r(T);var y=e(90228),a=e.n(y),O=e(87999),u=e.n(O),i=e(72951),D=e(7485),c=e(50959),M=e(52221),m=e(47698),C=e(45321),p=e(50159),I=e(16030),h=e(35384),r=e(75343),t=e(11527),f=function(){var x=(0,c.useRef)(),R=[{title:"ID",dataIndex:"id",valueType:"text",search:!1},{title:"\u5546\u54C1\u540D\u79F0",dataIndex:"goodsName",valueType:"text",search:!0},{title:"\u529F\u7387",dataIndex:"itemType",valueType:"text",search:!1},{title:"\u9500\u552E\u4EF7\u683C",dataIndex:"salePrice",valueType:"text",search:!1},{title:"\u5229\u6DA6",dataIndex:"profit",valueType:"text",search:!1},{title:"\u5E93\u5B58",dataIndex:"stock",valueType:"text",search:!1},{title:"\u9500\u91CF",dataIndex:"sales",valueType:"text",search:!1},{title:"\u5546\u54C1\u4E3B\u56FE",dataIndex:"picture",valueType:"text",search:!1,render:function(l,_){var s=_.picture?JSON.parse(_.picture)[0]:"";return s?(0,t.jsx)(M.Z,{src:s,width:50}):""}},{title:"\u662F\u5426\u4E0A\u67B6",dataIndex:"isUp",valueType:"text",search:!1,render:function(l,_){var s=function(){var A=u()(a()().mark(function v(d){var g,o;return a()().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return g=JSON.parse(JSON.stringify(_)),g.isUp=d?1:0,P.next=4,(0,i.Ge)(g);case 4:o=P.sent,m.ZP.success(d?"\u4E0A\u67B6\u6210\u529F":"\u4E0B\u67B6\u6210\u529F"),x.current&&x.current.reload();case 7:case"end":return P.stop()}},v)}));return function(d){return A.apply(this,arguments)}}();return(0,t.jsx)(C.Z,{checkedChildren:"\u4E0A\u67B6",value:_.isUp==1,unCheckedChildren:"\u4E0B\u67B6",defaultChecked:!0,onChange:s})}},{title:"\u64CD\u4F5C",dataIndex:"option",width:"220px",valueType:"option",render:function(l,_){return[(0,t.jsx)(p.ZP,{type:"link",size:"small",onClick:function(){D.history.push("goods/".concat(_.id,"/update"))},children:"\u7F16\u8F91"})]}}];return(0,t.jsx)(I._z,{children:(0,t.jsx)("div",{style:{width:"100%",float:"right"},children:(0,t.jsx)(h.Z,{actionRef:x,rowKey:"id",search:{labelWidth:120,defaultCollapsed:!1},toolBarRender:function(){return[(0,t.jsxs)(p.ZP,{type:"primary",onClick:u()(a()().mark(function l(){return a()().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:D.history.push("goods/0/create");case 1:case"end":return s.stop()}},l)})),children:[(0,t.jsx)(r.Z,{})," \u65B0\u5EFA"]},"add")]},request:function(){var E=u()(a()().mark(function l(_,s,A){var v,d;return a()().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,(0,i.k5)(_);case 2:return v=o.sent,d=v.data,o.abrupt("return",{data:(d==null?void 0:d.records)||[],total:d==null?void 0:d.total});case 5:case"end":return o.stop()}},l)}));return function(l,_,s){return E.apply(this,arguments)}}(),columns:R},"goodsList")})})};T.default=f},72951:function(j,T,e){e.d(T,{Ge:function(){return C},VT:function(){return I},Y:function(){return M},k5:function(){return D}});var y=e(90228),a=e.n(y),O=e(87999),u=e.n(O),i=e(7485);function D(r){return c.apply(this,arguments)}function c(){return c=u()(a()().mark(function r(t){return a()().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,i.request)("/api/goods/page",{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8"},data:t||{}}));case 1:case"end":return n.stop()}},r)})),c.apply(this,arguments)}function M(r){return m.apply(this,arguments)}function m(){return m=u()(a()().mark(function r(t){return a()().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,i.request)("/api/goods/add",{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8"},data:t||{}}));case 1:case"end":return n.stop()}},r)})),m.apply(this,arguments)}function C(r){return p.apply(this,arguments)}function p(){return p=u()(a()().mark(function r(t){return a()().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,i.request)("/api/goods/update",{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8"},data:t||{}}));case 1:case"end":return n.stop()}},r)})),p.apply(this,arguments)}function I(r){return h.apply(this,arguments)}function h(){return h=u()(a()().mark(function r(t){return a()().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,i.request)("/api/goods/detail",{method:"GET",headers:{"Content-Type":"application/json;charset=UTF-8"},params:t}));case 1:case"end":return n.stop()}},r)})),h.apply(this,arguments)}}}]);
