(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[2735],{1686:function(J,y,e){"use strict";e.r(y),e.d(y,{default:function(){return G}});var N=e(71194),E=e(50146),Q=e(43358),R=e(34041),X=e(47673),B=e(4107),k=e(57663),z=e(71577),b=e(62350),j=e(24565),o=e(39428),q=e(34792),d=e(48086),h=e(3182),_=e(9715),x=e(55843),A=e(2824),P=e(90631),v=e(67294),$=e(28790),O=e(16894),m=e(48971),p=e(96690),c={page:function(i){return i.isreport=!0,(0,m.WY)((0,p.vp)()+"/api/ThirdAuthorize/Page",{method:"Post",data:i})},GetAllStore:function(){return(0,m.WY)((0,p.zr)()+"/api/shop/alllist",{method:"GET"})},Create:function(i){return(0,m.WY)((0,p.vp)()+"/api/ThirdAuthorize/Create",{method:"Post",data:i})},Update:function(i){return(0,m.WY)((0,p.vp)()+"/api/ThirdAuthorize/Update",{method:"Post",data:i})},Del:function(i){return(0,m.WY)((0,p.vp)()+"/api/ThirdAuthorize/Del?id="+i,{method:"Post"})}},t=e(85893),W=function(){var i=(0,v.useState)(),S=(0,A.Z)(i,2),ee=S[0],te=S[1],M=(0,v.useState)([]),I=(0,A.Z)(M,2),F=I[0],U=I[1],C=(0,v.useRef)(),Y=(0,v.useState)(!1),T=(0,A.Z)(Y,2),L=T[0],g=T[1],K=x.Z.useForm(),V=(0,A.Z)(K,1),D=V[0];(0,v.useEffect)(function(){w()},[]);var w=function(){var s=(0,h.Z)((0,o.Z)().mark(function l(){var n;return(0,o.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,c.GetAllStore();case 2:n=r.sent,n.statusCode==200?U(n.data):d.default.error(n.msg||"\u83B7\u53D6\u5E97\u94FA\u5217\u8868\u5931\u8D25");case 4:case"end":return r.stop()}},l)}));return function(){return s.apply(this,arguments)}}(),H=[{title:"\u4E3B\u952E",dataIndex:"id",tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key",hideInSearch:!0,hideInTable:!0},{title:"\u5F52\u5C5E\u573A\u666F",dataIndex:"storeId",ellipsis:!0,hideInSearch:!0,render:function(l,n){var u=F.find(function(r){return r.id===n.storeId});if(u)return(0,t.jsx)("div",{children:u.name})}},{title:"\u6388\u6743\u7801",dataIndex:"authorizeCode",hideInSearch:!0},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",width:200,render:function(l,n){return[(0,t.jsx)(j.Z,{title:"\u786E\u5B9A\u8981\u91CD\u65B0\u6388\u6743\u5417?",onConfirm:function(){c.Update({id:n.id}).then(function(r){r.data?(d.default.success("\u4FEE\u6539\u6210\u529F"),g(!1),C.current.reloadAndRest()):d.default.error("\u4FEE\u6539\u5931\u8D25")})},okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",children:(0,t.jsx)("a",{onClick:(0,h.Z)((0,o.Z)().mark(function u(){return(0,o.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:case"end":return a.stop()}},u)})),children:"\u91CD\u65B0\u6388\u6743"},n.id)}),(0,t.jsx)(j.Z,{title:"\u786E\u8BA4\u5220\u9664\u5417?",onConfirm:function(){c.Del(n.id).then(function(r){r.data?(d.default.success("\u5220\u9664\u6210\u529F"),g(!1),C.current.reloadAndRest()):d.default.error("\u5220\u9664\u6210\u529F")})},okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",children:(0,t.jsx)("a",{onClick:(0,h.Z)((0,o.Z)().mark(function u(){return(0,o.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:case"end":return a.stop()}},u)})),children:"\u5220\u9664"},n.id)})]}}];return(0,t.jsxs)($.ZP,{header:{title:"",breadcrumb:{}},children:[(0,t.jsx)(O.ZP,{headerTitle:"",actionRef:C,rowKey:"orderFlowId",search:{labelWidth:120},toolBarRender:function(){return[(0,t.jsxs)(z.Z,{type:"primary",onClick:function(){g(!0)},children:[(0,t.jsx)(P.Z,{})," \u65B0\u5EFA"]},"create")]},columns:H,request:function(){var s=(0,h.Z)((0,o.Z)().mark(function l(n,u,r){var a;return(0,o.Z)().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,c.page(n);case 2:return a=f.sent,f.abrupt("return",{data:a.data.data,success:!0,total:a.data.total});case 4:case"end":return f.stop()}},l)}));return function(l,n,u){return s.apply(this,arguments)}}()}),(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(E.Z,{title:"\u6388\u6743",open:L,onOk:function(){D.submit()},onCancel:function(){g(!1)},children:(0,t.jsxs)(x.Z,{form:D,preserve:!1,layout:"horizontal",labelCol:{span:4},onFinish:function(){var s=(0,h.Z)((0,o.Z)().mark(function l(n){return(0,o.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:n.id?c.Update(n).then(function(a){a.data?(d.default.success("\u4FEE\u6539\u6210\u529F"),handleModalVisible(!1),C.current.reloadAndRest()):d.default.error("\u4FEE\u6539\u5931\u8D25")}):c.Create(n).then(function(a){a.data?(g(!1),d.default.success("\u6DFB\u52A0\u6210\u529F"),C.current.reloadAndRest()):d.default.error(a.errors||"\u6DFB\u52A0\u5931\u8D25")});case 1:case"end":return r.stop()}},l)}));return function(l){return s.apply(this,arguments)}}(),children:[(0,t.jsx)(x.Z.Item,{name:"id",hidden:!0,children:(0,t.jsx)(B.Z,{})}),(0,t.jsx)(x.Z.Item,{label:"\u5F52\u5C5E\u573A\u666F",name:"storeId",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u5F52\u5C5E\u573A\u666F\uFF01"}],children:(0,t.jsx)(R.Z,{allowClear:!0,placeholder:"\u8BF7\u9009\u62E9\u5F52\u5C5E\u573A\u666F",style:{width:"100%"},children:F.map(function(s){return(0,t.jsx)(Option,{value:s.id,children:s.name},s.id)})})})]})})})]})},G=W}}]);
