You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 lines
5.3 KiB

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[663],{95749:function(w,O,e){e.d(O,{Z:function(){return R}});var x=e(84908),p=e(85893);function R(m){return(0,p.jsx)(x.Z,{title:(m==null?void 0:m.title)||m.children,placement:"topLeft",children:(0,p.jsx)("div",{className:"fm-ellipsis-2",children:m.children})})}},79713:function(w,O,e){e.r(O),e.d(O,{default:function(){return H}});var x=e(97857),p=e.n(x),R=e(5574),m=e.n(R),K=e(15009),l=e.n(K),W=e(99289),E=e.n(W),T=e(67294),U=e(88593),g=e(84485),D=e(29924),C=e(26713),k=e(79216),L=e(85402),y=e(12461),Z=e(8702),S=e(95749),B=e(29526),r=e(85893),F=g.Z.Title,G=g.Z.Text,P=g.Z.Link,$=function(d){return(0,r.jsx)(D.ZP.Group,{defaultValue:null,onChange:function(t){d.onChange(t.target.value)},children:(0,r.jsxs)(C.Z,{wrap:!0,children:[(0,r.jsx)(D.ZP.Button,{value:null,children:"\u5168\u90E8"}),(0,r.jsx)(D.ZP.Button,{value:1,children:"\u5728\u552E\u4E2D"}),(0,r.jsx)(D.ZP.Button,{value:3,children:"\u5DF2\u552E\u7F44"}),(0,r.jsx)(D.ZP.Button,{value:2,children:"\u5DF2\u4E0B\u67B6"})]})})},z=function(d){var n,t=d.record;return(0,r.jsxs)(C.Z,{style:{width:250,overflowX:"hidden"},align:"start",children:[(0,r.jsx)(k.Z,{style:{width:80,height:80,objectFit:"contain"},src:t==null||(n=t.images)===null||n===void 0?void 0:n.split(",")[0]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)(G,{children:["ID:",t==null?void 0:t.spu_no]}),(0,r.jsx)(S.Z,{title:t==null?void 0:t.title,children:(0,r.jsx)(F,{level:5,children:t==null?void 0:t.title})})]})]})},V=function(d){var n=d.record,t=d.actionRef,M=function(){var c=E()(l()().mark(function i(){return l()().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:L.Z.confirm({content:"\u786E\u5B9A\u8981".concat(n.status===2?"\u4E0A\u67B6":"\u4E0B\u67B6","\u8BE5\u5546\u54C1\u5417\uFF1F"),onOk:function(){var h=E()(l()().mark(function a(){var v,o;return l()().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,B.Gf.request({},{online:(n==null?void 0:n.status)===2?"on":"off",ids:[n==null?void 0:n.id]});case 2:v=f.sent,v.code===0&&(y.ZP.success("\u64CD\u4F5C\u6210\u529F"),t==null||(o=t.current)===null||o===void 0||o.reload());case 4:case"end":return f.stop()}},a)}));function u(){return h.apply(this,arguments)}return u}()});case 1:case"end":return _.stop()}},i)}));return function(){return c.apply(this,arguments)}}(),A=function(){var c=E()(l()().mark(function i(s){return l()().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:L.Z.confirm({content:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u5546\u54C1\u5417\uFF1F",onOk:function(){var u=E()(l()().mark(function v(){var o,I;return l()().wrap(function(j){for(;;)switch(j.prev=j.next){case 0:return j.next=2,B.nq.request({},{ids:[s==null?void 0:s.id]});case 2:o=j.sent,o.code===0&&(y.ZP.success("\u64CD\u4F5C\u6210\u529F"),t==null||(I=t.current)===null||I===void 0||I.reload());case 4:case"end":return j.stop()}},v)}));function a(){return u.apply(this,arguments)}return a}()});case 1:case"end":return h.stop()}},i)}));return function(s){return c.apply(this,arguments)}}();return(0,r.jsxs)(C.Z,{wrap:!0,align:"center",children:[(0,r.jsx)(P,{onClick:function(){U.history.push("/goods_manage/detail?action=update&id=".concat(n.id,"&step=1"))},children:"\u7F16\u8F91"}),(0,r.jsx)(P,{onClick:M,children:(n==null?void 0:n.status)===2?"\u4E0A\u67B6":"\u4E0B\u67B6"}),(0,r.jsx)(P,{onClick:function(){U.history.push("/goods_manage/detail?action=detail&id=".concat(n.id,"&step=1"))},children:"\u67E5\u770B"}),(n==null?void 0:n.status)===2?(0,r.jsx)(P,{onClick:function(){return A(n)},children:"\u5220\u9664"}):null]})};function H(){var b=(0,T.useState)(),d=m()(b,2),n=d[0],t=d[1],M=(0,T.useRef)(),A=[{title:"\u5546\u54C1ID",hideInTable:!0,dataIndex:"spu_no",key:"spu_no"},{title:"\u5546\u54C1\u540D\u79F0",hideInTable:!0,dataIndex:"title",key:"title"},{title:"\u5546\u54C1\u4FE1\u606F",dataIndex:"title",key:"title",hideInSearch:!0,width:"250px",render:function(s,_){return(0,r.jsx)(z,{record:_})}},{title:"\u9500\u552E\u4EF7",hideInSearch:!0,dataIndex:"price_min",key:"price_min"},{title:"\u5E93\u5B58",hideInSearch:!0,dataIndex:"stock",key:"stock"},{title:"\u7D2F\u79EF\u9500\u91CF",hideInSearch:!0,dataIndex:"sales",key:"sales"},{title:"30\u65E5\u9500\u91CF",hideInSearch:!0,dataIndex:"sales_30",key:"sales_30"},{title:"\u521B\u5EFA\u65F6\u95F4",hideInSearch:!0,valueType:"dateTime",dataIndex:"createdAt",key:"createdAt"},{title:"\u64CD\u4F5C",fixed:"right",hideInSearch:!0,render:function(s,_){return(0,r.jsx)(V,{actionRef:M,record:_})}}],c=function(){var i=E()(l()().mark(function s(_){return l()().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",B.gp.request(p()(p()({},_),{},{page:_.current,page_size:_.pageSize})).then(function(a){var v,o;return{success:!0,data:(a==null||(v=a.data)===null||v===void 0?void 0:v.list)||[],total:(a==null||(o=a.data)===null||o===void 0?void 0:o.total)||0}}));case 1:case"end":return u.stop()}},s)}));return function(_){return i.apply(this,arguments)}}();return(0,T.useEffect)(function(){},[]),(0,r.jsx)("div",{children:(0,r.jsx)(Z.QVr,{scroll:{x:"max-content"},options:{reload:!1},actionRef:M,params:{status:n},request:function(){var i=E()(l()().mark(function s(_){return l()().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",c(_));case 1:case"end":return u.stop()}},s)}));return function(s){return i.apply(this,arguments)}}(),headerTitle:(0,r.jsx)($,{onChange:function(s){t(s)}}),columns:A})})}}}]);