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