"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[3759],{63937:function(R,g,e){e.r(g);var y=e(90228),a=e.n(y),O=e(87999),u=e.n(O),i=e(72951),c=e(7485),m=e(50959),M=e(52221),h=e(47698),C=e(45321),p=e(50159),I=e(16030),f=e(35384),r=e(75343),t=e(11527),E=function(){var x=(0,m.useRef)(),A=(0,c.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},{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 j=u()(a()().mark(function P(d){var D,o;return a()().wrap(function(T){for(;;)switch(T.prev=T.next){case 0:return D=JSON.parse(JSON.stringify(_)),D.isUp=d?1:0,T.next=4,(0,i.Ge)(D);case 4:o=T.sent,h.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,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",hidden:!A.hasPerms("/api/goods/update"),onClick:function(){c.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)(f.Z,{actionRef:x,rowKey:"id",search:{labelWidth:120,defaultCollapsed:!1},toolBarRender:function(){return[(0,t.jsxs)(p.ZP,{type:"primary",hidden:!A.hasPerms("/api/goods/add"),onClick:u()(a()().mark(function l(){return a()().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:c.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 v=u()(a()().mark(function l(_,s,j){var P,d;return a()().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,(0,i.k5)(_);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()}},l)}));return function(l,_,s){return v.apply(this,arguments)}}(),columns:U},"goodsList")})})};g.default=E},72951:function(R,g,e){e.d(g,{Ge:function(){return C},VT:function(){return I},Y:function(){return M},k5:function(){return c}});var y=e(90228),a=e.n(y),O=e(87999),u=e.n(O),i=e(7485);function c(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/page",{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 M(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/add",{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8"},data:t||{}}));case 1:case"end":return n.stop()}},r)})),h.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 f.apply(this,arguments)}function f(){return f=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)})),f.apply(this,arguments)}}}]);
