|
|
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[70928],{93260:function(e,t,n){n.r(t);var o=n(85573),i=n.n(o),r=n(7557),a=n.n(r),s=n(82242),l=n.n(s),c=n(41498),u=n.n(c),d=n(79800),p=n.n(d),f=n(39647),m=n.n(f),h=n(59301),v=n(7880),g=n(51136),b=n(78241),w=n(8591),x=n(95237),C=n(43604),y=n(98135),O=n(57809),Z=n(3113),j=n(89918),N=n(11094),S=n(37712),I=["user","globalSetting","loading","dispatch","restful"];t.default=(0,v.connect)((function(e){var t=e.user,n=e.loading;return{user:t,globalSetting:e.globalSetting,restful:e.restful,loading:n.models.index}}))((function(e){e.user,e.globalSetting,e.loading;var t,n,o=e.dispatch,r=e.restful,s=m()(e,I),c=(0,h.useState)({content:"",message:"",status:0,contacts:[],address:"",data:[]}),d=p()(c,2),f=(d[0],d[1],(0,h.useState)(!0)),v=p()(f,2),E=(v[0],v[1]),P=s.match.params,M=b.Z.useForm(),_=p()(M,1)[0],F=(0,h.useState)('\n\n \n##### 简要描述\n\n- 用户注册接口\n\n##### 请求URL\n- ` http://xx.com/api/user/register `\n \n##### 请求方式\n- POST \n\n##### 参数\n\n|参数名|必选|类型|说明|\n|:---- |:---|:----- |----- |\n|username |是 |string |用户名 |\n|password |是 |string | 密码 |\n|name |否 |string | 昵称 |\n\n##### 返回示例 \n\n``` \n {\n "error_code": 0,\n "data": {\n "uid": "1",\n "username": "12154545",\n "name": "吴系挂",\n "groupid": 2 ,\n "reg_time": "1436864169",\n "last_login_time": "0",\n }\n }\n```\n\n##### 返回参数说明 \n\n|参数名|类型|说明|\n|:----- |:-----|----- |\n|groupid |int |用户组id,1:超级管理员;2:普通用户 |\n\n##### 备注 \n\n- 更多返回错误代码请看首页的错误代码描述\n\n\n\n欢迎使用!'),R=p()(F,2),k=R[0],$=R[1];(0,h.useEffect)((function(){_.resetFields()}),[P.id]);var D=function(){var e=u()(a()().mark((function e(t){var n,o,i;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,_.getFieldsValue();case 2:return n=e.sent,o="/api/restfuls.json",0!=P.id&&(o="/api/restfuls/".concat(P.id,".json")),e.next=7,(0,g.ZP)(o,{method:0!=P.id?"put":"post",body:l()(l()({file_type:0},n),{},{parent_id:n.parent_id||""})});case 7:0===(i=e.sent).status&&(w.ZP.success("添加成功"),s.history.push("/ch/rest/".concat(i.data.id)));case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),A=function(){var e=u()(a()().mark((function e(){var t;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o({type:"restful/getRestful"});case 2:if(0==P.id){e.next=8;break}return e.next=5,o({type:"restful/getRestfulDetail",payload:l()({},P)});case 5:t=e.sent,_.setFieldsValue({description:null==t?void 0:t.description,name:null==t?void 0:t.name}),(0,j.ag)()||s.history.replace("/403");case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,h.useEffect)((function(){var e,t,n;(null!==(e=r.restful)&&void 0!==e&&e.data&&_.setFieldsValue({parent_id:1*P.categoryId}),null!==(t=r.restfulDetail)&&void 0!==t&&t.description&&0!=P.id)&&$(null===(n=r.restfulDetail)||void 0===n?void 0:n.description)}),[r.restful,null===(t=r.restfulDetail)||void 0===t?void 0:t.description]),(0,h.useEffect)((function(){E(!0),A()}),[P.id]),(0,S.jsx)("section",{children:(0,S.jsx)("aside",{className:"edu-container mt30",children:(0,S.jsxs)(b.Z,{onFinish:D,form:_,initialValues:i()({},"name",""),children:[(0,S.jsxs)(x.Z,{className:"mt30",children:[(0,S.jsx)(C.Z,{flex:"80px",className:"font14",children:"目录名称:"}),(0,S.jsx)(C.Z,{flex:"1",children:(0,S.jsx)(b.Z.Item,{name:"name",rules:[{required:!0,message:"请输入目录名称"}],children:(0,S.jsx)(y.Z,{placeholder:"请输入名称,最大限制60个字符 ",maxLength:60})})})]}),(0,S.jsxs)(x.Z,{className:"",children:[(0,S.jsx)(C.Z,{flex:"80px",className:"font14",children:"所属目录:"}),(0,S.jsx)(C.Z,{flex:"1",children:(0,S.jsx)(b.Z.Item,{name:"parent_id",rules:[{required:!0,message:"所属目录"}],children:(0,S.jsxs)(O.default,{showSearch:!0,style:{width:200},placeholder:"请选择目录",optionFilterProp:"children",filterOption:function(e,t){return t.children.toLowerCase().indexOf(e.toLowerCase())>=0},children:[(0,S.jsx)(O.default.Option,{value:0,children:"根目录"},9999),null==r||null===(n=r.restful)||void 0===n||null===(n=n.data)||void 0===n?void 0:n.map((function(e,t){return(0,S.jsx)(O.default.Option,{value:e.id,children:e.title},t)}))]})})})]}),(0,S.jsx)(b.Z.Item,{name:"description",rules:[{required:!0,message:"请输入目录名称"}],children:(0,S.jsx)(N.Z,{defaultValue:k,watch:!0,height:600})}),(0,S.jsx)(x.Z,{align:"middle",justify:"center",children:(0,S.jsx)(C.Z,{children:(0,S.jsx)(Z.ZP,{style:{width:130},size:"middle",type:"primary",htmlType:"submit",children:"保存"})})}),(0,S.jsx)("div",{className:"mt40"})]})})})}))},57809:function(e,t,n){var o=n(92310),i=n.n(o),r=n(77861),a=n(70521),s=n(59301),l=n(53487),c=n(62892),u=n(19080),d=n(36355),p=n(1684),f=n(93891),m=n(19716),h=n(32441),v=n(33234),g=n(14154),b=n(58582),w=n(84443),x=n(66339),C=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(n[o[i]]=e[o[i]])}return n};const y="SECRET_COMBOBOX_MODE_DO_NOT_USE",O=(e,t)=>{var n,{prefixCls:o,bordered:l=!0,className:O,rootClassName:Z,getPopupContainer:j,popupClassName:N,dropdownClassName:S,listHeight:I=256,placement:E,listItemHeight:P=24,size:M,disabled:_,notFoundContent:F,status:R,builtinPlacements:k,dropdownMatchSelectWidth:$,popupMatchSelectWidth:D,direction:A,style:V,allowClear:W}=e,L=C(e,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear"]);const{getPopupContainer:T,getPrefixCls:H,renderEmpty:B,direction:z,virtual:U,popupMatchSelectWidth:X,popupOverflow:Y,select:q}=s.useContext(d.E_),Q=H("select",o),G=H(),J=null!=A?A:z,{compactSize:K,compactItemClassnames:ee}=(0,v.ri)(Q,J),[te,ne]=(0,g.Z)(Q),oe=s.useMemo((()=>{const{mode:e}=L;if("combobox"!==e)return e===y?"combobox":e}),[L.mode]),ie="multiple"===oe||"tags"===oe,re=(0,w.Z)(L.suffixIcon,L.showArrow),ae=null!==(n=null!=D?D:$)&&void 0!==n?n:X,{status:se,hasFeedback:le,isFormItemInput:ce,feedbackIcon:ue}=s.useContext(h.aM),de=(0,u.F)(se,R);let pe;pe=void 0!==F?F:"combobox"===oe?null:(null==B?void 0:B("Select"))||s.createElement(f.Z,{componentName:"Select"});const{suffixIcon:fe,itemIcon:me,removeIcon:he,clearIcon:ve}=(0,x.Z)(Object.assign(Object.assign({},L),{multiple:ie,hasFeedback:le,feedbackIcon:ue,showSuffixIcon:re,prefixCls:Q,showArrow:L.showArrow,componentName:"Select"})),ge=!0===W?{clearIcon:ve}:W,be=(0,a.Z)(L,["suffixIcon","itemIcon"]),we=i()(N||S,{[`${Q}-dropdown-${J}`]:"rtl"===J},Z,ne),xe=(0,m.Z)((e=>{var t;return null!==(t=null!=M?M:K)&&void 0!==t?t:e})),Ce=s.useContext(p.Z),ye=null!=_?_:Ce,Oe=i()({[`${Q}-lg`]:"large"===xe,[`${Q}-sm`]:"small"===xe,[`${Q}-rtl`]:"rtl"===J,[`${Q}-borderless`]:!l,[`${Q}-in-form-item`]:ce},(0,u.Z)(Q,de,le),ee,null==q?void 0:q.className,O,Z,ne),Ze=s.useMemo((()=>void 0!==E?E:"rtl"===J?"bottomRight":"bottomLeft"),[E,J]),je=(0,b.Z)(k,Y);return te(s.createElement(r.ZP,Object.assign({ref:t,virtual:U,showSearch:null==q?void 0:q.showSearch},be,{style:Object.assign(Object.assign({},null==q?void 0:q.style),V),dropdownMatchSelectWidth:ae,builtinPlacements:je,transitionName:(0,c.m)(G,"slide-up",L.transitionName),listHeight:I,listItemHeight:P,mode:oe,prefixCls:Q,placement:Ze,direction:J,suffixIcon:fe,menuItemSelectedIcon:me,removeIcon:he,allowClear:ge,notFoundContent:pe,className:Oe,getPopupContainer:j||T,dropdownClassName:we,disabled:ye})))};const Z=s.forwardRef(O),j=(0,l.Z)(Z);Z.SECRET_COMBOBOX_MODE_DO_NOT_USE=y,Z.Option=r.Wx,Z.OptGroup=r.Xo,Z._InternalPanelDoNotUseOrYouWillBeFired=j,t.default=Z},8378:function(e,t){t.Z=e=>({[e.componentCls]:{[`${e.antCls}-motion-collapse-legacy`]:{overflow:"hidden","&-active":{transition:`height ${e.motionDurationMid} ${e.motionEaseInOut},\n opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`}},[`${e.antCls}-motion-collapse`]:{overflow:"hidden",transition:`height ${e.motionDurationMid} ${e.motionEaseInOut},\n opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`}}})},31561:function(e,t,n){n.d(t,{Z:function(){return y}});var o=n(1565),i=n(22386),r=n(88703),a=n(52167),s=n(35593),l=n(92310),c=n.n(l),u=n(16863),d=n(59301),p=n(13108),f=n(3490),m=p.Z.ESC,h=p.Z.TAB;var v=(0,d.forwardRef)((function(e,t){var n=e.overlay,o=e.arrow,i=e.prefixCls,r=(0,d.useMemo)((function(){return"function"==typeof n?n():n}),[n]),a=(0,u.sQ)(t,null==r?void 0:r.ref);return d.createElement(d.Fragment,null,o&&d.createElement("div",{className:"".concat(i,"-arrow")}),d.cloneElement(r,{ref:(0,u.Yr)(r)?a:void 0}))})),g={adjustX:1,adjustY:1},b=[0,0],w={topLeft:{points:["bl","tl"],overflow:g,offset:[0,-4],targetOffset:b},top:{points:["bc","tc"],overflow:g,offset:[0,-4],targetOffset:b},topRight:{points:["br","tr"],overflow:g,offset:[0,-4],targetOffset:b},bottomLeft:{points:["tl","bl"],overflow:g,offset:[0,4],targetOffset:b},bottom:{points:["tc","bc"],overflow:g,offset:[0,4],targetOffset:b},bottomRight:{points:["tr","br"],overflow:g,offset:[0,4],targetOffset:b}},x=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function C(e,t){var n,l=e.arrow,p=void 0!==l&&l,g=e.prefixCls,b=void 0===g?"rc-dropdown":g,C=e.transitionName,y=e.animation,O=e.align,Z=e.placement,j=void 0===Z?"bottomLeft":Z,N=e.placements,S=void 0===N?w:N,I=e.getPopupContainer,E=e.showAction,P=e.hideAction,M=e.overlayClassName,_=e.overlayStyle,F=e.visible,R=e.trigger,k=void 0===R?["hover"]:R,$=e.autoFocus,D=e.overlay,A=e.children,V=e.onVisibleChange,W=(0,a.Z)(e,x),L=d.useState(),T=(0,r.Z)(L,2),H=T[0],B=T[1],z="visible"in e?F:H,U=d.useRef(null),X=d.useRef(null),Y=d.useRef(null);d.useImperativeHandle(t,(function(){return U.current}));var q=function(e){B(e),null==V||V(e)};!function(e){var t=e.visible,n=e.triggerRef,o=e.onVisibleChange,i=e.autoFocus,r=e.overlayRef,a=d.useRef(!1),s=function(){var e,i;t&&(null===(e=n.current)||void 0===e||null===(i=e.focus)||void 0===i||i.call(e),null==o||o(!1))},l=function(){var e;return!(null===(e=r.current)||void 0===e||!e.focus||(r.current.focus(),a.current=!0,0))},c=function(e){switch(e.keyCode){case m:s();break;case h:var t=!1;a.current||(t=l()),t?e.preventDefault():s()}};d.useEffect((function(){return t?(window.addEventListener("keydown",c),i&&(0,f.Z)(l,3),function(){window.removeEventListener("keydown",c),a.current=!1}):function(){a.current=!1}}),[t])}({visible:z,triggerRef:Y,onVisibleChange:q,autoFocus:$,overlayRef:X});var Q,G,J,K=function(){return d.createElement(v,{ref:X,overlay:D,prefixCls:b,arrow:p})},ee=d.cloneElement(A,{className:c()(null===(n=A.props)||void 0===n?void 0:n.className,z&&(Q=e.openClassName,void 0!==Q?Q:"".concat(b,"-open"))),ref:(0,u.Yr)(A)?(0,u.sQ)(Y,A.ref):void 0}),te=P;return te||-1===k.indexOf("contextMenu")||(te=["click"]),d.createElement(s.Z,(0,o.Z)({builtinPlacements:S},W,{prefixCls:b,ref:U,popupClassName:c()(M,(0,i.Z)({},"".concat(b,"-show-arrow"),p)),popupStyle:_,action:k,showAction:E,hideAction:te,popupPlacement:j,popupAlign:O,popupTransitionName:C,popupAnimation:y,popupVisible:z,stretch:(G=e.minOverlayWidthMatchTrigger,J=e.alignPoint,("minOverlayWidthMatchTrigger"in e?G:!J)?"minWidth":""),popup:"function"==typeof D?K:K(),onPopupVisibleChange:q,onPopupClick:function(t){var n=e.onOverlayClick;B(!1),n&&n(t)},getPopupContainer:I}),ee)}var y=d.forwardRef(C)}}]); |