2 lines
3.8 KiB
JavaScript
2 lines
3.8 KiB
JavaScript
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[948],{36428:function(G,D,e){var l=e(88351),d=e(87841),R=e(993),p=e(96268),M=e(93236),O=e(90040),T=e(8263),i=e(62086),r=["fieldProps","options","radioType","layout","proFieldProps","valueEnum"],B=M.forwardRef(function(t,c){var P=t.fieldProps,f=t.options,W=t.radioType,L=t.layout,j=t.proFieldProps,m=t.valueEnum,a=(0,d.Z)(t,r);return(0,i.jsx)(T.Z,(0,l.Z)((0,l.Z)({valueType:W==="button"?"radioButton":"radio",ref:c,valueEnum:(0,R.h)(m,void 0)},a),{},{fieldProps:(0,l.Z)({options:f,layout:L},P),proFieldProps:j,filedConfig:{customLightMode:!0}}))}),I=M.forwardRef(function(t,c){var P=t.fieldProps,f=t.children;return(0,i.jsx)(p.ZP,(0,l.Z)((0,l.Z)({},P),{},{ref:c,children:f}))}),u=(0,O.G)(I,{valuePropName:"checked",ignoreWidth:!0}),s=u;s.Group=B,s.Button=p.ZP.Button,s.displayName="ProFormComponent",D.Z=s},3175:function(G,D,e){e.r(D);var l=e(25359),d=e.n(l),R=e(57213),p=e.n(R),M=e(49811),O=e.n(M),T=e(54306),i=e.n(T),r=e(93236),B=e(33045),I=e(50336),u=e(40882),s=e(61786),t=e(36428),c=e(23674),P=e(18123),f=e.n(P),W=e(23653),L=e(85968),j=e(48970),m=e(90627),a=e(62086),$=m.Z.PermissionController.permissionTree,U=m.Z.ArticleController,_e=U.articleCreate,N=U.articleUpdate,ae=U.articleItem,te=m.Z.ArticleCategoryController.articleCategoryItems,F=m.Z.AdminController,V=F.adminUpdate,z=F.adminItem;D.default=function(){var H=(0,r.useState)([]),b=i()(H,2),C=b[0],J=b[1];(0,r.useEffect)(function(){$().then(function(o){var _=o.data;J(_)})},[]);var Q=(0,c.useParams)(),A=(0,r.useRef)(y),X=(0,r.useState)(),g=i()(X,2),Y=g[0],Z=g[1],ne=(0,r.useRef)(),y={id:"",nickname:"",username:"",email:"",avatar:"",status:0,password:"",permission_ids:[],authority_note:void 0},w=(0,r.useState)(y),x=i()(w,2),re=x[0],K=x[1],k=(0,r.useState)(""),S=i()(k,2),se=S[0],oe=S[1];(0,r.useEffect)(function(){z(Q).then(function(o){var _=o.data;_&&(A.current.setFieldsValue(_),A.current.setFieldsValue({permission_ids:_.auth}),Z(_.auth),K(_))})},[]);var q=function(){var o=O()(d()().mark(function _(E){var v,h;return d()().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return K(E),n.next=3,V(p()({},E));case 3:v=n.sent,h=v.success,h&&(K(y),history.back());case 6:case"end":return n.stop()}},_)}));return function(E){return o.apply(this,arguments)}}(),le=function(){var o=O()(d()().mark(function _(E){var v,h;return d()().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,N(p()({},E));case 2:v=n.sent,h=v.success;case 5:case"end":return n.stop()}},_)}));return function(E){return o.apply(this,arguments)}}();return(0,a.jsx)(I._z,{header:{title:"\u7BA1\u7406\u5458\u7F16\u8F91"},ghost:!0,children:(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)(u.A,{formRef:A,onFinish:function(_){q(_)},children:[(0,a.jsx)(s.Z,{hidden:!0,width:"md",name:"id"}),(0,a.jsxs)(u.A.Group,{children:[(0,a.jsx)(s.Z,{rules:[{required:!0,message:"\u8BF7\u8F93\u5165"}],width:"md",name:"mobile",label:"\u624B\u673A\u53F7",placeholder:"\u8BF7\u8F93\u5165"}),(0,a.jsx)(s.Z.Password,{width:"md",name:"password",label:"\u5BC6\u7801",placeholder:"\u8BF7\u8F93\u5165"})]}),(0,a.jsxs)(u.A.Group,{children:[(0,a.jsx)(s.Z,{rules:[{required:!0,message:"\u8BF7\u8F93\u5165"}],width:"md",name:"nickname",label:"\u6635\u79F0",placeholder:"\u8BF7\u8F93\u5165"}),(0,a.jsx)(u.A.Item,{label:"\u5934\u50CF",name:"avatar",children:(0,a.jsx)(j.Z,{fileType:"image",defaultValue:"",count:1,mode:""})})]}),(0,a.jsx)(t.Z.Group,{name:"status",radioType:"button",label:"\u72B6\u6001",options:[{label:"\u6B63\u5E38",value:0},{label:"\u51BB\u7ED3",value:1},{label:"\u7981\u7528",value:2}]}),(0,a.jsx)(u.A.Item,{label:"\u8BBE\u7F6E\u6743\u9650",name:"permission_ids",children:(C==null?void 0:C.length)>0&&(0,a.jsx)(B.Z,{checkable:!0,multiple:!0,showLine:!0,showIcon:!1,defaultExpandAll:!0,checkedKeys:Y,onCheck:function(_){Z(_),A.current.setFieldsValue({permission_ids:_})},fieldNames:{title:"name",key:"id"},treeData:C})})]})})})}}}]);
|