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