|
- (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[3800],{20173:function(se,k,n){"use strict";n.d(k,{lM:function(){return Z},IH:function(){return G},mm:function(){return J},eP:function(){return ae},FM:function(){return ue}});var g=n(39428),x=n(11849),u=n(3182),A=n(48971),v=n(96690);function Z(d,o){return z.apply(this,arguments)}function z(){return z=(0,u.Z)((0,g.Z)().mark(function d(o,I){return(0,g.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,A.WY)((0,v.w)()+"/api/organize/page",{method:"POST",data:(0,x.Z)({},o)}));case 1:case"end":return r.stop()}},d)})),z.apply(this,arguments)}function G(d){return p.apply(this,arguments)}function p(){return p=(0,u.Z)((0,g.Z)().mark(function d(o){return(0,g.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,A.WY)((0,v.w)()+"/api/organize/addorg",{method:"POST",data:(0,x.Z)({},o)}));case 1:case"end":return t.stop()}},d)})),p.apply(this,arguments)}function re(d){return h.apply(this,arguments)}function h(){return h=_asyncToGenerator(_regeneratorRuntime().mark(function d(o){return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",request(getDataBaseUrl()+"\u200B/api\u200B/organize/getorglist",{method:"POST",data:_objectSpread({},o)}));case 1:case"end":return t.stop()}},d)})),h.apply(this,arguments)}function J(d){return R.apply(this,arguments)}function R(){return R=(0,u.Z)((0,g.Z)().mark(function d(o){return(0,g.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,A.WY)((0,v.w)()+"\u200B/api\u200B/organize/deleteorg?id="+o,{method:"GET"}));case 1:case"end":return t.stop()}},d)})),R.apply(this,arguments)}function ae(d){return B.apply(this,arguments)}function B(){return B=(0,u.Z)((0,g.Z)().mark(function d(o){return(0,g.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,A.WY)((0,v.w)()+"\u200B/api\u200B/organize/updateorg",{method:"POST",data:(0,x.Z)({},o)}));case 1:case"end":return t.stop()}},d)})),B.apply(this,arguments)}function de(d){return M.apply(this,arguments)}function M(){return M=_asyncToGenerator(_regeneratorRuntime().mark(function d(o){return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",request(getDataBaseUrl()+"/api\u200B/sysOrg\u200B/detail",{method:"POST",data:_objectSpread({},o)}));case 1:case"end":return t.stop()}},d)})),M.apply(this,arguments)}function ue(d){return W.apply(this,arguments)}function W(){return W=(0,u.Z)((0,g.Z)().mark(function d(o){return(0,g.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,A.WY)((0,v.w)()+"\u200B/api\u200B/organize/tree",{method:"GET",data:(0,x.Z)({},o)}));case 1:case"end":return t.stop()}},d)})),W.apply(this,arguments)}},72721:function(se,k,n){"use strict";n.r(k),n.d(k,{default:function(){return ye}});var g=n(57663),x=n(71577),u=n(39428),A=n(34792),v=n(48086),Z=n(3182),z=n(62350),G=n(24565),p=n(2824),re=n(49101),h=n(67294),J=n(28790),R=n(16894),ae=n(71194),B=n(50146),de=n(77883),M=n(85986),ue=n(62999),W=n(54680),d=n(47673),o=n(4107),I=n(9715),t=n(55843),r=n(85893),oe=function(e){var w=(0,h.useState)(),a=(0,p.Z)(w,2),_=a[0],V=a[1],K=t.Z.useForm(),E=(0,p.Z)(K,1),F=E[0];(0,h.useEffect)(function(){var P;if(e!=null&&(P=e.values)!==null&&P!==void 0&&P.id){var b,y,C,L,O,U,T,Y;F.setFieldsValue({id:e==null||(b=e.values)===null||b===void 0?void 0:b.id,name:e==null||(y=e.values)===null||y===void 0?void 0:y.name,orgId:e==null||(C=e.values)===null||C===void 0?void 0:C.orgId,phone:e==null||(L=e.values)===null||L===void 0?void 0:L.phone,sort:e==null||(O=e.values)===null||O===void 0?void 0:O.sort,description:e==null||(U=e.values)===null||U===void 0?void 0:U.description,orgName:e==null||(T=e.values)===null||T===void 0?void 0:T.orgName}),V(e==null||(Y=e.values)===null||Y===void 0?void 0:Y.orgId)}else F.resetFields()},[e.values]);var ee=function(b,y,C){F.setFieldsValue({orgName:y[0]}),V(b)};return(0,r.jsx)(B.Z,{title:e.values.id?"\u7F16\u8F91":"\u65B0\u5EFA",width:640,open:e.createModalVisible,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){e.onCancel()},destroyOnClose:!0,maskClosable:!1,children:(0,r.jsxs)(t.Z,{layout:"Horizontal",labelCol:{span:4},preserve:!1,form:F,initialValues:e.values,onFinish:e.onFinish,children:[(0,r.jsx)(t.Z.Item,{name:"id",hidden:!0,children:(0,r.jsx)(o.Z,{})}),(0,r.jsx)(t.Z.Item,{name:"orgName",hidden:!0,children:(0,r.jsx)(o.Z,{})}),(0,r.jsx)(t.Z.Item,{label:"\u6240\u5C5E\u7EC4\u7EC7",name:"orgId",rules:[{required:!0}],children:(0,r.jsx)(W.Z,{allowClear:!0,treeDefaultExpandAll:!0,treeData:e.OrgList,onChange:ee,value:_})}),(0,r.jsx)(t.Z.Item,{label:"\u573A\u666F\u540D\u79F0",name:"name",rules:[{required:!0,max:50}],children:(0,r.jsx)(o.Z,{})}),(0,r.jsx)(t.Z.Item,{label:"\u7535\u8BDD",name:"phone",rules:[{required:!0}],children:(0,r.jsx)(o.Z,{})}),(0,r.jsx)(t.Z.Item,{name:"sort",label:"\u6392\u5E8F",children:(0,r.jsx)(M.Z,{min:1,decimalSeparator:"0"})}),(0,r.jsx)(t.Z.Item,{label:"\u63CF\u8FF0",name:"description",children:(0,r.jsx)(o.Z,{})}),(0,r.jsxs)(t.Z.Item,{children:[(0,r.jsx)(x.Z,{htmlType:"button",style:{float:"right"},onClick:e.onCancel,children:"\u53D6\u6D88"}),(0,r.jsx)(x.Z,{disabled:!e.codeList.includes("StoreUp"),type:"primary",htmlType:"submit",style:{float:"right",marginRight:10},children:"\u4FDD\u5B58"})]})]})})},ce=oe,N=n(48971);function he(m){return Q.apply(this,arguments)}function Q(){return Q=(0,Z.Z)((0,u.Z)().mark(function m(e){return(0,u.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,N.WY)("/kitchbase/api/store/page",{method:"POST",data:e}));case 1:case"end":return a.stop()}},m)})),Q.apply(this,arguments)}function me(m){return X.apply(this,arguments)}function X(){return X=(0,Z.Z)((0,u.Z)().mark(function m(e){return(0,u.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,N.WY)("/kitchbase/api/store/add",{method:"POST",data:e}));case 1:case"end":return a.stop()}},m)})),X.apply(this,arguments)}function fe(m){return $.apply(this,arguments)}function $(){return $=(0,Z.Z)((0,u.Z)().mark(function m(e){return(0,u.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,N.WY)("/kitchbase/api/store/update",{method:"POST",data:e}));case 1:case"end":return a.stop()}},m)})),$.apply(this,arguments)}function ve(m){return q.apply(this,arguments)}function q(){return q=(0,Z.Z)((0,u.Z)().mark(function m(e){return(0,u.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,N.WY)("/kitchbase/api/store/delete",{method:"POST",data:e}));case 1:case"end":return a.stop()}},m)})),q.apply(this,arguments)}var ge=n(20173),Ze=n(64172),pe=function(){var e=(0,h.useState)([]),w=(0,p.Z)(e,2),a=w[0],_=w[1],V=(0,h.useState)([]),K=(0,p.Z)(V,2),E=K[0],F=K[1];(0,h.useEffect)(function(){Ze.Z.getRoleBasicMenu().then(function(c){c.data&&F(c.data)}),(0,ge.FM)().then(function(c){_(c.data)})},[]);var ee=(0,h.useState)(!1),P=(0,p.Z)(ee,2),b=P[0],y=P[1],C=(0,h.useRef)(),L=(0,h.useState)(),O=(0,p.Z)(L,2),U=O[0],T=O[1],Y=(0,h.useState)([]),ie=(0,p.Z)(Y,2),H=ie[0],te=ie[1],Se=[{title:"\u4E3B\u952E",dataIndex:"id",hideInSearch:!0,hideInTable:!0,tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key"},{title:"\u573A\u666F\u540D\u79F0",dataIndex:"name",ellipsis:!0},{title:"\u6240\u5C5E\u7EC4\u7EC7",dataIndex:"orgName",valueType:"treeSelect",fieldProps:{options:a,allowClear:!0},hideInSearch:!1},{title:"\u7535\u8BDD",dataIndex:"phone",search:!0},{title:"\u6392\u5E8F",dataIndex:"sort",search:!1},{title:"\u63CF\u8FF0",dataIndex:"description",search:!1},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",fixed:"right",width:200,render:function(s,l){return[(0,r.jsx)("a",{onClick:function(){y(!0),T(l)},children:"\u66F4\u65B0"},"update"),E.includes("StoreDel")&&(0,r.jsx)(G.Z,{type:"primary",title:"\u786E\u8BA4\u5220\u9664\u5417\uFF1F",okText:"\u662F",cancelText:"\u5426",onConfirm:function(){var i=[{id:l.id}];le(i)},onCancel:function(){},children:(0,r.jsx)("a",{href:"#",children:"\u5220\u9664"})},"primary")]}}],Ce=function(){var c=(0,Z.Z)((0,u.Z)().mark(function s(l){return(0,u.Z)().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,me(JSON.stringify(l)).then(function(S){S.succeeded?(v.default.success("\u6DFB\u52A0\u6210\u529F"),y(!1),T(void 0),C.current.reload()):v.default.error(S.errors)});case 2:case"end":return i.stop()}},s)}));return function(l){return c.apply(this,arguments)}}(),je=function(){var c=(0,Z.Z)((0,u.Z)().mark(function s(l){return(0,u.Z)().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,fe(JSON.stringify(l)).then(function(S){S.succeeded?(v.default.success("\u4FEE\u6539\u6210\u529F"),y(!1),T(void 0),C.current.reload()):v.default.error(S.errors)});case 2:case"end":return i.stop()}},s)}));return function(l){return c.apply(this,arguments)}}(),xe=function(){return(H==null?void 0:H.length)>0&&(0,r.jsx)(G.Z,{title:"\u786E\u8BA4\u5220\u9664\u5417?",onConfirm:we,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",children:(0,r.jsx)(x.Z,{type:"primary",children:"\u6279\u91CF\u5220\u9664"})})},we=function(){var s,l;le(H),te([]),(s=C.current)===null||s===void 0||(l=s.reloadAndRest)===null||l===void 0||l.call(s)},le=function(){var c=(0,Z.Z)((0,u.Z)().mark(function s(l){var f;return(0,u.Z)().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:return f=[],l.forEach(function(j){f.push(j.id)}),S.next=4,ve(f).then(function(j){if(j.succeeded){var D,ne;v.default.success("\u5220\u9664\u6210\u529F"),te([]),(D=C.current)===null||D===void 0||(ne=D.reloadAndRest)===null||ne===void 0||ne.call(D)}else v.default.error(j.errors)});case 4:case"end":return S.stop()}},s)}));return function(l){return c.apply(this,arguments)}}();return(0,r.jsxs)(J.ZP,{host:!0,header:{title:"",breadcrumb:{}},children:[(0,r.jsx)(R.ZP,{headerTitle:"\u573A\u666F\u4FE1\u606F",actionRef:C,rowKey:"id",pagination:{defaultPageSize:10},search:{labelWidth:120},toolBarRender:function(){return[E.includes("StoreAdd")&&(0,r.jsxs)(x.Z,{type:"primary",onClick:function(){y(!0)},children:[(0,r.jsx)(re.Z,{})," \u65B0\u5EFA"]},"primary"),E.includes("StoreDel")&&(0,r.jsx)(xe,{})]},request:function(){var c=(0,Z.Z)((0,u.Z)().mark(function s(l){var f,i;return(0,u.Z)().wrap(function(j){for(;;)switch(j.prev=j.next){case 0:return f=[],i=0,j.next=4,he(l).then(function(D){f=D.data.data,i=D.data.total});case 4:return j.abrupt("return",{data:f,success:!0,total:i});case 5:case"end":return j.stop()}},s)}));return function(s){return c.apply(this,arguments)}}(),columns:Se,rowSelection:{onChange:function(s,l){te(l)}}}),(0,r.jsx)(ce,{OrgList:a,codeList:E,onFinish:function(){var c=(0,Z.Z)((0,u.Z)().mark(function s(l){return(0,u.Z)().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(!l.id){i.next=5;break}return i.next=3,je(l);case 3:i.next=7;break;case 5:return i.next=7,Ce(l);case 7:case"end":return i.stop()}},s)}));return function(s){return c.apply(this,arguments)}}(),onCancel:function(){y(!1),T(void 0)},createModalVisible:b,values:U||{}})]})},ye=pe}}]);
|