(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[2324],{40919:function(Le,K,n){"use strict";n.r(K),n.d(K,{default:function(){return pe}});var We=n(58024),te=n(91894),Ge=n(57663),w=n(71577),Ye=n(77883),ae=n(21888),Ke=n(88983),O=n(47933),Oe=n(71153),re=n(60331),ne=n(86582),ze=n(62350),ue=n(24565),c=n(39428),Me=n(34792),p=n(48086),m=n(3182),y=n(2824),se=n(6700),g=n(67294),ie=n(28790),le=n(85224),oe=n(16894),C=n(48971),x=n(96690);function de(h){return E.apply(this,arguments)}function E(){return E=(0,m.Z)((0,c.Z)().mark(function h(v){return(0,c.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",(0,C.WY)((0,x.w)()+"/api/goodsattributeprice/getpage",{method:"POST",data:v}));case 1:case"end":return u.stop()}},h)})),E.apply(this,arguments)}function ce(h){return A.apply(this,arguments)}function A(){return A=(0,m.Z)((0,c.Z)().mark(function h(v){return(0,c.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",(0,C.WY)((0,x.w)()+"/api/goodsattributeprice/add",{method:"POST",data:v}));case 1:case"end":return u.stop()}},h)})),A.apply(this,arguments)}function fe(h){return R.apply(this,arguments)}function R(){return R=(0,m.Z)((0,c.Z)().mark(function h(v){return(0,c.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",(0,C.WY)((0,x.w)()+"/api/goodsattributeprice/update",{method:"POST",data:v}));case 1:case"end":return u.stop()}},h)})),R.apply(this,arguments)}function z(h){return D.apply(this,arguments)}function D(){return D=(0,m.Z)((0,c.Z)().mark(function h(v){return(0,c.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",(0,C.WY)((0,x.w)()+"/api/goodsattributeprice/delete?id="+v,{method:"GET"}));case 1:case"end":return u.stop()}},h)})),D.apply(this,arguments)}function he(h){return T.apply(this,arguments)}function T(){return T=(0,m.Z)((0,c.Z)().mark(function h(v){return(0,c.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",(0,C.WY)((0,x.w)()+"/api/goodsattribute/getbygoodsidattribute?id="+v,{method:"Get"}));case 1:case"end":return u.stop()}},h)})),T.apply(this,arguments)}var t=n(85893),ve=function(v){var b=(0,g.useState)(!1),u=(0,y.Z)(b,2),Ne=u[0],He=u[1],ge=(0,g.useState)([]),M=(0,y.Z)(ge,2),me=M[0],ye=M[1],Ze=(0,g.useState)(""),N=(0,y.Z)(Ze,2),Ce=N[0],V=N[1],Se=(0,g.useState)([]),H=(0,y.Z)(Se,2),$=H[0],I=H[1],j=(0,g.useRef)(),be=(0,g.useState)(),J=(0,y.Z)(be,2),Je=J[0],je=J[1],xe=(0,g.useState)([]),Q=(0,y.Z)(xe,2),F=Q[0],U=Q[1],Fe=(0,g.useState)(0),X=(0,y.Z)(Fe,2),k=X[0],P=X[1],we=(0,g.useState)([]),q=(0,y.Z)(we,2),S=q[0],B=q[1],Ee=(0,g.useState)([]),_=(0,y.Z)(Ee,2),Qe=_[0],Ae=_[1];(0,g.useEffect)(function(){Re()},[]);function Re(){he(v.location.query.values.id).then(function(s){s.data&&s.data.length>0&&B(s.data)})}var De=function(){var s=(0,m.Z)((0,c.Z)().mark(function a(e){var i;return(0,c.Z)().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(i=p.default.loading("\u6B63\u5728\u5220\u9664"),e){o.next=3;break}return o.abrupt("return",!0);case 3:return o.next=5,z(e.map(function(d){return d.id})).then(function(d){d.succeeded?(p.default.success("\u5220\u9664\u6210\u529F"),j.current.reload()):p.default.error(d.errors)});case 5:return i(),o.abrupt("return",!0);case 7:case"end":return o.stop()}},a)}));return function(e){return s.apply(this,arguments)}}(),Te=[{title:"\u4E3B\u952E",dataIndex:"id",hideInSearch:!0,hideInTable:!0,tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key",render:function(a,e){return(0,t.jsx)("a",{onClick:function(){je(e),setShowDetail(!0)},children:a})}},{title:"\u5C5E\u6027",dataIndex:"goodsattributeValue",valueType:"textarea",ellipsis:!0,readonly:!0},{title:"\u4EF7\u683C",dataIndex:"price",hideInSearch:!0},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(a,e,i,l){return[(0,t.jsx)("a",{onClick:function(){var d;l==null||(d=l.startEditable)===null||d===void 0||d.call(l,e.id)},children:"\u66F4\u65B0"},"config"),(0,t.jsx)(ue.Z,{type:"primary",title:"\u786E\u8BA4\u5220\u9664\u5417\uFF1F",okText:"\u662F",cancelText:"\u5426",onConfirm:(0,m.Z)((0,c.Z)().mark(function o(){return(0,c.Z)().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,z([e.id]).then(function(Z){Z.succeeded?(p.default.success("\u5220\u9664\u6210\u529F"),j.current.reload()):p.default.error(Z.errors)});case 2:case"end":return f.stop()}},o)})),onCancel:function(){},children:(0,t.jsx)("a",{href:"#",children:"\u5220\u9664"})},"primary")]}}],Ve=function(a){for(var e=a.target,i=e.name,l=e.value,o="",d=(0,ne.Z)($),f=0;f0&&(0,t.jsx)(le.Z,{extra:(0,t.jsxs)("div",{children:["\u5DF2\u9009\u62E9"," ",(0,t.jsx)("a",{style:{fontWeight:600},children:F.length})," ","\u9879 \xA0\xA0"]}),children:(0,t.jsx)(w.Z,{onClick:(0,m.Z)((0,c.Z)().mark(function s(){var a,e;return(0,c.Z)().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,De(F);case 2:U([]),(a=j.current)===null||a===void 0||(e=a.reloadAndRest)===null||e===void 0||e.call(a);case 4:case"end":return l.stop()}},s)})),children:"\u5220\u9664"})})]})})},pe=ve}}]);