|
|
|
(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[2735],{1686:function(H,y,e){"use strict";e.r(y),e.d(y,{default:function(){return W}});var J=e(71194),D=e(50146),N=e(43358),E=e(34041),Q=e(47673),B=e(4107),X=e(57663),P=e(71577),k=e(62350),j=e(24565),o=e(39428),b=e(34792),d=e(48086),h=e(3182),q=e(9715),C=e(55843),x=e(2824),z=e(90631),m=e(67294),R=e(28790),$=e(16894),v=e(48971),c={page:function(i){return i.isreport=!0,(0,v.WY)("/ordermanage/api/ThirdAuthorize/Page",{method:"Post",data:i})},GetAllStore:function(){return(0,v.WY)("/groupmeal/api/shop/alllist",{method:"GET"})},Create:function(i){return(0,v.WY)("/ordermanage/api/ThirdAuthorize/Create",{method:"Post",data:i})},Update:function(i){return(0,v.WY)("/ordermanage/api/ThirdAuthorize/Update",{method:"Post",data:i})},Del:function(i){return(0,v.WY)("/ordermanage/api/ThirdAuthorize/Del?id="+i,{method:"Post"})}},t=e(85893),O=function(){var i=(0,m.useState)(),S=(0,x.Z)(i,2),_=S[0],ee=S[1],G=(0,m.useState)([]),A=(0,x.Z)(G,2),F=A[0],M=A[1],Z=(0,m.useRef)(),U=(0,m.useState)(!1),I=(0,x.Z)(U,2),Y=I[0],g=I[1],L=C.Z.useForm(),w=(0,x.Z)(L,1),T=w[0];(0,m.useEffect)(function(){K()},[]);var K=function(){var s=(0,h.Z)((0,o.Z)().mark(function l(){var r;return(0,o.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,c.GetAllStore();case 2:r=n.sent,r.statusCode==200?M(r.data):d.default.error(r.msg||"\u83B7\u53D6\u5E97\u94FA\u5217\u8868\u5931\u8D25");case 4:case"end":return n.stop()}},l)}));return function(){return s.apply(this,arguments)}}(),V=[{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,render:function(l,r){var u=F.find(function(n){return n.id===r.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,r){return[(0,t.jsx)(j.Z,{title:"\u786E\u5B9A\u8981\u91CD\u65B0\u6388\u6743\u5417?",onConfirm:function(){c.Update({id:r.id}).then(function(n){n.data?(d.default.success("\u4FEE\u6539\u6210\u529F"),g(!1),Z.current.reload()):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"},r.id)}),(0,t.jsx)(j.Z,{title:"\u786E\u8BA4\u5220\u9664\u5417?",onConfirm:function(){c.Del(r.id).then(function(n){n.data?(d.default.success("\u5220\u9664\u6210\u529F"),g(!1),Z.current.reload()):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"},r.id)})]}}];return(0,t.jsxs)(R.ZP,{header:{title:"",breadcrumb:{}},children:[(0,t.jsx)($.ZP,{headerTitle:"",actionRef:Z,rowKey:"orderFlowId",search:{labelWidth:120},toolBarRender:function(){return[(0,t.jsxs)(P.Z,{type:"primary",onClick:function(){g(!0)},children:[(0,t.jsx)(z.Z,{})," \u65B0\u5EFA"]},"create")]},columns:V,request:function(){var s=(0,h.Z)((0,o.Z)().mark(function l(r,u,n){var a;return(0,o.Z)().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,c.page(r);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,r,u){return s.apply(this,arguments)}}()}),(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(D.Z,{title:"\u6388\u6743",open:Y,onOk:function(){T.submit()},onCancel:function(){g(!1)},children:(0,t.jsxs)(C.Z,{form:T,preserve:!1,layout:"horizontal",labelCol:{span:4},onFinish:function(){var s=(0,h.Z)((0,o.Z)().mark(function l(r){return(0,o.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:r.id?c.Update(r).then(function(a){a.data?(d.default.success("\u4FEE\u6539\u6210\u529F"),handleModalVisible(!1),Z.current.reload()):d.default.error("\u4FEE\u6539\u5931\u8D25")}):c.Create(r).then(function(a){a.data?(g(!1),d.default.success("\u6DFB\u52A0\u6210\u529F"),Z.current.reload()):d.default.error(a.errors||"\u6DFB\u52A0\u5931\u8D25")});case 1:case"end":return n.stop()}},l)}));return function(l){return s.apply(this,arguments)}}(),children:[(0,t.jsx)(C.Z.Item,{name:"id",hidden:!0,children:(0,t.jsx)(B.Z,{})}),(0,t.jsx)(C.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)(E.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)})})})]})})})]})},W=O}}]); |