|
|
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[70928],{13261:function(e,n,t){var s=t(82242),i=t.n(s),r=(t(59301),t(19779)),a=t(3113),l=t(37712);n.Z=function(e){var n=e.img,t=e.buttonProps,s=void 0===t?{}:t,u=e.styles,d=void 0===u?{}:u,c=e.customText,o=e.ButtonText,f=e.ButtonClick,p=e.Buttonclass,h=e.ButtonTwo,m=e.imgStyles,x=e.loading,g=void 0!==x&&x;return(0,l.jsxs)("section",{className:"tc animated fadeIn",style:i()(i()({},{color:"#999",margin:"100px auto",visibility:g?"hidden":"visible"}),d),children:[(0,l.jsx)("img",{src:n||r,style:i()({width:288,height:200},m)}),(0,l.jsx)("p",{className:"mt20 font14",children:c||"暂时还没有相关数据哦!"}),o&&(0,l.jsx)(a.ZP,i()(i()({className:p,onClick:f},s),{},{children:o})),h&&h]})}},39459:function(e,n,t){t.r(n);var s=t(85573),i=t.n(s),r=t(7557),a=t.n(r),l=t(82242),u=t.n(l),d=t(41498),c=t.n(d),o=t(79800),f=t.n(o),p=t(39647),h=t.n(p),m=t(59301),x=t(65363),g=t(79311),v=t(78241),j=t(8591),y=t(95237),Z=t(43604),w=t(73782),b=t(57809),S=t(3113),k=t(38296),N=t(33987),_=t(37712),F=["user","globalSetting","loading","dispatch","restful"];n.default=(0,x.connect)((function(e){var n=e.user,t=e.loading;return{user:n,globalSetting:e.globalSetting,restful:e.restful,loading:t.models.index}}))((function(e){e.user,e.globalSetting,e.loading;var n,t,s=e.dispatch,r=e.restful,l=h()(e,F),d=(0,m.useState)({content:"",message:"",status:0,contacts:[],address:"",data:[]}),o=f()(d,2),p=(o[0],o[1],(0,m.useState)(!0)),x=f()(p,2),P=(x[0],x[1]),C=l.match.params,I=v.Z.useForm(),O=f()(I,1)[0],T=(0,m.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欢迎使用!'),V=f()(T,2),B=V[0],D=V[1];(0,m.useEffect)((function(){O.resetFields()}),[C.id]);var L=function(){var e=c()(a()().mark((function e(n){var t,s,i;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,O.getFieldsValue();case 2:return t=e.sent,s="/api/restfuls.json",0!=C.id&&(s="/api/restfuls/".concat(C.id,".json")),e.next=7,(0,g.ZP)(s,{method:0!=C.id?"put":"post",body:u()(u()({file_type:0},t),{},{parent_id:t.parent_id||""})});case 7:0===(i=e.sent).status&&(j.ZP.success("添加成功"),l.history.push("/ch/rest/".concat(i.data.id)));case 9:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),q=function(){var e=c()(a()().mark((function e(){var n;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s({type:"restful/getRestful"});case 2:if(0==C.id){e.next=8;break}return e.next=5,s({type:"restful/getRestfulDetail",payload:u()({},C)});case 5:n=e.sent,O.setFieldsValue({description:null==n?void 0:n.description,name:null==n?void 0:n.name}),(0,k.ag)()||l.history.replace("/403");case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,m.useEffect)((function(){var e,n,t;(null!==(e=r.restful)&&void 0!==e&&e.data&&O.setFieldsValue({parent_id:1*C.categoryId}),null!==(n=r.restfulDetail)&&void 0!==n&&n.description&&0!=C.id)&&D(null===(t=r.restfulDetail)||void 0===t?void 0:t.description)}),[r.restful,null===(n=r.restfulDetail)||void 0===n?void 0:n.description]),(0,m.useEffect)((function(){P(!0),q()}),[C.id]),(0,_.jsx)("section",{children:(0,_.jsx)("aside",{className:"edu-container mt30",children:(0,_.jsxs)(v.Z,{onFinish:L,form:O,initialValues:i()({},"name",""),children:[(0,_.jsxs)(y.Z,{className:"mt30",children:[(0,_.jsx)(Z.Z,{flex:"80px",className:"font14",children:"目录名称:"}),(0,_.jsx)(Z.Z,{flex:"1",children:(0,_.jsx)(v.Z.Item,{name:"name",rules:[{required:!0,message:"请输入目录名称"}],children:(0,_.jsx)(w.Z,{placeholder:"请输入名称,最大限制60个字符 ",maxLength:60})})})]}),(0,_.jsxs)(y.Z,{className:"",children:[(0,_.jsx)(Z.Z,{flex:"80px",className:"font14",children:"所属目录:"}),(0,_.jsx)(Z.Z,{flex:"1",children:(0,_.jsx)(v.Z.Item,{name:"parent_id",rules:[{required:!0,message:"所属目录"}],children:(0,_.jsxs)(b.default,{showSearch:!0,style:{width:200},placeholder:"请选择目录",optionFilterProp:"children",filterOption:function(e,n){return n.children.toLowerCase().indexOf(e.toLowerCase())>=0},children:[(0,_.jsx)(b.default.Option,{value:0,children:"根目录"},9999),null==r||null===(t=r.restful)||void 0===t||null===(t=t.data)||void 0===t?void 0:t.map((function(e,n){return(0,_.jsx)(b.default.Option,{value:e.id,children:e.title},n)}))]})})})]}),(0,_.jsx)(v.Z.Item,{name:"description",rules:[{required:!0,message:"请输入目录名称"}],children:(0,_.jsx)(N.Z,{defaultValue:B,watch:!0,height:600})}),(0,_.jsx)(y.Z,{align:"middle",justify:"center",children:(0,_.jsx)(Z.Z,{children:(0,_.jsx)(S.ZP,{style:{width:130},size:"middle",type:"primary",htmlType:"submit",children:"保存"})})}),(0,_.jsx)("div",{className:"mt40"})]})})})}))}}]); |