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
10 KiB
1 lines
10 KiB
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[663],{95749:function(ne,F,i){i.d(F,{Z:function(){return z}});var V=i(84908),P=i(85893);function z(k){return(0,P.jsx)(V.Z,{title:(k==null?void 0:k.title)||k.children,placement:"topLeft",children:(0,P.jsx)("div",{className:"fm-ellipsis-2",children:k.children})})}},79713:function(ne,F,i){i.r(F),i.d(F,{default:function(){return he}});var V=i(97857),P=i.n(V),z=i(19632),k=i.n(z),te=i(5574),y=i.n(te),ie=i(15009),_=i.n(ie),le=i(99289),g=i.n(le),O=i(67294),q=i(88593),E=i(84485),L=i(29924),x=i(26713),J=i(79216),Q=i(85402),X=i(12461),G=i(79915),re=i(59652),ae=i(71577),ee=i(8702),ue=i(95749),W=i(31821),n=i(85893),se=E.Z.Title,oe=E.Z.Text,H=E.Z.Link,de=function(v){return(0,n.jsx)(L.ZP.Group,{defaultValue:null,onChange:function(a){v.onChange(a.target.value)},children:(0,n.jsxs)(x.Z,{wrap:!0,children:[(0,n.jsx)(L.ZP.Button,{value:null,children:"\u5168\u90E8"}),(0,n.jsx)(L.ZP.Button,{value:1,children:"\u5728\u552E\u4E2D"}),(0,n.jsx)(L.ZP.Button,{value:3,children:"\u5DF2\u552E\u7F44"}),(0,n.jsx)(L.ZP.Button,{value:2,children:"\u5DF2\u4E0B\u67B6"})]})})},_e=function(v){var r,a=v.record;return(0,n.jsxs)(x.Z,{style:{width:250,overflowX:"hidden"},align:"start",children:[(0,n.jsx)(J.Z,{style:{width:80,height:80,objectFit:"contain"},src:a==null||(r=a.images)===null||r===void 0?void 0:r.split(",")[0]}),(0,n.jsxs)("div",{children:[(0,n.jsxs)(oe,{children:["ID:",a==null?void 0:a.spu_no]}),(0,n.jsx)(ue.Z,{title:a==null?void 0:a.title,children:(0,n.jsx)(se,{level:5,children:a==null?void 0:a.title})})]})]})},ce=function(v){var r=v.record,a=v.actionRef,C=function(){var l=g()(_()().mark(function w(){return _()().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:Q.Z.confirm({content:"\u786E\u5B9A\u8981".concat(r.status===2?"\u4E0A\u67B6":"\u4E0B\u67B6","\u8BE5\u5546\u54C1\u5417\uFF1F"),onOk:function(){var b=g()(_()().mark(function j(){var Z,m;return _()().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return h.next=2,W.Gf.request({},{online:(r==null?void 0:r.status)===2?"on":"off",ids:[r==null?void 0:r.id]});case 2:Z=h.sent,Z.code===0&&(X.ZP.success("\u64CD\u4F5C\u6210\u529F"),a==null||(m=a.current)===null||m===void 0||m.reload());case 4:case"end":return h.stop()}},j)}));function D(){return b.apply(this,arguments)}return D}()});case 1:case"end":return S.stop()}},w)}));return function(){return l.apply(this,arguments)}}(),$=function(){var l=g()(_()().mark(function w(I){return _()().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:Q.Z.confirm({content:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u5546\u54C1\u5417\uFF1F",onOk:function(){var D=g()(_()().mark(function Z(){var m,B;return _()().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:return M.next=2,W.nq.request({},{ids:[I==null?void 0:I.id]});case 2:m=M.sent,m.code===0&&(X.ZP.success("\u64CD\u4F5C\u6210\u529F"),a==null||(B=a.current)===null||B===void 0||B.reload());case 4:case"end":return M.stop()}},Z)}));function j(){return D.apply(this,arguments)}return j}()});case 1:case"end":return b.stop()}},w)}));return function(I){return l.apply(this,arguments)}}();return(0,n.jsxs)(x.Z,{wrap:!0,align:"center",children:[(0,n.jsx)(H,{onClick:function(){q.history.push("/goods_manage/detail?action=update&id=".concat(r.id,"&step=1"))},children:"\u7F16\u8F91"}),(0,n.jsx)(H,{onClick:C,children:(r==null?void 0:r.status)===2?"\u4E0A\u67B6":"\u4E0B\u67B6"}),(0,n.jsx)(H,{onClick:function(){q.history.push("/goods_manage/detail?action=detail&id=".concat(r.id,"&step=1"))},children:"\u67E5\u770B"}),(r==null?void 0:r.status)===2?(0,n.jsx)(H,{onClick:function(){return $(r)},children:"\u5220\u9664"}):null]})},ve=function(v){var r,a=v.visible,C=v.onOk,$=v.onCancel,l=v.data,w=v.type,I=w===void 0?"price":w,S=(0,O.useState)([]),b=y()(S,2),D=b[0],j=b[1],Z=(0,O.useState)(),m=y()(Z,2),B=m[0],h=m[1],M=(0,O.useState)(),N=y()(M,2),f=N[0],c=N[1],t=[{title:"\u89C4\u683C\u4FE1\u606F",dataIndex:"specs",render:function(s,e){var d,o;return(0,n.jsxs)(x.Z,{direction:"horizontal",align:"start",children:[(0,n.jsx)(J.Z,{style:{width:100,height:100},src:e==null?void 0:e.image}),(0,n.jsxs)(x.Z,{direction:"vertical",children:[(0,n.jsxs)(E.Z.Text,{children:["\u89C4\u683CID:",e==null?void 0:e.sku_no]}),(0,n.jsxs)(x.Z,{direction:"vertical",children:[(0,n.jsx)(E.Z.Text,{style:{fontWeight:"bold",width:180},ellipsis:!0,children:l==null?void 0:l.title}),(0,n.jsx)(E.Z.Text,{children:e!=null&&e.specs?(d=JSON.parse(e==null?void 0:e.specs))===null||d===void 0||(o=d.map(function(p){return p.value}))===null||o===void 0?void 0:o.join("\uFF0C"):"-"})]})]})]})}},{title:"\u5F53\u524D\u4EF7\u683C",dataIndex:"price"},{title:"\u5F53\u524D\u5E93\u5B58",dataIndex:"stock"},{title:"\u6539\u540E\u4EF7\u683C",dataIndex:"afterPrice",render:function(s,e,d){var o;return(0,n.jsx)(G.Z,{value:(o=D[d])===null||o===void 0?void 0:o.afterPrice,onChange:function(A){j(function(U){var T=k()(U);return T[d].afterPrice=A,T})}})}},{title:"\u6539\u540E\u5E93\u5B58",dataIndex:"afterStock",render:function(s,e,d){var o;return(0,n.jsx)(G.Z,{value:(o=D[d])===null||o===void 0?void 0:o.afterStock,onChange:function(A){j(function(U){var T=k()(U);return T[d].afterStock=A,T})}})}}],R=function(){var u=g()(_()().mark(function s(e){return _()().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",W.NX.request(P()(P()({},e),{},{page:e==null?void 0:e.current,id:l==null?void 0:l.id})).then(function(p){var A,U,T,Y;return j((p==null||(A=p.data)===null||A===void 0||(U=A.list)===null||U===void 0?void 0:U.map(function(fe){return P()(P()({},fe),{},{afterPrice:null,afterStock:null})}))||[]),{success:!0,data:(p==null||(T=p.data)===null||T===void 0?void 0:T.list)||[],total:(p==null||(Y=p.data)===null||Y===void 0?void 0:Y.total)||0}}));case 1:case"end":return o.stop()}},s)}));return function(e){return u.apply(this,arguments)}}();return(0,n.jsxs)(Q.Z,{title:"\u914D\u7F6E",width:window.innerWidth>1e3?1e3:window.innerWidth-100,open:a,destroyOnClose:!0,onOk:function(){var s=D.map(function(e){return{id:e.id,price:(e==null?void 0:e.afterPrice)||(e==null?void 0:e.price),stock:(e==null?void 0:e.afterStock)||(e==null?void 0:e.stock)}});console.log(s),C(s)},onCancel:$,children:[(0,n.jsx)(re.Z,{children:(0,n.jsxs)(x.Z,{direction:"horizontal",align:"start",children:[(0,n.jsx)(J.Z,{style:{width:120},src:l!=null&&l.images?l==null||(r=l.images)===null||r===void 0?void 0:r.split(",")[0]:""}),(0,n.jsxs)(x.Z,{align:"start",direction:"vertical",children:[(0,n.jsx)(E.Z.Text,{style:{fontWeight:"bold",width:300},ellipsis:!0,children:l==null?void 0:l.title}),(0,n.jsxs)(E.Z.Text,{children:["ID:",l==null?void 0:l.spu_no]})]})]})}),(0,n.jsx)(ee.QVr,{dataSource:D,scroll:{x:"max-content"},request:R,style:{marginTop:20},columns:t,toolBarRender:function(){return[(0,n.jsx)(G.Z,{style:{width:120},placeholder:"\u8BF7\u8F93\u5165\u4EF7\u683C",onChange:function(e){h(e)}},"price"),(0,n.jsx)(G.Z,{style:{width:120},placeholder:"\u8BF7\u8F93\u5165\u5E93\u5B58",onChange:function(e){c(e)}},"stock"),(0,n.jsx)(ae.Z,{onClick:function(){j(function(e){var d=k()(e);return d.forEach(function(o){o.afterPrice=B,o.afterStock=f}),d})},children:"\u6279\u91CF\u4FEE\u6539"},"edit")]},search:!1})]})};function he(){var K=(0,O.useState)(),v=y()(K,2),r=v[0],a=v[1],C=(0,O.useRef)(),$=(0,O.useState)("price"),l=y()($,2),w=l[0],I=l[1],S=(0,O.useState)({}),b=y()(S,2),D=b[0],j=b[1],Z=(0,O.useState)(!1),m=y()(Z,2),B=m[0],h=m[1],M=[{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(c,t){return(0,n.jsx)(_e,{record:t})}},{title:"\u9500\u552E\u4EF7",hideInSearch:!0,dataIndex:"price_min",key:"price_min",render:function(c,t){return(0,n.jsxs)(x.Z,{direction:"vertical",children:[(0,n.jsx)(E.Z.Text,{children:(t==null?void 0:t.price_min)===(t==null?void 0:t.price_max)?t==null?void 0:t.price_min:"".concat(t==null?void 0:t.price_min,"-").concat(t==null?void 0:t.price_max)}),(0,n.jsx)(E.Z.Link,{onClick:function(){I("price"),j(t),h(!0)},children:"\u4FEE\u6539\u4EF7\u683C"})]})}},{title:"\u5E93\u5B58",hideInSearch:!0,dataIndex:"stock",key:"stock",render:function(c,t){return(0,n.jsxs)(x.Z,{direction:"vertical",children:[(0,n.jsx)(E.Z.Text,{children:t==null?void 0:t.stock}),(0,n.jsx)(E.Z.Link,{onClick:function(){I("stock"),j(t),h(!0)},children:"\u4FEE\u6539\u5E93\u5B58"})]})}},{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(c,t){return(0,n.jsx)(ce,{actionRef:C,record:t})}}],N=function(){var f=g()(_()().mark(function c(t){return _()().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",W.gp.request(P()(P()({},t),{},{page:t.current,page_size:t.pageSize})).then(function(s){var e,d;return{success:!0,data:(s==null||(e=s.data)===null||e===void 0?void 0:e.list)||[],total:(s==null||(d=s.data)===null||d===void 0?void 0:d.total)||0}}));case 1:case"end":return u.stop()}},c)}));return function(t){return f.apply(this,arguments)}}();return(0,O.useEffect)(function(){},[]),(0,n.jsxs)("div",{children:[(0,n.jsx)(ee.QVr,{scroll:{x:"max-content"},options:{reload:!1},actionRef:C,params:{status:r},request:function(){var f=g()(_()().mark(function c(t){return _()().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",N(t));case 1:case"end":return u.stop()}},c)}));return function(c){return f.apply(this,arguments)}}(),headerTitle:(0,n.jsx)(de,{onChange:function(c){a(c)}}),columns:M}),(0,n.jsx)(ve,{visible:B,onCancel:function(){h(!1)},onOk:function(){var f=g()(_()().mark(function c(t){var R,u;return _()().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,W.Y1.request({},{sku_list:t});case 2:R=e.sent,R.code===0&&(X.ZP.success("\u64CD\u4F5C\u6210\u529F"),h(!1),C==null||(u=C.current)===null||u===void 0||u.reload());case 4:case"end":return e.stop()}},c)}));return function(c){return f.apply(this,arguments)}}(),data:D})]})}}}]);
|
|
|