(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[4336],{55527:function(ye,U,s){"use strict";s.r(U),s.d(U,{default:function(){return de}});var Se=s(71194),M=s(50146),je=s(9715),m=s(55843),xe=s(47673),y=s(4107),we=s(57663),T=s(71577),Ce=s(62350),H=s(24565),a=s(39428),Fe=s(34792),f=s(48086),p=s(3182),S=s(2824),Q=s(49101),Z=s(67294),X=s(28790),q=s(85224),_=s(16894),Ee=s(79361),Ie=s(43358),j=s(34041),r=s(85893),ee=function(d){var h,n=j.Z.Option,w=j.Z.OptGroup;return(0,r.jsx)(M.Z,{title:d.values.id?"\u7F16\u8F91":"\u65B0\u5EFA",width:640,visible:d.createModalVisible,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){d.onCancel()},destroyOnClose:!0,children:(0,r.jsxs)(m.Z,{preserve:!1,initialValues:d.values,onFinish:d.onFinish,children:[(0,r.jsx)(m.Z.Item,{name:"id",hidden:!0,children:(0,r.jsx)(y.Z,{})}),(0,r.jsx)(m.Z.Item,{label:"\u540D\u79F0",name:"name",rules:[{required:!0}],children:(0,r.jsx)(y.Z,{})}),(0,r.jsx)(m.Z.Item,{label:"\u7535\u8BDD",name:"phone",rules:[{required:!0}],children:(0,r.jsx)(y.Z,{})}),(0,r.jsx)(m.Z.Item,{label:"\u5DE5\u53F7",name:"number",rules:[{required:!0}],children:(0,r.jsx)(y.Z,{})}),(0,r.jsx)(m.Z.Item,{label:"\u95E8\u5E97",name:"shopId",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u95E8\u5E97\uFF01"}],children:(0,r.jsx)(j.Z,{allowClear:!0,placeholder:"\u8BF7\u9009\u62E9\u95E8\u5E97",style:{width:"100%"},children:d==null||(h=d.storeList)===null||h===void 0?void 0:h.map(function(g){return(0,r.jsx)(n,{value:g.id,children:g.text},g.id)})})}),(0,r.jsx)(m.Z.Item,{noStyle:!0,shouldUpdate:function(C,$){return C.mode!==$.mode},children:function(C){var $=C.getFieldValue;return d.values.id?(0,r.jsx)(m.Z.Item,{name:"status",label:"\u72B6\u6001",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u72B6\u6001"}],children:(0,r.jsx)(j.Z,{placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001",children:(0,r.jsxs)(w,{children:[(0,r.jsx)(j.Z.Option,{value:0,children:"\u6B63\u5E38"}),(0,r.jsx)(j.Z.Option,{value:1,children:"\u505C\u7528"})]})})}):null}}),(0,r.jsx)(m.Z.Item,{children:(0,r.jsx)(T.Z,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})})},re=ee,x=s(48971);function te(){return B.apply(this,arguments)}function B(){return B=(0,p.Z)((0,a.Z)().mark(function c(){return(0,a.Z)().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return h.abrupt("return",(0,x.WY)("/storemanagement/api/shop/alllist",{method:"GET"}));case 1:case"end":return h.stop()}},c)})),B.apply(this,arguments)}function ae(c){return b.apply(this,arguments)}function b(){return b=(0,p.Z)((0,a.Z)().mark(function c(d){return(0,a.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,x.WY)("/storemanagement/api/StoreStaff/GetStoreStaffPage",{method:"POST",data:d}));case 1:case"end":return n.stop()}},c)})),b.apply(this,arguments)}function ne(c){return O.apply(this,arguments)}function O(){return O=(0,p.Z)((0,a.Z)().mark(function c(d){return(0,a.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,x.WY)("/storemanagement/api/StoreStaff/AddStoreStaff",{method:"POST",data:d}));case 1:case"end":return n.stop()}},c)})),O.apply(this,arguments)}function se(c){return R.apply(this,arguments)}function R(){return R=(0,p.Z)((0,a.Z)().mark(function c(d){return(0,a.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,x.WY)("/storemanagement/api/StoreStaff/UpdateStoreStaff",{method:"put",data:d}));case 1:case"end":return n.stop()}},c)})),R.apply(this,arguments)}function ue(c){return P.apply(this,arguments)}function P(){return P=(0,p.Z)((0,a.Z)().mark(function c(d){return(0,a.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,x.WY)("\u200B/storemanagement/api/StoreStaff/DelStoreStaff",{method:"DELETE",data:d}));case 1:case"end":return n.stop()}},c)})),P.apply(this,arguments)}function le(c){return D.apply(this,arguments)}function D(){return D=(0,p.Z)((0,a.Z)().mark(function c(d){return(0,a.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,x.WY)("/storemanagement/api/StoreStaff/UpdateStoreStaffPwd",{method:"put",data:d}));case 1:case"end":return n.stop()}},c)})),D.apply(this,arguments)}var E="message",ie=function(){var d=(0,Z.useState)(!1),h=(0,S.Z)(d,2),n=h[0],w=h[1],g=(0,Z.useState)(!1),C=(0,S.Z)(g,2),$=C[0],G=C[1],F=(0,Z.useRef)(),oe=(0,Z.useState)(),V=(0,S.Z)(oe,2),L=V[0],A=V[1],ce=(0,Z.useState)([]),W=(0,S.Z)(ce,2),I=W[0],k=W[1],fe=(0,Z.useState)([]),Y=(0,S.Z)(fe,2),Te=Y[0],$e=Y[1],he=(0,Z.useState)([]),J=(0,S.Z)(he,2),N=J[0],pe=J[1];(0,Z.useEffect)(function(){me()},[]);var me=function(){var o=(0,p.Z)((0,a.Z)().mark(function u(){var t,l;return(0,a.Z)().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,te();case 2:t=i.sent,t.statusCode==200?(l=[],t.data.forEach(function(v){l.push({id:v.id,text:v.name,value:v.id,label:v.name})}),pe(l)):f.default.error(t.msg||"\u83B7\u53D6\u5E97\u94FA\u5217\u8868\u5931\u8D25");case 4:case"end":return i.stop()}},u)}));return function(){return o.apply(this,arguments)}}(),ve=function(){var o=(0,p.Z)((0,a.Z)().mark(function u(t){return(0,a.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,f.default.loading("\u6B63\u5728\u6DFB\u52A0",E),e.next=4,ne(JSON.stringify(t)).then(function(i){return f.default.destroy(E),i.data?(f.default.success("\u6DFB\u52A0\u6210\u529F"),F.current.reload(),!0):(f.default.error(i.errors||"\u6DFB\u52A0\u5931\u8D25"),!1)});case 4:e.next=10;break;case 6:return e.prev=6,e.t0=e.catch(0),f.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),e.abrupt("return",!1);case 10:case"end":return e.stop()}},u,null,[[0,6]])}));return function(t){return o.apply(this,arguments)}}(),Ze=function(){var o=(0,p.Z)((0,a.Z)().mark(function u(t){return(0,a.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,f.default.loading("\u6B63\u5728\u4FEE\u6539",E),f.default.destroy(E),e.next=5,se(JSON.stringify(t)).then(function(i){return f.default.destroy(E),i.data?(f.default.success("\u4FEE\u6539\u6210\u529F"),F.current.reload(),!0):(f.default.error(i.errors||"\u4FEE\u6539\u5931\u8D25"),!1)});case 5:e.next=11;break;case 7:return e.prev=7,e.t0=e.catch(0),f.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),e.abrupt("return",!1);case 11:case"end":return e.stop()}},u,null,[[0,7]])}));return function(t){return o.apply(this,arguments)}}(),z=function(){var o=(0,p.Z)((0,a.Z)().mark(function u(t){return(0,a.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,ue(t).then(function(i){return i.data?(f.default.success("\u5220\u9664\u6210\u529F"),F.current.reload(),!0):(f.default.error("\u5220\u9664\u5931\u8D25"),!1)});case 3:e.next=9;break;case 5:return e.prev=5,e.t0=e.catch(0),f.default.error("\u5220\u9664\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),e.abrupt("return",!1);case 9:case"end":return e.stop()}},u,null,[[0,5]])}));return function(t){return o.apply(this,arguments)}}(),ge=[{title:"\u4E3B\u952E",dataIndex:"id",hideInSearch:!0,hideInTable:!0,tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key"},{title:"\u540D\u79F0",dataIndex:"name",valueType:"textarea",search:!1},{title:"\u7535\u8BDD",dataIndex:"phone",valueType:"textarea",search:!1},{title:"\u804C\u5DE5\u7F16\u53F7",dataIndex:"number",valueType:"textarea",search:!1},{title:"\u5F52\u5C5E\u95E8\u5E97",dataIndex:"shopId",ellipsis:!0,valueType:"select",fieldProps:{options:N}},{title:"\u72B6\u6001",dataIndex:"status",hideInForm:!0,search:!1,valueEnum:{0:{text:"\u6B63\u5E38",status:"Processing"},1:{text:"\u505C\u7528",status:"Success"},2:{text:"\u5220\u9664",status:"Error"}}},{title:"\u521B\u5EFA\u65F6\u95F4",dataIndex:"createAt",hideInForm:!0,search:!1},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",fixed:"right",width:200,render:function(u,t){return[(0,r.jsx)("a",{onClick:function(){w(!0),A(t)},children:" \u66F4\u65B0"},"config"),(0,r.jsx)(H.Z,{title:"\u786E\u5B9A\u8981\u5220\u9664\u5417\uFF1F",onConfirm:(0,p.Z)((0,a.Z)().mark(function l(){return(0,a.Z)().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:debugger;return i.next=3,z([t.id]);case 3:case"end":return i.stop()}},l)})),okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",children:(0,r.jsx)("a",{href:"#",children:"\u5220\u9664"})},"delete"),(0,r.jsx)("a",{onClick:function(){G(!0),t.pwd="",A(t)},children:" \u4FEE\u6539\u5BC6\u7801"},"config")]}}];return(0,r.jsxs)(X.ZP,{header:{title:"",breadcrumb:{}},children:[(0,r.jsx)(_.ZP,{pagination:{pageSize:10},scroll:{x:1300},headerTitle:"\u5E97\u94FA\u7C7B\u578B",actionRef:F,rowKey:"id",search:{labelWidth:120},toolBarRender:function(){return[(0,r.jsxs)(T.Z,{type:"primary",onClick:function(){w(!0)},children:[(0,r.jsx)(Q.Z,{})," \u65B0\u5EFA"]},"primary")]},request:function(){var o=(0,p.Z)((0,a.Z)().mark(function u(t){var l,e;return(0,a.Z)().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return l=[],e=0,v.next=4,ae(t).then(function(K){l=K.data.data,e=K.data.total});case 4:return v.abrupt("return",{data:l,success:!0,total:e});case 5:case"end":return v.stop()}},u)}));return function(u){return o.apply(this,arguments)}}(),columns:ge,rowSelection:{onChange:function(u,t){k(t)}}}),(I==null?void 0:I.length)>0&&(0,r.jsx)(q.Z,{extra:(0,r.jsxs)("div",{children:["\u5DF2\u9009\u62E9"," ",(0,r.jsx)("a",{style:{fontWeight:600},children:I.length})," ","\u9879 \xA0\xA0"]}),children:(0,r.jsx)(T.Z,{onClick:(0,p.Z)((0,a.Z)().mark(function o(){var u,t;return(0,a.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,z(I);case 2:k([]),(u=F.current)===null||u===void 0||(t=u.reloadAndRest)===null||t===void 0||t.call(u);case 4:case"end":return e.stop()}},o)})),children:"\u5220\u9664"})}),(0,r.jsx)(re,{onFinish:function(){var o=(0,p.Z)((0,a.Z)().mark(function u(t){var l;return(0,a.Z)().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:l=!1,t.id?l=Ze(t):l=ve(t),l&&(w(!1),A(void 0),F.current.reload());case 3:case"end":return i.stop()}},u)}));return function(u){return o.apply(this,arguments)}}(),onCancel:function(){w(!1),A(void 0)},createModalVisible:n,storeList:N,values:L||{}}),(0,r.jsx)(M.Z,{title:"\u4FEE\u6539\u5BC6\u7801",open:$,footer:null,onCancel:function(){G(!1)},children:(0,r.jsxs)(m.Z,{preserve:!1,onFinish:(0,p.Z)((0,a.Z)().mark(function o(){return(0,a.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,le(JSON.stringify(L)).then(function(l){l.data?(f.default.success("\u4FEE\u6539\u6210\u529F"),G(!1)):f.default.error(l.errors||"\u4FEE\u6539\u5931\u8D25")});case 2:case"end":return t.stop()}},o)})),initialValues:L,children:[(0,r.jsx)(m.Z.Item,{name:"id",hidden:!0,children:(0,r.jsx)(y.Z,{})}),(0,r.jsx)(m.Z.Item,{label:"\u5BC6\u7801",name:"pwd",rules:[{required:!0}],children:(0,r.jsx)(y.Z,{})}),(0,r.jsx)(m.Z.Item,{children:(0,r.jsx)(T.Z,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})})]})},de=ie}}]);