(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{101:function(e,t,a){"use strict";var r=a(3);Object.defineProperty(t,"__esModule",{value:!0}),t.changeStudyTip=function(){return{type:"yapi/user/CHANGE_STUDY_TIP"}},t.checkLoginState=function(){return{type:"yapi/user/GET_LOGIN_STATE",payload:l.default.get("/api/user/status")}},t.default=void 0,t.finishStudy=function(){return{type:"yapi/user/FINISH_STUDY",payload:l.default.get("/api/user/up_study")}},t.loginActions=function(e){return{type:c,payload:l.default.post("/api/user/login",e)}},t.loginLdapActions=function(e){return{type:c,payload:l.default.post("/api/user/login_by_ldap",e)}},t.loginTypeAction=function(e){return{type:s,index:e}},t.logoutActions=function(){return{type:i,payload:l.default.get("/api/user/logout")}},t.regActions=function(e){var t=e.email,a=e.password,r=e.userName,n={email:t,password:a,username:r};return{type:d,payload:l.default.post("/api/user/reg",n)}},t.setBreadcrumb=function(e){return{type:"yapi/user/SET_BREADCRUMB",data:e}},t.setImageUrl=function(e){return{type:"yapi/user/SET_IMAGE_URL",data:e}};var n=r(a(5)),l=r(a(44));function u(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function o(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?u(Object(a),!0).forEach((function(t){(0,n.default)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):u(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var c="yapi/user/LOGIN",i="yapi/user/LOGIN_OUT",s="yapi/user/LOGIN_TYPE",d="yapi/user/REGISTER",f={isLogin:!1,canRegister:!0,isLDAP:!1,userName:null,uid:null,email:"",loginState:0,loginWrapActiveKey:"1",role:"",type:"",breadcrumb:[],studyTip:0,study:!1,imageUrl:""};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"yapi/user/GET_LOGIN_STATE":return o(o({},e),{},{isLogin:0==t.payload.data.errcode,isLDAP:t.payload.data.ladp,canRegister:t.payload.data.canRegister,role:t.payload.data.data?t.payload.data.data.role:null,loginState:0==t.payload.data.errcode?2:1,userName:t.payload.data.data?t.payload.data.data.username:null,uid:t.payload.data.data?t.payload.data.data._id:null,type:t.payload.data.data?t.payload.data.data.type:null,study:!!t.payload.data.data&&t.payload.data.data.study});case c:return 0===t.payload.data.errcode?o(o({},e),{},{isLogin:!0,loginState:2,uid:t.payload.data.data.uid,userName:t.payload.data.data.username,role:t.payload.data.data.role,type:t.payload.data.data.type,study:t.payload.data.data.study}):e;case i:return o(o({},e),{},{isLogin:!1,loginState:1,userName:null,uid:null,role:"",type:""});case s:return o(o({},e),{},{loginWrapActiveKey:t.index});case d:return o(o({},e),{},{isLogin:!0,loginState:2,uid:t.payload.data.data.uid,userName:t.payload.data.data.username,type:t.payload.data.data.type,study:!!t.payload.data.data&&t.payload.data.data.study});case"yapi/user/SET_BREADCRUMB":return o(o({},e),{},{breadcrumb:t.data});case"yapi/user/CHANGE_STUDY_TIP":return o(o({},e),{},{studyTip:e.studyTip+1});case"yapi/user/FINISH_STUDY":return o(o({},e),{},{study:!0,studyTip:0});case"yapi/user/SET_IMAGE_URL":return o(o({},e),{},{imageUrl:t.data});default:return e}}},1013:function(e,t,a){},1014:function(e,t,a){"use strict";e.exports={server:!0,client:!0,httpCodes:[100,101,102,200,201,202,203,204,205,206,207,208,226,300,301,302,303,304,305,307,308,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,422,423,424,426,428,429,431,500,501,502,503,504,505,506,507,508,510,511]}},1015:function(e,t,a){},1016:function(e,t,a){"use strict";var r=a(3);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.fetchMockCol=function(e){return p.apply(this,arguments)};var n=r(a(30));a(38);var l=r(a(39)),u=r(a(31)),o=r(a(5)),c=r(a(44));function i(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function s(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?i(Object(a),!0).forEach((function(t){(0,o.default)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):i(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var d="yapi/mockCol/FETCH_MOCK_COL",f={list:[]};function p(){return(p=(0,u.default)(n.default.mark((function e(t){var a;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,c.default.get("/api/plugin/advmock/case/list?interface_id="+t);case 2:return 0!==(a=e.sent).errcode&&l.default.error(a.errmsg),e.abrupt("return",{type:d,payload:a.data});case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case d:return s(s({},e),{},{list:t.payload.data});default:return e}}},1017:function(e,t,a){"use strict";var r=a(3),n=r(a(30));a(38);var l=r(a(39)),u=r(a(31)),o=r(a(7)),c=r(a(1018));e.exports=function(){this.bindHook("import_data",(function(e){if(!e||"object"!==(0,o.default)(e))return console.error("importDataModule 参数Must be Object Type"),null;var t;e.swagger={name:"Swagger",run:(t=(0,u.default)(n.default.mark((function e(t){return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,c.default)(t);case 3:return e.abrupt("return",e.sent);case 6:e.prev=6,e.t0=e.catch(0),console.error(e.t0),l.default.error("解析失败");case 10:case"end":return e.stop()}}),e,null,[[0,6]])}))),function(e){return t.apply(this,arguments)}),desc:'<p>Swagger数据导入（ 支持 v2.0+ ）</p>\n      <p>\n        <a target="_blank" href="https://hellosean1025.github.io/yapi/documents/data.html#通过命令行导入接口数据">通过命令行导入接口数据</a>\n      </p>\n      '}}))}},1018:function(e,t,a){"use strict";var r,n=a(3),l=n(a(30)),u=n(a(31)),o=n(a(7)),c=a(79),i=a(1019),s=a(1136);function d(e){return"/"===e||("/"!=e.charAt(0)&&(e="/"+e),"/"===e.charAt(e.length-1)&&(e=e.substr(0,e.length-1))),e}function f(e){return e.swagger="2.0",c.each(e.paths,(function(e){c.each(e,(function(e){if(c.each(e.responses,(function(e){e.content&&e.content["application/json"]&&"object"===(0,o.default)(e.content["application/json"])&&(Object.assign(e,e.content["application/json"]),delete e.content),e.content&&e.content["application/hal+json"]&&"object"===(0,o.default)(e.content["application/hal+json"])&&(Object.assign(e,e.content["application/hal+json"]),delete e.content),e.content&&e.content["*/*"]&&"object"===(0,o.default)(e.content["*/*"])&&(Object.assign(e,e.content["*/*"]),delete e.content)})),e.requestBody){e.parameters||(e.parameters=[]);var t={type:"object",name:"body",in:"body"};try{t.schema=e.requestBody.content["application/json"].schema}catch(e){t.schema={}}e.parameters.push(t)}}))})),e}function p(e){return m.apply(this,arguments)}function m(){return(m=(0,u.default)(l.default.mark((function e(t){return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,new Promise((function(e){i({spec:t}).then((function(t){e(t.spec)}))}));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function h(){return(h=(0,u.default)(l.default.mark((function e(t){var a;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a={apis:[],cats:[]},"string"==typeof t&&t)try{t=JSON.parse(t)}catch(e){console.error("json 解析出错",e.message)}return t.openapi&&s(t.openapi,"3.0.0")>=0&&(t=f(t)),e.next=6,p(t);case 6:return t=e.sent,r=t,a.basePath=t.basePath||"",t.tags&&Array.isArray(t.tags)?t.tags.forEach((function(e){a.cats.push({name:e.name,desc:e.description})})):t.tags=[],c.each(t.paths,(function(e,r){delete e.parameters,c.each(e,(function(e,n){e.path=r,e.method=n;var l=null;try{(l=y(e,t.tags)).catname&&(c.find(a.cats,(function(e){return e.name===l.catname}))||0===t.tags.length&&a.cats.push({name:l.catname,desc:l.catname}))}catch(e){l=null}l&&a.apis.push(l)}))})),a.cats=a.cats.filter((function(e){var t=e.name;return c.find(a.apis,(function(e){return e.catname===t}))})),e.abrupt("return",a);case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function y(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],a={};if(a.method=e.method.toUpperCase(),a.title=e.summary||e.path,a.desc=e.description,a.catname=null,e.tags&&Array.isArray(e.tags)){a.tag=e.tags;for(var n=function(r){return/v[0-9\.]+/.test(e.tags[r])?"continue":t.length>0&&c.find(t,(function(t){return t.name===e.tags[r]}))||0===t.length?(a.catname=e.tags[r],"break"):void 0},l=0;l<e.tags.length;l++){var u=n(l);if("continue"!==u&&"break"===u)break}}a.path=d(e.path),a.req_params=[],a.req_body_form=[],a.req_headers=[],a.req_query=[],a.req_body_type="raw",a.res_body_type="raw",e.produces&&e.produces.indexOf("application/json")>-1&&(a.res_body_type="json",a.res_body_is_json_schema=!0),e.consumes&&Array.isArray(e.consumes)&&(e.consumes.indexOf("application/x-www-form-urlencoded")>-1||e.consumes.indexOf("multipart/form-data")>-1?a.req_body_type="form":e.consumes.indexOf("application/json")>-1&&(a.req_body_type="json",a.req_body_is_json_schema=!0)),a.res_body=g(e.responses);try{JSON.parse(a.res_body),a.res_body_type="json",a.res_body_is_json_schema=!0}catch(e){a.res_body_type="raw"}function i(e,t){if(!e||"string"!=typeof e||0!==e.indexOf("#/")||e.length<=2)return null;for(var a=e.substr(2).split("/"),r=0,n=(a=a.filter((function(e){return e}))).length;r<n;r++)try{t=t[a[r]]}catch(e){t="";break}return t}return e.parameters&&Array.isArray(e.parameters)&&e.parameters.forEach((function(e){e&&"object"===(0,o.default)(e)&&e.$ref&&(e=i(e.$ref,{parameters:r.parameters}));var t={name:e.name,desc:e.description,required:e.required?"1":"0"};if(e.in)switch(e.in){case"path":a.req_params.push(t);break;case"query":a.req_query.push(t);break;case"body":v(e.schema,a);break;case"formData":t.type="file"===e.type?"file":"text",e.example&&(t.example=e.example),a.req_body_form.push(t);break;case"header":a.req_headers.push(t)}else a.req_query.push(t)})),a}function v(e,t){t.req_body_other=JSON.stringify(e,null,2),function(e){try{return JSON.parse(e)}catch(e){return!1}}(t.req_body_other)&&(t.req_body_type="json",t.req_body_is_json_schema=!0)}function g(e){var t="";if(!e||"object"!==(0,o.default)(e))return t;var a=Object.keys(e);if(a.length>0){var r=e[a.indexOf("200")>-1?"200":a[0]];r&&"object"===(0,o.default)(r)?r.schema?t=JSON.stringify(r.schema,null,2):r.description&&(t=r.description):t="string"==typeof r?r:""}else t="";return t}e.exports=function(e){return h.apply(this,arguments)}},102:function(e,t,a){"use strict";var r=a(3);Object.defineProperty(t,"__esModule",{value:!0}),t.axios=void 0;var n=r(a(44)).default.create({timeout:9e3});t.axios=n,n.interceptors.response.use((function(e){return e.data}),(function(e){return Promise.reject(e)}))},103:function(e,t,a){"use strict";var r=a(3);Object.defineProperty(t,"__esModule",{value:!0}),t.addMember=function(e){return{type:"yapi/group/ADD_GROUP_MEMBER",payload:l.default.post("/api/group/add_member",e)}},t.changeGroupMsg=function(e){return{type:"yapi/group/CHANGE_GROUP_MESSAGE",payload:l.default.post("/api/group/up",e)}},t.changeMemberRole=function(e){return{type:"yapi/group/CHANGE_GROUP_MEMBER",payload:l.default.post("/api/group/change_member_role",e)}},t.default=void 0,t.delMember=function(e){return{type:"yapi/group/DEL_GROUP_MEMBER",payload:l.default.post("/api/group/del_member",e)}},t.deleteGroup=function(e){return{type:"yapi/group/DEL_GROUP",payload:l.default.post("/api/group/del",e)}},t.fetchGroupList=function(){return{type:"yapi/group/FETCH_GROUP_LIST",payload:l.default.get("/api/group/list")}},t.fetchGroupMemberList=function(e){return{type:"yapi/group/FETCH_GROUP_MEMBER",payload:l.default.get("/api/group/get_member_list",{params:{id:e}})}},t.fetchGroupMsg=function(e){return{type:"yapi/group/FETCH_GROUP_MSG",payload:l.default.get("/api/group/get",{params:{id:e}})}},t.setCurrGroup=function(e){return{type:"yapi/group/SET_CURR_GROUP",payload:l.default.get("/api/group/get",{params:{id:e._id}})}},t.updateGroupList=function(e){return{type:"yapi/group/UPDATE_GROUP_LIST",payload:e}};var n=r(a(5)),l=r(a(44));function u(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function o(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?u(Object(a),!0).forEach((function(t){(0,n.default)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):u(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var c={groupList:[],currGroup:{group_name:"",group_desc:"",custom_field1:{name:"",enable:!1}},field:{name:"",enable:!1},member:[],role:""};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"yapi/group/FETCH_GROUP_LIST":return o(o({},e),{},{groupList:t.payload.data.data});case"yapi/group/UPDATE_GROUP_LIST":return o(o({},e),{},{groupList:t.payload});case"yapi/group/SET_CURR_GROUP":return o(o({},e),{},{currGroup:t.payload.data.data});case"yapi/group/FETCH_GROUP_MEMBER":return o(o({},e),{},{member:t.payload.data.data});case"yapi/group/FETCH_GROUP_MSG":return console.log(t.payload),o(o({},e),{},{role:t.payload.data.data.role,currGroup:t.payload.data.data,field:{name:t.payload.data.data.custom_field1.name,enable:t.payload.data.data.custom_field1.enable}});default:return e}}},1137:function(e,t,a){"use strict";var r=a(3)(a(1138));e.exports=function(){this.bindHook("header_menu",(function(e){e.statisticsPage={path:"/statistic",name:"系统信息",icon:"bar-chart",adminFlag:!0}})),this.bindHook("app_route",(function(e){e.statisticsPage={path:"/statistic",component:r.default}}))}},1138:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(30)),u=r(a(31)),o=r(a(9)),c=r(a(10)),i=r(a(11)),s=r(a(12)),d=r(a(13)),f=r(a(5));a(57);var p=r(a(51));a(64);var m=r(a(49));a(55);var h=r(a(45));a(36);var y=r(a(4)),v=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=x(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),g=a(22),b=r(a(44)),E=r(a(0));a(1139);var _,k,j,w=a(101),O=r(a(1140)),C=r(a(1210));function x(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(x=function(e){return e?a:t})(e)}function P(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function N(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?P(Object(a),!0).forEach((function(t){(0,f.default)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):P(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function M(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,d.default)(e);if(t){var n=(0,d.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,s.default)(this,a)}}var S=function(e){return v.default.createElement(p.default,{type:"flex",justify:"space-start",className:"m-row"},v.default.createElement(m.default,{className:"gutter-row",span:6},v.default.createElement("span",null,"分组总数",v.default.createElement(h.default,{placement:"rightTop",title:"统计yapi中一共开启了多少可见的公共分组"},v.default.createElement(y.default,{className:"m-help",type:"question-circle"}))),v.default.createElement("h2",{className:"gutter-box"},e.date.groupCount)),v.default.createElement(m.default,{className:"gutter-row",span:6},v.default.createElement("span",null,"项目总数",v.default.createElement(h.default,{placement:"rightTop",title:"统计yapi中建立的所有项目总数"},v.default.createElement(y.default,{className:"m-help",type:"question-circle"}))),v.default.createElement("h2",{className:"gutter-box"},e.date.projectCount)),v.default.createElement(m.default,{className:"gutter-row",span:6},v.default.createElement("span",null,"接口总数",v.default.createElement(h.default,{placement:"rightTop",title:"统计yapi所有项目中的所有接口总数"},v.default.createElement(y.default,{className:"m-help",type:"question-circle"}))),v.default.createElement("h2",{className:"gutter-box"},e.date.interfaceCount)),v.default.createElement(m.default,{className:"gutter-row",span:6},v.default.createElement("span",null,"测试接口总数",v.default.createElement(h.default,{placement:"rightTop",title:"统计yapi所有项目中的所有测试接口总数"},v.default.createElement(y.default,{className:"m-help",type:"question-circle"}))),v.default.createElement("h2",{className:"gutter-box"},e.date.interfaceCaseCount)))};S.propTypes={date:E.default.object};var I=function(e){return v.default.createElement(p.default,{type:"flex",justify:"space-start",className:"m-row"},v.default.createElement(m.default,{className:"gutter-row",span:6},v.default.createElement("span",null,"操作系统类型",v.default.createElement(h.default,{placement:"rightTop",title:"操作系统类型,返回值有'darwin', 'freebsd', 'linux', 'sunos' , 'win32'"},v.default.createElement(y.default,{className:"m-help",type:"question-circle"}))),v.default.createElement("h2",{className:"gutter-box"},e.data.systemName)),v.default.createElement(m.default,{className:"gutter-row",span:6},v.default.createElement("span",null,"cpu负载",v.default.createElement(h.default,{placement:"rightTop",title:"cpu的总负载情况"},v.default.createElement(y.default,{className:"m-help",type:"question-circle"}))),v.default.createElement("h2",{className:"gutter-box"},e.data.load," %")),v.default.createElement(m.default,{className:"gutter-row",span:6},v.default.createElement("span",null,"系统空闲内存总量 / 内存总量",v.default.createElement(h.default,{placement:"rightTop",title:"系统空闲内存总量 / 内存总量"},v.default.createElement(y.default,{className:"m-help",type:"question-circle"}))),v.default.createElement("h2",{className:"gutter-box"},e.data.freemem," G / ",e.data.totalmem," G"," ")),v.default.createElement(m.default,{className:"gutter-row",span:6},v.default.createElement("span",null,"邮箱状态",v.default.createElement(h.default,{placement:"rightTop",title:"检测配置文件中配置邮箱的状态"},v.default.createElement(y.default,{className:"m-help",type:"question-circle"}))),v.default.createElement("h2",{className:"gutter-box"},e.data.mail)))};I.propTypes={data:E.default.object};var R=(0,g.connect)(null,{setBreadcrumb:w.setBreadcrumb})((j=k=function(e){(0,i.default)(d,e);var t,a,r,n,s=M(d);function d(e){var t;return(0,o.default)(this,d),(t=s.call(this,e)).state={count:{groupCount:0,projectCount:0,interfaceCount:0,interfactCaseCount:0},status:{mail:"",systemName:"",totalmem:"",freemem:"",uptime:""},dataTotal:[]},t}return(0,c.default)(d,[{key:"componentWillMount",value:(n=(0,u.default)(l.default.mark((function e(){return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.props.setBreadcrumb([{name:"系统信息"}]),this.getStatisData(),this.getSystemStatusData(),this.getGroupData();case 4:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"getStatisData",value:(r=(0,u.default)(l.default.mark((function e(){var t,a;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,b.default.get("/api/plugin/statismock/count");case 2:0===(t=e.sent).data.errcode&&(a=t.data.data,this.setState({count:N({},a)}));case 4:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"getSystemStatusData",value:(a=(0,u.default)(l.default.mark((function e(){var t,a;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,b.default.get("/api/plugin/statismock/get_system_status");case 2:0===(t=e.sent).data.errcode&&(a=t.data.data,this.setState({status:N({},a)}));case 4:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"getGroupData",value:(t=(0,u.default)(l.default.mark((function e(){var t,a;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,b.default.get("/api/plugin/statismock/group_data_statis");case 2:0===(t=e.sent).data.errcode&&((a=t.data.data).map((function(e){return e.key=e.name})),this.setState({dataTotal:a}));case 4:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"render",value:function(){var e=this.state,t=e.count,a=e.status,r=e.dataTotal;return v.default.createElement("div",{className:"g-statistic"},v.default.createElement("div",{className:"content"},v.default.createElement("h2",{className:"title"},"系统状况"),v.default.createElement("div",{className:"system-content"},v.default.createElement(I,{data:a})),v.default.createElement("h2",{className:"title"},"数据统计"),v.default.createElement("div",null,v.default.createElement(S,{date:t}),v.default.createElement(C.default,{dataSource:r}),v.default.createElement(O.default,null))))}}]),d}(v.Component),(0,f.default)(k,"propTypes",{setBreadcrumb:E.default.func}),_=j))||_;t.default=R},1139:function(e,t,a){},1140:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(30));a(136);var u=r(a(111)),o=r(a(31)),c=r(a(9)),i=r(a(10)),s=r(a(11)),d=r(a(12)),f=r(a(13)),p=r(a(5)),m=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=v(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),h=r(a(44)),y=a(1630);function v(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(v=function(e){return e?a:t})(e)}function g(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function b(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?g(Object(a),!0).forEach((function(t){(0,p.default)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):g(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function E(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,f.default)(e);if(t){var n=(0,f.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,d.default)(this,a)}}var _=function(e){(0,s.default)(r,e);var t,a=E(r);function r(e){var t;return(0,c.default)(this,r),(t=a.call(this,e)).state={showLoading:!0,chartDate:{mockCount:0,mockDateList:[]}},t}return(0,i.default)(r,[{key:"componentWillMount",value:function(){this.getMockData()}},{key:"getMockData",value:(t=(0,o.default)(l.default.mark((function e(){var t,a;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,h.default.get("/api/plugin/statismock/get");case 2:0===(t=e.sent).data.errcode&&(a=t.data.data,this.setState({showLoading:!1,chartDate:b({},a)}));case 4:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"render",value:function(){var e=this.state.chartDate,t=e.mockCount,a=e.mockDateList;return m.default.createElement("div",null,m.default.createElement(u.default,{spinning:this.state.showLoading},m.default.createElement("div",{className:"statis-chart-content"},m.default.createElement("h3",{className:"statis-title"},"mock 接口访问总数为：",t.toLocaleString()),m.default.createElement("div",{className:"statis-chart"},m.default.createElement(y.LineChart,{width:1050,height:300,data:a,margin:{top:5,right:30,left:20,bottom:5}},m.default.createElement(y.XAxis,{dataKey:"_id"}),m.default.createElement(y.YAxis,null),m.default.createElement(y.CartesianGrid,{strokeDasharray:"7 3"}),m.default.createElement(y.Tooltip,null),m.default.createElement(y.Legend,null),m.default.createElement(y.Line,{name:"mock统计值",type:"monotone",dataKey:"count",stroke:"#8884d8",activeDot:{r:8}}))),m.default.createElement("div",{className:"statis-footer"},"过去3个月mock接口调用情况"))))}}]),r}(m.Component);(0,p.default)(_,"propTypes",{});var k=_;t.default=k},1210:function(e,t,a){"use strict";var r=a(3);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(123);var n=r(a(126)),l=r(a(1)),u=r(a(0)),o=[{title:"Group",dataIndex:"name",key:"name"},{title:"项目",dataIndex:"project",key:"project"},{title:"接口",dataIndex:"interface",key:"interface"},{title:"mock数据",dataIndex:"mock",key:"mock"}],c=function(e){var t=e.dataSource;return l.default.createElement("div",{className:"m-row-table"},l.default.createElement("h3",{className:"statis-title"},"分组数据详情"),l.default.createElement(n.default,{className:"statis-table",pagination:!1,dataSource:t,columns:o}))};c.propTypes={dataSource:u.default.array};var i=c;t.default=i},1211:function(e,t,a){"use strict";function r(e,t){e.html={name:"html",route:"/api/plugin/export?type=html&pid=".concat(t),desc:"导出项目接口文档为 html 文件"},e.markdown={name:"markdown",route:"/api/plugin/export?type=markdown&pid=".concat(t),desc:"导出项目接口文档为 markdown 文件"},e.H5={name:"ks-html",route:"/api/plugin/export?type=ks-html&pid=".concat(t),desc:"导出项目接口文档为 html 文件"},e.json={name:"json",route:"/api/plugin/export?type=json&pid=".concat(t),desc:"导出项目接口文档为 json 文件,可使用该文件导入接口数据"}}e.exports=function(){this.bindHook("export_data",r)}},1212:function(e,t,a){"use strict";var r=a(3)(a(1213));function n(e){e.services={name:"生成 ts services",component:r.default}}e.exports=function(){this.bindHook("sub_setting_nav",n)}},1213:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l,u,o,c=r(a(30)),i=r(a(31)),s=r(a(9)),d=r(a(10)),f=r(a(11)),p=r(a(12)),m=r(a(13)),h=r(a(5)),y=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=E(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),v=r(a(0)),g=a(22),b=a(75);function E(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(E=function(e){return e?a:t})(e)}function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,m.default)(e);if(t){var n=(0,m.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,p.default)(this,a)}}a(1214);var k=(0,g.connect)((function(e){return{token:e.project.token}}),{getToken:b.getToken})((o=u=function(e){(0,f.default)(r,e);var t,a=_(r);function r(){return(0,s.default)(this,r),a.apply(this,arguments)}return(0,d.default)(r,[{key:"componentDidMount",value:(t=(0,i.default)(c.default.mark((function e(){var t;return c.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.props.projectId,e.next=3,this.props.getToken(t);case 3:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"render",value:function(){var e=this.props.projectId;return y.default.createElement("div",{className:"project-services"},y.default.createElement("section",{className:"news-box m-panel"},y.default.createElement("div",{className:"token"},y.default.createElement("h5",null,"安装工具"),y.default.createElement("pre",null,"\n  npm i sm2tsservice -D\n  "),y.default.createElement("h5",null,"配置【3.2.0及以上版本】"),y.default.createElement("pre",null,"\n  touch json2service.json\n  "),y.default.createElement("pre",null,'\n  {\n    "url": "yapi-swagger.json",\n    "remoteUrl": "'.concat(location.protocol,"//").concat(location.hostname).concat(location.port?":".concat(location.port):"","/api/open/plugin/export-full?type=json&pid=").concat(e,"&status=all&token=").concat(this.props.token,'",\n    "type": "yapi",\n    "swaggerParser": {}\n  }\n  ')),y.default.createElement("h5",null,"配置【3.2.0以下版本】"),y.default.createElement("pre",null,"\n  touch json2service.json\n  "),y.default.createElement("pre",null,'\n  {\n    "url": "'.concat(location.protocol,"//").concat(location.hostname).concat(location.port?":".concat(location.port):"","/api/open/plugin/export-full?type=json&pid=").concat(e,"&status=all&token=").concat(this.props.token,'",\n    "type": "yapi",\n    "swaggerParser": {}\n  }\n  ')),y.default.createElement("h5",null,"生成services代码"),y.default.createElement("pre",null,"\n  (./node_modules/.bin/)sm2tsservice --clear\n  ")),y.default.createElement("a",{href:"https://github.com/gogoyqj/sm2tsservice"},"更多说明 sm2tsservice")))}}]),r}(y.PureComponent),(0,h.default)(u,"propTypes",{projectId:v.default.string,token:v.default.string,getToken:v.default.func}),l=o))||l;t.default=k},1214:function(e,t,a){},1215:function(e,t,a){"use strict";var r=a(3),n=r(a(30));a(38);var l=r(a(39)),u=r(a(7)),o=r(a(31));function c(e){function t(){return(t=(0,o.default)(n.default.mark((function e(t){var a;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,a={apis:[],cats:[]},(t=JSON.parse(t)).forEach((function(e){a.cats.push({name:e.name,desc:e.desc}),e.list.forEach((function(t){t.catname=e.name})),a.apis=a.apis.concat(e.list)})),e.abrupt("return",a);case 7:e.prev=7,e.t0=e.catch(0),console.error(e.t0),l.default.error("数据格式有误");case 11:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}if(!e||"object"!==(0,u.default)(e))return console.error("importDataModule 参数Must be Object Type"),null;e.json={name:"json",run:function(e){return t.apply(this,arguments)},desc:"YApi接口 json数据导入"}}e.exports=function(){this.bindHook("import_data",c)}},1216:function(e,t,a){"use strict";var r=a(3)(a(1217));e.exports=function(){this.bindHook("sub_nav",(function(e){e.wiki={name:"Wiki",path:"/project/:id/wiki",component:r.default,icon:"book"}}))}},1217:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(30)),u=r(a(31));a(38);var o=r(a(39)),c=r(a(9)),i=r(a(10)),s=r(a(23)),d=r(a(11)),f=r(a(12)),p=r(a(13)),m=r(a(5)),h=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=C(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),y=a(22),v=r(a(44)),g=r(a(0));a(1218);var b,E,_,k=a(160),j=a(40),w=r(a(1219)),O=r(a(1220));function C(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(C=function(e){return e?a:t})(e)}function x(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,p.default)(e);if(t){var n=(0,p.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,f.default)(this,a)}}var P=(0,y.connect)((function(e){return{projectMsg:e.project.currProject}}),{})((_=E=function(e){(0,d.default)(r,e);var t,a=x(r);function r(e){var t;return(0,c.default)(this,r),t=a.call(this,e),(0,m.default)((0,s.default)(t),"endWebSocket",(function(){try{if("CLOSE"===t.state.status){t.handleWebsocketAccidentClose((function(){t.WebSocket.send("end")}))}}catch(e){return null}})),(0,m.default)((0,s.default)(t),"handleConflict",(function(){var e,a=location.hostname+(""!==location.port?":"+location.port:""),r="https:"===location.protocol?"wss":"ws";(e=new WebSocket(r+"://"+a+"/api/ws_plugin/wiki_desc/solve_conflict?id="+t.props.match.params.id)).onopen=function(){t.WebSocket=e,e.send("start")},e.onmessage=function(e){var a=JSON.parse(e.data);0===a.errno?(a.data&&t.setState({desc:a.data.desc,username:a.data.username,uid:a.data.uid,editorTime:(0,k.timeago)(a.data.up_time)}),t.setState({isEditor:!t.state.isEditor,status:"CLOSE"})):t.setState({editUid:a.data.uid,editName:a.data.username,status:"EDITOR"})},e.onerror=function(){t.setState({status:"CLOSE"}),console.warn("websocket 连接失败，将导致多人编辑同一个接口冲突。")}})),(0,m.default)((0,s.default)(t),"onEditor",(function(){t.handleWebsocketAccidentClose((function(){t.WebSocket.send("editor")}),(function(e){e||t.setState({isEditor:!t.state.isEditor})}))})),(0,m.default)((0,s.default)(t),"handleWebsocketAccidentClose",(function(e,a){t.WebSocket?(1!==t.WebSocket.readyState?o.default.error("websocket 链接失败，请重新刷新页面"):e(),a(!0)):a(!1)})),(0,m.default)((0,s.default)(t),"handleData",function(){var e=(0,u.default)(l.default.mark((function e(a){var r,n;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v.default.get("/api/plugin/wiki_desc/get",{params:a});case 2:0===(r=e.sent).data.errcode?(n=r.data.data)&&t.setState({desc:n.desc,markdown:n.markdown,username:n.username,uid:n.uid,editorTime:(0,k.timeago)(n.up_time)}):o.default.error("请求数据失败： ".concat(r.data.errmsg));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),(0,m.default)((0,s.default)(t),"onUpload",function(){var e=(0,u.default)(l.default.mark((function e(a,r){var n,u,c;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.props.match.params.id,u={project_id:n,desc:a,markdown:r,email_notice:t.state.notice},e.next=4,v.default.post("/api/plugin/wiki_desc/up",u);case 4:if(0!==(c=e.sent).data.errcode){e.next=11;break}return e.next=8,t.handleData({project_id:n});case 8:t.setState({isEditor:!1}),e.next=12;break;case 11:o.default.error("更新失败： ".concat(c.data.errmsg));case 12:t.endWebSocket();case 13:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}()),(0,m.default)((0,s.default)(t),"onCancel",(function(){t.setState({isEditor:!1}),t.endWebSocket()})),(0,m.default)((0,s.default)(t),"onEmailNotice",(function(e){t.setState({notice:e.target.checked})})),t.state={isEditor:!1,isUpload:!0,desc:"",markdown:"",notice:e.projectMsg.switch_notice,status:"INIT",editUid:"",editName:"",curdata:null},t}return(0,i.default)(r,[{key:"componentDidMount",value:(t=(0,u.default)(l.default.mark((function e(){var t;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.props.match.params.id,e.next=3,this.handleData({project_id:t});case 3:this.handleConflict();case 4:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"componentWillUnmount",value:function(){try{"CLOSE"===this.state.status&&(this.WebSocket.send("end"),this.WebSocket.close())}catch(e){return null}}},{key:"render",value:function(){var e=this.state,t=e.isEditor,a=e.username,r=e.editorTime,n=e.notice,l=e.uid,u=e.status,o=e.editUid,c=e.editName,i="admin"===this.props.projectMsg.role||"owner"===this.props.projectMsg.role||"dev"===this.props.projectMsg.role,s="EDITOR"===u;return h.default.createElement("div",{className:"g-row"},h.default.createElement("div",{className:"m-panel wiki-content"},h.default.createElement("div",{className:"wiki-content"},s&&h.default.createElement("div",{className:"wiki-conflict"},h.default.createElement(j.Link,{to:"/user/profile/".concat(o||l)},h.default.createElement("b",null,c||a)),h.default.createElement("span",null,"正在编辑该wiki，请稍后再试..."))),t?h.default.createElement(O.default,{isConflict:s,onUpload:this.onUpload,onCancel:this.onCancel,notice:n,onEmailNotice:this.onEmailNotice,desc:this.state.desc}):h.default.createElement(w.default,{editorEable:i,onEditor:this.onEditor,uid:l,username:a,editorTime:r,desc:this.state.desc})))}}]),r}(h.Component),(0,m.default)(E,"propTypes",{match:g.default.object,projectMsg:g.default.object}),b=_))||b;t.default=P},1218:function(e,t,a){},1219:function(e,t,a){"use strict";var r=a(3);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(33);var n=r(a(25)),l=r(a(1)),u=r(a(0)),o=a(40),c=function(e){var t=e.editorEable,a=e.onEditor,r=e.uid,u=e.username,c=e.editorTime,i=e.desc;return l.default.createElement("div",{className:"wiki-view-content"},l.default.createElement("div",{className:"wiki-title"},l.default.createElement(n.default,{icon:"edit",onClick:a,disabled:!t},"编辑"),u&&l.default.createElement("div",{className:"wiki-user"},"由"," ",l.default.createElement(o.Link,{className:"user-name",to:"/user/profile/".concat(r||11)},u)," ","修改于 ",c)),l.default.createElement("div",{className:"tui-editor-contents",dangerouslySetInnerHTML:{__html:i}}))};c.propTypes={editorEable:u.default.bool,onEditor:u.default.func,uid:u.default.number,username:u.default.string,editorTime:u.default.string,desc:u.default.string};var i=c;t.default=i},1220:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(278);var l=r(a(151));a(33);var u=r(a(25)),o=r(a(9)),c=r(a(10)),i=r(a(23)),s=r(a(11)),d=r(a(12)),f=r(a(13)),p=r(a(5)),m=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=v(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),h=r(a(0)),y=r(a(564));function v(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(v=function(e){return e?a:t})(e)}function g(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,f.default)(e);if(t){var n=(0,f.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,d.default)(this,a)}}a(565),a(566);var b=function(e){(0,s.default)(a,e);var t=g(a);function a(e){var r;return(0,o.default)(this,a),r=t.call(this,e),(0,p.default)((0,i.default)(r),"onUpload",(function(){var e=r.editor.getHtml(),t=r.editor.getMarkdown();r.props.onUpload(e,t)})),r}return(0,c.default)(a,[{key:"componentDidMount",value:function(){this.editor=new y.default({el:document.querySelector("#desc"),initialEditType:"wysiwyg",height:"500px",initialValue:this.props.desc})}},{key:"render",value:function(){var e=this.props,t=e.isConflict,a=e.onCancel,r=e.notice,n=e.onEmailNotice;return m.default.createElement("div",null,m.default.createElement("div",{id:"desc",className:"wiki-editor",style:{display:t?"none":"block"}}),m.default.createElement("div",{className:"wiki-title wiki-up"},m.default.createElement(u.default,{icon:"upload",type:"primary",className:"upload-btn",disabled:t,onClick:this.onUpload},"更新"),m.default.createElement(u.default,{onClick:a,className:"upload-btn"},"取消"),m.default.createElement(l.default,{checked:r,onChange:n},"通知相关人员")))}}]),a}(m.Component);(0,p.default)(b,"propTypes",{isConflict:h.default.bool,onUpload:h.default.func,onCancel:h.default.func,notice:h.default.bool,onEmailNotice:h.default.func,desc:h.default.string});var E=b;t.default=E},1224:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l,u,o,c=r(a(9)),i=r(a(10)),s=r(a(23)),d=r(a(11)),f=r(a(12)),p=r(a(13)),m=r(a(5)),h=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=P(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),y=r(a(17)),v=a(22),g=r(a(0)),b=a(40),E=a(1225),_=r(a(1608)),k=r(a(392)),j=r(a(398)),w=r(a(1612)),O=a(101),C=a(1613),x=r(a(1614));function P(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(P=function(e){return e?a:t})(e)}function N(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,p.default)(e);if(t){var n=(0,p.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,f.default)(this,a)}}var M=a(141),S={home:{path:"/",component:E.Index},group:{path:"/space",component:E.Group},project:{path:"/project/:id",component:E.Project},user:{path:"/user",component:_.default},follow:{path:"/follow",component:E.Follow},addProject:{path:"/add-project",component:E.AddProject},login:{path:"/login",component:E.Login}};M.emitHook("app_route",S);var I=(0,v.connect)((function(e){return{loginState:e.user.loginState,curUserRole:e.user.role}}),{checkLoginState:O.checkLoginState})((o=u=function(e){(0,d.default)(a,e);var t=N(a);function a(e){var r;return(0,c.default)(this,a),r=t.call(this,e),(0,m.default)((0,s.default)(r),"showConfirm",(function(e,t){var a=document.createElement("div");document.body.appendChild(a),y.default.render(h.default.createElement(w.default,{msg:e,callback:t}),a)})),(0,m.default)((0,s.default)(r),"route",(function(e){return 0===e?h.default.createElement(j.default,{visible:!0}):h.default.createElement(b.BrowserRouter,{getUserConfirmation:r.showConfirm},h.default.createElement("div",{className:"g-main"},h.default.createElement("div",{className:"router-main"},"admin"===r.props.curUserRole&&h.default.createElement(x.default,null),1!==r.props.loginState?h.default.createElement(k.default,null):null,h.default.createElement("div",{className:"router-container"},Object.keys(S).map((function(e){var t=S[e];return"login"===e?h.default.createElement(b.Route,{key:e,path:t.path,component:t.component}):"home"===e?h.default.createElement(b.Route,{key:e,exact:!0,path:t.path,component:t.component}):h.default.createElement(b.Route,{key:e,path:t.path,component:(0,C.requireAuthentication)(t.component)})}))))))})),r.state={login:0},r}return(0,i.default)(a,[{key:"componentDidMount",value:function(){this.props.checkLoginState()}},{key:"render",value:function(){return this.route(this.props.loginState)}}]),a}(h.PureComponent),(0,m.default)(u,"propTypes",{checkLoginState:g.default.func,loginState:g.default.number,curUserRole:g.default.string}),l=o))||l;t.default=I},1225:function(e,t,a){"use strict";var r=a(3);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"AddProject",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"Follows",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"Group",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"Header",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"Home",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"Index",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"Login",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"Project",{enumerable:!0,get:function(){return i.default}});var n=r(a(392)),l=r(a(1243)),u=r(a(1250)),o=r(a(1254)),c=r(a(579)),i=r(a(1284)),s=r(a(1604)),d=r(a(1606))},1232:function(e,t,a){},1233:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(30));a(53);var u=r(a(54));a(196);var o=r(a(153));a(33);var c=r(a(25));a(1234);var i=r(a(1632));a(48);var s=r(a(47));a(36);var d=r(a(4)),f=r(a(31)),p=r(a(9)),m=r(a(10)),h=r(a(23)),y=r(a(11)),v=r(a(12)),g=r(a(13)),b=r(a(5));a(232);var E=r(a(245)),_=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=D(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),k=r(a(1237)),j=r(a(0)),w=a(22);a(1238);var O,C,x,P=a(40),N=a(102),M=a(103),S=a(237),I=a(68),R=a(124);function D(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(D=function(e){return e?a:t})(e)}function T(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,g.default)(e);if(t){var n=(0,g.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,v.default)(this,a)}}E.default.Option;var q=(0,w.connect)((function(e){return{groupList:e.group.groupList,projectList:e.project.projectList}}),{setCurrGroup:M.setCurrGroup,changeMenuItem:S.changeMenuItem,fetchGroupMsg:M.fetchGroupMsg,fetchInterfaceListMenu:R.fetchInterfaceListMenu})(O=(0,P.withRouter)((x=C=function(e){(0,y.default)(a,e);var t=T(a);function a(e){var r;return(0,p.default)(this,a),r=t.call(this,e),(0,b.default)((0,h.default)(r),"jump",function(){var e=(0,f.default)(l.default.mark((function e(t,a){return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.props.fetchInterfaceListMenu(t);case 2:r.props.history.push("/project/"+t+"/interface/api/"+a),r.hide();case 4:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}()),(0,b.default)((0,h.default)(r),"searchDebounce",k.default.debounce(r.search,500)),(0,b.default)((0,h.default)(r),"query",(function(){r.state.keyWord&&0!=r.state.keyWord.length?(r.setState({loading:!0}),N.axios.post("/api/search",{keyWord:r.state.keyWord,page:r.state.page||1,limit:r.state.limit||10}).then((function(e){var t=r.state.interfaceList||[];r.state.page>1?e.data.interfaceData.list.forEach((function(e){t.push(e)})):t=e.data.interfaceData.list,r.setState({interfaceList:t,total:e.data.interfaceData.total,hasMore:e.data.interfaceData.hasMore}),r.setState({loading:!1})})).catch((function(e){r.setState({loading:!1})}))):r.setState({interfaceList:[],total:0,hasMore:!1})})),(0,b.default)((0,h.default)(r),"hide",(function(){r.setState({visible:!1})})),(0,b.default)((0,h.default)(r),"loadMore",(function(){if(!0===r.state.hasMore){var e=r.state.page;e+=1,r.setState({page:e},r.query)}})),r.state={dataSource:[],keyWord:"",interfaceList:[]},r}return(0,m.default)(a,[{key:"search",value:function(){this.setState({page:1,limit:10,hashMore:!1},this.query)}},{key:"render",value:function(){var e=this;this.state.dataSource;return _.default.createElement("div",{className:"search-wrapper"},_.default.createElement(u.default,{closable:!1,visible:this.state.visible,onCancel:function(){e.setState({visible:!1})},footer:"",style:{overflow:"hidden"}},_.default.createElement("div",null,_.default.createElement(s.default,{placeholder:"输入接口名字或者路径",value:this.state.keyWord,suffix:_.default.createElement(d.default,{type:"search"}),allowClear:!0,onKeyDown:function(t){13==t.keyCode&&e.search()},onChange:function(t){e.setState({keyWord:t.target.value},(function(){e.searchDebounce()}))}})),_.default.createElement("div",{style:{height:"40px",lineHeight:"24px",marginTop:"10px"}},"搜索结果 数量 ",_.default.createElement("span",{style:{color:"#EF4444"}},this.state.total)),this.state.total&&this.state.total>0?_.default.createElement("div",{style:{maxHeight:"500px",overflowY:"auto",marginTop:"5px"}},_.default.createElement(i.default,{itemLayout:"vertical",loading:this.state.loading,size:"small",style:{padding:"0 0 60px 10px"},header:_.default.createElement("div",{style:{color:"#34D399",fontSize:"18px",fontWeight:"500"}},"API")},this.state.interfaceList.map((function(t,a){return _.default.createElement(i.default.Item,null,_.default.createElement(i.default.Item.Meta,{title:_.default.createElement("div",{style:{fontSize:"14px",cursor:"pointer"},onClick:function(){e.jump(t.project_id,t._id)}},_.default.createElement("span",{style:{color:"#8189A1",fontWeight:"700"}},a+1,".")," ",t.title),description:_.default.createElement("span",{className:"flex"},_.default.createElement("span",null,t.path," ")," ",_.default.createElement("span",{style:{marginLeft:"20px"}},"修改时间:",(0,I.formatTime)(t.up_time)))}))}))),_.default.createElement("div",{style:{textAlign:"center",marginTop:"10px",position:"absolute",bottom:"10px",left:"0px",backgroundColor:"#fff",width:"100%"}},!0===this.state.hasMore?_.default.createElement(c.default,{type:"link",onLoad:this.loading,onClick:this.loadMore},"加载更多..."):_.default.createElement("span",null,"没有更多了..."))):_.default.createElement(o.default,null)),_.default.createElement(d.default,{className:"search",style:{fontSize:16},type:"search",onClick:function(){e.setState({visible:!0})}}))}}]),a}(_.default.Component),(0,b.default)(C,"propTypes",{groupList:j.default.array,projectList:j.default.array,router:j.default.object,history:j.default.object,location:j.default.object,setCurrGroup:j.default.func,changeMenuItem:j.default.func,fetchInterfaceListMenu:j.default.func,fetchGroupMsg:j.default.func}),O=x))||O)||O;t.default=q},1238:function(e,t,a){},124:function(e,t,a){"use strict";var r=a(3);Object.defineProperty(t,"__esModule",{value:!0}),t.changeEditStatus=function(e){return{type:"yapi/interface/CHANGE_EDIT_STATUS",status:e}},t.default=void 0,t.deleteInterfaceCatData=function(e){return y.apply(this,arguments)},t.deleteInterfaceData=function(e){return m.apply(this,arguments)},t.fetchInterfaceCatList=function(e){return E.apply(this,arguments)},t.fetchInterfaceData=function(e){return v.apply(this,arguments)},t.fetchInterfaceList=function(e){return b.apply(this,arguments)},t.fetchInterfaceListMenu=function(e){return g.apply(this,arguments)},t.initInterface=function(){return{type:"yapi/interface/INIT_INTERFACE_DATA"}},t.saveImportData=function(e){return h.apply(this,arguments)},t.updateInterfaceData=function(e){return{type:"yapi/interface/UPDATE_INTERFACE_DATA",updata:e,payload:!0}};var n=r(a(30)),l=r(a(31)),u=r(a(5)),o=r(a(44));function c(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function i(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?c(Object(a),!0).forEach((function(t){(0,u.default)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):c(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var s="yapi/interface/FETCH_INTERFACE_DATA",d="yapi/interface/FETCH_INTERFACE_LIST",f="yapi/interface/FETCH_INTERFACE_CAT_LIST",p={curdata:{},list:[],editStatus:!1,totalTableList:[],catTableList:[],count:0,totalCount:0};function m(){return(m=(0,l.default)(n.default.mark((function e(t){var a;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.default.post("/api/interface/del",{id:t});case 2:return a=e.sent,e.abrupt("return",{type:"yapi/interface/DELETE_INTERFACE_DATA",payload:a});case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function h(){return(h=(0,l.default)(n.default.mark((function e(t){var a;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.default.post("/api/interface/save",t);case 2:return a=e.sent,e.abrupt("return",{type:"yapi/interface/SAVE_IMPORT_DATA",payload:a});case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function y(){return(y=(0,l.default)(n.default.mark((function e(t){var a;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.default.post("/api/interface/del_cat",{catid:t});case 2:return a=e.sent,e.abrupt("return",{type:"yapi/interface/DELETE_INTERFACE_CAT_DATA",payload:a});case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function v(){return(v=(0,l.default)(n.default.mark((function e(t){var a;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.default.get("/api/interface/get?id="+t);case 2:return a=e.sent,e.abrupt("return",{type:s,payload:a});case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function g(){return(g=(0,l.default)(n.default.mark((function e(t){var a;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.default.get("/api/interface/list_menu?project_id="+t);case 2:return a=e.sent,e.abrupt("return",{type:"yapi/interface/FETCH_INTERFACE_LIST_MENU",payload:a});case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function b(){return(b=(0,l.default)(n.default.mark((function e(t){var a;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.default.get("/api/interface/list",{params:t});case 2:return a=e.sent,e.abrupt("return",{type:d,payload:a});case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function E(){return(E=(0,l.default)(n.default.mark((function e(t){var a;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.default.get("/api/interface/list_cat",{params:t});case 2:return a=e.sent,e.abrupt("return",{type:f,payload:a});case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"yapi/interface/INIT_INTERFACE_DATA":return p;case"yapi/interface/UPDATE_INTERFACE_DATA":return i(i({},e),{},{curdata:Object.assign({},e.curdata,t.updata)});case s:return i(i({},e),{},{curdata:t.payload.data.data});case"yapi/interface/FETCH_INTERFACE_LIST_MENU":return i(i({},e),{},{list:t.payload.data.data});case"yapi/interface/CHANGE_EDIT_STATUS":return i(i({},e),{},{editStatus:t.status});case d:return i(i({},e),{},{totalTableList:t.payload.data.data.list,totalCount:t.payload.data.data.count});case f:return i(i({},e),{},{catTableList:t.payload.data.data.list,count:t.payload.data.data.count});default:return e}}},1242:function(e,t,a){},1243:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(9)),u=r(a(10)),o=r(a(23)),c=r(a(11)),i=r(a(12)),s=r(a(13)),d=r(a(5));a(203);var f=r(a(210));a(36);var p=r(a(4));a(57);var m=r(a(51));a(64);var h=r(a(49));a(33);var y=r(a(25));a(1249);var v,g,b,E=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=C(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),_=a(22),k=a(40),j=r(a(0)),w=r(a(393)),O=a(237);function C(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(C=function(e){return e?a:t})(e)}function x(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,s.default)(e);if(t){var n=(0,s.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,i.default)(this,a)}}var P=a(141).emitHook("third_login"),N=function(){return E.default.createElement("div",{className:"g-body"},E.default.createElement("div",{className:"m-bg"},E.default.createElement("div",{className:"m-bg-mask m-bg-mask0"}),E.default.createElement("div",{className:"m-bg-mask m-bg-mask1"}),E.default.createElement("div",{className:"m-bg-mask m-bg-mask2"}),E.default.createElement("div",{className:"m-bg-mask m-bg-mask3"})),E.default.createElement("div",{className:"main-one"},E.default.createElement("div",{className:"container"},E.default.createElement(m.default,null,E.default.createElement(h.default,{lg:9,xs:24},E.default.createElement("div",{className:"home-des"},E.default.createElement("div",{className:"logo"},E.default.createElement(w.default,{length:"72px"}),E.default.createElement("span",{className:"name"},"YAPI")),E.default.createElement("div",{className:"detail"},"高效、易用、功能强大的API管理平台",E.default.createElement("br",null),E.default.createElement("span",{className:"desc"},"旨在为开发、产品、测试人员提供更优雅的接口管理服务")),E.default.createElement("div",{className:"btn-group"},E.default.createElement(k.Link,{to:"/login"},E.default.createElement(y.default,{type:"primary",className:"btn-home btn-login"},"登录 / 注册")),null!=P?E.default.createElement(P,null):null))),E.default.createElement(h.default,{lg:15,xs:0,className:"col-img"},E.default.createElement("div",{className:"img-container"}))))),E.default.createElement("div",{className:"feat-part section-feature"},E.default.createElement("div",{className:"container home-section"},E.default.createElement("h3",{className:"title"},"为API开发者设计的管理平台"),E.default.createElement("span",{className:"desc"},"YApi让接口开发更简单高效，让接口的管理更具可读性、可维护性，让团队协作更合理。"),E.default.createElement(m.default,{key:"feat-motion-row"},E.default.createElement(h.default,{span:8,className:"section-item",key:"feat-wrapper-1"},E.default.createElement(p.default,{type:"appstore-o",className:"img"}),E.default.createElement("h4",{className:"title"},"项目管理"),E.default.createElement("span",{className:"desc"},"提供基本的项目分组，项目管理，接口管理功能")),E.default.createElement(h.default,{span:8,className:"section-item",key:"feat-wrapper-2"},E.default.createElement(p.default,{type:"api",className:"img"}),E.default.createElement("h4",{className:"title"},"接口管理"),E.default.createElement("span",{className:"desc"},"友好的接口文档，基于websocket的多人协作接口编辑功能和类postman测试工具，让多人协作成倍提升开发效率")),E.default.createElement(h.default,{span:8,className:"section-item",key:"feat-wrapper-3"},E.default.createElement(p.default,{type:"database",className:"img"}),E.default.createElement("h4",{className:"title"},"MockServer"),E.default.createElement("span",{className:"desc"},"基于Mockjs，使用简单功能强大"))))),E.default.createElement("div",{className:"feat-part m-mock m-skew home-section"},E.default.createElement("div",{className:"m-skew-bg"},E.default.createElement("div",{className:"m-bg-mask m-bg-mask0"}),E.default.createElement("div",{className:"m-bg-mask m-bg-mask1"}),E.default.createElement("div",{className:"m-bg-mask m-bg-mask2"})),E.default.createElement("div",{className:"container skew-container"},E.default.createElement("h3",{className:"title"},"功能强大的 Mock 服务"),E.default.createElement("span",{className:"desc"},"你想要的 Mock 服务都在这里"),E.default.createElement(m.default,{className:"row-card"},E.default.createElement(h.default,{lg:12,xs:24,className:"section-card"},E.default.createElement(f.default,{title:"Mock 规则"},E.default.createElement("p",{className:"mock-desc"},"通过学习一些简单的 Mock 模板规则即可轻松编写接口，这将大大提高定义接口的效率，并且无需为编写 Mock 数据烦恼: 所有的数据都可以实时随机生成。"),E.default.createElement("div",{className:"code"},E.default.createElement("ol",{start:"1"},E.default.createElement("li",{className:"item"},E.default.createElement("span",{className:"orderNum orderNum-first"},"1"),E.default.createElement("span",null,E.default.createElement("span",null,"{  "))),E.default.createElement("li",{className:"item"},E.default.createElement("span",{className:"orderNum"},"2"),E.default.createElement("span",null,"    ",E.default.createElement("span",{className:"string"},'"errcode|200-500"'),E.default.createElement("span",null,": ",E.default.createElement("span",{className:"number"},"200"),",  "))),E.default.createElement("li",{className:"item"},E.default.createElement("span",{className:"orderNum"},"3"),E.default.createElement("span",null,"    ",E.default.createElement("span",{className:"string"},'"errmsg|4-8"'),E.default.createElement("span",null,": "),E.default.createElement("span",{className:"string"},'"@string"'),E.default.createElement("span",null,",  "))),E.default.createElement("li",{className:"item"},E.default.createElement("span",{className:"orderNum"},"4"),E.default.createElement("span",null,"    ",E.default.createElement("span",{className:"string"},'"data"'),E.default.createElement("span",null,": {  "))),E.default.createElement("li",{className:"item"},E.default.createElement("span",{className:"orderNum"},"5"),E.default.createElement("span",null,"        ",E.default.createElement("span",{className:"string"},'"boolean|1"'),E.default.createElement("span",null,": "),E.default.createElement("span",{className:"keyword"},"true"),E.default.createElement("span",null,",  "))),E.default.createElement("li",{className:"item"},E.default.createElement("span",{className:"orderNum"},"6"),E.default.createElement("span",null,"        ",E.default.createElement("span",{className:"string"},'"array|2"'),E.default.createElement("span",null,": [",E.default.createElement("span",{className:"string"},'"Bob"'),", ",E.default.createElement("span",{className:"string"},'"Jim"'),"],  "))),E.default.createElement("li",{className:"item"},E.default.createElement("span",{className:"orderNum"},"7"),E.default.createElement("span",null,"        ",E.default.createElement("span",{className:"string"},'"combine"'),E.default.createElement("span",null,": "),E.default.createElement("span",{className:"string"},'"@boolean & @array"'),E.default.createElement("span",null,"  "))),E.default.createElement("li",{className:"item"},E.default.createElement("span",{className:"orderNum"},"8"),E.default.createElement("span",null,"    }  ")),E.default.createElement("li",{className:"item"},E.default.createElement("span",{className:"orderNum orderNum-last"},"9"),E.default.createElement("span",null,"}  ")))))),E.default.createElement(h.default,{lg:12,xs:24,className:"section-card mock-after"},E.default.createElement(f.default,{title:"生成的 Mock 数据"},E.default.createElement("p",{className:"mock-desc"},"生成的 Mock 数据可以直接用 ajax 请求使用，也可以通过服务器代理使用（不需要修改项目一行代码）"),E.default.createElement("div",{className:"code"},E.default.createElement("ol",{start:"1"},E.default.createElement("li",{className:"alt"},E.default.createElement("span",{className:"orderNum orderNum-first"},"1"),E.default.createElement("span",null,E.default.createElement("span",null,"{  "))),E.default.createElement("li",{className:""},E.default.createElement("span",{className:"orderNum"},"2"),E.default.createElement("span",null,"  ",E.default.createElement("span",{className:"string"},'"errcode"'),E.default.createElement("span",null,": "),E.default.createElement("span",{className:"number"},"304"),E.default.createElement("span",null,",  "))),E.default.createElement("li",{className:"alt"},E.default.createElement("span",{className:"orderNum"},"3"),E.default.createElement("span",null,"  ",E.default.createElement("span",{className:"string"},'"errmsg"'),E.default.createElement("span",null,": "),E.default.createElement("span",{className:"string"},'"JtkMIoRu)N#ie^h%Z77[F)"'),E.default.createElement("span",null,",  "))),E.default.createElement("li",{className:""},E.default.createElement("span",{className:"orderNum"},"4"),E.default.createElement("span",null,"  ",E.default.createElement("span",{className:"string"},'"data"'),E.default.createElement("span",null,": {  "))),E.default.createElement("li",{className:"alt"},E.default.createElement("span",{className:"orderNum"},"5"),E.default.createElement("span",null,"    ",E.default.createElement("span",{className:"string"},'"boolean"'),E.default.createElement("span",null,": "),E.default.createElement("span",{className:"keyword"},"true"),E.default.createElement("span",null,",  "))),E.default.createElement("li",{className:""},E.default.createElement("span",{className:"orderNum"},"6"),E.default.createElement("span",null,"    ",E.default.createElement("span",{className:"string"},'"array"'),E.default.createElement("span",null,": "),"[",E.default.createElement("span",{className:"string"},'"Bob"'),", ",E.default.createElement("span",{className:"string"},'"Jim"'),", ",E.default.createElement("span",{className:"string"},'"Bob"'),", ",E.default.createElement("span",{className:"string"},'"Jim"'),"]",E.default.createElement("span",null,",  "))),E.default.createElement("li",{className:"alt"},E.default.createElement("span",{className:"orderNum"},"7"),E.default.createElement("span",null,"    ",E.default.createElement("span",{className:"string"},'"combine"'),E.default.createElement("span",null,": "),E.default.createElement("span",{className:"string"},'"true & Bob, Jim, Bob, Jim"'),E.default.createElement("span",null,"  "))),E.default.createElement("li",{className:""},E.default.createElement("span",{className:"orderNum"},"8"),E.default.createElement("span",null,"  }  ")),E.default.createElement("li",{className:"alt"},E.default.createElement("span",{className:"orderNum orderNum-last"},"9"),E.default.createElement("span",null,"}  "))))))))),E.default.createElement("div",{className:"home-section section-manage"},E.default.createElement("div",{className:"container"},E.default.createElement(m.default,{className:"row-card",style:{marginBottom:".48rem"}},E.default.createElement(h.default,{lg:7,xs:10,className:"section-card"},E.default.createElement(f.default,null,E.default.createElement("div",{className:"section-block block-first"},E.default.createElement("h4",null,"超级管理员(* N)"),E.default.createElement("p",{className:"item"}," - 创建分组"),E.default.createElement("p",{className:"item"}," - 分配组长"),E.default.createElement("p",{className:"item"}," - 管理所有成员信息")),E.default.createElement("div",{className:"section-block block-second"},E.default.createElement("h4",null,"组长(* N)"),E.default.createElement("p",{className:"item"}," - 创建项目"),E.default.createElement("p",{className:"item"}," - 管理分组或项目的信息"),E.default.createElement("p",{className:"item"}," - 管理开发者与成员")),E.default.createElement("div",{className:"section-block block-third"},E.default.createElement("h4",null,"开发者(* N) / 成员(* N)"),E.default.createElement("p",{className:"item"}," - 不允许创建分组"),E.default.createElement("p",{className:"item"}," - 不允许修改分组或项目信息")))),E.default.createElement(h.default,{lg:17,xs:14,className:"section-card manage-word"},E.default.createElement(p.default,{type:"team",className:"icon"}),E.default.createElement("h3",{className:"title"},"扁平化管理模式"),E.default.createElement("p",{className:"desc"},"接口管理的逻辑较为复杂，操作频率高，层层审批将严重拖慢生产效率，因此传统的金字塔管理模式并不适用。"),E.default.createElement("p",{className:"desc"},"YAPI 将扁平化管理模式的思想引入到产品的权限管理中，超级管理员拥有最高的权限，并将权限分配给若干组长，超级管理员只需管理组长即可，实际上管理YAPI各大分组与项目的是“组长”。组长对分组或项目负责，一般由BU负责人/项目负责人担任。"))))))};N.propTypes={introList:j.default.array};var M=(0,_.connect)((function(e){return{login:e.user.isLogin}}),{changeMenuItem:O.changeMenuItem})(v=(0,k.withRouter)((b=g=function(e){(0,c.default)(a,e);var t=x(a);function a(e){var r;return(0,l.default)(this,a),r=t.call(this,e),(0,d.default)((0,o.default)(r),"toStart",(function(){r.props.changeMenuItem("/group")})),r}return(0,u.default)(a,[{key:"componentWillMount",value:function(){this.props.login&&this.props.history.push("/space/home")}},{key:"componentDidMount",value:function(){}},{key:"render",value:function(){return E.default.createElement("div",{className:"home-main"},E.default.createElement(N,{introList:this.props.introList}),E.default.createElement("div",{className:"row-tip"},E.default.createElement("div",{className:"container"},E.default.createElement("div",{className:"tip-title"},E.default.createElement("h3",{className:"title"},"准备好使用了吗？"),E.default.createElement("p",{className:"desc"},"注册账号尽请使用吧，查看使用文档了解更多信息")),E.default.createElement("div",{className:"tip-btns"},E.default.createElement("div",{className:"btn-group"},E.default.createElement(k.Link,{to:"/login"},E.default.createElement(y.default,{type:"primary",className:"btn-home btn-login"},"登录 / 注册")),E.default.createElement(y.default,{className:"btn-home btn-home-normal"},E.default.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"https://yapi.ymfe.org"},"使用文档")))))))}}]),a}(E.PureComponent),(0,d.default)(g,"propTypes",{introList:j.default.array,login:j.default.bool,history:j.default.object,changeMenuItem:j.default.func}),v=b))||v)||v;t.default=M},1249:function(e,t,a){},1250:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(57);var l=r(a(51));a(64);var u=r(a(49));a(203);var o=r(a(210)),c=r(a(9)),i=r(a(10)),s=r(a(11)),d=r(a(12)),f=r(a(13)),p=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=h(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),m=r(a(1251));r(a(393));function h(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(h=function(e){return e?a:t})(e)}function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,f.default)(e);if(t){var n=(0,f.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,d.default)(this,a)}}var v=function(e){(0,s.default)(r,e);var t=y(r);function r(){return(0,c.default)(this,r),t.apply(this,arguments)}return(0,i.default)(r,[{key:"render",value:function(){return p.default.createElement("div",{className:"g-body login-body"},p.default.createElement("div",{className:"m-bg"},p.default.createElement("div",{className:"m-bg-mask m-bg-mask0"}),p.default.createElement("div",{className:"m-bg-mask m-bg-mask1"}),p.default.createElement("div",{className:"m-bg-mask m-bg-mask2"}),p.default.createElement("div",{className:"m-bg-mask m-bg-mask3"})),p.default.createElement("div",{className:"main-one login-container"},p.default.createElement("div",{className:"container"},p.default.createElement(l.default,{type:"flex",justify:"center"},p.default.createElement(u.default,{xs:20,sm:16,md:12,lg:8,className:"container-login"},p.default.createElement(o.default,{className:"card-login"},p.default.createElement("h2",{className:"login-title"},"凯叔接口文档管理"),p.default.createElement("div",{className:"login-logo"},p.default.createElement("img",{src:a(569)})),p.default.createElement(m.default,null)))))))}}]),r}(p.PureComponent);t.default=v},1251:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(9)),u=r(a(10)),o=r(a(11)),c=r(a(12)),i=r(a(13)),s=r(a(5));a(125);var d,f,p,m=r(a(110)),h=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=E(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),y=a(22),v=r(a(0)),g=r(a(1252)),b=r(a(1253));function E(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(E=function(e){return e?a:t})(e)}function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,i.default)(e);if(t){var n=(0,i.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,c.default)(this,a)}}a(570);var k=m.default.TabPane,j=(0,y.connect)((function(e){return{loginWrapActiveKey:e.user.loginWrapActiveKey,canRegister:e.user.canRegister}}))((p=f=function(e){(0,o.default)(a,e);var t=_(a);function a(e){return(0,l.default)(this,a),t.call(this,e)}return(0,u.default)(a,[{key:"render",value:function(){var e=this.props,t=e.loginWrapActiveKey,a=e.canRegister;return h.default.createElement(m.default,{defaultActiveKey:t,className:"login-form",tabBarStyle:{border:"none"}},h.default.createElement(k,{tab:"登录",key:"1"},h.default.createElement(g.default,null)),h.default.createElement(k,{tab:"注册",key:"2"},a?h.default.createElement(b.default,null):h.default.createElement("div",{style:{minHeight:200}},"管理员已禁止注册，请联系管理员")))}}]),a}(h.PureComponent),(0,s.default)(f,"propTypes",{form:v.default.object,loginWrapActiveKey:v.default.string,canRegister:v.default.bool}),d=p))||d;t.default=j},1252:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(33);var l=r(a(25));a(48);var u=r(a(47));a(36);var o=r(a(4));a(38);var c=r(a(39)),i=r(a(9)),s=r(a(10)),d=r(a(23)),f=r(a(11)),p=r(a(12)),m=r(a(13)),h=r(a(5));a(162);var y=r(a(127));a(82);var v,g,b,E=r(a(84)),_=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=C(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),k=r(a(0)),j=a(22),w=a(101),O=a(40);function C(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(C=function(e){return e?a:t})(e)}function x(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,m.default)(e);if(t){var n=(0,m.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,p.default)(this,a)}}a(570);var P=E.default.Item,N=y.default.Group,M={marginBottom:".16rem"},S={height:".42rem"},I=(0,j.connect)((function(e){return{loginData:e.user,isLDAP:e.user.isLDAP}}),{loginActions:w.loginActions,loginLdapActions:w.loginLdapActions})(v=(0,O.withRouter)((b=g=function(e){(0,f.default)(a,e);var t=x(a);function a(e){var r;return(0,i.default)(this,a),r=t.call(this,e),(0,h.default)((0,d.default)(r),"handleSubmit",(function(e){e.preventDefault(),r.props.form.validateFields((function(e,t){e||(r.props.isLDAP&&"ldap"===r.state.loginType?r.props.loginLdapActions(t).then((function(e){0==e.payload.data.errcode&&(r.props.history.replace("/space/home"),c.default.success("登录成功! "))})):r.props.loginActions(t).then((function(e){0==e.payload.data.errcode&&(r.props.history.replace("/space/home"),c.default.success("登录成功! "))})))}))})),(0,h.default)((0,d.default)(r),"handleFormLayoutChange",(function(e){r.setState({loginType:e.target.value})})),r.state={loginType:"ldap"},r}return(0,s.default)(a,[{key:"componentDidMount",value:function(){console.log("isLDAP",this.props.isLDAP)}},{key:"render",value:function(){var e=this.props.form.getFieldDecorator,t=this.props.isLDAP,a="ldap"===this.state.loginType?{}:{required:!0,message:"请输入正确的email!",pattern:/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{1,})+$/};return _.default.createElement(E.default,{onSubmit:this.handleSubmit},t&&_.default.createElement(P,null,_.default.createElement(N,{defaultValue:"ldap",onChange:this.handleFormLayoutChange},_.default.createElement(y.default,{value:"ldap"},"LDAP"),_.default.createElement(y.default,{value:"normal"},"普通登录"))),_.default.createElement(P,{style:M},e("email",{rules:[a]})(_.default.createElement(u.default,{style:S,prefix:_.default.createElement(o.default,{type:"user",style:{fontSize:13}}),placeholder:"Email"}))),_.default.createElement(P,{style:M},e("password",{rules:[{required:!0,message:"请输入密码!"}]})(_.default.createElement(u.default,{style:S,prefix:_.default.createElement(o.default,{type:"lock",style:{fontSize:13}}),type:"password",placeholder:"Password"}))),_.default.createElement(P,{style:M},_.default.createElement(l.default,{style:S,type:"primary",htmlType:"submit",className:"login-form-button"},"登录")))}}]),a}(_.PureComponent),(0,h.default)(g,"propTypes",{form:k.default.object,history:k.default.object,loginActions:k.default.func,loginLdapActions:k.default.func,isLDAP:k.default.bool}),v=b))||v)||v,R=E.default.create()(I);t.default=R},1253:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(33);var l=r(a(25));a(48);var u=r(a(47));a(36);var o=r(a(4));a(38);var c=r(a(39)),i=r(a(9)),s=r(a(10)),d=r(a(23)),f=r(a(11)),p=r(a(12)),m=r(a(13)),h=r(a(5));a(82);var y,v,g,b=r(a(84)),E=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=O(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),_=r(a(0)),k=a(22),j=a(101),w=a(40);function O(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(O=function(e){return e?a:t})(e)}function C(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,m.default)(e);if(t){var n=(0,m.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,p.default)(this,a)}}var x=b.default.Item,P={marginBottom:".16rem"},N={height:".42rem"},M=(0,k.connect)((function(e){return{loginData:e.user}}),{regActions:j.regActions})(y=(0,w.withRouter)((g=v=function(e){(0,f.default)(a,e);var t=C(a);function a(e){var r;return(0,i.default)(this,a),r=t.call(this,e),(0,h.default)((0,d.default)(r),"handleSubmit",(function(e){e.preventDefault(),r.props.form.validateFieldsAndScroll((function(e,t){e||r.props.regActions(t).then((function(e){0==e.payload.data.errcode&&(r.props.history.replace("/group"),c.default.success("注册成功! "))}))}))})),(0,h.default)((0,d.default)(r),"checkPassword",(function(e,t,a){var n=r.props.form;t&&t!==n.getFieldValue("password")?a("两次输入的密码不一致啊!"):a()})),(0,h.default)((0,d.default)(r),"checkConfirm",(function(e,t,a){var n=r.props.form;t&&r.state.confirmDirty&&n.validateFields(["confirm"],{force:!0}),a()})),r.state={confirmDirty:!1},r}return(0,s.default)(a,[{key:"render",value:function(){var e=this.props.form.getFieldDecorator;return E.default.createElement(b.default,{onSubmit:this.handleSubmit},E.default.createElement(x,{style:P},e("userName",{rules:[{required:!0,message:"请输入用户名!"}]})(E.default.createElement(u.default,{style:N,prefix:E.default.createElement(o.default,{type:"user",style:{fontSize:13}}),placeholder:"Username"}))),E.default.createElement(x,{style:P},e("email",{rules:[{required:!0,message:"请输入email!",pattern:/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{1,})+$/}]})(E.default.createElement(u.default,{style:N,prefix:E.default.createElement(o.default,{type:"mail",style:{fontSize:13}}),placeholder:"Email"}))),E.default.createElement(x,{style:P},e("password",{rules:[{required:!0,message:"请输入密码!"},{validator:this.checkConfirm}]})(E.default.createElement(u.default,{style:N,prefix:E.default.createElement(o.default,{type:"lock",style:{fontSize:13}}),type:"password",placeholder:"Password"}))),E.default.createElement(x,{style:P},e("confirm",{rules:[{required:!0,message:"请再次输入密码密码!"},{validator:this.checkPassword}]})(E.default.createElement(u.default,{style:N,prefix:E.default.createElement(o.default,{type:"lock",style:{fontSize:13}}),type:"password",placeholder:"Confirm Password"}))),E.default.createElement(x,{style:P},E.default.createElement(l.default,{style:N,type:"primary",htmlType:"submit",className:"login-form-button"},"注册")))}}]),a}(E.PureComponent),(0,h.default)(v,"propTypes",{form:_.default.object,history:_.default.object,regActions:_.default.func}),y=g))||y)||y,S=b.default.create()(M);t.default=S},1254:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(9)),u=r(a(10)),o=r(a(11)),c=r(a(12)),i=r(a(13)),s=r(a(5));a(125);var d=r(a(110));a(146);var f=r(a(147)),p=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=O(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),m=r(a(1255)),h=(r(a(574)),r(a(575)),r(a(576)),r(a(578)),r(a(0))),y=a(22),v=a(40),g=a(180),b=a(103);a(1282);r(a(44));var E,_,k,j=r(a(579)),w=r(a(1283));function O(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(O=function(e){return e?a:t})(e)}function C(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,i.default)(e);if(t){var n=(0,i.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,c.default)(this,a)}}var x=f.default.Content,P=f.default.Sider,N=(d.default.TabPane,(0,y.connect)((function(e){return{curGroupId:e.group.currGroup._id,curUserRole:e.user.role,curUserRoleInGroup:e.group.currGroup.role||e.group.role,currGroup:e.group.currGroup}}),{fetchNewsData:g.fetchNewsData,setCurrGroup:b.setCurrGroup})((k=_=function(e){(0,o.default)(a,e);var t=C(a);function a(e){var r;return(0,l.default)(this,a),(r=t.call(this,e)).state={groupId:-1},r}return(0,u.default)(a,[{key:"render",value:function(){return p.default.createElement("div",{className:"projectGround"},p.default.createElement(f.default,{style:{height:"calc(100vh - 100px)",marginLeft:"16px",marginTop:"24px",overflow:"hidden"}},p.default.createElement(P,{style:{height:"100%",backgroundColor:"#ECEEF1"},width:300},p.default.createElement(m.default,null)),p.default.createElement(f.default,null,p.default.createElement(x,{style:{height:"100%",margin:"0 24px 0 16px",overflow:"initial",backgroundColor:"#fff"}},p.default.createElement(v.Switch,null,p.default.createElement(v.Route,{path:"/space/group/:groupId",render:function(e){return p.default.createElement(w.default,e)}}),p.default.createElement(v.Route,{path:"/space/home",component:j.default}))))))}}]),a}(p.PureComponent),(0,s.default)(_,"propTypes",{fetchNewsData:h.default.func,curGroupId:h.default.number,curUserRole:h.default.string,currGroup:h.default.object,curUserRoleInGroup:h.default.string,setCurrGroup:h.default.func}),E=k))||E);t.default=N},1255:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(30));a(53);var u=r(a(54));a(57);var o=r(a(51));a(64);var c=r(a(49));a(144);var i=r(a(166));a(136);var s=r(a(111));a(33);var d=r(a(25));a(137);var f=r(a(90));a(36);var p=r(a(4));a(38);var m=r(a(39)),h=r(a(31)),y=r(a(9)),v=r(a(10)),g=r(a(23)),b=r(a(11)),E=r(a(12)),_=r(a(13)),k=r(a(5)),j=r(a(293));a(48);var w,O,C,x,P=r(a(47)),N=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=W(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),M=r(a(0)),S=a(22),I=a(311),R=r(a(44)),D=a(40),T=r(a(394)),q=r(a(568)),L=a(180),A=a(103),B=r(a(79));function W(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(W=function(e){return e?a:t})(e)}function G(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,_.default)(e);if(t){var n=(0,_.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,E.default)(this,a)}}a(1259);var F=P.default.TextArea,U=(P.default.Search,N.default.createElement("div",{className:"title-container"},N.default.createElement("h3",{className:"title"},"欢迎使用 YApi ~"),N.default.createElement("p",null,"这里的 ",N.default.createElement("b",null,"“个人空间”")," ","是你自己才能看到的分组，你拥有这个分组的全部权限，可以在这个分组里探索 YApi 的功能。"))),V=(0,S.connect)((function(e){return{groupList:e.group.groupList,currGroup:e.group.currGroup,curUserRole:e.user.role,curUserRoleInGroup:e.group.currGroup.role||e.group.role,studyTip:e.user.studyTip,study:e.user.study}}),{fetchGroupList:A.fetchGroupList,setCurrGroup:A.setCurrGroup,setGroupList:A.setGroupList,fetchNewsData:L.fetchNewsData,fetchGroupMsg:A.fetchGroupMsg})(w=(0,D.withRouter)((x=C=function(e){(0,b.default)(E,e);var t,a,r,n=G(E);function E(e){var t;return(0,y.default)(this,E),t=n.call(this,e),(0,k.default)((0,g.default)(t),"state",{addGroupModalVisible:!1,newGroupName:"",newGroupDesc:"",currGroupName:"",currGroupDesc:"",groupList:[],owner_uids:[]}),t}return(0,v.default)(E,[{key:"componentWillMount",value:(r=(0,h.default)(l.default.mark((function e(){return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return isNaN(this.props.match.params.groupId)||parseInt(this.props.match.params.groupId),e.next=3,this.props.fetchGroupList();case 3:return e.abrupt("return");case 10:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"showModal",value:function(){this.setState({addGroupModalVisible:!0})}},{key:"hideModal",value:function(){this.setState({newGroupName:"",group_name:"",owner_uids:[],addGroupModalVisible:!1})}},{key:"addGroup",value:(a=(0,h.default)(l.default.mark((function e(){var t,a,r,n,u,o,c;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.state,a=t.newGroupName,r=t.newGroupDesc,n=t.owner_uids,e.next=3,R.default.post("/api/group/add",{group_name:a,group_desc:r,owner_uids:n});case 3:if((u=e.sent).data.errcode){e.next=16;break}return this.setState({newGroupName:"",group_name:"",owner_uids:[],addGroupModalVisible:!1}),e.next=8,this.props.fetchGroupList();case 8:this.setState({groupList:this.props.groupList}),o=u.data.data._id,c=B.default.find(this.props.groupList,(function(e){return+e._id==+o})),this.props.setCurrGroup(c),this.props.fetchGroupMsg(this.props.currGroup._id),this.props.fetchNewsData(this.props.currGroup._id,"group",1,10),e.next=17;break;case 16:m.default.error(u.data.errmsg);case 17:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"editGroup",value:(t=(0,h.default)(l.default.mark((function e(){var t,a,r,n,u,o;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.state,a=t.currGroupName,r=t.currGroupDesc,n=this.props.currGroup._id,e.next=4,R.default.post("/api/group/up",{group_name:a,group_desc:r,id:n});case 4:if(!(u=e.sent).data.errcode){e.next=9;break}m.default.error(u.data.errmsg),e.next=16;break;case 9:return e.next=11,this.props.fetchGroupList();case 11:this.setState({groupList:this.props.groupList}),o=B.default.find(this.props.groupList,(function(e){return+e._id==+n})),this.props.setCurrGroup(o),this.props.fetchGroupMsg(this.props.currGroup._id),this.props.fetchNewsData(this.props.currGroup._id,"group",1,10);case 16:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"inputNewGroupName",value:function(e){this.setState({newGroupName:e.target.value})}},{key:"inputNewGroupDesc",value:function(e){this.setState({newGroupDesc:e.target.value})}},{key:"selectGroup",value:function(e){var t=e.key,a=B.default.find(this.props.groupList,(function(e){return+e._id==+t}));this.props.setCurrGroup(a),this.props.history.push("/space/group/"+"".concat(a._id)),this.props.fetchNewsData(t,"group",1,10)}},{key:"onUserSelect",value:function(e){this.setState({owner_uids:e})}},{key:"searchGroup",value:function(e,t){var a=t||e.target.value,r=this.props.groupList;""===a?this.setState({groupList:r}):this.setState({groupList:r.filter((function(e){return new RegExp(a,"i").test(e.group_name)}))})}},{key:"componentWillReceiveProps",value:function(e){this.props.groupList!==e.groupList&&this.setState({groupList:e.groupList})}},{key:"render",value:function(){var e=this,t=this.props.currGroup;return N.default.createElement("div",{className:"m-group"},N.default.createElement("div",{className:"system-menu",style:{backgroundColor:"#fff",borderRadius:"4px",overflow:"hidden",boxShadow:"0 0 6px 2px #D9D9D9",marginBottom:"10px"}},N.default.createElement("div",{style:{padding:"20px 10px",backgroundColor:"#fff"}},N.default.createElement("span",{style:{fontSize:"18px",fontWeight:"500"}},"面板")),N.default.createElement("div",null,N.default.createElement(f.default,{mode:"inline"},N.default.createElement(f.default.Item,null,N.default.createElement(D.Link,{to:"/space/home"},N.default.createElement(p.default,{type:"home"})," 首页")),N.default.createElement(f.default.Item,null,N.default.createElement(p.default,{type:"dashboard"})," Dashboard"),N.default.createElement(f.default.Item,null,N.default.createElement(p.default,{type:"star"})," 收藏")))),this.props.study?null:N.default.createElement("div",{className:"study-mask"}),N.default.createElement("div",{className:"group-bar"},N.default.createElement("div",{style:{borderRadius:"4px",overflow:"hidden"}},N.default.createElement("div",{style:{padding:"20px 10px",backgroundColor:"#fff"}},N.default.createElement("span",{style:{fontSize:"18px",fontWeight:"500"}},"空间")),N.default.createElement("div",{style:{padding:"5px"}},N.default.createElement(d.default,{size:"small",icon:"plus",onClick:this.showModal},"创建空间")),0===this.state.groupList.length&&N.default.createElement(s.default,{style:{marginTop:20,display:"flex",justifyContent:"center"}}),N.default.createElement("div",{className:"group-menu"},N.default.createElement(f.default,{mode:"inline",onClick:this.selectGroup,selectedKeys:["".concat(t._id)]},this.state.groupList.map((function(t){return"private"===t.type?N.default.createElement(f.default.Item,{key:"".concat(t._id),className:"group-item",style:{zIndex:0===e.props.studyTip?3:1}},N.default.createElement(p.default,{type:"user"}),N.default.createElement(i.default,{overlayClassName:"popover-index",content:N.default.createElement(q.default,null),title:U,placement:"right",visible:0===e.props.studyTip&&!e.props.study},t.group_name)):N.default.createElement(f.default.Item,{key:"".concat(t._id),className:"group-item"},N.default.createElement(p.default,{type:"folder-open"}),t.group_name)})))))),this.state.addGroupModalVisible?N.default.createElement(u.default,{title:"添加分组",visible:this.state.addGroupModalVisible,onOk:this.addGroup,onCancel:this.hideModal,className:"add-group-modal"},N.default.createElement(o.default,{gutter:6,className:"modal-input"},N.default.createElement(c.default,{span:"5"},N.default.createElement("div",{className:"label"},"分组名：")),N.default.createElement(c.default,{span:"15"},N.default.createElement(P.default,{placeholder:"请输入分组名称",onChange:this.inputNewGroupName}))),N.default.createElement(o.default,{gutter:6,className:"modal-input"},N.default.createElement(c.default,{span:"5"},N.default.createElement("div",{className:"label"},"简介：")),N.default.createElement(c.default,{span:"15"},N.default.createElement(F,{rows:3,placeholder:"请输入分组描述",onChange:this.inputNewGroupDesc}))),N.default.createElement(o.default,{gutter:6,className:"modal-input"},N.default.createElement(c.default,{span:"5"},N.default.createElement("div",{className:"label"},"组长：")),N.default.createElement(c.default,{span:"15"},N.default.createElement(T.default,{callbackState:this.onUserSelect})))):"")}}]),E}(N.PureComponent),(0,k.default)(C,"propTypes",{groupList:M.default.array,currGroup:M.default.object,fetchGroupList:M.default.func,setCurrGroup:M.default.func,setGroupList:M.default.func,match:M.default.object,history:M.default.object,curUserRole:M.default.string,curUserRoleInGroup:M.default.string,studyTip:M.default.number,study:M.default.bool,fetchNewsData:M.default.func,fetchGroupMsg:M.default.func}),O=x,(0,j.default)(O.prototype,"showModal",[I.autobind],Object.getOwnPropertyDescriptor(O.prototype,"showModal"),O.prototype),(0,j.default)(O.prototype,"hideModal",[I.autobind],Object.getOwnPropertyDescriptor(O.prototype,"hideModal"),O.prototype),(0,j.default)(O.prototype,"addGroup",[I.autobind],Object.getOwnPropertyDescriptor(O.prototype,"addGroup"),O.prototype),(0,j.default)(O.prototype,"editGroup",[I.autobind],Object.getOwnPropertyDescriptor(O.prototype,"editGroup"),O.prototype),(0,j.default)(O.prototype,"inputNewGroupName",[I.autobind],Object.getOwnPropertyDescriptor(O.prototype,"inputNewGroupName"),O.prototype),(0,j.default)(O.prototype,"inputNewGroupDesc",[I.autobind],Object.getOwnPropertyDescriptor(O.prototype,"inputNewGroupDesc"),O.prototype),(0,j.default)(O.prototype,"selectGroup",[I.autobind],Object.getOwnPropertyDescriptor(O.prototype,"selectGroup"),O.prototype),(0,j.default)(O.prototype,"onUserSelect",[I.autobind],Object.getOwnPropertyDescriptor(O.prototype,"onUserSelect"),O.prototype),(0,j.default)(O.prototype,"searchGroup",[I.autobind],Object.getOwnPropertyDescriptor(O.prototype,"searchGroup"),O.prototype),w=O))||w)||w;t.default=V},1259:function(e,t,a){},1262:function(e,t,a){},1263:function(e,t,a){},1264:function(e,t,a){},1265:function(e,t,a){},1273:function(e,t,a){"use strict";var r=a(3)(a(7)),n=a(143);e.exports=function(e,t,a){var l=function(e){if("object"===(0,r.default)(e)&&e)return e;try{return n.parse(e)}catch(t){return e}},u=function(a,r){if((a=a||"")==(r=r||""))return null;var n=e.diff(a,r);return t.format(n,a)},o=function(a,r){a=l(a),r=l(r);var n=e.diff(a,r);return t.format(n,a)},c={1:"必需",0:"非必需",text:"文本",file:"文件",undone:"未完成",done:"已完成",invalid:"废弃"},i=function(e){var t=Object.assign({},e);return t._id=void 0,Object.keys(t).forEach((function(e){switch(e){case"required":case"type":t[e]=c[t[e]]}})),t},s=function(e,t){return t=t||[],e=(e=e||[]).map(i),t=t.map(i),o(e,t)},d=[];if(a&&"object"===(0,r.default)(a)&&a.current){var f=a.current,p=a.old;if("wiki"===a.type)return f!=p&&d.push({title:"wiki更新",content:u(p,f)}),d.filter((function(e){return e.content}));f.path!=p.path&&d.push({title:"Api 路径",content:u(p.path,f.path)}),f.title!=p.title&&d.push({title:"Api 名称",content:u(p.title,f.title)}),f.method!=p.method&&d.push({title:"Method",content:u(p.method,f.method)}),f.catid!=p.catid&&d.push({title:"分类 id",content:u(p.catid,f.catid)}),f.status!=p.status&&d.push({title:"接口状态",content:u(c[p.status],c[f.status])}),f.tag!==p.tag&&d.push({title:"接口tag",content:u(p.tag,f.tag)}),d.push({title:"Request Path Params",content:s(p.req_params,f.req_params)}),d.push({title:"Request Query",content:s(p.req_query,f.req_query)}),d.push({title:"Request Header",content:s(p.req_headers,f.req_headers)});var m="form"===f.req_body_type?p.req_body_form:p.req_body_other;f.req_body_type!==p.req_body_type&&(d.push({title:"Request Type",content:u(p.req_body_type,f.req_body_type)}),m=null),"json"===f.req_body_type?d.push({title:"Request Body",content:o(m,f.req_body_other)}):"form"===f.req_body_type?d.push({title:"Request Form Body",content:s(m,f.req_body_form)}):d.push({title:"Request Raw Body",content:u(m,f.req_body_other)});var h=p.res_body;f.res_body_type!==p.res_body_type&&(d.push({title:"Response Type",content:u(p.res_body_type,f.res_body_type)}),h=""),"json"===f.res_body_type?d.push({title:"Response Body",content:o(h,f.res_body)}):d.push({title:"Response Body",content:u(h,f.res_body)})}return d.filter((function(e){return e.content}))}},1278:function(e,t,a){},1281:function(e,t,a){},1282:function(e,t,a){},1283:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(30));a(136);var u=r(a(111)),o=r(a(31)),c=r(a(9)),i=r(a(10)),s=r(a(11)),d=r(a(12)),f=r(a(13)),p=r(a(5));a(125);var m,h,y,v=r(a(110)),g=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=P(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),b=a(22),E=r(a(0)),_=r(a(44)),k=r(a(574)),j=r(a(575)),w=r(a(576)),O=r(a(578)),C=a(180),x=a(103);function P(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(P=function(e){return e?a:t})(e)}function N(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,f.default)(e);if(t){var n=(0,f.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,d.default)(this,a)}}var M=v.default.TabPane,S=(0,b.connect)((function(e){return{curGroupId:e.group.currGroup._id,curUserRole:e.user.role,curUserRoleInGroup:e.group.currGroup.role||e.group.role,currGroup:e.group.currGroup}}),{fetchNewsData:C.fetchNewsData,setCurrGroup:x.setCurrGroup})((y=h=function(e){(0,s.default)(r,e);var t,a=N(r);function r(e){var t;return(0,c.default)(this,r),(t=a.call(this,e)).state={groupId:-1},t}return(0,i.default)(r,[{key:"componentDidMount",value:(t=(0,o.default)(l.default.mark((function e(){var t,a,r;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((t=this.props.match.params.groupId)&&t>0)){e.next=5;break}this.setState({groupId:t}),e.next=9;break;case 5:return e.next=7,_.default.get("/api/group/get_mygroup");case 7:a=e.sent;try{r=a.data.data,this.setState({groupId:r._id}),this.props.setCurrGroup(r)}catch(e){console.error(e)}case 9:console.log(this.props);case 10:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"render",value:function(){return this.state.groupId&&-1!==this.state.groupId?g.default.createElement(v.default,{type:"card",className:"m-tab tabs-large",style:{height:"100%"}},g.default.createElement(M,{tab:"项目列表",key:"1"},g.default.createElement(k.default,{groupId:this.state.groupId})),"public"===this.props.currGroup.type?g.default.createElement(M,{tab:"成员列表",key:"2"},g.default.createElement(j.default,null)):null,["admin","owner","guest","dev"].indexOf(this.props.curUserRoleInGroup)>-1||"admin"===this.props.curUserRole?g.default.createElement(M,{tab:"分组动态",key:"3"},g.default.createElement(w.default,null)):"","admin"!==this.props.curUserRole&&"owner"!==this.props.curUserRoleInGroup||"private"===this.props.currGroup.type?null:g.default.createElement(M,{tab:"分组设置",key:"4"},g.default.createElement(O.default,null))):g.default.createElement(u.default,null)}}]),r}(g.PureComponent),(0,p.default)(h,"propTypes",{fetchNewsData:E.default.func,curGroupId:E.default.number,curUserRole:E.default.string,currGroup:E.default.object,curUserRoleInGroup:E.default.string,setCurrGroup:E.default.func}),m=y))||m;t.default=S},1284:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(30));a(36);var u=r(a(4)),o=r(a(31)),c=r(a(9)),i=r(a(10)),s=r(a(23)),d=r(a(11)),f=r(a(12)),p=r(a(13)),m=r(a(5));a(146);var h,y,v,g=r(a(147)),b=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=q(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),E=a(22),_=r(a(0)),k=a(40),j=a(397),w=a(103),O=a(101),C=a(75),x=r(a(1357)),P=r(a(1571)),N=r(a(1573)),M=r(a(398)),S=r(a(1580)),I=r(a(1584)),R=r(a(1591)),D=r(a(1592)),T=r(a(1596));r(a(1603));function q(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(q=function(e){return e?a:t})(e)}function L(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,p.default)(e);if(t){var n=(0,p.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,f.default)(this,a)}}var A=a(141),B=g.default.Content,W=g.default.Sider,G=(0,E.connect)((function(e){return{curProject:e.project.currProject,currGroup:e.group.currGroup}}),{getProject:C.getProject,fetchGroupMsg:w.fetchGroupMsg,setBreadcrumb:O.setBreadcrumb})((v=y=function(e){(0,d.default)(n,e);var t,a,r=L(n);function n(e){var t;return(0,c.default)(this,n),t=r.call(this,e),(0,m.default)((0,s.default)(t),"state",{collapsed:!1,project:null}),(0,m.default)((0,s.default)(t),"toggleCollapsed",(function(){t.setState({collapsed:!t.state.collapsed})})),t}return(0,i.default)(n,[{key:"componentWillMount",value:(a=(0,o.default)(l.default.mark((function e(){var t;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.props.getProject(this.props.match.params.id);case 2:return t=e.sent.payload.data.data,e.next=5,this.props.fetchGroupMsg(this.props.curProject.group_id);case 5:this.setState({project:t}),this.props.setBreadcrumb([{name:this.props.currGroup.group_name,href:"/space/group/"+this.props.currGroup._id},{name:this.props.curProject.name}]);case 7:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"componentWillReceiveProps",value:(t=(0,o.default)(l.default.mark((function e(t){var a,r;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=this.props.match.params.id,r=t.match.params.id,a===r){e.next=8;break}return e.next=5,this.props.getProject(r);case 5:return e.next=7,this.props.fetchGroupMsg(this.props.curProject.group_id);case 7:this.props.setBreadcrumb([{name:this.props.currGroup.group_name,href:"/space/group/"+this.props.currGroup._id},{name:this.props.curProject.name}]);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"render",value:function(){var e,t,a=this,r=this.props,n=r.match,l=r.location,o={interface:{name:"API",icon:"api",path:"/project/:id/interface/:action",component:x.default,count:0},interfaceCol:{name:"API测试",icon:"car",path:"/project/:id/interfaceCol",component:R.default},statusCode:{name:"状态码",icon:"car",path:"/project/:id/statusCode",component:D.default},dataStructure:{name:"模板",icon:"database",path:"/project/:projectId/dataStructure",component:T.default},activity:{name:"动态",icon:"eye",path:"/project/:id/activity",component:P.default},data:{name:"数据管理",icon:"database",path:"/project/:id/data",component:I.default},members:{name:"成员管理",icon:"user",path:"/project/:id/members",component:S.default},setting:{name:"设置",icon:"setting",path:"/project/:id/setting",component:N.default}};for(e in A.emitHook("sub_nav",o),o)if(null!==(0,k.matchPath)(l.pathname,{path:o[e].path})){t=o[e].name;break}var c=[];return Object.keys(o).forEach((function(e){var t=o[e],r={};"interface"===e&&(r={name:t.name,path:"/project/".concat(n.params.id,"/interface/api"),icon:t.icon,count:null!=a.state.project?a.state.project.interface_count:0}),r="dataStructure"===e?{name:t.name,path:t.path.replace(/\:projectId/gi,n.params.id),icon:t.icon}:{name:t.name,path:t.path.replace(/\:id/gi,n.params.id),icon:t.icon},c.push(r)})),"private"===this.props.currGroup.type&&(c=c.filter((function(e){return"成员管理"!=e.name}))),0===Object.keys(this.props.curProject).length?b.default.createElement(M.default,{visible:!0}):b.default.createElement("div",null,b.default.createElement(g.default,{style:{height:"calc(100vh - 60px)",marginLeft:"2px"}},b.default.createElement(W,{style:{borderRight:"1px solid #E4E6E9",backgroundColor:"#F7F7F7"},width:160,trigger:null,collapsible:!0,collapsed:this.state.collapsed},b.default.createElement(j.Subnav,{inlineCollapsed:this.state.collapsed,default:t,data:c}),b.default.createElement("div",{style:{width:"4px",height:"100%",position:"absolute",right:0,top:0,textAlign:"center",alignItems:"center",display:"flex"}},b.default.createElement(u.default,{type:this.state.collapsed?"right":"left",style:{marginLeft:"3px"},onClick:this.toggleCollapsed}))),b.default.createElement(B,{style:{overflow:"hidden",padding:"10px"}},b.default.createElement(k.Switch,null,b.default.createElement(k.Redirect,{exact:!0,from:"/project/:id",to:"/project/".concat(n.params.id,"/interface/api")}),Object.keys(o).map((function(e){var t=o[e];return"members"===e?"private"!==a.props.currGroup.type?b.default.createElement(k.Route,{path:t.path,component:t.component,key:e}):null:b.default.createElement(k.Route,{path:t.path,component:t.component,key:e})}))))))}}]),n}(b.PureComponent),(0,m.default)(y,"propTypes",{match:_.default.object,curProject:_.default.object,getProject:_.default.func,location:_.default.object,fetchGroupMsg:_.default.func,setBreadcrumb:_.default.func,currGroup:_.default.object}),h=v))||h;t.default=G},1285:function(e,t,a){"use strict";(function(e){var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(64);var l=r(a(49));a(36);var u=r(a(4));a(57);var o=r(a(51)),c=r(a(9)),i=r(a(10)),s=r(a(11)),d=r(a(12)),f=r(a(13)),p=r(a(5));a(1286);var m=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=y(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),h=r(a(0));function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(y=function(e){return e?a:t})(e)}function v(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,f.default)(e);if(t){var n=(0,f.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,d.default)(this,a)}}var g=e.env.version,b=function(e){(0,s.default)(a,e);var t=v(a);function a(e){return(0,c.default)(this,a),t.call(this,e)}return(0,i.default)(a,[{key:"render",value:function(){return m.default.createElement("div",{className:"footer-wrapper"},m.default.createElement(o.default,{className:"footer-container"},this.props.footList.map((function(e,t){return m.default.createElement(E,{key:t,linkList:e.linkList,title:e.title,iconType:e.iconType})}))))}}]),a}(m.PureComponent);(0,p.default)(b,"propTypes",{footList:h.default.array});var E=function(e){(0,s.default)(a,e);var t=v(a);function a(e){return(0,c.default)(this,a),t.call(this,e)}return(0,i.default)(a,[{key:"render",value:function(){return m.default.createElement(l.default,{span:6},m.default.createElement("h4",{className:"title"},this.props.iconType?m.default.createElement(u.default,{type:this.props.iconType,className:"icon"}):"",this.props.title),this.props.linkList.map((function(e,t){return m.default.createElement("p",{key:t},m.default.createElement("a",{href:e.itemLink,className:"link"},e.itemTitle))})))}}]),a}(m.PureComponent);(0,p.default)(E,"propTypes",{linkList:h.default.array,title:h.default.string,iconType:h.default.string}),b.defaultProps={footList:[{title:"GitHub",iconType:"github",linkList:[{itemTitle:"YApi 源码仓库",itemLink:"https://github.com/YMFE/yapi"}]},{title:"团队",iconType:"team",linkList:[{itemTitle:"YMFE",itemLink:"https://ymfe.org"}]},{title:"反馈",iconType:"aliwangwang-o",linkList:[{itemTitle:"Github Issues",itemLink:"https://github.com/YMFE/yapi/issues"},{itemTitle:"Github Pull Requests",itemLink:"https://github.com/YMFE/yapi/pulls"}]},{title:"Copyright © 2018-".concat((new Date).getFullYear()," YMFE"),linkList:[{itemTitle:"版本: ".concat(g," "),itemLink:"https://github.com/YMFE/yapi/blob/master/CHANGELOG.md"},{itemTitle:"使用文档",itemLink:"https://hellosean1025.github.io/yapi/"}]}]};var _=b;t.default=_}).call(this,a(99))},1286:function(e,t,a){},1287:function(e,t,a){},1288:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(137);var l=r(a(90));a(36);var u=r(a(4)),o=r(a(9)),c=r(a(10)),i=r(a(11)),s=r(a(12)),d=r(a(13)),f=r(a(5));a(1289);var p=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=y(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),m=a(40),h=r(a(0));function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(y=function(e){return e?a:t})(e)}function v(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,d.default)(e);if(t){var n=(0,d.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,s.default)(this,a)}}var g=function(e){(0,i.default)(a,e);var t=v(a);function a(e){return(0,o.default)(this,a),t.call(this,e)}return(0,c.default)(a,[{key:"badge",value:function(e){return null==e?"":p.default.createElement("div",{style:{height:"17px",textAlign:"center",fontSize:"12px",color:"#8189A1",lineHeight:"11px",padding:"2px 5px",position:"absolute",right:10,top:10,backgroundColor:"#D8DCE4",border:"1px solid #D9D9D9",borderRadius:"8px"}},e)}},{key:"render",value:function(){var e=this;return p.default.createElement(l.default,{onClick:this.handleClick,selectedKeys:[this.props.default],mode:"inline",style:{backgroundColor:"#F7F7F7",height:"100%"}},this.props.data.map((function(t,a){return 2===t.name.length&&(t.name=t.name[0]+" "+t.name[1]),p.default.createElement(l.default.Item,{key:t.name.replace(" ",""),overflowedIndicator:p.default.createElement(u.default,{type:t.icon}),title:t.name},p.default.createElement(m.Link,{to:t.path},p.default.createElement(u.default,{type:t.icon}),p.default.createElement("span",null,e.props.data[a].name," ",e.badge(t.count))," "))})))}}]),a}(p.PureComponent);(0,f.default)(g,"propTypes",{data:h.default.array,default:h.default.string,inlineCollapsed:h.default.bool});var b=g;t.default=b},1289:function(e,t,a){},1292:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(53);var l=r(a(54));a(57);var u=r(a(51));a(64);var o=r(a(49));a(55);var c=r(a(45));a(48);var i=r(a(47));a(36);var s=r(a(4));a(238);var d=r(a(246)),f=r(a(9)),p=r(a(10)),m=r(a(23)),h=r(a(11)),y=r(a(12)),v=r(a(13)),g=r(a(5));a(295);var b=r(a(312)),E=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=C(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),_=r(a(0));a(1293);var k=r(a(1294)),j=r(a(1295)),w=r(a(1296)),O=a(68);function C(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(C=function(e){return e?a:t})(e)}function x(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,v.default)(e);if(t){var n=(0,v.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,y.default)(this,a)}}function P(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function N(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?P(Object(a),!0).forEach((function(t){(0,g.default)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):P(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var M=a(160).handleParamsValue,S=b.default.Panel;var I=function(e){(0,h.default)(a,e);var t=x(a);function a(e){var r;return(0,f.default)(this,a),r=t.call(this,e),(0,g.default)((0,m.default)(r),"handleConstantsInput",(function(e){e=e.replace(/^\{\{(.+)\}\}$/g,"$1"),r.setState({constantInput:e}),r.mockClick(0)(e)})),(0,g.default)((0,m.default)(r),"handleParamsInput",(function(e,t,a){var n,l=(n=r.state.methodsParamsList,JSON.parse(JSON.stringify(n)));l[t].params[a]=e,r.setState({methodsParamsList:l})})),(0,g.default)((0,m.default)(r),"MethodsListSource",(function(e){return E.default.createElement(j.default,{click:r.mockClick(e.index),clickValue:e.value,params:e.params,paramsInput:r.handleParamsInput,clickIndex:e.index})})),(0,g.default)((0,m.default)(r),"handleCancel",(function(){r.setInit(),r.props.handleCancel()})),(0,g.default)((0,m.default)(r),"handleOk",(function(e){r.props.handleOk(e),r.setInit()})),(0,g.default)((0,m.default)(r),"handleCollapse",(function(e){r.setState({activeKey:e})})),r.state={methodsShow:!1,methodsShowMore:!1,methodsList:[],constantInput:"",activeKey:"1",methodsParamsList:[{name:"",params:[],type:"dataSource"}]},r}return(0,p.default)(a,[{key:"componentWillMount",value:function(){var e=this.props.inputValue;this.setState({constantInput:e}),e&&this.handleInitList(e)}},{key:"handleInitList",value:function(e){var t=this,a=(e=e.replace(/^\{\{(.+)\}\}$/g,"$1")).split("|");a[0].indexOf("@")>=0?this.setState({activeKey:"2"}):a[0].indexOf("$")>=0&&this.setState({activeKey:"3"});for(var r=[{name:(0,O.trim)(a[0]),params:[],type:"dataSource"}],n=1;n<a.length;n++){var l=a[n].split(":"),u=l[1]&&l[1].split(",");u=u&&u.map((function(e){return(0,O.trim)(e)}));var o={name:(0,O.trim)(l[0]),params:u||[]};r.push(o)}this.setState({methodsParamsList:r},(function(){t.mockClick(a.length)()}))}},{key:"mockClick",value:function(e){var t=this;return function(a,r){var n=function(e,t,a,r){var n=[].concat(e);n.splice(t+1,n.length-t),n.push({name:"",params:[]});var l=r||[],u=a||"";return n[t]=N(N({},n[t]),{},{name:u,params:l}),n}(t.state.methodsParamsList,e,a,r);t.setState({methodsParamsList:n})}}},{key:"handleValue",value:function(e){return M(e,{})}},{key:"handleError",value:function(){return E.default.createElement(d.default,{message:"请求“变量集”尚未运行,所以我们无法从其响应中提取的值。您可以在测试集合中测试这些变量。",type:"warning"})}},{key:"setInit",value:function(){this.setState({methodsParamsList:[{name:"",params:[],type:"dataSource"}]})}},{key:"render",value:function(){var e=this,t=this.props,a=t.visible,r=t.envType,n=this.state,d=n.methodsParamsList,f=n.constantInput,p=function(){var e="",t=d.length;return d.forEach((function(a,r){var n=a.name&&t-2!==r;e+=a.name,a.params.forEach((function(t,a){e+=a>0?" , ":" : ",e+=t})),e+=n?" | ":""})),"{{ "+e+" }}"};return E.default.createElement(l.default,{title:E.default.createElement("p",null,E.default.createElement(s.default,{type:"edit"})," 高级参数设置"),visible:a,onOk:function(){return e.handleOk(p())},onCancel:this.handleCancel,wrapClassName:"modal-postman",width:1024,maskClosable:!1,okText:"插入"},E.default.createElement(u.default,{className:"modal-postman-form",type:"flex"},d.map((function(t,a){return"dataSource"===t.type?E.default.createElement(o.default,{span:8,className:"modal-postman-col",key:a},E.default.createElement(b.default,{className:"modal-postman-collapse",activeKey:e.state.activeKey,onChange:e.handleCollapse,bordered:!1,accordion:!0},E.default.createElement(S,{header:E.default.createElement("h3",{className:"mock-title"},"常量"),key:"1"},E.default.createElement(i.default,{placeholder:"基础参数值",value:f,onChange:function(t){return e.handleConstantsInput(t.target.value,a)}})),E.default.createElement(S,{header:E.default.createElement("h3",{className:"mock-title"},"mock数据"),key:"2"},E.default.createElement(k.default,{click:e.mockClick(a),clickValue:t.name})),"case"===r&&E.default.createElement(S,{header:E.default.createElement("h3",{className:"mock-title"},"变量 ",E.default.createElement(c.default,{placement:"top",title:"YApi 提供了强大的变量参数功能，你可以在测试的时候使用前面接口的 参数 或 返回值 作为 后面接口的参数，即使接口之间存在依赖，也可以轻松 一键测试~"},E.default.createElement(s.default,{type:"question-circle-o"}))),key:"3"},E.default.createElement(w.default,{id:e.props.id,click:e.mockClick(a),clickValue:t.name})))):E.default.createElement(o.default,{span:8,className:"modal-postman-col",key:a},E.default.createElement(e.MethodsListSource,{index:a,value:t.name,params:t.params}))}))),E.default.createElement(u.default,{className:"modal-postman-expression"},E.default.createElement(o.default,{span:6},E.default.createElement("h3",{className:"title"},"表达式")),E.default.createElement(o.default,{span:18},E.default.createElement("span",{className:"expression-item"},p()))),E.default.createElement(u.default,{className:"modal-postman-preview"},E.default.createElement(o.default,{span:6},E.default.createElement("h3",{className:"title"},"预览")),E.default.createElement(o.default,{span:18},E.default.createElement("h3",null,this.handleValue(p())||p()&&this.handleError()))))}}]),a}(E.Component);(0,g.default)(I,"propTypes",{visible:_.default.bool,handleCancel:_.default.func,handleOk:_.default.func,inputValue:_.default.any,envType:_.default.string,id:_.default.number});var R=I;t.default=R},1293:function(e,t,a){},1294:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(57);var l=r(a(51)),u=r(a(9)),o=r(a(10)),c=r(a(23)),i=r(a(11)),s=r(a(12)),d=r(a(13)),f=r(a(5));a(48);var p=r(a(47)),m=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=y(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),h=r(a(0));function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(y=function(e){return e?a:t})(e)}function v(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,d.default)(e);if(t){var n=(0,d.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,s.default)(this,a)}}var g=r(a(72)).default.MOCK_SOURCE,b=p.default.Search,E=function(e){(0,i.default)(a,e);var t=v(a);function a(e){var r;return(0,u.default)(this,a),r=t.call(this,e),(0,f.default)((0,c.default)(r),"onFilter",(function(e){var t=g.filter((function(t){return-1!==t.mock.indexOf(e.target.value)}));r.setState({filter:e.target.value,list:t})})),r.state={filter:"",list:[]},r}return(0,o.default)(a,[{key:"componentDidMount",value:function(){this.setState({list:g})}},{key:"render",value:function(){var e=this.state,t=e.list,a=e.filter,r=this.props,n=r.click,u=r.clickValue;return m.default.createElement("div",{className:"modal-postman-form-mock"},m.default.createElement(b,{onChange:this.onFilter,value:a,placeholder:"搜索mock数据",className:"mock-search"}),t.map((function(e,t){return m.default.createElement(l.default,{key:t,type:"flex",align:"middle",className:"row "+(e.mock===u?"checked":""),onClick:function(){return n(e.mock)}},m.default.createElement("span",null,e.mock))})))}}]),a}(m.Component);(0,f.default)(E,"propTypes",{click:h.default.func,clickValue:h.default.string});var _=E;t.default=_},1295:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(36);var l=r(a(4));a(57);var u=r(a(51));a(55);var o=r(a(45));a(48);var c=r(a(47)),i=r(a(9)),s=r(a(10)),d=r(a(23)),f=r(a(11)),p=r(a(12)),m=r(a(13)),h=r(a(5));a(71);var y=r(a(61)),v=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=E(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),g=r(a(0)),b=r(a(79));function E(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(E=function(e){return e?a:t})(e)}function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,m.default)(e);if(t){var n=(0,m.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,p.default)(this,a)}}var k=y.default.Option;var j=[{name:"md5",type:!1,params:[],desc:"md5加密"},{name:"lower",type:!1,params:[],desc:"所有字母变成小写"},{name:"length",type:!1,params:[],desc:"数据长度"},{name:"substr",type:!0,component:"doubleInput",params:[],desc:"截取部分字符串"},{name:"sha",type:!0,component:"select",params:["sha1"],desc:"sha加密"},{name:"base64",type:!1,params:[],desc:"base64加密"},{name:"unbase64",type:!1,params:[],desc:"base64解密"},{name:"concat",type:!0,component:"input",params:[],desc:"连接字符串"},{name:"lconcat",type:!0,component:"input",params:[],desc:"左连接"},{name:"upper",type:!1,desc:"所有字母变成大写"},{name:"number",type:!1,desc:"字符串转换为数字类型"}],w=function(e){(0,f.default)(a,e);var t=_(a);function a(e){var r;return(0,i.default)(this,a),r=t.call(this,e),(0,h.default)((0,d.default)(r),"showMore",(function(){r.setState({moreFlag:!1})})),(0,h.default)((0,d.default)(r),"inputComponent",(function(e){var t=e.clickIndex,a=e.paramsIndex,n=e.params;return v.default.createElement(c.default,{size:"small",placeholder:"请输入参数",value:n[0],onChange:function(e){return r.handleParamsChange(e.target.value,t,a,0)}})})),(0,h.default)((0,d.default)(r),"doubleInputComponent",(function(e){var t=e.clickIndex,a=e.paramsIndex,n=e.params;return v.default.createElement("div",null,v.default.createElement(c.default,{size:"small",placeholder:"start",value:n[0],onChange:function(e){return r.handleParamsChange(e.target.value,t,a,0)}}),v.default.createElement(c.default,{size:"small",placeholder:"length",value:n[1],onChange:function(e){return r.handleParamsChange(e.target.value,t,a,1)}}))})),(0,h.default)((0,d.default)(r),"selectComponent",(function(e){var t=e.clickIndex,a=e.paramsIndex,n=e.params;return v.default.createElement(y.default,{value:n[0]||"sha1",placeholder:"请选择",style:{width:150},size:"small",onChange:function(e){return r.handleParamsChange(e,t,a,0)}},["sha1","sha224","sha256","sha384","sha512"].map((function(e,t){return v.default.createElement(k,{value:e,key:t},e)})))})),r.state={list:j,moreFlag:!0},r}return(0,s.default)(a,[{key:"componentDidMount",value:function(){var e=!(b.default.findIndex(j,{name:this.props.clickValue})>3);this.setState({moreFlag:e})}},{key:"handleParamsChange",value:function(e,t,a,r){var n,l=(n=this.state.list,JSON.parse(JSON.stringify(n)));l[a].params[r]=e,this.setState({list:l}),this.props.paramsInput(e,t,r)}},{key:"handleComponent",value:function(e,t,a,r){var n={clickIndex:t,paramsIndex:a,params:r};switch(e.component){case"select":return this.selectComponent(n);case"input":return this.inputComponent(n);case"doubleInput":return this.doubleInputComponent(n)}}},{key:"render",value:function(){var e=this,t=this.state,a=t.list,r=t.moreFlag,n=this.props,c=n.click,i=n.clickValue,s=n.clickIndex,d=n.params,f=r?a.slice(0,4):a;return v.default.createElement("div",{className:"modal-postman-form-method"},v.default.createElement("h3",{className:"methods-title title"},"方法"),f.map((function(t,a){return v.default.createElement(u.default,{key:a,type:"flex",align:"middle",className:"row methods-row "+(t.name===i?"checked":""),onClick:function(){return c(t.name,f[a].params)}},v.default.createElement(o.default,{title:t.desc},v.default.createElement("span",null,t.name)),v.default.createElement("span",{className:"input-component"},t.type&&e.handleComponent(t,s,a,t.name===i?d:[])))})),r&&v.default.createElement("div",{className:"show-more",onClick:this.showMore},v.default.createElement(l.default,{type:"down"}),v.default.createElement("span",{style:{paddingLeft:"4px"}},"更多")))}}]),a}(v.Component);(0,h.default)(w,"propTypes",{show:g.default.bool,click:g.default.func,clickValue:g.default.string,paramsInput:g.default.func,clickIndex:g.default.number,params:g.default.array});var O=w;t.default=O},1296:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(30)),u=r(a(581)),o=r(a(7)),c=r(a(31)),i=r(a(9)),s=r(a(10)),d=r(a(23)),f=r(a(11)),p=r(a(12)),m=r(a(13)),h=r(a(5));a(148);var y,v,g,b=r(a(149)),E=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=w(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),_=r(a(0)),k=a(22),j=a(167);function w(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(w=function(e){return e?a:t})(e)}function O(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,m.default)(e);if(t){var n=(0,m.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,p.default)(this,a)}}var C=b.default.TreeNode;function x(e){return e.split(".").slice(0,-1).join(".")}function P(e){return e.replace(/\[.*?\]/g,"")}var N=(0,k.connect)((function(e){return{currColId:e.interfaceCol.currColId}}),{fetchVariableParamsList:j.fetchVariableParamsList})((g=v=function(e){(0,f.default)(n,e);var t,a,r=O(n);function n(){var e;(0,i.default)(this,n);for(var t=arguments.length,a=new Array(t),l=0;l<t;l++)a[l]=arguments[l];return e=r.call.apply(r,[this].concat(a)),(0,h.default)((0,d.default)(e),"state",{records:[],expandedKeys:[],selectedKeys:[]}),(0,h.default)((0,d.default)(e),"handleSelect",(function(t){e.setState({selectedKeys:[t]}),t&&0===t.indexOf("CanSelectPath-")?(t=t.substr("CanSelectPath-".length),e.props.click(t)):e.setState({expandedKeys:[t]})})),(0,h.default)((0,d.default)(e),"onExpand",(function(t){e.setState({expandedKeys:t})})),e}return(0,s.default)(n,[{key:"handleRecordsData",value:function(e){var t=[];this.id=e;for(var a=0;a<this.records.length&&this.records[a]._id!==e;a++)t.push(this.records[a]);this.setState({records:t})}},{key:"componentDidMount",value:(a=(0,c.default)(l.default.mark((function e(){var t,a,r,n,u,o,c,i;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.props,a=t.currColId,r=t.fetchVariableParamsList,n=t.clickValue,e.next=3,r(a);case 3:u=e.sent,o=u.payload.data.data,this.records=o.sort((function(e,t){return e.index-t.index})),this.handleRecordsData(this.props.id),n&&(c=n.lastIndexOf("]")===n.length-1,i=c?P(n):x(n),this.setState({expandedKeys:[i],selectedKeys:["CanSelectPath-"+n]}));case 8:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"componentWillReceiveProps",value:(t=(0,c.default)(l.default.mark((function e(t){return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.records&&t.id&&this.id!==t.id&&this.handleRecordsData(t.id);case 1:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"render",value:function(){var e=this;return E.default.createElement("div",{className:"modal-postman-form-variable"},E.default.createElement(b.default,{expandedKeys:this.state.expandedKeys,selectedKeys:this.state.selectedKeys,onSelect:function(t){var a=(0,u.default)(t,1)[0];return e.handleSelect(a)},onExpand:this.onExpand},function e(t){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=Object.keys(t),l=n.map((function(n,l){var u,c=t[n];if(0===r?(a=(a="$")+"."+c._id,u=c.casename,c={params:c.params,body:c.body}):a=Array.isArray(t)?0===l?a+"["+n+"]":P(a)+"["+n+"]":0===l?a+"."+n:x(a)+"."+n,c&&"object"===(0,o.default)(c)){var i=Array.isArray(c)&&0===c.length;return E.default.createElement(C,{key:a,disabled:i,title:u||n},e(c,a,r+1))}return E.default.createElement(C,{key:"CanSelectPath-"+a,title:n})}));return l}(this.state.records)))}}]),n}(E.Component),(0,h.default)(v,"propTypes",{click:_.default.func,currColId:_.default.number,fetchVariableParamsList:_.default.func,clickValue:_.default.string,id:_.default.number}),y=g))||y;t.default=N},1302:function(e,t,a){},1303:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(33);var l=r(a(25));a(55);var u=r(a(45));a(57);var o=r(a(51));a(36);var c=r(a(4));a(48);var i=r(a(47));a(64);var s=r(a(49));a(232);var d=r(a(245)),f=r(a(7)),p=r(a(9)),m=r(a(10)),h=r(a(23)),y=r(a(11)),v=r(a(12)),g=r(a(13)),b=r(a(5));a(71);var E=r(a(61));a(82);var _=r(a(84)),k=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=O(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),j=r(a(0));a(584);var w=r(a(72));function O(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(O=function(e){return e?a:t})(e)}function C(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function x(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,g.default)(e);if(t){var n=(0,g.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,v.default)(this,a)}}var P=_.default.Item,N=E.default.Option,M={header:[{name:"",value:""}],cookie:[{name:"",value:""}],global:[{name:"",value:""}]},S=function(e){(0,y.default)(a,e);var t=x(a);function a(e){var r;return(0,p.default)(this,a),r=t.call(this,e),(0,b.default)((0,h.default)(r),"addHeader",(function(e,t,a){var n=r.state[a][t+1];if(!n||"object"!==(0,f.default)(n)){var l={};l[a]=[].concat(r.state[a],{name:"",value:""}),r.setState(l)}})),(0,b.default)((0,h.default)(r),"delHeader",(function(e,t){var a=r.props.form.getFieldValue(t),n={};n[t]=a.filter((function(t,a){return a!==e})),r.props.form.setFieldsValue(n),r.setState(n)})),(0,b.default)((0,h.default)(r),"handleOk",(function(e){e.preventDefault();var t=r.props,a=t.form,n=t.onSubmit,l=t.projectMsg;a.validateFields((function(e,t){if(!e){var a=t.header.filter((function(e){return""!==e.name})),r=t.cookie.filter((function(e){return""!==e.name})),u=t.global.filter((function(e){return""!==e.name}));r.length>0&&a.push({name:"Cookie",value:r.map((function(e){return e.name+"="+e.value})).join(";")});var o={};o.env=Object.assign({_id:l._id},{name:t.env.name,domain:t.env.protocol+t.env.domain,header:a,global:u}),n(o)}}))})),r.state=Object.assign({},M),r}return(0,m.default)(a,[{key:"initState",value:function(e){var t=[{name:"",value:""}],a=[{name:"",value:""}],r=[{name:"",value:""}],n=e.header,l=e.global;return n&&0!==n.length&&n.forEach((function(e){if("Cookie"===e.name){var r=e.value;r&&(r=r.split(";").forEach((function(e){e&&(e=e.split("="),a.unshift({name:e[0]?e[0].trim():"",value:e[1]?e[1].trim():""}))})))}else t.unshift(e)})),l&&0!==l.length&&l.forEach((function(e){r.unshift(e)})),{header:t,cookie:a,global:r}}},{key:"handleInit",value:function(e){this.props.form.resetFields();var t=this.initState(e);this.setState(function(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?C(Object(a),!0).forEach((function(t){(0,b.default)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):C(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}({},t))}},{key:"componentWillReceiveProps",value:function(e){this.props.projectMsg.name!==e.projectMsg.name&&this.handleInit(e.projectMsg)}},{key:"render",value:function(){var e,t=this,a=this.props.projectMsg,r=this.props.form.getFieldDecorator,n=function(e,a,n){var l=t.state[n].length-1;return k.default.createElement(o.default,{gutter:2,key:a},k.default.createElement(s.default,{span:10},k.default.createElement(P,null,r("".concat(n,"[").concat(a,"].name"),{validateTrigger:["onChange","onBlur"],initialValue:e.name||""})(k.default.createElement(i.default,{placeholder:"请输入 ".concat(n," Name"),style:{width:"200px"},onChange:function(){return t.addHeader(e,a,n)}})))),k.default.createElement(s.default,{span:12},k.default.createElement(P,null,r("".concat(n,"[").concat(a,"].value"),{validateTrigger:["onChange","onBlur"],initialValue:e.value||""})(k.default.createElement(i.default,{placeholder:"请输入参数内容",style:{width:"90%",marginRight:8}})))),k.default.createElement(s.default,{span:2,className:a===l?" env-last-row":null},k.default.createElement(c.default,{className:"dynamic-delete-button delete",type:"delete",onClick:function(e){e.stopPropagation(),t.delHeader(a,n)}})))};return k.default.createElement("div",null,(e=a,k.default.createElement("div",null,k.default.createElement("h3",{className:"env-label"},"环境名称"),k.default.createElement(P,{required:!1},r("env.name",{validateTrigger:["onChange","onBlur"],initialValue:"新环境"===e.name?"":e.name||"",rules:[{required:!1,whitespace:!0,validator:function(e,t,a){if(t)if(0===t.length)a("请输入环境名称");else{if(/\S/.test(t))return a();a("请输入环境名称")}else a("请输入环境名称")}}]})(k.default.createElement(i.default,{onChange:function(e){return t.props.handleEnvInput(e.target.value)},placeholder:"请输入环境名称",style:{width:"90%",marginRight:8}}))),k.default.createElement("h3",{className:"env-label"},"环境域名"),k.default.createElement(P,{required:!1},r("env.domain",{validateTrigger:["onChange","onBlur"],initialValue:e.domain?e.domain.split("//")[1]:"",rules:[{required:!1,whitespace:!0,validator:function(e,t,a){if(t)if(0===t.length)a("请输入环境域名!");else{if(!/\s/.test(t))return a();a("环境域名不允许出现空格!")}else a("请输入环境域名!")}}]})(k.default.createElement(i.default,{placeholder:"请输入环境域名",style:{width:"90%",marginRight:8},addonBefore:r("env.protocol",{initialValue:e.domain?e.domain.split("//")[0]+"//":"http://",rules:[{required:!0}]})(k.default.createElement(E.default,null,k.default.createElement(N,{value:"http://"},"http://"),k.default.createElement(N,{value:"https://"},"https://")))}))),k.default.createElement("h3",{className:"env-label"},"Header"),t.state.header.map((function(e,a){return function(e,a){var n=t.state.header.length-1;return k.default.createElement(o.default,{gutter:2,key:a},k.default.createElement(s.default,{span:10},k.default.createElement(P,null,r("header["+a+"].name",{validateTrigger:["onChange","onBlur"],initialValue:e.name||""})(k.default.createElement(d.default,{style:{width:"200px"},allowClear:!0,dataSource:w.default.HTTP_REQUEST_HEADER,placeholder:"请输入header名称",onChange:function(){return t.addHeader(e,a,"header")},filterOption:function(e,t){return-1!==t.props.children.toUpperCase().indexOf(e.toUpperCase())}})))),k.default.createElement(s.default,{span:12},k.default.createElement(P,null,r("header["+a+"].value",{validateTrigger:["onChange","onBlur"],initialValue:e.value||""})(k.default.createElement(i.default,{placeholder:"请输入参数内容",style:{width:"90%",marginRight:8}})))),k.default.createElement(s.default,{span:2,className:a===n?" env-last-row":null},k.default.createElement(c.default,{className:"dynamic-delete-button delete",type:"delete",onClick:function(e){e.stopPropagation(),t.delHeader(a,"header")}})))}(e,a)})),k.default.createElement("h3",{className:"env-label"},"Cookie"),t.state.cookie.map((function(e,t){return n(e,t,"cookie")})),k.default.createElement("h3",{className:"env-label"},"global",k.default.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"https://hellosean1025.github.io/yapi/documents/project.html#%E9%85%8D%E7%BD%AE%E7%8E%AF%E5%A2%83",style:{marginLeft:8}},k.default.createElement(u.default,{title:"点击查看文档"},k.default.createElement(c.default,{type:"question-circle-o",style:{fontSize:"13px"}})))),t.state.global.map((function(e,t){return n(e,t,"global")})))),k.default.createElement("div",{className:"btnwrap-changeproject"},k.default.createElement(l.default,{className:"m-btn btn-save",icon:"save",type:"primary",size:"large",onClick:this.handleOk},"保 存")))}}]),a}(k.Component);(0,b.default)(S,"propTypes",{projectMsg:j.default.object,form:j.default.object,onSubmit:j.default.func,handleEnvInput:j.default.func});var I=_.default.create()(S);t.default=I},1314:function(e,t){},1345:function(e,t){},1347:function(e,t){},1357:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(30)),u=r(a(58)),o=(r(a(581)),r(a(31))),c=r(a(9)),i=r(a(10)),s=r(a(23)),d=r(a(11)),f=r(a(12)),p=r(a(13)),m=r(a(5));a(137);var h=r(a(90));a(146);var y=r(a(147)),v=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=S(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),g=r(a(17)),b=r(a(0)),E=a(40),_=a(22),k=a(182);a(601);var j,w,O,C=r(a(1358)),x=r(a(1361)),P=r(a(1363)),N=(r(a(637)),r(a(638)),r(a(657)),a(75)),M=a(167);function S(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(S=function(e){return e?a:t})(e)}function I(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,p.default)(e);if(t){var n=(0,p.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,f.default)(this,a)}}y.default.Content,y.default.Sider;var R={path:"/project/:id/interface/:action/:actionId",exact:!0},D=(h.default.SubMenu,function(e){var t;return"api"===e.match.params.action&&(e.match.params.actionId?isNaN(e.match.params.actionId)?0===e.match.params.actionId.indexOf("cat_")&&(t=x.default):t=P.default:t=x.default),v.default.createElement(t,e)});D.propTypes={match:b.default.object};var T=(0,_.connect)((function(e){return{isShowCol:e.interfaceCol.isShowCol}}),{setColData:M.setColData,getProject:N.getProject})((O=w=function(e){(0,d.default)(r,e);var t,a=I(r);function r(e){var t;return(0,c.default)(this,r),t=a.call(this,e),(0,m.default)((0,s.default)(t),"state",{interfaceSider:null,beforeWidth:0,mouseY:0,mouseX:0,dragDom:null}),(0,m.default)((0,s.default)(t),"onChange",(function(e){var a=t.props.match.params;"colOrCase"===e&&(e=t.props.isShowCol?"col":"case"),t.props.history.push("/project/"+a.id+"/interface/"+e)})),(0,m.default)((0,s.default)(t),"drag",(function(e){document.documentElement.addEventListener("mousemove",t.handleMouseMove),document.documentElement.addEventListener("mouseup",t.handleMouseUp),e.preventDefault();var a=e.currentTarget.previousElementSibling.clientWidth,r=g.default.findDOMNode(t.state.interfaceSider);t.setState({beforeWidth:a,dragDom:r,mouseX:e.clientX})})),(0,m.default)((0,s.default)(t),"handleMouseMove",(function(e){var a=e.clientX-t.state.mouseX,r=t.state.beforeWidth+a;if(!(r<1)&&t.state.beforeWidth!=r){var n=t.state.dragDom;n.style.width=r+"px",n.style.minWidth=r+"px",n.style.flex="0 0 "+r+"px",t.setState({mouseX:e.clientX,beforeWidth:r})}})),(0,m.default)((0,s.default)(t),"handleMouseUp",(function(e){document.documentElement.removeEventListener("mousemove",t.handleMouseMove),document.documentElement.removeEventListener("mouseup",t.handleMouseUp)})),(0,m.default)((0,s.default)(t),"interfaceSiderFun",(function(e){t.setState({interfaceSider:e})})),(0,m.default)((0,s.default)(t),"DragSider",(function(){return v.default.createElement("div",null,"ddd")})),t}return(0,i.default)(r,[{key:"componentWillMount",value:(t=(0,o.default)(l.default.mark((function e(){return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.props.setColData({isShowCol:!0});case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"render",value:function(){this.props.match.params.action;return v.default.createElement(k.ReflexContainer,{style:{height:"calc(100vh - 80px)",backgroundColor:"#fff"},orientation:"vertical"},v.default.createElement(k.ReflexElement,{style:{height:"100%",overflow:"hidden",borderLeft:"1px solid #D9D9D9",border:"1px solid #D9D9D9",borderRight:"0px"},id:"interface-sider",size:200},v.default.createElement("div",{className:"left-menu",style:{height:parseInt(document.body.clientHeight)-80+"px"}},v.default.createElement(C.default,{router:(0,E.matchPath)(this.props.location.pathname,R),projectId:this.props.match.params.id}))),v.default.createElement(k.ReflexSplitter,null),v.default.createElement(k.ReflexElement,{style:{height:"100%",overflow:"hidden",border:"1px solid #D9D9D9",borderLeft:"0px solid #D9D9D9",backgroundColor:"#fff"}},v.default.createElement("div",{className:"right-content"},v.default.createElement(E.Switch,null,v.default.createElement(E.Route,{exact:!0,path:"/project/:id/interface/:action",component:D}),v.default.createElement(E.Route,(0,u.default)({},R,{component:D}))))))}}]),r}(v.PureComponent),(0,m.default)(w,"propTypes",{match:b.default.object,history:b.default.object,location:b.default.object,isShowCol:b.default.bool,getProject:b.default.func,setColData:b.default.func}),j=O))||j;t.default=T},1358:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(30));a(137);var u=r(a(90));a(55);r(a(45));a(144);var o=r(a(166));a(36);var c=r(a(4));a(33);var i=r(a(25)),s=r(a(31));a(38);var d=r(a(39)),f=r(a(9)),p=r(a(10)),m=r(a(23)),h=r(a(11)),y=r(a(12)),v=r(a(13)),g=r(a(5));a(148);var b=r(a(149));a(53);var E,_,k,j=r(a(54)),w=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=q(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),O=a(22),C=r(a(0)),x=a(124),P=a(75),N=r(a(602)),M=r(a(1359)),S=r(a(603)),I=r(a(44)),R=a(40),D=r(a(294)),T=a(68);r(a(72));function q(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(q=function(e){return e?a:t})(e)}function L(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,v.default)(e);if(t){var n=(0,v.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,y.default)(this,a)}}a(1360);var A=j.default.confirm,B=b.default.TreeNode,W=(b.default.DirectoryTree,(0,O.connect)((function(e){return{list:e.inter.list,inter:e.inter.curdata,curProject:e.project.currProject,expands:[]}}),{fetchInterfaceListMenu:x.fetchInterfaceListMenu,fetchInterfaceData:x.fetchInterfaceData,deleteInterfaceCatData:x.deleteInterfaceCatData,deleteInterfaceData:x.deleteInterfaceData,initInterface:x.initInterface,getProject:P.getProject,fetchInterfaceCatList:x.fetchInterfaceCatList,fetchInterfaceList:x.fetchInterfaceList})((k=_=function(e){(0,h.default)(r,e);var t,a=L(r);function r(e){var t,n;return(0,f.default)(this,r),n=a.call(this,e),(0,g.default)((0,m.default)(n),"changeModal",(function(e,t){var a={};a[e]=t,n.setState(a)})),(0,g.default)((0,m.default)(n),"handleCancel",(function(){n.setState({visible:!1})})),(0,g.default)((0,m.default)(n),"onSelect",(function(e){console.log(e);var t=n.props,a=t.history,r=t.match,l=e[0];if(!l||!e)return!1;var u="/project/"+r.params.id+"/interface/api";"root"===l?a.push(u):a.push(u+"/"+l),console.log(n.state.expands)})),(0,g.default)((0,m.default)(n),"changeExpands",(function(){})),(0,g.default)((0,m.default)(n),"handleAddInterface",(function(e,t){e.project_id=n.props.projectId,I.default.post("/api/interface/add",e).then((function(e){if(0!==e.data.errcode)return d.default.error(e.data.errmsg);d.default.success("接口添加成功");var a=e.data.data._id;n.props.history.push("/project/"+n.props.projectId+"/interface/api/"+a),n.getList(),n.setState({visible:!1}),t&&t()}))})),(0,g.default)((0,m.default)(n),"handleAddInterfaceCat",(function(e){e.project_id=n.props.projectId,e.parent_id=n.state.curCatdata.addchild?n.state.curCatdata._id:-1,I.default.post("/api/interface/add_cat",e).then((function(t){if(0!==t.data.errcode)return d.default.error(t.data.errmsg);d.default.success("接口分组添加成功"),n.getList(),n.props.getProject(e.project_id),n.setState({add_cat_modal_visible:!1})}))})),(0,g.default)((0,m.default)(n),"handleChangeInterfaceCat",(function(e){e.project_id=n.props.projectId;var t={catid:n.state.curCatdata._id,name:e.name,desc:e.desc};I.default.post("/api/interface/up_cat",t).then((function(t){if(0!==t.data.errcode)return d.default.error(t.data.errmsg);d.default.success("接口分组更新成功"),n.getList(),n.props.getProject(e.project_id),n.setState({change_cat_modal_visible:!1})}))})),(0,g.default)((0,m.default)(n),"showConfirm",(function(e){var t=(0,m.default)(n),a=e._id,r=e.catid,u=A({title:"您确认删除此接口????",content:"温馨提示：接口删除后，无法恢复",okText:"确认",cancelText:"取消",onOk:function(){return(0,s.default)(l.default.mark((function e(){return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.props.deleteInterfaceData(a,t.props.projectId);case 2:return e.next=4,t.getList();case 4:return e.next=6,t.props.fetchInterfaceCatList({catid:r});case 6:u.destroy(),t.props.history.push("/project/"+t.props.match.params.id+"/interface/api/cat_"+r);case 8:case"end":return e.stop()}}),e)})))()},onCancel:function(){u.destroy()}})})),(0,g.default)((0,m.default)(n),"showDelCatConfirm",(function(e){var t=(0,m.default)(n),a=A({title:"确定删除此接口分组吗？",content:"温馨提示：该操作会删除该分组下所有接口，接口删除后无法恢复",okText:"确认",cancelText:"取消",onOk:function(){return(0,s.default)(l.default.mark((function r(){return l.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.props.deleteInterfaceCatData(e,t.props.projectId);case 2:return r.next=4,t.getList();case 4:return r.next=6,t.props.fetchInterfaceList({project_id:t.props.projectId});case 6:t.props.history.push("/project/"+t.props.match.params.id+"/interface/api"),a.destroy();case 8:case"end":return r.stop()}}),r)})))()},onCancel:function(){}})})),(0,g.default)((0,m.default)(n),"copyInterface",function(){var e=(0,s.default)(l.default.mark((function e(t){var a,r,u;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.props.fetchInterfaceData(t);case 2:a=e.sent,r=a.payload.data.data,u=(0,D.default)(r,(function(e){e.title=e.title+"_copy",e.path=e.path+"_"+Date.now()})),I.default.post("/api/interface/add",u).then(function(){var e=(0,s.default)(l.default.mark((function e(t){var a;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0===t.data.errcode){e.next=2;break}return e.abrupt("return",d.default.error(t.data.errmsg));case 2:return d.default.success("接口添加成功"),a=t.data.data._id,e.next=6,n.getList();case 6:n.props.history.push("/project/"+n.props.projectId+"/interface/api/"+a),n.setState({visible:!1});case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),(0,g.default)((0,m.default)(n),"enterItem",(function(e){n.setState({delIcon:e})})),(0,g.default)((0,m.default)(n),"leaveItem",(function(){n.setState({delIcon:null})})),(0,g.default)((0,m.default)(n),"onFilter",(function(e){n.setState({filter:e.target.value,list:JSON.parse(JSON.stringify(n.props.list))})})),(0,g.default)((0,m.default)(n),"onExpand",(function(e){n.setState({expands:e})})),(0,g.default)((0,m.default)(n),"onDrop",function(){var e=(0,s.default)(l.default.mark((function e(t){var a,r,u,o,c,i,s,d,f,p,m,h,y,v,g,b,E;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=t.node.props.pos.split("-")[1]-1,r=t.dragNode.props.pos.split("-")[1]-1,!(a<0||r<0)){e.next=4;break}return e.abrupt("return");case 4:if(u=n.props.list,o=n.props.list[a]._id,c=t.dragNode.props.eventKey,i=n.props.list[r]._id,s=t.node.props.pos.split("-"),d=Number(s[s.length-1]),f=t.dragNode.props.pos.split("-"),p=Number(f[f.length-1]),-1!==c.indexOf("cat")){e.next=27;break}if(o!==i){e.next=19;break}m=u[a].list,h=(0,T.arrayChangeIndex)(m,p,d),I.default.post("/api/interface/up_index",h).then(),e.next=21;break;case 19:return e.next=21,I.default.post("/api/interface/up",{id:c,catid:o});case 21:y=n.props,v=y.projectId,g=y.router,n.props.fetchInterfaceListMenu(v),n.props.fetchInterfaceList({project_id:v}),g&&isNaN(g.params.actionId)&&(b=g.params.actionId.substr(4),n.props.fetchInterfaceCatList({catid:b})),e.next=30;break;case 27:E=(0,T.arrayChangeIndex)(u,p-1,d-1),I.default.post("/api/interface/up_cat_index",E).then(),n.props.fetchInterfaceListMenu(n.props.projectId);case 30:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),(0,g.default)((0,m.default)(n),"filterList",(function(e){var t=(0,m.default)(n),a=[];return{menuList:(0,D.default)(e,(function(e){e.filter((function(e){var r=!1;return-1===e.name.indexOf(t.state.filter)?(e.list=e.list.filter((function(e){return(-1!==e.title.indexOf(t.state.filter)||-1!==e.path.indexOf(t.state.filter))&&(r=!0,!0)})),a.push("cat_"+e._id),!0===r):(a.push("cat_"+e._id),!0)}))})),arr:a}})),n.state=(t={curKey:null,visible:!1,delIcon:null,curCatid:null,add_cat_modal_visible:!1,change_cat_modal_visible:!1,del_cat_modal_visible:!1},(0,g.default)(t,"change_cat_modal_visible",!1),(0,g.default)(t,"curCatdata",{}),(0,g.default)(t,"expands",null),(0,g.default)(t,"list",[]),t),n}return(0,p.default)(r,[{key:"handleRequest",value:function(){this.props.initInterface(),this.getList()}},{key:"getList",value:(t=(0,s.default)(l.default.mark((function e(){var t;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.props.fetchInterfaceListMenu(this.props.projectId);case 2:t=e.sent,this.setState({list:t.payload.data.data});case 4:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"componentWillMount",value:function(){this.handleRequest()}},{key:"componentWillReceiveProps",value:function(e){this.props.list!==e.list&&this.setState({list:e.list})}},{key:"render",value:function(){var e,t=this,a=this.props.match.params,r=w.default.createElement("div",{className:"interface-filter"},w.default.createElement("div",null,w.default.createElement("div",{style:{maxHeight:"54px",padding:"8px 10px",borderBottom:"1px solid #D9D9D9"}},w.default.createElement(i.default,{icon:"plus",type:"primary",onClick:function(){return t.changeModal("add_cat_modal_visible",!0)},className:"btn-filter"},"添加分组"))),this.state.visible?w.default.createElement(j.default,{title:"添加接口",visible:this.state.visible,onCancel:function(){return t.changeModal("visible",!1)},footer:null,className:"addcatmodal"},w.default.createElement(N.default,{catdata:this.props.curProject.cat,catid:this.state.curCatid,onCancel:function(){return t.changeModal("visible",!1)},onSubmit:this.handleAddInterface})):"",this.state.add_cat_modal_visible?w.default.createElement(j.default,{title:this.state.curCatdata.addchild?"在【"+this.state.curCatdata.name+"】下添加子分组":"添加主分组",visible:this.state.add_cat_modal_visible,onCancel:function(){return t.changeModal("add_cat_modal_visible",!1)},footer:null,className:"addcatmodal"},w.default.createElement(M.default,{catdata:this.state.curCatdata.addchild?{}:this.state.curCatdata,onCancel:function(){return t.changeModal("add_cat_modal_visible",!1)},onSubmit:this.handleAddInterfaceCat})):"",this.state.add_cat_modal_visible?w.default.createElement(j.default,{title:"添加分组",visible:this.state.add_cat_modal_visible,onCancel:function(){return t.changeModal("add_cat_modal_visible",!1)},footer:null,className:"addcatmodal"},w.default.createElement(M.default,{onCancel:function(){return t.changeModal("add_cat_modal_visible",!1)},onSubmit:this.handleAddInterfaceCat})):"",this.state.change_cat_modal_visible?w.default.createElement(j.default,{title:"修改分组",visible:this.state.change_cat_modal_visible,onCancel:function(){return t.changeModal("change_cat_modal_visible",!1)},footer:null,className:"addcatmodal"},w.default.createElement(M.default,{catdata:this.state.curCatdata,onCancel:function(){return t.changeModal("change_cat_modal_visible",!1)},onSubmit:this.handleChangeInterfaceCat})):"",this.state.add_fork_modal_visible?w.default.createElement(S.default,{visible:this.state.add_fork_modal_visible,catdata:this.state.curCatdata,onCancel:function(){return t.changeModal("add_fork_modal_visible",!1)},onSubmit:function(e){if(console.log(e),e&&e.length>0){for(var a in console.log(t.state.curCatdata),console.log(t.state.curCatid),e){var r=e[a];if(!0===r.cat);else{var n={catid:t.state.curCatid,project_id:t.props.projectId,type:"ref",ref_id:r.key};console.log(n),I.default.post("/api/interface/add",n).then((function(e){if(0!==e.data.errcode)return d.default.error("".concat(e.data.errmsg,", 关联接口出现异常"))}))}}t.getList()}t.changeModal("add_fork_modal_visible",!1)}}):""),n=function(){var e=t.props,a=e.router,r=e.inter,n=e.list,l={expands:[],selects:[]};if(0===n.length)return l;if(a){if(isNaN(a.params.actionId)){var u=a.params.actionId.substr(4);return{expands:t.state.expands?t.state.expands:["cat_"+u],selects:["cat_"+u]}}return r&&r._id?{expands:t.state.expands?t.state.expands:["cat_"+r.catid],selects:[r._id+""]}:l}return{expands:t.state.expands?t.state.expands:["cat_"+n[0]._id],selects:["root"]}}();if(this.state.filter){var l=this.filterList(this.state.list);e=l.menuList,n.expands=l.arr}else e=this.state.list;return w.default.createElement("div",null,r,e.length>0?w.default.createElement("div",{className:"tree-wrappper"},w.default.createElement(u.default,{mode:"inline"},w.default.createElement(u.default.Item,{className:"item",style:{borderBottom:"1px dashed #D9D9D9"}},w.default.createElement(R.Link,{onClick:function(e){e.stopPropagation(),t.changeExpands()},to:"/project/"+a.id+"/interface/api"},w.default.createElement(c.default,{type:"menu",style:{marginRight:5}}),"所有API"))),w.default.createElement(b.default,{blockNode:"false",autoExpandParent:!0,className:"interface-list",defaultExpandedKeys:n.expands,defaultSelectedKeys:n.selects,onSelect:this.onSelect,onExpand:this.onExpand,draggable:!0,onDrop:this.onDrop,switcherIcon:w.default.createElement(c.default,{type:"down"})},e.map((function e(r){return w.default.createElement(B,{title:w.default.createElement("div",{className:"container-title",onMouseEnter:function(){return t.enterItem(r._id)},onMouseLeave:t.leaveItem},w.default.createElement(R.Link,{className:"interface-item",to:"/project/"+a.id+"/interface/api/cat_"+r._id},w.default.createElement(c.default,{type:"folder-open",style:{marginRight:5}}),r.name),w.default.createElement("div",{className:"btns"},w.default.createElement(o.default,{placement:"leftTop",content:w.default.createElement("div",{className:"IM-menu"},w.default.createElement("div",null,w.default.createElement("span",{onClick:function(e){e.stopPropagation(),t.changeModal("visible",!0),t.setState({curCatid:r._id})}},w.default.createElement(c.default,{type:"plus"})," 新增接口")),w.default.createElement("div",{onClick:function(e){e.stopPropagation(),t.changeModal("add_fork_modal_visible",!0),t.setState({curCatid:r._id,curCatdata:r})}},w.default.createElement("span",null,w.default.createElement(c.default,{type:"fork"})," 关联接口")),w.default.createElement("div",null,w.default.createElement("span",{onClick:function(e){e.stopPropagation(),t.changeModal("add_cat_modal_visible",!0),r.addchild=!0,t.setState({curCatdata:r})}},w.default.createElement(c.default,{type:"plus"})," 添加分组")),w.default.createElement("div",null,w.default.createElement("span",{onClick:function(e){e.stopPropagation(),t.changeModal("change_cat_modal_visible",!0),t.setState({curCatdata:r})}},w.default.createElement(c.default,{type:"edit"})," 编辑分组")),w.default.createElement("div",null,w.default.createElement("span",{onClick:function(e){e.stopPropagation(),t.showDelCatConfirm(r._id)}},w.default.createElement(c.default,{type:"delete"})," 删除分组")))},w.default.createElement(c.default,{type:"ellipsis",style:{display:t.state.delIcon==r._id?"block":"none"}})))),key:"cat_"+r._id},r.children?r.children.map(e):"")})))):null)}}]),r}(w.PureComponent),(0,g.default)(_,"propTypes",{match:C.default.object,inter:C.default.object,projectId:C.default.string,list:C.default.array,fetchInterfaceListMenu:C.default.func,curProject:C.default.object,fetchInterfaceData:C.default.func,addInterfaceData:C.default.func,deleteInterfaceData:C.default.func,initInterface:C.default.func,history:C.default.object,router:C.default.object,getProject:C.default.func,fetchInterfaceCatList:C.default.func,fetchInterfaceList:C.default.func}),E=k))||E),G=(0,R.withRouter)(W);t.default=G},1359:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(33);var l=r(a(25)),u=r(a(58));a(48);var o=r(a(47)),c=r(a(9)),i=r(a(10)),s=r(a(23)),d=r(a(11)),f=r(a(12)),p=r(a(13)),m=r(a(5));a(82);var h=r(a(84)),y=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=g(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),v=r(a(0));function g(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(g=function(e){return e?a:t})(e)}function b(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,p.default)(e);if(t){var n=(0,p.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,f.default)(this,a)}}var E=h.default.Item;var _=function(e){(0,d.default)(a,e);var t=b(a);function a(){var e;(0,c.default)(this,a);for(var r=arguments.length,n=new Array(r),l=0;l<r;l++)n[l]=arguments[l];return e=t.call.apply(t,[this].concat(n)),(0,m.default)((0,s.default)(e),"handleSubmit",(function(t){t.preventDefault(),e.props.form.validateFields((function(t,a){t||e.props.onSubmit(a)}))})),e}return(0,i.default)(a,[{key:"render",value:function(){var e,t=this.props.form,a=t.getFieldDecorator,r=t.getFieldsError,n={labelCol:{xs:{span:24},sm:{span:6}},wrapperCol:{xs:{span:24},sm:{span:14}}};return y.default.createElement(h.default,{onSubmit:this.handleSubmit},y.default.createElement(E,(0,u.default)({},n,{label:"分组名"}),a("name",{rules:[{required:!0,message:"请输入分类名称!"}],initialValue:this.props.catdata&&this.props.catdata.name||null})(y.default.createElement(o.default,{placeholder:"分类名称"}))),y.default.createElement(E,(0,u.default)({},n,{label:"备注"}),a("desc",{initialValue:this.props.catdata&&this.props.catdata.desc||null})(y.default.createElement(o.default,{placeholder:"备注"}))),y.default.createElement(E,{className:"catModalfoot",wrapperCol:{span:24,offset:8}},y.default.createElement(l.default,{onClick:this.props.onCancel,style:{marginRight:"10px"}},"取消"),y.default.createElement(l.default,{type:"primary",htmlType:"submit",disabled:(e=r(),Object.keys(e).some((function(t){return e[t]})))},"提交")))}}]),a}(y.PureComponent);(0,m.default)(_,"propTypes",{form:v.default.object,onSubmit:v.default.func,onCancel:v.default.func,catdata:v.default.object});var k=h.default.create()(_);t.default=k},1360:function(e,t,a){},1361:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(30));a(123);var u=r(a(126));a(33);var o=r(a(25));a(55);var c=r(a(45));a(36);var i=r(a(4));a(38);var s=r(a(39)),d=r(a(31)),f=r(a(9)),p=r(a(10)),m=r(a(23)),h=r(a(11)),y=r(a(12)),v=r(a(13)),g=r(a(5));a(71);var b=r(a(61));a(53);var E=r(a(54)),_=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=q(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),k=a(22),j=r(a(0)),w=r(a(44)),O=r(a(294)),C=r(a(602)),x=a(124),P=a(75),N=a(40),M=r(a(72));a(604);r(a(605));var S,I,R,D=a(68),T=r(a(603));function q(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(q=function(e){return e?a:t})(e)}function L(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,v.default)(e);if(t){var n=(0,v.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,y.default)(this,a)}}var A=E.default.confirm,B=b.default.Option,W=(0,k.connect)((function(e){return{curData:e.inter.curdata,curProject:e.project.currProject,catList:e.inter.list,totalTableList:e.inter.totalTableList,catTableList:e.inter.catTableList,totalCount:e.inter.totalCount,count:e.inter.count}}),{fetchInterfaceListMenu:x.fetchInterfaceListMenu,fetchInterfaceList:x.fetchInterfaceList,fetchInterfaceCatList:x.fetchInterfaceCatList,deleteInterfaceData:x.deleteInterfaceData,getProject:P.getProject,fetchInterfaceData:x.fetchInterfaceData})((R=I=function(e){(0,h.default)(a,e);var t=L(a);function a(e){var r;return(0,f.default)(this,a),r=t.call(this,e),(0,g.default)((0,m.default)(r),"handleRequest",function(){var e=(0,d.default)(l.default.mark((function e(t){var a,n,u,o,c;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((a=t.match.params).actionId){e.next=10;break}return n=a.id,r.setState({catid:null}),u={page:r.state.current,limit:20,project_id:n},e.next=7,r.props.fetchInterfaceList(u);case 7:r.setState({loading:!1}),e.next=17;break;case 10:if(!isNaN(a.actionId)){e.next=17;break}return o=a.actionId.substr(4),r.setState({catid:+o}),c={page:r.state.current,limit:20,catid:o},e.next=16,r.props.fetchInterfaceCatList(c);case 16:r.setState({loading:!1});case 17:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),(0,g.default)((0,m.default)(r),"handleChangeInterfaceCat",(function(e,t){var a={catid:r.state.catid,name:t,desc:e};w.default.post("/api/interface/up_cat",a).then(function(){var e=(0,d.default)(l.default.mark((function e(t){var a;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0===t.data.errcode){e.next=2;break}return e.abrupt("return",s.default.error(t.data.errmsg));case 2:return a=r.props.match.params.id,e.next=5,r.props.getProject(a);case 5:return e.next=7,r.props.fetchInterfaceListMenu(a);case 7:s.default.success("接口集合简介更新成功");case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())})),(0,g.default)((0,m.default)(r),"handleChange",(function(e,t,a){r.setState({sortedInfo:a})})),(0,g.default)((0,m.default)(r),"handleDelInterface",(function(e){var t=(0,m.default)(r),a=e._id,n=r.props.curProject._id,u=(e.catid,e.ref_id?"移除关联":"删除"),o=e.ref_id?"移除关联不会删除原始接口":"接口删除后，无法恢复",c=A({title:"您确认".concat(u,"此接口????"),content:"温馨提示：".concat(o),okText:"确认",cancelText:"取消",onOk:function(){return(0,d.default)(l.default.mark((function e(){return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.props.deleteInterfaceData(a,n);case 2:t.handleRequest(t.props),c.destroy();case 4:case"end":return e.stop()}}),e)})))()},onCancel:function(){c.destroy()}})})),(0,g.default)((0,m.default)(r),"copyInterface",function(){var e=(0,d.default)(l.default.mark((function e(t){var a,n,u;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.props.fetchInterfaceData(t);case 2:a=e.sent,n=a.payload.data.data,u=(0,O.default)(n,(function(e){e.title=e.title+"_copy",e.path=e.path.trim()+"_"+(new Date).getTime()})),w.default.post("/api/interface/add",u).then(function(){var e=(0,d.default)(l.default.mark((function e(t){return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0===t.data.errcode){e.next=2;break}return e.abrupt("return",s.default.error(t.data.errmsg));case 2:s.default.success("接口添加成功"),r.handleRequest(r.props);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),(0,g.default)((0,m.default)(r),"handleAddInterface",(function(e){e.project_id=r.props.curProject._id,w.default.post("/api/interface/add",e).then((function(t){if(0!==t.data.errcode)return s.default.error("".concat(t.data.errmsg,", 你可以在左侧的接口列表中对接口进行删改"));s.default.success("接口添加成功");var a=t.data.data._id;r.props.history.push("/project/"+e.project_id+"/interface/api/"+a),r.props.fetchInterfaceListMenu(e.project_id)}))})),(0,g.default)((0,m.default)(r),"changeInterfaceCat",function(){var e=(0,d.default)(l.default.mark((function e(t,a){var n,u;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={id:t,catid:a},e.next=3,w.default.post("/api/interface/up",n);case 3:0===(u=e.sent).data.errcode?(s.default.success("修改成功"),r.handleRequest(r.props),r.props.fetchInterfaceListMenu(r.props.curProject._id)):s.default.error(u.data.errmsg);case 5:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}()),(0,g.default)((0,m.default)(r),"changeInterfaceStatus",function(){var e=(0,d.default)(l.default.mark((function e(t){var a,n;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a={id:t.split("-")[0],status:t.split("-")[1]},e.next=3,w.default.post("/api/interface/up",a);case 3:0===(n=e.sent).data.errcode?(s.default.success("修改成功"),r.handleRequest(r.props)):s.default.error(n.data.errmsg);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),(0,g.default)((0,m.default)(r),"changePage",(function(e){r.setState({current:e},(function(){return r.handleRequest(r.props)}))})),r.state={visible:!1,data:[],catid:null,total:null,current:1},r}return(0,p.default)(a,[{key:"componentWillMount",value:function(){this.actionId=this.props.match.params.actionId,this.handleRequest(this.props)}},{key:"componentWillReceiveProps",value:function(e){var t=this,a=e.match.params.actionId;this.actionId!==a&&(this.actionId=a,this.setState({current:1,loading:!0},(function(){return t.handleRequest(e)})))}},{key:"render",value:function(){var e=this,t=(this.props.curProject.tag.map((function(e){return{text:e.name,value:e.name}})),[{key:"p",width:2},{title:"接口名称",dataIndex:"title",key:"title",width:30,render:function(e,t){return _.default.createElement(N.Link,{to:"/project/"+t.project_id+"/interface/api/"+t._id},_.default.createElement("span",{className:"name"},e))}},{title:"URL",dataIndex:"path",key:"path",width:50,render:function(t,a){var r=e.props.curProject.basepath+t,n=M.default.METHOD_COLOR[a.method?a.method.toLowerCase():"get"]||M.default.METHOD_COLOR.get;return _.default.createElement("div",null,_.default.createElement("span",{style:{color:n.color,backgroundColor:n.bac},className:"colValue"},a.method),_.default.createElement(c.default,{title:"开放接口",placement:"topLeft"},_.default.createElement("span",null,a.api_opened&&_.default.createElement(i.default,{className:"opened",type:"eye-o"}))),_.default.createElement(c.default,{title:r,placement:"topLeft",overlayClassName:"toolTip"},_.default.createElement("span",{className:"path"},r)))}},{title:"状态",dataIndex:"status",key:"status",width:20,render:function(t,a){var r=a.key;M.default.INTERFACE_STATUS[t];return _.default.createElement(b.default,{value:r+"-"+t,className:"select",onChange:e.changeInterfaceStatus},_.default.createElement(B,{value:r+"-done"},_.default.createElement("span",{className:"tag-status done"},"完成")),_.default.createElement(B,{value:r+"-undone"},_.default.createElement("span",{className:"tag-status undone"},"未完成")),_.default.createElement(B,{value:r+"-invalid"},_.default.createElement("span",{className:"tag-status invalid"},"废弃")))},filters:[{text:"已完成",value:"done"},{text:"未完成",value:"undone"},{text:"废弃",value:"invalid"}],onFilter:function(e,t){return 0===t.status.indexOf(e)}},{title:"负责人",dataIndex:"connUsername",width:20},{title:"创建者",dataIndex:"createUserName",width:20},{title:"更新时间",dataIndex:"up_time",key:"up_time",width:20,ellipsis:!0,render:function(e,t){return(0,D.formatTime)(e)}},{title:"操作",width:20,render:function(t,a){return _.default.createElement("div",null,_.default.createElement(o.default,{type:"link",onClick:function(){e.handleDelInterface(a)}},a.ref_id?"移除":"删除"),a.ref_id?null:_.default.createElement(o.default,{type:"link",onClick:function(){e.copyInterface(a._id)}},"复制"))}}]),a=this.props.curProject?this.props.curProject.cat:[];if(a)for(var r=0;r<a.length;r++)if(a[r]._id===this.state.catid){a[r].name,a[r].desc;break}var n=[],l=0,d=this.props.match.params;d.actionId?isNaN(d.actionId)&&(n=this.props.catTableList,l=this.props.count):(n=this.props.totalTableList,l=this.props.totalCount),n=n.map((function(e){return e.key=e._id,e}));var f={total:l,pageSize:20,showTotal:function(e){return"共 ".concat(e," 条记录")},current:this.state.current,onChange:this.changePage},p=!this.props.match.params.actionId;return _.default.createElement("div",{style:{padding:"0px"}},_.default.createElement("div",{style:{maxHeight:"54px",borderBottom:"1px solid #D9D9D9",padding:"8px 10px"}},_.default.createElement(o.default,{icon:"plus",disabled:p,type:"primary",onClick:function(){return e.setState({visible:!0})}},"添加接口"),_.default.createElement(o.default,{style:{marginLeft:"10px"},icon:"plus",disabled:p,type:"primary",onClick:function(){return e.setState({add_fork_modal_visible:!0})}},"关联接口"),_.default.createElement(o.default,{style:{marginLeft:"10px"},icon:"reload",type:"primary",onClick:function(){return e.handleRequest(e.props)}},"刷新")),_.default.createElement(u.default,{style:{height:"calc(100vh - 230px)"},className:"table-interfacelist",scroll:{x:1200,y:parseInt(document.body.clientHeight)-230,scrollToFirstRowOnChange:!0},pagination:f,columns:t,rowKey:function(e){return e.key},onChange:this.handleChange,bordered:!0,loading:this.state.loading,size:"small",dataSource:n}),this.state.visible&&_.default.createElement(E.default,{title:"添加接口",visible:this.state.visible,onCancel:function(){return e.setState({visible:!1})},footer:null,className:"addcatmodal"},_.default.createElement(C.default,{catid:this.state.catid,catdata:a,onCancel:function(){return e.setState({visible:!1})},onSubmit:this.handleAddInterface})),this.state.add_fork_modal_visible?_.default.createElement(T.default,{visible:this.state.add_fork_modal_visible,catdata:this.state.curCatdata,onCancel:function(){e.setState({add_fork_modal_visible:!1})},onSubmit:function(t){if(t&&t.length>0){for(var a in t){var r=t[a];if(!0===r.cat);else{var n={catid:e.state.catid,project_id:e.props.match.params.id,type:"ref",ref_id:r.key};w.default.post("/api/interface/add",n).then((function(e){if(0!==e.data.errcode)return s.default.error("".concat(e.data.errmsg,", 关联接口出现异常"))}))}}e.handleRequest(e.props)}e.setState({add_fork_modal_visible:!1})}}):"")}}]),a}(_.PureComponent),(0,g.default)(I,"propTypes",{curData:j.default.object,catList:j.default.array,match:j.default.object,curProject:j.default.object,history:j.default.object,fetchInterfaceListMenu:j.default.func,deleteInterfaceData:j.default.func,fetchInterfaceList:j.default.func,fetchInterfaceData:j.default.func,fetchInterfaceCatList:j.default.func,totalTableList:j.default.array,catTableList:j.default.array,totalCount:j.default.number,count:j.default.number,getProject:j.default.func}),S=R))||S;t.default=W},1362:function(e,t,a){},1363:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(53);var l=r(a(54));a(33);var u=r(a(25)),o=r(a(9)),c=r(a(10)),i=r(a(23)),s=r(a(11)),d=r(a(12)),f=r(a(13)),p=r(a(5));a(125);var m,h,y,v=r(a(110)),g=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=C(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),b=a(22),E=r(a(0)),_=r(a(1364)),k=r(a(1472)),j=a(40),w=a(124),O=r(a(1480));function C(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(C=function(e){return e?a:t})(e)}function x(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,f.default)(e);if(t){var n=(0,f.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,d.default)(this,a)}}var P=a(141),N=v.default.TabPane,M=(0,b.connect)((function(e){return{curdata:e.inter.curdata,list:e.inter.list,editStatus:e.inter.editStatus}}),{fetchInterfaceData:w.fetchInterfaceData})((y=h=function(e){(0,s.default)(a,e);var t=x(a);function a(e){var r;return(0,o.default)(this,a),r=t.call(this,e),(0,p.default)((0,i.default)(r),"switchToView",(function(){r.setState({curtab:"view"})})),(0,p.default)((0,i.default)(r),"onChange",(function(e){"edit"===r.state.curtab&&r.props.editStatus?r.showModal():r.setState({curtab:e}),r.setState({nextTab:e})})),(0,p.default)((0,i.default)(r),"handleOk",(function(){r.setState({visible:!1,curtab:r.state.nextTab})})),(0,p.default)((0,i.default)(r),"showModal",(function(){r.setState({visible:!0})})),(0,p.default)((0,i.default)(r),"handleCancel",(function(){r.setState({visible:!1})})),r.title="凯叔API管理",r.state={curtab:"view",visible:!1,nextTab:""},r}return(0,c.default)(a,[{key:"componentWillMount",value:function(){var e=this.props.match.params;this.actionId=e.actionId,this.handleRequest(this.props)}},{key:"componentWillUnmount",value:function(){document.getElementsByTagName("title")[0].innerText=this.title}},{key:"componentWillReceiveProps",value:function(e){var t=e.match.params;t.actionId!==this.actionId&&(this.actionId=t.actionId,this.handleRequest(e))}},{key:"handleRequest",value:function(e){var t=e.match.params;this.props.fetchInterfaceData(t.actionId),this.setState({curtab:"view"})}},{key:"render",value:function(){var e=this;this.props.curdata.title&&(document.getElementsByTagName("title")[0].innerText=this.props.curdata.title+"-"+this.title);var t={view:{component:k.default,name:"预览"},edit:{component:_.default,name:"编辑"},run:{component:O.default,name:"测试"}};P.emitHook("interface_tab",t);var a=g.default.createElement(v.default,{onChange:this.onChange,activeKey:this.state.curtab,defaultActiveKey:"run"},Object.keys(t).filter((function(t){return"edit"!=t||!e.props.curdata.type||"ref"!=e.props.curdata.type})).map((function(e){var a=t[e];return g.default.createElement(N,{tab:a.name,key:e})}))),r=null;if(this.state.curtab){var n=t[this.state.curtab].component;r=g.default.createElement(n,{switchToView:this.switchToView})}return g.default.createElement("div",{className:"interface-content"},g.default.createElement(j.Prompt,{when:!("edit"!==this.state.curtab||!this.props.editStatus),message:function(){return"离开页面会丢失当前编辑的内容，确定要离开吗？"}}),a,r,this.state.visible&&g.default.createElement(l.default,{title:"你即将离开编辑页面",visible:this.state.visible,onCancel:this.handleCancel,footer:[g.default.createElement(u.default,{key:"back",onClick:this.handleCancel},"取 消"),g.default.createElement(u.default,{key:"submit",onClick:this.handleOk},"确 定")]},g.default.createElement("p",null,"离开页面会丢失当前编辑的内容，确定要离开吗？")))}}]),a}(g.default.Component),(0,p.default)(h,"propTypes",{match:E.default.object,list:E.default.array,curdata:E.default.object,fetchInterfaceData:E.default.func,history:E.default.object,editStatus:E.default.bool}),m=y))||m,S=(0,j.withRouter)(M);t.default=S},1364:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(30));a(53);var u=r(a(54));a(38);var o=r(a(39)),c=r(a(31)),i=r(a(9)),s=r(a(10)),d=r(a(23)),f=r(a(11)),p=r(a(12)),m=r(a(13)),h=r(a(5)),y=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=P(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),v=r(a(0)),g=a(22),b=r(a(1365)),E=a(124),_=a(75),k=r(a(44));a(604);var j,w,O,C=a(40),x=r(a(632));function P(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(P=function(e){return e?a:t})(e)}function N(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,m.default)(e);if(t){var n=(0,m.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,p.default)(this,a)}}var M=(0,g.connect)((function(e){return{curdata:e.inter.curdata,currProject:e.project.currProject}}),{updateInterfaceData:E.updateInterfaceData,fetchInterfaceListMenu:E.fetchInterfaceListMenu,fetchInterfaceData:E.fetchInterfaceData,getProject:_.getProject})((O=w=function(e){(0,f.default)(a,e);var t=N(a);function a(e){var r;(0,i.default)(this,a),r=t.call(this,e),(0,h.default)((0,d.default)(r),"onSubmit",function(){var e=(0,c.default)(l.default.mark((function e(t){var a;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.id=r.props.match.params.actionId,e.next=3,k.default.post("/api/interface/up",t);case 3:a=e.sent,r.props.fetchInterfaceListMenu(r.props.currProject._id).then(),r.props.fetchInterfaceData(t.id).then(),0===a.data.errcode?(r.props.updateInterfaceData(t),o.default.success("保存成功")):o.default.error(a.data.errmsg);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),(0,h.default)((0,d.default)(r),"onTagClick",(function(){r.setState({visible:!0})})),(0,h.default)((0,d.default)(r),"handleOk",(0,c.default)(l.default.mark((function e(){var t,a,n,u;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=(t=r.tag.state.tag).filter((function(e){return""!==e.name})),a=r.props.currProject._id,n={id:a,tag:t},e.next=6,k.default.post("/api/project/up_tag",n);case 6:if(0!==(u=e.sent).data.errcode){e.next=13;break}return e.next=10,r.props.getProject(a);case 10:o.default.success("保存成功"),e.next=14;break;case 13:o.default.error(u.data.errmsg);case 14:r.setState({visible:!1});case 15:case"end":return e.stop()}}),e)})))),(0,h.default)((0,d.default)(r),"handleCancel",(function(){r.setState({visible:!1})})),(0,h.default)((0,d.default)(r),"tagSubmit",(function(e){r.tag=e}));var n=r.props,u=n.curdata,s=n.currProject;return r.state={mockUrl:location.protocol+"//"+location.hostname+(""!==location.port?":"+location.port:"")+"/mock/".concat(s._id).concat(s.basepath).concat(u.path),curdata:{},status:0,visible:!1},r}return(0,s.default)(a,[{key:"componentWillUnmount",value:function(){try{1===this.state.status&&this.WebSocket.close()}catch(e){return null}}},{key:"componentDidMount",value:function(){var e,t=this,a=location.hostname+(""!==location.port?":"+location.port:""),r=!1,n="https:"===location.protocol?"wss":"ws";setTimeout((function(){!1===r&&(t.setState({curdata:t.props.curdata,status:1}),r=!0)}),1e3);try{(e=new WebSocket(n+"://"+a+"/api/interface/solve_conflict?id="+this.props.match.params.actionId)).onopen=function(){t.WebSocket=e},e.onmessage=function(e){r=!0;var a=JSON.parse(e.data);0===a.errno?t.setState({curdata:a.data,status:1}):t.setState({curdata:a.data,status:2})},e.onerror=function(){t.setState({curdata:t.props.curdata,status:1}),console.warn("websocket 连接失败，将导致多人编辑同一个接口冲突。")}}catch(e){this.setState({curdata:this.props.curdata,status:1}),console.error("websocket 连接失败，将导致多人编辑同一个接口冲突。")}}},{key:"render",value:function(){var e=this.props.currProject,t=e.cat,a=e.basepath,r=e.switch_notice,n=e.tag;return y.default.createElement("div",{className:"interface-edit",style:{height:"100%",overflowY:"auto"}},1===this.state.status?y.default.createElement(b.default,{cat:t,mockUrl:this.state.mockUrl,basepath:a,noticed:r,onSubmit:this.onSubmit,curdata:this.state.curdata,onTagClick:this.onTagClick}):null,2===this.state.status?y.default.createElement("div",{style:{textAlign:"center",fontSize:"14px",paddingTop:"10px"}},y.default.createElement(C.Link,{to:"/user/profile/"+this.state.curdata.uid},y.default.createElement("b",null,this.state.curdata.username)),y.default.createElement("span",null,"正在编辑该接口，请稍后再试...")):null,0===this.state.status&&"正在加载，请耐心等待...",y.default.createElement(u.default,{title:"Tag 设置",width:680,visible:this.state.visible,onOk:this.handleOk,onCancel:this.handleCancel,okText:"保存"},y.default.createElement("div",{className:"tag-modal-center"},y.default.createElement(x.default,{tagMsg:n,ref:this.tagSubmit}))))}}]),a}(y.PureComponent),(0,h.default)(w,"propTypes",{curdata:v.default.object,currProject:v.default.object,updateInterfaceData:v.default.func,fetchInterfaceListMenu:v.default.func,fetchInterfaceData:v.default.func,match:v.default.object,switchToView:v.default.func,getProject:v.default.func}),j=O))||j,S=(0,C.withRouter)(M);t.default=S},1365:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(30));a(1366);var u=r(a(1634));a(134);var o=r(a(135));a(144);var c=r(a(166));a(33);var i=r(a(25));a(55);var s=r(a(45)),d=r(a(58));a(53);var f=r(a(54));a(232);var p=r(a(245));a(57);var m=r(a(51));a(64);var h=r(a(49));a(36);var y=r(a(4)),v=r(a(31));a(38);var g=r(a(39)),b=r(a(9)),E=r(a(10)),_=r(a(23)),k=r(a(11)),j=r(a(12)),w=r(a(13)),O=r(a(5));a(162);var C=r(a(127));a(71);var x=r(a(61));a(82);var P=r(a(84));a(48);var N=r(a(47)),M=r(a(7));a(125);var S,I,R,D=r(a(110)),T=Z(a(1)),q=r(a(0)),L=a(22),A=r(a(79)),B=Z(a(72)),W=a(68),G=a(124),F=r(a(143)),U=r(a(585)),V=r(a(373)),H=r(a(165)),z=r(a(44)),J=r(a(606)),K=r(a(1464)),Y=r(a(564)),Q=r(a(1465));function X(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(X=function(e){return e?a:t})(e)}function Z(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=X(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}return r.default=e,a&&a.set(e,r),r}function $(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function ee(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?$(Object(a),!0).forEach((function(t){(0,O.default)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):$(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function te(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,w.default)(e);if(t){var n=(0,w.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,j.default)(this,a)}}a(565),a(566);var ae,re=(0,J.default)({lang:"zh_CN",mock:B.MOCK_SOURCE}),ne=(0,J.default)({lang:"zh_CN",mock:B.MOCK_SOURCE}),le=D.default.TabPane;function ue(e){try{if((e=F.default.parse(e)).properties&&"object"===(0,M.default)(e.properties)&&!e.type&&(e.type="object"),e.items&&"object"===(0,M.default)(e.items)&&!e.type&&(e.type="array"),!e.type)return!1;e.type=e.type.toLowerCase();return-1!==["object","string","number","array","boolean","integer"].indexOf(e.type)&&JSON.stringify(e)}catch(e){return!1}}a(1469);var oe=function(e){try{return F.default.parse(e),!0}catch(e){return!1}},ce='\n  {\n    /**\n     * info\n     */\n\n    "id": 1 //appId\n  }\n\n',ie=N.default.TextArea,se=P.default.Item,de=x.default.Option,fe=N.default.Group,pe=C.default.Button,me=C.default.Group,he={req_query:{name:"",required:"1",desc:"",example:""},req_headers:{name:"",required:"1",desc:"",example:""},req_params:{name:"",desc:"",example:""},req_body_form:{name:"",type:"text",required:"1",desc:"",example:""}},ye=B.default.HTTP_METHOD,ve=Object.keys(ye),ge=B.default.HTTP_REQUEST_HEADER,be=(0,L.connect)((function(e){return{custom_field:e.group.field,projectMsg:e.project.currProject}}),{changeEditStatus:G.changeEditStatus})((R=I=function(e){(0,k.default)(a,e);var t=te(a);function a(e){var r;(0,b.default)(this,a),r=t.call(this,e),(0,O.default)((0,_.default)(r),"handleSubmit",(function(e){e.preventDefault(),r.setState({submitStatus:!0});try{r.props.form.validateFields((function(e,t){if(setTimeout((function(){r._isMounted&&r.setState({submitStatus:!1})}),3e3),!e){if(t.desc=r.editor.getHtml(),t.markdown=r.editor.getMarkdown(),"json"===t.res_body_type){if(r.state.res_body&&!1===oe(r.state.res_body))return g.default.error("返回body json格式有问题，请检查！");try{t.res_body=JSON.stringify(JSON.parse(r.state.res_body),null,"   ")}catch(e){t.res_body=r.state.res_body}}if("json"===t.req_body_type){if(r.state.req_body_other&&!1===oe(r.state.req_body_other))return g.default.error("响应Body json格式有问题，请检查！");try{t.req_body_other=JSON.stringify(JSON.parse(r.state.req_body_other),null,"   ")}catch(e){t.req_body_other=r.state.req_body_other}}t.method=r.state.method,t.req_params=t.req_params||[],t.req_headers=t.req_headers||[],t.req_body_form=t.req_body_form||[],t.api_manager_conn_id=r.state.api_manager_conn_id;var a=!1,n=!1;if("form"===t.req_body_type?(t.req_body_form.forEach((function(e){"file"===e.type&&(a=!0)})),t.req_headers.map((function(e){"Content-Type"===e.name&&(e.value=a?"multipart/form-data":"application/x-www-form-urlencoded",n=!0)})),!1===n&&t.req_headers.unshift({name:"Content-Type",value:a?"multipart/form-data":"application/x-www-form-urlencoded"})):"json"===t.req_body_type&&(!t.req_headers||t.req_headers.map((function(e){"Content-Type"===e.name&&(e.value="application/json",n=!0)})),!1===n&&(t.req_headers=t.req_headers||[],t.req_headers.unshift({name:"Content-Type",value:"application/json"}))),t.req_headers=t.req_headers?t.req_headers.filter((function(e){return""!==e.name})):[],t.req_body_form=t.req_body_form?t.req_body_form.filter((function(e){return""!==e.name})):[],t.req_params=t.req_params?t.req_params.filter((function(e){return""!==e.name})):[],t.req_query=t.req_query?t.req_query.filter((function(e){return""!==e.name})):[],!0!==ye[t.method].request_body&&(t.req_body_form=[]),t.req_body_is_json_schema&&t.req_body_other&&"json"===t.req_body_type&&(t.req_body_other=ue(t.req_body_other),!t.req_body_other))return g.default.error("请求参数 json-schema 格式有误");if(t.res_body_is_json_schema&&t.res_body&&"json"===t.res_body_type&&(t.res_body=ue(t.res_body),!t.res_body))return g.default.error("返回数据 json-schema 格式有误");r.props.onSubmit(t),ae.props.changeEditStatus(!1)}}))}catch(e){console.error(e.message),r.setState({submitStatus:!1})}})),(0,O.default)((0,_.default)(r),"onChangeMethod",(function(e){var t=[];t=ye[e].request_body?["req","body"]:["req","query"],r.setState({req_radio_type:t.join("-")}),r.setState({method:e},(function(){r._changeRadioGroup(t[0],t[1])}))})),(0,O.default)((0,_.default)(r),"addParams",(function(e,t){var a={};t=t||he[e],a[e]=[].concat(r.state[e],t),r.setState(a)})),(0,O.default)((0,_.default)(r),"delParams",(function(e,t){var a=r.props.form.getFieldValue(t),n={};n[t]=a.filter((function(t,a){return a!==e})),r.props.form.setFieldsValue(n),r.setState(n)})),(0,O.default)((0,_.default)(r),"handleMockPreview",(0,v.default)(l.default.mark((function e(){var t,a,n;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t="",e.prev=1,!r.props.form.getFieldValue("res_body_is_json_schema")){e.next=8;break}return a=F.default.parse(r.props.form.getFieldValue("res_body")),e.next=6,z.default.post("/api/interface/schema2json",{schema:a});case 6:return n=e.sent,e.abrupt("return",r.mockPreview.setValue(JSON.stringify(n.data)));case 8:t=!0===r.resBodyEditor.editor.curData.format?JSON.stringify(r.resBodyEditor.editor.curData.mockData(),null,"  "):"解析出错: "+r.resBodyEditor.editor.curData.format,e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),t="解析出错: "+e.t0.message;case 14:r.mockPreview.setValue(t);case 15:case"end":return e.stop()}}),e,null,[[1,11]])})))),(0,O.default)((0,_.default)(r),"handleJsonType",(function(e){"preview"===(e=e||"tpl")&&r.handleMockPreview(),r.setState({jsonType:e})})),(0,O.default)((0,_.default)(r),"handlePath",(function(e){var t=e.target.value,a=[],n=function(e){var t=A.default.find(r.state.req_params,{name:e});t?a.push(t):a.push({name:e,desc:""})};if(t=(0,W.handlePath)(t),r.props.form.setFieldsValue({path:t}),t&&-1!==t.indexOf(":")){var l,u,o=t.split("/");for(u=1;u<o.length;u++)":"===o[u][0]&&(l=o[u].substr(1),n(l))}t&&t.length>3&&t.replace(/\{(.+?)\}/g,(function(e,t){n(t)})),r.setState({req_params:a})})),(0,O.default)((0,_.default)(r),"changeRadioGroup",(function(e){var t=e.target.value.split("-");"req"===t[0]&&r.setState({req_radio_type:e.target.value}),r._changeRadioGroup(t[0],t[1])})),(0,O.default)((0,_.default)(r),"_changeRadioGroup",(function(e,t){var a={};for(var n in r.state.hideTabs[e])a[n]="hide";a[t]="",r.setState({hideTabs:ee(ee({},r.state.hideTabs),{},(0,O.default)({},e,a))})})),(0,O.default)((0,_.default)(r),"handleDragMove",(function(e){return function(t){var a=(0,O.default)({},e,t);r.props.form.setFieldsValue(a),r.setState(a)}})),(0,O.default)((0,_.default)(r),"handleResBody",(function(e){var t=r.state.res_body;r.setState({res_body:e.text}),ae.props.changeEditStatus(t!==e.text)})),(0,O.default)((0,_.default)(r),"handleReqBody",(function(e){var t=r.state.req_body_other;r.setState({req_body_other:e.text}),ae.props.changeEditStatus(t!==e.text)})),(0,O.default)((0,_.default)(r),"handleBulkOk",(function(){var e=r.props.form.getFieldValue(r.state.bulkName),t=[];r.state.bulkValue.split("\n").forEach((function(a,n){var l=Object.assign({},e[n]||he[r.state.bulkName]);l.name=a.split(":")[0],l.example=a.split(":")[1]||"",t.push(l)})),r.setState((0,O.default)({visible:!1,bulkValue:null,bulkName:null},r.state.bulkName,t))})),(0,O.default)((0,_.default)(r),"handleBulkCancel",(function(){r.setState({visible:!1,bulkValue:null,bulkName:null})})),(0,O.default)((0,_.default)(r),"showBulk",(function(e){var t=r.props.form.getFieldValue(e),a="";t.forEach((function(e){return a+=e.name?"".concat(e.name,":").concat(e.example||"","\n"):""})),r.setState({visible:!0,bulkValue:a,bulkName:e})})),(0,O.default)((0,_.default)(r),"handleBulkValueInput",(function(e){r.setState({bulkValue:e.target.value})}));var n=r.props.curdata;return r.state=r.initState(n),r}return(0,E.default)(a,[{key:"initState",value:function(e){return this.startTime=(new Date).getTime(),e.req_query&&0===e.req_query.length&&delete e.req_query,e.req_headers&&0===e.req_headers.length&&delete e.req_headers,e.req_body_form&&0===e.req_body_form.length&&delete e.req_body_form,e.req_params&&0===e.req_params.length&&delete e.req_params,e.req_body_form&&(e.req_body_form=e.req_body_form.map((function(e){return e.type="text"===e.type?"text":"file",e}))),e.hideTabs={req:{body:"hide",query:"hide",headers:"hide"}},console.log(e),e.method&&(e.hideTabs.req[ye[e.method].default_tab]=""),Object.assign({submitStatus:!1,title:"",path:"",status:"undone",api_manager_conn_id:"",method:"get",req_params:[],req_query:[{name:"",desc:"",required:"1"}],req_headers:[{name:"",value:"",required:"1"}],req_body_type:"form",req_body_form:[{name:"",type:"text",required:"1"}],req_body_other:"",res_body_type:"json",res_body:"",desc:"",res_body_mock:"",jsonType:"tpl",mockUrl:this.props.mockUrl,req_radio_type:"req-query",custom_field_value:"",api_opened:!1,visible:!1},e)}},{key:"componentDidMount",value:function(){ae=this,this._isMounted=!0,this.setState({req_radio_type:ye[this.state.method].request_body?"req-body":"req-query"}),this.mockPreview=(0,V.default)({container:"mock-preview",data:"",readOnly:!0}),this.editor=new Y.default({el:document.querySelector("#desc"),initialEditType:"wysiwyg",previewStyle:"vertical",theme:"dark",plugins:[Q.default],height:"500px",viewer:!0,initialValue:this.state.markdown||this.state.desc})}},{key:"componentWillUnmount",value:function(){ae.props.changeEditStatus(!1),ae=null,this._isMounted=!1}},{key:"render",value:function(){var e=this,t=this.props.form.getFieldDecorator,a=this.props,r=a.custom_field,n=a.projectMsg,l={labelCol:{span:4},wrapperCol:{span:18}},v=ue(this.state.res_body)||"",g=ue(this.state.req_body_other)||"",b=this.state.req_params.map((function(e,a){return function(e,a){return T.default.createElement(m.default,{key:a,className:"interface-edit-item-content"},T.default.createElement(h.default,{span:"6",className:"interface-edit-item-content-col"},t("req_params["+a+"].name",{initialValue:e.name})(T.default.createElement(N.default,{disabled:!0,placeholder:"参数名称"}))),T.default.createElement(h.default,{span:"7",className:"interface-edit-item-content-col"},t("req_params["+a+"].example",{initialValue:e.example})(T.default.createElement(ie,{autosize:!0,placeholder:"参数示例"}))),T.default.createElement(h.default,{span:"11",className:"interface-edit-item-content-col"},t("req_params["+a+"].desc",{initialValue:e.desc})(T.default.createElement(ie,{autosize:!0,placeholder:"备注"}))))}(e,a)})),E=this.state.req_query.map((function(a,r){return function(a,r){return T.default.createElement(m.default,{key:r,className:"interface-edit-item-content"},T.default.createElement(h.default,{span:"1",easy_drag_sort_child:"true",className:"interface-edit-item-content-col interface-edit-item-content-col-drag"},T.default.createElement(y.default,{type:"bars"})),T.default.createElement(h.default,{span:"4",draggable:"false",className:"interface-edit-item-content-col"},t("req_query["+r+"].name",{initialValue:a.name})(T.default.createElement(N.default,{placeholder:"参数名称"}))),T.default.createElement(h.default,{span:"3",className:"interface-edit-item-content-col"},t("req_query["+r+"].required",{initialValue:a.required})(T.default.createElement(x.default,null,T.default.createElement(de,{value:"1"},"必需"),T.default.createElement(de,{value:"0"},"非必需")))),T.default.createElement(h.default,{span:"6",className:"interface-edit-item-content-col"},t("req_query["+r+"].example",{initialValue:a.example})(T.default.createElement(ie,{autosize:!0,placeholder:"参数示例"}))),T.default.createElement(h.default,{span:"9",className:"interface-edit-item-content-col"},t("req_query["+r+"].desc",{initialValue:a.desc})(T.default.createElement(ie,{autosize:!0,placeholder:"备注"}))),T.default.createElement(h.default,{span:"1",className:"interface-edit-item-content-col"},T.default.createElement(y.default,{type:"delete",className:"interface-edit-del-icon",onClick:function(){return e.delParams(r,"req_query")}})))}(a,r)})),_=this.state.req_headers?this.state.req_headers.map((function(a,r){return function(a,r){return T.default.createElement(m.default,{key:r,className:"interface-edit-item-content"},T.default.createElement(h.default,{span:"1",easy_drag_sort_child:"true",className:"interface-edit-item-content-col interface-edit-item-content-col-drag"},T.default.createElement(y.default,{type:"bars"})),T.default.createElement(h.default,{span:"4",className:"interface-edit-item-content-col"},t("req_headers["+r+"].name",{initialValue:a.name})(T.default.createElement(p.default,{dataSource:ge,filterOption:function(e,t){return-1!==t.props.children.toUpperCase().indexOf(e.toUpperCase())},placeholder:"参数名称"}))),T.default.createElement(h.default,{span:"5",className:"interface-edit-item-content-col"},t("req_headers["+r+"].value",{initialValue:a.value})(T.default.createElement(N.default,{placeholder:"参数值"}))),T.default.createElement(h.default,{span:"5",className:"interface-edit-item-content-col"},t("req_headers["+r+"].example",{initialValue:a.example})(T.default.createElement(ie,{autosize:!0,placeholder:"参数示例"}))),T.default.createElement(h.default,{span:"8",className:"interface-edit-item-content-col"},t("req_headers["+r+"].desc",{initialValue:a.desc})(T.default.createElement(ie,{autosize:!0,placeholder:"备注"}))),T.default.createElement(h.default,{span:"1",className:"interface-edit-item-content-col"},T.default.createElement(y.default,{type:"delete",className:"interface-edit-del-icon",onClick:function(){return e.delParams(r,"req_headers")}})))}(a,r)})):[],k=this.state.req_body_form.map((function(a,r){return function(a,r){return T.default.createElement(m.default,{key:r,className:"interface-edit-item-content"},T.default.createElement(h.default,{span:"1",easy_drag_sort_child:"true",className:"interface-edit-item-content-col interface-edit-item-content-col-drag"},T.default.createElement(y.default,{type:"bars"})),T.default.createElement(h.default,{span:"4",className:"interface-edit-item-content-col"},t("req_body_form["+r+"].name",{initialValue:a.name})(T.default.createElement(N.default,{placeholder:"name"}))),T.default.createElement(h.default,{span:"3",className:"interface-edit-item-content-col"},t("req_body_form["+r+"].type",{initialValue:a.type})(T.default.createElement(x.default,null,T.default.createElement(de,{value:"text"},"text"),T.default.createElement(de,{value:"file"},"file")))),T.default.createElement(h.default,{span:"3",className:"interface-edit-item-content-col"},t("req_body_form["+r+"].required",{initialValue:a.required})(T.default.createElement(x.default,null,T.default.createElement(de,{value:"1"},"必需"),T.default.createElement(de,{value:"0"},"非必需")))),T.default.createElement(h.default,{span:"5",className:"interface-edit-item-content-col"},t("req_body_form["+r+"].example",{initialValue:a.example})(T.default.createElement(ie,{autosize:!0,placeholder:"参数示例"}))),T.default.createElement(h.default,{span:"7",className:"interface-edit-item-content-col"},t("req_body_form["+r+"].desc",{initialValue:a.desc})(T.default.createElement(ie,{autosize:!0,placeholder:"备注"}))),T.default.createElement(h.default,{span:"1",className:"interface-edit-item-content-col"},T.default.createElement(y.default,{type:"delete",className:"interface-edit-del-icon",onClick:function(){return e.delParams(r,"req_body_form")}})))}(a,r)}));return T.default.createElement("div",null,T.default.createElement(f.default,{title:"批量添加参数",width:680,visible:this.state.visible,onOk:this.handleBulkOk,onCancel:this.handleBulkCancel,okText:"导入"},T.default.createElement("div",null,T.default.createElement(ie,{placeholder:"每行一个name:examples",autosize:{minRows:6,maxRows:10},value:this.state.bulkValue,onChange:this.handleBulkValueInput}))),T.default.createElement(P.default,{onSubmit:this.handleSubmit},T.default.createElement("h3",{className:"interface-title",style:{marginTop:0}},"基本设置"),T.default.createElement("div",{className:"panel-sub"},T.default.createElement(se,(0,d.default)({className:"interface-edit-item"},l,{label:"接口名称"}),t("title",{initialValue:this.state.title,rules:(0,W.nameLengthLimit)("接口")})(T.default.createElement(N.default,{id:"title",placeholder:"接口名称"}))),T.default.createElement(se,(0,d.default)({className:"interface-edit-item"},l,{label:"选择分组"}),t("catid",{initialValue:this.state.catid+"",rules:[{required:!0,message:"请选择一个分组"}]})(T.default.createElement(x.default,{placeholder:"请选择一个分组"},this.props.cat.map((function(e){return T.default.createElement(de,{key:e._id,value:e._id+""},e.name)}))))),T.default.createElement(se,(0,d.default)({className:"interface-edit-item"},l,{label:T.default.createElement("span",null,"接口路径 ",T.default.createElement(s.default,{title:T.default.createElement("div",null,T.default.createElement("p",null,"1. 支持动态路由,例如:","/api/user/{id}"),T.default.createElement("p",null,"2. 支持 ?controller=xxx 的QueryRouter,非router的Query参数请定义到 Request设置->Query"))},T.default.createElement(y.default,{type:"question-circle-o",style:{width:"10px"}})))}),T.default.createElement(fe,{compact:!0},T.default.createElement(x.default,{value:this.state.method,onChange:this.onChangeMethod,style:{width:"15%"}},ve.map((function(e){return T.default.createElement(de,{key:e,value:e},e)}))),T.default.createElement(s.default,{title:"接口基本路径，可在 项目设置 里修改",style:{display:""==this.props.basepath?"block":"none"}},T.default.createElement(N.default,{disabled:!0,value:this.props.basepath,readOnly:!0,onChange:function(){},style:{width:"25%"}})),t("path",{initialValue:this.state.path,rules:[{required:!0,message:"请输入接口路径!"}]})(T.default.createElement(N.default,{onChange:this.handlePath,placeholder:"/path",style:{width:"60%"}}))),T.default.createElement(m.default,{className:"interface-edit-item"},T.default.createElement(h.default,{span:24,offset:0},b))),T.default.createElement(se,(0,d.default)({className:"interface-edit-item"},l,{label:"Tag"}),t("tag",{initialValue:this.state.tag})(T.default.createElement(x.default,{placeholder:"请选择 tag ",mode:"multiple"},n.tag.map((function(e){return T.default.createElement(de,{value:e.name,key:e._id},e.name)})),T.default.createElement(de,{value:"tag设置",disabled:!0,style:{cursor:"pointer",color:"#2395f1"}},T.default.createElement(i.default,{type:"primary",onClick:this.props.onTagClick},"Tag设置"))))),T.default.createElement(se,(0,d.default)({className:"interface-edit-item"},l,{label:"状态"}),t("status",{initialValue:this.state.status})(T.default.createElement(C.default.Group,{value:this.state.status},T.default.createElement(C.default,{value:"done"},"已完成"),T.default.createElement(C.default,{value:"undone"},"未完成"),T.default.createElement(C.default,{value:"invalid"},"废弃")))),T.default.createElement(se,(0,d.default)({className:"interface-edit-item"},l,{label:T.default.createElement("span",null,"访问权限",T.default.createElement(c.default,{content:T.default.createElement("div",null,T.default.createElement("p",{style:{fontWeight:500,color:"#000"}},"针对APP访问接口权限，不是接口文档的权限"),T.default.createElement("p",null,"1.未登录：没有登录也可以访问该接口"),T.default.createElement("p",null,"2.游客账户：游客账户也可以访问该接口，例如某些游客账户也记录数据到云端"),T.default.createElement("p",null,"3.正式账户：正式账户"))},T.default.createElement(y.default,{type:"question-circle-o",style:{width:"10px"}})))}),t("identityType",{initialValue:this.state.identityType,rules:[{required:!0,message:"请选择访问权限"}]})(T.default.createElement(x.default,{placeholder:"请选择访问权限",mode:"multiple",defaultValue:"none"},T.default.createElement(de,{value:"none",style:{cursor:"pointer",color:"#2395f1"}},"未登录"),T.default.createElement(de,{value:"tourist",style:{cursor:"pointer",color:"#2395f1"}},"游客账户"),T.default.createElement(de,{value:"certified",style:{cursor:"pointer",color:"#2395f1"}},"正式账户")))),T.default.createElement(se,(0,d.default)({className:"interface-edit-item"},l,{label:"负责人"}),t("api_manager_conn_id",{initialValue:this.state.api_manager_conn_id,rules:[{required:!0,message:"请选择负责人"}]})(T.default.createElement(K.default,{value:this.state.api_manager_conn_id,onChange:function(t){e.setState({api_manager_conn_id:t})}}))),r.enable&&T.default.createElement(se,(0,d.default)({className:"interface-edit-item"},l,{label:r.name}),t("custom_field_value",{initialValue:this.state.custom_field_value})(T.default.createElement(N.default,{placeholder:"请输入"})))),T.default.createElement("h3",{className:"interface-title"},"请求参数设置"),T.default.createElement("div",{className:"container-radiogroup"},T.default.createElement(me,{value:this.state.req_radio_type,size:"large",className:"radioGroup",onChange:this.changeRadioGroup},ye[this.state.method].request_body?T.default.createElement(pe,{value:"req-body"},"Body"):null,T.default.createElement(pe,{value:"req-query"},"Query"),T.default.createElement(pe,{value:"req-headers"},"Headers"))),T.default.createElement("div",{className:"panel-sub"},T.default.createElement(se,{className:"interface-edit-item "+this.state.hideTabs.req.query},T.default.createElement(m.default,{type:"flex",justify:"space-around"},T.default.createElement(h.default,{span:12},T.default.createElement(i.default,{size:"small",type:"primary",onClick:function(){return e.addParams("req_query")}},"添加Query参数")),T.default.createElement(h.default,{span:12},T.default.createElement("div",{className:"bulk-import",onClick:function(){return e.showBulk("req_query")}},"批量添加")))),T.default.createElement(m.default,{className:"interface-edit-item "+this.state.hideTabs.req.query},T.default.createElement(h.default,null,T.default.createElement(U.default,{data:function(){return e.props.form.getFieldValue("req_query")},onChange:this.handleDragMove("req_query"),onlyChild:"easy_drag_sort_child"},E))),T.default.createElement(se,{className:"interface-edit-item "+this.state.hideTabs.req.headers},T.default.createElement(i.default,{size:"small",type:"primary",onClick:function(){return e.addParams("req_headers")}},"添加Header")),T.default.createElement(m.default,{className:"interface-edit-item "+this.state.hideTabs.req.headers},T.default.createElement(h.default,null,T.default.createElement(U.default,{data:function(){return e.props.form.getFieldValue("req_headers")},onChange:this.handleDragMove("req_headers"),onlyChild:"easy_drag_sort_child"},_))),ye[this.state.method].request_body?T.default.createElement("div",null,T.default.createElement(se,{className:"interface-edit-item "+this.state.hideTabs.req.body},t("req_body_type",{initialValue:this.state.req_body_type})(T.default.createElement(me,null,T.default.createElement(C.default,{value:"form"},"form"),T.default.createElement(C.default,{value:"json"},"json"),T.default.createElement(C.default,{value:"file"},"file"),T.default.createElement(C.default,{value:"raw"},"raw")))),T.default.createElement(m.default,{className:"interface-edit-item "+("form"===this.props.form.getFieldValue("req_body_type")?this.state.hideTabs.req.body:"hide")},T.default.createElement(h.default,{style:{minHeight:"50px"}},T.default.createElement(m.default,{type:"flex",justify:"space-around"},T.default.createElement(h.default,{span:"12",className:"interface-edit-item"},T.default.createElement(i.default,{size:"small",type:"primary",onClick:function(){return e.addParams("req_body_form")}},"添加form参数")),T.default.createElement(h.default,{span:"12"},T.default.createElement("div",{className:"bulk-import",onClick:function(){return e.showBulk("req_body_form")}},"批量添加"))),T.default.createElement(U.default,{data:function(){return e.props.form.getFieldValue("req_body_form")},onChange:this.handleDragMove("req_body_form"),onlyChild:"easy_drag_sort_child"},k)))):null,T.default.createElement(m.default,{className:"interface-edit-item "+("json"===this.props.form.getFieldValue("req_body_type")?this.state.hideTabs.req.body:"hide")},T.default.createElement("span",null,"JSON-SCHEMA: ",!n.is_json5&&T.default.createElement(s.default,{title:"项目 -> 设置 开启 json5"},T.default.createElement(y.default,{type:"question-circle-o"})," ")),t("req_body_is_json_schema",{valuePropName:"checked",initialValue:this.state.req_body_is_json_schema||!n.is_json5})(T.default.createElement(o.default,{checkedChildren:"开",unCheckedChildren:"关",disabled:!n.is_json5})),T.default.createElement(h.default,{style:{marginTop:"5px"},className:"interface-edit-json-info"},this.props.form.getFieldValue("req_body_is_json_schema")?T.default.createElement(ne,{onChange:function(t){e.setState({req_body_other:t}),(new Date).getTime()-e.startTime>1e3&&ae.props.changeEditStatus(!0)},isMock:!0,data:g}):T.default.createElement("span",null,"基于 Json5, 参数描述信息用注释的方式实现"," ",T.default.createElement(s.default,{title:T.default.createElement("pre",null,ce)},T.default.createElement(y.default,{type:"question-circle-o",style:{color:"#086dbf"}})),"“全局编辑”或 “退出全屏” 请按 F9")),T.default.createElement(h.default,null,!this.props.form.getFieldValue("req_body_is_json_schema")&&T.default.createElement(H.default,{className:"interface-editor",data:this.state.req_body_other,onChange:this.handleReqBody,fullScreen:!0}))),"file"===this.props.form.getFieldValue("req_body_type")&&"hide"!==this.state.hideTabs.req.body?T.default.createElement(m.default,{className:"interface-edit-item"},T.default.createElement(h.default,{className:"interface-edit-item-other-body"},t("req_body_other",{initialValue:this.state.req_body_other})(T.default.createElement(ie,{placeholder:"",autosize:!0})))):null,"raw"===this.props.form.getFieldValue("req_body_type")&&"hide"!==this.state.hideTabs.req.body?T.default.createElement(m.default,null,T.default.createElement(h.default,null,t("req_body_other",{initialValue:this.state.req_body_other})(T.default.createElement(ie,{placeholder:"",autosize:{minRows:8}})))):null),T.default.createElement("h2",{className:"interface-title"},"返回数据设置 ",!n.is_json5&&T.default.createElement(s.default,{title:"项目 -> 设置 开启 json5"},T.default.createElement(y.default,{type:"question-circle-o",className:"tooltip"})," "),t("res_body_is_json_schema",{valuePropName:"checked",initialValue:this.state.res_body_is_json_schema||!n.is_json5})(T.default.createElement(o.default,{checkedChildren:"json-schema",unCheckedChildren:"json",disabled:!n.is_json5}))),T.default.createElement("div",{className:"container-radiogroup"},t("res_body_type",{initialValue:this.state.res_body_type})(T.default.createElement(me,{size:"large",className:"radioGroup"},T.default.createElement(pe,{value:"json"},"JSON"),T.default.createElement(pe,{value:"raw"},"RAW")))),T.default.createElement("div",{className:"panel-sub"},T.default.createElement(m.default,{className:"interface-edit-item",style:{display:"json"===this.props.form.getFieldValue("res_body_type")?"block":"none"}},T.default.createElement(h.default,null,T.default.createElement(D.default,{size:"large",defaultActiveKey:"tpl",onChange:this.handleJsonType},T.default.createElement(le,{tab:"模板",key:"tpl"}),T.default.createElement(le,{tab:"预览",key:"preview"})),T.default.createElement("div",{style:{marginTop:"10px"}},this.props.form.getFieldValue("res_body_is_json_schema")?T.default.createElement("div",{style:{display:"tpl"===this.state.jsonType?"block":"none"}},T.default.createElement(re,{onChange:function(t){e.setState({res_body:t}),(new Date).getTime()-e.startTime>1e3&&ae.props.changeEditStatus(!0)},isMock:!0,data:v})):T.default.createElement("div",{style:{padding:"10px 0",fontSize:"15px"}},T.default.createElement("span",null,"基于 mockjs 和 json5,使用注释方式写参数说明"," ",T.default.createElement(s.default,{title:T.default.createElement("pre",null,ce)},T.default.createElement(y.default,{type:"question-circle-o",style:{color:"#086dbf"}}))," ",",具体使用方法请"," ",T.default.createElement("span",{className:"href",onClick:function(){return window.open("https://yapi.ymfe.org/documents/mock.html","_blank")}},"查看文档")),"，“全局编辑”或 “退出全屏” 请按 ",T.default.createElement("span",{style:{fontWeight:"500"}},"F9")),!this.props.form.getFieldValue("res_body_is_json_schema")&&"tpl"===this.state.jsonType&&T.default.createElement(H.default,{className:"interface-editor",data:this.state.res_body,onChange:this.handleResBody,ref:function(t){return e.resBodyEditor=t},fullScreen:!0}),T.default.createElement("div",{id:"mock-preview",style:{backgroundColor:"#eee",lineHeight:"20px",minHeight:"300px",display:"preview"===this.state.jsonType?"block":"none"}})))),T.default.createElement(m.default,{className:"interface-edit-item",style:{display:"raw"===this.props.form.getFieldValue("res_body_type")?"block":"none"}},T.default.createElement(h.default,null,t("res_body",{initialValue:this.state.res_body})(T.default.createElement(ie,{style:{minHeight:"150px"},placeholder:""}))))),T.default.createElement("h2",{className:"interface-title"},"备 注"),T.default.createElement("div",{className:"panel-sub"},T.default.createElement(se,{className:"interface-edit-item"},T.default.createElement("div",null,T.default.createElement("div",{id:"desc",style:{lineHeight:"20px"},className:"remark-editor"})))),T.default.createElement("h2",{className:"interface-title"},"其 他"),T.default.createElement("div",{className:"panel-sub"},T.default.createElement(se,(0,d.default)({className:"interface-edit-item"},l,{label:T.default.createElement("span",null,"开放接口 ",T.default.createElement(s.default,{title:"用户可以在 数据导出 时选择只导出公开接口"},T.default.createElement(y.default,{type:"question-circle-o",style:{width:"10px"}})))}),t("api_opened",{valuePropName:"checked",initialValue:this.state.api_opened})(T.default.createElement(o.default,{checkedChildren:"开",unCheckedChildren:"关"})))),T.default.createElement(se,{className:"interface-edit-item",style:{textAlign:"center",marginTop:"16px"}},T.default.createElement(u.default,{offsetBottom:14,style:{height:"60px",padding:"0px"}},T.default.createElement(i.default,{className:"interface-edit-submit-button",disabled:this.state.submitStatus,size:"large",htmlType:"submit"},"保存")))))}}]),a}(T.PureComponent),(0,O.default)(I,"propTypes",{custom_field:q.default.object,groupList:q.default.array,form:q.default.object,curdata:q.default.object,mockUrl:q.default.string,onSubmit:q.default.func,basepath:q.default.string,noticed:q.default.bool,cat:q.default.array,changeEditStatus:q.default.func,projectMsg:q.default.object,onTagClick:q.default.func}),S=R))||S,Ee=P.default.create({onValuesChange:function(){ae.props.changeEditStatus(!0)}})(be);t.default=Ee},141:function(e,t,a){"use strict";var r,n,l;n={hooks:r={third_login:{type:"component",mulit:!1,listener:null},import_data:{type:"listener",mulit:!0,listener:[]},export_data:{type:"listener",mulit:!0,listener:[]},interface_tab:{type:"listener",mulit:!0,listener:[]},before_request:{type:"listener",mulit:!0,listener:[]},after_request:{type:"listener",mulit:!0,listener:[]},before_col_request:{type:"listener",mulit:!0,listener:[]},after_col_request:{type:"listener",mulit:!0,listener:[]},header_menu:{type:"listener",mulit:!0,listener:[]},app_route:{type:"listener",mulit:!0,listener:[]},add_reducer:{type:"listener",mulit:!0,listener:[]},sub_nav:{type:"listener",mulit:!0,listener:[]},sub_setting_nav:{type:"listener",mulit:!0,listener:[]}},bindHook:function(e,t){if(!e)throw new Error("缺少hookname");if(e in r==!1)throw new Error("不存在的hookname");!0===r[e].mulit?r[e].listener.push(t):r[e].listener=t},emitHook:function(e){for(var t=arguments.length,a=new Array(t>1?t-1:0),l=1;l<t;l++)a[l-1]=arguments[l];if(!r[e])throw new Error("不存在的hook name");var u=r[e];if(!0===u.mulit&&"listener"===u.type){if(Array.isArray(u.listener)){var o=[];return u.listener.forEach((function(e){"function"==typeof e&&o.push(Promise.resolve(e.call.apply(e,[n].concat(a))))})),Promise.all(o)}}else if(!1===u.mulit&&"listener"===u.type){var c;if("function"==typeof u.listener)return Promise.resolve((c=u.listener).call.apply(c,[n].concat(a)))}else if("component"===u.type)return u.listener}};try{l=a(703)}catch(e){l={}}Object.keys(l).forEach((function(e){if(!l[e])return null;l[e]&&"function"==typeof l[e].module&&l[e].module.call(n,l[e].options)})),e.exports=n},1464:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(9)),u=r(a(10)),o=r(a(23)),c=r(a(11)),i=r(a(12)),s=r(a(13)),d=r(a(5));a(71);var f=r(a(61)),p=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=y(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),m=a(102),h=r(a(0));function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(y=function(e){return e?a:t})(e)}function v(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,s.default)(e);if(t){var n=(0,s.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,i.default)(this,a)}}var g=f.default.Option,b=function(e){(0,c.default)(a,e);var t=v(a);function a(e){var r;return(0,l.default)(this,a),r=t.call(this,e),(0,d.default)((0,o.default)(r),"onChange",(function(e){r.setState({value:e}),r.props.onChange&&r.props.onChange(e)})),(0,d.default)((0,o.default)(r),"user",(function(e){return p.default.createElement(g,{data:e,key:e._id,value:e._id,title:e.username},e.username)})),(0,d.default)((0,o.default)(r),"filter",(function(e){return!r.state.search||0==r.state.search.lenngth||(e.username.indexOf(r.state.search)||e.usernamePinYin.indexOf(r.state.search))})),r.state={loading:!1,users:[],visible:!1},r}return(0,u.default)(a,[{key:"getUserList",value:function(){var e=this;this.setState({loading:!0}),m.axios.get("/api/user/list",{params:{limit:500}}).then((function(t){console.log(t),e.setState({users:t.data.list,loading:!1})}))}},{key:"componentWillMount",value:function(){this.getUserList(),this.setState({value:this.props.value})}},{key:"render",value:function(){return p.default.createElement("div",null,p.default.createElement(f.default,{showSearch:!0,loading:this.state.loading,defaultValue:this.state.value,filterOption:function(e,t){var a=t.props.data;return null!=a&&(-1!=a.username.indexOf(e)||-1!=a.usernamePinYin.indexOf(e))},onChange:this.onChange,optionFilterProp:"title"},this.state.users.map(this.user)))}}]),a}(p.PureComponent);(0,d.default)(b,"propTypes",{onChange:h.default.func,value:h.default.number});var E=b;t.default=E},1469:function(e,t,a){var r=a(1470);"string"==typeof r&&(r=[[e.i,r,""]]);var n={transform:void 0};a(35)(r,n);r.locals&&(e.exports=r.locals)},1470:function(e,t,a){(e.exports=a(34)(!1)).push([e.i,".tui-editor-contents h1 {\n  font-size: 45px;\n  line-height: 1.5;\n  border-bottom: 3px double #999;\n  margin: 52px 0 15px 0;\n  padding-bottom: 7px;\n  color: #000;\n}\n\n.tui-editor-contents h2 {\n  font-size: 34px;\n  line-height: 1.5;\n  border-bottom: 1px solid #dbdbdb;\n  margin: 30px 0 13px 0;\n  padding-bottom: 7px;\n  color: #333;\n}\n\n.tui-editor-contents h3,\n.tui-editor-contents h4 {\n  font-size: 24px;\n  line-height: 1.5;\n  margin: 20px 0 2px;\n  color: #333;\n}\n\n.tui-editor-contents h5,\n.tui-editor-contents h6 {\n  font-size: 16px;\n  line-height: 1.5;\n  margin: 10px 0 -4px;\n  color: #333;\n}\n\n/*\n\ngithub.com style (c) Vasily Polovnyov <vast@whiteants.net>\n\n*/\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  color: #333;\n  background: #f8f8f8;\n}\n\n.hljs-comment,\n.hljs-quote {\n  color: #998;\n  font-style: italic;\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-subst {\n  color: #333;\n  font-weight: bold;\n}\n\n.hljs-number,\n.hljs-literal,\n.hljs-variable,\n.hljs-template-variable,\n.hljs-tag .hljs-attr {\n  color: #008080;\n}\n\n.hljs-string,\n.hljs-doctag {\n  color: #d14;\n}\n\n.hljs-title,\n.hljs-section,\n.hljs-selector-id {\n  color: #900;\n  font-weight: bold;\n}\n\n.hljs-subst {\n  font-weight: normal;\n}\n\n.hljs-type,\n.hljs-class .hljs-title {\n  color: #458;\n  font-weight: bold;\n}\n\n.hljs-tag,\n.hljs-name,\n.hljs-attribute {\n  color: #000080;\n  font-weight: normal;\n}\n\n.hljs-regexp,\n.hljs-link {\n  color: #009926;\n}\n\n.hljs-symbol,\n.hljs-bullet {\n  color: #990073;\n}\n\n.hljs-built_in,\n.hljs-builtin-name {\n  color: #0086b3;\n}\n\n.hljs-meta {\n  color: #999;\n  font-weight: bold;\n}\n\n.hljs-deletion {\n  background: #fdd;\n}\n\n.hljs-addition {\n  background: #dfd;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n\n/* BASICS */\n\n.CodeMirror {\n  /* Set height, width, borders, and global font properties here */\n  font-family: monospace;\n  height: 300px;\n  color: black;\n  direction: ltr;\n}\n\n/* PADDING */\n\n.CodeMirror-lines {\n  padding: 4px 0; /* Vertical padding around content */\n}\n.CodeMirror pre {\n  padding: 0 4px; /* Horizontal padding of content */\n}\n\n.CodeMirror-scrollbar-filler,\n.CodeMirror-gutter-filler {\n  background-color: white; /* The little square between H and V scrollbars */\n}\n\n/* GUTTER */\n\n.CodeMirror-gutters {\n  border-right: 1px solid #ddd;\n  background-color: #f7f7f7;\n  white-space: nowrap;\n}\n\n.CodeMirror-linenumber {\n  padding: 0 3px 0 5px;\n  min-width: 20px;\n  text-align: right;\n  color: #999;\n  white-space: nowrap;\n}\n\n.CodeMirror-guttermarker {\n  color: black;\n}\n.CodeMirror-guttermarker-subtle {\n  color: #999;\n}\n\n/* CURSOR */\n\n.CodeMirror-cursor {\n  border-left: 1px solid black;\n  border-right: none;\n  width: 0;\n}\n/* Shown when moving in bi-directional text */\n.CodeMirror div.CodeMirror-secondarycursor {\n  border-left: 1px solid silver;\n}\n.cm-fat-cursor .CodeMirror-cursor {\n  width: auto;\n  border: 0 !important;\n  background: #7e7;\n}\n.cm-fat-cursor div.CodeMirror-cursors {\n  z-index: 1;\n}\n.cm-fat-cursor-mark {\n  background-color: rgba(20, 255, 20, 0.5);\n  -webkit-animation: blink 1.06s steps(1) infinite;\n  -moz-animation: blink 1.06s steps(1) infinite;\n  animation: blink 1.06s steps(1) infinite;\n}\n.cm-animate-fat-cursor {\n  width: auto;\n  border: 0;\n  -webkit-animation: blink 1.06s steps(1) infinite;\n  -moz-animation: blink 1.06s steps(1) infinite;\n  animation: blink 1.06s steps(1) infinite;\n  background-color: #7e7;\n}\n@-moz-keyframes blink {\n  0% {\n  }\n  50% {\n    background-color: transparent;\n  }\n  100% {\n  }\n}\n@-webkit-keyframes blink {\n  0% {\n  }\n  50% {\n    background-color: transparent;\n  }\n  100% {\n  }\n}\n@keyframes blink {\n  0% {\n  }\n  50% {\n    background-color: transparent;\n  }\n  100% {\n  }\n}\n\n/* Can style cursor different in overwrite (non-insert) mode */\n/* .CodeMirror-overwrite .CodeMirror-cursor {\n} */\n\n.cm-tab {\n  display: inline-block;\n  text-decoration: inherit;\n}\n\n.CodeMirror-rulers {\n  position: absolute;\n  left: 0;\n  right: 0;\n  top: -50px;\n  bottom: -20px;\n  overflow: hidden;\n}\n.CodeMirror-ruler {\n  border-left: 1px solid #ccc;\n  top: 0;\n  bottom: 0;\n  position: absolute;\n}\n\n/* DEFAULT THEME */\n\n.cm-s-default .cm-header {\n  color: blue;\n}\n.cm-s-default .cm-quote {\n  color: #090;\n}\n.cm-negative {\n  color: #d44;\n}\n.cm-positive {\n  color: #292;\n}\n.cm-header,\n.cm-strong {\n  font-weight: bold;\n}\n.cm-em {\n  font-style: italic;\n}\n.cm-link {\n  text-decoration: underline;\n}\n.cm-strikethrough {\n  text-decoration: line-through;\n}\n\n.cm-s-default .cm-keyword {\n  color: #708;\n}\n.cm-s-default .cm-atom {\n  color: #219;\n}\n.cm-s-default .cm-number {\n  color: #164;\n}\n.cm-s-default .cm-def {\n  color: #00f;\n}\n/* .cm-s-default .cm-variable,\n.cm-s-default .cm-punctuation,\n.cm-s-default .cm-property,\n.cm-s-default .cm-operator {\n} */\n.cm-s-default .cm-variable-2 {\n  color: #05a;\n}\n.cm-s-default .cm-variable-3,\n.cm-s-default .cm-type {\n  color: #085;\n}\n.cm-s-default .cm-comment {\n  color: #a50;\n}\n.cm-s-default .cm-string {\n  color: #a11;\n}\n.cm-s-default .cm-string-2 {\n  color: #f50;\n}\n.cm-s-default .cm-meta {\n  color: #555;\n}\n.cm-s-default .cm-qualifier {\n  color: #555;\n}\n.cm-s-default .cm-builtin {\n  color: #30a;\n}\n.cm-s-default .cm-bracket {\n  color: #997;\n}\n.cm-s-default .cm-tag {\n  color: #170;\n}\n.cm-s-default .cm-attribute {\n  color: #00c;\n}\n.cm-s-default .cm-hr {\n  color: #999;\n}\n.cm-s-default .cm-link {\n  color: #00c;\n}\n\n.cm-s-default .cm-error {\n  color: #f00;\n}\n.cm-invalidchar {\n  color: #f00;\n}\n\n.CodeMirror-composing {\n  border-bottom: 2px solid;\n}\n\n/* Default styles for common addons */\n\ndiv.CodeMirror span.CodeMirror-matchingbracket {\n  color: #0b0;\n}\ndiv.CodeMirror span.CodeMirror-nonmatchingbracket {\n  color: #a22;\n}\n.CodeMirror-matchingtag {\n  background: rgba(255, 150, 0, 0.3);\n}\n.CodeMirror-activeline-background {\n  background: #e8f2ff;\n}\n\n/* STOP */\n\n/* The rest of this file contains styles related to the mechanics of\n   the editor. You probably shouldn't touch them. */\n\n.CodeMirror {\n  position: relative;\n  overflow: hidden;\n  background: white;\n}\n\n.CodeMirror-scroll {\n  overflow: scroll !important; /* Things will break if this is overridden */\n  /* 30px is the magic margin used to hide the element's real scrollbars */\n  /* See overflow: hidden in .CodeMirror */\n  margin-bottom: -30px;\n  margin-right: -30px;\n  padding-bottom: 30px;\n  height: 100%;\n  outline: none; /* Prevent dragging from highlighting the element */\n  position: relative;\n}\n.CodeMirror-sizer {\n  position: relative;\n  border-right: 30px solid transparent;\n}\n\n/* The fake, visible scrollbars. Used to force redraw during scrolling\n   before actual scrolling happens, thus preventing shaking and\n   flickering artifacts. */\n.CodeMirror-vscrollbar,\n.CodeMirror-hscrollbar,\n.CodeMirror-scrollbar-filler,\n.CodeMirror-gutter-filler {\n  position: absolute;\n  z-index: 6;\n  display: none;\n}\n.CodeMirror-vscrollbar {\n  right: 0;\n  top: 0;\n  overflow-x: hidden;\n  overflow-y: scroll;\n}\n.CodeMirror-hscrollbar {\n  bottom: 0;\n  left: 0;\n  overflow-y: hidden;\n  overflow-x: scroll;\n}\n.CodeMirror-scrollbar-filler {\n  right: 0;\n  bottom: 0;\n}\n.CodeMirror-gutter-filler {\n  left: 0;\n  bottom: 0;\n}\n\n.CodeMirror-gutters {\n  position: absolute;\n  left: 0;\n  top: 0;\n  min-height: 100%;\n  z-index: 3;\n}\n.CodeMirror-gutter {\n  white-space: normal;\n  height: 100%;\n  display: inline-block;\n  vertical-align: top;\n  margin-bottom: -30px;\n}\n.CodeMirror-gutter-wrapper {\n  position: absolute;\n  z-index: 4;\n  background: none !important;\n  border: none !important;\n}\n.CodeMirror-gutter-background {\n  position: absolute;\n  top: 0;\n  bottom: 0;\n  z-index: 4;\n}\n.CodeMirror-gutter-elt {\n  position: absolute;\n  cursor: default;\n  z-index: 4;\n}\n.CodeMirror-gutter-wrapper ::selection {\n  background-color: transparent;\n}\n.CodeMirror-gutter-wrapper ::-moz-selection {\n  background-color: transparent;\n}\n\n.CodeMirror-lines {\n  cursor: text;\n  min-height: 1px; /* prevents collapsing before first draw */\n}\n.CodeMirror pre {\n  /* Reset some styles that the rest of the page might have set */\n  -moz-border-radius: 0;\n  -webkit-border-radius: 0;\n  border-radius: 0;\n  border-width: 0;\n  background: transparent;\n  font-family: inherit;\n  font-size: inherit;\n  margin: 0;\n  white-space: pre;\n  word-wrap: normal;\n  line-height: inherit;\n  color: inherit;\n  z-index: 2;\n  position: relative;\n  overflow: visible;\n  -webkit-tap-highlight-color: transparent;\n  -webkit-font-variant-ligatures: contextual;\n  font-variant-ligatures: contextual;\n}\n.CodeMirror-wrap pre {\n  word-wrap: break-word;\n  white-space: pre-wrap;\n  word-break: normal;\n}\n\n.CodeMirror-linebackground {\n  position: absolute;\n  left: 0;\n  right: 0;\n  top: 0;\n  bottom: 0;\n  z-index: 0;\n}\n\n.CodeMirror-linewidget {\n  position: relative;\n  z-index: 2;\n  padding: 0.1px; /* Force widget margins to stay inside of the container */\n}\n\n/* .CodeMirror-widget {\n} */\n\n.CodeMirror-rtl pre {\n  direction: rtl;\n}\n\n.CodeMirror-code {\n  outline: none;\n}\n\n/* Force content-box sizing for the elements where we expect it */\n.CodeMirror-scroll,\n.CodeMirror-sizer,\n.CodeMirror-gutter,\n.CodeMirror-gutters,\n.CodeMirror-linenumber {\n  -moz-box-sizing: content-box;\n  box-sizing: content-box;\n}\n\n.CodeMirror-measure {\n  position: absolute;\n  width: 100%;\n  height: 0;\n  overflow: hidden;\n  visibility: hidden;\n}\n\n.CodeMirror-cursor {\n  position: absolute;\n  pointer-events: none;\n}\n.CodeMirror-measure pre {\n  position: static;\n}\n\ndiv.CodeMirror-cursors {\n  visibility: hidden;\n  position: relative;\n  z-index: 3;\n}\ndiv.CodeMirror-dragcursors {\n  visibility: visible;\n}\n\n.CodeMirror-focused div.CodeMirror-cursors {\n  visibility: visible;\n}\n\n.CodeMirror-selected {\n  background: #d9d9d9;\n}\n.CodeMirror-focused .CodeMirror-selected {\n  background: #d7d4f0;\n}\n.CodeMirror-crosshair {\n  cursor: crosshair;\n}\n.CodeMirror-line::selection,\n.CodeMirror-line > span::selection,\n.CodeMirror-line > span > span::selection {\n  background: #d7d4f0;\n}\n.CodeMirror-line::-moz-selection,\n.CodeMirror-line > span::-moz-selection,\n.CodeMirror-line > span > span::-moz-selection {\n  background: #d7d4f0;\n}\n\n.cm-searching {\n  background-color: #ffa;\n  background-color: rgba(255, 255, 0, 0.4);\n}\n\n/* Used to force a border model for a node */\n.cm-force-border {\n  padding-right: 0.1px;\n}\n\n@media print {\n  /* Hide the cursor when printing */\n  .CodeMirror div.CodeMirror-cursors {\n    visibility: hidden;\n  }\n}\n\n/* See issue #2901 */\n.cm-tab-wrap-hack:after {\n  content: '';\n}\n\n/* Help users use markselection to safely style text background */\nspan.CodeMirror-selectedtext {\n  background: none;\n}\n",""])},1471:function(e,t,a){},1472:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(633);var l=r(a(634));a(55);var u=r(a(45));a(144);var o=r(a(166));a(123);var c=r(a(126));a(36);var i=r(a(4));a(236);var s=r(a(244));a(38);var d=r(a(39)),f=r(a(9)),p=r(a(10)),m=r(a(23)),h=r(a(11)),y=r(a(12)),v=r(a(13)),g=r(a(5));a(125);var b=r(a(110));a(1475);var E,_,k,j=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=D(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),w=a(22),O=r(a(0)),C=r(a(165)),x=a(68),P=r(a(204)),N=r(a(72)),M=r(a(72)),S=r(a(415)),I=r(a(1477)),R=r(a(635));function D(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(D=function(e){return e?a:t})(e)}function T(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,v.default)(e);if(t){var n=(0,v.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,y.default)(this,a)}}var q=b.default.TabPane,L=M.default.HTTP_METHOD,A=(0,w.connect)((function(e){return{curData:e.inter.curdata,custom_field:e.group.field,currProject:e.project.currProject}}))((k=_=function(e){(0,h.default)(a,e);var t=T(a);function a(e){var r;return(0,f.default)(this,a),r=t.call(this,e),(0,g.default)((0,m.default)(r),"enterItem",(function(){r.setState({enter:!0})})),(0,g.default)((0,m.default)(r),"leaveItem",(function(){r.setState({enter:!1})})),(0,g.default)((0,m.default)(r),"copyUrl",(function(e){(0,S.default)(e),d.default.success("已经成功复制到剪切板")})),(0,g.default)((0,m.default)(r),"flagMsg",(function(e,t){return e&&t?j.default.createElement("span",null,"( 全局mock & 严格模式 )"):!e&&t?j.default.createElement("span",null,"( 严格模式 )"):e&&!t?j.default.createElement("span",null,"( 全局mock )"):void 0})),(0,g.default)((0,m.default)(r),"identityTypeHandler",(function(e){return console.log(e),"none"===e?j.default.createElement(s.default,null,"未登录"):"tourist"===e?j.default.createElement(s.default,null,"游客账户"):"certified"===e?j.default.createElement(s.default,{color:"red"},j.default.createElement(i.default,{type:"exclamation"}),"正式账户"):void 0})),r.state={init:!0,enter:!1},r}return(0,p.default)(a,[{key:"req_body_form",value:function(e,t){if("form"===e){var a=[{title:"参数名称",dataIndex:"name",key:"name",width:140},{title:"参数类型",dataIndex:"type",key:"type",width:100,render:function(e){return"text"===(e=e||"").toLowerCase()?j.default.createElement("span",null,j.default.createElement("i",{className:"query-icon text"},"T"),"文本"):j.default.createElement("span",null,j.default.createElement(i.default,{type:"file",className:"query-icon"}),"文件")}},{title:"是否必须",dataIndex:"required",key:"required",width:100,render:function(e){}},{title:"示例",dataIndex:"example",key:"example",width:80,render:function(e,t){return j.default.createElement("p",{style:{whiteSpace:"pre-wrap"}},t.example)}},{title:"备注",dataIndex:"value",key:"value",render:function(e,t){return j.default.createElement("p",{style:{whiteSpace:"pre-wrap"}},t.value)}}],r=[];return t&&t.length&&t.map((function(e,t){r.push({key:t,name:e.name,value:e.desc,example:e.example,required:0==e.required?"否":"是",type:e.type})})),j.default.createElement("div",{style:{display:r.length?"":"none"},className:"colBody"},j.default.createElement(c.default,{bordered:!0,size:"small",pagination:!1,columns:a,dataSource:r}))}}},{key:"res_body",value:function(e,t,a){return"json"===e?a?j.default.createElement(I.default,{dataSource:t}):j.default.createElement("div",{className:"colBody"},j.default.createElement(C.default,{data:t,readOnly:!0,style:{minHeight:600}})):"raw"===e?j.default.createElement("div",{className:"colBody"},j.default.createElement(C.default,{data:t,readOnly:!0,mode:"text",style:{minHeight:300}})):void 0}},{key:"req_body",value:function(e,t,a){if(t)return a&&"json"===e?j.default.createElement(I.default,{dataSource:t}):j.default.createElement("div",{className:"colBody"},j.default.createElement(C.default,{data:t,readOnly:!0,style:{minHeight:300},mode:"json"===e?"javascript":"text"}))}},{key:"req_query",value:function(e){var t=[{title:"参数名称",dataIndex:"name",width:140,key:"name"},{title:"是否必须",width:100,dataIndex:"required",key:"required"},{title:"示例",dataIndex:"example",key:"example",width:80,render:function(e,t){return j.default.createElement("p",{style:{whiteSpace:"pre-wrap"}},t.example)}},{title:"备注",dataIndex:"value",key:"value",render:function(e,t){return j.default.createElement("p",{style:{whiteSpace:"pre-wrap"}},t.value)}}],a=[];return e&&e.length&&e.map((function(e,t){a.push({key:t,name:e.name,value:e.desc,example:e.example,required:0==e.required?"否":j.default.createElement("span",{style:{color:"#FF274F"}},"是")})})),j.default.createElement(c.default,{bordered:!0,size:"small",pagination:!1,columns:t,dataSource:a})}},{key:"countEnter",value:function(e){var t=0,a=0;if(!e||!e.indexOf)return 0;for(;e.indexOf("\n",t)>-1;)t=e.indexOf("\n",t)+2,a++;return a}},{key:"componentDidMount",value:function(){!this.props.curData.title&&this.state.init&&this.setState({init:!1})}},{key:"render",value:function(){var e=this,t=[];this.props.curData.req_headers&&this.props.curData.req_headers.length&&this.props.curData.req_headers.map((function(e,a){t.push({key:a,name:e.name,required:0==e.required?"否":"是",value:e.value,example:e.example,desc:e.desc})}));var a=[];this.props.curData.req_params&&this.props.curData.req_params.length&&this.props.curData.req_params.map((function(e,t){a.push({key:t,name:e.name,desc:e.desc,example:e.example})}));var r=[{title:"参数名称",dataIndex:"name",key:"name",width:140},{title:"示例",dataIndex:"example",key:"example",width:80,render:function(e,t){return j.default.createElement("p",{style:{whiteSpace:"pre-wrap"}},t.example)}},{title:"备注",dataIndex:"desc",key:"desc",render:function(e,t){return j.default.createElement("p",{style:{whiteSpace:"pre-wrap"}},t.desc)}}],n=[{title:"参数名称",dataIndex:"name",key:"name",width:"200px"},{title:"参数值",dataIndex:"value",key:"value",width:"300px"},{title:"是否必须",dataIndex:"required",key:"required",width:"100px"},{title:"示例",dataIndex:"example",key:"example",width:"80px",render:function(e,t){return j.default.createElement("p",{style:{whiteSpace:"pre-wrap"}},t.example)}},{title:"备注",dataIndex:"desc",key:"desc",render:function(e,t){return j.default.createElement("p",{style:{whiteSpace:"pre-wrap"}},t.desc)}}],d=this.props.curData.req_body_other||"form"===this.props.curData.req_body_type&&this.props.curData.req_body_form&&this.props.curData.req_body_form.length,f=t&&t.length||a&&a.length||this.props.curData.req_query&&this.props.curData.req_query.length||d,p=N.default.METHOD_COLOR[this.props.curData.method?this.props.curData.method.toLowerCase():"get"];p||(p="get");var m=this.props.curData,h=(m.tag,m.up_time),y=m.title,v=(m.uid,m.username),g=j.default.createElement("div",{className:"caseContainer",style:{height:"100%",overflowY:"auto"}},j.default.createElement("div",null,j.default.createElement("div",{style:{alignItems:"center",justifyContent:"space-between",flexDirection:"row",display:"flex"}},j.default.createElement("div",{style:{display:"flex",flexDirection:"row"}},j.default.createElement("span",{style:{color:"#fff",backgroundColor:"#8189A1"},className:"colValue tag-method"},"HTTP"),j.default.createElement("span",{style:{color:p.color,backgroundColor:p.bac},className:"colValue tag-method"},this.props.curData.method),j.default.createElement("span",{style:{marginLeft:"6px"},className:"tag-status "+this.props.curData.status},{undone:"未完成",done:"已完成",invalid:"废弃"}[this.props.curData.status])),j.default.createElement("div",{style:{display:"flex",flexDirection:"row",right:"20px",height:"23px",clear:"both"}},j.default.createElement(o.default,{content:"查看历史"},j.default.createElement(R.default,{type:"yapi-history1",height:"40",style:{fontSize:"24px"},onClick:function(){console.log("==")}})),j.default.createElement(o.default,{content:"编辑"},j.default.createElement(R.default,{type:"yapi-icon_edit_edit",height:"40",style:{fontSize:"24px",marginLeft:"10px"},onClick:function(){console.log("==")}})))),j.default.createElement("div",{className:"colValue",style:{marginTop:"10px",fontSize:"22px",lineHeight:"32px",color:"#000"},onMouseEnter:this.enterItem,onMouseLeave:this.leaveItem},this.props.curData.path,j.default.createElement(u.default,{title:"复制路径"},j.default.createElement(i.default,{type:"copy",className:"interface-url-icon",onClick:function(){return e.copyUrl(e.props.currProject.basepath+e.props.curData.path)},style:{display:this.state.enter?"inline-block":"none"}}))),j.default.createElement("div",{style:{fontSize:"16px",marginTop:"6px"}},y),j.default.createElement("div",{style:{marginTop:"20px",color:"#8189A1"}},j.default.createElement("span",{style:{marginRight:"30px"}},j.default.createElement("span",{className:"h4"},"负责人: "),this.props.curData.connUsername," "),j.default.createElement("span",{style:{marginRight:"30px"}},j.default.createElement("span",{className:"h4"},"创建人:")," ",v," "),j.default.createElement("span",{style:{marginRight:"30px"}},j.default.createElement("span",{className:"h4"},"更新时间:")," ",(0,x.formatTime)(h)," ")),j.default.createElement("div",{style:{height:"40px",marginTop:"10px"}},j.default.createElement("span",{className:"h4"},j.default.createElement(o.default,{content:j.default.createElement("div",null,j.default.createElement("p",{style:{fontWeight:500,color:"#000"}},"针对APP访问接口权限，不是接口文档的权限"),j.default.createElement("p",null,"1.未登录：没有登录也可以访问该接口"),j.default.createElement("p",null,"2.游客账户：游客账户也可以访问该接口，例如某些游客账户也记录数据到云端"),j.default.createElement("p",null,"3.正式账户：正式账户"))},"访问权限",j.default.createElement(i.default,{type:"question-circle-o",style:{width:"10px"}}))," ："),this.props.curData.identityType&&this.props.curData.identityType.length>0?this.props.curData.identityType.map(this.identityTypeHandler):"未设置")),j.default.createElement(l.default,null),j.default.createElement("h3",{className:"interface-title",style:{display:f?"":"none"}},"请求参数"),a.length?j.default.createElement("div",{className:"colHeader"},j.default.createElement("h3",{className:"col-title"},"路径参数："),j.default.createElement(c.default,{bordered:!0,size:"small",pagination:!1,columns:r,dataSource:a})):"",t.length?j.default.createElement("div",{className:"colHeader"},j.default.createElement("h3",{className:"col-title"},"Headers："),j.default.createElement(c.default,{bordered:!0,size:"small",pagination:!1,columns:n,dataSource:t})):"",this.props.curData.req_query&&this.props.curData.req_query.length?j.default.createElement("div",{className:"colQuery"},j.default.createElement("h3",{className:"col-title"},"Query："),this.req_query(this.props.curData.req_query)):"",j.default.createElement("div",{style:{display:this.props.curData.method&&L[this.props.curData.method.toUpperCase()].request_body?"":"none"}},j.default.createElement("h3",{style:{display:d?"":"none"},className:"col-title"},"Body: ",j.default.createElement(s.default,{color:"#303445"},this.props.curData.req_body_type)),j.default.createElement(b.default,{defaultActiveKey:"req-1"},j.default.createElement(q,{tab:"表格",key:"req-1"},"form"===this.props.curData.req_body_type?this.req_body_form(this.props.curData.req_body_type,this.props.curData.req_body_form):this.req_body(this.props.curData.req_body_type,this.props.curData.req_body_other,this.props.curData.req_body_is_json_schema)),j.default.createElement(q,{tab:j.default.createElement("span",null,"JSON ",j.default.createElement(s.default,{color:"geekblue"},"beta")),key:"req-2"},j.default.createElement("div",{className:"colBody"},j.default.createElement(C.default,{data:this.props.curData.req_body_other_json?this.props.curData.req_body_other_json:"",readOnly:!0,style:{minHeight:200}}))))),j.default.createElement("div",null,j.default.createElement("h3",{className:"interface-title"},"返回参数"," ",j.default.createElement(s.default,{color:"#303445"},this.props.curData.res_body_type)),j.default.createElement(b.default,{defaultActiveKey:"1"},j.default.createElement(q,{tab:"表格",key:"1"},this.res_body(this.props.curData.res_body_type,this.props.curData.res_body,this.props.curData.res_body_is_json_schema)),j.default.createElement(q,{tab:j.default.createElement("span",null,"JSON ",j.default.createElement(s.default,{color:"geekblue"},"beta")),key:"2"},j.default.createElement("div",{className:"colBody"},j.default.createElement(C.default,{data:this.props.curData.res_body_json?this.props.curData.res_body_json:"",readOnly:!0,style:{minHeight:600}}))))),j.default.createElement("div",null,j.default.createElement(l.default,null),this.props.curData.desc&&j.default.createElement("h3",{className:"interface-title"},"说明"),this.props.curData.desc&&j.default.createElement("div",{className:"tui-editor-contents",style:{margin:"0px",padding:"0px 20px",float:"none"},dangerouslySetInnerHTML:{__html:this.props.curData.desc}})));return this.props.curData.title||(g=this.state.init?j.default.createElement("div",null):j.default.createElement(P.default,{type:"noData"})),g}}]),a}(j.PureComponent),(0,g.default)(_,"propTypes",{curData:O.default.object,currProject:O.default.object,custom_field:O.default.object}),E=k))||E;t.default=A},1475:function(e,t,a){},1477:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(123);var l=r(a(126)),u=r(a(9)),o=r(a(10)),c=r(a(11)),i=r(a(12)),s=r(a(13)),d=r(a(5)),f=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=v(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),p=r(a(143)),m=r(a(0)),h=a(1478),y=r(a(79));function v(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(v=function(e){return e?a:t})(e)}function g(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,s.default)(e);if(t){var n=(0,s.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,i.default)(this,a)}}a(1479);var b={desc:"备注",default:"实例",maximum:"最大值",minimum:"最小值",maxItems:"最大数量",minItems:"最小数量",maxLength:"最大长度",minLength:"最小长度",enum:"枚举",enumDesc:"枚举备注",uniqueItems:"元素是否都不同",itemType:"item 类型",format:"format",itemFormat:"format",mock:"mock"},E=[{title:"名称",dataIndex:"name",key:"name",width:300},{title:"类型",dataIndex:"type",key:"type",width:100,render:function(e,t){return"array"===e?f.default.createElement("span",null,t.sub?t.sub.itemType||"":"array"," []"):f.default.createElement("span",null,e)}},{title:"是否必须",dataIndex:"required",key:"required",width:80,render:function(e){return e?f.default.createElement("div",{style:{color:"#FF274F"}},"必须"):f.default.createElement("div",null,"非必须")}},{title:"默认值",dataIndex:"default",key:"default",width:80,render:function(e){return f.default.createElement("div",null,y.default.isBoolean(e)?e+"":e)}},{title:"备注",dataIndex:"desc",key:"desc",render:function(e,t){return y.default.isUndefined(t.childrenDesc)?f.default.createElement("span",{className:"table-desc"},e):f.default.createElement("span",{className:"table-desc"},t.childrenDesc)}},{title:"其他信息",dataIndex:"sub",key:"sub",width:200,render:function(e,t){var a=e||t;return Object.keys(a).map((function(e,t){var r=b[e],n=a[e];return!y.default.isUndefined(a[e])&&!y.default.isUndefined(r)&&f.default.createElement("p",{key:t},f.default.createElement("span",{style:{fontWeight:"700"}},r,": "),f.default.createElement("span",null,n.toString()))}))}}],_=function(e){(0,c.default)(a,e);var t=g(a);function a(e){return(0,u.default)(this,a),t.call(this,e)}return(0,o.default)(a,[{key:"render",value:function(){var e;try{e=p.default.parse(this.props.dataSource)}catch(t){e=null}if(!e)return null;var t=(0,h.schemaTransformToTable)(e);return t=y.default.isArray(t)?t:[],f.default.createElement(l.default,{bordered:!0,size:"small",defaultExpandAllRows:!0,pagination:!1,dataSource:t,columns:E})}}]),a}(f.Component);(0,d.default)(_,"propTypes",{dataSource:m.default.string});var k=_;t.default=k},1478:function(e,t,a){"use strict";var r=a(79),n=1;function l(e){var t=Object.assign({},e);return r.isUndefined(e.type)&&r.isObject(e.properties)&&(t.type="object"),t}t.schemaTransformToTable=function(e){try{e=l(e);var t=c(e,0);return t=r.isArray(t)?t:[t]}catch(e){console.log(e)}};var u=function(e,t){switch(e.type){case"string":return s(e);case"number":return f(e);case"array":return d(e,t);case"object":return i(e,t);case"boolean":return m(e);case"integer":return p(e);default:return h(e)}},o=function(e,t){return[e,t].join("\n").trim()},c=function(e,t){var a=u(e,t);if("object"!==e.type){var n=a.desc,l=a.default,o=a.children;delete a.desc,delete a.default,delete a.children;var c={type:e.type,key:t,desc:n,default:l,sub:a};return r.isArray(o)&&(c=Object.assign({},c,{children:o})),c}return a},i=function(e,t){var a=e.properties,n=e.required;a=a||{},n=n||[];var u=[];return Object.keys(a).map((function(e,i){var s=a[e],d=l(JSON.parse(JSON.stringify(s))),f=c(d,t+"-"+i),p={name:e,key:t+"-"+i,desc:o(d.title,d.description),required:-1!=n.indexOf(e)};"object"===s.type||r.isUndefined(s.type)&&r.isArray(f)?delete(p=Object.assign({},p,{type:"object",children:f})).sub:p=Object.assign({},p,f),u.push(p)})),u},s=function(e){return{desc:o(e.title,e.description),default:e.default,maxLength:e.maxLength,minLength:e.minLength,enum:e.enum,enumDesc:e.enumDesc,format:e.format,mock:e.mock&&e.mock.mock}},d=function(e,t){e.items=e.items||{type:"string"};var a=l(e.items),c=u(a,t),i=c;r.isArray(c)||r.isUndefined(c)||(c.key="array-"+n++,i=[c]);var s={desc:o(e.title,e.description),default:e.default,minItems:e.minItems,uniqueItems:e.uniqueItems,maxItems:e.maxItems,itemType:a.type,children:i};return"string"===a.type&&(s=Object.assign({},s,{itemFormat:a.format})),s},f=function(e){return{desc:o(e.title,e.description),maximum:e.maximum,minimum:e.minimum,default:e.default,format:e.format,enum:e.enum,enumDesc:e.enumDesc,mock:e.mock&&e.mock.mock}},p=function(e){return{desc:o(e.title,e.description),maximum:e.maximum,minimum:e.minimum,default:e.default,format:e.format,enum:e.enum,enumDesc:e.enumDesc,mock:e.mock&&e.mock.mock}},m=function(e){return{desc:o(e.title,e.description),default:e.default,enum:e.enum,mock:e.mock&&e.mock.mock}},h=function(e){return{desc:o(e.title,e.description),default:e.default,mock:e.mock&&e.mock.mock}}},1479:function(e,t,a){},1480:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(30));a(38);var u,o,c,i=r(a(39)),s=r(a(7)),d=r(a(31)),f=r(a(9)),p=r(a(10)),m=r(a(23)),h=r(a(11)),y=r(a(12)),v=r(a(13)),g=r(a(5)),b=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=C(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),E=r(a(0)),_=a(22),k=a(40),j=r(a(44)),w=a(397),O=r(a(1481));r(a(636));function C(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(C=function(e){return e?a:t})(e)}function x(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,v.default)(e);if(t){var n=(0,v.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,y.default)(this,a)}}a(1496);var P=(0,_.connect)((function(e){return{currInterface:e.inter.curdata,currProject:e.project.currProject,curUid:e.user.uid}}))(u=(0,k.withRouter)((c=o=function(e){(0,h.default)(a,e);var t=x(a);function a(e){var r;return(0,f.default)(this,a),r=t.call(this,e),(0,g.default)((0,m.default)(r),"state",{}),(0,g.default)((0,m.default)(r),"savePostmanRef",(function(e){r.postman=e})),(0,g.default)((0,m.default)(r),"saveCase",function(){var e=(0,d.default)(l.default.mark((function e(t,a){var n,u,o,c,d,f,p,m,h,y,v,g;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.props.match.params.id,u=r.props.currInterface._id,o=r.postman.state,c=o.case_env,d=o.req_params,f=o.req_query,p=o.req_headers,m=o.req_body_type,h=o.req_body_form,y=o.req_body_other,(v={interface_id:u,casename:a,col_id:t,project_id:n,case_env:c,req_params:d,req_query:f,req_headers:p,req_body_type:m,req_body_form:h,req_body_other:y}).test_res_body&&"object"===(0,s.default)(v.test_res_body)&&(v.test_res_body=JSON.stringify(v.test_res_body,null,"   ")),e.next=7,j.default.post("/api/col/add_case",v);case 7:(g=e.sent).data.errcode?i.default.error(g.data.errmsg):(i.default.success("添加成功"),r.setState({saveCaseModalVisible:!1}));case 9:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}()),r}return(0,p.default)(a,[{key:"componentWillMount",value:function(){}},{key:"componentWillReceiveProps",value:function(){}},{key:"render",value:function(){var e=this,t=this.props,a=t.currInterface,r=t.currProject,n=Object.assign({},a,{env:r.env,pre_script:r.pre_script,after_script:r.after_script});return n.path=r.basepath+a.path,b.default.createElement("div",null,b.default.createElement(w.Postman,{data:n,id:r._id,type:"inter",saveTip:"保存到集合",save:function(){return e.setState({saveCaseModalVisible:!0})},ref:this.savePostmanRef,interfaceId:a._id,projectId:a.project_id,curUid:this.props.curUid}),b.default.createElement(O.default,{visible:this.state.saveCaseModalVisible,caseName:a.title,onCancel:function(){return e.setState({saveCaseModalVisible:!1})},onOk:this.saveCase}))}}]),a}(b.default.Component),(0,g.default)(o,"propTypes",{currProject:E.default.object,currInterface:E.default.object,match:E.default.object,curUid:E.default.number}),u=c))||u)||u;t.default=P},1481:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(30));a(53);var u=r(a(54));a(33);var o=r(a(25));a(36);var c=r(a(4));a(57);var i=r(a(51));a(64);var s=r(a(49));a(38);var d=r(a(39)),f=r(a(31)),p=r(a(9)),m=r(a(10)),h=r(a(23)),y=r(a(11)),v=r(a(12)),g=r(a(13)),b=r(a(5));a(295);var E=r(a(312));a(48);var _,k,j,w=r(a(47)),O=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=S(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),C=a(22),x=r(a(0)),P=r(a(44)),N=a(40),M=a(167);function S(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(S=function(e){return e?a:t})(e)}function I(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,g.default)(e);if(t){var n=(0,g.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,v.default)(this,a)}}var R=w.default.TextArea,D=E.default.Panel,T=(0,C.connect)((function(e){return{interfaceColList:e.interfaceCol.interfaceColList}}),{fetchInterfaceColList:M.fetchInterfaceColList})(_=(0,N.withRouter)((j=k=function(e){(0,y.default)(a,e);var t=I(a);function a(e){var r;return(0,p.default)(this,a),r=t.call(this,e),(0,b.default)((0,h.default)(r),"state",{visible:!1,addColName:"",addColDesc:"",id:0,caseName:""}),(0,b.default)((0,h.default)(r),"addCol",(0,f.default)(l.default.mark((function e(){var t,a,n,u,o;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.state,a=t.addColName,n=t.addColDesc,u=r.props.match.params.id,e.next=4,P.default.post("/api/col/add_col",{name:a,desc:n,project_id:u});case 4:if((o=e.sent).data.errcode){e.next=12;break}return d.default.success("添加集合成功"),e.next=9,r.props.fetchInterfaceColList(u);case 9:r.setState({id:o.data.data._id}),e.next=13;break;case 12:d.default.error(o.data.errmsg);case 13:case"end":return e.stop()}}),e)})))),(0,b.default)((0,h.default)(r),"select",(function(e){r.setState({id:e})})),r}return(0,m.default)(a,[{key:"componentWillMount",value:function(){this.props.fetchInterfaceColList(this.props.match.params.id),this.setState({caseName:this.props.caseName})}},{key:"componentWillReceiveProps",value:function(e){this.setState({id:e.interfaceColList[0]._id}),this.setState({caseName:e.caseName})}},{key:"render",value:function(){var e=this,t=this.props.interfaceColList,a=void 0===t?[]:t,r=this.state.id;return O.default.createElement(u.default,{className:"add-col-modal",title:"添加到集合",visible:this.props.visible,onOk:function(){return e.props.onOk(r,e.state.caseName)},onCancel:this.props.onCancel},O.default.createElement(i.default,{gutter:6,className:"modal-input"},O.default.createElement(s.default,{span:5},O.default.createElement("div",{className:"label"},"接口用例名：")),O.default.createElement(s.default,{span:15},O.default.createElement(w.default,{placeholder:"请输入接口用例名称",value:this.state.caseName,onChange:function(t){return e.setState({caseName:t.target.value})}}))),O.default.createElement("p",null,"请选择添加到的集合："),O.default.createElement("ul",{className:"col-list"},a.length?a.map((function(t){return O.default.createElement("li",{key:t._id,className:"col-item ".concat(t._id===r?"selected":""),onClick:function(){return e.select(t._id)}},O.default.createElement(c.default,{type:"folder-open",style:{marginRight:6}}),t.name)})):O.default.createElement("span",null,"暂无集合，请添加！")),O.default.createElement(E.default,null,O.default.createElement(D,{header:"添加新集合"},O.default.createElement(i.default,{gutter:6,className:"modal-input"},O.default.createElement(s.default,{span:5},O.default.createElement("div",{className:"label"},"集合名：")),O.default.createElement(s.default,{span:15},O.default.createElement(w.default,{placeholder:"请输入集合名称",value:this.state.addColName,onChange:function(t){return e.setState({addColName:t.target.value})}}))),O.default.createElement(i.default,{gutter:6,className:"modal-input"},O.default.createElement(s.default,{span:5},O.default.createElement("div",{className:"label"},"简介：")),O.default.createElement(s.default,{span:15},O.default.createElement(R,{rows:3,placeholder:"请输入集合描述",value:this.state.addColDesc,onChange:function(t){return e.setState({addColDesc:t.target.value})}}))),O.default.createElement(i.default,{type:"flex",justify:"end"},O.default.createElement(o.default,{style:{float:"right"},type:"primary",onClick:this.addCol},"添 加")))))}}]),a}(O.PureComponent),(0,b.default)(k,"propTypes",{visible:x.default.bool,interfaceColList:x.default.array,fetchInterfaceColList:x.default.func,match:x.default.object,onOk:x.default.func,onCancel:x.default.func,caseName:x.default.string}),_=j))||_)||_;t.default=T},1482:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(5)),u=r(a(9)),o=r(a(10)),c=r(a(11)),i=r(a(12)),s=r(a(13));a(125);var d=r(a(110)),f=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=h(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),p=(r(a(1483)),r(a(1484))),m=r(a(1491));function h(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(h=function(e){return e?a:t})(e)}function y(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function v(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,s.default)(e);if(t){var n=(0,s.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,i.default)(this,a)}}a(1493);var g=d.default.TabPane,b=function(e){(0,c.default)(a,e);var t=v(a);function a(e){var r;return(0,u.default)(this,a),(r=t.call(this,e)).state={params:r.props.params||[],headers:[]},r}return(0,o.default)(a,[{key:"componentDidMount",value:function(){}},{key:"valueChange",value:function(e,t){var a=this,r=this.state||{};r[e]=t,this.setState(function(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?y(Object(a),!0).forEach((function(t){(0,l.default)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):y(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}({},r),(function(){a.props.onChange&&a.props.onChange(a.state)}))}},{key:"render",value:function(){var e=this;return f.default.createElement("div",null,f.default.createElement(d.default,{size:"small",animated:!1},f.default.createElement(g,{tab:f.default.createElement("div",null,"Params",f.default.createElement("span",{className:"request-badge"},this.state.params.length)),key:"params"},f.default.createElement(p.default,{key:"params",value:this.state.params,onChange:function(t){e.valueChange("params",t.values)}})),f.default.createElement(g,{tab:f.default.createElement("div",null,"Headers",f.default.createElement("span",{className:"request-badge"},this.state.headers.length)),key:"headers"},f.default.createElement(p.default,{key:"headers",value:this.state.headers,onChange:function(t){e.valueChange("headers",t.values)}})),f.default.createElement(g,{tab:"请求体",key:"request_body"},f.default.createElement(m.default,null))))}}]),a}(f.default.Component);t.default=b},1483:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(9)),u=r(a(10)),o=r(a(11)),c=r(a(12)),i=r(a(13)),s=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=d(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1));function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(d=function(e){return e?a:t})(e)}function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,i.default)(e);if(t){var n=(0,i.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,c.default)(this,a)}}var p=function(e){(0,o.default)(a,e);var t=f(a);function a(e){return(0,l.default)(this,a),t.call(this,e)}return(0,u.default)(a,[{key:"render",value:function(){return s.default.createElement("div",null)}}]),a}(s.PureComponent);t.default=p},1484:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(36);var l=r(a(4));a(48);var u=r(a(47)),o=r(a(9)),c=r(a(10)),i=r(a(11)),s=r(a(12)),d=r(a(13)),f=r(a(5)),p=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=g(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),m=r(a(0)),h=a(182),y=r(a(1485));a(1489);var v=r(a(1490));function g(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(g=function(e){return e?a:t})(e)}function b(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,d.default)(e);if(t){var n=(0,d.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,s.default)(this,a)}}var E=function(e){(0,i.default)(a,e);var t=b(a);function a(e){var r;return(0,o.default)(this,a),(r=t.call(this,e)).state={active:!1,params:[]},r}return(0,c.default)(a,[{key:"componentDidMount",value:function(){this.setState({params:this.props.value.length>0?this.props.value:[{enable:!0}]})}},{key:"changeValue",value:function(e,t,a){var r=this.state.params;r[a]=r[a]||{name:"",value:"",desc:"",enable:!0};var n=r[a];!(a>=r.length-1)||this.stringNotBlank(n.name)&&this.stringNotBlank(n.value)||(r[a+1]={name:"",value:"",desc:"",enable:!0}),n[e]=t,this.setState({params:r},this.paramChangeEvent)}},{key:"getValueData",value:function(){return this.state.params.filter((function(e){return!(!e.name||!0!==e.enable)}))}},{key:"removeParam",value:function(e){var t=this.state.params;t.splice(e,1),this.setState({params:t},this.paramChangeEvent)}},{key:"paramChangeEvent",value:function(){var e=this,t=this.state.params||[];if(t.length<=0)t.push({name:"",value:"",enable:!0});else if(t.length>0){var a=t[t.length-1];this.stringNotBlank(a.name)&&this.stringNotBlank(a.value)||t.push({name:"",value:"",enable:!0})}this.setState({params:t},(function(){if(e.props.onChange){var t=e.getValueData();e.props.onChange({values:t,count:t.length})}}))}},{key:"stringNotBlank",value:function(e){return!(e&&e.length>0)}},{key:"render",value:function(){var e=this;return p.default.createElement(h.ReflexContainer,{style:{padding:"10px 0px",overflowY:"auto"}},p.default.createElement(h.ReflexElement,{size:200},p.default.createElement("div",{className:"params-container"},this.state.params.map((function(t,a){return p.default.createElement("div",{className:"flex params",key:a},p.default.createElement("div",{className:"flex flex-1 params-name"},p.default.createElement(u.default,{className:"input",placeholder:"Key",value:t.name,onChange:function(t){var r=t.target.value;e.changeValue("name",r,a)}})),p.default.createElement("div",{className:"flex flex-1 params-value"},p.default.createElement(u.default,{className:"input",placeholder:"Value",value:t.value,onChange:function(t){var r=t.target.value;e.changeValue("value",r,a)}})),p.default.createElement("div",{className:"flex flex-1 params-value"},p.default.createElement(u.default,{className:"input",placeholder:"Descriotion",value:t.desc,onChange:function(t){var r=t.target.desc;e.changeValue("desc",r,a)}})),p.default.createElement("div",{className:"flex params-checked"},p.default.createElement(y.default,{checked:t.enable,onChange:function(t){e.changeValue("enable",t,a)}})),p.default.createElement("div",{className:"flex params-trash"},p.default.createElement("div",{style:{height:"20px",padding:"2px",marginTop:"3px"}},p.default.createElement(l.default,{onClick:function(){e.removeParam(a)},component:function(){return p.default.createElement(v.default,{color:"#EF4444",width:"16",height:"16"})}}))))})))))}}]),a}(p.default.Component);t.default=E,(0,f.default)(E,"propTypes",{onChange:m.default.func,value:m.default.array})},1485:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(36);var l=r(a(4)),u=r(a(9)),o=r(a(10)),c=r(a(11)),i=r(a(12)),s=r(a(13)),d=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=m(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),f=r(a(1486)),p=r(a(1487));function m(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(m=function(e){return e?a:t})(e)}function h(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,s.default)(e);if(t){var n=(0,s.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,i.default)(this,a)}}a(1488);var y=function(e){(0,c.default)(a,e);var t=h(a);function a(){return(0,u.default)(this,a),t.apply(this,arguments)}return(0,o.default)(a,[{key:"checkedChange",value:function(){var e=!this.props.checked;this.props.onChange&&this.props.onChange(e)}},{key:"render",value:function(){function e(e){return!0===e.checked?d.default.createElement(l.default,{component:function(){return d.default.createElement(f.default,{color:"#54B785",width:"16",height:"16"})}}):d.default.createElement(l.default,{component:function(){return d.default.createElement(p.default,{color:"#54B785",width:"16",height:"16"})}})}return d.default.createElement("span",{className:"app-checkbox-wrap",onClick:this.checkedChange.bind(this)},d.default.createElement("div",{className:"circle ".concat(!0===this.props.checked?"active":"")},d.default.createElement(e,{checked:this.props.checked})),null!=this.props.label?d.default.createElement("div",{className:"label"},this.props.label):null)}}]),a}(d.PureComponent);t.default=y},1486:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(58)),u=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=o(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var c=l?Object.getOwnPropertyDescriptor(e,u):null;c&&(c.get||c.set)?Object.defineProperty(r,u,c):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(o=function(e){return e?a:t})(e)}var c=function(e){return u.createElement("svg",(0,l.default)({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},e),u.createElement("path",{d:"M22 11.08V12a10 10 0 11-5.93-9.14"}),u.createElement("path",{d:"M22 4L12 14.01l-3-3"}))};t.default=c},1487:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(58)),u=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=o(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var c=l?Object.getOwnPropertyDescriptor(e,u):null;c&&(c.get||c.set)?Object.defineProperty(r,u,c):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(o=function(e){return e?a:t})(e)}var c=function(e){return u.createElement("svg",(0,l.default)({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},e),u.createElement("circle",{cx:12,cy:12,r:10}))};t.default=c},1488:function(e,t,a){},1489:function(e,t,a){},1490:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(58)),u=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=o(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var c=l?Object.getOwnPropertyDescriptor(e,u):null;c&&(c.get||c.set)?Object.defineProperty(r,u,c):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(o=function(e){return e?a:t})(e)}var c=function(e){return u.createElement("svg",(0,l.default)({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},e),u.createElement("path",{d:"M3 6h18M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"}))};t.default=c},1491:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(162);var l=r(a(127)),u=r(a(9)),o=r(a(10)),c=r(a(11)),i=r(a(12)),s=r(a(13)),d=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=f(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1));function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(f=function(e){return e?a:t})(e)}function p(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,s.default)(e);if(t){var n=(0,s.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,i.default)(this,a)}}a(1492);var m=function(e){(0,c.default)(a,e);var t=p(a);function a(e){var r;return(0,u.default)(this,a),(r=t.call(this,e)).state={data:{bodyType:"none"}},r}return(0,o.default)(a,[{key:"valueChange",value:function(e,t){var a=this.state.data;a[e]=t,this.setState({data:a})}},{key:"render",value:function(){var e=this;return d.default.createElement("div",{className:"request-body-container"},d.default.createElement("div",{className:"request-body-type"},d.default.createElement(l.default.Group,{value:this.state.data.bodyType,onChange:function(t){e.valueChange("bodyType",t.target.value)}},d.default.createElement(l.default,{value:"none"},"none"),d.default.createElement(l.default,{value:"form-data"},"form-data"),d.default.createElement(l.default,{value:"json"},"JSON"))),"json"===this.state.data.bodyType?d.default.createElement("div",{className:"json-body"},"body"):null,d.default.createElement("div",null))}}]),a}(d.default.Component);t.default=m},1492:function(e,t,a){},1493:function(e,t,a){},1494:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(33);var l=r(a(25)),u=r(a(5)),o=r(a(9)),c=r(a(10)),i=r(a(11)),s=r(a(12)),d=r(a(13));a(71);var f=r(a(61));a(48);var p=r(a(47)),m=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=y(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),h=r(a(635));function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(y=function(e){return e?a:t})(e)}function v(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function g(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?v(Object(a),!0).forEach((function(t){(0,u.default)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):v(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function b(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,d.default)(e);if(t){var n=(0,d.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,s.default)(this,a)}}a(1495);p.default.Group;var E=f.default.Option,_=function(e){(0,i.default)(a,e);var t=b(a);function a(e){var r;return(0,o.default)(this,a),(r=t.call(this,e)).state={data:g({},r.props),methods:["get","post","put","delete","head"]},r}return(0,c.default)(a,[{key:"componentWillMount",value:function(){console.log(this.state.path)}},{key:"valueChange",value:function(e,t){var a=this.state.data;a[e]=t,this.setState({data:a},this.onChange)}},{key:"send",value:function(){this.onChange(),this.props.onSend&&this.props.onSend()}},{key:"onChange",value:function(){this.props.onChange&&this.props.onChange(this.state.data)}},{key:"render",value:function(){var e=this;return m.default.createElement("div",{style:{padding:"2px 10px",font:"12px",lineHeight:"12px"},className:"url-container flex flex-1"},m.default.createElement("div",{className:"flex flex-1"},m.default.createElement("div",{size:"small",className:"flex flex-1",style:{}},m.default.createElement(f.default,{defaultValue:this.state.data.method,onChange:function(t){e.valueChange("method",t)}},this.state.methods.map((function(e){return m.default.createElement(E,{key:e},e.toUpperCase())}))),m.default.createElement("div",{className:"flex flex-1",style:{flex:" 1 1 0%",flexDirection:"column"}},m.default.createElement(p.default,{placeholder:"Path",className:"input",value:this.state.data.path,onChange:function(t){e.valueChange("path",t.target.value)}})))),m.default.createElement("div",{className:"flex",style:{margin:"0 4px"}},m.default.createElement(l.default,{onClick:function(){e.send()}},m.default.createElement(h.default,{type:"yapi-send"}),"发送")))}}]),a}(m.default.Component);t.default=_},1495:function(e,t,a){},1496:function(e,t,a){},1497:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(30));a(123);var u=r(a(126));a(55);var o=r(a(45));a(36);var c=r(a(4)),i=r(a(31)),s=r(a(9)),d=r(a(10)),f=r(a(23)),p=r(a(11)),m=r(a(12)),h=r(a(13)),y=r(a(5));a(71);var v,g,b,E=r(a(61)),_=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=C(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),k=r(a(0)),j=r(a(72)),w=a(22),O=a(124);function C(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(C=function(e){return e?a:t})(e)}function x(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,h.default)(e);if(t){var n=(0,h.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,m.default)(this,a)}}var P=E.default.Option,N=(0,w.connect)((function(e){return{projectList:e.project.projectList,list:e.inter.list}}),{fetchInterfaceListMenu:O.fetchInterfaceListMenu})((b=g=function(e){(0,p.default)(r,e);var t,a=x(r);function r(e){var t;return(0,s.default)(this,r),t=a.call(this,e),(0,y.default)((0,f.default)(t),"state",{selectedRowKeys:[],categoryCount:{},project:t.props.currProjectId}),(0,y.default)((0,f.default)(t),"onChange",function(){var e=(0,i.default)(l.default.mark((function e(a){return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.setState({project:a,selectedRowKeys:[],categoryCount:{}}),e.next=3,t.props.fetchInterfaceListMenu(a);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),t}return(0,d.default)(r,[{key:"componentDidMount",value:(t=(0,i.default)(l.default.mark((function e(){return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.props.fetchInterfaceListMenu(this.props.currProjectId);case 2:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"render",value:function(){var e=this,t=this.props,a=t.list,r=t.projectList,n=a.map((function(e){return{key:"category_"+e._id,title:e.name,isCategory:!0,children:e.list?e.list.map((function(t){return t.key=t._id,t.categoryKey="category_"+e._id,t.categoryLength=e.list.length,t})):[]}})),l=this,i={onSelect:function(e,t){var a=l.state.selectedRowKeys,r=l.state.categoryCount,n=e.categoryKey,u=e.categoryLength,o=[];e.isCategory?(o=e.children.map((function(e){return e._id})).concat(e.key),t?(o=o.filter((function(e){return-1===a.indexOf(e)})).concat(a),r[n]=u):(o=a.filter((function(e){return-1===o.indexOf(e)})),r[n]=0)):t?(o=a.concat(e._id),r[n]?r[n]+=1:r[n]=1,r[n]===e.categoryLength&&o.push(n)):(o=a.filter((function(t){return t!==e._id})),r[n]&&(r[n]-=1),o=o.filter((function(e){return e!==n}))),l.setState({selectedRowKeys:o,categoryCount:r}),l.props.selectInterface(o.filter((function(e){return-1===(""+e).indexOf("category")})),l.state.project)},onSelectAll:function(e){var t=[],a=l.state.categoryCount;e?(n.forEach((function(e){e.children&&(a["category_"+e._id]=e.children.length,t=t.concat(e.children.map((function(e){return e._id}))))})),t=t.concat(n.map((function(e){return e.key})))):(a={},t=[]),l.setState({selectedRowKeys:t,categoryCount:a}),l.props.selectInterface(t.filter((function(e){return-1===(""+e).indexOf("category")})),l.state.project)},selectedRowKeys:l.state.selectedRowKeys},s=[{title:"接口名称",dataIndex:"title",width:"30%"},{title:"接口路径",dataIndex:"path",width:"40%"},{title:"请求方法",dataIndex:"method",render:function(e){var t=j.default.METHOD_COLOR[e?e.toLowerCase():"get"];return _.default.createElement("span",{style:{color:t.color,backgroundColor:t.bac,borderRadius:4},className:"colValue"},e)}},{title:_.default.createElement("span",null,"状态"," ",_.default.createElement(o.default,{title:"筛选满足条件的接口集合"},_.default.createElement(c.default,{type:"question-circle-o"}))),dataIndex:"status",render:function(t){e.getStatusText(t)},filters:[{text:"已完成",value:"done"},{text:"未完成",value:"undone"},{text:"废弃",value:"invalid"}],onFilter:function(e,t){return t.children.filter((function(t){return 0===t.status.indexOf(e)})).length>0}}];return _.default.createElement("div",null,_.default.createElement("div",{className:"select-project"},_.default.createElement("span",null,"选择要导入的项目： "),_.default.createElement(E.default,{value:this.state.project,style:{width:200},onChange:this.onChange},r.map((function(e){return e.projectname?"":_.default.createElement(P,{value:"".concat(e._id),key:e._id},e.name)})))),_.default.createElement(u.default,{columns:s,rowSelection:i,dataSource:n,pagination:!1}))}}]),r}(_.PureComponent),(0,y.default)(g,"propTypes",{list:k.default.array,selectInterface:k.default.func,projectList:k.default.array,currProjectId:k.default.string,fetchInterfaceListMenu:k.default.func}),v=b))||v;t.default=N},1498:function(e,t,a){},1567:function(e,t,a){"use strict";var r=a(3);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(57);var n=r(a(51));a(64);var l=r(a(49)),u=r(a(7));a(125);var o=r(a(110)),c=r(a(1)),i=r(a(0)),s=o.default.TabPane;function d(e){return e&&"object"===(0,u.default)(e)?JSON.stringify(e,null,"   "):e}var f=function(e){var t,a=d(e.data),r=d(e.headers),u=d(e.res_header),i=d(e.res_body),f=e.status;return e.validRes&&Array.isArray(e.validRes)&&(t=e.validRes.map((function(e,t){return c.default.createElement("div",{key:t},e.message)}))),c.default.createElement("div",{className:"report"},c.default.createElement(o.default,{defaultActiveKey:"request"},c.default.createElement(s,{className:"case-report-pane",tab:"Request",key:"request"},c.default.createElement(n.default,{className:"case-report"},c.default.createElement(l.default,{className:"case-report-title",span:"6"},"Url"),c.default.createElement(l.default,{span:"18"},e.url)),e.query?c.default.createElement(n.default,{className:"case-report"},c.default.createElement(l.default,{className:"case-report-title",span:"6"},"Query"),c.default.createElement(l.default,{span:"18"},e.query)):null,e.headers?c.default.createElement(n.default,{className:"case-report"},c.default.createElement(l.default,{className:"case-report-title",span:"6"},"Headers"),c.default.createElement(l.default,{span:"18"},c.default.createElement("pre",null,r))):null,a?c.default.createElement(n.default,{className:"case-report"},c.default.createElement(l.default,{className:"case-report-title",span:"6"},"Body"),c.default.createElement(l.default,{span:"18"},c.default.createElement("pre",{style:{whiteSpace:"pre-wrap"}},a))):null),c.default.createElement(s,{className:"case-report-pane",tab:"Response",key:"response"},c.default.createElement(n.default,{className:"case-report"},c.default.createElement(l.default,{className:"case-report-title",span:"6"},"HttpCode"),c.default.createElement(l.default,{span:"18"},c.default.createElement("pre",null,f))),e.res_header?c.default.createElement(n.default,{className:"case-report"},c.default.createElement(l.default,{className:"case-report-title",span:"6"},"Headers"),c.default.createElement(l.default,{span:"18"},c.default.createElement("pre",null,u))):null,e.res_body?c.default.createElement(n.default,{className:"case-report"},c.default.createElement(l.default,{className:"case-report-title",span:"6"},"Body"),c.default.createElement(l.default,{span:"18"},c.default.createElement("pre",null,i))):null),c.default.createElement(s,{className:"case-report-pane",tab:"验证结果",key:"valid"},e.validRes?c.default.createElement(n.default,{className:"case-report"},c.default.createElement(l.default,{className:"case-report-title",span:"6"},"验证结果"),c.default.createElement(l.default,{span:"18"},c.default.createElement("pre",null,t))):null)))};f.propTypes={url:i.default.string,data:i.default.any,headers:i.default.object,res_header:i.default.object,res_body:i.default.any,query:i.default.string,validRes:i.default.array,status:i.default.number};var p=f;t.default=p},1568:function(e,t,a){"use strict";var r=a(3);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(57);var n=r(a(51));a(64);var l=r(a(49));a(55);var u=r(a(45));a(36);var o=r(a(4)),c=r(a(9)),i=r(a(10)),s=r(a(23)),d=r(a(11)),f=r(a(12)),p=r(a(13)),m=r(a(5));a(295);var h=r(a(312));a(71);var y=r(a(61)),v=r(a(1)),g=r(a(0));function b(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,p.default)(e);if(t){var n=(0,p.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,f.default)(this,a)}}a(1569);var E=y.default.Option,_=h.default.Panel,k=function(e){(0,d.default)(a,e);var t=b(a);function a(e){var r;return(0,c.default)(this,a),r=t.call(this,e),(0,m.default)((0,s.default)(r),"callback",(function(e){r.props.changeClose&&r.props.changeClose(e)})),r}return(0,i.default)(a,[{key:"render",value:function(){var e=this;return v.default.createElement(h.default,{style:{margin:0,marginBottom:"16px"},onChange:this.callback,activeKey:this.props.collapseKey},v.default.createElement(_,{header:v.default.createElement("span",null," ","选择测试用例环境",v.default.createElement(u.default,{title:"默认使用测试用例选择的环境"}," ",v.default.createElement(o.default,{type:"question-circle-o"})," ")),key:"1"},v.default.createElement("div",{className:"case-env"},this.props.envList.length>0&&v.default.createElement("div",null,this.props.envList.map((function(t){return v.default.createElement(n.default,{key:t._id,type:"flex",justify:"space-around",align:"middle",className:"env-item"},v.default.createElement(l.default,{span:6,className:"label"},v.default.createElement(u.default,{title:t.name},v.default.createElement("span",{className:"label-name"},t.name))),v.default.createElement(l.default,{span:18},v.default.createElement(y.default,{style:{width:"100%"},value:e.props.envValue[t._id]||"",defaultValue:"",onChange:function(a){return e.props.currProjectEnvChange(a,t._id)}},v.default.createElement(E,{key:"default",value:""},"默认环境"),t.env.map((function(e){return v.default.createElement(E,{value:e.name,key:e._id},e.name+": "+e.domain)})))))}))))))}}]),a}(v.default.Component);t.default=k,(0,m.default)(k,"propTypes",{envList:g.default.array,currProjectEnvChange:g.default.func,changeClose:g.default.func,collapseKey:g.default.any,envValue:g.default.object})},1569:function(e,t,a){},1570:function(e,t,a){},1571:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(33);var l=r(a(25)),u=r(a(9)),o=r(a(10)),c=r(a(11)),i=r(a(12)),s=r(a(13)),d=r(a(5));a(1572);var f,p,m,h=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=b(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),y=r(a(577)),v=a(22),g=r(a(0));function b(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(b=function(e){return e?a:t})(e)}function E(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,s.default)(e);if(t){var n=(0,s.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,i.default)(this,a)}}var _=(0,v.connect)((function(e){return{uid:e.user.uid+"",curdata:e.inter.curdata,currProject:e.project.currProject}}))((m=p=function(e){(0,c.default)(a,e);var t=E(a);function a(e){return(0,u.default)(this,a),t.call(this,e)}return(0,o.default)(a,[{key:"render",value:function(){var e=this.props.currProject;return h.default.createElement("div",{className:"",style:{height:"100%",overflowY:"auto"}},h.default.createElement("section",{className:"news-box m-panel"},h.default.createElement("div",{style:{display:"none"},className:"logHead"},h.default.createElement("div",{className:"projectDes"},h.default.createElement("p",null,"高效、易用、可部署的API管理平台")),h.default.createElement("div",{className:"Mockurl"},h.default.createElement("span",null,"Mock地址："),h.default.createElement("p",null,location.protocol+"//"+location.hostname+(""!==location.port?":"+location.port:"")+"/mock/".concat(e._id).concat(e.basepath,"/yourPath")),h.default.createElement(l.default,{type:"primary"},h.default.createElement("a",{href:"/api/project/download?project_id=".concat(this.props.match.params.id)},"下载Mock数据")))),h.default.createElement(y.default,{type:"project",typeid:+this.props.match.params.id})))}}]),a}(h.PureComponent),(0,d.default)(p,"propTypes",{uid:g.default.string,getMockUrl:g.default.func,match:g.default.object,curdata:g.default.object,currProject:g.default.object}),f=m))||f;t.default=_},1572:function(e,t,a){},1573:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(9)),u=r(a(10)),o=r(a(11)),c=r(a(12)),i=r(a(13)),s=r(a(5));a(125);var d,f,p,m=r(a(110)),h=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=j(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),y=r(a(0)),v=r(a(1574)),g=r(a(583)),b=r(a(1575)),E=r(a(1577)),_=r(a(1579)),k=a(22);function j(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(j=function(e){return e?a:t})(e)}function w(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,i.default)(e);if(t){var n=(0,i.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,c.default)(this,a)}}a(423);var O=m.default.TabPane,C=a(141),x={},P=(0,k.connect)((function(e){return{curProjectRole:e.project.currProject.role}}))((p=f=function(e){(0,o.default)(a,e);var t=w(a);function a(){return(0,l.default)(this,a),t.apply(this,arguments)}return(0,u.default)(a,[{key:"render",value:function(){var e=this.props.match.params.id;return C.emitHook("sub_setting_nav",x),h.default.createElement("div",{style:{height:"100%",overflowY:"auto"}},h.default.createElement(m.default,{type:"card",className:"has-affix-footer tabs-large"},h.default.createElement(O,{tab:"项目配置",key:"1"},h.default.createElement(v.default,{projectId:+e})),h.default.createElement(O,{tab:"环境配置",key:"2"},h.default.createElement(g.default,{projectId:+e})),h.default.createElement(O,{tab:"请求配置",key:"3"},h.default.createElement(b.default,{projectId:+e})),"guest"!==this.props.curProjectRole?h.default.createElement(O,{tab:"token配置",key:"4"},h.default.createElement(E.default,{projectId:+e,curProjectRole:this.props.curProjectRole})):null,h.default.createElement(O,{tab:"全局mock脚本",key:"5"},h.default.createElement(_.default,{projectId:+e})),Object.keys(x).map((function(t){var a=x[t].component;return h.default.createElement(O,{tab:x[t].name,key:x[t].name},h.default.createElement(a,{projectId:+e}))}))))}}]),a}(h.PureComponent),(0,s.default)(f,"propTypes",{match:y.default.object,curProjectRole:y.default.string}),d=p))||d;t.default=P},1574:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(30));a(203);var u=r(a(210));a(33);var o=r(a(25));a(134);var c=r(a(135));a(55);var i=r(a(45)),s=r(a(58));a(57);var d=r(a(51));a(64);var f=r(a(49));a(144);var p=r(a(166));a(36);var m=r(a(4)),h=r(a(31));a(238);var y=r(a(246));a(38);var v=r(a(39)),g=r(a(9)),b=r(a(10)),E=r(a(23)),_=r(a(11)),k=r(a(12)),j=r(a(13)),w=r(a(5));a(71);var O=r(a(61));a(53);var C=r(a(54));a(162);var x=r(a(127));a(82);var P=r(a(84));a(48);var N=r(a(47)),M=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=H(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),S=r(a(0)),I=a(75),R=a(103),D=a(103),T=a(101),q=a(22),L=a(40),A=r(a(72)),B=a(68);a(423);var W,G,F,U=r(a(79)),V=r(a(632));function H(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(H=function(e){return e?a:t})(e)}function z(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,j.default)(e);if(t){var n=(0,j.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,k.default)(this,a)}}var J=N.default.TextArea,K=P.default.Item,Y=x.default.Group,Q=x.default.Button,X=C.default.confirm,Z={labelCol:{lg:{offset:1,span:3},xs:{span:24},sm:{span:6}},wrapperCol:{lg:{span:19},xs:{span:24},sm:{span:14}},className:"form-item"},$=O.default.Option,ee=(0,q.connect)((function(e){return{projectList:e.project.projectList,groupList:e.group.groupList,projectMsg:e.project.currProject,currGroup:e.group.currGroup}}),{updateProject:I.updateProject,delProject:I.delProject,getProject:I.getProject,fetchGroupMsg:R.fetchGroupMsg,upsetProject:I.upsetProject,fetchGroupList:D.fetchGroupList,setBreadcrumb:T.setBreadcrumb})(W=(0,L.withRouter)((F=G=function(e){(0,_.default)(r,e);var t,a=z(r);function r(e){var t;return(0,g.default)(this,r),t=a.call(this,e),(0,w.default)((0,E.default)(t),"handleOk",(function(e){e.preventDefault();var a=t.props,r=a.form,n=a.updateProject,l=a.projectMsg,u=a.groupList;r.validateFields((function(e,a){if(!e){var o=t.tag.state.tag;o=o.filter((function(e){return""!==e.name}));var c=Object.assign(l,a,{tag:o});a.protocol=t.state.protocol.split(":")[0];var i=c.group_id,s=U.default.find(u,(function(e){return e._id==i}));n(c).then((function(e){if(0==e.payload.data.errcode){t.props.getProject(t.props.projectId),v.default.success("修改成功! "),t.props.fetchGroupMsg(i);var a=(0,B.htmlFilter)(c.name);t.props.setBreadcrumb([{name:s.group_name,href:"/space/group/"+i},{name:a}])}})).catch((function(){})),r.resetFields()}}))})),(0,w.default)((0,E.default)(t),"tagSubmit",(function(e){t.tag=e})),(0,w.default)((0,E.default)(t),"showConfirm",(function(){var e=(0,E.default)(t);X({title:"确认删除 "+e.props.projectMsg.name+" 项目吗？",content:M.default.createElement("div",{style:{marginTop:"10px",fontSize:"13px",lineHeight:"25px"}},M.default.createElement(y.default,{message:"警告：此操作非常危险,会删除该项目下面所有接口，并且无法恢复!",type:"warning",banner:!0}),M.default.createElement("div",{style:{marginTop:"16px"}},M.default.createElement("p",{style:{marginBottom:"8px"}},M.default.createElement("b",null,"请输入项目名称确认此操作:")),M.default.createElement(N.default,{id:"project_name",size:"large"}))),onOk:function(){var t=(0,B.trim)(document.getElementById("project_name").value);if(e.props.projectMsg.name!==t)return v.default.error("项目名称有误"),new Promise((function(e,t){t("error")}));e.props.delProject(e.props.projectId).then((function(t){0==t.payload.data.errcode&&(v.default.success("删除成功!"),e.props.history.push("/space/group/"+e.props.projectMsg.group_id))}))},iconType:"delete",onCancel:function(){}})})),(0,w.default)((0,E.default)(t),"changeProjectColor",(function(e){var a=t.props.projectMsg,r=a._id,n=a.color,l=a.icon;t.props.upsetProject({id:r,color:e.target.value||n,icon:l}).then((function(e){0===e.payload.data.errcode&&t.props.getProject(t.props.projectId)}))})),(0,w.default)((0,E.default)(t),"changeProjectIcon",(function(e){var a=t.props.projectMsg,r=a._id,n=a.color,l=a.icon;t.props.upsetProject({id:r,color:n,icon:e.target.value||l}).then((function(e){0===e.payload.data.errcode&&t.props.getProject(t.props.projectId)}))})),(0,w.default)((0,E.default)(t),"toggleDangerOptions",(function(){t.setState({showDangerOptions:!t.state.showDangerOptions})})),t.state={protocol:"http://",projectMsg:{},showDangerOptions:!1},t}return(0,b.default)(r,[{key:"componentWillMount",value:(t=(0,h.default)(l.default.mark((function e(){return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.props.fetchGroupList();case 2:return e.next=4,this.props.fetchGroupMsg(this.props.projectMsg.group_id);case 4:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"render",value:function(){var e,t=this.props.form.getFieldDecorator,a=this.props,r=a.projectMsg,n=a.currGroup,l=location.protocol+"//"+location.hostname+(""!==location.port?":"+location.port:"")+"/mock/".concat(r._id).concat(r.basepath,"+$接口请求路径"),h=r.name,y=r.basepath,v=r.desc,g=r.project_type,b=r.group_id,E=r.switch_notice,_=r.strice,k=r.is_json5,j=r.tag;e={name:h,basepath:y,desc:v,project_type:g,group_id:b,switch_notice:E,strice:_,is_json5:k,tag:j};var w=(0,B.entries)(A.default.PROJECT_COLOR),C=M.default.createElement(Y,{onChange:this.changeProjectColor,value:r.color,className:"color"},w.map((function(e,t){return M.default.createElement(Q,{key:t,value:e[0],style:{backgroundColor:e[1],color:"#fff",fontWeight:"bold"}},e[0]===r.color?M.default.createElement(m.default,{type:"check"}):null)}))),S=M.default.createElement(Y,{onChange:this.changeProjectIcon,value:r.icon,className:"icon"},A.default.PROJECT_ICON.map((function(e){return M.default.createElement(Q,{key:e,value:e,style:{fontWeight:"bold"}},M.default.createElement(m.default,{type:e}))}))),I="owner"===r.role||"admin"===r.role;return M.default.createElement("div",null,M.default.createElement("div",{className:"m-panel"},M.default.createElement(d.default,{className:"project-setting"},M.default.createElement(f.default,{xs:6,lg:{offset:1,span:3},className:"setting-logo"},M.default.createElement(p.default,{placement:"bottom",title:C,content:S,trigger:"click",overlayClassName:"change-project-container"},M.default.createElement(m.default,{type:r.icon||"star-o",className:"ui-logo",style:{backgroundColor:A.default.PROJECT_COLOR[r.color]||A.default.PROJECT_COLOR.blue}}))),M.default.createElement(f.default,{xs:18,sm:15,lg:19,className:"setting-intro"},M.default.createElement("h2",{className:"ui-title"},(n.group_name||"")+" / "+(r.name||"")))),M.default.createElement("hr",{className:"breakline"}),M.default.createElement(P.default,null,M.default.createElement(K,(0,s.default)({},Z,{label:"项目ID"}),M.default.createElement("span",null,this.props.projectMsg._id)),M.default.createElement(K,(0,s.default)({},Z,{label:"项目名称"}),t("name",{initialValue:e.name,rules:(0,B.nameLengthLimit)("项目")})(M.default.createElement(N.default,null))),M.default.createElement(K,(0,s.default)({},Z,{label:"所属分组"}),t("group_id",{initialValue:e.group_id+"",rules:[{required:!0,message:"请选择项目所属的分组!"}]})(M.default.createElement(O.default,{disabled:!I},this.props.groupList.map((function(e,t){return M.default.createElement($,{value:e._id.toString(),key:t},e.group_name)}))))),M.default.createElement(K,(0,s.default)({},Z,{label:M.default.createElement("span",null,"接口基本路径 ",M.default.createElement(i.default,{title:"基本路径为空表示根路径"},M.default.createElement(m.default,{type:"question-circle-o"})))}),t("basepath",{initialValue:e.basepath,rules:[{required:!1,message:"请输入基本路径! "}]})(M.default.createElement(N.default,null))),M.default.createElement(K,(0,s.default)({},Z,{label:M.default.createElement("span",null,"MOCK地址 ",M.default.createElement(i.default,{title:"具体使用方法请查看文档"},M.default.createElement(m.default,{type:"question-circle-o"})))}),M.default.createElement(N.default,{disabled:!0,value:l,onChange:function(){}})),M.default.createElement(K,(0,s.default)({},Z,{label:"描述"}),t("desc",{initialValue:e.desc,rules:[{required:!1}]})(M.default.createElement(J,{rows:8}))),M.default.createElement(K,(0,s.default)({},Z,{label:M.default.createElement("span",null,"tag 信息 ",M.default.createElement(i.default,{title:"定义 tag 信息，过滤接口"},M.default.createElement(m.default,{type:"question-circle-o"})))}),M.default.createElement(V.default,{tagMsg:j,ref:this.tagSubmit})),M.default.createElement(K,(0,s.default)({},Z,{label:M.default.createElement("span",null,"mock严格模式 ",M.default.createElement(i.default,{title:"开启后 mock 请求会对 query，body form 的必须字段和 json schema 进行校验"},M.default.createElement(m.default,{type:"question-circle-o"})))}),t("strice",{valuePropName:"checked",initialValue:e.strice})(M.default.createElement(c.default,{checkedChildren:"开",unCheckedChildren:"关"}))),M.default.createElement(K,(0,s.default)({},Z,{label:M.default.createElement("span",null,"开启json5 ",M.default.createElement(i.default,{title:"开启后可在接口 body 和返回值中写 json 字段"},M.default.createElement(m.default,{type:"question-circle-o"})))}),t("is_json5",{valuePropName:"checked",initialValue:e.is_json5})(M.default.createElement(c.default,{checkedChildren:"开",unCheckedChildren:"关"}))),M.default.createElement(K,(0,s.default)({},Z,{label:"默认开启邮件通知"}),t("switch_notice",{valuePropName:"checked",initialValue:e.switch_notice})(M.default.createElement(c.default,{checkedChildren:"开",unCheckedChildren:"关"}))),M.default.createElement(K,(0,s.default)({},Z,{label:"权限"}),t("project_type",{rules:[{required:!0}],initialValue:e.project_type})(M.default.createElement(Y,null,M.default.createElement(x.default,{value:"private",className:"radio"},M.default.createElement(m.default,{type:"lock"}),"私有 ",M.default.createElement("br",null),M.default.createElement("span",{className:"radio-desc"},"只有组长和项目开发者可以索引并查看项目信息")),M.default.createElement("br",null),"admin"===r.role&&M.default.createElement(x.default,{value:"public",className:"radio"},M.default.createElement(m.default,{type:"unlock"}),"公开",M.default.createElement("br",null),M.default.createElement("span",{className:"radio-desc"},"任何人都可以索引并查看项目信息")))))),M.default.createElement("div",{className:"btnwrap-changeproject"},M.default.createElement(o.default,{className:"m-btn btn-save",icon:"save",type:"primary",size:"large",onClick:this.handleOk},"保 存")),"owner"===r.role||"admin"===r.role?M.default.createElement("div",{className:"danger-container"},M.default.createElement("div",{className:"title"},M.default.createElement("h2",{className:"content"},M.default.createElement(m.default,{type:"exclamation-circle-o"})," 危险操作"),M.default.createElement(o.default,{onClick:this.toggleDangerOptions},"查 看",M.default.createElement(m.default,{type:this.state.showDangerOptions?"up":"down"}))),this.state.showDangerOptions?M.default.createElement(u.default,{hoverable:!0,className:"card-danger"},M.default.createElement("div",{className:"card-danger-content"},M.default.createElement("h3",null,"删除项目"),M.default.createElement("p",null,"项目一旦删除，将无法恢复数据，请慎重操作！"),M.default.createElement("p",null,"只有组长和管理员有权限删除项目。")),M.default.createElement(o.default,{type:"danger",ghost:!0,className:"card-danger-btn",onClick:this.showConfirm},"删除")):null):null))}}]),r}(M.PureComponent),(0,w.default)(G,"propTypes",{projectId:S.default.number,form:S.default.object,updateProject:S.default.func,delProject:S.default.func,getProject:S.default.func,history:S.default.object,fetchGroupMsg:S.default.func,upsetProject:S.default.func,groupList:S.default.array,projectList:S.default.array,projectMsg:S.default.object,fetchGroupList:S.default.func,currGroup:S.default.object,setBreadcrumb:S.default.func}),W=F))||W)||W,te=P.default.create()(ee);t.default=te},1575:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(30));a(33);var u=r(a(25)),o=r(a(58));a(38);var c=r(a(39)),i=r(a(31)),s=r(a(9)),d=r(a(10)),f=r(a(23)),p=r(a(11)),m=r(a(12)),h=r(a(13)),y=r(a(5));a(82);var v=r(a(84)),g=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=C(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),b=r(a(0)),E=a(22);a(1576);var _,k,j,w=r(a(165)),O=a(75);function C(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(C=function(e){return e?a:t})(e)}function x(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,h.default)(e);if(t){var n=(0,h.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,m.default)(this,a)}}var P=v.default.Item,N=(0,E.connect)((function(e){return{projectMsg:e.project.currProject}}),{updateProjectScript:O.updateProjectScript,getProject:O.getProject})(_=v.default.create()((j=k=function(e){(0,p.default)(a,e);var t=x(a);function a(){var e;(0,s.default)(this,a);for(var r=arguments.length,n=new Array(r),u=0;u<r;u++)n[u]=arguments[u];return e=t.call.apply(t,[this].concat(n)),(0,y.default)((0,f.default)(e),"handleSubmit",(0,i.default)(l.default.mark((function t(){var a;return l.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.props.updateProjectScript({id:e.props.projectId,pre_script:e.state.pre_script,after_script:e.state.after_script});case 2:if(0!==(a=t.sent).payload.data.errcode){t.next=9;break}return c.default.success("保存成功"),t.next=7,e.props.getProject(e.props.projectId);case 7:t.next=10;break;case 9:c.default.success("保存失败, "+a.payload.data.errmsg);case 10:case"end":return t.stop()}}),t)})))),e}return(0,d.default)(a,[{key:"componentWillMount",value:function(){this.setState({pre_script:this.props.projectMsg.pre_script,after_script:this.props.projectMsg.after_script})}},{key:"render",value:function(){var e=this,t={labelCol:{xs:{span:24},sm:{span:6}},wrapperCol:{xs:{span:24},sm:{span:16}}},a={wrapperCol:{xs:{span:24,offset:0},sm:{span:16,offset:8}}},r=this.state,n=r.pre_script,l=r.after_script;return g.default.createElement("div",{className:"project-request"},g.default.createElement(v.default,{onSubmit:this.handleSubmit},g.default.createElement(P,(0,o.default)({},t,{label:"Pre-request Script(请求参数处理脚本)"}),g.default.createElement(w.default,{data:n,onChange:function(t){return e.setState({pre_script:t.text})},fullScreen:!0,className:"request-editor"})),g.default.createElement(P,(0,o.default)({},t,{label:"Pre-response Script(响应数据处理脚本)"}),g.default.createElement(w.default,{data:l,onChange:function(t){return e.setState({after_script:t.text})},fullScreen:!0,className:"request-editor"})),g.default.createElement(P,a,g.default.createElement(u.default,{onClick:this.handleSubmit,type:"primary"},"保存"))))}}]),a}(g.PureComponent),(0,y.default)(k,"propTypes",{projectMsg:b.default.object,updateProjectScript:b.default.func,getProject:b.default.func,projectId:b.default.number}),_=j))||_)||_;t.default=N},1576:function(e,t,a){},1577:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(30));a(55);var u=r(a(45));a(36);var o=r(a(4)),c=r(a(31));a(38);var i=r(a(39)),s=r(a(9)),d=r(a(10)),f=r(a(23)),p=r(a(11)),m=r(a(12)),h=r(a(13)),y=r(a(5));a(53);var v=r(a(54)),g=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=C(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),b=r(a(0));a(1578);var E,_,k,j=a(75),w=a(22),O=r(a(415));function C(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(C=function(e){return e?a:t})(e)}function x(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,h.default)(e);if(t){var n=(0,h.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,m.default)(this,a)}}var P=v.default.confirm,N=(0,w.connect)((function(e){return{token:e.project.token}}),{getToken:j.getToken,updateToken:j.updateToken})((k=_=function(e){(0,p.default)(r,e);var t,a=x(r);function r(){var e;(0,s.default)(this,r);for(var t=arguments.length,n=new Array(t),u=0;u<t;u++)n[u]=arguments[u];return e=a.call.apply(a,[this].concat(n)),(0,y.default)((0,f.default)(e),"copyToken",(function(){(0,O.default)(e.props.token),i.default.success("已经成功复制到剪切板")})),(0,y.default)((0,f.default)(e),"updateToken",(function(){var t=(0,f.default)(e);P({title:"重新生成key",content:"重新生成之后，之前的key将无法使用，确认重新生成吗？",okText:"确认",cancelText:"取消",onOk:function(){return(0,c.default)(l.default.mark((function e(){return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.props.updateToken(t.props.projectId);case 2:i.default.success("更新成功");case 3:case"end":return e.stop()}}),e)})))()},onCancel:function(){}})})),e}return(0,d.default)(r,[{key:"componentDidMount",value:(t=(0,c.default)(l.default.mark((function e(){return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.props.getToken(this.props.projectId);case 2:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"render",value:function(){return g.default.createElement("div",{className:"project-token"},g.default.createElement("h2",{className:"token-title"},"工具标识"),g.default.createElement("div",{className:"message"},"每个项目都有唯一的标识token，用户可以使用这个token值来请求项目 openapi."),g.default.createElement("div",{className:"token"},g.default.createElement("span",null,"token: ",g.default.createElement("span",{className:"token-message"},this.props.token)),g.default.createElement(u.default,{title:"复制"},g.default.createElement(o.default,{className:"token-btn",type:"copy",onClick:this.copyToken})),"admin"===this.props.curProjectRole||"owner"===this.props.curProjectRole?g.default.createElement(u.default,{title:"刷新"},g.default.createElement(o.default,{className:"token-btn",type:"reload",onClick:this.updateToken})):null),g.default.createElement("div",{className:"blockquote"},"为确保项目内数据的安全性和私密性，请勿轻易将该token暴露给项目组外用户。"),g.default.createElement("br",null),g.default.createElement("h2",{className:"token-title"},"open接口："),g.default.createElement("p",null,g.default.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"https://hellosean1025.github.io/yapi/openapi.html"},"详细接口文档")),g.default.createElement("div",null,g.default.createElement("ul",{className:"open-api"},g.default.createElement("li",null,"/api/open/run_auto_test [运行自动化测试]"),g.default.createElement("li",null,"/api/open/import_data [导入数据]"),g.default.createElement("li",null,"/api/interface/add [新增接口]"),g.default.createElement("li",null,"/api/interface/save [保存接口]"),g.default.createElement("li",null,"/api/interface/up [更新接口]"),g.default.createElement("li",null,"/api/interface/get [获取接口]"),g.default.createElement("li",null,"/api/interface/list [获取接口列表]"),g.default.createElement("li",null,"/api/interface/list_menu [获取接口菜单]"),g.default.createElement("li",null,"/api/interface/add_cat [新增接口分类]"),g.default.createElement("li",null,"/api/interface/getCatMenu [获取所有分类]"))))}}]),r}(g.Component),(0,y.default)(_,"propTypes",{projectId:b.default.number,getToken:b.default.func,token:b.default.string,updateToken:b.default.func,curProjectRole:b.default.string}),E=k))||E;t.default=N},1578:function(e,t,a){},1579:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(30));a(33);var u=r(a(25)),o=r(a(58));a(134);var c=r(a(135));a(55);var i=r(a(45));a(36);var s=r(a(4));a(38);var d=r(a(39)),f=r(a(31)),p=r(a(9)),m=r(a(10)),h=r(a(23)),y=r(a(11)),v=r(a(12)),g=r(a(13)),b=r(a(5));a(82);var E,_,k,j=r(a(84)),w=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=N(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),O=a(22),C=r(a(0)),x=r(a(165)),P=a(75);function N(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(N=function(e){return e?a:t})(e)}function M(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,g.default)(e);if(t){var n=(0,g.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,v.default)(this,a)}}var S=j.default.Item,I={labelCol:{sm:{span:4}},wrapperCol:{sm:{span:16}}},R={wrapperCol:{sm:{span:16,offset:11}}},D=(0,O.connect)((function(e){return{projectMsg:e.project.currProject}}),{updateProjectMock:P.updateProjectMock,getProject:P.getProject})(E=j.default.create()((k=_=function(e){(0,y.default)(a,e);var t=M(a);function a(e){var r;return(0,p.default)(this,a),r=t.call(this,e),(0,b.default)((0,h.default)(r),"handleSubmit",(0,f.default)(l.default.mark((function e(){var t,a;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={id:r.props.projectId,project_mock_script:r.state.project_mock_script,is_mock_open:r.state.is_mock_open},e.next=3,r.props.updateProjectMock(t);case 3:if(0!==(a=e.sent).payload.data.errcode){e.next=10;break}return d.default.success("保存成功"),e.next=8,r.props.getProject(r.props.projectId);case 8:e.next=11;break;case 10:d.default.success("保存失败, "+a.payload.data.errmsg);case 11:case"end":return e.stop()}}),e)})))),(0,b.default)((0,h.default)(r),"onChange",(function(e){r.setState({is_mock_open:e})})),(0,b.default)((0,h.default)(r),"handleMockJsInput",(function(e){r.setState({project_mock_script:e.text})})),r.state={is_mock_open:!1,project_mock_script:""},r}return(0,m.default)(a,[{key:"componentWillMount",value:function(){this.setState({is_mock_open:this.props.projectMsg.is_mock_open,project_mock_script:this.props.projectMsg.project_mock_script})}},{key:"render",value:function(){return w.default.createElement("div",{className:"m-panel"},w.default.createElement(j.default,null,w.default.createElement(S,(0,o.default)({label:w.default.createElement("span",null,"是否开启 ",w.default.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"https://hellosean1025.github.io/yapi/documents/project.html#%E5%85%A8%E5%B1%80mock"},w.default.createElement(i.default,{title:"点击查看文档"},w.default.createElement(s.default,{type:"question-circle-o"}))))},I),w.default.createElement(c.default,{checked:this.state.is_mock_open,onChange:this.onChange,checkedChildren:"开",unCheckedChildren:"关"})),w.default.createElement(S,(0,o.default)({label:"Mock脚本"},I),w.default.createElement(x.default,{data:this.state.project_mock_script,onChange:this.handleMockJsInput,style:{minHeight:"500px"}})),w.default.createElement(S,R,w.default.createElement(u.default,{type:"primary",htmlType:"submit",onClick:this.handleSubmit},"保存"))))}}]),a}(w.Component),(0,b.default)(_,"propTypes",{form:C.default.object,match:C.default.object,projectId:C.default.number,updateProjectMock:C.default.func,projectMsg:C.default.object,getProject:C.default.func}),E=k))||E)||E;t.default=D},1580:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(30));a(203);var u=r(a(210));a(1581);var o=r(a(1636));a(123);var c=r(a(126));a(53);var i=r(a(54));a(57);var s=r(a(51));a(64);var d=r(a(49));a(230);var f=r(a(231));a(33);var p=r(a(25));a(55);var m=r(a(45));a(134);var h=r(a(135));a(38);var y=r(a(39)),v=r(a(31)),g=r(a(9)),b=r(a(10)),E=r(a(23)),_=r(a(11)),k=r(a(12)),j=r(a(13)),w=r(a(5));a(71);var O,C,x,P=r(a(61)),N=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=L(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),M=r(a(0)),S=a(103),I=a(22),R=r(a(204)),D=a(103),T=a(75),q=r(a(394));function L(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(L=function(e){return e?a:t})(e)}function A(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,j.default)(e);if(t){var n=(0,j.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,k.default)(this,a)}}function B(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function W(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?B(Object(a),!0).forEach((function(t){(0,w.default)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):B(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}a(423);var G=P.default.Option,F=function(e){return e.map((function(e,t){return W(W({},e),{},{key:t})}))},U=(0,I.connect)((function(e){return{projectMsg:e.project.currProject,uid:e.user.uid,projectList:e.project.projectList}}),{fetchGroupMemberList:D.fetchGroupMemberList,getProjectMemberList:T.getProjectMemberList,addMember:T.addMember,delMember:T.delMember,fetchGroupMsg:S.fetchGroupMsg,changeMemberRole:T.changeMemberRole,getProject:T.getProject,fetchProjectList:T.fetchProjectList,changeMemberEmailNotice:T.changeMemberEmailNotice})((x=C=function(e){(0,_.default)(r,e);var t,a=A(r);function r(e){var t;return(0,g.default)(this,r),t=a.call(this,e),(0,w.default)((0,E.default)(t),"showAddMemberModal",(function(){t.setState({visible:!0})})),(0,w.default)((0,E.default)(t),"showImportMemberModal",(0,v.default)(l.default.mark((function e(){return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.props.fetchProjectList(t.props.projectMsg.group_id);case 2:t.setState({modalVisible:!0});case 3:case"end":return e.stop()}}),e)})))),(0,w.default)((0,E.default)(t),"reFetchList",(function(){t.props.getProjectMemberList(t.props.match.params.id).then((function(e){t.setState({projectMemberList:F(e.payload.data.data),visible:!1,modalVisible:!1})}))})),(0,w.default)((0,E.default)(t),"handleOk",(function(){t.addMembers(t.state.inputUids)})),(0,w.default)((0,E.default)(t),"addMembers",(function(e){t.props.addMember({id:t.props.match.params.id,member_uids:e,role:t.state.inputRole}).then((function(e){if(!e.payload.data.errcode){var a=e.payload.data.data,r=a.add_members,n=a.exist_members,l=r.length,u=n.length;t.setState({inputRole:"dev",inputUids:[]}),y.default.success("添加成功! 已成功添加 ".concat(l," 人，其中 ").concat(u," 人已存在")),t.reFetchList()}}))})),(0,w.default)((0,E.default)(t),"changeNewMemberRole",(function(e){t.setState({inputRole:e})})),(0,w.default)((0,E.default)(t),"deleteConfirm",(function(e){return function(){var a=t.props.match.params.id;t.props.delMember({id:a,member_uid:e}).then((function(e){e.payload.data.errcode||(y.default.success(e.payload.data.errmsg),t.reFetchList())}))}})),(0,w.default)((0,E.default)(t),"changeUserRole",(function(e){var a=t.props.match.params.id,r=e.split("-")[0],n=e.split("-")[1];t.props.changeMemberRole({id:a,member_uid:n,role:r}).then((function(e){e.payload.data.errcode||(y.default.success(e.payload.data.errmsg),t.reFetchList())}))})),(0,w.default)((0,E.default)(t),"changeEmailNotice",function(){var e=(0,v.default)(l.default.mark((function e(a,r){var n;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.props.match.params.id,e.next=3,t.props.changeMemberEmailNotice({id:n,member_uid:r,notice:a});case 3:t.reFetchList();case 4:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}()),(0,w.default)((0,E.default)(t),"handleCancel",(function(){t.setState({visible:!1})})),(0,w.default)((0,E.default)(t),"handleModalCancel",(function(){t.setState({modalVisible:!1})})),(0,w.default)((0,E.default)(t),"handleChange",(function(e){t.setState({selectProjectId:e})})),(0,w.default)((0,E.default)(t),"handleModalOk",(0,v.default)(l.default.mark((function e(){var a,r;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.props.getProjectMemberList(t.state.selectProjectId);case 2:a=e.sent,r=a.payload.data.data.map((function(e){return e.uid})),t.addMembers(r);case 5:case"end":return e.stop()}}),e)})))),(0,w.default)((0,E.default)(t),"onUserSelect",(function(e){t.setState({inputUids:e})})),t.state={groupMemberList:[],projectMemberList:[],groupName:"",role:"",visible:!1,dataSource:[],inputUids:[],inputRole:"dev",modalVisible:!1,selectProjectId:0},t}return(0,b.default)(r,[{key:"componentWillMount",value:(t=(0,v.default)(l.default.mark((function e(){var t,a,r;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.props.fetchGroupMemberList(this.props.projectMsg.group_id);case 2:return t=e.sent,e.next=5,this.props.fetchGroupMsg(this.props.projectMsg.group_id);case 5:return a=e.sent,e.next=8,this.props.getProjectMemberList(this.props.match.params.id);case 8:r=e.sent,this.setState({groupMemberList:t.payload.data.data,groupName:a.payload.data.data.group_name,projectMemberList:F(r.payload.data.data),role:this.props.projectMsg.role});case 10:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"render",value:function(){var e=this,t="owner"===this.state.role||"admin"===this.state.role,a=[{title:this.props.projectMsg.name+" 项目成员 ("+this.state.projectMemberList.length+") 人",dataIndex:"username",key:"username",render:function(a,r){return N.default.createElement("div",{className:"m-user"},N.default.createElement("img",{src:"/api/user/avatar?uid="+r.uid,className:"m-user-img"}),N.default.createElement("p",{className:"m-user-name"},a),N.default.createElement(m.default,{placement:"top",title:"邮件通知"},N.default.createElement("span",null,N.default.createElement(h.default,{size:"small",checkedChildren:"开",unCheckedChildren:"关",checked:r.email_notice,disabled:!(t||r.uid===e.props.uid),onChange:function(t){return e.changeEmailNotice(t,r.uid)}}))))}},{title:"owner"===this.state.role||"admin"===this.state.role?N.default.createElement("div",{className:"btn-container"},N.default.createElement(p.default,{className:"btn",type:"primary",icon:"plus",onClick:this.showAddMemberModal},"添加成员"),N.default.createElement(p.default,{className:"btn",icon:"plus",onClick:this.showImportMemberModal},"批量导入成员")):"",key:"action",className:"member-opration",render:function(t,a){return"owner"===e.state.role||"admin"===e.state.role?N.default.createElement("div",null,N.default.createElement(P.default,{value:a.role+"-"+a.uid,className:"select",onChange:e.changeUserRole},N.default.createElement(G,{value:"owner-"+a.uid},"组长"),N.default.createElement(G,{value:"dev-"+a.uid},"开发者"),N.default.createElement(G,{value:"guest-"+a.uid},"访客")),N.default.createElement(f.default,{placement:"topRight",title:"你确定要删除吗? ",onConfirm:e.deleteConfirm(a.uid),okText:"确定",cancelText:""},N.default.createElement(p.default,{type:"danger",icon:"delete",className:"btn-danger"}))):"owner"===a.role?"组长":"dev"===a.role?"开发者":"guest"===a.role?"访客":""}}],r=this.props.projectList.map((function(e,t){return N.default.createElement(G,{key:t,value:""+e._id},e.name)}));return N.default.createElement("div",{className:"",style:{height:"100%",overflowY:"auto"}},N.default.createElement("div",{className:"m-panel"},this.state.visible?N.default.createElement(i.default,{title:"添加成员",visible:this.state.visible,onOk:this.handleOk,onCancel:this.handleCancel},N.default.createElement(s.default,{gutter:6,className:"modal-input"},N.default.createElement(d.default,{span:"5"},N.default.createElement("div",{className:"label usernamelabel"},"用户名: ")),N.default.createElement(d.default,{span:"15"},N.default.createElement(q.default,{callbackState:this.onUserSelect}))),N.default.createElement(s.default,{gutter:6,className:"modal-input"},N.default.createElement(d.default,{span:"5"},N.default.createElement("div",{className:"label usernamelabel"},"权限: ")),N.default.createElement(d.default,{span:"15"},N.default.createElement(P.default,{defaultValue:"dev",className:"select",onChange:this.changeNewMemberRole},N.default.createElement(G,{value:"owner"},"组长"),N.default.createElement(G,{value:"dev"},"开发者"),N.default.createElement(G,{value:"guest"},"访客"))))):"",N.default.createElement(i.default,{title:"批量导入成员",visible:this.state.modalVisible,onOk:this.handleModalOk,onCancel:this.handleModalCancel},N.default.createElement(s.default,{gutter:6,className:"modal-input"},N.default.createElement(d.default,{span:"5"},N.default.createElement("div",{className:"label usernamelabel"},"项目名: ")),N.default.createElement(d.default,{span:"15"},N.default.createElement(P.default,{showSearch:!0,style:{width:200},placeholder:"请选择项目名称",optionFilterProp:"children",onChange:this.handleChange},r)))),N.default.createElement(c.default,{columns:a,dataSource:this.state.projectMemberList,pagination:!1,locale:{emptyText:N.default.createElement(R.default,{type:"noMemberInProject"})},className:"setting-project-member"}),N.default.createElement(u.default,{bordered:!1,title:this.state.groupName+" 分组成员 ("+this.state.groupMemberList.length+") 人",hoverable:!0,className:"setting-group"},this.state.groupMemberList.length?this.state.groupMemberList.map((function(t,a){return N.default.createElement("div",{key:a,className:"card-item"},N.default.createElement("img",{src:location.protocol+"//"+location.host+"/api/user/avatar?uid="+t.uid,className:"item-img"}),N.default.createElement("p",{className:"item-name"},t.username,t.uid===e.props.uid?N.default.createElement(o.default,{count:"我",style:{backgroundColor:"#689bd0",fontSize:"13px",marginLeft:"8px",borderRadius:"4px"}}):null),"owner"===t.role?N.default.createElement("p",{className:"item-role"},"组长"):null,"dev"===t.role?N.default.createElement("p",{className:"item-role"},"开发者"):null,"guest"===t.role?N.default.createElement("p",{className:"item-role"},"访客"):null)})):N.default.createElement(R.default,{type:"noMemberInGroup"}))))}}]),r}(N.PureComponent),(0,w.default)(C,"propTypes",{match:M.default.object,projectId:M.default.number,projectMsg:M.default.object,uid:M.default.number,addMember:M.default.func,delMember:M.default.func,changeMemberRole:M.default.func,getProject:M.default.func,fetchGroupMemberList:M.default.func,fetchGroupMsg:M.default.func,getProjectMemberList:M.default.func,fetchProjectList:M.default.func,projectList:M.default.array,changeMemberEmailNotice:M.default.func}),O=x))||O;t.default=U},1584:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(30));a(278);var u=r(a(151));a(136);var o=r(a(111));a(33);var c=r(a(25));a(48);var i=r(a(47));a(134);var s=r(a(135));a(55);var d=r(a(45));a(36);var f=r(a(4)),p=r(a(31));a(38);var m=r(a(39)),h=r(a(9)),y=r(a(10)),v=r(a(23)),g=r(a(11)),b=r(a(12)),E=r(a(13)),_=r(a(5));a(162);var k=r(a(127));a(53);var j=r(a(54));a(71);var w=r(a(61));a(662);var O=r(a(663)),C=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=L(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),x=r(a(0)),P=a(22);a(1589);var N,M,S,I=r(a(44)),R=r(a(174)),D=a(124),T=a(180),q=a(75);function L(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(L=function(e){return e?a:t})(e)}function A(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,E.default)(e);if(t){var n=(0,E.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,b.default)(this,a)}}var B=O.default.Dragger,W=w.default.Option,G=j.default.confirm,F=a(141),U=k.default.Group,V={},H={},z=a(1590);var J=(0,P.connect)((function(e){return{curCatid:- -e.inter.curdata.catid,basePath:e.project.currProject.basepath,updateLogList:e.news.updateLogList,swaggerUrlData:e.project.swaggerUrlData}}),{saveImportData:D.saveImportData,fetchUpdateLogData:T.fetchUpdateLogData,handleSwaggerUrlData:q.handleSwaggerUrlData})((S=M=function(e){(0,g.default)(a,e);var t=A(a);function a(e){var r;return(0,h.default)(this,a),r=t.call(this,e),(0,_.default)((0,v.default)(r),"uploadChange",(function(e){var t=e.file.status;"uploading"!==t&&console.log(e.file,e.fileList),"done"===t?m.default.success("".concat(e.file.name," 文件上传成功")):"error"===t&&m.default.error("".concat(e.file.name," 文件上传失败"))})),(0,_.default)((0,v.default)(r),"handleAddInterface",function(){var e=(0,p.default)(l.default.mark((function e(t){return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,z(t,r.props.match.params.id,r.state.selectCatid,r.state.menuList,r.props.basePath,r.state.dataSync,m.default.error,m.default.success,(function(){return r.setState({showLoading:!1})}));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),(0,_.default)((0,v.default)(r),"handleFile",(function(e){if(!r.state.curImportType)return m.default.error("请选择导入数据的方式");if(r.state.selectCatid){r.setState({showLoading:!0});var t=new FileReader;t.readAsText(e.file),t.onload=function(){var e=(0,p.default)(l.default.mark((function e(t){return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,V[r.state.curImportType].run(t.target.result);case 2:if(t=e.sent,"merge"!==r.state.dataSync){e.next=7;break}r.showConfirm(t),e.next=9;break;case 7:return e.next=9,r.handleAddInterface(t);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}else m.default.error("请选择上传的默认分类")})),(0,_.default)((0,v.default)(r),"showConfirm",function(){var e=(0,p.default)(l.default.mark((function e(t){var a,n,u,o,c,i;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=(0,v.default)(r),n=r.props.match.params.id,u=t.apis.map((function(e){return{method:e.method,path:e.path}})),e.next=5,r.props.fetchUpdateLogData({type:"project",typeid:n,apis:u});case 5:o=e.sent,c=o.payload.data.data,i=G({title:"您确认要进行数据同步????",width:600,okType:"danger",iconType:"exclamation-circle",className:"dataImport-confirm",okText:"确认",cancelText:"取消",content:C.default.createElement("div",{className:"postman-dataImport-modal"},C.default.createElement("div",{className:"postman-dataImport-modal-content"},c.map((function(e,t){return C.default.createElement("div",{key:t,className:"postman-dataImport-show-diff"},C.default.createElement("span",{className:"logcontent",dangerouslySetInnerHTML:{__html:e.content}}))}))),C.default.createElement("p",{className:"info"},"温馨提示： 数据同步后，可能会造成原本的修改数据丢失")),onOk:function(){return(0,p.default)(l.default.mark((function e(){return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.handleAddInterface(t);case 2:case"end":return e.stop()}}),e)})))()},onCancel:function(){a.setState({showLoading:!1,dataSync:"normal"}),i.destroy()}});case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),(0,_.default)((0,v.default)(r),"handleImportType",(function(e){r.setState({curImportType:e,isSwaggerUrl:!1})})),(0,_.default)((0,v.default)(r),"handleExportType",(function(e){r.setState({curExportType:e,isWiki:!1})})),(0,_.default)((0,v.default)(r),"onChange",(function(e){r.setState({dataSync:e})})),(0,_.default)((0,v.default)(r),"handleUrlChange",(function(e){r.setState({isSwaggerUrl:e})})),(0,_.default)((0,v.default)(r),"swaggerUrlInput",(function(e){r.setState({swaggerUrl:e})})),(0,_.default)((0,v.default)(r),"onUrlUpload",(0,p.default)(l.default.mark((function e(){var t;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.state.curImportType){e.next=2;break}return e.abrupt("return",m.default.error("请选择导入数据的方式"));case 2:if(r.state.swaggerUrl){e.next=4;break}return e.abrupt("return",m.default.error("url 不能为空"));case 4:if(!r.state.selectCatid){e.next=26;break}return r.setState({showLoading:!0}),e.prev=6,e.next=9,r.props.handleSwaggerUrlData(r.state.swaggerUrl);case 9:return e.next=11,V[r.state.curImportType].run(r.props.swaggerUrlData);case 11:if(t=e.sent,"merge"!==r.state.dataSync){e.next=16;break}r.showConfirm(t),e.next=18;break;case 16:return e.next=18,r.handleAddInterface(t);case 18:e.next=24;break;case 20:e.prev=20,e.t0=e.catch(6),r.setState({showLoading:!1}),m.default.error(e.t0.message);case 24:e.next=27;break;case 26:m.default.error("请选择上传的默认分类");case 27:case"end":return e.stop()}}),e,null,[[6,20]])})))),(0,_.default)((0,v.default)(r),"handleChange",(function(e){r.setState({exportContent:e.target.value})})),(0,_.default)((0,v.default)(r),"handleWikiChange",(function(e){r.setState({isWiki:e.target.checked})})),r.state={selectCatid:"",menuList:[],curImportType:"swagger",curExportType:null,showLoading:!1,dataSync:"merge",exportContent:"all",isSwaggerUrl:!1,swaggerUrl:"",isWiki:!1},r}return(0,y.default)(a,[{key:"componentWillMount",value:function(){var e=this;I.default.get("/api/interface/getCatMenu?project_id=".concat(this.props.match.params.id)).then((function(t){if(0===t.data.errcode){var a=t.data.data;e.setState({menuList:a,selectCatid:a[0]._id})}})),F.emitHook("import_data",V),F.emitHook("export_data",H,this.props.match.params.id)}},{key:"selectChange",value:function(e){this.setState({selectCatid:+e})}},{key:"render",value:function(){var e=this,t={name:"interfaceData",multiple:!0,showUploadList:!1,action:"/api/interface/interUpload",customRequest:this.handleFile,onChange:this.uploadChange},a=function(e,t,a){if(e){var r=R.default.parse(e,!0),n={};return n=Object.assign(n,r.query,{status:t,isWiki:a}),R.default.format({pathname:r.pathname,query:n})}}(this.state.curExportType&&H[this.state.curExportType]&&H[this.state.curExportType].route,this.state.exportContent,this.state.isWiki);return C.default.createElement("div",{className:"g-row"},C.default.createElement("div",{className:"m-panel"},C.default.createElement("div",{className:"postman-dataImport"},C.default.createElement("div",{className:"dataImportCon"},C.default.createElement("div",null,C.default.createElement("h3",null,"数据导入 ",C.default.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"https://hellosean1025.github.io/yapi/documents/data.html"},C.default.createElement(d.default,{title:"点击查看文档"},C.default.createElement(f.default,{type:"question-circle-o"}))))),C.default.createElement("div",{className:"dataImportTile"},C.default.createElement(w.default,{placeholder:"请选择导入数据的方式",value:this.state.curImportType,onChange:this.handleImportType},Object.keys(V).map((function(e){return C.default.createElement(W,{key:e,value:e},V[e].name)})))),C.default.createElement("div",{className:"catidSelect"},C.default.createElement(w.default,{value:this.state.selectCatid+"",showSearch:!0,style:{width:"100%"},placeholder:"请选择数据导入的默认分类",optionFilterProp:"children",onChange:this.selectChange.bind(this),filterOption:function(e,t){return t.props.children.toLowerCase().indexOf(e.toLowerCase())>=0}},this.state.menuList.map((function(e,t){return C.default.createElement(W,{key:t,value:e._id+""},e.name)})))),C.default.createElement("div",{className:"dataSync"},C.default.createElement("span",{className:"label"},"数据同步 ",C.default.createElement(d.default,{title:C.default.createElement("div",null,C.default.createElement("h3",{style:{color:"white"}},"普通模式"),C.default.createElement("p",null,"不导入已存在的接口"),C.default.createElement("br",null),C.default.createElement("h3",{style:{color:"white"}},"智能合并"),C.default.createElement("p",null,"已存在的接口，将合并返回数据的 response，适用于导入了 swagger 数据，保留对数据结构的改动"),C.default.createElement("br",null),C.default.createElement("h3",{style:{color:"white"}},"完全覆盖"),C.default.createElement("p",null,"不保留旧数据，完全使用新数据，适用于接口定义完全交给后端定义"))},C.default.createElement(f.default,{type:"question-circle-o"}))," "),C.default.createElement(w.default,{value:this.state.dataSync,onChange:this.onChange},C.default.createElement(W,{value:"normal"},"普通模式"),C.default.createElement(W,{value:"good"},"智能合并"),C.default.createElement(W,{value:"merge"},"完全覆盖"))),"swagger"===this.state.curImportType&&C.default.createElement("div",{className:"dataSync"},C.default.createElement("span",{className:"label"},"开启url导入 ",C.default.createElement(d.default,{title:"swagger url 导入"},C.default.createElement(f.default,{type:"question-circle-o"}))," ","  "),C.default.createElement(s.default,{checked:this.state.isSwaggerUrl,onChange:this.handleUrlChange})),this.state.isSwaggerUrl?C.default.createElement("div",{className:"import-content url-import-content"},C.default.createElement(i.default,{placeholder:"http://demo.swagger.io/v2/swagger.json",onChange:function(t){return e.swaggerUrlInput(t.target.value)}}),C.default.createElement(c.default,{type:"primary",className:"url-btn",onClick:this.onUrlUpload,loading:this.state.showLoading},"上传")):C.default.createElement("div",{className:"import-content"},C.default.createElement(o.default,{spinning:this.state.showLoading,tip:"上传中..."},C.default.createElement(B,t,C.default.createElement("p",{className:"ant-upload-drag-icon"},C.default.createElement(f.default,{type:"inbox"})),C.default.createElement("p",{className:"ant-upload-text"},"点击或者拖拽文件到上传区域"),C.default.createElement("p",{className:"ant-upload-hint",onClick:function(e){e.stopPropagation()},dangerouslySetInnerHTML:{__html:this.state.curImportType?V[this.state.curImportType].desc:null}}))))),C.default.createElement("div",{className:"dataImportCon",style:{marginLeft:"20px",display:Object.keys(H).length>0?"":"none"}},C.default.createElement("div",null,C.default.createElement("h3",null,"数据导出")),C.default.createElement("div",{className:"dataImportTile"},C.default.createElement(w.default,{placeholder:"请选择导出数据的方式",onChange:this.handleExportType},Object.keys(H).map((function(e){return C.default.createElement(W,{key:e,value:e},H[e].name)})))),C.default.createElement("div",{className:"dataExport"},C.default.createElement(U,{defaultValue:"all",onChange:this.handleChange},C.default.createElement(k.default,{value:"all"},"全部接口"),C.default.createElement(k.default,{value:"open"},"公开接口"))),C.default.createElement("div",{className:"export-content"},this.state.curExportType?C.default.createElement("div",null,C.default.createElement("p",{className:"export-desc"},H[this.state.curExportType].desc),C.default.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:a},C.default.createElement(c.default,{className:"export-button",type:"primary",size:"large"}," ","导出"," ")),C.default.createElement(u.default,{checked:this.state.isWiki,onChange:this.handleWikiChange,className:"wiki-btn",disabled:"json"===this.state.curExportType},"添加wiki ",C.default.createElement(d.default,{title:"开启后 html 和 markdown 数据导出会带上wiki数据"},C.default.createElement(f.default,{type:"question-circle-o"}))," ")):C.default.createElement(c.default,{disabled:!0,className:"export-button",type:"primary",size:"large"}," ","导出"," "))))))}}]),a}(C.PureComponent),(0,_.default)(M,"propTypes",{match:x.default.object,curCatid:x.default.number,basePath:x.default.string,saveImportData:x.default.func,fetchUpdateLogData:x.default.func,updateLogList:x.default.array,handleSwaggerUrlData:x.default.func,swaggerUrlData:x.default.string}),N=S))||N;t.default=J},1589:function(e,t,a){},1590:function(e,t,a){"use strict";(function(t){var r=a(3),n=r(a(30)),l=r(a(31)),u=r(a(7)),o=a(79),c=a(44),i="object"==(void 0===t?"undefined":(0,u.default)(t))&&t.global===t;function s(){return(s=(0,l.default)(n.default.mark((function e(t,a,r,s,d,f,p,m,h,y,v){var g,b,E;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g=o.throttle((function(e,t){m("正在导入，已执行任务 ".concat(e+1," 个，共 ").concat(t," 个"))}),3e3),b=function(){var e=(0,l.default)(n.default.mark((function e(t){var r,l,d,f;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r={},!t||!Array.isArray(t)){e.next=12;break}l=n.default.mark((function e(l){var u,d,f,m,g;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=t[l],d=o.find(s,(function(e){return e.name===u.name})),r[u.name]=u,!d){e.next=7;break}u.id=d._id,e.next=18;break;case 7:return f="/api/interface/add_cat",i&&(f="http://127.0.0.1:"+v+f),m={name:u.name,project_id:a,desc:u.desc,token:y},e.next=12,c.post(f,m);case 12:if(!(g=e.sent).data.errcode){e.next=17;break}return p(g.data.errmsg),h({showLoading:!1}),e.abrupt("return",{v:!1});case 17:u.id=g.data.data._id;case 18:case"end":return e.stop()}}),e)})),d=0;case 4:if(!(d<t.length)){e.next=12;break}return e.delegateYield(l(d),"t0",6);case 6:if(f=e.t0,"object"!==(0,u.default)(f)){e.next=9;break}return e.abrupt("return",f.v);case 9:d++,e.next=4;break;case 12:return e.abrupt("return",r);case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),E=function(){var e=(0,l.default)(n.default.mark((function e(t){var l,o,s,E,_,k,j,w,O,C,x,P,N,M;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,b(t.cats);case 2:if(!1!==(l=e.sent)){e.next=5;break}return e.abrupt("return");case 5:if(o=t.apis,s=o.length,E=0,_=s,k=0,0!==s){e.next=14;break}return p("解析数据为空"),h({showLoading:!1}),e.abrupt("return");case 14:if(!t.basePath){e.next=19;break}return j="/api/project/up",i&&(j="http://127.0.0.1:"+v+j),e.next=19,c.post(j,{id:a,basepath:t.basePath,token:y});case 19:w=0;case 20:if(!(w<o.length)){e.next=58;break}if(O=o[w],C=Object.assign(O,{project_id:a,catid:r}),d&&(C.path=0===C.path.indexOf(d)?C.path.substr(d.length):C.path),C.catname&&l[C.catname]&&"object"===(0,u.default)(l[C.catname])&&l[C.catname].id&&(C.catid=l[C.catname].id),C.token=y,"normal"===f){e.next=37;break}return E++,x="/api/interface/save",i&&(x="http://127.0.0.1:"+v+x),C.dataSync=f,e.next=33,c.post(x,C);case 33:(P=e.sent).data.errcode?(_--,h({showLoading:!1}),p(P.data.errmsg)):k+=P.data.data.length,e.next=50;break;case 37:return E++,N="/api/interface/add",i&&(N="http://127.0.0.1:"+v+N),e.next=42,c.post(N,C);case 42:if(!(M=e.sent).data.errcode){e.next=50;break}if(_--,40022==M.data.errcode&&k++,40033!=M.data.errcode){e.next=50;break}return h({showLoading:!1}),p("没有权限"),e.abrupt("break",58);case 50:if(E!==s){e.next=54;break}return h({showLoading:!1}),m("成功导入接口 ".concat(_," 个, 已存在的接口 ").concat(k," 个")),e.abrupt("return");case 54:g(w,o.length);case 55:w++,e.next=20;break;case 58:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.next=5,E(t);case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}e.exports=function(e,t,a,r,n,l,u,o,c,i,d){return s.apply(this,arguments)}}).call(this,a(60))},1591:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(30)),u=r(a(58)),o=r(a(31)),c=r(a(9)),i=r(a(10)),s=r(a(23)),d=r(a(11)),f=r(a(12)),p=r(a(13)),m=r(a(5));a(137);var h=r(a(90));a(146);var y=r(a(147)),v=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=N(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),g=r(a(0)),b=a(40),E=a(22);a(601);var _,k,j,w=r(a(637)),O=r(a(638)),C=r(a(657)),x=a(75),P=a(167);function N(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(N=function(e){return e?a:t})(e)}function M(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,p.default)(e);if(t){var n=(0,p.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,f.default)(this,a)}}var S=y.default.Content,I=y.default.Sider,R={path:"/project/:id/interfaceCol/:action/:actionId",exact:!0},D=(h.default.SubMenu,function(e){var t;return console.log("----------"),console.log(e.match.params.action),t="col"===e.match.params.action?O.default:(e.match.params.action,C.default),v.default.createElement(t,e)});D.propTypes={match:g.default.object};var T=(0,E.connect)((function(e){return{isShowCol:e.interfaceCol.isShowCol}}),{setColData:P.setColData,getProject:x.getProject})((j=k=function(e){(0,d.default)(r,e);var t,a=M(r);function r(e){var t;return(0,c.default)(this,r),t=a.call(this,e),(0,m.default)((0,s.default)(t),"onChange",(function(e){var a=t.props.match.params;"colOrCase"===e&&(e=t.props.isShowCol?"col":"case"),t.props.history.push("/project/"+a.id+"/interfaceCol/"+e)})),t}return(0,i.default)(r,[{key:"componentWillMount",value:(t=(0,o.default)(l.default.mark((function e(){return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.props.setColData({isShowCol:!0});case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"render",value:function(){this.props.match.params.action;return v.default.createElement(y.default,{style:{height:"calc(100vh - 80px)",overflow:"hidden"}},v.default.createElement(I,{style:{height:"100%",overflow:"hidden",backgroundColor:"#fff"},width:300},v.default.createElement("div",{className:"left-menu",style:{height:parseInt(document.body.clientHeight)-80+"px"}},v.default.createElement(w.default,{router:(0,b.matchPath)(this.props.location.pathname,R),projectId:this.props.match.params.id}))),v.default.createElement(y.default,null,v.default.createElement(S,{style:{height:"100%",overflow:"hidden",border:"1px solid #D9D9D9",borderLeft:"0px solid #D9D9D9",backgroundColor:"#fff"}},v.default.createElement("div",{className:"right-content"},v.default.createElement(b.Switch,null,v.default.createElement(b.Route,{exact:!0,path:"/project/:id/interfaceCol/:action",component:D}),v.default.createElement(b.Route,(0,u.default)({},R,{component:D})))))))}}]),r}(v.PureComponent),(0,m.default)(k,"propTypes",{match:g.default.object,history:g.default.object,location:g.default.object,isShowCol:g.default.bool,getProject:g.default.func,setColData:g.default.func}),_=j))||_;t.default=T},1592:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(30));a(144);var u=r(a(166));a(196);var o=r(a(153));a(137);var c=r(a(90));a(36);var i=r(a(4));a(33);var s=r(a(25)),d=r(a(31)),f=r(a(9)),p=r(a(10)),m=r(a(23)),h=r(a(11)),y=r(a(12)),v=r(a(13)),g=r(a(5));a(53);var b=r(a(54));a(148);var E=r(a(149));a(146);var _,k,j,w=r(a(147)),O=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=R(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),C=r(a(0)),x=a(40),P=a(22),N=a(182),M=a(102),S=r(a(1593)),I=r(a(1594));function R(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(R=function(e){return e?a:t})(e)}function D(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,v.default)(e);if(t){var n=(0,v.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,y.default)(this,a)}}var T=w.default.Content,q=(w.default.Sider,E.default.TreeNode),L=b.default.confirm,A=(0,P.connect)((function(e){return{statusCodeGroupList:[]}}))((j=k=function(e){(0,h.default)(y,e);var t,a,r,n=D(y);function y(e){var t;return(0,f.default)(this,y),t=n.call(this,e),(0,g.default)((0,m.default)(t),"leaveItem",(function(){t.setState({delIcon:null})})),t.state={statusCodeGroupList:[],editGroupId:null},t}return(0,p.default)(y,[{key:"queryGroupList",value:(r=(0,d.default)(l.default.mark((function e(){var t=this;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:M.axios.get("/api/statusCode/group/list?projectId="+this.props.match.params.id).then((function(e){t.setState({statusCodeGroupList:e.data})}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"selectedGroup",value:(a=(0,d.default)(l.default.mark((function e(t){return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&0!=t.length){e.next=2;break}return e.abrupt("return");case 2:this.props.history.push("/project/"+this.props.match.params.id+"/statusCode/list/"+t[0]);case 3:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"editGroup",value:function(e){this.setState({editGroupId:e,add_group_modal_visible:!0})}},{key:"delGroup",value:function(e){var t=this;L({title:"确定删除此分组吗？",content:"温馨提示：该操作会删除该分组下所有状态码，删除后无法恢复",okText:"确认",cancelText:"取消",onOk:function(){return(0,d.default)(l.default.mark((function a(){return l.default.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:M.axios.post("/api/statusCode/group/del",{groupId:e}).then((function(){t.queryGroupList()}));case 1:case"end":return a.stop()}}),a)})))()},onCancel:function(){}})}},{key:"componentDidMount",value:(t=(0,d.default)(l.default.mark((function e(){var t;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=this.props.match.params,this.setState({projectId:t.id}),this.queryGroupList();case 3:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"render",value:function(){var e=this;return O.default.createElement(N.ReflexContainer,{style:{height:"calc(100vh - 80px)"},orientation:"vertical"},O.default.createElement(N.ReflexElement,{style:{height:"100%",overflow:"hidden",borderLeft:"1px solid #D9D9D9",border:"1px solid #D9D9D9",backgroundColor:"#fff"},id:"interface-sider",size:250},this.state.add_group_modal_visible?O.default.createElement(S.default,{visible:this.state.add_group_modal_visible,projectId:this.state.projectId,groupId:this.state.editGroupId,onCancel:function(){e.setState({add_group_modal_visible:!1})},onSubmit:function(){e.setState({add_group_modal_visible:!1}),e.queryGroupList()}}):"",O.default.createElement("div",{className:"left-menu",style:{height:parseInt(document.body.clientHeight)-80+"px"}},O.default.createElement("div",{style:{padding:"8px 10px",borderBottom:"1px solid #D9D9D9"}},O.default.createElement(s.default,{icon:"plus",type:"primary",onClick:function(){e.setState({editGroupId:null,add_group_modal_visible:!0})}},"添加分组")),O.default.createElement(c.default,{mode:"inline"},O.default.createElement(c.default.Item,{className:"item",style:{borderBottom:"1px dashed #D9D9D9"}},O.default.createElement(x.Link,{to:"/project/"+this.props.match.params.id+"/statusCode/list"},O.default.createElement(i.default,{type:"menu",style:{marginRight:5}}),"所有状态码"))),this.state.statusCodeGroupList.length<=0?O.default.createElement(o.default,{description:"还没有状态码哦~"}):"",O.default.createElement(E.default,{onSelect:function(t){e.selectedGroup(t)}},this.state.statusCodeGroupList.map((function(t){return O.default.createElement(q,{key:t._id,title:O.default.createElement("div",{onMouseLeave:e.leaveItem},t.groupName,O.default.createElement("div",{className:"btns"},O.default.createElement(u.default,{placement:"leftTop",content:O.default.createElement("div",{className:"IM-menu"},O.default.createElement("div",null,O.default.createElement("span",{onClick:function(a){a.stopPropagation(),e.editGroup(t._id)}},O.default.createElement(i.default,{type:"edit"})," 编辑")),O.default.createElement("div",null,O.default.createElement("span",{onClick:function(a){a.stopPropagation(),e.delGroup(t._id)}},O.default.createElement(i.default,{type:"delete"})," 删除")))},O.default.createElement(i.default,{type:"ellipsis"}))))})}))))),O.default.createElement(N.ReflexSplitter,null),O.default.createElement(N.ReflexElement,null,O.default.createElement(T,{style:{height:"100%",overflow:"hidden",border:"1px solid #D9D9D9",borderLeft:"0px solid #D9D9D9",backgroundColor:"#fff"}},O.default.createElement(x.Switch,null,O.default.createElement(x.Route,{path:"/project/:id/statusCode/list/:groupId",component:I.default}),O.default.createElement(x.Route,{path:"/project/:id/statusCode",component:I.default})))))}}]),y}(O.PureComponent),(0,g.default)(k,"propTypes",{match:C.default.object,history:C.default.object,projectId:C.default.string}),_=j))||_;t.default=A},1593:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(53);var l=r(a(54));a(33);var u=r(a(25)),o=r(a(58));a(48);var c=r(a(47));a(38);var i=r(a(39)),s=r(a(9)),d=r(a(10)),f=r(a(23)),p=r(a(11)),m=r(a(12)),h=r(a(13)),y=r(a(5));a(82);var v=r(a(84)),g=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=_(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),b=(a(22),r(a(0))),E=a(102);function _(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(_=function(e){return e?a:t})(e)}function k(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,h.default)(e);if(t){var n=(0,h.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,m.default)(this,a)}}var j=v.default.Item;var w=function(e){(0,p.default)(a,e);var t=k(a);function a(e){var r;return(0,s.default)(this,a),r=t.call(this,e),(0,y.default)((0,f.default)(r),"onSubmit",(function(e){e.preventDefault(),r.props.form.validateFields((function(e,t){e||(r.state.group&&r.state.group._id?(t.projectId=r.state.group.projectId,t.parentId=r.state.group.parentId,t.inedx=r.state.group.inedx,t._id=r.state.group._id):t.projectId=r.props.projectId,E.axios.post("/api/statusCode/group/save",t).then((function(e){if(0!==e.errcode)return i.default.error("".concat(e.errmsg,", 添加分组出现异常"));r.props.form.resetFields(),r.props.onSubmit&&r.props.onSubmit()})))}))})),r.state={visible:r.props.visible,group:{}},r}return(0,d.default)(a,[{key:"componentDidMount",value:function(){this.props.groupId&&this.loadGroup(this.props.groupId)}},{key:"loadGroup",value:function(e){var t=this;E.axios.get("/api/statusCode/group/get",{params:{groupId:e}}).then((function(e){console.log(e.data),t.setState({group:e.data})}))}},{key:"render",value:function(){var e,t=this,a=this.props.form,r=a.getFieldDecorator,n=a.getFieldsError,i={labelCol:{xs:{span:24},sm:{span:6}},wrapperCol:{xs:{span:24},sm:{span:14}}};return g.default.createElement(l.default,{title:"添加分组",footer:"",visible:this.props.visible,className:"addcatmodal",onCancel:function(){t.props.form.resetFields(),t.props.onCancel&&t.props.onCancel()}},g.default.createElement(v.default,{onSubmit:this.onSubmit},g.default.createElement(j,(0,o.default)({},i,{label:"分组名"}),r("groupName",{rules:[{required:!0,message:"请输入分类名称!"}],initialValue:this.state.group&&this.state.group.groupName||null})(g.default.createElement(c.default,{placeholder:"分类名称"}))),g.default.createElement(j,(0,o.default)({},i,{label:"描述"}),r("desc",{initialValue:this.state.group&&this.state.group.desc||null})(g.default.createElement(c.default,{placeholder:"描述"}))),g.default.createElement(j,{className:"catModalfoot",wrapperCol:{span:24,offset:8}},g.default.createElement(u.default,{onClick:function(){t.props.form.resetFields(),t.props.onCancel&&t.props.onCancel()},style:{marginRight:"10px"}},"取消"),g.default.createElement(u.default,{type:"primary",htmlType:"submit",disabled:(e=n(),Object.keys(e).some((function(t){return e[t]})))},"提交"))))}}]),a}(g.PureComponent);(0,y.default)(w,"propTypes",{form:b.default.object,visible:b.default.bool,projectId:b.default.string,groupId:b.default.number,onCancel:b.default.func,onSubmit:b.default.func});var O=v.default.create()(w);t.default=O},1594:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(30));a(123);var u=r(a(126));a(33);var o=r(a(25)),c=r(a(31)),i=r(a(9)),s=r(a(10)),d=r(a(11)),f=r(a(12)),p=r(a(13)),m=r(a(5));a(53);var h=r(a(54));a(148);var y=r(a(149));a(146);var v,g,b,E=r(a(147)),_=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=C(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),k=r(a(0)),j=(a(40),a(22)),w=a(102),O=r(a(1595));function C(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(C=function(e){return e?a:t})(e)}function x(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,p.default)(e);if(t){var n=(0,p.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,f.default)(this,a)}}E.default.Content,E.default.Sider,y.default.TreeNode;var P=h.default.confirm,N=(0,j.connect)((function(e){return{statusCodeList:[],projectId:null}}))((b=g=function(e){(0,d.default)(a,e);var t=x(a);function a(e){var r;return(0,i.default)(this,a),(r=t.call(this,e)).state={statusCodeList:[],projectId:null,editCodeId:null},r}return(0,s.default)(a,[{key:"queryCodeList",value:function(e){var t=this;!e&&this.state.groupId&&(e=this.state.groupId),w.axios.get("/api/statusCode/list",{params:{groupId:e,projectId:this.state.projectId}}).then((function(a){t.setState({statusCodeList:a.data,groupId:e})}))}},{key:"delete",value:function(e){var t=this;P({title:"确定删除此状态码吗？",content:"温馨提示：删除后无法恢复",okText:"确认",cancelText:"取消",onOk:function(){return(0,c.default)(l.default.mark((function a(){return l.default.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:w.axios.post("/api/statusCode/del",{id:e}).then((function(){t.queryCodeList()}));case 1:case"end":return a.stop()}}),a)})))()},onCancel:function(){}})}},{key:"componentWillMount",value:function(){var e=this,t=this.props.match.params,a=t.groupId,r=t.id;this.setState({projectId:r,groupId:a},(function(){e.queryCodeList()}))}},{key:"componentWillReceiveProps",value:function(e){var t=this,a=e.match.params.groupId,r=e.match.params.id;a?a&&a!==this.state.groupId&&(this.setState({projectId:r,groupId:a}),this.queryCodeList(a)):(this.setState({projectId:r,groupId:null},(function(){t.queryCodeList(a)})),console.log("没有groupId",e.match.params))}},{key:"render",value:function(){var e=this,t=[{title:"错误码",width:2,dataIndex:"code"},{title:"描述",width:5,dataIndex:"codeDescription"},{title:"操作",width:2,render:function(t,a){return _.default.createElement("div",null,_.default.createElement(o.default,{type:"link",onClick:function(t){t.stopPropagation(),e.setState({editCodeId:a._id,add_code_modal_visible:!0})}},"编辑"),_.default.createElement(o.default,{type:"link",onClick:function(t){t.stopPropagation(),e.delete(a._id)}},"删除"))}}];return _.default.createElement("div",{style:{backgroundColor:"#fff",height:"calc(100vh - 80px)"}},_.default.createElement("div",{style:{height:"30px",padding:"10px 10px "}},this.state.groupId?_.default.createElement(o.default,{icon:"plus",type:"primary",onClick:function(){e.setState({add_code_modal_visible:!0})}},"添加状态码"):""),!0===this.state.add_code_modal_visible?_.default.createElement(O.default,{id:this.state.editCodeId,visible:this.state.add_code_modal_visible,projectId:this.state.projectId,onSubmit:function(){e.queryCodeList(),e.setState({add_code_modal_visible:!1,editCodeId:null})},onCancel:function(){e.setState({add_code_modal_visible:!1,editCodeId:null})},groupId:this.state.groupId}):"",_.default.createElement("div",{style:{marginTop:"20px",overflowY:"auto",height:"calc(100vh - 130px)"}},_.default.createElement(u.default,{style:{margin:"10px 10px"},columns:t,dataSource:this.state.statusCodeList,bordered:!0,size:"small"})))}}]),a}(_.PureComponent),(0,m.default)(g,"propTypes",{match:k.default.object,projectId:k.default.string}),v=b))||v;t.default=N},1595:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(53);var l=r(a(54));a(33);var u=r(a(25)),o=r(a(58));a(48);var c=r(a(47));a(38);var i=r(a(39)),s=r(a(9)),d=r(a(10)),f=r(a(23)),p=r(a(11)),m=r(a(12)),h=r(a(13)),y=r(a(5));a(82);var v=r(a(84)),g=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=_(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),b=(a(22),r(a(0))),E=a(102);function _(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(_=function(e){return e?a:t})(e)}function k(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,h.default)(e);if(t){var n=(0,h.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,m.default)(this,a)}}var j=v.default.Item;var w=function(e){(0,p.default)(a,e);var t=k(a);function a(e){var r;return(0,s.default)(this,a),r=t.call(this,e),(0,y.default)((0,f.default)(r),"onSubmit",(function(e){e.preventDefault(),r.props.form.validateFields((function(e,t){if(!e){t.projectId=r.props.projectId,t.groupId=r.props.groupId;var a={projectId:r.props.projectId,groupId:r.props.groupId,code:t.code,codeDescription:t.codeDescription,_id:r.props.id};E.axios.post("/api/statusCode/save",a).then((function(e){if(0!==e.errcode)return i.default.error("".concat(e.errmsg,", 新增错误码出现异常"));r.props.onSubmit(e.data),r.props.form.resetFields()}))}}))})),r.state={data:null},r}return(0,d.default)(a,[{key:"componentDidMount",value:function(){this.props.id&&this.loadData(this.props.id)}},{key:"loadData",value:function(e){var t=this;E.axios.get("/api/statusCode/getById",{params:{id:e}}).then((function(e){t.setState({data:e.data})}))}},{key:"render",value:function(){var e,t=this,a=this.props.form,r=a.getFieldDecorator,n=a.getFieldsError,i={labelCol:{xs:{span:24},sm:{span:6}},wrapperCol:{xs:{span:24},sm:{span:14}}};return g.default.createElement(l.default,{destroyOnClose:!0,title:"添加状态码",footer:null,visible:this.props.visible,className:"addcatmodal",onCancel:function(){t.props.form.resetFields(),t.props.onCancel&&t.props.onCancel()}},g.default.createElement(v.default,{onSubmit:this.onSubmit},g.default.createElement(j,(0,o.default)({},i,{label:"code"}),r("code",{rules:[{required:!0,message:"请输入code!"}],initialValue:this.state.data&&this.state.data.code||null})(g.default.createElement(c.default,{placeholder:"code"}))),g.default.createElement(j,(0,o.default)({},i,{label:"描述"}),r("codeDescription",{initialValue:this.state.data&&this.state.data.codeDescription||null})(g.default.createElement(c.default,{placeholder:"描述"}))),g.default.createElement(j,{className:"catModalfoot",wrapperCol:{span:24,offset:8}},g.default.createElement(u.default,{onClick:function(){t.props.form.resetFields(),t.props.onCancel()},style:{marginRight:"10px"}},"取消"),g.default.createElement(u.default,{type:"primary",htmlType:"submit",disabled:(e=n(),Object.keys(e).some((function(t){return e[t]})))},"提交"))))}}]),a}(g.default.Component);(0,y.default)(w,"propTypes",{form:b.default.object,id:b.default.number,visible:b.default.bool,projectId:b.default.string,groupId:b.default.string,onCancel:b.default.func,onSubmit:b.default.func});var O=v.default.create()(w);t.default=O},1596:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(30));a(137);var u=r(a(90));a(144);var o=r(a(166));a(36);var c=r(a(4));a(196);var i=r(a(153));a(33);var s=r(a(25)),d=r(a(31)),f=r(a(9)),p=r(a(10)),m=r(a(23)),h=r(a(11)),y=r(a(12)),v=r(a(13)),g=r(a(5));a(53);var b=r(a(54));a(148);var E=r(a(149)),_=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=R(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),k=r(a(0)),j=a(40),w=a(22),O=a(182);r(a(1597)),a(212);a(1598);var C,x,P,N=a(102),M=r(a(1600)),S=(r(a(1601)),r(a(658))),I=r(a(424));function R(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(R=function(e){return e?a:t})(e)}function D(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,v.default)(e);if(t){var n=(0,v.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,y.default)(this,a)}}a(1602);E.default.TreeNode;var T=b.default.confirm,q=(0,w.connect)((function(e){return{statusCodeGroupList:[]}}))((P=x=function(e){(0,h.default)(n,e);var t,a,r=D(n);function n(e){var t;return(0,f.default)(this,n),t=r.call(this,e),(0,g.default)((0,m.default)(t),"leaveItem",(function(){t.setState({delIcon:null})})),t.state={statusCodeGroupList:[],statusCodeList:[],editGroupId:null,selectedGroupId:null},t}return(0,p.default)(n,[{key:"queryGroupList",value:(a=(0,d.default)(l.default.mark((function e(){var t=this;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:N.axios.get("/api/dataStructure/all?projectId="+this.props.match.params.projectId).then((function(e){t.setState({statusCodeGroupList:e.data})}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"queryCodeList",value:function(e){var t=this;!e&&this.state.groupId&&(e=this.state.groupId),N.axios.get("/api/dataStructure/list",{params:{groupId:e,projectId:this.state.projectId}}).then((function(a){t.setState({statusCodeList:a.data,groupId:e})}))}},{key:"addDataStructure",value:function(e){this.setState({selectedGroupId:e,add_code_modal_visible:!0})}},{key:"editGroup",value:function(e){this.setState({editGroupId:e,add_group_modal_visible:!0})}},{key:"delGroup",value:function(e){var t=this;T({title:"确定删除此分组吗？",content:"温馨提示：该操作会删除该分组下所有状态码，删除后无法恢复",okText:"确认",cancelText:"取消",onOk:function(){return(0,d.default)(l.default.mark((function a(){return l.default.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:N.axios.post("/api/dataStructure/group/del",{groupId:e}).then((function(){t.queryGroupList()}));case 1:case"end":return a.stop()}}),a)})))()},onCancel:function(){}})}},{key:"componentDidMount",value:(t=(0,d.default)(l.default.mark((function e(){var t;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=this.props.match.params,this.setState({projectId:t.projectId}),this.queryGroupList();case 3:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"render",value:function(){var e=this;return _.default.createElement(O.ReflexContainer,{style:{height:"calc(100vh - 80px)"},orientation:"vertical"},_.default.createElement(O.ReflexElement,{style:{height:"100%",overflow:"hidden",borderLeft:"1px solid #D9D9D9",border:"1px solid #D9D9D9",backgroundColor:"#fff"},id:"interface-sider",size:250},this.state.add_group_modal_visible?_.default.createElement(M.default,{visible:this.state.add_group_modal_visible,projectId:this.state.projectId,groupId:this.state.editGroupId,onCancel:function(){e.setState({add_group_modal_visible:!1})},onSubmit:function(){e.setState({add_group_modal_visible:!1}),e.queryGroupList()}}):"",!0===this.state.add_code_modal_visible?_.default.createElement(I.default,{id:this.state.editCodeId,visible:this.state.add_code_modal_visible,projectId:this.state.projectId,onSubmit:function(){e.queryGroupList(),e.setState({add_code_modal_visible:!1,editCodeId:null})},onCancel:function(){e.setState({add_code_modal_visible:!1,editCodeId:null})},groupId:this.state.selectedGroupId}):"",_.default.createElement("div",{className:"left-menu",style:{height:parseInt(document.body.clientHeight)-80+"px"}},_.default.createElement("div",{style:{padding:"10px 10px",borderBottom:"1px solid #D9D9D9"}},_.default.createElement(s.default,{icon:"plus",type:"primary",size:"small",onClick:function(){e.setState({editGroupId:null,add_group_modal_visible:!0})}},"添加分组")),this.state.statusCodeGroupList.length<=0?_.default.createElement(i.default,{description:"还没有模板哦~"}):"",_.default.createElement(u.default,{mode:"inline",onSelect:function(t){t.item;var a=t.key;t.keyPath,t.selectedKeys,t.domEvent;e.props.history.push("/project/"+e.props.match.params.projectId+"/dataStructure/"+a+"/view")}},this.state.statusCodeGroupList.map((function(t,a){return _.default.createElement(u.default.SubMenu,{key:t._id,title:_.default.createElement("div",null,_.default.createElement(o.default,{placement:"bottom",trigger:"contextMenu",overlayStyle:{zIndex:"10000000"},content:_.default.createElement("div",{className:"popup"},_.default.createElement("div",null,_.default.createElement("span",{onClick:function(a){a.stopPropagation(),e.addDataStructure(t._id)}},_.default.createElement(c.default,{type:"plus"})," 添加模板")),_.default.createElement("div",null,_.default.createElement("span",{onClick:function(a){a.stopPropagation(),e.editGroup(t._id)}},_.default.createElement(c.default,{type:"edit"})," 编辑")),_.default.createElement("div",null,_.default.createElement("span",{onClick:function(a){a.stopPropagation(),e.delGroup(t._id)}},_.default.createElement(c.default,{type:"delete"})," 删除")))},_.default.createElement("div",null,t.groupName))),onContextMenu:function(e){}},t.children.map((function(a,r){return _.default.createElement(u.default.Item,{key:a._id},_.default.createElement("div",null,a.name,_.default.createElement("div",{style:{position:"absolute",right:"0px",top:"50%",transform:"translateY(-60%)",height:"30px",width:"30px",color:"000"}},_.default.createElement(o.default,{placement:"leftTop",content:_.default.createElement("div",{className:"IM-menu"},_.default.createElement("div",null,_.default.createElement("span",{onClick:function(a){a.stopPropagation(),e.editGroup(t._id)}},_.default.createElement(c.default,{type:"edit"})," 编辑")),_.default.createElement("div",null,_.default.createElement("span",{onClick:function(a){a.stopPropagation(),e.delGroup(t._id)}},_.default.createElement(c.default,{type:"delete"})," 删除")))},_.default.createElement("div",null,_.default.createElement(c.default,{type:"ellipsis"}))))))})))}))))),_.default.createElement(O.ReflexSplitter,null),_.default.createElement(O.ReflexElement,null,_.default.createElement("div",{style:{height:"100%",overflow:"hidden",border:"1px solid #D9D9D9",borderLeft:"0px solid #D9D9D9",backgroundColor:"#fff"}},_.default.createElement(O.ReflexContainer,{style:{height:"calc(100vh - 80px)"},orientation:"vertical"},_.default.createElement(O.ReflexElement,null,_.default.createElement(j.Switch,null,_.default.createElement(j.Route,{path:"/project/:projectId/dataStructure/:dataStructureId/view",component:S.default})))))))}}]),n}(_.PureComponent),(0,g.default)(x,"propTypes",{match:k.default.object,history:k.default.object,projectId:k.default.string}),C=P))||C;t.default=q},160:function(e,t,a){"use strict";var r=a(3)(a(7)),n=a(262),l=a(357).filter,u=a(357).utils,o=a(143),c=a(759);function i(e,t){if(!e||"string"!=typeof e||0!==e.indexOf("$.")||e.length<=2)return null;for(var a=e.substr(2).split("."),r=0,n=(a=a.filter((function(e){return e}))).length;r<n;r++)try{var l=a[r].match(/(.*?)\[([0-9]+)\]/);t=l?t[l[1]][l[2]]:t[a[r]]}catch(e){t="";break}return t}function s(e){return e&&"string"==typeof e&&"@"===e[0]?n.mock(e):e}function d(e,t,a){t=t.trim();try{return l(t,function(e){return function(t){return"@"===t[0]?s(t):0===t.indexOf("$.")?i(t,e):0===t.indexOf("global.")?function(e,t){if(!e||"string"!=typeof e||0!==e.indexOf("global."))return e;var a=e.split(".");return t[(a=a.filter((function(e){return e})))[0]][a[1]]||e}(t,e):t}}(a))}catch(t){return e}}function f(e){return Array.isArray(e)?e:[]}t.handleJson=function e(t,a){if(!t)return t;if("string"==typeof t)return a(t);if("object"!==(0,r.default)(t))return t;for(var n in t)t[n]=e(t[n],a);return t},t.handleParamsValue=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=/\{\{\s*([^}]+?)\}\}/g;if(!e||"string"!=typeof e)return e;var r=(e=e.trim()).match(/^\{\{([^\}]+)\}\}$/);return r?d(e,r[1],t):"@"===e[0]||"$"===e[0]?d(e,e,t):e.replace(a,(function(e,a){return d(e,a,t)}))},t.simpleJsonPathParse=i,t.handleMockWord=s,t.joinPath=function(e,t){var a=e.length;return"/"===e[a-1]&&(e=e.substr(0,a-1)),"/"!==t[0]&&(t=t.substr(1)),e+t},t.safeArray=f,t.isJson5=function(e){if(!e)return!1;try{return e=o.parse(e)}catch(e){return!1}},t.isJson=function(e){if(!e)return!1;try{return e=JSON.parse(e)}catch(e){return!1}},t.unbase64=function(e){try{return u.unbase64(e)}catch(t){return e}},t.json_parse=function(e){try{return JSON.parse(e)}catch(t){return e}},t.json_format=function(e){try{return JSON.stringify(JSON.parse(e),null,"   ")}catch(t){return e}},t.ArrayToObject=function(e){var t={};return f(e).forEach((function(e){t[e.name]=e.value})),t},t.timeago=function(e){var t,a,r,n,l,u;return u=(n=parseInt((new Date).getTime()/1e3)-e)>31104e3?parseInt(n/31104e3):0,l=n>2592e3?parseInt(n/2592e3):0,r=n>86400?parseInt(n/86400):0,a=n>3600?parseInt(n/3600):0,t=parseInt(n/60),u>0?u+"年前":l>0&&u<=0?l+"月前":r>0&&l<=0?r+"天前":r<=0&&a>0?a+"小时前":a<=0&&t>0?t+"分钟前":t<=0&&n>0?n<30?"刚刚":n+"秒前":"刚刚"},t.bytesToSize=function(e){if(0===e)return"0 B";var t=Math.floor(Math.log(e)/Math.log(1e3));return(e/Math.pow(1e3,t)).toPrecision(3)+" "+["B","KB","MB","GB"][t]},t.schemaValidator=function(e,t){try{var r=new c({format:!1,meta:!1}),n=a(803);r.addMetaSchema(n),r._opts.defaultMeta=n.id,r._refs["http://json-schema.org/schema"]="http://json-schema.org/draft-04/schema";var l=a(804);e=e||{type:"object",title:"empty object",properties:{}};var u=r.compile(e),o=u(t),i="";return o||(l.zh(u.errors),i+=r.errorsText(u.errors,{separator:"\n"})),{valid:o,message:i}}catch(e){return{valid:!1,message:e.message}}}},1600:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(53);var l=r(a(54));a(33);var u=r(a(25)),o=r(a(58));a(48);var c=r(a(47));a(38);var i=r(a(39)),s=r(a(9)),d=r(a(10)),f=r(a(23)),p=r(a(11)),m=r(a(12)),h=r(a(13)),y=r(a(5));a(82);var v=r(a(84)),g=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=_(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),b=(a(22),r(a(0))),E=a(102);function _(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(_=function(e){return e?a:t})(e)}function k(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,h.default)(e);if(t){var n=(0,h.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,m.default)(this,a)}}var j=v.default.Item;var w=function(e){(0,p.default)(a,e);var t=k(a);function a(e){var r;return(0,s.default)(this,a),r=t.call(this,e),(0,y.default)((0,f.default)(r),"onSubmit",(function(e){e.preventDefault(),r.props.form.validateFields((function(e,t){e||(r.state.group&&r.state.group._id?(t.projectId=r.state.group.projectId,t.parentId=r.state.group.parentId,t.inedx=r.state.group.inedx,t._id=r.state.group._id):t.projectId=r.props.projectId,E.axios.post("/api/dataStructure/group/save",t).then((function(e){if(0!==e.errcode)return i.default.error("".concat(e.errmsg,", 添加分组出现异常"));r.props.form.resetFields(),r.props.onSubmit&&r.props.onSubmit()})))}))})),r.state={visible:r.props.visible,group:{}},r}return(0,d.default)(a,[{key:"componentDidMount",value:function(){this.props.groupId&&this.loadGroup(this.props.groupId)}},{key:"loadGroup",value:function(e){var t=this;E.axios.get("/api/dataStructure/group/get",{params:{groupId:e}}).then((function(e){console.log(e.data),t.setState({group:e.data})}))}},{key:"render",value:function(){var e,t=this,a=this.props.form,r=a.getFieldDecorator,n=a.getFieldsError,i={labelCol:{xs:{span:24},sm:{span:6}},wrapperCol:{xs:{span:24},sm:{span:14}}};return g.default.createElement(l.default,{title:"添加分组",footer:"",visible:this.props.visible,className:"addcatmodal",onCancel:function(){t.props.form.resetFields(),t.props.onCancel&&t.props.onCancel()}},g.default.createElement(v.default,{onSubmit:this.onSubmit},g.default.createElement(j,(0,o.default)({},i,{label:"分组名"}),r("groupName",{rules:[{required:!0,message:"请输入分类名称!"}],initialValue:this.state.group&&this.state.group.groupName||null})(g.default.createElement(c.default,{placeholder:"分类名称"}))),g.default.createElement(j,(0,o.default)({},i,{label:"描述"}),r("desc",{initialValue:this.state.group&&this.state.group.desc||null})(g.default.createElement(c.default,{placeholder:"描述"}))),g.default.createElement(j,{className:"catModalfoot",wrapperCol:{span:24,offset:8}},g.default.createElement(u.default,{onClick:function(){t.props.form.resetFields(),t.props.onCancel&&t.props.onCancel()},style:{marginRight:"10px"}},"取消"),g.default.createElement(u.default,{type:"primary",htmlType:"submit",disabled:(e=n(),Object.keys(e).some((function(t){return e[t]})))},"提交"))))}}]),a}(g.PureComponent);(0,y.default)(w,"propTypes",{form:b.default.object,visible:b.default.bool,projectId:b.default.string,groupId:b.default.number,onCancel:b.default.func,onSubmit:b.default.func});var O=v.default.create()(w);t.default=O},1601:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(30));a(137);var u=r(a(90));a(33);var o=r(a(25)),c=r(a(31)),i=r(a(9)),s=r(a(10)),d=r(a(11)),f=r(a(12)),p=r(a(13)),m=r(a(5));a(53);var h=r(a(54));a(148);var y,v,g,b=r(a(149)),E=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=P(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),_=r(a(0)),k=a(40),j=a(22),w=a(102),O=r(a(424)),C=a(182),x=r(a(658));function P(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(P=function(e){return e?a:t})(e)}function N(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,p.default)(e);if(t){var n=(0,p.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,f.default)(this,a)}}b.default.TreeNode;var M=h.default.confirm,S=(0,j.connect)((function(e){return{statusCodeList:[],projectId:null}}))((g=v=function(e){(0,d.default)(a,e);var t=N(a);function a(e){var r;return(0,i.default)(this,a),(r=t.call(this,e)).state={statusCodeList:[],projectId:null,editCodeId:null,selectedDataKey:null},r}return(0,s.default)(a,[{key:"queryCodeList",value:function(e){var t=this;!e&&this.state.groupId&&(e=this.state.groupId),w.axios.get("/api/dataStructure/list",{params:{groupId:e,projectId:this.state.projectId}}).then((function(a){t.setState({statusCodeList:a.data,groupId:e})}))}},{key:"delete",value:function(e){var t=this;M({title:"确定删除此状态码吗？",content:"温馨提示：删除后无法恢复",okText:"确认",cancelText:"取消",onOk:function(){return(0,c.default)(l.default.mark((function a(){return l.default.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:w.axios.post("/api/dataStructure/del",{id:e}).then((function(){t.queryCodeList()}));case 1:case"end":return a.stop()}}),a)})))()},onCancel:function(){}})}},{key:"componentWillMount",value:function(){var e=this,t=this.props.match.params,a=t.groupId,r=t.id;this.setState({projectId:r,groupId:a},(function(){e.queryCodeList()}))}},{key:"componentWillReceiveProps",value:function(e){var t=this,a=e.match.params.groupId,r=e.match.params.id;a?a&&a!==this.state.groupId&&(this.setState({projectId:r,groupId:a}),this.queryCodeList(a)):(this.setState({projectId:r,groupId:null},(function(){t.queryCodeList(a)})),console.log("没有groupId",e.match.params))}},{key:"render",value:function(){var e=this;return E.default.createElement(C.ReflexContainer,{style:{height:"calc(100vh - 80px)"},orientation:"vertical"},E.default.createElement(C.ReflexElement,{style:{height:"100%",overflow:"hidden",borderLeft:"1px solid #D9D9D9",border:"1px solid #D9D9D9",backgroundColor:"#fff"},id:"interface-sider",size:300},E.default.createElement("div",{style:{height:"30px",padding:"10px 10px "}},this.state.groupId?E.default.createElement(o.default,{icon:"plus",type:"primary",size:"small",onClick:function(){e.setState({add_code_modal_visible:!0})}},"添加模板"):""),!0===this.state.add_code_modal_visible?E.default.createElement(O.default,{id:this.state.editCodeId,visible:this.state.add_code_modal_visible,projectId:this.state.projectId,onSubmit:function(){e.queryCodeList(),e.setState({add_code_modal_visible:!1,editCodeId:null})},onCancel:function(){e.setState({add_code_modal_visible:!1,editCodeId:null})},groupId:this.state.groupId}):"",E.default.createElement("div",{style:{marginTop:"20px",overflowY:"auto",height:"calc(100vh - 130px)"}},E.default.createElement(u.default,{selectedKeys:this.state.selectedDataKey},this.state.statusCodeList.map((function(e){return E.default.createElement(u.default.Item,{key:e._id},e.name)}))))),E.default.createElement(C.ReflexSplitter,null),E.default.createElement(C.ReflexElement,null,E.default.createElement(k.Switch,null,E.default.createElement(k.Route,{path:"/project/:projectId/dataStructure/view/:id",component:x.default}))))}}]),a}(E.PureComponent),(0,m.default)(v,"propTypes",{match:_.default.object,projectId:_.default.string}),y=g))||y;t.default=S},1602:function(e,t,a){},1603:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(30));a(48);var u=r(a(47));a(33);var o=r(a(25)),c=r(a(31)),i=r(a(9)),s=r(a(10)),d=r(a(11)),f=r(a(12)),p=r(a(13));a(148);var m=r(a(149));a(146);var h,y=r(a(147)),v=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=E(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),g=(r(a(0)),a(40),a(22)),b=r(a(44));function E(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(E=function(e){return e?a:t})(e)}function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,p.default)(e);if(t){var n=(0,p.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,f.default)(this,a)}}var k=y.default.Content,j=y.default.Sider,w=m.default.TreeNode,O=(0,g.connect)((function(e){return{}}))(h=function(e){(0,d.default)(r,e);var t,a=_(r);function r(e){var t;return(0,i.default)(this,r),(t=a.call(this,e)).state={docHtml:"",doc:{},docList:[],selectedDocKey:null},t}return(0,s.default)(r,[{key:"componentDidMount",value:(t=(0,c.default)(l.default.mark((function e(){var t=this;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:b.default.get("/api/yuque/getDocsByNamespace").then((function(e){console.log(e.data),t.setState({docList:e.data.data})}));case 1:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})},{key:"getDocDetail",value:function(){var e=this;this.state.selectedDocKey&&b.default.get("/api/yuque/getDoc?slug="+this.state.selectedDocKey).then((function(t){console.log(t.data.data),e.setState({docHtml:t.data.data.body_html,doc:t.data.data})}))}},{key:"render",value:function(){var e=this;return v.default.createElement(y.default,{style:{height:"calc(100vh - 80px)"}},v.default.createElement(j,{style:{height:"100%",overflow:"hidden",borderLeft:"1px solid #D9D9D9",border:"1px solid #D9D9D9"},ref:this.interfaceSiderFun,id:"interface-sider",width:300},v.default.createElement("div",{className:"left-menu",style:{height:parseInt(document.body.clientHeight)-80+"px"}},v.default.createElement("div",{style:{padding:"10px"}},v.default.createElement(o.default,{icon:"plus",type:"primary"},"添加文档")),v.default.createElement("div",{style:{borderTop:"1px solid #D9D9D9",borderBottom:"1px solid #D9D9D9",padding:"6px 10px"}},v.default.createElement(u.default,{style:{width:"100%"},placeholder:"搜索文档"})),v.default.createElement("div",{style:{overflowY:"auto"}},v.default.createElement(m.default,{className:"interface-list",onSelect:function(t,a){console.log(t),e.setState({selectedDocKey:t},e.getDocDetail)}},this.state.docList.filter((function(e){return 1==e.status})).map((function(e){return v.default.createElement(w,{title:e.title,key:e.slug})})))))),v.default.createElement(y.default,null,v.default.createElement(k,{style:{height:"100%",overflow:"hidden",border:"1px solid #D9D9D9",borderLeft:"0px solid #D9D9D9",backgroundColor:"#fff"}},v.default.createElement("div",{style:{backgroundColor:"#fff",height:"calc(100vh - 80px)"}},v.default.createElement("div",{style:{overflowY:"auto",height:"calc(100vh - 130px)"}},v.default.createElement("div",{style:{padding:"15px 15px",height:"52px",borderBottom:"1px solid #D9D9D9"}},v.default.createElement("h2",null,this.state.doc.title)),v.default.createElement("div",{style:{padding:"15px"},dangerouslySetInnerHTML:{__html:this.state.docHtml}}))))))}}]),r}(v.PureComponent))||h;t.default=O},1604:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(30));a(57);var u=r(a(51));a(64);var o=r(a(49)),c=r(a(31)),i=r(a(9)),s=r(a(10)),d=r(a(23)),f=r(a(11)),p=r(a(12)),m=r(a(13)),h=r(a(5)),y=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=C(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1));a(1605);var v,g,b,E=r(a(0)),_=a(22),k=a(396),j=a(101),w=r(a(395)),O=r(a(204));function C(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(C=function(e){return e?a:t})(e)}function x(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,m.default)(e);if(t){var n=(0,m.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,p.default)(this,a)}}var P=(0,_.connect)((function(e){return{data:e.follow.data,uid:e.user.uid}}),{getFollowList:k.getFollowList,setBreadcrumb:j.setBreadcrumb})((b=g=function(e){(0,f.default)(r,e);var t,a=x(r);function r(e){var t;return(0,i.default)(this,r),t=a.call(this,e),(0,h.default)((0,d.default)(t),"receiveRes",(function(){t.props.getFollowList(t.props.uid).then((function(e){0===e.payload.data.errcode&&t.setState({data:e.payload.data.data.list})}))})),t.state={data:[]},t}return(0,s.default)(r,[{key:"componentWillMount",value:(t=(0,c.default)(l.default.mark((function e(){var t=this;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.props.setBreadcrumb([{name:"我的关注"}]),this.props.getFollowList(this.props.uid).then((function(e){0===e.payload.data.errcode&&t.setState({data:e.payload.data.data.list})}));case 2:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"render",value:function(){var e=this,t=this.state.data;return t=t.sort((function(e,t){return t.up_time-e.up_time})),y.default.createElement("div",null,y.default.createElement("div",{className:"g-row",style:{paddingLeft:"32px",paddingRight:"32px"}},y.default.createElement(u.default,{gutter:16,className:"follow-box pannel-without-tab"},t.length?t.map((function(t,a){return y.default.createElement(o.default,{xs:6,md:4,xl:3,key:a},y.default.createElement(w.default,{projectData:t,inFollowPage:!0,callbackResult:e.receiveRes}))})):y.default.createElement(O.default,{type:"noFollow"}))))}}]),r}(y.PureComponent),(0,h.default)(g,"propTypes",{getFollowList:E.default.func,setBreadcrumb:E.default.func,uid:E.default.number}),v=b))||v;t.default=P},1605:function(e,t,a){},1606:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(30));a(57);var u=r(a(51));a(64);var o=r(a(49));a(33);var c=r(a(25));a(55);var i=r(a(45));a(36);var s=r(a(4)),d=r(a(58)),f=r(a(31));a(38);var p=r(a(39)),m=r(a(9)),h=r(a(10)),y=r(a(23)),v=r(a(11)),g=r(a(12)),b=r(a(13)),E=r(a(5)),_=r(a(293));a(162);var k=r(a(127));a(71);var j=r(a(61));a(82);var w=r(a(84));a(48);var O,C,x,P,N=r(a(47)),M=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=W(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),S=r(a(0)),I=a(22),R=a(75),D=a(103),T=a(311),q=a(101),L=a(68),A=r(a(72)),B=a(40);function W(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(W=function(e){return e?a:t})(e)}function G(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,b.default)(e);if(t){var n=(0,b.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,g.default)(this,a)}}a(1607);var F=N.default.TextArea,U=w.default.Item,V=j.default.Option,H=k.default.Group,z={labelCol:{lg:{span:3},xs:{span:24},sm:{span:6}},wrapperCol:{lg:{span:21},xs:{span:24},sm:{span:14}},className:"form-item"},J=(0,I.connect)((function(e){return{groupList:e.group.groupList,currGroup:e.group.currGroup}}),{fetchGroupList:D.fetchGroupList,addProject:R.addProject,setBreadcrumb:q.setBreadcrumb})(O=(0,B.withRouter)((P=x=function(e){(0,v.default)(r,e);var t,a=G(r);function r(e){var t;return(0,m.default)(this,r),t=a.call(this,e),(0,E.default)((0,y.default)(t),"handlePath",(function(e){var a=e.target.value;t.props.form.setFieldsValue({basepath:(0,L.handlePath)(a)})})),t.state={groupList:[],currGroupId:null},t}return(0,h.default)(r,[{key:"handleOk",value:function(e){var t=this,a=this.props,r=a.form,n=a.addProject;e.preventDefault(),r.validateFields((function(e,a){e||(a.group_id=a.group,a.icon=A.default.PROJECT_ICON[0],a.color=(0,L.pickRandomProperty)(A.default.PROJECT_COLOR),n(a).then((function(e){0==e.payload.data.errcode&&(r.resetFields(),p.default.success("创建成功! "),t.props.history.push("/project/"+e.payload.data.data._id+"/interface/api"))})))}))}},{key:"componentWillMount",value:(t=(0,f.default)(l.default.mark((function e(){return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.props.setBreadcrumb([{name:"新建项目"}]),this.props.currGroup._id){e.next=4;break}return e.next=4,this.props.fetchGroupList();case 4:if(0!==this.props.groupList.length){e.next=6;break}return e.abrupt("return",null);case 6:this.setState({currGroupId:this.props.currGroup._id?this.props.currGroup._id:this.props.groupList[0]._id}),this.setState({groupList:this.props.groupList});case 8:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"render",value:function(){var e=this.props.form.getFieldDecorator;return M.default.createElement("div",{className:"g-row"},M.default.createElement("div",{className:"g-row m-container"},M.default.createElement(w.default,null,M.default.createElement(U,(0,d.default)({},z,{label:"项目名称"}),e("name",{rules:(0,L.nameLengthLimit)("项目")})(M.default.createElement(N.default,null))),M.default.createElement(U,(0,d.default)({},z,{label:"所属分组"}),e("group",{initialValue:this.state.currGroupId+"",rules:[{required:!0,message:"请选择项目所属的分组!"}]})(M.default.createElement(j.default,null,this.state.groupList.map((function(e,t){return M.default.createElement(V,{disabled:!("dev"===e.role||"owner"===e.role||"admin"===e.role),value:e._id.toString(),key:t},e.group_name)}))))),M.default.createElement("hr",{className:"breakline"}),M.default.createElement(U,(0,d.default)({},z,{label:M.default.createElement("span",null,"基本路径 ",M.default.createElement(i.default,{title:"接口基本路径，为空是根路径"},M.default.createElement(s.default,{type:"question-circle-o"})))}),e("basepath",{rules:[{required:!1,message:"请输入项目基本路径"}]})(M.default.createElement(N.default,{onBlur:this.handlePath}))),M.default.createElement(U,(0,d.default)({},z,{label:"描述"}),e("desc",{rules:[{required:!1,message:"描述不超过144字!",max:144}]})(M.default.createElement(F,{rows:4}))),M.default.createElement(U,(0,d.default)({},z,{label:"权限"}),e("project_type",{rules:[{required:!0}],initialValue:"private"})(M.default.createElement(H,null,M.default.createElement(k.default,{value:"private",className:"radio"},M.default.createElement(s.default,{type:"lock"}),"私有",M.default.createElement("br",null),M.default.createElement("span",{className:"radio-desc"},"只有组长和项目开发者可以索引并查看项目信息")),M.default.createElement("br",null))))),M.default.createElement(u.default,null,M.default.createElement(o.default,{sm:{offset:6},lg:{offset:3}},M.default.createElement(c.default,{className:"m-btn",icon:"plus",type:"primary",onClick:this.handleOk},"创建项目")))))}}]),r}(M.PureComponent),(0,E.default)(x,"propTypes",{groupList:S.default.array,form:S.default.object,currGroup:S.default.object,addProject:S.default.func,history:S.default.object,setBreadcrumb:S.default.func,fetchGroupList:S.default.func}),C=P,(0,_.default)(C.prototype,"handleOk",[T.autobind],Object.getOwnPropertyDescriptor(C.prototype,"handleOk"),C.prototype),O=C))||O)||O,K=w.default.create()(J);t.default=K},1607:function(e,t,a){},1608:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(57);var l=r(a(51)),u=r(a(9)),o=r(a(10)),c=r(a(11)),i=r(a(12)),s=r(a(13)),d=r(a(5));a(1609);var f,p,m,h=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=_(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),y=a(22),v=a(40),g=r(a(1610)),b=r(a(0)),E=r(a(1611));function _(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(_=function(e){return e?a:t})(e)}function k(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,s.default)(e);if(t){var n=(0,s.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,i.default)(this,a)}}var j=(0,y.connect)((function(e){return{curUid:e.user.uid,userType:e.user.type,role:e.user.role}}),{})((m=p=function(e){(0,c.default)(a,e);var t=k(a);function a(e){return(0,u.default)(this,a),t.call(this,e)}return(0,o.default)(a,[{key:"render",value:function(){return h.default.createElement("div",null,h.default.createElement("div",{className:"g-doc"},h.default.createElement(l.default,{className:"user-box"},h.default.createElement(v.Route,{path:this.props.match.path+"/list",component:g.default}),h.default.createElement(v.Route,{path:this.props.match.path+"/profile/:uid",component:E.default}))))}}]),a}(h.PureComponent),(0,d.default)(p,"propTypes",{match:b.default.object,curUid:b.default.number,userType:b.default.string,role:b.default.string}),f=m))||f;t.default=j},1609:function(e,t,a){},1610:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(30));a(123);var u=r(a(126));a(230);var o=r(a(231));a(236);var c=r(a(244)),i=r(a(31));a(38);var s=r(a(39)),d=r(a(9)),f=r(a(10)),p=r(a(23)),m=r(a(11)),h=r(a(12)),y=r(a(13)),v=r(a(5));a(48);var g,b,E,_=r(a(47)),k=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=N(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),j=a(68),w=a(40),O=a(101),C=a(22),x=r(a(0)),P=r(a(44));function N(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(N=function(e){return e?a:t})(e)}function M(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function S(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?M(Object(a),!0).forEach((function(t){(0,v.default)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):M(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function I(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,y.default)(e);if(t){var n=(0,y.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,h.default)(this,a)}}var R=_.default.Search,D=(0,C.connect)((function(e){return{curUserRole:e.user.role}}),{setBreadcrumb:O.setBreadcrumb})((E=b=function(e){(0,m.default)(r,e);var t,a=I(r);function r(e){var t;return(0,d.default)(this,r),t=a.call(this,e),(0,v.default)((0,p.default)(t),"changePage",(function(e){t.setState({current:e},t.getUserList)})),(0,v.default)((0,p.default)(t),"confirm",(function(e){P.default.post("/api/user/del",{id:e}).then((function(a){if(0===a.data.errcode){s.default.success("已删除此用户");var r=t.state.data;r=r.filter((function(t){return t._id!=e})),t.setState({data:r})}else s.default.error(a.data.errmsg)}),(function(e){s.default.error(e.message)}))})),(0,v.default)((0,p.default)(t),"disable",(function(e){P.default.post("/api/user/disable",{id:e}).then((function(e){0===e.data.errcode?(s.default.success("已禁用此用户"),t.getUserList()):s.default.error(e.data.errmsg)}),(function(e){s.default.error(e.message)}))})),(0,v.default)((0,p.default)(t),"handleSearch",(function(e){var a={q:e};""!==a.q?P.default.get("/api/user/search",{params:a}).then((function(e){var a=[];(e=e.data.data)&&e.forEach((function(e){return a.push(S(S({},e),{},{_id:e.uid}))})),t.setState({data:a,isSearch:!0})})):t.setState({data:t.state.backups,isSearch:!1})})),t.state={data:[],total:null,current:1,backups:[],isSearch:!1},t}return(0,f.default)(r,[{key:"getUserList",value:function(){var e=this;P.default.get("/api/user/list?page="+this.state.current+"&limit=20").then((function(t){var a=t.data;if(0===a.errcode){var r=a.data.list,n=a.data.count;r.map((function(e,t){e.key=t,e.up_time=(0,j.formatTime)(e.up_time)})),e.setState({data:r,total:n,backups:r})}}))}},{key:"componentDidMount",value:function(){this.getUserList()}},{key:"componentWillMount",value:(t=(0,i.default)(l.default.mark((function e(){return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.props.setBreadcrumb([{name:"用户管理"}]);case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"render",value:function(){var e=this,t=this.props.curUserRole,a=[];"admin"===t&&(a=this.state.data);var r=[{title:"用户名",dataIndex:"username",key:"username",width:180,render:function(e,t){return k.default.createElement(w.Link,{to:"/user/profile/"+t._id},t.username)}},{title:"Email",dataIndex:"email",key:"email"},{title:"用户角色",dataIndex:"role",key:"role",width:150},{title:"状态",dataIndex:"status",key:"status",width:150,render:function(e,t){return 1===e?k.default.createElement(c.default,{color:"#2db7f5"},"正常"):k.default.createElement(c.default,{color:"#8189A1"},"禁用")}},{title:"更新日期",dataIndex:"up_time",key:"up_time",width:160},{title:"功能",key:"action",width:"150px",render:function(t){return k.default.createElement("span",null,k.default.createElement(o.default,{title:"确认删除此用户?",onConfirm:function(){e.confirm(t._id)},okText:"确定",cancelText:"取消"},k.default.createElement("a",{style:{display:"block",textAlign:"center"},href:"#"},"删除")),k.default.createElement(o.default,{title:"确认禁用此用户?",onConfirm:function(){e.disable(t._id)},okText:"确定",cancelText:"取消"},k.default.createElement("a",null,"禁用")))}}];r=r.filter((function(e){return"action"!==e.key||"admin"===t}));var n={total:this.state.total,pageSize:20,current:this.state.current,onChange:this.changePage},l={total:this.state.data.length,pageSize:20,current:1};return k.default.createElement("section",{className:"user-table"},k.default.createElement("div",{className:"user-search-wrapper"},k.default.createElement("h2",{style:{marginBottom:"10px"}},"用户总数：",this.state.total,"位"),k.default.createElement(R,{onChange:function(t){return e.handleSearch(t.target.value)},onSearch:this.handleSearch,placeholder:"请输入用户名"})),k.default.createElement(u.default,{bordered:!0,rowKey:function(e){return e._id},columns:r,pagination:this.state.isSearch?l:n,dataSource:a}))}}]),r}(k.PureComponent),(0,v.default)(b,"propTypes",{setBreadcrumb:x.default.func,curUserRole:x.default.string}),g=E))||g;t.default=D},1611:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(55);var l=r(a(45));a(662);var u=r(a(663));a(57);var o=r(a(51));a(64);var c=r(a(49));a(48);var i=r(a(47));a(71);var s=r(a(61));a(38);var d=r(a(39)),f=r(a(9)),p=r(a(10)),m=r(a(23)),h=r(a(11)),y=r(a(12)),v=r(a(13)),g=r(a(5));a(33);var b,E,_,k,j,w,O=r(a(25)),C=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=I(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),x=r(a(44)),P=a(68),N=r(a(0)),M=a(101),S=a(22);function I(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(I=function(e){return e?a:t})(e)}function R(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function D(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?R(Object(a),!0).forEach((function(t){(0,g.default)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):R(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function T(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,v.default)(e);if(t){var n=(0,v.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,y.default)(this,a)}}var q=function(e){var t=e.isAdmin,a=e.isOwner,r=e.onClick,n=e.name,l=e.admin;return a?l?null:C.default.createElement(O.default,{icon:"edit",onClick:function(){r(n,!0)}},"修改"):t?C.default.createElement(O.default,{icon:"edit",onClick:function(){r(n,!0)}},"修改"):null};q.propTypes={isAdmin:N.default.bool,isOwner:N.default.bool,onClick:N.default.func,name:N.default.string,admin:N.default.bool};var L=(0,S.connect)((function(e){return{curUid:e.user.uid,userType:e.user.type,curRole:e.user.role}}),{setBreadcrumb:M.setBreadcrumb})((_=E=function(e){(0,h.default)(a,e);var t=T(a);function a(e){var r;return(0,f.default)(this,a),r=t.call(this,e),(0,g.default)((0,m.default)(r),"handleEdit",(function(e,t){var a={};a[e]=t,r.setState(a)})),(0,g.default)((0,m.default)(r),"getUserInfo",(function(e){var t=(0,m.default)(r),a=r.props.curUid;x.default.get("/api/user/find?id="+e).then((function(n){t.setState({userinfo:n.data.data,_userinfo:n.data.data}),a===+e?r.props.setBreadcrumb([{name:n.data.data.username}]):r.props.setBreadcrumb([{name:"管理: "+n.data.data.username}])}))})),(0,g.default)((0,m.default)(r),"updateUserinfo",(function(e){var t=r.state,a=r.state._userinfo[e],n={uid:t.userinfo.uid};n[e]=a,x.default.post("/api/user/update",n).then((function(t){var n=t.data;if(0===n.errcode){var l=r.state.userinfo;l[e]=a,r.setState({userinfo:l}),r.handleEdit(e+"Edit",!1),d.default.success("更新用户信息成功")}else d.default.error(n.errmsg)}),(function(e){d.default.error(e.message)}))})),(0,g.default)((0,m.default)(r),"changeUserinfo",(function(e){var t=e.target,a=t.getAttribute("name"),n=t.value;r.setState({_userinfo:D(D({},r.state._userinfo),{},(0,g.default)({},a,n))})})),(0,g.default)((0,m.default)(r),"changeRole",(function(e){var t=r.state.userinfo;t.role=e,r.setState({_userinfo:t}),r.updateUserinfo("role")})),(0,g.default)((0,m.default)(r),"updatePassword",(function(){var e=document.getElementById("old_password").value,t=document.getElementById("password").value;if(t!=document.getElementById("verify_pass").value)return d.default.error("两次输入的密码不一样");var a={uid:r.state.userinfo.uid,password:t,old_password:e};x.default.post("/api/user/change_password",a).then((function(e){var t=e.data;0===t.errcode?(r.handleEdit("secureEdit",!1),d.default.success("修改密码成功"),r.props.curUid===r.state.userinfo.uid&&location.reload()):d.default.error(t.errmsg)}),(function(e){d.default.error(e.message)}))})),r.state={usernameEdit:!1,emailEdit:!1,secureEdit:!1,roleEdit:!1,userinfo:{}},r}return(0,p.default)(a,[{key:"componentDidMount",value:function(){this._uid=this.props.match.params.uid,this.handleUserinfo(this.props)}},{key:"componentWillReceiveProps",value:function(e){e.match.params.uid&&this._uid!==e.match.params.uid&&this.handleUserinfo(e)}},{key:"handleUserinfo",value:function(e){var t=e.match.params.uid;this.getUserInfo(t)}},{key:"render",value:function(){var e,t,a,r,n=this,l=O.default.Group,u=s.default.Option,d=this.state.userinfo,f=this.state._userinfo,p="";if(p="third"!==this.props.userType&&"site"===this.props.userType,e=!1===this.state.usernameEdit?C.default.createElement("div",null,C.default.createElement("span",{className:"text"},d.username),"  ",p&&C.default.createElement(q,{userType:p,isOwner:d.uid===this.props.curUid,isAdmin:"admin"===this.props.curRole,onClick:this.handleEdit,name:"usernameEdit"})):C.default.createElement("div",null,C.default.createElement(i.default,{value:f.username,name:"username",onChange:this.changeUserinfo,placeholder:"用户名"}),C.default.createElement(l,{className:"edit-buttons"},C.default.createElement(O.default,{className:"edit-button",onClick:function(){n.handleEdit("usernameEdit",!1)}},"取消"),C.default.createElement(O.default,{className:"edit-button",onClick:function(){n.updateUserinfo("username")},type:"primary"},"确定"))),t=!1===this.state.emailEdit?C.default.createElement("div",null,C.default.createElement("span",{className:"text"},d.email),"  ",p&&C.default.createElement(q,{admin:"admin"===d.role,isOwner:d.uid===this.props.curUid,isAdmin:"admin"===this.props.curRole,onClick:this.handleEdit,name:"emailEdit"})):C.default.createElement("div",null,C.default.createElement(i.default,{placeholder:"Email",value:f.email,name:"email",onChange:this.changeUserinfo}),C.default.createElement(l,{className:"edit-buttons"},C.default.createElement(O.default,{className:"edit-button",onClick:function(){n.handleEdit("emailEdit",!1)}},"取消"),C.default.createElement(O.default,{className:"edit-button",type:"primary",onClick:function(){n.updateUserinfo("email")}},"确定"))),r=!1===this.state.roleEdit?C.default.createElement("div",null,C.default.createElement("span",{className:"text"},{admin:"管理员",member:"会员"}[d.role]),"  "):C.default.createElement(s.default,{defaultValue:f.role,onChange:this.changeRole,style:{width:150}},C.default.createElement(u,{value:"admin"},"管理员"),C.default.createElement(u,{value:"member"},"会员")),!1===this.state.secureEdit){var m="";p&&(m=C.default.createElement(O.default,{icon:"edit",onClick:function(){n.handleEdit("secureEdit",!0)}},"修改")),a=m}else a=C.default.createElement("div",null,C.default.createElement(i.default,{style:{display:"admin"===this.props.curRole&&"admin"!=d.role?"none":""},placeholder:"旧的密码",type:"password",name:"old_password",id:"old_password"}),C.default.createElement(i.default,{placeholder:"新的密码",type:"password",name:"password",id:"password"}),C.default.createElement(i.default,{placeholder:"确认密码",type:"password",name:"verify_pass",id:"verify_pass"}),C.default.createElement(l,{className:"edit-buttons"},C.default.createElement(O.default,{className:"edit-button",onClick:function(){n.handleEdit("secureEdit",!1)}},"取消"),C.default.createElement(O.default,{className:"edit-button",onClick:this.updatePassword,type:"primary"},"确定")));return C.default.createElement("div",{className:"user-profile"},C.default.createElement("div",{className:"user-item-body"},d.uid===this.props.curUid?C.default.createElement("h3",null,"个人设置"):C.default.createElement("h3",null,d.username," 资料设置"),C.default.createElement(o.default,{className:"avatarCon",type:"flex",justify:"start"},C.default.createElement(c.default,{span:24},d.uid===this.props.curUid?C.default.createElement(A,{uid:d.uid},"点击上传头像"):C.default.createElement("div",{className:"avatarImg"},C.default.createElement("img",{src:"/api/user/avatar?uid=".concat(d.uid)})))),C.default.createElement(o.default,{className:"user-item",type:"flex",justify:"start"},C.default.createElement("div",{className:"maoboli"}),C.default.createElement(c.default,{span:4},"用户id"),C.default.createElement(c.default,{span:12},d.uid)),C.default.createElement(o.default,{className:"user-item",type:"flex",justify:"start"},C.default.createElement("div",{className:"maoboli"}),C.default.createElement(c.default,{span:4},"用户名"),C.default.createElement(c.default,{span:12},e)),C.default.createElement(o.default,{className:"user-item",type:"flex",justify:"start"},C.default.createElement("div",{className:"maoboli"}),C.default.createElement(c.default,{span:4},"Email"),C.default.createElement(c.default,{span:12},t)),C.default.createElement(o.default,{className:"user-item",style:{display:"admin"===this.props.curRole?"":"none"},type:"flex",justify:"start"},C.default.createElement("div",{className:"maoboli"}),C.default.createElement(c.default,{span:4},"角色"),C.default.createElement(c.default,{span:12},r)),C.default.createElement(o.default,{className:"user-item",style:{display:"admin"===this.props.curRole?"":"none"},type:"flex",justify:"start"},C.default.createElement("div",{className:"maoboli"}),C.default.createElement(c.default,{span:4},"登陆方式"),C.default.createElement(c.default,{span:12},"site"===d.type?"站点登陆":"第三方登陆")),C.default.createElement(o.default,{className:"user-item",type:"flex",justify:"start"},C.default.createElement("div",{className:"maoboli"}),C.default.createElement(c.default,{span:4},"创建账号时间"),C.default.createElement(c.default,{span:12},(0,P.formatTime)(d.add_time))),C.default.createElement(o.default,{className:"user-item",type:"flex",justify:"start"},C.default.createElement("div",{className:"maoboli"}),C.default.createElement(c.default,{span:4},"更新账号时间"),C.default.createElement(c.default,{span:12},(0,P.formatTime)(d.up_time))),p?C.default.createElement(o.default,{className:"user-item",type:"flex",justify:"start"},C.default.createElement("div",{className:"maoboli"}),C.default.createElement(c.default,{span:4},"密码"),C.default.createElement(c.default,{span:12},a)):""))}}]),a}(C.PureComponent),(0,g.default)(E,"propTypes",{match:N.default.object,curUid:N.default.number,userType:N.default.string,setBreadcrumb:N.default.func,curRole:N.default.string,upload:N.default.bool}),b=_))||b,A=(0,S.connect)((function(e){return{url:e.user.imageUrl}}),{setImageUrl:M.setImageUrl})((w=j=function(e){(0,h.default)(a,e);var t=T(a);function a(e){return(0,f.default)(this,a),t.call(this,e)}return(0,p.default)(a,[{key:"uploadAvatar",value:function(e){var t=this;x.default.post("/api/user/upload_avatar",{basecode:e}).then((function(){t.props.setImageUrl(e)})).catch((function(e){console.log(e)}))}},{key:"handleChange",value:function(e){var t,a,r,n=this;"done"===e.file.status&&(t=e.file.originFileObj,a=function(e){n.uploadAvatar(e)},(r=new FileReader).addEventListener("load",(function(){return a(r.result)})),r.readAsDataURL(t))}},{key:"render",value:function(){var e=this.props.url,t=e||"/api/user/avatar?uid=".concat(this.props.uid);return C.default.createElement("div",{className:"avatar-box"},C.default.createElement(l.default,{placement:"right",title:C.default.createElement("div",null,"点击头像更换 (只支持jpg、png格式且大小不超过200kb的图片)")},C.default.createElement("div",null,C.default.createElement(u.default,{className:"avatar-uploader",name:"basecode",showUploadList:!1,action:"/api/user/upload_avatar",beforeUpload:B,onChange:this.handleChange.bind(this)},C.default.createElement("div",{style:{width:100,height:100}},C.default.createElement("img",{className:"avatar",src:t}))))),C.default.createElement("span",{className:"avatarChange"}))}}]),a}(C.PureComponent),(0,g.default)(j,"propTypes",{uid:N.default.number,setImageUrl:N.default.func,url:N.default.any}),k=w))||k;function B(e){var t="image/jpeg"===e.type,a="image/png"===e.type;t||a||d.default.error("图片的格式只能为 jpg、png！");var r=e.size/1024/1024<.2;return r||d.default.error("图片必须小于 200kb!"),(a||t)&&r}var W=L;t.default=W},1612:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(53);var l=r(a(54));a(33);var u=r(a(25)),o=r(a(9)),c=r(a(10)),i=r(a(23)),s=r(a(11)),d=r(a(12)),f=r(a(13)),p=r(a(5)),m=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=y(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),h=r(a(0));function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(y=function(e){return e?a:t})(e)}function v(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,f.default)(e);if(t){var n=(0,f.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,d.default)(this,a)}}var g=function(e){(0,s.default)(a,e);var t=v(a);function a(e){var r;return(0,o.default)(this,a),r=t.call(this,e),(0,p.default)((0,i.default)(r),"yes",(function(){r.props.callback(!0),r.setState({visible:!1})})),(0,p.default)((0,i.default)(r),"no",(function(){r.props.callback(!1),r.setState({visible:!1})})),r.state={visible:!0},r}return(0,c.default)(a,[{key:"componentWillReceiveProps",value:function(){this.setState({visible:!0})}},{key:"render",value:function(){return this.state.visible?m.default.createElement(l.default,{title:"你即将离开编辑页面",visible:this.state.visible,onCancel:this.no,footer:[m.default.createElement(u.default,{key:"back",onClick:this.no},"取 消"),m.default.createElement(u.default,{key:"submit",onClick:this.yes},"确 定")]},m.default.createElement("p",null,this.props.msg)):null}}]),a}(m.PureComponent);(0,p.default)(g,"propTypes",{msg:h.default.string,callback:h.default.func});var b=g;t.default=b},1613:function(e,t,a){"use strict";var r=a(3);Object.defineProperty(t,"__esModule",{value:!0}),t.requireAuthentication=function(e){var t,a,r;return(0,d.connect)((function(e){return{isAuthenticated:e.user.isLogin}}),{changeMenuItem:p.changeMenuItem})((r=a=function(t){(0,u.default)(d,t);var a,r,i=(a=d,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=(0,c.default)(a);if(r){var n=(0,c.default)(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return(0,o.default)(this,e)});function d(e){return(0,n.default)(this,d),i.call(this,e)}return(0,l.default)(d,[{key:"componentWillMount",value:function(){this.checkAuth()}},{key:"componentWillReceiveProps",value:function(){this.checkAuth()}},{key:"checkAuth",value:function(){this.props.isAuthenticated||(this.props.history.push("/"),this.props.changeMenuItem("/"))}},{key:"render",value:function(){return s.default.createElement("div",null,this.props.isAuthenticated?s.default.createElement(e,this.props):null)}}]),d}(s.default.PureComponent),(0,i.default)(a,"propTypes",{isAuthenticated:f.default.bool,location:f.default.object,dispatch:f.default.func,history:f.default.object,changeMenuItem:f.default.func}),t=r))||t};var n=r(a(9)),l=r(a(10)),u=r(a(11)),o=r(a(12)),c=r(a(13)),i=r(a(5)),s=r(a(1)),d=a(22),f=r(a(0)),p=a(237)},1614:function(e,t,a){"use strict";(function(e){var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(38);var l=r(a(39)),u=r(a(9)),o=r(a(10)),c=r(a(11)),i=r(a(12)),s=r(a(13)),d=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=p(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),f=r(a(44));function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(p=function(e){return e?a:t})(e)}function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,s.default)(e);if(t){var n=(0,s.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,i.default)(this,a)}}var h=function(t){(0,c.default)(r,t);var a=m(r);function r(t){var n;return(0,u.default)(this,r),(n=a.call(this,t)).state={newVersion:e.env.version,version:e.env.version},n}return(0,o.default)(r,[{key:"componentDidMount",value:function(){var e=this;f.default.get("https://www.fastmock.site/mock/1529fa78fa4c4880ad153d115084a940/yapi/versions").then((function(t){200===t.status?e.setState({newVersion:t.data.data[0]}):l.default.error("无法获取新版本信息！")}))}},{key:"render",value:function(){this.state.newVersion,this.state.version;return d.default.createElement("div",null)}}]),r}(d.Component);t.default=h}).call(this,a(99))},1615:function(e,t,a){"use strict";var r=a(3);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=[l.default,u.default],a=n.applyMiddleware.apply(void 0,t)(n.createStore)(o.default,e);return a};var n=a(249),l=r(a(1616)),u=r(a(1622)),o=r(a(1623))},1622:function(e,t,a){"use strict";var r=a(3);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(38);var n=r(a(39));t.default=function(){return function(e){return function(t){if(t){if(t.error)n.default.error(t.payload&&t.payload.message||"服务器错误");else if(t.payload&&t.payload.data&&t.payload.data.errcode&&40011!==t.payload.data.errcode)throw n.default.error(t.payload.data.errmsg),new Error(t.payload.data.errmsg);return e(t)}}}}},1623:function(e,t,a){"use strict";var r=a(3);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=a(249),l=r(a(101)),u=r(a(103)),o=r(a(75)),c=r(a(124)),i=r(a(167)),s=r(a(180)),d=r(a(1624)),f=r(a(237)),p=r(a(396)),m=a(141),h={group:u.default,user:l.default,inter:c.default,interfaceCol:i.default,project:o.default,news:s.default,addInterface:d.default,menu:f.default,follow:p.default};(0,m.emitHook)("add_reducer",h);var y=(0,n.combineReducers)(h);t.default=y},1624:function(e,t,a){"use strict";var r=a(3);Object.defineProperty(t,"__esModule",{value:!0}),t.addInterfaceClipboard=function(e){return{type:"yapi/addInterface/ADD_INTERFACE_CLIPBOARD",payload:e}},t.addReqHeader=function(e){return{type:"yapi/addInterface/ADD_INTERFACE_SEQ_HEADER",payload:e}},t.default=void 0,t.deleteReqHeader=function(e){return{type:"yapi/addInterface/DELETE_INTERFACE_SEQ_HEADER",payload:e}},t.fetchInterfaceProject=function(e){return{type:"yapi/addInterface/FETCH_INTERFACE_PROJECT",payload:l.default.get("/api/project/get",{params:{id:e}})}},t.getReqParams=function(e){return{type:"yapi/addInterface/GET_INTERFACE_REQ_PARAMS",payload:e}},t.getResParams=function(e){return{type:"yapi/addInterface/GET_INTERFACE_RES_PARAMS",payload:e}},t.pushInputValue=function(e){return{type:"yapi/addInterface/FETCH_ADD_INTERFACE_INPUT",payload:e}},t.pushInterfaceMethod=function(e){return{type:"yapi/addInterface/PUSH_INTERFACE_METHOD",payload:e}},t.pushInterfaceName=function(e){return{type:"yapi/addInterface/PUSH_INTERFACE_NAME",payload:e}},t.reqHeaderValue=function(e){return{type:"yapi/addInterface/FETCH_ADD_INTERFACE_HEADER_VALUE",payload:e}},t.reqTagValue=function(e){return{type:"yapi/addInterface/FETCH_ADD_INTERFACE_TAG_VALUE",payload:e}};var n=r(a(5)),l=r(a(44));function u(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function o(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?u(Object(a),!0).forEach((function(t){(0,n.default)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):u(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var c={interfaceName:"",url:"",method:"GET",seqGroup:[{id:0,name:"",value:""}],reqParams:"",resParams:"",project:{},clipboard:function(){}};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"yapi/addInterface/FETCH_ADD_INTERFACE_INPUT":return o(o({},e),{},{url:t.payload});case"yapi/addInterface/FETCH_ADD_INTERFACE_TAG_VALUE":return o(o({},e),{},{tagValue:t.payload});case"yapi/addInterface/FETCH_ADD_INTERFACE_HEADER_VALUE":return o(o({},e),{},{headerValue:t.payload});case"yapi/addInterface/ADD_INTERFACE_SEQ_HEADER":case"yapi/addInterface/DELETE_INTERFACE_SEQ_HEADER":return o(o({},e),{},{seqGroup:t.payload});case"yapi/addInterface/GET_INTERFACE_REQ_PARAMS":return o(o({},e),{},{reqParams:t.payload});case"yapi/addInterface/GET_INTERFACE_RES_PARAMS":return o(o({},e),{},{resParams:t.payload});case"yapi/addInterface/PUSH_INTERFACE_NAME":return o(o({},e),{},{interfaceName:t.payload});case"yapi/addInterface/PUSH_INTERFACE_METHOD":return o(o({},e),{},{method:t.payload});case"yapi/addInterface/FETCH_INTERFACE_PROJECT":return o(o({},e),{},{project:t.payload.data.data});case"yapi/addInterface/ADD_INTERFACE_CLIPBOARD":return o(o({},e),{},{clipboard:t.payload});default:return e}}},165:function(e,t,a){"use strict";var r=a(3);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(a(9)),l=r(a(10)),u=r(a(11)),o=r(a(12)),c=r(a(13)),i=r(a(5)),s=r(a(1)),d=r(a(373)),f=r(a(0));function p(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,c.default)(e);if(t){var n=(0,c.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,o.default)(this,a)}}a(1013);var m={javascript:"ace/mode/javascript",json:"ace/mode/json",text:"ace/mode/text",xml:"ace/mode/xml",html:"ace/mode/html"},h={width:"100%",height:"200px"};function y(e){return m[e]||m.text}var v=function(e){(0,u.default)(a,e);var t=p(a);function a(e){return(0,n.default)(this,a),t.call(this,e)}return(0,l.default)(a,[{key:"componentDidMount",value:function(){this.editor=(0,d.default)({container:this.editorElement,data:this.props.data,onChange:this.props.onChange,readOnly:this.props.readOnly,fullScreen:this.props.fullScreen});var e=this.props.mode||"javascript";this.editor.editor.getSession().setMode(y(e)),"function"==typeof this.props.callback&&this.props.callback(this.editor.editor)}},{key:"componentWillReceiveProps",value:function(e){if(this.editor&&e.data!==this.props.data&&this.editor.getValue()!==e.data){this.editor.setValue(e.data);var t=e.mode||"javascript";this.editor.editor.getSession().setMode(y(t)),this.editor.editor.clearSelection()}}},{key:"render",value:function(){var e=this;return s.default.createElement("div",{className:this.props.className,style:this.props.className?void 0:this.props.style||h,ref:function(t){e.editorElement=t}})}}]),a}(s.default.PureComponent);(0,i.default)(v,"propTypes",{data:f.default.any,onChange:f.default.func,className:f.default.string,mode:f.default.string,readOnly:f.default.bool,callback:f.default.func,style:f.default.object,fullScreen:f.default.bool,insertCode:f.default.func});var g=v;t.default=g},167:function(e,t,a){"use strict";var r=a(3);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.fetchCaseData=function(e){return{type:c,payload:l.default.get("/api/col/case?caseid="+e)}},t.fetchCaseEnvList=function(e){return{type:"yapi/interfaceCol/FETCH_CASE_ENV_LIST",payload:l.default.get("/api/col/case_env_list",{params:{col_id:e}})}},t.fetchCaseList=function(e){return{type:i,payload:l.default.get("/api/col/case_list/?col_id="+e)}},t.fetchInterfaceColList=function(e){return{type:"yapi/interfaceCol/FETCH_INTERFACE_COL_LIST",payload:l.default.get("/api/col/list?project_id="+e)}},t.fetchVariableParamsList=function(e){return{type:"yapi/interfaceCol/FETCH_VARIABLE_PARAMS_LIST",payload:l.default.get("/api/col/case_list_by_var_params?col_id="+e)}},t.setColData=function(e){return{type:s,payload:e}};var n=r(a(5)),l=r(a(44));function u(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function o(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?u(Object(a),!0).forEach((function(t){(0,n.default)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):u(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var c="yapi/interfaceCol/FETCH_CASE_DATA",i="yapi/interfaceCol/FETCH_CASE_LIST",s="yapi/interfaceCol/SET_COL_DATA",d={interfaceColList:[{_id:0,name:"",uid:0,project_id:0,desc:"",add_time:0,up_time:0,caseList:[{}]}],isShowCol:!0,isRender:!1,currColId:0,currCaseId:0,currCase:{},currCaseList:[],variableParamsList:[],envList:[]};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:d,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"yapi/interfaceCol/FETCH_INTERFACE_COL_LIST":return o(o({},e),{},{interfaceColList:t.payload.data.data});case c:return o(o({},e),{},{currCase:t.payload.data.data});case i:return o(o({},e),{},{currCaseList:t.payload.data.data});case"yapi/interfaceCol/FETCH_VARIABLE_PARAMS_LIST":return o(o({},e),{},{variableParamsList:t.payload.data.data});case s:return o(o({},e),t.payload);case"yapi/interfaceCol/FETCH_CASE_ENV_LIST":return o(o({},e),{},{envList:t.payload.data.data});default:return e}}},180:function(e,t,a){"use strict";var r=a(3);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.fetchMoreNews=function(e,t,a,r,n){var l={typeid:e,type:t,page:a,limit:r||o.default.PAGE_LIMIT,selectValue:n};return{type:"yapi/news/FETCH_MORE_NEWS",payload:u.default.get("/api/log/list",{params:l})}},t.fetchNewsData=function(e,t,a,r,n){var l={typeid:e,type:t,page:a,limit:r||o.default.PAGE_LIMIT,selectValue:n};return{type:"yapi/news/FETCH_NEWS_DATA",payload:u.default.get("/api/log/list",{params:l})}},t.fetchUpdateLogData=function(e){return{type:"",payload:u.default.post("/api/log/list_by_update",e)}},t.getMockUrl=function(e){var t={id:e};return{type:"",payload:u.default.get("/api/project/get",{params:t})}};var n=r(a(571)),l=r(a(5)),u=r(a(44)),o=r(a(72));function c(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function i(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?c(Object(a),!0).forEach((function(t){(0,l.default)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):c(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var s={newsData:{list:[],total:0},curpage:1};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"yapi/news/FETCH_NEWS_DATA":var a=t.payload.data.data.list;return e.newsData.list=a,e.curpage=1,e.newsData.list.sort((function(e,t){return t.add_time-e.add_time})),i(i({},e),{},{newsData:{total:t.payload.data.data.total,list:e.newsData.list}});case"yapi/news/FETCH_MORE_NEWS":var r,l=t.payload.data.data.list;return(r=e.newsData.list).push.apply(r,(0,n.default)(l)),e.newsData.list.sort((function(e,t){return t.add_time-e.add_time})),l&&l.length&&e.curpage++,i(i({},e),{},{newsData:{total:t.payload.data.data.total,list:e.newsData.list}});default:return e}}},204:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(36);var l,u,o,c=r(a(4)),i=r(a(9)),s=r(a(10)),d=r(a(11)),f=r(a(12)),p=r(a(13)),m=r(a(5)),h=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=v(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),y=r(a(0));function v(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(v=function(e){return e?a:t})(e)}function g(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,p.default)(e);if(t){var n=(0,p.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,f.default)(this,a)}}a(1263);var b=(0,a(40).withRouter)((o=u=function(e){(0,d.default)(a,e);var t=g(a);function a(e){return(0,i.default)(this,a),t.call(this,e)}return(0,s.default)(a,[{key:"render",value:function(){var e=this,t=this.props,a=t.type,r=t.title,n=t.desc,l=t.opration,u="frown-o";if(a)switch(a){case"noFollow":r="你还没有关注项目呢",n=h.default.createElement("span",null,"先去 ",h.default.createElement("a",{onClick:function(){return e.props.history.push("/group")}},"“项目广场”")," 逛逛吧, 那里可以添加关注。");break;case"noInterface":r="该项目还没有接口呢",n="在左侧 “接口列表” 中添加接口";break;case"noMemberInProject":r="该项目还没有成员呢";break;case"noMemberInGroup":r="该分组还没有成员呢";break;case"noProject":r="该分组还没有项目呢",n=h.default.createElement("span",null,"请点击右上角添加项目按钮新建项目");break;case"noData":r="暂无数据",n="先去别处逛逛吧";break;case"noChange":r="没有改动",n="该操作未改动 Api 数据",u="meh-o";break;default:console.log("default")}return h.default.createElement("div",{className:"err-msg"},h.default.createElement(c.default,{type:u,className:"icon"}),h.default.createElement("p",{className:"title"},r),h.default.createElement("p",{className:"desc"},n),h.default.createElement("p",{className:"opration"},l))}}]),a}(h.PureComponent),(0,m.default)(u,"propTypes",{type:y.default.string,history:y.default.object,title:y.default.oneOfType([y.default.string,y.default.object]),desc:y.default.oneOfType([y.default.string,y.default.object]),opration:y.default.oneOfType([y.default.string,y.default.object])}),l=o))||l;t.default=b},237:function(e,t,a){"use strict";var r=a(3);Object.defineProperty(t,"__esModule",{value:!0}),t.changeMenuItem=function(e){return{type:"yapi/menu/CHANGE_MENU_ITEM",data:e}},t.default=void 0;var n=r(a(5));function l(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function u(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?l(Object(a),!0).forEach((function(t){(0,n.default)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):l(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var o={curKey:"/"+window.location.hash.split("/")[1]};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o,t=arguments.length>1?arguments[1]:void 0;return"yapi/menu/CHANGE_MENU_ITEM"===t.type?u(u({},e),{},{curKey:t.data}):e}},357:function(e,t,a){"use strict";var r=a(3),n=r(a(9)),l=r(a(10)),u=a(747),o=a(750),c=a(758).Base64,i={md5:function(e){return u(e)},sha:function(e,t){return o(t).update(e).digest("hex")},sha1:function(e){return o("sha1").update(e).digest("hex")},sha224:function(e){return o("sha224").update(e).digest("hex")},sha256:function(e){return o("sha256").update(e).digest("hex")},sha384:function(e){return o("sha384").update(e).digest("hex")},sha512:function(e){return o("sha512").update(e).digest("hex")},base64:function(e){return c.encode(e)},unbase64:function(e){return c.decode(e)},substr:function(e){for(var t=arguments.length,a=new Array(t>1?t-1:0),r=1;r<t;r++)a[r-1]=arguments[r];return e.substr.apply(e,a)},concat:function(e){for(var t=arguments.length,a=new Array(t>1?t-1:0),r=1;r<t;r++)a[r-1]=arguments[r];return a.forEach((function(t){e+=t})),e},lconcat:function(e){for(var t=this,a=arguments.length,r=new Array(a>1?a-1:0),n=1;n<a;n++)r[n-1]=arguments[n];return r.forEach((function(a){e=a+t._string})),e},lower:function(e){return e.toLowerCase()},upper:function(e){return e.toUpperCase()},length:function(e){return e.length},number:function(e){return isNaN(e)?e:+e}},s=function(e){return e},d=function(e){return e[0]!==e[e.length-1]||'"'!==e[0]&&"'"!==e[0]||(e=e.substr(1,e.length-2)),s(e.replace(new RegExp("___UNIQUE_VERTICAL___","g"),"|").replace(new RegExp("___UNIQUE_COMMA___","g"),","))},f=function(){function e(t){(0,n.default)(this,e),this._string=t}return(0,l.default)(e,[{key:"toString",value:function(){return this._string}}]),e}();function p(e,t){f.prototype[e]=function(){for(var e=arguments.length,a=new Array(e),r=0;r<e;r++)a[r]=arguments[r];return a.unshift(this._string+""),this._string=t.apply(this,a),this}}function m(e,t,a){return 0===a?new f(t):e[t.method].apply(e,t.args)}function h(e,t){if(e=e.trim(),0===t)return d(e);var a,r=[];if(e.indexOf(":")>0?(a=(e=e.split(":"))[0].trim(),r=e[1].split(",").map((function(e){return d(e.trim())}))):a=e,"function"!=typeof i[a])throw new Error("This method name(".concat(a,") is not exist."));return{method:a,args:r}}!function(e){for(var t in e)p(t,e[t])}(i),e.exports={utils:i,PowerString:f,filter:function(e,t){return e?("function"==typeof t&&(s=t),e=e.replace("\\|","___UNIQUE_VERTICAL___").replace("\\,","___UNIQUE_COMMA___").split("|").map(h).reduce(m,null).toString()):e}}},373:function(e,t,a){"use strict";var r=a(3)(a(7)),n=a(523),l=a(262);a(1008),a(525),a(1011),a(1012);var u=a(143),o=a(522),c=n.acequire("ace/ext/language_tools"),i=[{name:"字符串",mock:"@string"},{name:"自然数",mock:"@natural"},{name:"浮点数",mock:"@float"},{name:"字符",mock:"@character"},{name:"布尔",mock:"@boolean"},{name:"url",mock:"@url"},{name:"域名",mock:"@domain"},{name:"ip地址",mock:"@ip"},{name:"id",mock:"@id"},{name:"guid",mock:"@guid"},{name:"当前时间",mock:"@now"},{name:"时间戳",mock:"@timestamp"},{name:"日期",mock:"@date"},{name:"时间",mock:"@time"},{name:"日期时间",mock:"@datetime"},{name:"图片连接",mock:"@image"},{name:"图片data",mock:"@imageData"},{name:"颜色",mock:"@color"},{name:"颜色hex",mock:"@hex"},{name:"颜色rgba",mock:"@rgba"},{name:"颜色rgb",mock:"@rgb"},{name:"颜色hsl",mock:"@hsl"},{name:"整数",mock:"@integer"},{name:"email",mock:"@email"},{name:"大段文本",mock:"@paragraph"},{name:"句子",mock:"@sentence"},{name:"单词",mock:"@word"},{name:"大段中文文本",mock:"@cparagraph"},{name:"中文标题",mock:"@ctitle"},{name:"标题",mock:"@title"},{name:"姓名",mock:"@name"},{name:"中文姓名",mock:"@cname"},{name:"中文姓",mock:"@cfirst"},{name:"中文名",mock:"@clast"},{name:"英文姓",mock:"@first"},{name:"英文名",mock:"@last"},{name:"中文句子",mock:"@csentence"},{name:"中文词组",mock:"@cword"},{name:"地址",mock:"@region"},{name:"省份",mock:"@province"},{name:"城市",mock:"@city"},{name:"地区",mock:"@county"},{name:"转换为大写",mock:"@upper"},{name:"转换为小写",mock:"@lower"},{name:"挑选（枚举）",mock:"@pick"},{name:"打乱数组",mock:"@shuffle"},{name:"协议",mock:"@protocol"}],s=n.acequire("ace/lib/dom");n.acequire("ace/commands/default_commands").commands.push({name:"Toggle Fullscreen",bindKey:"F9",exec:function(e){if(e._fullscreen_yapi){var t=s.toggleCssClass(document.body,"fullScreen");s.setCssClass(e.container,"fullScreen",t),e.setAutoScrollEditorIntoView(!t),e.resize()}}}),e.exports=function(e){var t,a,s,d,f;function p(e){var t=a.curData;try{t.text=e;var r=u.parse(e);t.format=!0,t.jsonData=r,t.mockData=function(){return l.mock(o(r,{}))}}catch(e){t.format=e.message}}function m(e){return"string"==typeof(e=e||"")?function(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch(t){return e}}(e):"object"===(0,r.default)(e)?JSON.stringify(e,null,"  "):""+e}return d=(e=e||{}).container||"mock-editor",e.wordList&&"object"===(0,r.default)(e.wordList)&&e.wordList.name&&e.wordList.mock&&i.push(e.wordList),f=e.data||"",e.readOnly=e.readOnly||!1,e.fullScreen=e.fullScreen||!1,(t=n.edit(d)).$blockScrolling=1/0,t.getSession().setMode("ace/mode/javascript"),!0===e.readOnly&&(t.setReadOnly(!0),t.renderer.$cursorLayer.element.style.display="none"),t.setTheme("ace/theme/monokai"),t.setOptions({enableBasicAutocompletion:!0,enableSnippets:!1,enableLiveAutocompletion:!0,useWorker:!0}),t._fullscreen_yapi=e.fullScreen,a={curData:{},getValue:function(){return a.curData.text},setValue:function(e){t.setValue(m(e))},editor:t,options:e,insertCode:function(e){var a=t.selection.getCursor();t.session.insert(a,e)}},s={identifierRegexps:[/[@]/],getCompletions:function(e,t,a,r,n){0!==r.length?n(null,i.map((function(e){return{name:e.mock,value:e.mock,score:e.mock,meta:e.name}}))):n(null,[])}},c.addCompleter(s),a.setValue(m(f)),p(t.getValue()),t.clearSelection(),t.getSession().on("change",(function(){p(t.getValue()),"function"==typeof e.onChange&&e.onChange.call(a,a.curData),t.clearSelection()})),a}},392:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(38);var l=r(a(39)),u=r(a(9)),o=r(a(10)),c=r(a(23)),i=r(a(11)),s=r(a(12)),d=r(a(13)),f=r(a(5));a(367);var p=r(a(253));a(144);var m=r(a(166));a(55);var h=r(a(45));a(236);var y=r(a(244));a(137);var v=r(a(90));a(36);var g=r(a(4));a(146);var b=r(a(147));a(1232);var E,_,k,j=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=I(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),w=r(a(0)),O=a(22),C=a(40),x=a(101),P=a(237),N=r(a(1233)),M=(r(a(393)),r(a(567))),S=r(a(568));function I(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(I=function(e){return e?a:t})(e)}function R(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,d.default)(e);if(t){var n=(0,d.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,s.default)(this,a)}}var D=b.default.Header,T=a(141),q={user:{path:"/user/profile",name:"个人中心",icon:"user",adminFlag:!1},solution:{path:"/user/list",name:"用户管理",icon:"solution",adminFlag:!0}};T.emitHook("header_menu",q);var L=function(e){return j.default.createElement(v.default,{theme:"dark",className:"user-menu"},Object.keys(q).map((function(t){var a=q[t],r="admin"===e.role;return a.adminFlag&&!r?null:j.default.createElement(v.default.Item,{key:t},"个人中心"===a.name?j.default.createElement(C.Link,{to:a.path+"/".concat(e.uid)},j.default.createElement(g.default,{type:a.icon}),a.name):j.default.createElement(C.Link,{to:a.path},j.default.createElement(g.default,{type:a.icon}),a.name))})),j.default.createElement(v.default.Item,{key:"9"},j.default.createElement("a",{onClick:e.logout},j.default.createElement(g.default,{type:"logout"}),"退出")))},A=j.default.createElement("div",{className:"title-container"},j.default.createElement("h3",{className:"title"},j.default.createElement(g.default,{type:"star"})," 关注"),j.default.createElement("p",null,"这里是你的专属收藏夹，便于你找到自己的项目")),B=j.default.createElement("div",{className:"title-container"},j.default.createElement("h3",{className:"title"},j.default.createElement(g.default,{type:"plus-circle"})," 新建项目"),j.default.createElement("p",null,"在任何页面都可以快速新建项目")),W=j.default.createElement("div",{className:"title-container"},j.default.createElement("h3",{className:"title"},"使用文档 ",j.default.createElement(y.default,{color:"orange"},"推荐!")),j.default.createElement("p",null,"初次使用 YApi，强烈建议你阅读"," ",j.default.createElement("a",{target:"_blank",href:"https://hellosean1025.github.io/yapi/",rel:"noopener noreferrer"},"使用文档"),"，我们为你提供了通俗易懂的快速入门教程，更有详细的使用说明，欢迎阅读！"," "));L.propTypes={user:w.default.string,msg:w.default.string,role:w.default.string,uid:w.default.number,relieveLink:w.default.func,logout:w.default.func};var G=function(e){var t=e.imageUrl?e.imageUrl:"/api/user/avatar?uid=".concat(e.uid);return j.default.createElement("ul",null,j.default.createElement("li",{className:"toolbar-li "},j.default.createElement(N.default,{groupList:e.groupList})),j.default.createElement(m.default,{overlayClassName:"popover-index",content:j.default.createElement(S.default,null),title:A,placement:"bottomRight",arrowPointAtCenter:!0,visible:1===e.studyTip&&!e.study},j.default.createElement(h.default,{placement:"bottom",title:"我的关注"},j.default.createElement("li",{className:"toolbar-li"},j.default.createElement(C.Link,{to:"/follow"},j.default.createElement(g.default,{className:"dropdown-link",style:{fontSize:16},type:"star"}))))),j.default.createElement(m.default,{overlayClassName:"popover-index",content:j.default.createElement(S.default,null),title:B,placement:"bottomRight",arrowPointAtCenter:!0,visible:2===e.studyTip&&!e.study},j.default.createElement(h.default,{placement:"bottom",title:"新建项目"},j.default.createElement("li",{className:"toolbar-li"},j.default.createElement(C.Link,{to:"/add-project"},j.default.createElement(g.default,{className:"dropdown-link",style:{fontSize:16},type:"plus-circle"}))))),j.default.createElement(m.default,{overlayClassName:"popover-index",content:j.default.createElement(S.default,{isLast:!0}),title:W,placement:"bottomRight",arrowPointAtCenter:!0,visible:3===e.studyTip&&!e.study},j.default.createElement(h.default,{placement:"bottom",title:"使用文档"},j.default.createElement("li",{className:"toolbar-li"},j.default.createElement("a",{target:"_blank",href:"https://hellosean1025.github.io/yapi",rel:"noopener noreferrer"},j.default.createElement(g.default,{className:"dropdown-link",style:{fontSize:16},type:"question-circle"}))))),j.default.createElement("li",{className:"toolbar-li"},j.default.createElement(p.default,{placement:"bottomRight",trigger:["click"],overlay:j.default.createElement(L,{user:e.user,msg:e.msg,uid:e.uid,role:e.role,relieveLink:e.relieveLink,logout:e.logout})},j.default.createElement("a",{className:"dropdown-link"},j.default.createElement("span",{className:"avatar-image"},j.default.createElement("img",{src:t})),j.default.createElement("span",{className:"name"},j.default.createElement(g.default,{type:"down"}))))))};G.propTypes={user:w.default.string,msg:w.default.string,role:w.default.string,uid:w.default.number,relieveLink:w.default.func,logout:w.default.func,groupList:w.default.array,studyTip:w.default.number,study:w.default.bool,imageUrl:w.default.any};var F=(0,O.connect)((function(e){return{user:e.user.userName,uid:e.user.uid,msg:null,role:e.user.role,login:e.user.isLogin,studyTip:e.user.studyTip,study:e.user.study,imageUrl:e.user.imageUrl}}),{loginTypeAction:x.loginTypeAction,logoutActions:x.logoutActions,checkLoginState:x.checkLoginState,changeMenuItem:P.changeMenuItem})(E=(0,C.withRouter)((k=_=function(e){(0,i.default)(r,e);var t=R(r);function r(e){var a;return(0,u.default)(this,r),a=t.call(this,e),(0,f.default)((0,c.default)(a),"linkTo",(function(e){"/doc"!=e.key&&(a.props.changeMenuItem(e.key),a.props.login||l.default.info("请先登录",1))})),(0,f.default)((0,c.default)(a),"relieveLink",(function(){a.props.changeMenuItem("")})),(0,f.default)((0,c.default)(a),"logout",(function(e){e.preventDefault(),a.props.logoutActions().then((function(e){0==e.payload.data.errcode?(a.props.history.push("/"),a.props.changeMenuItem("/"),l.default.success("退出成功! ")):l.default.error(e.payload.data.errmsg)})).catch((function(e){l.default.error(e)}))})),(0,f.default)((0,c.default)(a),"handleLogin",(function(e){e.preventDefault(),a.props.loginTypeAction("1")})),(0,f.default)((0,c.default)(a),"handleReg",(function(e){e.preventDefault(),a.props.loginTypeAction("2")})),(0,f.default)((0,c.default)(a),"checkLoginState",(function(){a.props.checkLoginState.then((function(e){0!==e.payload.data.errcode&&a.props.history.push("/")})).catch((function(e){console.log(e)}))})),a.state={showSearch:!1},a}return(0,o.default)(r,[{key:"render",value:function(){var e=this.props,t=e.login,r=e.user,n=e.msg,l=e.uid,u=e.role,o=e.studyTip,c=e.study,i=e.imageUrl;return j.default.createElement(D,{className:"header-box m-header"},j.default.createElement("div",{className:"content g-row"},j.default.createElement(C.Link,{onClick:this.relieveLink,to:"/space/group",className:"logo"},j.default.createElement("div",{className:"href"},j.default.createElement("span",{className:"img"},j.default.createElement("img",{src:a(569),width:"32",height:32})))),j.default.createElement(M.default,null),j.default.createElement("div",{className:"user-toolbar",style:{position:"relative",zIndex:this.props.studyTip>0?3:1}},t?j.default.createElement(G,{studyTip:o,study:c,user:r,msg:n,uid:l,role:u,imageUrl:i,relieveLink:this.relieveLink,logout:this.logout}):"")))}}]),r}(j.PureComponent),(0,f.default)(_,"propTypes",{router:w.default.object,user:w.default.string,msg:w.default.string,uid:w.default.number,role:w.default.string,login:w.default.bool,relieveLink:w.default.func,logoutActions:w.default.func,checkLoginState:w.default.func,loginTypeAction:w.default.func,changeMenuItem:w.default.func,history:w.default.object,location:w.default.object,study:w.default.bool,studyTip:w.default.number,imageUrl:w.default.any}),E=k))||E)||E;t.default=F},393:function(e,t,a){"use strict";var r=a(3);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(a(1)),l=r(a(0)),u=function(e){var t=e.length;return n.default.createElement("svg",{className:"svg",width:t,height:t,viewBox:"0 0 64 64",version:"1.1"},n.default.createElement("title",null,"Icon"),n.default.createElement("desc",null,"Created with Sketch."),n.default.createElement("defs",null,n.default.createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"linearGradient-1"},n.default.createElement("stop",{stopColor:"#FFFFFF",offset:"0%"}),n.default.createElement("stop",{stopColor:"#F2F2F2",offset:"100%"})),n.default.createElement("circle",{id:"path-2",cx:"31.9988602",cy:"31.9988602",r:"2.92886048"}),n.default.createElement("filter",{x:"-85.4%",y:"-68.3%",width:"270.7%",height:"270.7%",filterUnits:"objectBoundingBox",id:"filter-3"},n.default.createElement("feOffset",{dx:"0",dy:"1",in:"SourceAlpha",result:"shadowOffsetOuter1"}),n.default.createElement("feGaussianBlur",{stdDeviation:"1.5",in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),n.default.createElement("feColorMatrix",{values:"0 0 0 0 0   0 0 0 0 0   0 0 0 0 0  0 0 0 0.159703351 0",type:"matrix",in:"shadowBlurOuter1"}))),n.default.createElement("g",{id:"首页",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},n.default.createElement("g",{id:"大屏幕"},n.default.createElement("g",{id:"Icon"},n.default.createElement("circle",{id:"Oval-1",fill:"url(#linearGradient-1)",cx:"32",cy:"32",r:"32"}),n.default.createElement("path",{d:"M36.7078009,31.8054514 L36.7078009,51.7110548 C36.7078009,54.2844537 34.6258634,56.3695395 32.0579205,56.3695395 C29.4899777,56.3695395 27.4099998,54.0704461 27.4099998,51.7941246 L27.4099998,31.8061972 C27.4099998,29.528395 29.4909575,27.218453 32.0589004,27.230043 C34.6268432,27.241633 36.7078009,29.528395 36.7078009,31.8054514 Z",id:"blue",fill:"#2359F1",fillRule:"nonzero"}),n.default.createElement("path",{d:"M45.2586091,17.1026914 C45.2586091,17.1026914 45.5657231,34.0524383 45.2345291,37.01141 C44.9033351,39.9703817 43.1767091,41.6667796 40.6088126,41.6667796 C38.040916,41.6667796 35.9609757,39.3676862 35.9609757,37.0913646 L35.9609757,17.1034372 C35.9609757,14.825635 38.0418959,12.515693 40.6097924,12.527283 C43.177689,12.538873 45.2586091,14.825635 45.2586091,17.1026914 Z",id:"green",fill:"#57CF27",fillRule:"nonzero",transform:"translate(40.674608, 27.097010) rotate(60.000000) translate(-40.674608, -27.097010) "}),n.default.createElement("path",{d:"M28.0410158,17.0465598 L28.0410158,36.9521632 C28.0410158,39.525562 25.9591158,41.6106479 23.3912193,41.6106479 C20.8233227,41.6106479 18.7433824,39.3115545 18.7433824,37.035233 L18.7433824,17.0473055 C18.7433824,14.7695034 20.8243026,12.4595614 23.3921991,12.4711513 C25.9600956,12.4827413 28.0410158,14.7695034 28.0410158,17.0465598 Z",id:"red",fill:"#FF561B",fillRule:"nonzero",transform:"translate(23.392199, 27.040878) rotate(-60.000000) translate(-23.392199, -27.040878) "}),n.default.createElement("g",{id:"inner-round"},n.default.createElement("use",{fill:"black",fillOpacity:"1",filter:"url(#filter-3)",xlinkHref:"#path-2"}),n.default.createElement("use",{fill:"#F7F7F7",fillRule:"evenodd",xlinkHref:"#path-2"}))))))};u.propTypes={length:l.default.any};var o=u;t.default=o},394:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(9)),u=r(a(10)),o=r(a(23)),c=r(a(11)),i=r(a(12)),s=r(a(13)),d=r(a(5));a(71);var f=r(a(61)),p=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=y(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),m=r(a(0)),h=r(a(44));function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(y=function(e){return e?a:t})(e)}function v(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,s.default)(e);if(t){var n=(0,s.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,i.default)(this,a)}}var g=f.default.Option,b=function(e){(0,c.default)(a,e);var t=v(a);function a(e){var r;return(0,l.default)(this,a),r=t.call(this,e),(0,d.default)((0,o.default)(r),"state",{dataSource:[],fetching:!1}),(0,d.default)((0,o.default)(r),"handleSearch",(function(e){var t={q:e};r.setState({fetching:!0}),h.default.get("/api/user/search",{params:t}).then((function(e){var t=[];(e=e.data.data)&&(e.forEach((function(e){return t.push({username:e.username,id:e.uid})})),r.setState({dataSource:t}))}))})),(0,d.default)((0,o.default)(r),"handleChange",(function(e){r.setState({dataSource:[],fetching:!1}),r.props.callbackState(e)})),r}return(0,u.default)(a,[{key:"render",value:function(){var e=this.state,t=e.dataSource,a=e.fetching,r=t.map((function(e,t){return p.default.createElement(g,{key:t,value:""+e.id},e.username)}));return p.default.createElement(f.default,{mode:"multiple",style:{width:"100%"},placeholder:"请输入用户名",filterOption:!1,optionLabelProp:"children",notFoundContent:a?p.default.createElement("span",{style:{color:"red"}}," 当前用户不存在"):null,onSearch:this.handleSearch,onChange:this.handleChange},r)}}]),a}(p.PureComponent);(0,d.default)(b,"propTypes",{callbackState:m.default.func});var E=b;t.default=E},395:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(30));a(55);var u=r(a(45));a(203);var o=r(a(210));a(36);var c=r(a(4));a(48);var i=r(a(47));a(238);var s=r(a(246));a(38);var d=r(a(39)),f=r(a(31)),p=r(a(9)),m=r(a(10)),h=r(a(23)),y=r(a(11)),v=r(a(12)),g=r(a(13)),b=r(a(5));a(53);var E=r(a(54));a(1262);var _,k,j,w=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=D(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),O=a(22),C=a(396),x=r(a(0)),P=a(40),N=a(68),M=r(a(72)),S=r(a(294)),I=a(75),R=a(68);function D(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(D=function(e){return e?a:t})(e)}function T(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,g.default)(e);if(t){var n=(0,g.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,v.default)(this,a)}}var q=E.default.confirm,L=(0,O.connect)((function(e){return{uid:e.user.uid,currPage:e.project.currPage}}),{delFollow:C.delFollow,addFollow:C.addFollow,getProject:I.getProject,checkProjectName:I.checkProjectName,copyProjectMsg:I.copyProjectMsg})(_=(0,P.withRouter)((j=k=function(e){(0,y.default)(a,e);var t=T(a);function a(e){var r;return(0,p.default)(this,a),r=t.call(this,e),(0,b.default)((0,h.default)(r),"copy",function(){var e=(0,f.default)(l.default.mark((function e(t){var a,n,u,o;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=r.props.projectData._id,e.next=3,r.props.getProject(a);case 3:return n=e.sent,u=n.payload.data.data,o=(0,S.default)(u,(function(e){e.preName=e.name,e.name=t})),e.next=8,r.props.copyProjectMsg(o);case 8:d.default.success("项目复制成功"),r.props.callbackResult();case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),(0,b.default)((0,h.default)(r),"showConfirm",(function(){var e=(0,h.default)(r);q({title:"确认复制 "+e.props.projectData.name+" 项目吗？",okText:"确认",cancelText:"取消",content:w.default.createElement("div",{style:{marginTop:"10px",fontSize:"13px",lineHeight:"25px"}},w.default.createElement(s.default,{message:"该操作将会复制 ".concat(e.props.projectData.name," 下的所有接口集合，但不包括测试集合中的接口"),type:"info"}),w.default.createElement("div",{style:{marginTop:"16px"}},w.default.createElement("p",null,w.default.createElement("b",null,"项目名称:")),w.default.createElement(i.default,{id:"project_name",placeholder:"项目名称"}))),onOk:function(){return(0,f.default)(l.default.mark((function t(){var a,r;return l.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=(0,R.trim)(document.getElementById("project_name").value),r=e.props.projectData.group_id,t.next=4,e.props.checkProjectName(a,r);case 4:e.copy(a);case 5:case"end":return t.stop()}}),t)})))()},iconType:"copy",onCancel:function(){}})})),(0,b.default)((0,h.default)(r),"del",(function(){var e=r.props.projectData.projectid||r.props.projectData._id;r.props.delFollow(e).then((function(e){0===e.payload.data.errcode&&r.props.callbackResult()}))})),(0,b.default)((0,h.default)(r),"add",(function(){var e=r.props,t=e.uid,a=e.projectData,n={uid:t,projectid:a._id,projectname:a.name,icon:a.icon||M.default.PROJECT_ICON[0],color:a.color||M.default.PROJECT_COLOR.blue};r.props.addFollow(n).then((function(e){0===e.payload.data.errcode&&r.props.callbackResult()}))})),r.add=(0,N.debounce)(r.add,400),r.del=(0,N.debounce)(r.del,400),r}return(0,m.default)(a,[{key:"render",value:function(){var e=this,t=this.props,a=t.projectData,r=t.inFollowPage,n=t.isShow;return w.default.createElement("div",{className:"card-container"},w.default.createElement(o.default,{bordered:!1,className:"m-card",onClick:function(){return e.props.history.push("/project/"+(a.projectid||a._id))}},w.default.createElement(c.default,{type:a.icon||"star-o",className:"ui-logo",style:{backgroundColor:M.default.PROJECT_COLOR[a.color]||M.default.PROJECT_COLOR.blue}}),w.default.createElement("h4",{className:"ui-title"},a.name||a.projectname)),w.default.createElement("div",{className:"card-btns",onClick:a.follow||r?this.del:this.add},w.default.createElement(u.default,{placement:"rightTop",title:a.follow||r?"取消关注":"添加关注"},w.default.createElement(c.default,{type:a.follow||r?"star":"star-o",className:"icon "+(a.follow||r?"active":"")}))),n&&w.default.createElement("div",{className:"copy-btns",onClick:this.showConfirm},w.default.createElement(u.default,{placement:"rightTop",title:"复制项目"},w.default.createElement(c.default,{type:"copy",className:"icon"}))))}}]),a}(w.PureComponent),(0,b.default)(k,"propTypes",{projectData:x.default.object,uid:x.default.number,inFollowPage:x.default.bool,callbackResult:x.default.func,history:x.default.object,delFollow:x.default.func,addFollow:x.default.func,isShow:x.default.bool,getProject:x.default.func,checkProjectName:x.default.func,copyProjectMsg:x.default.func,currPage:x.default.number}),_=j))||_)||_;t.default=L},396:function(e,t,a){"use strict";var r=a(3);Object.defineProperty(t,"__esModule",{value:!0}),t.addFollow=function(e){return{type:"yapi/follow/ADD_FOLLOW",payload:l.default.post("/api/follow/add",e)}},t.default=void 0,t.delFollow=function(e){return{type:"yapi/follow/DEL_FOLLOW",payload:l.default.post("/api/follow/del",{projectid:e})}},t.getFollowList=function(e){return{type:"yapi/follow/GET_FOLLOW_LIST",payload:l.default.get("/api/follow/list",{params:{uid:e}})}};var n=r(a(5)),l=r(a(44));function u(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function o(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?u(Object(a),!0).forEach((function(t){(0,n.default)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):u(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var c={data:[]};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c,t=arguments.length>1?arguments[1]:void 0;return"yapi/follow/GET_FOLLOW_LIST"===t.type?o(o({},e),{},{data:t.payload.data.data}):e}},397:function(e,t,a){"use strict";var r=a(3);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Breadcrumb",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"Footer",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"Header",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"Loading",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"Postman",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"ProjectCard",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"Subnav",{enumerable:!0,get:function(){return i.default}});var n=r(a(567)),l=r(a(1285)),u=r(a(392)),o=r(a(398)),c=r(a(395)),i=r(a(1288)),s=r(a(580))},398:function(e,t,a){"use strict";var r=a(3);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(a(9)),l=r(a(10)),u=r(a(11)),o=r(a(12)),c=r(a(13)),i=r(a(5)),s=r(a(1)),d=r(a(0));function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,c.default)(e);if(t){var n=(0,c.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,o.default)(this,a)}}a(1287);var p=function(e){(0,u.default)(a,e);var t=f(a);function a(e){var r;return(0,n.default)(this,a),(r=t.call(this,e)).state={show:e.visible},r}return(0,l.default)(a,[{key:"componentWillReceiveProps",value:function(e){this.setState({show:e.visible})}},{key:"render",value:function(){return s.default.createElement("div",{className:"loading-box",style:{display:this.state.show?"flex":"none"}},s.default.createElement("div",{className:"loading-box-bg"}),s.default.createElement("div",{className:"loading-box-inner"},s.default.createElement("div",null),s.default.createElement("div",null),s.default.createElement("div",null),s.default.createElement("div",null),s.default.createElement("div",null),s.default.createElement("div",null),s.default.createElement("div",null),s.default.createElement("div",null)))}}]),a}(s.default.PureComponent);t.default=p,(0,i.default)(p,"defaultProps",{visible:!1}),(0,i.default)(p,"propTypes",{visible:d.default.bool})},423:function(e,t,a){},424:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(53);var l=r(a(54));a(33);var u=r(a(25)),o=r(a(58));a(48);var c=r(a(47));a(38);var i=r(a(39)),s=r(a(9)),d=r(a(10)),f=r(a(23)),p=r(a(11)),m=r(a(12)),h=r(a(13)),y=r(a(5)),v=r(a(7));a(82);var g=r(a(84)),b=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=O(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),E=r(a(0)),_=a(102),k=r(a(606)),j=r(a(143)),w=a(72);function O(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(O=function(e){return e?a:t})(e)}function C(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,h.default)(e);if(t){var n=(0,h.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,m.default)(this,a)}}var x=(0,k.default)({lang:"zh_CN",mock:w.MOCK_SOURCE}),P=g.default.Item;var N=function(e){(0,p.default)(a,e);var t=C(a);function a(e){var r;return(0,s.default)(this,a),r=t.call(this,e),(0,y.default)((0,f.default)(r),"onSubmit",(function(e){e.preventDefault(),r.props.form.validateFields((function(e,t){if(!e){t.projectId=r.props.projectId,t.groupId=r.props.groupId;var a={projectId:r.props.projectId||r.state.data.projectId,groupId:r.props.groupId||r.state.data.groupId,code:t.code,name:t.name,structure:r.state.data.structure,description:t.description,_id:r.props.id};_.axios.post("/api/dataStructure/save",a).then((function(e){if(0!==e.errcode)return i.default.error("".concat(e.errmsg,", 新增错误码出现异常"));r.props.onSubmit(e.data),r.props.form.resetFields()}))}}))})),r.state={data:{}},r}return(0,d.default)(a,[{key:"componentDidMount",value:function(){this.props.id&&this.loadData(this.props.id)}},{key:"loadData",value:function(e){var t=this;_.axios.get("/api/dataStructure/getById",{params:{id:e}}).then((function(e){e.data&&e.data.structure&&(e.data.structure=function(e){try{if((e=j.default.parse(e)).properties&&"object"===(0,v.default)(e.properties)&&!e.type&&(e.type="object"),e.items&&"object"===(0,v.default)(e.items)&&!e.type&&(e.type="array"),!e.type)return!1;e.type=e.type.toLowerCase();return-1!==["object","string","number","array","boolean","integer"].indexOf(e.type)&&JSON.stringify(e)}catch(e){return!1}}(e.data.structure)),t.setState({data:e.data})}))}},{key:"render",value:function(){var e,t=this,a=this.props.form,r=a.getFieldDecorator,n=a.getFieldsError,i={labelCol:{xs:{span:24},sm:{span:6}},wrapperCol:{xs:{span:24},sm:{span:14}}};return b.default.createElement(l.default,{destroyOnClose:!0,title:"编辑模板",footer:null,width:"1000px",visible:this.props.visible,className:"addcatmodal",onCancel:function(){t.props.form.resetFields(),t.props.onCancel&&t.props.onCancel()}},b.default.createElement(g.default,{onSubmit:this.onSubmit},b.default.createElement(P,(0,o.default)({},i,{label:"模板名称"}),r("name",{rules:[{required:!0,message:"请输入模板名称!"}],initialValue:this.state.data&&this.state.data.name||null})(b.default.createElement(c.default,{placeholder:"模板名称"}))),b.default.createElement(P,(0,o.default)({},i,{label:"模板编号"}),r("code",{rules:[{required:!0,message:"请输入模板编号!"}],initialValue:this.state.data&&this.state.data.code||null})(b.default.createElement(c.default,{placeholder:"模板编号"}))),b.default.createElement(P,(0,o.default)({},i,{label:"描述"}),r("description",{initialValue:this.state.data&&this.state.data.description||null})(b.default.createElement(c.default,{placeholder:"描述"}))),b.default.createElement("div",{style:{marginTop:"10px",padding:"0 10px "}},b.default.createElement("div",{style:{minHeight:"300px",maxHeight:"500px",overflowY:"auto"}},b.default.createElement(x,{onChange:function(e){var a=t.state.data;a.structure=e,t.setState({data:a})},isMock:!0,data:!!this.state.data.structure&&this.state.data.structure}))),b.default.createElement(P,{className:"catModalfoot",wrapperCol:{span:24,offset:8}},b.default.createElement(u.default,{onClick:function(){t.props.form.resetFields(),t.props.onCancel()},style:{marginRight:"10px"}},"取消"),b.default.createElement(u.default,{type:"primary",htmlType:"submit",disabled:(e=n(),Object.keys(e).some((function(t){return e[t]})))},"提交"))))}}]),a}(b.default.Component);(0,y.default)(N,"propTypes",{form:E.default.object,id:E.default.number,visible:E.default.bool,projectId:E.default.string,groupId:E.default.string,onCancel:E.default.func,onSubmit:E.default.func});var M=g.default.create()(N);t.default=M},522:function(e,t,a){"use strict";var r=a(3)(a(7)),n=/\${([a-zA-Z]+)\.?([a-zA-Z0-9_\.]*)\}/i;a(262).Random.extend({timestamp:function(){var e=(new Date).getTime()+"";return+e.substr(0,e.length-3)}}),e.exports=function(e,t){t=t||{};var a={regexp:function(e){return new RegExp(e)}};return e&&"object"===(0,r.default)(e)?function e(t,n){n||(n=Array.isArray(t)?[]:{});for(var u in t)if(t.hasOwnProperty(u))if(t[u]&&"object"===(0,r.default)(t[u]))n[u]=t[u].constructor===Array?[]:{},e(t[u],n[u]);else if(t[u]&&"string"==typeof t[u]){t[u]=l(t[u]);var o=u.split("|"),c=[].concat(o);if(n[u]=t[u],o.length>1)for(var i,s=1,d=o.length;s<d;s++)o[s]=o[s].toLowerCase(),o[s]in a&&(-1!==(i=c.indexOf(o[s]))&&c.splice(i,1),delete n[u],n[c.join("|")]=a[o[s]].call(t,t[u]))}else n[u]=t[u];return n}(e):e;function l(e){if("string"!=typeof e||-1===e.indexOf("{")||-1===e.indexOf("}")||-1===e.indexOf("$"))return e;var a=e.match(n);if(a){var l=a[1]+(a[2]?"."+a[2]:"");if(!l)return e;var u=l.split("."),o=t;return void 0===(0,r.default)(t[u[0]])?e:(u.forEach((function(e){if(""===o)return"";o=e in o?o[e]:""})),o)}return e}}},567:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(1239);var l=r(a(1631)),u=r(a(9)),o=r(a(10)),c=r(a(11)),i=r(a(12)),s=r(a(13)),d=r(a(5));a(1242);var f,p,m,h=a(40),y=r(a(0)),v=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=g(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1));function g(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(g=function(e){return e?a:t})(e)}function b(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,s.default)(e);if(t){var n=(0,s.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,i.default)(this,a)}}var E=(0,a(22).connect)((function(e){return{breadcrumb:e.user.breadcrumb}}))(f=(0,h.withRouter)((m=p=function(e){(0,c.default)(a,e);var t=b(a);function a(e){return(0,u.default)(this,a),t.call(this,e)}return(0,o.default)(a,[{key:"render",value:function(){var e=this.props.breadcrumb.map((function(e,t){return e.href?v.default.createElement(l.default.Item,{key:t},v.default.createElement(h.Link,{to:e.href},e.name)):v.default.createElement(l.default.Item,{key:t},e.name)}));return v.default.createElement("div",{className:"breadcrumb-container"},v.default.createElement(l.default,null,e))}}]),a}(v.PureComponent),(0,d.default)(p,"propTypes",{breadcrumb:y.default.array}),f=m))||f)||f;t.default=E},568:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(33);var l,u,o,c=r(a(25)),i=r(a(9)),s=r(a(10)),d=r(a(23)),f=r(a(11)),p=r(a(12)),m=r(a(13)),h=r(a(5)),y=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=E(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),v=r(a(0)),g=a(22),b=a(101);function E(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(E=function(e){return e?a:t})(e)}function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,m.default)(e);if(t){var n=(0,m.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,p.default)(this,a)}}var k=(0,g.connect)(null,{changeStudyTip:b.changeStudyTip,finishStudy:b.finishStudy})((o=u=function(e){(0,f.default)(a,e);var t=_(a);function a(e){var r;return(0,i.default)(this,a),r=t.call(this,e),(0,h.default)((0,d.default)(r),"nextStep",(function(){r.props.changeStudyTip(),r.props.isLast&&r.props.finishStudy()})),(0,h.default)((0,d.default)(r),"exitGuide",(function(){r.props.finishStudy()})),r}return(0,s.default)(a,[{key:"render",value:function(){return y.default.createElement("div",{className:"btn-container"},y.default.createElement(c.default,{className:"btn",type:"primary",onClick:this.nextStep},this.props.isLast?"完 成":"下一步"),y.default.createElement(c.default,{className:"btn",type:"dashed",onClick:this.exitGuide},"退出指引"))}}]),a}(y.PureComponent),(0,h.default)(u,"propTypes",{changeStudyTip:v.default.func,finishStudy:v.default.func,isLast:v.default.bool}),l=o))||l;t.default=k},569:function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHEAAABxCAYAAADifkzQAAAWWklEQVR4Xu2beZRXxZXHO3M8M54ZT5g/5iQTI5qo04lL1CREdgWkF3ZpUDoKZ9wCxrCogGIyigJiZAngBigooAKyCUKERsADOSqLyiarIGizKMomNHt3Td16Ve/durd+S3e9x9D0/PE59d59Vbfqfm/Ve/XerztHiIqcxNmzLmkuluRLukuek0yRlEje0/xd8rpkhK7TTPJD1D4ZqA4JwQyJQIPz518k7SRjJFskogqckayU/FXSUPIDwfvxg+qQEMyQCDS4qnOF5HnJIcGT4ssOyV8k/yF4v1WD6pAQzJAINLjKc5XkTRGsHip+3JRJhos4kkl1SAhmSAQaXPZcJBkiOSW42EmzX9JV8k+Cjys7qA4JwQyJQIPLjsaSrwQX92zzgeQywceXGapDQjBDItDg0gMz/3HJacEF/b/ioORWwceaHqpDQjBDItDgUvPPkqmCi3guUCHpLfiYU0N1SAhmSAQanJt/lSwSXLxzjaEi29cRqkNCMEMi0OA4sAKrQwINwwSPgUN1SAhmSAQanA3M6jcEF+pc5yHBY6mxSXxUcIGqA/DOepPg8dS4JDYS59YutLLslvxI8LhqTBJhI7Ndi1GdmS54bDUmiU8TMaozLQSPj+uQEMyQCDS4Pesul5xwiFFd+VxygaBxUh0SghkSgQa3Z904hxDVnbsEjZPqkBDMkAh2cLUlJx0iVHc2C/qxnOqQEMyQCHYSz6dnIcV+NlIdEoIZEiEKDGbql47gzxfgz0LO+yQ2cQR+PnFM4L/doTokBDPEQe7FP3IiA3vWEfj5Rhsadxi/Q6s4YIY4oINHSVwFgX66YKp4pu8fRefWeSKv7q9FnV9ekRV1r/4v0arRjaLvfXeIBa+/II59sYoKWGmObV8pZr08TDx8dyfRoXlj0fC6q1i/qWh8w9WiU2ETFQvEpH2OoHGfN0mUwf1w7XvTyiFoeR4LN151pZg4/ElxZtcalpxMQBtoCxOD+q0qt+XfLFbMfX1zriN+gOoUF8wQB3TwQOc2zYddfenFLPA46NI2Txza/AFLVCq+3/qR+MNtrZmfOLjqkv8U11x2cb9chwZUp7hghjigg5f0p8EaILH0NpWK66+4lLU3tLm5nkoOTRgF6rRtUp+1N0AftN9UZJiULJFUp7hghjggg28nqcABXvfz2mJIv+5i89LZomL3WiZ0OvZvWCZmjBkiCur/loomHrjjVlafAnVou/x6v1E+wTetnw4YO8Qw9LEeKibit1zSKvc8SOK/SXbh4ED8HcvfZYJUltNffSr697yXCidK3niR1TXANVq/f497lC9at7LsXD7fNbF2Sy7KreZJ7IGDgp3f12uWMAF8eOz+LpZwtzZtwOoY4BquC21pHR++Wfu+ihH3Iell9KA6xQUzxIEZtORjHNDbrwxjgftyeMuH4nfy+YT7WTZjvJj83CAxqHc3BRwvnTHOqgNtoC3158vc10bSJIIG1TaJ/54bPBdUMDdcedlJ16vAgY3/gG25+GD2hLRs/3Aea2uARBHhMgJtqB/gTOlqsX7RdNY/5dMFU5zvqRDjr352yVHUF2hQK7eaJvFGLFqnwqalNGBI3vWXsw1BSuClmvoA3p/2MqubicVTxzA/8Gy8vSD799imda4T333GN0OFDeqsIXVBC6ZTXDBDHMCAJfk4kPuL28EPp1awve8tZsKkA7b0rtX82ZKZrG4m1r43jfn5aM5EVi8Tb734DPPTqbDJMlIPtGA6xQUzxAEMWFIfByJf9nfSYMcOfoyJkg54v6M+ALi90bpdb2+jVtv8Sc87X+z/MXM88wObrsrcGX7x0x+LT+ZPZn5a31R3FakLWjCd4oIZ4gAGLPkJDqT+tblHaLCwql4fOUA83v3ujMC72J7Vi5lgwAtP9bXEhW+rtA7YcB1oQ+sA8Kx7std9rH8K1Fk0ZTRrD/w29+ffkiSCFkynuGCGONBJBLbjYJa/M4kF7As8x+AjOu5n5bw3WD2w4TrQJo73QwrEiPvRGlTb3SnwDA6oXZMGzh2dD2Oe7meJBr8slO/iX4HAdtMN11h1Rw/qx+r5ALFBjLgPyWCjB9UpLpghDsygc4PbSBkO6v7itqJs2womQFWAn5DggzP2P2FYf1bPMPWFwVZdaAs+aL2qAD9pQWzYv4794txqnkTgYRKYaNGwjtp0VPV2tnPFfPFo1zupYOojeDqf8A7o+vgNvyWCT1o/G+C5DrFATNSvpHcu0oLqFBfMEAd44JIfSCY7AhR1fnG5KG7RTNzXsZW469aCtNxT1EKV8LGa+gHqXZObVSKgDtSl7QHwjftKB4wZxg6/aVI/GogZYj8vkghcWJTfDD4G00BjAZ6D8GsCTVgqoC60oX7iovDmRl/I8sJcogPVKS6YIQ7o4IEli0penSKfSalWQVX45SU/Fv26da70T0gAtIG24IP6rSrwVwJTRg8RCxbMH5vr0IDqFBfMEAd08EBJyYKx4tutalPz2rAn1N+mXPuznzIhsqFZnevUz1CVWX2pAB/wznfL765n/WQDxACxQExqw3Zol4BYcx0aVFSUM63igBnigA4eUEk8vIeJCCviq1UlWXPk8+XMR1yAb9pfOpx3gOOHUiaR6hQXzBAHdPBhEk8e4UEnBPzqvnjqWPHuxOfS7lhjZe9noqL89PmRRMaedUESRYUQ32ziwScA/PlHrr7lPXjXbex6Ihz8UkCMKtbq/sfDDJzE7/fy4BMgr170KQ6eW/R6ElQcP+xMYlLPQgMzJAJO4pmT8razngkQN01+c621AaHXY2ffFpVAgCYxaZghEXASgUOlXISYOetJPHaghiXxzInEV+NZTeK+zTKu8hqWxLPwbDyrSTzxfRRXiiQm+VxkhkRwJbFCztxvNnNBYuKsJfFAsCM1yGQ5k5gkzOCDmW1s1rmSCJw8KoVI5rZ6VpIIr0vyvZDGVa2TmBKSRJit5lgc3cfFiYHkk7g+mIR0YtaUJDIOfuUQyY/Ek1j2HY+jRicRVub+L7hQHhQ2iH6khb9go9e9gE0ZjaHGJ1El8kysicR/Dgm/eNDrVSZDAoGam0SVyPJYb63wL9ir/v6m8w+nqsTRb/mYHdAkso1ezDBDImRIorXRAY58I5LatVaJrzfId8Hgu6hzvASaxKRhhkTIkEQn8LNVgu+RWfPdtuB7Lx1fGv4/iQj4bU49gxL+ROcEVl/ZfjambKgxSTS3pEy3JsXp4/pZeRaSuXdDMHEcL/HZUmOSWCXgwzn8icfXG7n4vsBPSfDhoaLqyTNU6yQ26PC2Rf0Os1QJAdEkZrsS6fXgvDzYaBza5fHclKv628+DVXeqjPXr6jtbTBLrtp+eU6/9zFAHRce3mW6+MIMPDTvOlsxBBOcQ0KARc+cLR8CxUH4q+CUBXgEO7w5uvQd2iu+/3CzKdm0JPlIfLA0SBl9aYNME76XUT0wMHP7OfIgZkhZoMDun0W2RJsKhnQ/M4IOVRDnoYOAqiFoyoN1lx06xgJNk5dq9YtP2qm1OUpFpdR4/cVrUaz9jt4y3Vpg8rYXRQzi084EZfMCzLpp5KoiR0i7WbtrHgk6K02fKRZt73xHFPeZL4fn1pIBJU79olpDxQsyhFqEeshQO7XxgBh/MTCMJvEqen4EkTpy5gQVtyDTDK8u4qetE3Vunw6oQ09/dyq7HBR335DmbhVyFMolzzjQKYkd3paAUDu18YAYf6KzT5UxZwswUt3cvYSJkAxUqE3v3HRENO8wQ9YpmqlXRpHi2OHD4OKuXBMU9F6pYZeKEjHsmJNA8Zow2wqGdD8zggxowWo2SX0MwMgDNbPFF6SEWeCYqm8ReTy2VyZupVgQAiXxi+IesXlVIN5Yvdx/WqzBIok4kaKDvTHqj59DOB2bwIVx94aDnTDfJM+XwVz5mwbtIJ1Y6lq4oVUkzCYQ+GwDy+JP1X7P6cTJi/CeqL+gT7j7BHQg0iDY45/wzUSfOPAuvlGUFnpVwfFOnOWL/wWNMgDiAnWHLe+bppAViGsDWvtu74vTpZF4tDh46JhrfHvSjV6CJGzS4Ej9ihEM7H5jBB3zfl8fDzWwMZqQWU66IIWNWMRHi4IVJq8PVh1aC1feEGclsroaO/ThY/eHE0X0HiRyO7k5MN1+YwQcz2+SAL5SB7IcgwgTqMrjNzRKbtsX7/rZDPmvBbyggmjhmDNB3o46zxNffuv82BqhKIjdu+87uO+w/QPYvtZh9odFHOLTzgRl8QEkstsW0Ra0vA+74wHxx4qT/d0oAhO/62BLlN1wJul+6GqHOgwOWMh9VBWLoJHfd4YYmSlx0Ww3sxVobppsvzOCDGWQj2FqHwpHbqV4RsHvsPyL7HWO6FVKybGe0G2WrAZ2Hfc8Sy1buYn6qAsSAN1HRBIomkrZLTYINjnBo5wMz+BDc92dfJAd+HAsXgYSUKwLe48ZOXseEqQzwKe+WO+eEO1IzUaJVgNGrUdZtcfdc7zvBS2+sDfrtSJKI49XjkByXx6AN080XZvBB307b6kGHQdBkmpkLAtRtPyPtl5xM/HX0SvVVRt1K1UqMbmvRJsPu20yg5yesZv6y5dVp62W/ZvW7EhiMweigNWnb8Fz/dtogeJl9XgWAbqGWiEhIJaZMAHweg/fHdLdMF1t3HJCTIPi0Rt8Nrf7MsZk80HcR9D9DbYio33TAGIeO1RNHfxEyfl39E0AbppsvzOBD8RN/yWnTc1Rp6x7PCUOrHqNEq+6jguPuwXHL7iNFyz+NVGWLB/6mKPzjcNFn2Jvi8BH3b3sUEPOBgRNU25Z/GqEJfAKqX4yxof6h7UPPvp715Dlw+KjoPeRNNdawX/CLfFv0COI2sYM2oJFwaOcDM/hQ/MSfaz8yKV8Y+k7MUzwyER8HJdBnQnPR57WA3q/eovjzpDbi48/fE/hfxVx8tHmeeHh80Ab89J2QF4D8m/Owf31u+jT9rlL98T4MFXIsq7YuFP0mtg7HqdpDv7g/Em+oxUSNPJZJrG30igtm8OGOp/o+GAyYJ4+hRe8DoCQCkJwhM+4T2/euZYICZScOi0cntIySqAQNJkWYTJxUdO6aOJCcEyl+3d+2Z414dvo9sq9miqBN5INOHHvC6mSiJN75VN9eVDdfmMGHu57pPtsKighpRDaC0xXRW5YqMeMhkc3EQ+OaicFv/bdYvW2JOHk6+lQ3afEgnUDdVoP9WSKbPlP0B329texvoX/o61PZ56CpXdQYgCCJwYRx9uWINZxUSA/QiOrmCzP4cO/QP3zmmv04qDCRWFAsrF6JRjQloKT3+OZifMnjYvGaKdaKCFdiJTFtcZ/vr5um+oC+wuTpBOK64ZjR5MCT1BWvATSiuvnCDD50G9l5XzR4kkQSNAWLZES1kxolFl9zrYpwUqBjy67b0f5UslA/bEy6xD5o3wo6YdFxt5Fd4E/qmHY+MIMP3V/scIKtNAiABgkiEBFDYZBYRlwqppPQp1vgsE7YBvWnb82u/qJJY+pzvzgmFrOe0CaR3V/qeILq5gsz+NBrbJtymiwcYO/X7FsfFhWLYouHhdbHWkx8O42Ej8S0kqaPw7qyNJPF+MZl1J9+TqP+MHjcOK4wTnRngvMHX25TTnXzhRl8eHBcYQUOwKwOZ6BmU2KJg0UKjunKyAz1qW26/1TQSWNskU9HH8YniRMD13FiHxrXooLq5gsz+IAHHOISlAho6kQrwX4m4fNAbMezUV+LStMP78+udwtakcZv5N/VDwPFSZMXnqNjqpsvzOADCy4NqZJCE4Q3G0Fp6thCp/KNS7xpoX1QbH92cmksYT1VRrdpQzixdaKpbr4wgw88AS7B8bkWzCEuFg1v9TP5i97psq2nr1nt+Bhsn3zMZoJFiXcfA1Q3X5jBh80LG4utixoFLEYlZlFD6/oWc65LOMeA3ZRhWw1uS9vgethv1FfUHz22feBr1BcijE8jjz9f3Fii7eq8kdgkNaK6+cIMXiyXt4qV+ZICXVaGPIctFVDX1EftVmAfpg6pq+q42uDScd20C9ujOi5WaQ1UqYFj0Ijq5gkz+HB0aZNyFgwVEQOCuKB1WLvmui5MGtMObPo8rKPr4XNn39QPquMah3NM5hglPIw50qNsadNz+xVj+4KmZVEQNIkoUCymsYeip8G0rQqVbWuND7cnfnC9lERJVBo5tPOBGXxYNi1/o7UKzUzHAjJRkBBUSNf1lY7r2QDtFKR/4y9d/5RU4w3tugyJNFk2vWAj1c0XZvBh2mvthzgTaCUBlamEyOY8UzJTXWf+HNdZHTLmVLB4cZmvnolKI4d2PjCDD2Ne6lwr2tygAHAwoTj62KpHRGYipRE6leC0DbW72ikblAbH9dAP9mmOdfwmeWhijx3dpRbVzRdm8GHMi51zdpTo5yLFBESTykTJJJQjIRhLfFQ/TBjxQZNAz7O5Rm1hXR273qnuXNisTCaR6eYLM/gwf3IrYGG4vWaYgOkxPXcIRK/TZIUThfhwiR3WcY0NtcNJMW0sG/XhALTQrxkLprReKGG6+cIMPrwy+k6gdhBgNPgwGBpgGCiU2YiC69D6SGh2Tuu6SFFHjS0FaWMisUtNXhnTubaE6eYLM/igk5izYd4t+8WqQqHAL7phqQOzXohTiJKyvqmL2qS7jn1jX1Zbhy+LFO1CfxrrONABNBknEwhQ3XxhBh/mjmqfM++5opx5o4qePtizqTjQs4kkKA/2Muc2qewR+DocZ/LbNLTxa6kJ6kb1o/E7/Opjl39cB9vnjurw9NyRHaRGHZhuvjCDD5DAuaOKVFnaNa9iZ15LAXyZ3yosKbgOrbczz1yP7LQuXHO1pddpXdo39xtB2+Bzag/boL52dc2vgORViyQufaptztIB7WTZDspZYXAQkCo1EJwuv9KBQmmO8fXgmItmXU9HqrauceTRMUTtzfis6xrWlvQpdZm1TOnSVmlDdfOFGXxQCTTIwZZ2yyunAdvBt1ZYYoR2fkzBE8CUEbZfy18BvRac83banqJ+6C8sIz/mOmhgNFGJHHCOJ3HB4KKcBU8HlAzuAGX/0hYtMwddoG2qNNejuqF4cN2qi+z62Bbb7hMnhPnC5xh2DZ2za7j/1qK0RSshNemvdNHagC5UN1+YwYdwsCaZstzSt+CIFZwKWKMFsJJkiYjPI7GsyZBCyMgf8kHr4v4sH45+jS/qI6wfnOO+tz5SeERNZqTLOZ/EOQOLFe/oUnPp7jsLUIBIDBI0F42KiwWm10m70KdB3tosP+actMdjMf70dVVfY3yFNtQOYtojY57zZPElkpzZ/TtJpBZwLKG6+cIMPqikDegUJtGUiwcUDSttGW0gLIFNqeym1MeWiHYSsKCW8KEfZMd1CkwCojJqh8Zg+XUc4z7MeUFwV4FYFw8sGgZJM0Dyqk8SEVES2+d88njrjdHzIsB6NoViI5HMuZUgl7DYjnxadRH6Ol2Z3BetR65jUBIhVogZJxFDdfOFGXyAVUgTGSbxf1rnbO1TeMQSKh8nFQlMxA9FJG2t1egQ27rVOdpzW9SnfR3dSq32pK28vrVPwRGIVa7EcPVRqG6+MIMPswb+3snbg+5QyOMLdvYqOAUBW8mjQjLh9TlOFLaH51hYJH5+kFCc9OhWamPVw326IH3v6Jl/6u1Bv7+Axk+1oLr58r+W4L8iRbCojgAAAABJRU5ErkJggg=="},570:function(e,t,a){},574:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(30));a(55);var u=r(a(45));a(33);var o=r(a(25));a(57);var c=r(a(51));a(64);var i,s,d,f,p=r(a(49)),m=r(a(571)),h=r(a(31)),y=r(a(9)),v=r(a(10)),g=r(a(23)),b=r(a(11)),E=r(a(12)),_=r(a(13)),k=r(a(5)),j=r(a(293)),w=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=R(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),O=r(a(0)),C=a(22),x=a(40),P=a(75),N=r(a(395)),M=r(a(204)),S=a(311),I=a(101);a(102),a(68);function R(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(R=function(e){return e?a:t})(e)}function D(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,_.default)(e);if(t){var n=(0,_.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,E.default)(this,a)}}a(1264);var T=(0,C.connect)((function(e){return{projectList:e.project.projectList,userInfo:e.project.userInfo,tableLoading:e.project.tableLoading,currGroup:e.group.currGroup,currPage:e.project.currPage}}),{fetchProjectList:P.fetchProjectList,addProject:P.addProject,delProject:P.delProject,changeUpdateModal:P.changeUpdateModal,setBreadcrumb:I.setBreadcrumb})((f=d=function(e){(0,b.default)(r,e);var t,a=D(r);function r(e){var t;return(0,y.default)(this,r),t=a.call(this,e),(0,k.default)((0,g.default)(t),"receiveRes",(function(){t.props.fetchProjectList(t.props.currGroup._id,t.props.currPage)})),t.state={visible:!1,protocol:"http://",projectData:[]},t}return(0,v.default)(r,[{key:"handleCancel",value:function(){this.props.form.resetFields(),this.setState({visible:!1})}},{key:"protocolChange",value:function(e){this.setState({protocol:e})}},{key:"componentDidMount",value:(t=(0,h.default)(l.default.mark((function e(){var t;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(t=this.props.groupId)&&t>0&&this.props.fetchProjectList(t,this.props.currPage),console.log(this.props);case 3:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"componentWillReceiveProps",value:function(e){if(this.props.setBreadcrumb([{name:""+(e.currGroup.group_name||"")}]),this.props.currGroup!==e.currGroup&&e.currGroup._id&&this.props.fetchProjectList(e.currGroup._id,this.props.currPage),this.props.projectList!==e.projectList){var t=e.projectList.map((function(e,t){return e.key=t,e}));this.setState({projectData:t})}}},{key:"render",value:function(){var e=this,t=this.state.projectData,a=[],r=[];for(var n in t)t[n].follow?r.push(t[n]):a.push(t[n]);r=r.sort((function(e,t){return t.up_time-e.up_time})),a=a.sort((function(e,t){return t.up_time-e.up_time})),t=[].concat((0,m.default)(r),(0,m.default)(a));var l=/(admin)|(owner)|(dev)/.test(this.props.currGroup.role),i=function(){return r.length?w.default.createElement(c.default,null,w.default.createElement("h3",{className:"owner-type"},"我的关注"),r.map((function(t,a){return w.default.createElement(p.default,{xs:8,lg:6,xxl:4,key:a},w.default.createElement(N.default,{projectData:t,callbackResult:e.receiveRes}))}))):null},s=function(){return a.length?w.default.createElement(c.default,{style:{borderBottom:"1px solid #eee",marginBottom:"15px"}},w.default.createElement("h3",{className:"owner-type"},"我的项目"),a.map((function(t,a){return w.default.createElement(p.default,{xs:8,lg:6,xxl:4,key:a},w.default.createElement(N.default,{projectData:t,callbackResult:e.receiveRes,isShow:l}))}))):null},d=function(){return t.length?w.default.createElement("div",null,w.default.createElement(s,null),w.default.createElement(i,null)):w.default.createElement(M.default,{type:"noProject"})};return w.default.createElement("div",{style:{paddingTop:"24px"},className:"m-panel card-panel card-panel-s project-list"},w.default.createElement(c.default,{className:"project-list-header"},w.default.createElement(p.default,{span:16,style:{textAlign:"left"}},this.props.currGroup.group_name," 分组共 (",t.length,") 个项目"),w.default.createElement(p.default,{span:8},l?w.default.createElement(x.Link,{to:"/add-project"},w.default.createElement(o.default,{type:"primary"},"添加项目")):w.default.createElement(u.default,{title:"您没有权限,请联系该分组组长或管理员"},w.default.createElement(o.default,{type:"primary",disabled:!0},"添加项目")))),w.default.createElement(c.default,{style:{height:"calc(100vh - 270px)",overflowY:"auto"}},"private"===this.props.currGroup.type?w.default.createElement(d,null):t.length?t.map((function(t,a){return w.default.createElement(p.default,{xs:8,lg:6,xxl:4,key:a},w.default.createElement(N.default,{projectData:t,callbackResult:e.receiveRes,isShow:l}))})):w.default.createElement(M.default,{type:"noProject"})))}}]),r}(w.PureComponent),(0,k.default)(d,"propTypes",{form:O.default.object,fetchProjectList:O.default.func,addProject:O.default.func,delProject:O.default.func,changeUpdateModal:O.default.func,projectList:O.default.array,userInfo:O.default.object,tableLoading:O.default.bool,currGroup:O.default.object,setBreadcrumb:O.default.func,currPage:O.default.number,studyTip:O.default.number,study:O.default.bool}),s=f,(0,j.default)(s.prototype,"handleCancel",[S.autobind],Object.getOwnPropertyDescriptor(s.prototype,"handleCancel"),s.prototype),(0,j.default)(s.prototype,"protocolChange",[S.autobind],Object.getOwnPropertyDescriptor(s.prototype,"protocolChange"),s.prototype),i=s))||i;t.default=T},575:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(123);var l=r(a(126));a(53);var u=r(a(54));a(57);var o=r(a(51));a(64);var c=r(a(49));a(230);var i=r(a(231));a(33);var s=r(a(25));a(38);var d=r(a(39)),f=r(a(9)),p=r(a(10)),m=r(a(23)),h=r(a(11)),y=r(a(12)),v=r(a(13)),g=r(a(293)),b=r(a(5));a(71);var E=r(a(61)),_=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=R(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),k=r(a(0)),j=a(22),w=a(40);a(1265);var O,C,x,P,N=a(311),M=a(103),S=r(a(204)),I=r(a(394));function R(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(R=function(e){return e?a:t})(e)}function D(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,v.default)(e);if(t){var n=(0,v.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,y.default)(this,a)}}function T(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function q(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?T(Object(a),!0).forEach((function(t){(0,b.default)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):T(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var L=E.default.Option;function A(e){return e.map((function(e,t){return q(q({},e),{},{key:t})}))}var B=(0,j.connect)((function(e){return{currGroup:e.group.currGroup,uid:e.user.uid,role:e.group.role}}),{fetchGroupMemberList:M.fetchGroupMemberList,fetchGroupMsg:M.fetchGroupMsg,addMember:M.addMember,delMember:M.delMember,changeMemberRole:M.changeMemberRole})((P=x=function(e){(0,h.default)(a,e);var t=D(a);function a(e){var r;return(0,f.default)(this,a),r=t.call(this,e),(0,b.default)((0,m.default)(r),"showAddMemberModal",(function(){r.setState({visible:!0})})),(0,b.default)((0,m.default)(r),"reFetchList",(function(){r.props.fetchGroupMemberList(r.props.currGroup._id).then((function(e){r.setState({userInfo:A(e.payload.data.data),visible:!1})}))})),(0,b.default)((0,m.default)(r),"handleOk",(function(){r.props.addMember({id:r.props.currGroup._id,member_uids:r.state.inputUids,role:r.state.inputRole}).then((function(e){if(!e.payload.data.errcode){var t=e.payload.data.data,a=t.add_members,n=t.exist_members,l=a.length,u=n.length;r.setState({inputRole:"dev",inputUids:[]}),d.default.success("添加成功! 已成功添加 ".concat(l," 人，其中 ").concat(u," 人已存在")),r.reFetchList()}}))})),(0,b.default)((0,m.default)(r),"changeNewMemberRole",(function(e){r.setState({inputRole:e})})),(0,b.default)((0,m.default)(r),"deleteConfirm",(function(e){return function(){var t=r.props.currGroup._id;r.props.delMember({id:t,member_uid:e}).then((function(e){e.payload.data.errcode||(d.default.success(e.payload.data.errmsg),r.reFetchList())}))}})),(0,b.default)((0,m.default)(r),"changeUserRole",(function(e){var t=r.props.currGroup._id,a=e.split("-")[0],n=e.split("-")[1];r.props.changeMemberRole({id:t,member_uid:n,role:a}).then((function(e){e.payload.data.errcode||(d.default.success(e.payload.data.errmsg),r.reFetchList())}))})),(0,b.default)((0,m.default)(r),"handleCancel",(function(){r.setState({visible:!1})})),r.state={userInfo:[],role:"",visible:!1,dataSource:[],inputUids:[],inputRole:"dev"},r}return(0,p.default)(a,[{key:"componentWillReceiveProps",value:function(e){var t=this;if(this._groupId!=this._groupId)return null;this.props.currGroup._id!==e.currGroup._id&&(this.props.fetchGroupMemberList(e.currGroup._id).then((function(e){t.setState({userInfo:A(e.payload.data.data)})})),this.props.fetchGroupMsg(e.currGroup._id).then((function(e){t.setState({role:e.payload.data.data.role})})))}},{key:"componentDidMount",value:function(){var e=this,t=this._groupId=this.props.currGroup._id;this.props.fetchGroupMsg(t).then((function(t){e.setState({role:t.payload.data.data.role})})),this.props.fetchGroupMemberList(t).then((function(t){e.setState({userInfo:A(t.payload.data.data)})}))}},{key:"onUserSelect",value:function(e){this.setState({inputUids:e})}},{key:"render",value:function(){for(var e=this,t=[{title:this.props.currGroup.group_name+" 分组成员 ("+this.state.userInfo.length+") 人",dataIndex:"username",key:"username",render:function(e,t){return _.default.createElement("div",{className:"m-user"},_.default.createElement(w.Link,{to:"/user/profile/".concat(t.uid)},_.default.createElement("img",{src:location.protocol+"//"+location.host+"/api/user/avatar?uid="+t.uid,className:"m-user-img"})),_.default.createElement(w.Link,{to:"/user/profile/".concat(t.uid)},_.default.createElement("p",{className:"m-user-name"},e)))}},{title:"owner"===this.state.role||"admin"===this.state.role?_.default.createElement("div",{className:"btn-container"},_.default.createElement(s.default,{className:"btn",type:"primary",onClick:this.showAddMemberModal},"添加成员")):"",key:"action",className:"member-opration",render:function(t,a){return"owner"===e.state.role||"admin"===e.state.role?_.default.createElement("div",null,_.default.createElement(E.default,{value:a.role+"-"+a.uid,className:"select",onChange:e.changeUserRole},_.default.createElement(L,{value:"owner-"+a.uid},"组长"),_.default.createElement(L,{value:"dev-"+a.uid},"开发者"),_.default.createElement(L,{value:"guest-"+a.uid},"访客")),_.default.createElement(i.default,{placement:"topRight",title:"你确定要删除吗? ",onConfirm:e.deleteConfirm(a.uid),okText:"确定",cancelText:""},_.default.createElement(s.default,{type:"danger",icon:"delete",className:"btn-danger"}))):"owner"===a.role?"组长":"dev"===a.role?"开发者":"guest"===a.role?"访客":""}}],a=this.state.userInfo,r=[],n=[],d=[],f=0;f<a.length;f++)"owner"===a[f].role&&r.push(a[f]),"dev"===a[f].role&&n.push(a[f]),"guest"===a[f].role&&d.push(a[f]);return a=[].concat(r,n,d),_.default.createElement("div",{className:"m-panel"},this.state.visible?_.default.createElement(u.default,{title:"添加成员",visible:this.state.visible,onOk:this.handleOk,onCancel:this.handleCancel},_.default.createElement(o.default,{gutter:6,className:"modal-input"},_.default.createElement(c.default,{span:"5"},_.default.createElement("div",{className:"label usernamelabel"},"用户名: ")),_.default.createElement(c.default,{span:"15"},_.default.createElement(I.default,{callbackState:this.onUserSelect}))),_.default.createElement(o.default,{gutter:6,className:"modal-input"},_.default.createElement(c.default,{span:"5"},_.default.createElement("div",{className:"label usernameauth"},"权限: ")),_.default.createElement(c.default,{span:"15"},_.default.createElement(E.default,{defaultValue:"dev",className:"select",onChange:this.changeNewMemberRole},_.default.createElement(L,{value:"owner"},"组长"),_.default.createElement(L,{value:"dev"},"开发者"),_.default.createElement(L,{value:"guest"},"访客"))))):"",_.default.createElement(l.default,{columns:t,dataSource:a,pagination:!1,locale:{emptyText:_.default.createElement(S.default,{type:"noMemberInGroup"})}}))}}]),a}(_.PureComponent),(0,b.default)(x,"propTypes",{currGroup:k.default.object,uid:k.default.number,fetchGroupMemberList:k.default.func,fetchGroupMsg:k.default.func,addMember:k.default.func,delMember:k.default.func,changeMemberRole:k.default.func,role:k.default.string}),C=P,(0,g.default)(C.prototype,"onUserSelect",[N.autobind],Object.getOwnPropertyDescriptor(C.prototype,"onUserSelect"),C.prototype),O=C))||O;t.default=B},576:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l,u,o,c=r(a(9)),i=r(a(10)),s=r(a(11)),d=r(a(12)),f=r(a(13)),p=r(a(5)),m=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=g(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),h=r(a(577)),y=a(22),v=r(a(0));function g(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(g=function(e){return e?a:t})(e)}function b(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,f.default)(e);if(t){var n=(0,f.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,d.default)(this,a)}}var E=(0,y.connect)((function(e){return{uid:e.user.uid+"",curGroupId:e.group.currGroup._id}}))((o=u=function(e){(0,s.default)(a,e);var t=b(a);function a(e){return(0,c.default)(this,a),t.call(this,e)}return(0,i.default)(a,[{key:"render",value:function(){return m.default.createElement("div",{className:"g-row"},m.default.createElement("section",{className:"news-box m-panel"},m.default.createElement(h.default,{type:"group",typeid:this.props.curGroupId})))}}]),a}(m.PureComponent),(0,p.default)(u,"propTypes",{uid:v.default.string,match:v.default.object,curGroupId:v.default.number}),l=o))||l;t.default=E},577:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(30));a(57);var u=r(a(51));a(64);var o=r(a(49));a(53);var c=r(a(54));a(136);var i=r(a(111));a(1266);var s=r(a(1633));a(33);var d=r(a(25));a(1269);var f=r(a(1272)),p=r(a(7));a(236);var m=r(a(244)),h=r(a(31)),y=r(a(9)),v=r(a(10)),g=r(a(23)),b=r(a(11)),E=r(a(12)),_=r(a(13)),k=r(a(5));a(232);var j=r(a(245)),w=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=A(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),O=r(a(0)),C=a(22),x=a(68),P=r(a(1273)),N=r(a(72)),M=a(40),S=a(180),I=a(124),R=r(a(204));a(1274),a(1276),a(1278);var D,T,q,L=a(160);function A(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(A=function(e){return e?a:t})(e)}function B(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,_.default)(e);if(t){var n=(0,_.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,E.default)(this,a)}}var W=a(1279),G=W.formatters.html,F=j.default.Option,U=j.default.OptGroup,V=function(e){var t=e.title,a=e.content,r=e.className;return a?w.default.createElement("div",{className:r},w.default.createElement("h3",{className:"title"},t),w.default.createElement("div",{dangerouslySetInnerHTML:{__html:a}})):null};V.propTypes={title:O.default.string,content:O.default.string,className:O.default.string};var H=(0,C.connect)((function(e){return{newsData:e.news.newsData,curpage:e.news.curpage,curUid:e.user.uid}}),{fetchNewsData:S.fetchNewsData,fetchMoreNews:S.fetchMoreNews,fetchInterfaceList:I.fetchInterfaceList})((q=T=function(e){(0,b.default)(r,e);var t,a=B(r);function r(e){var t;return(0,y.default)(this,r),t=a.call(this,e),(0,k.default)((0,g.default)(t),"handleCancel",(function(){t.setState({visible:!1})})),(0,k.default)((0,g.default)(t),"openDiff",(function(e){t.setState({curDiffData:e,visible:!0})})),(0,k.default)((0,g.default)(t),"handleSelectApi",(function(e){t.curSelectValue=e,t.props.fetchNewsData(t.props.typeid,t.props.type,1,10,e)})),t.state={bidden:"",loading:!1,visible:!1,curDiffData:{},apiList:[]},t.curSelectValue="",t}return(0,v.default)(r,[{key:"getMore",value:function(){var e=this;this.props.curpage<=this.props.newsData.total&&(this.setState({loading:!0}),this.props.fetchMoreNews(this.props.typeid,this.props.type,this.props.curpage+1,10,this.curSelectValue).then((function(){e.setState({loading:!1}),e.props.newsData.total===e.props.curpage&&e.setState({bidden:"logbidden"})})))}},{key:"componentWillMount",value:function(){this.props.fetchNewsData(this.props.typeid,this.props.type,1,10),"project"===this.props.type&&this.getApiList()}},{key:"getApiList",value:(t=(0,h.default)(l.default.mark((function e(){var t;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.props.fetchInterfaceList({project_id:this.props.typeid,limit:"all"});case 2:t=e.sent,this.setState({apiList:t.payload.data.data.list});case 4:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"render",value:function(){var e=this,t=this.props.newsData?this.props.newsData.list:[],a=this.state.curDiffData,r={project:"项目",group:"分组",interface:"接口",interface_col:"接口集",user:"用户",other:"其他"},n=this.state.apiList.map((function(e){var t=N.default.METHOD_COLOR[e.method?e.method.toLowerCase():"get"];return w.default.createElement(F,{title:e.title,value:e._id+"",path:e.path,key:e._id},e.title," ",w.default.createElement(m.default,{style:{color:t?t.color:"#cfefdf",backgroundColor:t?t.bac:"#00a854",border:"unset"}},e.method))}));n.unshift(w.default.createElement(F,{value:"",key:"all"},"选择全部")),t=t&&t.length?t.map((function(t,a){var n=!1;return t.data&&"object"===(0,p.default)(t.data)&&(n=!0),w.default.createElement(s.default.Item,{dot:w.default.createElement(M.Link,{to:"/user/profile/".concat(t.uid)},w.default.createElement(f.default,{src:"/api/user/avatar?uid=".concat(t.uid)})),key:a},w.default.createElement("div",{className:"logMesHeade"},w.default.createElement("span",{className:"logoTimeago"},(0,L.timeago)(t.add_time)),w.default.createElement("span",{className:"logtype"},r[t.type],"动态"),w.default.createElement("span",{className:"logtime"},(0,x.formatTime)(t.add_time))),w.default.createElement("span",{className:"logcontent",dangerouslySetInnerHTML:{__html:t.content}}),w.default.createElement("div",{style:{padding:"10px 0 0 10px"}},n&&w.default.createElement(d.default,{onClick:function(){return e.openDiff(t.data)}},"改动详情")))})):"";var l=this.props.newsData.total<=this.props.curpage?w.default.createElement("a",{className:"logbidden"},"以上为全部内容"):w.default.createElement("a",{className:"loggetMore",onClick:this.getMore.bind(this)},"查看更多");this.state.loading&&(l=w.default.createElement(i.default,null));var h=(0,P.default)(W,G,a);return w.default.createElement("section",{className:"news-timeline"},w.default.createElement(c.default,{style:{minWidth:"800px"},title:"Api 改动日志",visible:this.state.visible,footer:null,onCancel:this.handleCancel},w.default.createElement("i",null,"注： 绿色代表新增内容，红色代表删除内容"),w.default.createElement("div",{className:"project-interface-change-content"},h.map((function(e,t){return w.default.createElement(V,{className:"item-content",title:e.title,key:t,content:e.content})})),0===h.length&&w.default.createElement(R.default,{type:"noChange"}))),"project"===this.props.type&&w.default.createElement(u.default,{className:"news-search"},w.default.createElement(o.default,{span:"3"},"选择查询的 Api："),w.default.createElement(o.default,{span:"10"},w.default.createElement(j.default,{onSelect:this.handleSelectApi,style:{width:"100%"},placeholder:"Select Api",optionLabelProp:"title",filterOption:function(e,t){return""==t.props.value||(-1!==t.props.path.indexOf(e)||-1!==t.props.title.indexOf(e))}},w.default.createElement(U,{label:"other"},w.default.createElement(F,{value:"wiki",path:"",title:"wiki"},"wiki")),w.default.createElement(U,{label:"api"},n)))),t?w.default.createElement(s.default,{className:"news-content",pending:l},t):w.default.createElement(R.default,{type:"noData"}))}}]),r}(w.PureComponent),(0,k.default)(T,"propTypes",{newsData:O.default.object,fetchNewsData:O.default.func,fetchMoreNews:O.default.func,setLoading:O.default.func,loading:O.default.bool,curpage:O.default.number,typeid:O.default.number,curUid:O.default.number,type:O.default.string,fetchInterfaceList:O.default.func}),D=q))||D;t.default=H},578:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(30));a(203);var u=r(a(210));a(33);var o=r(a(25));a(134);var c=r(a(135));a(55);var i=r(a(45));a(36);var s=r(a(4));a(57);var d=r(a(51));a(64);var f=r(a(49));a(238);var p=r(a(246));a(38);var m=r(a(39)),h=r(a(31)),y=r(a(9)),v=r(a(10)),g=r(a(23)),b=r(a(11)),E=r(a(12)),_=r(a(13)),k=r(a(5));a(53);var j=r(a(54));a(48);var w,O,C,x=r(a(47)),P=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=T(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),N=a(22),M=r(a(0)),S=a(180),I=a(103),R=a(68),D=r(a(79));function T(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(T=function(e){return e?a:t})(e)}function q(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,_.default)(e);if(t){var n=(0,_.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,E.default)(this,a)}}a(1281);var L=x.default.TextArea,A=j.default.confirm,B=(0,N.connect)((function(e){return{groupList:e.group.groupList,currGroup:e.group.currGroup,curUserRole:e.user.role}}),{changeGroupMsg:I.changeGroupMsg,fetchGroupList:I.fetchGroupList,setCurrGroup:I.setCurrGroup,fetchGroupMsg:I.fetchGroupMsg,fetchNewsData:S.fetchNewsData,updateGroupList:I.updateGroupList,deleteGroup:I.deleteGroup})((C=O=function(e){(0,b.default)(a,e);var t=q(a);function a(e){var r;return(0,y.default)(this,a),r=t.call(this,e),(0,k.default)((0,g.default)(r),"changeName",(function(e){r.setState({currGroupName:e.target.value})})),(0,k.default)((0,g.default)(r),"changeDesc",(function(e){r.setState({currGroupDesc:e.target.value})})),(0,k.default)((0,g.default)(r),"changeCustomName",(function(e){var t=!!r.state.custom_field1_enable&&!e.target.value;r.setState({custom_field1_name:e.target.value,custom_field1_rule:t})})),(0,k.default)((0,g.default)(r),"changeCustomEnable",(function(e){var t=!!e&&!r.state.custom_field1_name;r.setState({custom_field1_enable:e,custom_field1_rule:t})})),(0,k.default)((0,g.default)(r),"toggleDangerOptions",(function(){r.setState({showDangerOptions:!r.state.showDangerOptions})})),(0,k.default)((0,g.default)(r),"editGroup",(0,h.default)(l.default.mark((function e(){var t,a;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.props.currGroup._id,!r.state.custom_field1_rule){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,r.props.changeGroupMsg({group_name:r.state.currGroupName,group_desc:r.state.currGroupDesc,custom_field1:{name:r.state.custom_field1_name,enable:r.state.custom_field1_enable},id:r.props.currGroup._id});case 5:if(e.sent.payload.data.errcode){e.next=15;break}return m.default.success("修改成功！"),e.next=10,r.props.fetchGroupList(r.props.groupList);case 10:r.props.updateGroupList(r.props.groupList),a=D.default.find(r.props.groupList,(function(e){return+e._id==+t})),r.props.setCurrGroup(a),r.props.fetchGroupMsg(r.props.currGroup._id),r.props.fetchNewsData(r.props.currGroup._id,"group",1,10);case 15:case"end":return e.stop()}}),e)})))),(0,k.default)((0,g.default)(r),"deleteGroup",(0,h.default)(l.default.mark((function e(){var t,a,n;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=(0,g.default)(r),a=t.props.currGroup,e.next=4,r.props.deleteGroup({id:a._id});case 4:if(e.sent.payload.data.errcode){e.next=12;break}return m.default.success("删除成功"),e.next=9,t.props.fetchGroupList();case 9:n=t.props.groupList[0]||{group_name:"",group_desc:""},t.setState({groupList:t.props.groupList}),t.props.setCurrGroup(n);case 12:case"end":return e.stop()}}),e)})))),(0,k.default)((0,g.default)(r),"showConfirm",(function(){var e=(0,g.default)(r);A({title:"确认删除 "+e.props.currGroup.group_name+" 分组吗？",content:P.default.createElement("div",{style:{marginTop:"10px",fontSize:"13px",lineHeight:"25px"}},P.default.createElement(p.default,{message:"警告：此操作非常危险,会删除该分组下面所有项目和接口，并且无法恢复!",type:"warning"}),P.default.createElement("div",{style:{marginTop:"16px"}},P.default.createElement("p",null,P.default.createElement("b",null,"请输入分组名称确认此操作:")),P.default.createElement(x.default,{id:"group_name"}))),onOk:function(){var t=(0,R.trim)(document.getElementById("group_name").value);if(e.props.currGroup.group_name!==t)return m.default.error("分组名称有误"),new Promise((function(e,t){t("error")}));e.deleteGroup()},iconType:"delete",onCancel:function(){}})})),r.state={currGroupDesc:"",currGroupName:"",showDangerOptions:!1,custom_field1_name:"",custom_field1_enable:!1,custom_field1_rule:!1},r}return(0,v.default)(a,[{key:"initState",value:function(e){this.setState({currGroupName:e.currGroup.group_name,currGroupDesc:e.currGroup.group_desc,custom_field1_name:e.currGroup.custom_field1.name,custom_field1_enable:e.currGroup.custom_field1.enable})}},{key:"componentWillMount",value:function(){this.initState(this.props)}},{key:"componentWillReceiveProps",value:function(e){this.props.currGroup._id!==e.currGroup._id&&(this.initState(e),this.setState({showDangerOptions:!1}))}},{key:"render",value:function(){return P.default.createElement("div",{className:"m-panel card-panel card-panel-s panel-group"},P.default.createElement(d.default,{type:"flex",justify:"space-around",className:"row",align:"middle"},P.default.createElement(f.default,{span:4,className:"label"},"分组名："),P.default.createElement(f.default,{span:20},P.default.createElement(x.default,{size:"large",placeholder:"请输入分组名称",value:this.state.currGroupName,onChange:this.changeName}))),P.default.createElement(d.default,{type:"flex",justify:"space-around",className:"row",align:"middle"},P.default.createElement(f.default,{span:4,className:"label"},"简介："),P.default.createElement(f.default,{span:20},P.default.createElement(L,{size:"large",rows:3,placeholder:"请输入分组描述",value:this.state.currGroupDesc,onChange:this.changeDesc}))),P.default.createElement(d.default,{type:"flex",justify:"space-around",className:"row",align:"middle"},P.default.createElement(f.default,{span:4,className:"label"},"接口自定义字段 ",P.default.createElement(i.default,{title:"可以在接口中添加 额外字段 数据"},P.default.createElement(s.default,{type:"question-circle-o",style:{width:"10px"}}))," ："),P.default.createElement(f.default,{span:12,style:{position:"relative"}},P.default.createElement(x.default,{placeholder:"请输入自定义字段名称",style:{borderColor:this.state.custom_field1_rule?"#f5222d":""},value:this.state.custom_field1_name,onChange:this.changeCustomName}),P.default.createElement("div",{className:"custom-field-rule",style:{display:this.state.custom_field1_rule?"block":"none"}},"自定义字段名称不能为空")),P.default.createElement(f.default,{span:2,className:"label"},"开启："),P.default.createElement(f.default,{span:6},P.default.createElement(c.default,{checked:this.state.custom_field1_enable,checkedChildren:"开",unCheckedChildren:"关",onChange:this.changeCustomEnable}))),P.default.createElement(d.default,{type:"flex",justify:"center",className:"row save"},P.default.createElement(f.default,{span:4,className:"save-button"},P.default.createElement(o.default,{className:"m-btn btn-save",icon:"save",type:"primary",onClick:this.editGroup},"保 存"))),"admin"===this.props.curUserRole?P.default.createElement(d.default,{type:"flex",justify:"center",className:"danger-container"},P.default.createElement(f.default,{span:24,className:"title"},P.default.createElement("h2",{className:"content"},P.default.createElement(s.default,{type:"exclamation-circle-o"})," 危险操作"),P.default.createElement(o.default,{onClick:this.toggleDangerOptions},"查 看",P.default.createElement(s.default,{type:this.state.showDangerOptions?"up":"down"}))),this.state.showDangerOptions?P.default.createElement(u.default,{hoverable:!0,className:"card-danger",style:{width:"100%"}},P.default.createElement("div",{className:"card-danger-content"},P.default.createElement("h3",null,"删除分组"),P.default.createElement("p",null,"分组一旦删除，将无法恢复数据，请慎重操作！"),P.default.createElement("p",null,"只有超级管理员有权限删除分组。")),P.default.createElement(o.default,{type:"danger",ghost:!0,className:"card-danger-btn",onClick:this.showConfirm},"删除")):null):null)}}]),a}(P.PureComponent),(0,k.default)(O,"propTypes",{currGroup:M.default.object,curUserRole:M.default.string,changeGroupMsg:M.default.func,fetchGroupList:M.default.func,setCurrGroup:M.default.func,fetchGroupMsg:M.default.func,fetchNewsData:M.default.func,updateGroupList:M.default.func,deleteGroup:M.default.func,groupList:M.default.array}),w=C))||w;t.default=B},579:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(123);var l=r(a(126));a(33);var u=r(a(25));a(48);var o=r(a(47)),c=r(a(9)),i=r(a(10)),s=r(a(23)),d=r(a(11)),f=r(a(12)),p=r(a(13)),m=r(a(5)),h=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=b(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),y=a(40),v=a(102),g=a(68);function b(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(b=function(e){return e?a:t})(e)}function E(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,p.default)(e);if(t){var n=(0,p.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,f.default)(this,a)}}var _=function(e){(0,d.default)(a,e);var t=E(a);function a(e){var r;return(0,c.default)(this,a),r=t.call(this,e),(0,m.default)((0,s.default)(r),"myInterfaces",(function(){r.setState({loading:!0}),v.axios.get("/api/interface/my",{params:{page:r.state.myInterface.pageNo||1,path:r.state.path}}).then((function(e){var t=r.state.myInterface||{};t.list=e.data.list,t.count=e.data.count,t.total=e.data.total,r.setState({myInterfaceList:e.data.list,myInterface:t}),r.setState({loading:!1})}))})),r.state={myInterfaceList:[],loading:!1,path:"",myInterface:{list:[],count:0,total:0,pageNo:1,limit:15}},r}return(0,i.default)(a,[{key:"componentWillMount",value:function(){this.myInterfaces()}},{key:"render",value:function(){var e=this,t=function(){var t={total:e.state.myInterface.count,pageSize:e.state.myInterface.limit||15,showTotal:function(t){return"共 ".concat(e.state.myInterface.count," 条记录")},current:e.state.myInterface.pageNo,onChange:function(t){var a=e.state.myInterface;a.pageNo=t,e.setState({myInterface:a},e.myInterfaces)}},a={undone:"未完成",done:"已完成",invalid:"废弃"},r=[{title:"接口名称",dataIndex:"title",ellipsis:!0,render:function(e,t){return h.default.createElement(y.Link,{to:"/project/"+t.project_id+"/interface/api/"+t._id},h.default.createElement("span",{className:"name"},e))}},{title:"接口路径",dataIndex:"path",ellipsis:!0},{title:"状态",dataIndex:"status",render:function(e,t){return a[e]}},{title:"创建人",dataIndex:"createUserName",ellipsis:!0},{title:"负责人",dataIndex:"connUsername",ellipsis:!0,render:function(e,t){return e&&e.length>0?e:"未设置"}},{title:"修改时间",dataIndex:"up_time",ellipsis:!0,render:function(e,t){return(0,g.formatTime)(e)}}];return h.default.createElement("div",{style:{margin:"2px 2px 20px 2px"}},h.default.createElement("h3",{className:"owner-type"},"我的接口"),h.default.createElement("div",{className:"flex flex-1"},h.default.createElement("div",{className:"flex"},h.default.createElement(o.default,{key:"search_path",value:e.state.path,placeholder:"接口名称或者路径",width:200,allowClear:!0,onChange:function(t){e.setState({path:t.target.value})}}),h.default.createElement(u.default,{style:{marginLeft:"4px"},onClick:function(){e.myInterfaces()}},"搜索"))),h.default.createElement(l.default,{loading:e.state.loading,rowKey:"_id",style:{marginTop:"10px"},bordered:!0,columns:r,dataSource:e.state.myInterfaceList,size:"small",pagination:t}))};return h.default.createElement("div",{style:{paddingTop:"24px"},className:"m-panel card-panel card-panel-s project-list"},h.default.createElement(t,{key:"my"}))}}]),a}(h.PureComponent);t.default=_},580:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.InsertCodeMap=void 0;var l=r(a(30));a(57);var u=r(a(51));a(64);var o=r(a(49));a(134);var c=r(a(135));a(136);var i=r(a(111));a(36);var s=r(a(4));a(278);var d=r(a(151));a(33);var f=r(a(25));a(53);var p=r(a(54)),m=r(a(31)),h=r(a(7)),y=r(a(9)),v=r(a(10)),g=r(a(23)),b=r(a(11)),E=r(a(12)),_=r(a(13)),k=r(a(5));a(55);var j=r(a(45));a(295);var w=r(a(312));a(71);var O=r(a(61));a(48);var C=r(a(47));a(125);var x=r(a(110)),P=W(a(1)),N=r(a(0)),M=r(a(72)),S=r(a(165)),I=r(a(79)),R=a(68),D=r(a(1292));W(a(582));a(1302);var T=r(a(583)),q=r(a(143)),L=a(182),A=a(102);function B(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(B=function(e){return e?a:t})(e)}function W(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=B(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}return r.default=e,a&&a.set(e,r),r}function G(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function F(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?G(Object(a),!0).forEach((function(t){(0,k.default)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):G(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function U(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,_.default)(e);if(t){var n=(0,_.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,E.default)(this,a)}}var V=a(160),H=V.handleParamsValue,z=V.ArrayToObject,J=V.schemaValidator,K=a(586),Y=K.handleParams,Q=K.checkRequestBodyIsRaw,X=K.handleContentType,Z=(K.crossRequest,K.checkNameIsExistInArray),$=(a(600),x.default.TabPane),ee=M.default.HTTP_METHOD,te=C.default.Group,ae=O.default.Option,re=w.default.Panel,ne=[{code:"assert.equal(status, 200)",title:"断言 httpCode 等于 200"},{code:"assert.equal(body.code, 0)",title:"断言返回数据 code 是 0"},{code:"assert.notEqual(status, 404)",title:"断言 httpCode 不是 404"},{code:"assert.notEqual(body.code, 40000)",title:"断言返回数据 code 不是 40000"},{code:'assert.deepEqual(body, {"code": 0})',title:'断言对象 body 等于 {"code": 0}'},{code:'assert.notDeepEqual(body, {"code": 0})',title:'断言对象 body 不等于 {"code": 0}'}];t.InsertCodeMap=ne;var le=function(e){var t=e.example,a=e.desc,r=e.name,n=!t&&!a,l=function(){return P.default.createElement("div",null,t&&P.default.createElement("div",null,"示例： ",P.default.createElement("span",{className:"table-desc"},t)),a&&P.default.createElement("div",null,"备注： ",P.default.createElement("span",{className:"table-desc"},a)))};return P.default.createElement("div",null,n?P.default.createElement(C.default,{value:r,className:"key"}):P.default.createElement(j.default,{placement:"topLeft",title:P.default.createElement(l,null)},P.default.createElement(C.default,{value:r,className:"key"})))};le.propTypes={example:N.default.string,desc:N.default.string,name:N.default.string};var ue=function(e){(0,b.default)(r,e);var t,a=U(r);function r(e){var t;return(0,y.default)(this,r),t=a.call(this,e),(0,k.default)((0,g.default)(t),"handleReqHeader",(function(e,a){var r=e?a.findIndex((function(t){return t.name===e})):0;r=-1===r?0:r;var n=[].concat(t.props.data.req_headers||[]);return[].concat(a[r].header||[]).forEach((function(e){Z(e.name,n)||(e=F(F({},e),{},{abled:!0}),n.push(e))})),n=n.filter((function(e){return e&&"object"===(0,h.default)(e)}))})),(0,k.default)((0,g.default)(t),"selectDomain",(function(e){console.log(e);var a=t.handleReqHeader(e,t.state.env);t.setState({case_env:e,req_headers:a})})),(0,k.default)((0,g.default)(t),"onOpenTest",(function(e){t.setState({test_script:e.text})})),(0,k.default)((0,g.default)(t),"handleInsertCode",(function(e){t.aceEditor.editor.insertCode(e)})),(0,k.default)((0,g.default)(t),"handleRequestBody",(function(e){t.setState({req_body_other:e.text})})),(0,k.default)((0,g.default)(t),"reqRealInterface",(0,m.default)(l.default.mark((function e(){var a,r,n,u,o;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!0!==t.state.loading){e.next=3;break}return t.setState({loading:!1}),e.abrupt("return",null);case 3:return t.setState({loading:!0}),a=Y(t.state,t.handleValue),e.prev=5,console.log(a),e.next=9,A.axios.post("/api/postman/send",a);case 9:n=e.sent,console.log(n),r={headers:n.data.headers,body:n.data.body,status:n.data.status,size:n.data.size,time:n.data.time,statusText:n.data.statusText,runTime:n.runTime,rid:n.data.rid},e.next=17;break;case 14:e.prev=14,e.t0=e.catch(5),r={};case 17:if(!0!==t.state.loading){e.next=21;break}t.setState({loading:!1}),e.next=22;break;case 21:return e.abrupt("return",null);case 22:(u=r.body)&&"object"===(0,h.default)(u)?(r.body=JSON.stringify(u,null,"  "),t.setState({res_body_type:"json"})):(0,R.isJson)(r.body)&&t.setState({res_body_type:"json"}),(o=t.resBodyValidator(t.props.data,r.body)).valid?t.setState({test_valid_msg:""}):t.setState({test_valid_msg:"返回参数 ".concat(o.message)}),t.setState({resStatusCode:r.status,resSize:r.size,resTime:r.time,rid:r.rid,resStatusText:r.statusText,test_res_header:r.headers,test_res_body:r.body});case 27:case"end":return e.stop()}}),e,null,[[5,14]])})))),(0,k.default)((0,g.default)(t),"resBodyValidator",(function(e,t){var a=e.res_body_type,r=e.res_body_is_json_schema,n=e.res_body,l={valid:!0};if("json"===a&&r){var u=(0,R.json5_parse)(n),o=(0,R.json5_parse)(t);l=J(u,o)}return l})),(0,k.default)((0,g.default)(t),"changeParam",(function(e,a,r,n){n=n||"value";var l=(0,R.deepCopyJson)(t.state[e]);l[r][n]=a,"value"===n&&(l[r].enable=!!a),t.setState((0,k.default)({},e,l))})),(0,k.default)((0,g.default)(t),"changeBody",(function(e,a,r){var n=(0,R.deepCopyJson)(t.state.req_body_form);"value"===(r=r||"value")?(n[a].enable=!!e,"file"===n[a].type?n[a].value="file_"+a:n[a].value=e):"enable"===r&&(n[a].enable=e),t.setState({req_body_form:n})})),(0,k.default)((0,g.default)(t),"showModal",(function(e,a,r){var n,l="";if("req_body_other"===r){var u=t.aceEditor.editor.editor;n=u.session.doc.positionToIndex(u.selection.getCursor()),l=t.getInstallValue(e||"",n).val}else{n=document.getElementById("".concat(r,"_").concat(a)).selectionStart,l=t.getInstallValue(e||"",n).val}t.setState({modalVisible:!0,inputIndex:a,inputValue:l,cursurPosition:n,modalType:r})})),(0,k.default)((0,g.default)(t),"handleModalOk",(function(e){var a=t.state,r=a.inputIndex,n=a.modalType;"req_body_other"===n?t.changeInstallBody(n,e):t.changeInstallParam(n,e,r),t.setState({modalVisible:!1})})),(0,k.default)((0,g.default)(t),"changeInstallBody",(function(e,a){var r=(0,R.deepCopyJson)(t.state[e])||"",n=t.getInstallValue(r,t.state.cursurPosition),l=n.left,u=n.right;t.setState((0,k.default)({},e,"".concat(l).concat(a).concat(u)))})),(0,k.default)((0,g.default)(t),"getInstallValue",(function(e,t){var a=e.substr(0,t),r=e.substr(t),n=a.lastIndexOf("{{"),l=a.lastIndexOf("}}"),u=r.indexOf("}}"),o="";return-1!==n&&-1!==u&&n>l&&(a=a.substr(0,n),r=r.substr(u+2),o=e.substring(n,t+u+2)),{left:a,right:r,val:o}})),(0,k.default)((0,g.default)(t),"changeInstallParam",(function(e,a,r,n){n=n||"value";var l=(0,R.deepCopyJson)(t.state[e]),u=l[r][n]||"",o=t.getInstallValue(u,t.state.cursurPosition),c=o.left,i=o.right;l[r][n]="".concat(c).concat(a).concat(i),t.setState((0,k.default)({},e,l))})),(0,k.default)((0,g.default)(t),"handleModalCancel",(function(){t.setState({modalVisible:!1,cursurPosition:-1})})),(0,k.default)((0,g.default)(t),"showEnvModal",(function(){t.setState({envModalVisible:!0})})),(0,k.default)((0,g.default)(t),"handleEnvOk",(function(e,a){t.setState({envModalVisible:!1,case_env:e[a].name})})),(0,k.default)((0,g.default)(t),"handleEnvCancel",(function(){t.setState({envModalVisible:!1})})),t.state=F({loading:!1,resStatusCode:null,test_valid_msg:null,resStatusText:null,case_env:"",mock_verify:!1,enable_script:!1,test_script:"",hasPlugin:!0,inputValue:"",cursurPosition:{row:1,column:-1},envModalVisible:!1,test_res_header:null,test_res_body:null},t.props.data),t}return(0,v.default)(r,[{key:"checkInterfaceData",value:function(e){return!(!e||"object"!==(0,h.default)(e)||!e._id)}},{key:"initState",value:(t=(0,m.default)(l.default.mark((function e(t){var a,r,n,u,o,c,i=this;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.checkInterfaceData(t)){e.next=2;break}return e.abrupt("return",null);case 2:if(a=t.req_body_other,r=t.req_body_type,n=t.req_body_is_json_schema,u=a,"inter"!==this.props.type||"json"!==r||!a||!n){e.next=18;break}o={},e.prev=6,o=q.default.parse(a),e.next=14;break;case 10:return e.prev=10,e.t0=e.catch(6),console.log("e",e.t0),e.abrupt("return");case 14:return e.next=16,A.axios.post("/api/interface/schema2json",{schema:o,required:!0});case 16:c=e.sent,u=JSON.stringify(c);case 18:this.setState(F(F(F({},this.state),{},{test_res_header:null,test_res_body:null},t),{},{req_body_other:u,resStatusCode:null,test_valid_msg:null,resStatusText:null}),(function(){return"inter"===i.props.type&&i.initEnvState(t.case_env,t.env)}));case 19:case"end":return e.stop()}}),e,this,[[6,10]])}))),function(e){return t.apply(this,arguments)})},{key:"initEnvState",value:function(e,t){var a=this,r=this.handleReqHeader(e,t);this.setState({req_headers:r,env:t},(function(){var e=!I.default.find(t,(function(e){return e.name===a.state.case_env}));a.state.case_env&&!e||a.setState({case_env:a.state.env[0].name})}))}},{key:"componentWillMount",value:function(){this.initState(this.props.data)}},{key:"componentWillUnmount",value:function(){clearInterval(this._crossRequestInterval)}},{key:"componentWillReceiveProps",value:function(e){this.checkInterfaceData(e.data)&&this.checkInterfaceData(this.props.data)&&((e.data._id!==this.props.data._id||e.data.interface_up_time!==this.props.data.interface_up_time)&&this.initState(e.data),e.data.env!==this.props.data.env&&this.initEnvState(this.state.case_env,e.data.env))}},{key:"handleValue",value:function(e,t){var a=z(t);return H(e,{global:a})}},{key:"render",value:function(){var e,t=this,a=this.state,r=a.method,n=a.env,l=a.path,m=a.req_params,h=void 0===m?[]:m,y=a.req_headers,v=void 0===y?[]:y,g=a.req_query,b=void 0===g?[]:g,E=a.req_body_type,_=a.req_body_form,N=void 0===_?[]:_,M=a.loading,I=a.inputValue,R=a.hasPlugin;return console.log(this.state.case_env),P.default.createElement("div",{className:"interface-test postman"},this.state.modalVisible&&P.default.createElement(D.default,{visible:this.state.modalVisible,handleCancel:this.handleModalCancel,handleOk:this.handleModalOk,inputValue:I,envType:this.props.type,id:+this.state._id}),this.state.envModalVisible&&P.default.createElement(p.default,{title:"环境设置",visible:this.state.envModalVisible,onOk:this.handleEnvOk,onCancel:this.handleEnvCancel,footer:null,width:800,className:"env-modal"},P.default.createElement(T.default,{projectId:this.props.data.project_id,onOk:this.handleEnvOk})),P.default.createElement(L.ReflexContainer,null,P.default.createElement(L.ReflexElement,null,P.default.createElement("div",{className:"url"},P.default.createElement(te,{compact:!0,style:{display:"flex"}},P.default.createElement(O.default,{value:r,style:{flexBasis:100}},Object.keys(ee).map((function(e,t){return P.default.createElement(ae,{value:e.toUpperCase(),key:t},e.toUpperCase())}))),P.default.createElement(O.default,{value:this.state.case_env,style:{flexBasis:180,flexGrow:1},onChange:this.selectDomain},n.map((function(e,t){return P.default.createElement(ae,{value:e.name,key:t},e.name+"："+e.domain)})),P.default.createElement(ae,{value:"环境配置",disabled:!0,style:{cursor:"pointer",color:"#2395f1"}},P.default.createElement(f.default,{type:"primary",onClick:this.showEnvModal},"环境配置"))),P.default.createElement(C.default,{disabled:!0,value:l,onChange:this.changePath,spellCheck:"false",style:{flexBasis:180,flexGrow:1}})),P.default.createElement(f.default,(e={disabled:!R,onClick:this.reqRealInterface,type:"primary",style:{marginLeft:10,width:"150px"}},(0,k.default)(e,"disabled",M),(0,k.default)(e,"icon",M?"loading":""),e),M?"取消":"发送[通过服务器]"),P.default.createElement(j.default,{placement:"bottom",title:function(){return"inter"===t.props.type?"保存到测试集":"更新该用例"}},P.default.createElement(f.default,{onClick:this.props.save,type:"primary",style:{marginLeft:10}},"inter"===this.props.type?"保存":"更新")))),P.default.createElement(L.ReflexElement,{className:"postman-content"},P.default.createElement(L.ReflexContainer,{className:"postman-content"},P.default.createElement(L.ReflexElement,{size:300},P.default.createElement(x.default,{defaultActiveKey:"1",style:{padding:"10px 0 0 0"}},b.length>0&&P.default.createElement($,{tab:"Params",key:"1"},P.default.createElement("div",{style:{marginTop:"10px"}},b.map((function(e,a){return P.default.createElement("div",{key:a,className:"key-value-wrap"},P.default.createElement(le,{example:e.example,desc:e.desc,name:e.name})," ",1==e.required?P.default.createElement(d.default,{className:"params-enable",checked:!0,disabled:!0}):P.default.createElement(d.default,{className:"params-enable",checked:e.enable,onChange:function(e){return t.changeParam("req_query",e.target.checked,a,"enable")}}),P.default.createElement("span",{className:"eq-symbol"},"="),P.default.createElement(C.default,{value:e.value,className:"value",onChange:function(e){return t.changeParam("req_query",e.target.value,a)},placeholder:"参数值",id:"req_query_".concat(a),addonAfter:P.default.createElement(s.default,{type:"edit",onClick:function(){return t.showModal(e.value,a,"req_query")}})}))})))),P.default.createElement($,{tab:"Headers",key:"2"},this.state.req_headers.map((function(e,a){return P.default.createElement("div",{key:a,className:"key-value-wrap"},P.default.createElement(le,{example:e.example,desc:e.desc,name:e.name}),P.default.createElement("span",{className:"eq-symbol"},"="),P.default.createElement(C.default,{value:e.value,className:"value",onChange:function(e){return t.changeParam("req_headers",e.target.value,a)},placeholder:"参数值",id:"req_headers_".concat(a),addonAfter:!e.abled&&P.default.createElement(s.default,{type:"edit",onClick:function(){return t.showModal(e.value,a,"req_headers")}})}))}))),ee[r].request_body&&("form"===E&&N.length>0||"form"!==E)&&P.default.createElement($,{tab:"Body",key:"3"},P.default.createElement("div",{style:{display:Q(r,E)?"block":"none"}},"json"===E&&P.default.createElement("div",{className:"adv-button"},P.default.createElement(f.default,{onClick:function(){return t.showModal(t.state.req_body_other,0,"req_body_other")}},"高级参数设置"),P.default.createElement(j.default,{title:"高级参数设置只在json字段值中生效"},"  ",P.default.createElement(s.default,{type:"question-circle-o"}))),P.default.createElement(S.default,{className:"pretty-editor",ref:function(e){return t.aceEditor=e},data:this.state.req_body_other,mode:"json"===E?null:"text",onChange:this.handleRequestBody,fullScreen:!0})),ee[r].request_body&&"form"===E&&P.default.createElement("div",null,N.map((function(e,a){return P.default.createElement("div",{key:a,className:"key-value-wrap"},P.default.createElement(le,{example:e.example,desc:e.desc,name:e.name})," ",1==e.required?P.default.createElement(d.default,{className:"params-enable",checked:!0,disabled:!0}):P.default.createElement(d.default,{className:"params-enable",checked:e.enable,onChange:function(e){return t.changeBody(e.target.checked,a,"enable")}}),P.default.createElement("span",{className:"eq-symbol"},"="),"file"===e.type?"因Chrome最新版安全策略限制，不再支持文件上传":P.default.createElement(C.default,{value:e.value,className:"value",onChange:function(e){return t.changeBody(e.target.value,a)},placeholder:"参数值",id:"req_body_form_".concat(a),addonAfter:P.default.createElement(s.default,{type:"edit",onClick:function(){return t.showModal(e.value,a,"req_body_form")}})}))})),P.default.createElement(f.default,{style:{display:"none"},type:"primary",icon:"plus",onClick:this.addBody},"添加Form参数")),ee[r].request_body&&"file"===E&&P.default.createElement("div",null,P.default.createElement(C.default,{type:"file",id:"single-file"})))),P.default.createElement(w.default,{defaultActiveKey:["0","1","2","3"],bordered:!0,style:{display:"none"}},P.default.createElement(re,{header:"PATH PARAMETERS",key:"0",className:0===h.length?"hidden":""},h.map((function(e,a){return P.default.createElement("div",{key:a,className:"key-value-wrap"},P.default.createElement(le,{example:e.example,desc:e.desc,name:e.name}),P.default.createElement("span",{className:"eq-symbol"},"="),P.default.createElement(C.default,{value:e.value,className:"value",onChange:function(e){return t.changeParam("req_params",e.target.value,a)},placeholder:"参数值",id:"req_params_".concat(a),addonAfter:P.default.createElement(s.default,{type:"edit",onClick:function(){return t.showModal(e.value,a,"req_params")}})}))})),P.default.createElement(f.default,{style:{display:"none"},type:"primary",icon:"plus",onClick:this.addPathParam},"添加Path参数")),P.default.createElement(re,{header:"QUERY PARAMETERS",key:"1",className:0===b.length?"hidden":""},b.map((function(e,a){return P.default.createElement("div",{key:a,className:"key-value-wrap"},P.default.createElement(le,{example:e.example,desc:e.desc,name:e.name})," ",1==e.required?P.default.createElement(d.default,{className:"params-enable",checked:!0,disabled:!0}):P.default.createElement(d.default,{className:"params-enable",checked:e.enable,onChange:function(e){return t.changeParam("req_query",e.target.checked,a,"enable")}}),P.default.createElement("span",{className:"eq-symbol"},"="),P.default.createElement(C.default,{value:e.value,className:"value",onChange:function(e){return t.changeParam("req_query",e.target.value,a)},placeholder:"参数值",id:"req_query_".concat(a),addonAfter:P.default.createElement(s.default,{type:"edit",onClick:function(){return t.showModal(e.value,a,"req_query")}})}))})),P.default.createElement(f.default,{style:{display:"none"},type:"primary",icon:"plus",onClick:this.addQuery},"添加Query参数")),P.default.createElement(re,{header:"HEADERS",key:"2",className:0===v.length?"hidden":""},v.map((function(e,a){return P.default.createElement("div",{key:a,className:"key-value-wrap"},P.default.createElement(le,{example:e.example,desc:e.desc,name:e.name}),P.default.createElement("span",{className:"eq-symbol"},"="),P.default.createElement(C.default,{value:e.value,disabled:!!e.abled,className:"value",onChange:function(e){return t.changeParam("req_headers",e.target.value,a)},placeholder:"参数值",id:"req_headers_".concat(a),addonAfter:!e.abled&&P.default.createElement(s.default,{type:"edit",onClick:function(){return t.showModal(e.value,a,"req_headers")}})}))})),P.default.createElement(f.default,{style:{display:"none"},type:"primary",icon:"plus",onClick:this.addHeader},"添加Header")),P.default.createElement(re,{header:P.default.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},P.default.createElement(j.default,{title:"F9 全屏编辑"},"BODY(F9)")),key:"3",className:ee[r].request_body&&("form"===E&&N.length>0||"form"!==E)?"POST":"hidden"},P.default.createElement("div",{style:{display:Q(r,E)?"block":"none"}},"json"===E&&P.default.createElement("div",{className:"adv-button"},P.default.createElement(f.default,{onClick:function(){return t.showModal(t.state.req_body_other,0,"req_body_other")}},"高级参数设置"),P.default.createElement(j.default,{title:"高级参数设置只在json字段值中生效"},"  ",P.default.createElement(s.default,{type:"question-circle-o"}))),P.default.createElement(S.default,{className:"pretty-editor",ref:function(e){return t.aceEditor=e},data:this.state.req_body_other,mode:"json"===E?null:"text",onChange:this.handleRequestBody,fullScreen:!0})),ee[r].request_body&&"form"===E&&P.default.createElement("div",null,N.map((function(e,a){return P.default.createElement("div",{key:a,className:"key-value-wrap"},P.default.createElement(le,{example:e.example,desc:e.desc,name:e.name})," ",1==e.required?P.default.createElement(d.default,{className:"params-enable",checked:!0,disabled:!0}):P.default.createElement(d.default,{className:"params-enable",checked:e.enable,onChange:function(e){return t.changeBody(e.target.checked,a,"enable")}}),P.default.createElement("span",{className:"eq-symbol"},"="),"file"===e.type?"因Chrome最新版安全策略限制，不再支持文件上传":P.default.createElement(C.default,{value:e.value,className:"value",onChange:function(e){return t.changeBody(e.target.value,a)},placeholder:"参数值",id:"req_body_form_".concat(a),addonAfter:P.default.createElement(s.default,{type:"edit",onClick:function(){return t.showModal(e.value,a,"req_body_form")}})}))})),P.default.createElement(f.default,{style:{display:"none"},type:"primary",icon:"plus",onClick:this.addBody},"添加Form参数")),ee[r].request_body&&"file"===E&&P.default.createElement("div",null,P.default.createElement(C.default,{type:"file",id:"single-file"}))))),P.default.createElement(L.ReflexSplitter,{propagate:!0,style:{borderBottom:"1px solid #e9e6e6",borderTop:"1px solid #e9e6e6"}}),P.default.createElement(L.ReflexElement,null,P.default.createElement("div",null,P.default.createElement("div",{style:{height:"30px",padding:"0 10px",lineHeight:"30px",color:"#737373",fontSize:"12px"}},P.default.createElement("span",null,"状态:",P.default.createElement("span",{style:{color:"#10b981"}},this.state.resStatusCode)),P.default.createElement("span",{style:{marginLeft:"20px"}},"时间: ",P.default.createElement("span",{style:{color:"#10b981"}},this.state.resTime," ms")),P.default.createElement("span",{style:{marginLeft:"20px"}},"大小: ",P.default.createElement("span",{style:{color:"#10b981"}},this.state.resSize)),P.default.createElement("span",{style:{marginLeft:"20px"}},"_rid: ",P.default.createElement("span",{style:{color:"#10b981"}},this.state.rid)))),P.default.createElement(x.default,{size:"small",defaultActiveKey:"res",className:"response-tab"},P.default.createElement(x.default.TabPane,{tab:"返回结果",key:"res"},P.default.createElement(i.default,{spinning:this.state.loading},P.default.createElement("div",{className:"body",style:{marginTop:"10px"}},P.default.createElement(S.default,{readOnly:!0,className:"pretty-editor-body",data:this.state.test_res_body,mode:X(this.state.test_res_header)})))),P.default.createElement(x.default.TabPane,{tab:"Header",key:"header"},P.default.createElement("div",{className:"container-header-body"},P.default.createElement("div",{className:"header"},P.default.createElement(S.default,{callback:function(e){e.renderer.setShowGutter(!1)},readOnly:!0,className:"pretty-editor-header",data:this.state.test_res_header,mode:"json"})))),"case"===this.props.type?P.default.createElement(x.default.TabPane,{className:"response-test",tab:P.default.createElement(j.default,{title:"测试脚本，可断言返回结果，使用方法请查看文档"},"Test"),key:"test"},P.default.createElement("h3",{style:{margin:"5px"}}," 是否开启: ",P.default.createElement(c.default,{checked:this.state.enable_script,onChange:function(e){return t.setState({enable_script:e})}})),P.default.createElement("p",{style:{margin:"10px"}},"注：Test 脚本只有做自动化测试才执行"),P.default.createElement(u.default,null,P.default.createElement(o.default,{span:"18"},P.default.createElement(S.default,{onChange:this.onOpenTest,className:"case-script",data:this.state.test_script,ref:function(e){t.aceEditor=e}})),P.default.createElement(o.default,{span:"6"},P.default.createElement("div",{className:"insert-code"},ne.map((function(e){return P.default.createElement("div",{style:{cursor:"pointer"},className:"code-item",key:e.title,onClick:function(){t.handleInsertCode("\n"+e.code)}},e.title)})))))):null))))))}}]),r}(P.default.Component);t.default=ue,(0,k.default)(ue,"propTypes",{data:N.default.object,save:N.default.func,type:N.default.string,curUid:N.default.number.isRequired,interfaceId:N.default.number.isRequired,projectId:N.default.number.isRequired})},582:function(e,t,a){"use strict";var r=a(3);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(238);var n=r(a(246)),l=r(a(1)),u=r(a(0));function o(e){var t=e.hasPlugin;return l.default.createElement("div",{className:t?null:"has-plugin"},t?"":l.default.createElement(n.default,{message:l.default.createElement("div",null,"重要：当前的接口测试服务，需安装免费测试增强插件,仅支持 chrome 浏览器，选择下面任意一种安装方式：",l.default.createElement("div",null,l.default.createElement("a",{target:"blank",href:"https://juejin.im/post/5e3bbd986fb9a07ce152b53d"}," ","[谷歌请求插件详细安装教程]"," "))),type:"warning"}))}t.initCrossRequest=function(e){var t=0,a=setInterval((function(){(t+=500)>5e3&&clearInterval(a),window.crossRequest?(clearInterval(a),e(!0)):e(!1)}),500);return a},o.propTypes={hasPlugin:u.default.bool};var c=o;t.default=c},583:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(30));a(55);var u=r(a(45));a(57);var o=r(a(51));a(230);var c=r(a(231));a(36);var i=r(a(4));a(38);var s=r(a(39)),d=r(a(31)),f=r(a(9)),p=r(a(10)),m=r(a(23)),h=r(a(11)),y=r(a(12)),v=r(a(13)),g=r(a(5));a(146);var b=r(a(147)),E=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=N(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),_=r(a(0));a(584);var k,j,w,O=r(a(1303)),C=a(22),x=a(75),P=r(a(585));function N(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(N=function(e){return e?a:t})(e)}function M(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function S(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?M(Object(a),!0).forEach((function(t){(0,g.default)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):M(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function I(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,v.default)(e);if(t){var n=(0,v.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,y.default)(this,a)}}var R=b.default.Content,D=b.default.Sider,T=(0,C.connect)((function(e){return{projectMsg:e.project.currProject}}),{updateEnv:x.updateEnv,getProject:x.getProject,getEnv:x.getEnv})((w=j=function(e){(0,h.default)(n,e);var t,a,r=I(n);function n(e){var t;return(0,f.default)(this,n),t=r.call(this,e),(0,g.default)((0,m.default)(t),"handleClick",(function(e,a){t.setState({currentEnvMsg:a,currentKey:e})})),(0,g.default)((0,m.default)(t),"addParams",(function(e,a){var r={};a={name:"新环境",domain:"",header:[]},r[e]=[].concat(a,t.state[e]),t.setState(r),t.handleClick(0,a)})),(0,g.default)((0,m.default)(t),"delParams",(function(e,a){var r=t.state.env,n={};return n[a]=r.filter((function(t,a){return a!==e})),t.setState(n),t.handleClick(0,n[a][0]),n._id=t.state._id,n})),(0,g.default)((0,m.default)(t),"enterItem",(function(e){t.setState({delIcon:e})})),(0,g.default)((0,m.default)(t),"onSubmit",(function(e,a){var r={};r.env=[].concat(t.state.env),r.env.splice(a,1,e.env),r._id=t.state._id,t.onSave(r),t.props.onOk&&t.props.onOk(r.env,a)})),(0,g.default)((0,m.default)(t),"handleInputChange",(function(e,a){var r=[].concat(t.state.env);r[a].name=e||"新环境",t.setState({env:r})})),(0,g.default)((0,m.default)(t),"handleDragMove",(function(e){return function(a,r,n){var l=(0,g.default)({},e,a);t.setState(l),l._id=t.state._id,t.handleClick(n,l[e][n]),t.onSave(l)}})),t.state={env:[],_id:null,currentEnvMsg:{},delIcon:null,currentKey:-2},t}return(0,p.default)(n,[{key:"initState",value:function(e,t){var a={};a.env=[].concat(e),a._id=t,this.setState(S(S({},this.state),a))}},{key:"componentWillMount",value:(a=(0,d.default)(l.default.mark((function e(){var t,a,r;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._isMounted=!0,e.next=3,this.props.getProject(this.props.projectId);case 3:t=this.props.projectMsg,a=t.env,r=t._id,this.initState(a,r),this.handleClick(0,a[0]);case 6:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"componentWillUnmount",value:function(){this._isMounted=!1}},{key:"showConfirm",value:function(e,t){var a=this.delParams(e,t);this.onSave(a)}},{key:"onSave",value:(t=(0,d.default)(l.default.mark((function e(t){var a=this;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.props.updateEnv(t).then((function(e){0==e.payload.data.errcode&&(a.props.getProject(a.props.projectId),a.props.getEnv(a.props.projectId),s.default.success("修改成功! "),a._isMounted&&a.setState(S({},t)))})).catch((function(){s.default.error("环境设置不成功 ")}));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"render",value:function(){var e=this,t=this.state,a=t.env,r=t.currentKey,n=a.map((function(t,n){return E.default.createElement(o.default,{key:n,className:"menu-item "+(n===r?"menu-item-checked":""),onClick:function(){return e.handleClick(n,t)},onMouseEnter:function(){return e.enterItem(n)}},E.default.createElement("span",{className:"env-icon-style"},E.default.createElement("span",{className:"env-name",style:{color:"新环境"===t.name&&"#2395f1"}},t.name),E.default.createElement(c.default,{title:"您确认删除此环境变量?",onConfirm:function(t){t.stopPropagation(),e.showConfirm(n,"env")},okText:"确定",cancelText:"取消"},E.default.createElement(i.default,{type:"delete",className:"interface-delete-icon",style:{display:e.state.delIcon==n&&a.length-1!=0?"block":"none"}}))))}));return E.default.createElement("div",{className:"m-env-panel"},E.default.createElement(b.default,{className:"project-env"},E.default.createElement(D,{width:195,style:{background:"#fff"}},E.default.createElement("div",{style:{height:"100%",borderRight:0}},E.default.createElement(o.default,{className:"first-menu-item menu-item"},E.default.createElement("div",{className:"env-icon-style"},E.default.createElement("h3",null,"环境列表 ",E.default.createElement(u.default,{placement:"top",title:"在这里添加项目的环境配置"},E.default.createElement(i.default,{type:"question-circle-o"}))),E.default.createElement(u.default,{title:"添加环境变量"},E.default.createElement(i.default,{type:"plus",onClick:function(){return e.addParams("env")}})))),E.default.createElement(P.default,{data:function(){return a},onChange:this.handleDragMove("env")},n))),E.default.createElement(b.default,{className:"env-content"},E.default.createElement(R,{style:{background:"#fff",padding:24,margin:0,minHeight:280}},E.default.createElement(O.default,{projectMsg:this.state.currentEnvMsg,onSubmit:function(t){return e.onSubmit(t,r)},handleEnvInput:function(t){return e.handleInputChange(t,r)}})))))}}]),n}(E.Component),(0,g.default)(j,"propTypes",{projectId:_.default.number,updateEnv:_.default.func,getProject:_.default.func,projectMsg:_.default.object,onOk:_.default.func,getEnv:_.default.func}),k=w))||k;t.default=T},584:function(e,t,a){},585:function(e,t,a){"use strict";var r=a(3);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(a(9)),l=r(a(10)),u=r(a(11)),o=r(a(12)),c=r(a(13)),i=r(a(5)),s=r(a(7)),d=r(a(1)),f=r(a(17)),p=r(a(0));function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,c.default)(e);if(t){var n=(0,c.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,o.default)(this,a)}}var h=null;function y(e){return e&&"object"===(0,s.default)(e)&&1===e.nodeType&&"string"==typeof e.nodeName&&"function"==typeof e.getAttribute}var v=function(e){(0,u.default)(a,e);var t=m(a);function a(){return(0,n.default)(this,a),t.apply(this,arguments)}return(0,l.default)(a,[{key:"render",value:function(){var e=this,t=this.props,a=t.onlyChild,r=t.children;return d.default.createElement("div",null,r.map((function(r,n){return d.default.isValidElement(r)?d.default.cloneElement(r,{draggable:!a,ref:"x"+n,"data-ref":"x"+n,onDragStart:function(){h=n},onMouseDown:function(t){if(a){var r=t.target,n=t.target;if(y(r)){do{if(r&&y(r)&&r.getAttribute(a)&&(n=r),r&&"DIV"==r.tagName&&r.getAttribute("data-ref"))break}while(r=r.parentNode);if(r){var l=e.refs[r.getAttribute("data-ref")],u=f.default.findDOMNode(l);u&&(u.draggable=!!n.getAttribute(a))}}}},onDragEnter:function(){!function(e,a){if(e!==a){var r;r=t.data();var n,l,u,o,c=(l=e,u=a,o=(n=[].concat(n=r)).splice(l,1)[0],n.splice(u,0,o),n);"function"==typeof t.onChange&&t.onChange(c,e,a)}}(h,n),h=n},onDragEnd:function(){h=null,"function"==typeof t.onDragEnd&&t.onDragEnd()}}):r})))}}]),a}(d.default.Component);t.default=v,(0,i.default)(v,"propTypes",{children:p.default.array,onChange:p.default.func,onDragEnd:p.default.func,data:p.default.func,onlyChild:p.default.string})},586:function(module,exports,__webpack_require__){"use strict";(function(global){var _interopRequireDefault=__webpack_require__(3),_regenerator=_interopRequireDefault(__webpack_require__(30)),_asyncToGenerator2=_interopRequireDefault(__webpack_require__(31)),_typeof2=_interopRequireDefault(__webpack_require__(7)),_require=__webpack_require__(160),isJson5=_require.isJson5,json_parse=_require.json_parse,handleJson=_require.handleJson,joinPath=_require.joinPath,safeArray=_require.safeArray,constants=__webpack_require__(72),_=__webpack_require__(79),URL=__webpack_require__(174),utils=__webpack_require__(357).utils,HTTP_METHOD=constants.HTTP_METHOD,axios=__webpack_require__(44),qs=__webpack_require__(587),CryptoJS=__webpack_require__(1316),jsrsasign=__webpack_require__(1340),https=__webpack_require__(1341),isNode="object"==(void 0===global?"undefined":(0,_typeof2.default)(global))&&global.global===global,ContentTypeMap={"application/json":"json","application/xml":"xml","text/xml":"xml","application/html":"html","text/html":"html",other:"text"},getStorage=function(){var e=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function e(t){var a,r;return _regenerator.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!isNode){e.next=9;break}return a=global.storageCreator(t),e.next=5,a.getItem();case 5:return r=e.sent,e.abrupt("return",{getItem:function(e){return r[e]},setItem:function(e,t){r[e]=t,a.setItem(e,t)}});case 9:return e.abrupt("return",{getItem:function(e){return window.localStorage.getItem(e)},setItem:function(e,t){return window.localStorage.setItem(e,t)}});case 10:e.next=16;break;case 12:return e.prev=12,e.t0=e.catch(0),console.error(e.t0),e.abrupt("return",{getItem:function(t){console.error(t,e.t0)},setItem:function(t,a){console.error(t,a,e.t0)}});case 16:case"end":return e.stop()}}),e,null,[[0,12]])})));return function(t){return e.apply(this,arguments)}}();function httpRequestByNode(e){return _httpRequestByNode.apply(this,arguments)}function _httpRequestByNode(){return(_httpRequestByNode=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function e(t){var a,r,n;return _regenerator.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=function(){var e;t&&"object"===(0,_typeof2.default)(t.headers)&&t.headers&&(Object.keys(t.headers).forEach((function(a){/content-type/i.test(a)&&t.headers[a]&&(e=t.headers[a].split(";")[0].trim().toLowerCase()),t.headers[a]||delete t.headers[a]})),"application/x-www-form-urlencoded"===e&&"object"===(0,_typeof2.default)(t.data)&&t.data&&(t.data=qs.stringify(t.data)))},a=function(e){return e&&"object"===(0,_typeof2.default)(e)?{res:{header:e.headers,status:e.status,body:e.data}}:{res:{status:500,body:isNode?"请求出错, 内网服务器自动化测试无法访问到，请检查是否为内网服务器！":"请求出错"}}},e.prev=2,r(),e.next=6,axios({method:t.method,url:t.url,headers:t.headers,timeout:1e4,maxRedirects:0,httpsAgent:new https.Agent({rejectUnauthorized:!1}),data:t.data});case 6:return n=e.sent,e.abrupt("return",a(n));case 10:if(e.prev=10,e.t0=e.catch(2),void 0!==e.t0.response){e.next=14;break}return e.abrupt("return",a({headers:{},status:null,data:e.t0.message}));case 14:return e.abrupt("return",a(e.t0.response));case 15:case"end":return e.stop()}}),e,null,[[2,10]])})))).apply(this,arguments)}function handleContentType(e){if(!e||"object"!==(0,_typeof2.default)(e))return ContentTypeMap.other;var t="other";try{return Object.keys(e).forEach((function(a){/content-type/i.test(a)&&(t=e[a].split(";")[0].trim().toLowerCase())})),ContentTypeMap[t]?ContentTypeMap[t]:ContentTypeMap.other}catch(e){return ContentTypeMap.other}}function checkRequestBodyIsRaw(e,t){return!(!t||"file"===t||"form"===t||!HTTP_METHOD[e].request_body)&&t}function checkNameIsExistInArray(e,t){for(var a=!1,r=0;r<t.length;r++){if(t[r].name===e){a=!0;break}}return a}function handleCurrDomain(e,t){var a=_.find(e,(function(e){return e.name===t}));return a||(a=e[0]),a}function sandboxByNode(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=__webpack_require__(1356);t=new a.Script(t);var r=new a.createContext(e);return t.runInContext(r,{timeout:1e4}),e}function sandbox(){return _sandbox.apply(this,arguments)}function _sandbox(){return(_sandbox=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function e(){var t,a,r=arguments;return _regenerator.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.length>0&&void 0!==r[0]?r[0]:{},a=r.length>1?r[1]:void 0,!isNode){e.next=17;break}e.prev=3,t.context=t,t.console=console,t.Promise=Promise,t.setTimeout=setTimeout,t=sandboxByNode(t,a),e.next=15;break;case 11:throw e.prev=11,e.t0=e.catch(3),e.t0.message="Script: ".concat(a,"\n      message: ").concat(e.t0.message),e.t0;case 15:e.next=18;break;case 17:t=sandboxByBrowser(t,a);case 18:if(!t.promise||"object"!==(0,_typeof2.default)(t.promise)||!t.promise.then){e.next=28;break}return e.prev=19,e.next=22,t.promise;case 22:e.next=28;break;case 24:throw e.prev=24,e.t1=e.catch(19),e.t1.message="Script: ".concat(a,"\n      message: ").concat(e.t1.message),e.t1;case 28:return e.abrupt("return",t);case 29:case"end":return e.stop()}}),e,null,[[3,11],[19,24]])})))).apply(this,arguments)}function sandboxByBrowser(){var context=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},script=arguments.length>1?arguments[1]:void 0;if(!script||"string"!=typeof script)return context;var beginScript="";for(var i in context)beginScript+="var ".concat(i," = context.").concat(i,";");try{eval(beginScript+script)}catch(e){var message="Script:\n                   ----CodeBegin----:\n                   ".concat(beginScript,"\n                   ").concat(script,"\n                   ----CodeEnd----\n                  ");throw e.message="Script: ".concat(message,"\n    message: ").concat(e.message),e}return context}function crossRequest(e,t,a){return _crossRequest.apply(this,arguments)}function _crossRequest(){return(_crossRequest=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function e(t,a,r){var n,l,u,o,c,i,s,d=arguments;return _regenerator.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=d.length>3&&void 0!==d[3]?d[3]:{},l=Object.assign({},t),u=l.taskId||Math.random()+"",o=URL.parse(l.url,!0),c={},c=Object.assign(c,o.query),e.t0=isNode,e.t1=l.method,e.t2=o.pathname,e.t3=c,e.t4=l.headers||{},e.t5=l.data,e.next=13,getStorage(u);case 13:if(e.t6=e.sent,i={isNode:e.t0,get href(){return o.href},set href(e){throw new Error("context.href 不能被赋值")},get hostname(){return o.hostname},set hostname(e){throw new Error("context.hostname 不能被赋值")},get caseId(){return l.caseId},set caseId(e){throw new Error("context.caseId 不能被赋值")},method:e.t1,pathname:e.t2,query:e.t3,requestHeader:e.t4,requestBody:e.t5,promise:!1,storage:e.t6},Object.assign(i,n),i.utils=Object.freeze({_,CryptoJS,jsrsasign,base64:utils.base64,md5:utils.md5,sha1:utils.sha1,sha224:utils.sha224,sha256:utils.sha256,sha384:utils.sha384,sha512:utils.sha512,unbase64:utils.unbase64,axios}),!a){e.next=24;break}return e.next=20,sandbox(i,a);case 20:i=e.sent,t.url=l.url=URL.format({protocol:o.protocol,host:o.host,query:i.query,pathname:i.pathname}),t.headers=l.headers=i.requestHeader,t.data=l.data=i.requestBody;case 24:if(!isNode){e.next=31;break}return e.next=27,httpRequestByNode(l);case 27:(s=e.sent).req=l,e.next=34;break;case 31:return e.next=33,new Promise((function(e,t){l.error=l.success=function(a,r,n){var l="";a&&"string"==typeof a&&(a=json_parse(n.res.body),n.res.body=a),isNode||(l='请求异常，请检查 chrome network 错误信息... https://juejin.im/post/5c888a3e5188257dee0322af 通过该链接查看教程"）'),isNaN(n.res.status)&&t({body:a||l,header:r,message:l}),e(n)},window.crossRequest(l)}));case 33:s=e.sent;case 34:if(!r){e.next=46;break}return i.responseData=s.res.body,i.responseHeader=s.res.header,i.responseStatus=s.res.status,i.runTime=s.runTime,e.next=41,sandbox(i,r);case 41:i=e.sent,s.res.body=i.responseData,s.res.header=i.responseHeader,s.res.status=i.responseStatus,s.runTime=i.runTime;case 46:return e.abrupt("return",s);case 47:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function handleParams(e,t,a){var r=Object.assign({},e);function n(e){var r={};return safeArray(e).forEach((function(e){e&&e.name&&(e.enable||"1"===e.required)&&(r[e.name]=t(e.value,l.global),a&&(a[e.name]=r[e.name]))})),r}var l,u,o=r.case_env,c=r.path,i=r.env,s=r._id,d={};l=handleCurrDomain(i,o),r.req_params=r.req_params||[],r.req_params.forEach((function(e){var r=t(e.value,l.global);a&&(a[e.name]=r),c=(c=c.replace(":".concat(e.name),r||":".concat(e.name))).replace("{".concat(e.name,"}"),r||"{".concat(e.name,"}"))}));var f,p,m=URL.parse(joinPath(l.domain,c),!0),h=URL.format({protocol:m.protocol||"http",host:m.host,pathname:m.pathname}),y=(f=r.req_headers,p={},safeArray(f).forEach((function(e){e&&e.name&&(p[e.name]=t(e.value,l.global),a&&(a[e.name]=p[e.name]))})),p);d={url:h,caseId:s,method:r.method,query:Object.assign(m.query,n(r.req_query)),headers:y,timeout:824e5};try{if("raw"===r.req_body_type&&y&&y["Content-Type"])if(y["Content-Type"].indexOf("application/x-www-form-urlencoded")>=0){r.req_body_type="form";var v=json_parse(r.req_body_other);v&&"object"===(0,_typeof2.default)(v)&&(r.req_body_form=[],Object.keys(v).forEach((function(e){r.req_body_form.push({name:e,type:"text",value:JSON.stringify(v[e]),enable:!0})})))}else y["Content-Type"].indexOf("application/json")>=0&&(r.req_body_type="json")}catch(e){console.error("err",e)}if(HTTP_METHOD[r.method].request_body){if("form"===r.req_body_type)u=n(safeArray(r.req_body_form).filter((function(e){return"text"==e.type})));else if("json"===r.req_body_type){var g=isJson5(r.req_body_other);!1===g?u=r.req_body_other:(a&&(a=Object.assign(a,g)),u=handleJson(g,(function(e){return t(e,l.global)})))}else u=r.req_body_other;d.data=u,"form"===r.req_body_type?d.files=n(safeArray(r.req_body_form).filter((function(e){return"file"==e.type}))):"file"===r.req_body_type&&(d.file="single-file")}return d}exports.checkRequestBodyIsRaw=checkRequestBodyIsRaw,exports.handleParams=handleParams,exports.handleContentType=handleContentType,exports.crossRequest=crossRequest,exports.handleCurrDomain=handleCurrDomain,exports.checkNameIsExistInArray=checkNameIsExistInArray}).call(this,__webpack_require__(60))},600:function(e,t,a){"use strict";e.exports=function(e,t,a){return e&&t&&a||console.error("uid projectId interfaceId 不能为空",e,t,a),{uid:+e,projectId:+t,interfaceId:+a}}},601:function(e,t,a){},602:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(33);var l=r(a(25));a(48);var u=r(a(47)),o=r(a(58)),c=r(a(9)),i=r(a(10)),s=r(a(23)),d=r(a(11)),f=r(a(12)),p=r(a(13)),m=r(a(5));a(71);var h=r(a(61));a(82);var y=r(a(84)),v=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=_(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),g=r(a(0)),b=r(a(72)),E=a(68);function _(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(_=function(e){return e?a:t})(e)}function k(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,p.default)(e);if(t){var n=(0,p.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,f.default)(this,a)}}var j=b.default.HTTP_METHOD,w=Object.keys(j),O=y.default.Item,C=h.default.Option;var x=function(e){(0,d.default)(a,e);var t=k(a);function a(){var e;(0,c.default)(this,a);for(var r=arguments.length,n=new Array(r),l=0;l<r;l++)n[l]=arguments[l];return e=t.call.apply(t,[this].concat(n)),(0,m.default)((0,s.default)(e),"handleSubmit",(function(t){t.preventDefault(),e.props.form.validateFields((function(t,a){t||e.props.onSubmit(a,(function(){e.props.form.resetFields()}))}))})),(0,m.default)((0,s.default)(e),"handlePath",(function(t){var a=t.target.value;e.props.form.setFieldsValue({path:(0,E.handleApiPath)(a)})})),e}return(0,i.default)(a,[{key:"render",value:function(){var e,t=this.props.form,a=t.getFieldDecorator,r=t.getFieldsError,n=a("method",{initialValue:"GET"})(v.default.createElement(h.default,{style:{width:75}},w.map((function(e){return v.default.createElement(C,{key:e,value:e},e)})))),c={labelCol:{xs:{span:24},sm:{span:6}},wrapperCol:{xs:{span:24},sm:{span:14}}};return v.default.createElement(y.default,{onSubmit:this.handleSubmit},v.default.createElement(O,(0,o.default)({},c,{label:"接口分类"}),a("catid",{initialValue:this.props.catid?this.props.catid+"":this.props.catdata[0]._id+""})(v.default.createElement(h.default,null,this.props.catdata.map((function(e){return v.default.createElement(C,{key:e._id,value:e._id+""},e.name)}))))),v.default.createElement(O,(0,o.default)({},c,{label:"接口名称"}),a("title",{rules:(0,E.nameLengthLimit)("接口")})(v.default.createElement(u.default,{placeholder:"接口名称"}))),v.default.createElement(O,(0,o.default)({},c,{label:"接口路径"}),a("path",{rules:[{required:!0,message:"请输入接口路径!"}]})(v.default.createElement(u.default,{onBlur:this.handlePath,addonBefore:n,placeholder:"/path"}))),v.default.createElement(O,(0,o.default)({},c,{label:"注"}),v.default.createElement("span",{style:{color:"#929292"}},"详细的接口数据可以在编辑页面中添加")),v.default.createElement(O,{className:"catModalfoot",wrapperCol:{span:24,offset:8}},v.default.createElement(l.default,{onClick:this.props.onCancel,style:{marginRight:"10px"}},"取消"),v.default.createElement(l.default,{type:"primary",htmlType:"submit",disabled:(e=r(),Object.keys(e).some((function(t){return e[t]})))},"提交")))}}]),a}(v.PureComponent);(0,m.default)(x,"propTypes",{form:g.default.object,onSubmit:g.default.func,onCancel:g.default.func,catid:g.default.number,catdata:g.default.array});var P=y.default.create()(x);t.default=P},603:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(30));a(53);var u=r(a(54));a(33);var o=r(a(25));a(136);var c=r(a(111)),i=r(a(31));a(236);var s=r(a(244)),d=r(a(9)),f=r(a(10)),p=r(a(23)),m=r(a(11)),h=r(a(12)),y=r(a(13)),v=r(a(5));a(148);var g=r(a(149));a(71);var b=r(a(61));a(82);var E,_,k,j=r(a(84)),w=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=S(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),O=a(22),C=r(a(0)),x=r(a(44)),P=r(a(587)),N=a(124),M=a(103);function S(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(S=function(e){return e?a:t})(e)}function I(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,y.default)(e);if(t){var n=(0,y.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,h.default)(this,a)}}j.default.Item;var R=b.default.Option,D=g.default.TreeNode;var T=(0,O.connect)((function(e){return{curProject:e.project.currProject,catList:e.inter.list,totalTableList:e.inter.totalTableList,catTableList:e.inter.catTableList,totalCount:e.inter.totalCount,count:e.inter.count}}),{fetchInterfaceListMenu:N.fetchInterfaceListMenu,fetchInterfaceList:N.fetchInterfaceList,fetchInterfaceCatList:N.fetchInterfaceCatList,fetchGroupList:M.fetchGroupList})((k=_=function(e){(0,m.default)(h,e);var t,a,r,n=I(h);function h(e){var t;return(0,d.default)(this,h),t=n.call(this,e),(0,v.default)((0,p.default)(t),"changeState",(function(e,a){var r={};r[e]=a,t.setState(r)})),(0,v.default)((0,p.default)(t),"onSubmit",(function(e){if(e.preventDefault(),t.props&&t.props.onSubmit){var a=[];for(var r in t.state.selectedNodes){var n=t.state.selectedNodes[r],l=n.props.nodeType,u={key:n.key};u.cat="cat"===l,a.push(u)}t.props.onSubmit(a)}})),(0,v.default)((0,p.default)(t),"renderTitle",(function(e){return w.default.createElement("div",{style:{display:"flex"},onClick:function(e){return e.stopPropagation()}},t.methodTag(e.method)," ",e.title," ",e.path)})),(0,v.default)((0,p.default)(t),"methodTag",(function(e){return"POST"==e?w.default.createElement(s.default,{color:"red"},e):w.default.createElement(s.default,{color:"green"},e)})),t.state={groupData:[],projectData:[],total:0,current:1,backups:[],selectedGroup:null,isSearch:!1,selectedNodes:[],visible:t.props.visible,loading:!1},t}return(0,f.default)(h,[{key:"getGroupList",value:function(){var e=this;x.default.get("/api/group/list").then((function(t){var a=t.data;if(0===a.errcode){var r=a.data;e.setState({groupData:r})}}))}},{key:"getProjectList",value:(r=(0,i.default)(l.default.mark((function e(t){var a,r,n,u,o,c;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.selectedGroup!=t){e.next=2;break}return e.abrupt("return");case 2:return this.setState({selectedGroup:t,loading:!0}),a="/api/project/list?group_id="+t+"&page=1&limit=10",e.next=6,x.default.get(a);case 6:return e.next=8,e.sent.data;case 8:if(0!==(r=e.sent).errcode){e.next=18;break}return n=r.data.list,u=n.map((function(e){return e._id})),e.next=14,this.getInterfaceList(u);case 14:o=e.sent,c=o.interfaces,n=n.filter((function(e){return c[e._id]})).map((function(e){return e})),this.setState({projectData:n,interfaces:c});case 18:this.setState({loading:!1});case 19:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"getInterfaceList",value:(a=(0,i.default)(l.default.mark((function e(t){var a;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,x.default.get("/api/interface/findByProjects",{params:{projectIds:t},paramsSerializer:function(e){return P.default.stringify(e,{indices:!1})}});case 2:return e.next=4,e.sent.data;case 4:if(0!==(a=e.sent).errcode){e.next=7;break}return e.abrupt("return",a.data);case 7:return e.abrupt("return",[]);case 8:case"end":return e.stop()}}),e)}))),function(e){return a.apply(this,arguments)})},{key:"getChildren",value:function(e){return e.intefaceList?e.intefaceList.map((function(e){e.name,e._id})):""}},{key:"componentDidMount",value:(t=(0,i.default)(l.default.mark((function e(){return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.getGroupList();case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"render",value:function(){var e,t=this,a=this.props.form,r=(a.getFieldDecorator,a.getFieldsError);return w.default.createElement(u.default,{title:"关联接口文档",footer:null,width:800,maskClosable:!1,keyboard:!1,visible:this.props.visible,className:"ForkDocModal",onCancel:function(){t.props.onCancel&&t.props.onCancel()}},w.default.createElement("div",null,w.default.createElement("div",{style:{textAlign:"center",borderBottom:"1px solid #E9E9E9",padding:"10px"}},"选择空间："," ",w.default.createElement(b.default,{style:{width:500},onChange:function(e){return t.getProjectList(e)}},this.state.groupData.map((function(e){return w.default.createElement(R,{value:e._id,key:e._id},e.group_name)})))),w.default.createElement("div",{style:{marginTop:20}}),w.default.createElement(c.default,{spinning:this.state.loading},w.default.createElement("div",{style:{height:600,overflowY:"auto",padding:"20px",border:"1px solid #E9E9E9",margin:"10px"}},w.default.createElement(g.default,{checkable:!0,multiple:!0,onSelect:function(e,t){},onCheck:function(e,a){t.setState({selectedNodes:a.checkedNodes})}},this.state.projectData.map((function(e){return w.default.createElement(D,{nodeType:"cat",title:e.name,key:e._id},t.state.interfaces[e._id]?t.state.interfaces[e._id].map((function(e){return w.default.createElement(D,{nodeType:"interface",title:t.renderTitle(e),key:e._id})})):"")})))))),w.default.createElement("div",{style:{height:"40px",paddingTop:"5px",alignItems:"end",alignContent:"end",textAlign:"right",marginRight:"20px",borderTop:"1px solid #E9E9E9"}},w.default.createElement(o.default,{onClick:this.props.onCancel,style:{marginRight:"10px"}},"取消"),w.default.createElement(o.default,{type:"primary",htmlType:"submit",onClick:this.onSubmit,disabled:(e=r(),Object.keys(e).some((function(t){return e[t]})))},"提交")))}}]),h}(w.PureComponent),(0,v.default)(_,"propTypes",{form:C.default.object,catdata:C.default.object,fetchGroupList:C.default.func,visible:C.default.bool,onCancel:C.default.func,onSubmit:C.default.func}),E=k))||E,q=j.default.create()(T);t.default=q},604:function(e,t,a){},605:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(48);var l=r(a(47));a(55);var u=r(a(45));a(36);var o=r(a(4)),c=r(a(9)),i=r(a(10)),s=r(a(23)),d=r(a(11)),f=r(a(12)),p=r(a(13)),m=r(a(5)),h=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=v(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),y=r(a(0));function v(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(v=function(e){return e?a:t})(e)}function g(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,p.default)(e);if(t){var n=(0,p.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,f.default)(this,a)}}a(1362);var b=function(e){(0,d.default)(a,e);var t=g(a);function a(e){var r;return(0,c.default)(this,a),r=t.call(this,e),(0,m.default)((0,s.default)(r),"toggle",(function(){r.setState({inputShow:!r.state.inputShow})})),(0,m.default)((0,s.default)(r),"handleChange",(function(e){r.setState({inputValue:e.target.value})})),r.state={inputShow:!1,inputValue:""},r}return(0,i.default)(a,[{key:"componentWillReceiveProps",value:function(e){this.props.desc===e.desc&&this.setState({inputShow:!1})}},{key:"render",value:function(){var e=this;return h.default.createElement("div",null,this.props.desc&&h.default.createElement("div",{className:"component-label"},this.state.inputShow?h.default.createElement("div",{className:"label-input-wrapper"},h.default.createElement(l.default,{onChange:this.handleChange,defaultValue:this.props.desc,size:"small"}),h.default.createElement(o.default,{className:"interface-delete-icon",onClick:function(){e.props.onChange(e.state.inputValue),e.toggle()},type:"check"}),h.default.createElement(o.default,{className:"interface-delete-icon",onClick:this.toggle,type:"close"})):h.default.createElement("div",null,h.default.createElement("p",null,this.props.desc,"   ",h.default.createElement(u.default,{title:"编辑简介"},h.default.createElement(o.default,{onClick:this.toggle,className:"interface-delete-icon",type:"edit"}))))))}}]),a}(h.Component);t.default=b,(0,m.default)(b,"propTypes",{onChange:y.default.func,desc:y.default.string,cat_name:y.default.string})},632:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(57);var l=r(a(51));a(36);var u=r(a(4));a(64);var o=r(a(49));a(48);var c=r(a(47)),i=r(a(7)),s=r(a(9)),d=r(a(10)),f=r(a(23)),p=r(a(11)),m=r(a(12)),h=r(a(13)),y=r(a(5)),v=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=b(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),g=r(a(0));function b(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(b=function(e){return e?a:t})(e)}function E(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,h.default)(e);if(t){var n=(0,h.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,m.default)(this,a)}}a(1471);var k=function(e){(0,p.default)(a,e);var t=_(a);function a(e){var r;return(0,s.default)(this,a),r=t.call(this,e),(0,y.default)((0,f.default)(r),"addHeader",(function(e,t,a,n){var l={};l[a]=[].concat(r.state[a]),l[a][t][n]=e;var u=r.state[a][t+1];if(!u||"object"!==(0,i.default)(u)){l[a]=[].concat(r.state[a],{name:"",desc:""})}r.setState(l)})),(0,y.default)((0,f.default)(r),"delHeader",(function(e,t){var a=r.state[t],n={};n[t]=a.filter((function(t,a){return a!==e})),r.setState(n)})),(0,y.default)((0,f.default)(r),"handleChange",(function(e,t,a,n){var l=r.state;l[a][t][n]=e,r.setState(l)})),r.state={tag:[{name:"",desc:""}]},r}return(0,d.default)(a,[{key:"initState",value:function(e){var t=[{name:"",desc:""}];return e&&0!==e.length&&e.forEach((function(e){t.unshift(e)})),{tag:t}}},{key:"componentDidMount",value:function(){this.handleInit(this.props.tagMsg)}},{key:"handleInit",value:function(e){var t=this.initState(e);this.setState(function(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?E(Object(a),!0).forEach((function(t){(0,y.default)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):E(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}({},t))}},{key:"render",value:function(){var e=this;return v.default.createElement("div",{className:"project-tag"},this.state.tag.map((function(t,a){return function(t,a,r){var n=e.state[r].length-1;return v.default.createElement(l.default,{key:a,className:"tag-item"},v.default.createElement(o.default,{span:6,className:"item-name"},v.default.createElement(c.default,{placeholder:"请输入 ".concat(r," 名称"),value:t.name||"",onChange:function(t){return e.addHeader(t.target.value,a,r,"name")}})),v.default.createElement(o.default,{span:12},v.default.createElement(c.default,{placeholder:"请输入tag 描述信息",style:{width:"90%",marginRight:8},onChange:function(t){return e.handleChange(t.target.value,a,r,"desc")},value:t.desc||""})),v.default.createElement(o.default,{span:2,className:a===n?" tag-last-row":null},v.default.createElement(u.default,{className:"dynamic-delete-button delete",type:"delete",onClick:function(t){t.stopPropagation(),e.delHeader(a,r)}})))}(t,a,"tag")})))}}]),a}(v.Component);(0,y.default)(k,"propTypes",{tagMsg:g.default.array,tagSubmit:g.default.func});var j=k;t.default=j},635:function(e,t,a){"use strict";var r=a(3);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(36);var n=r(a(4)).default.createFromIconfontCN({scriptUrl:"//at.alicdn.com/t/font_2897661_ejx5wg93jzv.js"});t.default=n},636:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(5)),u=r(a(9)),o=r(a(10)),c=r(a(11)),i=r(a(12)),s=r(a(13)),d=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=h(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),f=a(182),p=r(a(1482)),m=r(a(1494));function h(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(h=function(e){return e?a:t})(e)}function y(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function v(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,s.default)(e);if(t){var n=(0,s.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,i.default)(this,a)}}var g=function(e){(0,c.default)(a,e);var t=v(a);function a(e){var r;return(0,u.default)(this,a),(r=t.call(this,e)).state=function(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?y(Object(a),!0).forEach((function(t){(0,l.default)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):y(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}({req_query:r.props.data.req_query,req_headers:r.props.data.req_headers,method:r.props.data.method,req_body_type:r.props.data.req_body_type},r.props.data),r}return(0,o.default)(a,[{key:"componentWillMount",value:function(){console.log(this.props.data)}},{key:"send",value:function(){console.log(this.state.headers)}},{key:"render",value:function(){var e=this;return d.default.createElement("div",{style:{height:"1000px",margin:"10px 0 0 0"}},d.default.createElement(f.ReflexContainer,null,d.default.createElement(f.ReflexElement,{size:40},d.default.createElement(m.default,{method:this.state.method,path:this.state.path,onChange:function(t){var a=t.method,r=t.path;t.environment;e.setState({path:r,method:a})},onSend:function(){e.send()}})),d.default.createElement(f.ReflexElement,{size:200},d.default.createElement(p.default,{params:this.state.req_query,headers:this.state.req_headers,onChange:function(t){var a=t.headers,r=t.params;e.setState({req_query:r,headers:a})}})),d.default.createElement(f.ReflexSplitter,null),d.default.createElement(f.ReflexElement,null,JSON.stringify(this.state.req_query))))}}]),a}(d.PureComponent);t.default=g},637:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(30));a(33);var u=r(a(25));a(55);var o=r(a(45));a(36);var c=r(a(4));a(38);var i=r(a(39)),s=r(a(31)),d=r(a(9)),f=r(a(10)),p=r(a(23)),m=r(a(11)),h=r(a(12)),y=r(a(13)),v=r(a(5));a(48);var g=r(a(47));a(53);var b=r(a(54));a(82);var E=r(a(84));a(148);var _,k,j,w=r(a(149)),O=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=D(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),C=a(22),x=a(40),P=r(a(0)),N=a(167),M=a(75),S=r(a(44)),I=r(a(1497)),R=a(68);function D(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(D=function(e){return e?a:t})(e)}function T(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,y.default)(e);if(t){var n=(0,y.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,h.default)(this,a)}}a(1498);var q=w.default.TreeNode,L=E.default.Item,A=b.default.confirm,B=E.default.create()((function(e){var t=e.visible,a=e.onCancel,r=e.onCreate,n=e.form,l=e.title,u=n.getFieldDecorator;return O.default.createElement(b.default,{visible:t,title:l,onCancel:a,onOk:r},O.default.createElement(E.default,{layout:"vertical"},O.default.createElement(L,{label:"集合名"},u("colName",{rules:[{required:!0,message:"请输入集合命名！"}]})(O.default.createElement(g.default,null))),O.default.createElement(L,{label:"简介"},u("colDesc")(O.default.createElement(g.default,{type:"textarea"})))))})),W=(0,C.connect)((function(e){return{interfaceColList:e.interfaceCol.interfaceColList,currCase:e.interfaceCol.currCase,isRander:e.interfaceCol.isRander,currCaseId:e.interfaceCol.currCaseId,curProject:e.project.currProject}}),{fetchInterfaceColList:N.fetchInterfaceColList,fetchInterfaceCaseList:N.fetchInterfaceCaseList,fetchCaseData:N.fetchCaseData,fetchCaseList:N.fetchCaseList,setColData:N.setColData,fetchProjectList:M.fetchProjectList})(_=(0,x.withRouter)((j=k=function(e){(0,m.default)(r,e);var t,a=T(r);function r(e){var t;return(0,d.default)(this,r),t=a.call(this,e),(0,v.default)((0,p.default)(t),"state",{colModalType:"",colModalVisible:!1,editColId:0,filterValue:"",importInterVisible:!1,importInterIds:[],importColId:0,expands:null,list:[],delIcon:null,selectedProject:null}),(0,v.default)((0,p.default)(t),"addorEditCol",(0,s.default)(l.default.mark((function e(){var a,r,n,u,o,c,s,d;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=t.form.getFieldsValue(),r=a.colName,n=a.colDesc,u=t.state,o=u.colModalType,c=u.editColId,s=t.props.match.params.id,d={},"add"!==o){e.next=10;break}return e.next=7,S.default.post("/api/col/add_col",{name:r,desc:n,project_id:s});case 7:d=e.sent,e.next=14;break;case 10:if("edit"!==o){e.next=14;break}return e.next=13,S.default.post("/api/col/up_col",{name:r,desc:n,col_id:c});case 13:d=e.sent;case 14:d.data.errcode?i.default.error(d.data.errmsg):(t.setState({colModalVisible:!1}),i.default.success("edit"===o?"修改集合成功":"添加集合成功"),t.getList());case 15:case"end":return e.stop()}}),e)})))),(0,v.default)((0,p.default)(t),"onExpand",(function(e){t.setState({expands:e})})),(0,v.default)((0,p.default)(t),"onSelect",(function(e){if(e.length){var a=e[0].split("_")[0],r=e[0].split("_")[1],n=t.props.match.params.id;"col"===a?(t.props.setColData({isRander:!1}),t.props.history.push("/project/"+n+"/interfaceCol/col/"+r)):(t.props.setColData({isRander:!1}),t.props.history.push("/project/"+n+"/interfaceCol/case/"+r))}t.setState({expands:null})})),(0,v.default)((0,p.default)(t),"showDelColConfirm",(function(e){var a=(0,p.default)(t),r=t.props.match.params;A({title:"您确认删除此测试集合",content:"温馨提示：该操作会删除该集合下所有测试用例，用例删除后无法恢复",okText:"确认",cancelText:"取消",onOk:function(){return(0,s.default)(l.default.mark((function t(){var n,u,o;return l.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,S.default.get("/api/col/del_col?col_id="+e);case 2:if((n=t.sent).data.errcode){t.next=12;break}return i.default.success("删除集合成功"),t.next=7,a.getList();case 7:u=t.sent,o=u.payload.data.data[0]._id,a.props.history.push("/project/"+r.id+"/interface/col/"+o),t.next=13;break;case 12:i.default.error(n.data.errmsg);case 13:case"end":return t.stop()}}),t)})))()}})})),(0,v.default)((0,p.default)(t),"copyInterface",function(){var e=(0,s.default)(l.default.mark((function e(a){var r,n,u,o,c,s,d;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!0!==t._copyInterfaceSign){e.next=2;break}return e.abrupt("return");case 2:return t._copyInterfaceSign=!0,r=a.desc,n=a.project_id,u=a._id,o=a.name,o="".concat(o," copy"),e.next=8,S.default.post("/api/col/add_col",{name:o,desc:r,project_id:n});case 8:if(!(c=e.sent).data.errcode){e.next=12;break}return i.default.error(c.data.errmsg),e.abrupt("return");case 12:return s=c.data.data._id,e.next=15,S.default.post("/api/col/clone_case_list",{new_col_id:s,col_id:u,project_id:n});case 15:if(d=e.sent,t._copyInterfaceSign=!1,!d.data.errcode){e.next=20;break}return i.default.error(d.data.errmsg),e.abrupt("return");case 20:t.getList(),t.props.setColData({isRander:!0}),i.default.success("克隆测试集成功");case 23:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),(0,v.default)((0,p.default)(t),"showNoDelColConfirm",(function(){A({title:"此测试集合为最后一个集合",content:"温馨提示：建议不要删除"})})),(0,v.default)((0,p.default)(t),"caseCopy",function(){var e=(0,s.default)(l.default.mark((function e(a){var r,n,u,o,c,s;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=(0,p.default)(t),e.next=3,r.props.fetchCaseData(a);case 3:return n=e.sent,u=n.payload.data.data,(u=JSON.parse(JSON.stringify(u))).casename="".concat(u.casename,"_copy"),delete u._id,e.next=10,S.default.post("/api/col/add_case",u);case 10:if((o=e.sent).data.errcode){e.next=21;break}return i.default.success("克隆用例成功"),c=o.data.data.col_id,s=o.data.data.project_id,e.next=17,t.getList();case 17:t.props.history.push("/project/"+s+"/interface/col/"+c),t.setState({visible:!1}),e.next=22;break;case 21:i.default.error(o.data.errmsg);case 22:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),(0,v.default)((0,p.default)(t),"showDelCaseConfirm",(function(e){var a=(0,p.default)(t),r=t.props.match.params;A({title:"您确认删除此测试用例",content:"温馨提示：用例删除后无法恢复",okText:"确认",cancelText:"取消",onOk:function(){return(0,s.default)(l.default.mark((function t(){var n;return l.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,S.default.get("/api/col/del_case?caseid="+e);case 2:(n=t.sent).data.errcode?i.default.error(n.data.errmsg):(i.default.success("删除用例成功"),a.getList(),+e==+a.props.currCaseId?a.props.history.push("/project/"+r.id+"/interface/col/"):a.props.setColData({isRander:!0}));case 4:case"end":return t.stop()}}),t)})))()}})})),(0,v.default)((0,p.default)(t),"showColModal",(function(e,a){var r="edit"===e?{colName:a.name,colDesc:a.desc}:{colName:"",colDesc:""};t.setState({colModalVisible:!0,colModalType:e||"add",editColId:a&&a._id}),t.form.setFieldsValue(r)})),(0,v.default)((0,p.default)(t),"saveFormRef",(function(e){t.form=e})),(0,v.default)((0,p.default)(t),"selectInterface",(function(e,a){t.setState({importInterIds:e,selectedProject:a})})),(0,v.default)((0,p.default)(t),"showImportInterfaceModal",function(){var e=(0,s.default)(l.default.mark((function e(a){var r;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.props.curProject.group_id,e.next=3,t.props.fetchProjectList(r);case 3:t.setState({importInterVisible:!0,importColId:a});case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),(0,v.default)((0,p.default)(t),"handleImportOk",(0,s.default)(l.default.mark((function e(){var a,r,n,u,o;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=t.state.selectedProject||t.props.match.params.id,r=t.state,n=r.importColId,u=r.importInterIds,e.next=4,S.default.post("/api/col/add_case_list",{interface_list:u,col_id:n,project_id:a});case 4:(o=e.sent).data.errcode?i.default.error(o.data.errmsg):(t.setState({importInterVisible:!1}),i.default.success("导入集合成功"),t.getList(),t.props.setColData({isRander:!0}));case 6:case"end":return e.stop()}}),e)})))),(0,v.default)((0,p.default)(t),"handleImportCancel",(function(){t.setState({importInterVisible:!1})})),(0,v.default)((0,p.default)(t),"filterCol",(function(e){var a=e.target.value;t.setState({filterValue:a,list:JSON.parse(JSON.stringify(t.props.interfaceColList))})})),(0,v.default)((0,p.default)(t),"onDrop",function(){var e=(0,s.default)(l.default.mark((function e(a){var r,n,u,o,c,i,s,d,f,p,m,h,y;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.props.interfaceColList,n=a.node.props.pos.split("-")[1],u=r[n]._id,o=a.dragNode.props.eventKey,c=a.dragNode.props.pos.split("-")[1],i=r[c]._id,s=a.node.props.pos.split("-"),d=Number(s[s.length-1]),f=a.dragNode.props.pos.split("-"),p=Number(f[f.length-1]),-1!==o.indexOf("col")){e.next=18;break}return u===i&&(m=r[n].caseList,h=(0,R.arrayChangeIndex)(m,p,d),S.default.post("/api/col/up_case_index",h).then()),e.next=14,S.default.post("/api/col/up_case",{id:o.split("_")[1],col_id:u});case 14:t.getList(),t.props.setColData({isRander:!0}),e.next=21;break;case 18:y=(0,R.arrayChangeIndex)(r,p,d),S.default.post("/api/col/up_col_index",y).then(),t.getList();case 21:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),(0,v.default)((0,p.default)(t),"enterItem",(function(e){t.setState({delIcon:e})})),(0,v.default)((0,p.default)(t),"leaveItem",(function(){t.setState({delIcon:null})})),t}return(0,f.default)(r,[{key:"componentWillMount",value:function(){this.getList()}},{key:"componentWillReceiveProps",value:function(e){this.props.interfaceColList!==e.interfaceColList&&this.setState({list:e.interfaceColList})}},{key:"getList",value:(t=(0,s.default)(l.default.mark((function e(){var t;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.props.fetchInterfaceColList(this.props.match.params.id);case 2:return t=e.sent,this.setState({list:t.payload.data.data}),e.abrupt("return",t);case 5:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"render",value:function(){var e=this,t=this.state,a=t.colModalType,r=t.colModalVisible,n=t.importInterVisible,l=this.props.match.params.id,i=function(t){return O.default.createElement(q,{style:{width:"100%"},key:"case_"+t._id,title:O.default.createElement("div",{className:"menu-title",onMouseEnter:function(){return e.enterItem(t._id)},onMouseLeave:e.leaveItem,title:t.casename},O.default.createElement("span",{className:"casename"},t.casename),O.default.createElement("div",{className:"btns"},O.default.createElement(o.default,{title:"删除用例"},O.default.createElement(c.default,{type:"delete",className:"interface-delete-icon",onClick:function(a){a.stopPropagation(),e.showDelCaseConfirm(t._id)},style:{display:e.state.delIcon==t._id?"block":"none"}})),O.default.createElement(o.default,{title:"克隆用例"},O.default.createElement(c.default,{type:"copy",className:"interface-delete-icon",onClick:function(a){a.stopPropagation(),e.caseCopy(t._id)},style:{display:e.state.delIcon==t._id?"block":"none"}}))))})},s=function(){var t=e.props,a=t.router,r=t.currCase,n=t.interfaceColList,l={expands:[],selects:[]};if(0===n.length)return l;if(a){if(console.log(a.params.action),"case"===a.params.action)return r&&r._id?{expands:e.state.expands?e.state.expands:["col_"+r.col_id],selects:["case_"+r._id]}:l;var u=a.params.actionId;return{expands:e.state.expands?e.state.expands:["col_"+u],selects:["col_"+u]}}return{expands:e.state.expands?e.state.expands:["col_"+n[0]._id],selects:["root"]}}(),d=this.state.list;if(this.state.filterValue){var f=[];d=d.filter((function(t){return t.caseList=t.caseList.filter((function(t){return-1!==t.casename.indexOf(e.state.filterValue)||-1!==t.path.indexOf(e.state.filterValue)})),f.push("col_"+t._id),!0})),f.length>0&&(s.expands=f)}return O.default.createElement("div",{style:{height:"100%",overflow:"hidden",borderLeft:"1px solid #D9D9D9",border:"1px solid #D9D9D9",backgroundColor:"#fff"}},O.default.createElement("div",{className:"interface-filter"},O.default.createElement("div",{style:{padding:"8px 10px",borderBottom:"1px solid #D9D9D9"}},O.default.createElement(o.default,{placement:"bottom",title:"添加集合"},O.default.createElement(u.default,{type:"primary",icon:"plus",onClick:function(){return e.showColModal("add")}},"添加集合")))),O.default.createElement("div",{className:"tree-wrapper",style:{maxHeight:parseInt(document.body.clientHeight)-240+"px"}},O.default.createElement(w.default,{className:"col-list-tree",defaultExpandedKeys:s.expands,defaultSelectedKeys:s.selects,expandedKeys:s.expands,selectedKeys:s.selects,onSelect:this.onSelect,autoExpandParent:!0,draggable:!0,onExpand:this.onExpand,onDrop:this.onDrop},d.map((function(t){return O.default.createElement(q,{key:"col_"+t._id,title:O.default.createElement("div",{className:"menu-title"},O.default.createElement("span",null,O.default.createElement(c.default,{type:"folder-open",style:{marginRight:5}}),O.default.createElement("span",null,t.name)),O.default.createElement("div",{className:"btns"},O.default.createElement(o.default,{title:"删除集合"},O.default.createElement(c.default,{type:"delete",style:{display:d.length>1?"":"none"},className:"interface-delete-icon",onClick:function(){e.showDelColConfirm(t._id)}})),O.default.createElement(o.default,{title:"编辑集合"},O.default.createElement(c.default,{type:"edit",className:"interface-delete-icon",onClick:function(a){a.stopPropagation(),e.showColModal("edit",t)}})),O.default.createElement(o.default,{title:"导入接口"},O.default.createElement(c.default,{type:"plus",className:"interface-delete-icon",onClick:function(a){a.stopPropagation(),e.showImportInterfaceModal(t._id)}})),O.default.createElement(o.default,{title:"克隆集合"},O.default.createElement(c.default,{type:"copy",className:"interface-delete-icon",onClick:function(a){a.stopPropagation(),e.copyInterface(t)}}))))},t.caseList.map(i))})))),O.default.createElement(B,{ref:this.saveFormRef,type:a,visible:r,onCancel:function(){e.setState({colModalVisible:!1})},onCreate:this.addorEditCol}),O.default.createElement(b.default,{title:"导入接口到集合",visible:n,onOk:this.handleImportOk,onCancel:this.handleImportCancel,className:"import-case-modal",width:800},O.default.createElement(I.default,{currProjectId:l,selectInterface:this.selectInterface})))}}]),r}(O.PureComponent),(0,v.default)(k,"propTypes",{match:P.default.object,interfaceColList:P.default.array,fetchInterfaceColList:P.default.func,fetchInterfaceCaseList:P.default.func,fetchCaseList:P.default.func,fetchCaseData:P.default.func,setColData:P.default.func,currCaseId:P.default.number,history:P.default.object,isRander:P.default.bool,router:P.default.object,currCase:P.default.object,curProject:P.default.object,fetchProjectList:P.default.func}),_=j))||_)||_;t.default=W},638:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(30));a(53);var u=r(a(54));a(48);var o=r(a(47));a(57);var c=r(a(51));a(134);var i=r(a(135));a(64);var s=r(a(49));a(33);var d=r(a(25));a(36);var f=r(a(4));a(136);var p=r(a(111));a(55);var m=r(a(45)),h=r(a(7));a(38);var y=r(a(39)),v=r(a(31)),g=r(a(9)),b=r(a(10)),E=r(a(23)),_=r(a(11)),k=r(a(12)),j=r(a(13)),w=r(a(5));a(71);var O,C,x,P,N,M=r(a(61)),S=$(a(1)),I=a(22),R=r(a(0)),D=a(40),T=a(167),q=r(a(1499)),L=a(75),A=a(418),B=r(a(165)),W=$(a(1544)),G=$(a(1551)),F=$(a(1555)),U=r(a(44)),V=r(a(1567)),H=r(a(79)),z=a(582),J=r(a(294)),K=a(580),Y=r(a(1568)),Q=r(a(605)),X=r(a(415));function Z(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(Z=function(e){return e?a:t})(e)}function $(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=Z(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}return r.default=e,a&&a.set(e,r),r}function ee(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function te(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?ee(Object(a),!0).forEach((function(t){(0,w.default)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):ee(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function ae(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,j.default)(e);if(t){var n=(0,j.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,k.default)(this,a)}}var re=a(586),ne=re.handleParams,le=re.crossRequest,ue=re.handleCurrDomain,oe=re.checkNameIsExistInArray,ce=a(160),ie=ce.handleParamsValue,se=ce.json_parse,de=ce.ArrayToObject,fe=M.default.Option,pe=a(600),me={top:10};function he(e){try{return JSON.parse(e)}catch(e){return{}}}var ye=(O=(0,I.connect)((function(e){return{interfaceColList:e.interfaceCol.interfaceColList,currColId:e.interfaceCol.currColId,currCaseId:e.interfaceCol.currCaseId,isShowCol:e.interfaceCol.isShowCol,isRander:e.interfaceCol.isRander,currCaseList:e.interfaceCol.currCaseList,currProject:e.project.currProject,token:e.project.token,envList:e.interfaceCol.envList,curProjectRole:e.project.currProject.role,projectEnv:e.project.projectEnv,curUid:e.user.uid}}),{fetchInterfaceColList:T.fetchInterfaceColList,fetchCaseList:T.fetchCaseList,setColData:T.setColData,getToken:L.getToken,getEnv:L.getEnv,fetchCaseEnvList:T.fetchCaseEnvList}),C=(0,A.DragDropContext)(q.default),O(x=(0,D.withRouter)(x=C((N=P=function(e){(0,_.default)(k,e);var t,a,r,n=ae(k);function k(e){var t;return(0,g.default)(this,k),t=n.call(this,e),(0,w.default)((0,E.default)(t),"handleChangeInterfaceCol",(function(e,a){var r={col_id:t.props.currColId,name:a,desc:e};U.default.post("/api/col/up_col",r).then(function(){var e=(0,v.default)(l.default.mark((function e(a){var r;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!a.data.errcode){e.next=2;break}return e.abrupt("return",y.default.error(a.data.errmsg));case 2:return r=t.props.match.params.id,e.next=5,t.props.fetchInterfaceColList(r);case 5:y.default.success("接口集合简介更新成功");case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())})),(0,w.default)((0,E.default)(t),"handleReqHeader",(function(e,a,r){var n=H.default.find(t.props.envList,(function(t){return t._id===e}));return ue(n&&n.env,r).header.forEach((function(e){oe(e.name,a)||(e=te(te({},e),{},{abled:!0}),a.push(e))})),a})),(0,w.default)((0,E.default)(t),"handleColdata",(function(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,E.default)(t),n=(0,J.default)(e,(function(e){e.map((function(e){return e.id=e._id,e._test_status=e.test_status,a[e.project_id]&&(e.case_env=a[e.project_id]),e.req_headers=r.handleReqHeader(e.project_id,e.req_headers,e.case_env),e}))}));t.setState({rows:n})})),(0,w.default)((0,E.default)(t),"executeTests",(0,v.default)(l.default.mark((function e(){var a,r,n,u,o;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=l.default.mark((function e(a,r,n,c){var i,s,d,f;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.state.rows,s=H.default.find(t.props.envList,(function(e){return u=n,o=c,e._id===i[a].project_id})),c=Object.assign({},i[a],{env:s.env,pre_script:t.props.currProject.pre_script,after_script:t.props.currProject.after_script},{test_status:"loading"}),(n=[].concat([],i))[a]=c,t.setState({rows:n}),d="error",f=void 0,e.prev=7,e.next=10,t.handleTest(c);case 10:400===(f=e.sent).code?d="error":0===f.code?d="ok":1===f.code&&(d="invalid"),e.next=19;break;case 14:e.prev=14,e.t0=e.catch(7),console.error(e.t0),d="error",f=e.t0;case 19:t.reports[c._id]=f,t.records[c._id]={status:f.status,params:f.params,body:f.res_body},c=Object.assign({},i[a],{test_status:d}),(n=[].concat([],i))[a]=c,t.setState({rows:n}),u=n,o=c;case 27:case"end":return e.stop()}}),e,null,[[7,14]])})),r=0,n=t.state.rows.length;case 2:if(!(r<n)){e.next=7;break}return e.delegateYield(a(r,n,u,o),"t0",4);case 4:r++,e.next=2;break;case 7:return e.next=9,U.default.post("/api/col/up_col",{col_id:t.props.currColId,test_report:JSON.stringify(t.reports)});case 9:case"end":return e.stop()}}),e)})))),(0,w.default)((0,E.default)(t),"handleTest",function(){var e=(0,v.default)(l.default.mark((function e(a){var r,n,u,o,c,i,s;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={},n=ne(a,t.handleValue,r),u={code:400,msg:"数据异常",validRes:[]},e.prev=3,e.next=6,le(n,a.pre_script,a.after_script,pe(t.props.curUid,t.props.match.params.id,a.interface_id));case 6:return o=e.sent,n.taskId=t.props.curUid,c=o.res.body=se(o.res.body),u=te(te(te({},n),u),{},{res_header:o.res.header,res_body:c,status:o.res.status,statusText:o.res.statusText}),n.data&&"object"===(0,h.default)(n.data)&&(r=te(te({},r),n.data)),i=[],s=Object.assign({},{status:o.res.status,body:c,header:o.res.header,statusText:o.res.statusText}),e.next=15,t.handleScriptTest(a,s,i,r);case 15:0===i.length?(u.code=0,u.validRes=[{message:"验证通过"}]):i.length>0&&(u.code=1,u.validRes=i),e.next=21;break;case 18:e.prev=18,e.t0=e.catch(3),u=te(te(te({},n),u),{},{res_header:e.t0.header,res_body:e.t0.body||e.t0.message,status:0,statusText:e.t0.message,code:400,validRes:[{message:e.t0.message}]});case 21:return u.params=r,e.abrupt("return",u);case 23:case"end":return e.stop()}}),e,null,[[3,18]])})));return function(t){return e.apply(this,arguments)}}()),(0,w.default)((0,E.default)(t),"handleScriptTest",function(){var e=(0,v.default)(l.default.mark((function e(a,r,n,u){var o;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,U.default.post("/api/col/run_script",{response:r,records:t.records,script:a.test_script,params:u,col_id:t.props.currColId,interface_id:a.interface_id});case 3:0!==(o=e.sent).data.errcode&&o.data.data.logs.forEach((function(e){n.push({message:e})})),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),n.push({message:"Error: "+e.t0.message});case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t,a,r,n){return e.apply(this,arguments)}}()),(0,w.default)((0,E.default)(t),"handleValue",(function(e,a){var r=de(a),n=Object.assign({},{global:r},t.records);return ie(e,n)})),(0,w.default)((0,E.default)(t),"arrToObj",(function(e,a){var r={};return(e=e||[]).forEach((function(e){e.name&&e.enable&&"file"!==e.type&&(r[e.name]=t.handleValue(e.value),a&&(a[e.name]=r[e.name]))})),r})),(0,w.default)((0,E.default)(t),"onDrop",(function(){var e=[];t.state.rows.forEach((function(t,a){e.push({id:t._id,index:a})})),U.default.post("/api/col/up_case_index",e).then((function(){t.props.fetchInterfaceColList(t.props.match.params.id)}))})),(0,w.default)((0,E.default)(t),"onChangeTest",(function(e){t.setState({commonSetting:te(te({},t.state.commonSetting),{},{checkScript:te(te({},t.state.commonSetting.checkScript),{},{content:e.text})})})})),(0,w.default)((0,E.default)(t),"handleInsertCode",(function(e){t.aceEditor.editor.insertCode(e)})),(0,w.default)((0,E.default)(t),"changeCollapseClose",(function(e){e?t.setState({collapseKey:e}):t.setState({collapseKey:"1",currColEnvObj:{}})})),(0,w.default)((0,E.default)(t),"openReport",(function(e){if(!t.reports[e])return y.default.warn("还没有生成报告");t.setState({visible:!0,curCaseid:e})})),(0,w.default)((0,E.default)(t),"openAdv",(function(e){var a=H.default.find(t.props.currCaseList,(function(t){return t.id===e}));t.setState({enableScript:a.enable_script,curScript:a.test_script,advVisible:!0,curCaseid:e})})),(0,w.default)((0,E.default)(t),"handleScriptChange",(function(e){t.setState({curScript:e.text})})),(0,w.default)((0,E.default)(t),"handleAdvCancel",(function(){t.setState({advVisible:!1})})),(0,w.default)((0,E.default)(t),"handleAdvOk",(0,v.default)(l.default.mark((function e(){var a,r,n,u,o;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=t.state,r=a.curCaseid,n=a.enableScript,u=a.curScript,e.next=3,U.default.post("/api/col/up_case",{id:r,test_script:u,enable_script:n});case 3:return 0===e.sent.data.errcode&&y.default.success("更新成功"),t.setState({advVisible:!1}),o=t.currColId,t.props.setColData({currColId:+o,isShowCol:!0,isRander:!1}),e.next=10,t.props.fetchCaseList(o);case 10:t.handleColdata(t.props.currCaseList);case 11:case"end":return e.stop()}}),e)})))),(0,w.default)((0,E.default)(t),"handleCancel",(function(){t.setState({visible:!1})})),(0,w.default)((0,E.default)(t),"currProjectEnvChange",(function(e,a){var r=te(te({},t.state.currColEnvObj),{},(0,w.default)({},a,e));t.setState({currColEnvObj:r}),t.handleColdata(t.props.currCaseList,r)})),(0,w.default)((0,E.default)(t),"autoTests",(function(){t.setState({autoVisible:!0,currColEnvObj:{},collapseKey:""})})),(0,w.default)((0,E.default)(t),"handleAuto",(function(){t.setState({autoVisible:!1,email:!1,download:!1,mode:"html",currColEnvObj:{},collapseKey:""})})),(0,w.default)((0,E.default)(t),"copyUrl",(function(e){(0,X.default)(e),y.default.success("已经成功复制到剪切板")})),(0,w.default)((0,E.default)(t),"modeChange",(function(e){t.setState({mode:e})})),(0,w.default)((0,E.default)(t),"emailChange",(function(e){t.setState({email:e})})),(0,w.default)((0,E.default)(t),"downloadChange",(function(e){t.setState({download:e})})),(0,w.default)((0,E.default)(t),"handleColEnvObj",(function(e){var t="";for(var a in e)t+=e[a]?"&env_".concat(a,"=").concat(e[a]):"";return t})),(0,w.default)((0,E.default)(t),"handleCommonSetting",(function(){var e=t.state.commonSetting,a=te({col_id:t.props.currColId},e);console.log(a),U.default.post("/api/col/up_col",a).then(function(){var e=(0,v.default)(l.default.mark((function e(t){return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.data.errcode){e.next=2;break}return e.abrupt("return",y.default.error(t.data.errmsg));case 2:y.default.success("配置测试集成功");case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),t.setState({commonSettingModalVisible:!1})})),(0,w.default)((0,E.default)(t),"cancelCommonSetting",(function(){t.setState({commonSettingModalVisible:!1})})),(0,w.default)((0,E.default)(t),"openCommonSetting",(function(){t.setState({commonSettingModalVisible:!0})})),(0,w.default)((0,E.default)(t),"changeCommonFieldSetting",(function(e){return function(a){var r=a;"object"===(0,h.default)(a)&&a&&(r=a.target.value);var n=t.state.commonSetting.checkResponseField;t.setState({commonSetting:te(te({},t.state.commonSetting),{},{checkResponseField:te(te({},n),{},(0,w.default)({},e,r))})})}})),t.reports={},t.records={},t.state={rows:[],reports:{},visible:!1,curCaseid:null,hasPlugin:!1,advVisible:!1,curScript:"",enableScript:!1,autoVisible:!1,mode:"html",email:!1,download:!1,currColEnvObj:{},collapseKey:"1",commonSettingModalVisible:!1,commonSetting:{checkHttpCodeIs200:!1,checkResponseField:{name:"code",value:"0",enable:!1},checkResponseSchema:!1,checkScript:{enable:!1,content:""}}},t.onRow=t.onRow.bind((0,E.default)(t)),t.onMoveRow=t.onMoveRow.bind((0,E.default)(t)),t}return(0,b.default)(k,[{key:"handleColIdChange",value:(r=(0,v.default)(l.default.mark((function e(t){var a;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.props.setColData({currColId:+t,isShowCol:!0,isRander:!1}),e.next=3,this.props.fetchCaseList(t);case 3:return 0===(a=e.sent).payload.data.errcode&&(this.reports=he(a.payload.data.colData.test_report),this.setState({commonSetting:te(te({},this.state.commonSetting),a.payload.data.colData)})),e.next=7,this.props.fetchCaseList(t);case 7:return e.next=9,this.props.fetchCaseEnvList(t);case 9:this.changeCollapseClose(),this.handleColdata(this.props.currCaseList);case 11:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"componentWillMount",value:(a=(0,v.default)(l.default.mark((function e(){var t,a,r,n,u=this;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.props.fetchInterfaceColList(this.props.match.params.id);case 2:return t=e.sent,e.next=5,this.props.getToken(this.props.match.params.id);case 5:if(this.props.currColId,r=this.props.match.params,n=r.actionId,this.currColId=a=+n||t.payload.data.data[0]._id,this.props.history.push("/project/"+r.id+"/interfaceCol/col/"+a),!a||0==a){e.next=13;break}return e.next=13,this.handleColIdChange(a);case 13:this._crossRequestInterval=(0,z.initCrossRequest)((function(e){u.setState({hasPlugin:e})}));case 14:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"componentWillUnmount",value:function(){clearInterval(this._crossRequestInterval)}},{key:"onRow",value:function(e){return{rowId:e.id,onMove:this.onMoveRow,onDrop:this.onDrop}}},{key:"onMoveRow",value:function(e){var t=e.sourceRowId,a=e.targetRowId,r=G.moveRows({sourceRowId:t,targetRowId:a})(this.state.rows);r&&this.setState({rows:r})}},{key:"componentWillReceiveProps",value:(t=(0,v.default)(l.default.mark((function e(t){var a;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:((a=isNaN(t.match.params.actionId)?0:+t.match.params.actionId)&&this.currColId&&a!==this.currColId||t.isRander)&&(this.currColId=a,this.handleColIdChange(a));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"render",value:function(){for(var e=this,t=this.props.currProject._id,a=[{property:"casename",header:{label:"用例名称"},props:{style:{width:"250px"}},cell:{formatters:[function(e,a){var r=a.rowData;return S.default.createElement(D.Link,{to:"/project/"+t+"/interface/case/"+r._id},r.casename.length>23?r.casename.substr(0,20)+"...":r.casename)}]}},{header:{label:"key",formatters:[function(){return S.default.createElement(m.default,{title:S.default.createElement("span",null," ","每个用例都有唯一的key，用于获取所匹配接口的响应数据，例如使用"," ",S.default.createElement("a",{href:"https://yapi.ymfe.org/documents/case.html#%E7%AC%AC%E4%BA%8C%E6%AD%A5%EF%BC%8C%E7%BC%96%E8%BE%91%E6%B5%8B%E8%AF%95%E7%94%A8%E4%BE%8B",className:"link-tooltip",target:"blank"}," ","变量参数"," ")," ","功能"," ")},"Key")}]},props:{style:{width:"100px"}},cell:{formatters:[function(e,t){var a=t.rowData;return S.default.createElement("span",null,a._id)}]}},{property:"test_status",header:{label:"状态"},props:{style:{width:"100px"}},cell:{formatters:[function(t,a){var r=a.rowData,n=r._id,l=e.reports[n]?e.reports[n].code:0;if("loading"===r.test_status)return S.default.createElement("div",null,S.default.createElement(p.default,null));switch(l){case 0:return S.default.createElement("div",null,S.default.createElement(m.default,{title:"Pass"},S.default.createElement(f.default,{style:{color:"#00a854"},type:"check-circle"})));case 400:return S.default.createElement("div",null,S.default.createElement(m.default,{title:"请求异常"},S.default.createElement(f.default,{type:"info-circle",style:{color:"#f04134"}})));case 1:return S.default.createElement("div",null,S.default.createElement(m.default,{title:"验证失败"},S.default.createElement(f.default,{type:"exclamation-circle",style:{color:"#ffbf00"}})));default:return S.default.createElement("div",null,S.default.createElement(f.default,{style:{color:"#00a854"},type:"check-circle"}))}}]}},{property:"path",header:{label:"接口路径"},cell:{formatters:[function(e,t){var a=t.rowData;return S.default.createElement(m.default,{title:"跳转到对应接口"},S.default.createElement(D.Link,{to:"/project/".concat(a.project_id,"/interface/api/").concat(a.interface_id)},a.path.length>23?a.path+"...":a.path))}]}},{header:{label:"测试报告"},props:{style:{width:"200px"}},cell:{formatters:[function(t,a){var r=a.rowData;return S.default.createElement("div",{className:"interface-col-table-action"},e.reports[r.id]?S.default.createElement(d.default,{onClick:function(){return e.openReport(r.id)}},"测试报告"):null)}]}}],r=this.state.rows,n={header:{cell:G.Header},body:{row:G.Row}},l=F.columnChildren({columns:a}),h=F.resolve({columns:l,method:F.nested})(r),y=location.protocol+"//"+location.hostname+(""!==location.port?":"+location.port:""),v=this.handleColEnvObj(this.state.currColEnvObj),g="/api/open/run_auto_test?id=".concat(this.props.currColId,"&token=").concat(this.props.token).concat(v||"","&mode=").concat(this.state.mode,"&email=").concat(this.state.email,"&download=").concat(this.state.download),b="",E="",_=0;_<this.props.interfaceColList.length;_++)if(this.props.interfaceColList[_]._id===this.props.currColId){b=this.props.interfaceColList[_].name,E=this.props.interfaceColList[_].desc;break}return S.default.createElement("div",{className:"interface-col"},S.default.createElement(u.default,{title:"通用规则配置",visible:this.state.commonSettingModalVisible,onOk:this.handleCommonSetting,onCancel:this.cancelCommonSetting,width:"1000px",style:me},S.default.createElement("div",{className:"common-setting-modal"},S.default.createElement(c.default,{className:"setting-item"},S.default.createElement(s.default,{className:"col-item",span:"4"},S.default.createElement("label",null,"检查HttpCode: ",S.default.createElement(m.default,{title:"检查 http code 是否为 200"},S.default.createElement(f.default,{type:"question-circle-o",style:{width:"10px"}})))),S.default.createElement(s.default,{className:"col-item",span:"18"},S.default.createElement(i.default,{onChange:function(t){var a=e.state.commonSetting;e.setState({commonSetting:te(te({},a),{},{checkHttpCodeIs200:t})})},checked:this.state.commonSetting.checkHttpCodeIs200,checkedChildren:"开",unCheckedChildren:"关"}))),S.default.createElement(c.default,{className:"setting-item"},S.default.createElement(s.default,{className:"col-item",span:"4"},S.default.createElement("label",null,"检查返回json: ",S.default.createElement(m.default,{title:"检查接口返回数据字段值，比如检查 code 是不是等于 0"},S.default.createElement(f.default,{type:"question-circle-o",style:{width:"10px"}})))),S.default.createElement(s.default,{className:"col-item",span:"6"},S.default.createElement(o.default,{value:this.state.commonSetting.checkResponseField.name,onChange:this.changeCommonFieldSetting("name"),placeholder:"字段名"})),S.default.createElement(s.default,{className:"col-item",span:"6"},S.default.createElement(o.default,{onChange:this.changeCommonFieldSetting("value"),value:this.state.commonSetting.checkResponseField.value,placeholder:"值"})),S.default.createElement(s.default,{className:"col-item",span:"6"},S.default.createElement(i.default,{onChange:this.changeCommonFieldSetting("enable"),checked:this.state.commonSetting.checkResponseField.enable,checkedChildren:"开",unCheckedChildren:"关"}))),S.default.createElement(c.default,{className:"setting-item"},S.default.createElement(s.default,{className:"col-item",span:"4"},S.default.createElement("label",null,"检查返回数据结构: ",S.default.createElement(m.default,{title:"只有 response 基于 json-schema 方式定义，该检查才会生效"},S.default.createElement(f.default,{type:"question-circle-o",style:{width:"10px"}})))),S.default.createElement(s.default,{className:"col-item",span:"18"},S.default.createElement(i.default,{onChange:function(t){var a=e.state.commonSetting;e.setState({commonSetting:te(te({},a),{},{checkResponseSchema:t})})},checked:this.state.commonSetting.checkResponseSchema,checkedChildren:"开",unCheckedChildren:"关"}))),S.default.createElement(c.default,{className:"setting-item"},S.default.createElement(s.default,{className:"col-item  ",span:"4"},S.default.createElement("label",null,"全局测试脚本: ",S.default.createElement(m.default,{title:"在跑自动化测试时，优先调用全局脚本，只有全局脚本通过测试，才会开始跑case自定义的测试脚本"},S.default.createElement(f.default,{type:"question-circle-o",style:{width:"10px"}})))),S.default.createElement(s.default,{className:"col-item",span:"14"},S.default.createElement("div",null,S.default.createElement(i.default,{onChange:function(t){var a=e.state.commonSetting;e.setState({commonSetting:te(te({},a),{},{checkScript:te(te({},e.state.checkScript),{},{enable:t})})})},checked:this.state.commonSetting.checkScript.enable,checkedChildren:"开",unCheckedChildren:"关"})),S.default.createElement(B.default,{onChange:this.onChangeTest,className:"case-script",data:this.state.commonSetting.checkScript.content,ref:function(t){e.aceEditor=t}})),S.default.createElement(s.default,{span:"6"},S.default.createElement("div",{className:"insert-code"},K.InsertCodeMap.map((function(t){return S.default.createElement("div",{style:{cursor:"pointer"},className:"code-item",key:t.title,onClick:function(){e.handleInsertCode("\n"+t.code)}},t.title)}))))))),S.default.createElement(c.default,{type:"flex",justify:"center",align:"top"},S.default.createElement(s.default,{span:5},S.default.createElement("h2",{className:"interface-title",style:{display:"inline-block",margin:"8px 20px 16px 0px"}},"测试集合 ",S.default.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"https://yapi.ymfe.org/documents/case.html"},S.default.createElement(m.default,{title:"点击查看文档"},S.default.createElement(f.default,{type:"question-circle-o"}))))),S.default.createElement(s.default,{span:10},S.default.createElement(Y.default,{envList:this.props.envList,currProjectEnvChange:this.currProjectEnvChange,envValue:this.state.currColEnvObj,collapseKey:this.state.collapseKey,changeClose:this.changeCollapseClose})),S.default.createElement(s.default,{span:9},this.state.hasPlugin?S.default.createElement("div",{style:{float:"right",paddingTop:"8px"}},"guest"!==this.props.curProjectRole&&S.default.createElement(m.default,{title:"在 YApi 服务端跑自动化测试，测试环境不能为私有网络，请确保 YApi 服务器可以访问到自动化测试环境domain"},S.default.createElement(d.default,{style:{marginRight:"8px"},onClick:this.autoTests},"服务端测试")),S.default.createElement(d.default,{onClick:this.openCommonSetting,style:{marginRight:"8px"}},"通用规则配置")," ",S.default.createElement(d.default,{type:"primary",onClick:this.executeTests},"开始测试")):S.default.createElement(m.default,{title:"请安装 cross-request Chrome 插件"},S.default.createElement(d.default,{disabled:!0,type:"primary",style:{float:"right",marginTop:"8px"}},"开始测试")))),S.default.createElement("div",{className:"component-label-wrapper"},S.default.createElement(Q.default,{onChange:function(t){return e.handleChangeInterfaceCol(t,b)},desc:E})),S.default.createElement(W.Provider,{components:n,columns:l,style:{width:"100%",borderCollapse:"collapse"}},S.default.createElement(W.Header,{className:"interface-col-table-header",headerRows:F.headerRows({columns:a})}),S.default.createElement(W.Body,{className:"interface-col-table-body",rows:h,rowKey:"id",onRow:this.onRow})),S.default.createElement(u.default,{title:"测试报告",width:"900px",style:{minHeight:"500px"},visible:this.state.visible,onCancel:this.handleCancel,footer:null},S.default.createElement(V.default,this.reports[this.state.curCaseid])),S.default.createElement(u.default,{title:"自定义测试脚本",width:"660px",style:{minHeight:"500px"},visible:this.state.advVisible,onCancel:this.handleAdvCancel,onOk:this.handleAdvOk,maskClosable:!1},S.default.createElement("h3",null,"是否开启: ",S.default.createElement(i.default,{checked:this.state.enableScript,onChange:function(t){return e.setState({enableScript:t})}})),S.default.createElement(B.default,{className:"case-script",data:this.state.curScript,onChange:this.handleScriptChange})),this.state.autoVisible&&S.default.createElement(u.default,{title:"服务端自动化测试",width:"780px",style:{minHeight:"500px"},visible:this.state.autoVisible,onCancel:this.handleAuto,className:"autoTestsModal",footer:null},S.default.createElement(c.default,{type:"flex",justify:"space-around",className:"row",align:"top"},S.default.createElement(s.default,{span:3,className:"label",style:{paddingTop:"16px"}},"选择环境",S.default.createElement(m.default,{title:"默认使用测试用例选择的环境"},S.default.createElement(f.default,{type:"question-circle-o"}))," ："),S.default.createElement(s.default,{span:21},S.default.createElement(Y.default,{envList:this.props.envList,currProjectEnvChange:this.currProjectEnvChange,envValue:this.state.currColEnvObj,collapseKey:this.state.collapseKey,changeClose:this.changeCollapseClose}))),S.default.createElement(c.default,{type:"flex",justify:"space-around",className:"row",align:"middle"},S.default.createElement(s.default,{span:3,className:"label"},"输出格式："),S.default.createElement(s.default,{span:21},S.default.createElement(M.default,{value:this.state.mode,onChange:this.modeChange},S.default.createElement(fe,{key:"html",value:"html"},"html"),S.default.createElement(fe,{key:"json",value:"json"},"json")))),S.default.createElement(c.default,{type:"flex",justify:"space-around",className:"row",align:"middle"},S.default.createElement(s.default,{span:3,className:"label"},"邮件通知",S.default.createElement(m.default,{title:"测试不通过时，会给项目组成员发送邮件"},S.default.createElement(f.default,{type:"question-circle-o",style:{width:"10px"}}))," ："),S.default.createElement(s.default,{span:21},S.default.createElement(i.default,{checked:this.state.email,checkedChildren:"开",unCheckedChildren:"关",onChange:this.emailChange}))),S.default.createElement(c.default,{type:"flex",justify:"space-around",className:"row",align:"middle"},S.default.createElement(s.default,{span:3,className:"label"},"下载数据",S.default.createElement(m.default,{title:"开启后，测试数据将被下载到本地"},S.default.createElement(f.default,{type:"question-circle-o",style:{width:"10px"}}))," ："),S.default.createElement(s.default,{span:21},S.default.createElement(i.default,{checked:this.state.download,checkedChildren:"开",unCheckedChildren:"关",onChange:this.downloadChange}))),S.default.createElement(c.default,{type:"flex",justify:"space-around",className:"row",align:"middle"},S.default.createElement(s.default,{span:21,className:"autoTestUrl"},S.default.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:y+g},g)),S.default.createElement(s.default,{span:3},S.default.createElement(d.default,{className:"copy-btn",onClick:function(){return e.copyUrl(y+g)}},"复制"))),S.default.createElement("div",{className:"autoTestMsg"},"注：访问该URL，可以测试所有用例，请确保YApi服务器可以访问到环境配置的 domain")))}}]),k}(S.PureComponent),(0,w.default)(P,"propTypes",{match:R.default.object,interfaceColList:R.default.array,fetchInterfaceColList:R.default.func,fetchCaseList:R.default.func,setColData:R.default.func,history:R.default.object,currCaseList:R.default.array,currColId:R.default.number,currCaseId:R.default.number,isShowCol:R.default.bool,isRander:R.default.bool,currProject:R.default.object,getToken:R.default.func,token:R.default.string,curProjectRole:R.default.string,getEnv:R.default.func,projectEnv:R.default.object,fetchCaseEnvList:R.default.func,envList:R.default.array,curUid:R.default.number}),x=N))||x)||x)||x);t.default=ye},657:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(30));a(48);var u=r(a(47));a(55);var o=r(a(45));a(38);var c,i,s,d=r(a(39)),f=r(a(31)),p=r(a(9)),m=r(a(10)),h=r(a(23)),y=r(a(11)),v=r(a(12)),g=r(a(13)),b=r(a(5)),E=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=P(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),_=a(22),k=r(a(0)),j=a(40),w=r(a(44)),O=a(75),C=a(167),x=a(397);r(a(636));function P(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(P=function(e){return e?a:t})(e)}function N(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,g.default)(e);if(t){var n=(0,g.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,v.default)(this,a)}}a(1570);var M=(0,_.connect)((function(e){return{interfaceColList:e.interfaceCol.interfaceColList,currColId:e.interfaceCol.currColId,currCaseId:e.interfaceCol.currCaseId,currCase:e.interfaceCol.currCase,isShowCol:e.interfaceCol.isShowCol,currProject:e.project.currProject,projectEnv:e.project.projectEnv,curUid:e.user.uid}}),{fetchInterfaceColList:C.fetchInterfaceColList,fetchCaseData:C.fetchCaseData,setColData:C.setColData,fetchCaseList:C.fetchCaseList,getEnv:O.getEnv})(c=(0,j.withRouter)((s=i=function(e){(0,y.default)(n,e);var t,a,r=N(n);function n(e){var t;return(0,p.default)(this,n),t=r.call(this,e),(0,b.default)((0,h.default)(t),"state",{isEditingCasename:!0,editCasename:""}),(0,b.default)((0,h.default)(t),"savePostmanRef",(function(e){t.postman=e})),(0,b.default)((0,h.default)(t),"updateCase",(0,f.default)(l.default.mark((function e(){var a,r,n,u,o,c,i,s,f,p,m,h,y,v,g,b;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=t.postman.state,r=a.case_env,n=a.req_params,u=a.req_query,o=a.req_headers,c=a.req_body_type,i=a.req_body_form,s=a.req_body_other,f=a.test_script,p=a.enable_script,m=a.test_res_body,h=a.test_res_header,y=t.state.editCasename,v=t.props.currCase._id,g={id:v,casename:y,case_env:r,req_params:n,req_query:u,req_headers:o,req_body_type:c,req_body_form:i,req_body_other:s,test_script:f,enable_script:p,test_res_body:m,test_res_header:h},e.next=6,w.default.post("/api/col/up_case",g);case 6:b=e.sent,t.props.currCase.casename!==y&&t.props.fetchInterfaceColList(t.props.match.params.id),b.data.errcode?d.default.error(b.data.errmsg):(d.default.success("更新成功"),t.props.fetchCaseData(v));case 9:case"end":return e.stop()}}),e)})))),(0,b.default)((0,h.default)(t),"triggerEditCasename",(function(){t.setState({isEditingCasename:!0,editCasename:t.props.currCase.casename})})),(0,b.default)((0,h.default)(t),"cancelEditCasename",(function(){t.setState({isEditingCasename:!1,editCasename:t.props.currCase.casename})})),t}return(0,m.default)(n,[{key:"getColId",value:function(e,t){var a=0;return e.forEach((function(e){e.caseList.forEach((function(r){+r._id==+t&&(a=e._id)}))})),a}},{key:"componentWillMount",value:(a=(0,f.default)(l.default.mark((function e(){var t,a,r,n,u;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.props.fetchInterfaceColList(this.props.match.params.id);case 2:return t=e.sent,a=this.props.currCaseId,r=this.props.match.params,n=r.actionId,a=+n||+a||t.payload.data.data[0].caseList[0]._id,u=this.getColId(t.payload.data.data,a),this.props.history.push("/project/"+r.id+"/interfaceCol/case/"+a),e.next=11,this.props.fetchCaseData(a);case 11:return this.props.setColData({currCaseId:+a,currColId:u,isShowCol:!1}),e.next=14,this.props.getEnv(this.props.currCase.project_id);case 14:this.setState({editCasename:this.props.currCase.casename});case 15:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"componentWillReceiveProps",value:(t=(0,f.default)(l.default.mark((function e(t){var a,r,n,u;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=this.props.match.params.actionId,r=t.match.params.actionId,n=t.interfaceColList,u=this.getColId(n,r),a===r){e.next=11;break}return e.next=7,this.props.fetchCaseData(r);case 7:return this.props.setColData({currCaseId:+r,currColId:u,isShowCol:!1}),e.next=10,this.props.getEnv(this.props.currCase.project_id);case 10:this.setState({editCasename:this.props.currCase.casename});case 11:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"render",value:function(){var e=this,t=this.props,a=t.currCase,r=t.currProject,n=t.projectEnv,l=this.state,c=l.isEditingCasename,i=l.editCasename,s=Object.assign({},a,{env:n.env,pre_script:r.pre_script,after_script:r.after_script},{_id:a._id});return E.default.createElement("div",{style:{padding:"6px 0"},className:"case-content"},E.default.createElement("div",{className:"case-title"},!c&&E.default.createElement(o.default,{title:"点击编辑",placement:"bottom"},E.default.createElement("div",{className:"case-name",onClick:this.triggerEditCasename},a.casename)),c&&E.default.createElement("div",{className:"edit-case-name"},E.default.createElement(u.default,{value:i,onChange:function(t){return e.setState({editCasename:t.target.value})},style:{fontSize:18}})),E.default.createElement("span",{className:"inter-link",style:{margin:"0px 8px 0px 6px",fontSize:12}},E.default.createElement(j.Link,{className:"text",to:"/project/".concat(a.project_id,"/interface/api/").concat(a.interface_id)},"对应接口"))),E.default.createElement("div",null,Object.keys(a).length>0&&E.default.createElement(x.Postman,{data:s,type:"case",saveTip:"更新保存修改",save:this.updateCase,ref:this.savePostmanRef,interfaceId:a.interface_id,projectId:a.project_id,curUid:this.props.curUid})))}}]),n}(E.PureComponent),(0,b.default)(i,"propTypes",{match:k.default.object,interfaceColList:k.default.array,fetchInterfaceColList:k.default.func,fetchCaseData:k.default.func,setColData:k.default.func,fetchCaseList:k.default.func,history:k.default.object,currColId:k.default.number,currCaseId:k.default.number,currCase:k.default.object,isShowCol:k.default.bool,currProject:k.default.object,getEnv:k.default.func,projectEnv:k.default.object,curUid:k.default.number}),c=s))||c)||c;t.default=M},658:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(30));a(633);var u=r(a(634));a(36);var o=r(a(4)),c=r(a(31)),i=r(a(9)),s=r(a(10)),d=r(a(23)),f=r(a(11)),p=r(a(12)),m=r(a(13)),h=r(a(5));a(53);var y,v,g,b=r(a(54)),E=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=C(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),_=r(a(0)),k=r(a(165)),j=a(22),w=a(102),O=r(a(424));function C(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(C=function(e){return e?a:t})(e)}function x(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,m.default)(e);if(t){var n=(0,m.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,p.default)(this,a)}}b.default.confirm;var P=(0,j.connect)((function(e){return{statusCodeGroupList:[]}}))((g=v=function(e){(0,f.default)(p,e);var t,a,r,n=x(p);function p(e){var t;return(0,i.default)(this,p),t=n.call(this,e),(0,h.default)((0,d.default)(t),"leaveItem",(function(){t.setState({delIcon:null})})),t.state={add_code_modal_visible:!1,dataStructureId:null,data:null},t}return(0,s.default)(p,[{key:"queryGroupList",value:(r=(0,c.default)(l.default.mark((function e(){return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))),function(){return r.apply(this,arguments)})},{key:"selectedGroup",value:(a=(0,c.default)(l.default.mark((function e(t){return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))),function(e){return a.apply(this,arguments)})},{key:"loadData",value:function(e){var t=this;w.axios.get("/api/dataStructure/getById",{params:{id:e||this.state.dataStructureId}}).then((function(e){e.data&&e.data.structure,t.setState({data:e.data})}))}},{key:"showEdit",value:function(){this.setState({add_code_modal_visible:!0})}},{key:"componentDidMount",value:(t=(0,c.default)(l.default.mark((function e(){var t;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=this.props.match.params.dataStructureId,this.setState({dataStructureId:t}),this.loadData(t);case 3:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"componentWillReceiveProps",value:function(e){var t=e.match.params.dataStructureId;this.setState({dataStructureId:t}),this.loadData(t)}},{key:"render",value:function(){var e=this;return E.default.createElement("div",{style:{padding:"20px 15px",lineHeight:"30px"}},!0===this.state.add_code_modal_visible?E.default.createElement(O.default,{id:this.state.dataStructureId,visible:this.state.add_code_modal_visible,projectId:this.state.projectId,onSubmit:function(){e.setState({add_code_modal_visible:!1}),e.loadData()},onCancel:function(){e.setState({add_code_modal_visible:!1})},groupId:this.state.selectedGroupId}):"",this.state.data?E.default.createElement("div",null,E.default.createElement("div",{style:{position:"absolute",right:"20px"}},E.default.createElement(o.default,{type:"edit",style:{cursor:"pointer"},onClick:this.showEdit.bind(this)})),E.default.createElement("div",null,E.default.createElement("div",{style:{color:"#000",fontSize:"22px",lineHeight:"22px",fontWeight:"700"}},this.state.data.name),E.default.createElement("div",null,E.default.createElement("span",{style:{color:"rgb(0 0 0 / 65%)"}},"模板编号:  ",this.state.data.code))),E.default.createElement("div",null,E.default.createElement("span",{style:{color:"rgb(0 0 0 / 65%)"}},"模板描述:  "),E.default.createElement("span",null,this.state.data.description)),E.default.createElement(u.default,null),E.default.createElement("div",{style:{fontWeight:"500",color:"#000",marginTop:"10px"}},"结构"),E.default.createElement("div",{style:{marginTop:"10px",borderRadius:"4px",overflow:"hidden"}},E.default.createElement(k.default,{data:this.state.data?this.state.data.structure_json:"",readOnly:!0,style:{minHeight:200}}))):E.default.createElement("div",null,"没有数据"))}}]),p}(E.PureComponent),(0,h.default)(v,"propTypes",{match:_.default.object,history:_.default.object,projectId:_.default.string}),y=g))||y;t.default=P},68:function(e,t,a){"use strict";var r=a(520),n=a(72),l=a(262),u=a(143),o=a(522),c={0:"admin",10:"owner",20:"dev",30:"guest",40:"member"},i={manageUserlist:"admin",changeMemberRole:"owner",editInterface:"dev",viewPrivateInterface:"guest",viewGroup:"guest"};function s(e){return e?(e+="").replace(/(^\s*)|(\s*$)/g,""):e}t.isJson=function(e){if(!e)return!1;try{return e=JSON.parse(e)}catch(e){return!1}},t.safeArray=function(e){return Array.isArray(e)?e:[]},t.json5_parse=function(e){try{return u.parse(e)}catch(t){return e}},t.json_parse=function(e){try{return JSON.parse(e)}catch(t){return e}},t.deepCopyJson=function(e){return JSON.parse(JSON.stringify(e))},t.isJson5=function(e){if(!e)return!1;try{return e=u.parse(e)}catch(e){return!1}},t.checkAuth=function(e,t){return c[i[e]]<=c[t]},t.formatTime=function(e){return r.unix(e).format("YYYY-MM-DD HH:mm:ss")},t.debounce=function(e,t){var a;return function(){clearTimeout(a),a=setTimeout(e,t)}},t.pickRandomProperty=function(e){var t,a=0;for(var r in e)Math.random()<1/++a&&(t=r);return t},t.getImgPath=function(e,t){var a=window.devicePixelRatio>=2?2:1;return"".concat(e,"@").concat(a,"x.").concat(t)},t.trim=s,t.handlePath=function(e){return(e=s(e))?"/"===e?"":e="/"===(e="/"!==e[0]?"/"+e:e)[e.length-1]?e.substr(0,e.length-1):e:e},t.handleApiPath=function(e){return e?e="/"!==(e=s(e))[0]?"/"+e:e:""},t.nameLengthLimit=function(e){return[{required:!0,validator:function(t,a,r){var l=a?function(e){for(var t=0,a=0;a<e.length;a++)e.charCodeAt(a)>255?t+=2:t++;return t}(a):0;if(l>n.NAME_LIMIT)r("请输入"+e+"名称，长度不超过"+n.NAME_LIMIT+"字符(中文算作2字符)!");else{if(0!==l)return r();r("请输入"+e+"名称，长度不超过"+n.NAME_LIMIT+"字符(中文算作2字符)!")}}}]},t.htmlFilter=function(e){return e.replace(/<\/?.+?\/?>/g,"")||"新项目"},t.entries=function(e){var t=[];for(var a in e)t.push([a,e[a]]);return t},t.getMockText=function(e){try{return JSON.stringify(l.mock(o(u.parse(e),{})),null,"  ")}catch(e){return""}},t.safeAssign=function(e,t){var a=Object.keys(t);return Object.keys(e).reduce((function(r,n){return a.indexOf(n)>=0?r[n]=t[n]:r[n]=e[n],r}),{})},t.arrayChangeIndex=function(e,t,a){var r=[].concat(e),n=r[t];r.splice(t,1),r.splice(a,0,n);var l=[];return r.forEach((function(e,t){l.push({id:e._id,index:t})})),l}},690:function(e,t,a){"use strict";var r=a(3);a(691);var n=r(a(1635));a(700),a(701),a(702),a(141);var l=r(a(1)),u=r(a(17)),o=r(a(1224)),c=a(22),i=r(a(1615)),s=r(a(1625)),d=(0,i.default)();u.default.render(l.default.createElement(c.Provider,{store:d},l.default.createElement(n.default,{locale:s.default},l.default.createElement(o.default,null))),document.getElementById("yapi"))},699:function(e,t,a){var r={"./zh-cn":448,"./zh-cn.js":448};function n(e){var t=l(e);return a(t)}function l(e){if(!a.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}n.keys=function(){return Object.keys(r)},n.resolve=l,e.exports=n,n.id=699},700:function(e,t,a){},701:function(e,t,a){},702:function(e,t,a){},703:function(e,t,a){"use strict";e.exports={"import-postman":{module:a(704),options:null},"import-har":{module:a(828),options:null},"advanced-mock":{module:a(829),options:null},"import-swagger":{module:a(1017),options:null},statistics:{module:a(1137),options:null},"export-data":{module:a(1211),options:null},"gen-services":{module:a(1212),options:null},"import-yapi-json":{module:a(1215),options:null},wiki:{module:a(1216),options:null}}},704:function(e,t,a){"use strict";var r=a(3),n=r(a(7));a(38);var l=r(a(39)),u=r(a(174)),o=r(a(79)),c=a(160),i=a(359);function s(e){var t=[];function a(e){var t={},a=[];for(var r in e)t[e[r].url+"-"+e[r].method+"-"+e[r].method]||(a.push(e[r]),t[e[r].url+"-"+e[r].method+"-"+e[r].method]=!0);return a}function r(e){var t=[];if(e&&e.length)for(var a in e)t.push({name:e[a].key,desc:e[a].description,value:e[a].value,required:e[a].enabled?"1":"0"});return t}function s(e){var t=[];if(e&&e.length)for(var a in e)t.push({name:e[a].key,desc:e[a].description,value:e[a].value,required:e[a].enabled?"1":"0"});return t}function d(e){var t=[];if(e&&e.length)for(var a in e)t.push({name:e[a].key,value:e[a].value,type:e[a].type,required:e[a].enabled?"1":"0",desc:e[a].description});return t}function f(e){var t;return e=(t=e,u.default.parse(t)).pathname,(e=decodeURIComponent(e))?("/"!=(e=e.replace(/\{\{.*\}\}/g,""))[0]&&(e="/"+e),e):""}function p(e,a){var n={title:"name",path:"url",method:"method",desc:"description",req_query:"queryParams",req_headers:"headerData",req_params:"",req_body_type:"dataMode",req_body_form:"data",req_body_other:"rawModeData",res_body:"text",res_body_type:"language"};a=a||["title","path","catname","method","desc","req_query","req_headers","req_body_type","req_body_form","req_body_other","res"];var u={};try{for(var c in a)if("req_query"===(c=a[c]))u[c]=r.bind(this)(e[n[c]]);else if("req_headers"===c)u[c]=s.bind(this)(e[n[c]]);else if("req_body_form"===c)u[c]=d.bind(this)(e[n[c]]);else if("req_body_type"===c)"urlencoded"===e[n[c]]||"params"===e[n[c]]?u[c]="form":o.default.isString(e.headers)&&e.headers.indexOf("application/json")>-1?u[c]="json":u[c]="raw";else if("req_body_other"===c)o.default.isString(e.headers)&&e.headers.indexOf("application/json")>-1?(u.req_body_is_json_schema=!0,u[c]=h(e[n[c]])):u[c]=e[n[c]];else if("path"===c){if(u[c]=f.bind(this)(e[n[c]]),u[c]&&u[c].indexOf("/:")>-1){var i=u[c].substr(u[c].indexOf("/:")+2).split("/:"),p=[];for(var y in i)p.push({name:i[y],desc:""});u.req_params=p}}else if("title"===c){var v=f.bind(this)(e[n.path]);e[n[c]].indexOf(v)>-1?(u[c]=v,u[c]&&u[c].indexOf("/:")>-1&&(u[c]=u[c].substr(0,u[c].indexOf("/:")))):u[c]=e[n[c]]}else if("catname"===c){var g=t.filter((function(t){return t.id===e.folder}));u[c]=g&&Array.isArray(g)&&g.length>0?g[0].name:null}else if("res"===c){var b=m(e.responses);b&&(u.res_body=b.res_body,u.res_body_type=b.res_body_type)}else u[c]=e[n[c]]}catch(e){console.log(e.message),l.default.error("".concat(e.message,", 导入的postman格式有误"))}return u}var m=function(e){if(e&&e.length){var t=e[0],a={};return a.res_body_type="json"===t.language?"json":"raw","json"===t.language?(a.res_body_is_json_schema=!0,a.res_body=h(t.text)):a.res_body=t.text,a}return null},h=function(e){e=e||{};var t=(0,c.json_parse)(e);return t=i(t),JSON.stringify(t)};if(!e||"object"!==(0,n.default)(e))return console.error("obj参数必需是一个对象"),null;e.postman={name:"Postman",run:function(e){try{var r=(e=JSON.parse(e)).requests,n={apis:[],cats:[]};if(r=a.bind(this)(r),e.folders&&Array.isArray(e.folders)&&e.folders.forEach((function(e){n.cats.push({name:e.name,desc:e.description})})),o.default.find(e.folders,(function(t){return t.collectionId===e.id}))&&(t=e.folders),r&&r.length)for(var u in r){var c=p.bind(this)(r[u]);n.apis.push(c)}return n}catch(e){l.default.error("文件格式必须为JSON")}},desc:"注意：只支持json格式数据"}}e.exports=function(){this.bindHook("import_data",s)}},72:function(e,t,a){"use strict";e.exports={PAGE_LIMIT:10,NAME_LIMIT:100,INTERFACE_STATUS:{undone:{color:"#ff561b",label:"未完成"},done:{color:"#57cf27",label:"已完成"},invalid:{color:"#413936",label:"废弃"}},HTTP_METHOD:{GET:{request_body:!1,default_tab:"query"},POST:{request_body:!0,default_tab:"body"},PUT:{request_body:!0,default_tab:"body"},DELETE:{request_body:!0,default_tab:"body"},HEAD:{request_body:!1,default_tab:"query"},OPTIONS:{request_body:!1,default_tab:"query"},PATCH:{request_body:!0,default_tab:"body"}},PROJECT_COLOR:{blue:"#2395f1",green:"#00a854",yellow:"#ffbf00",red:"#f56a00",pink:"#f5317f",cyan:"#00a2ae",gray:"#bfbfbf",purple:"#7265e6"},PROJECT_ICON:["car","code-o","swap","clock-circle-o","unlock","calendar","play-circle-o","file-text","desktop","hdd","appstore-o","line-chart","mail","mobile","notification","picture","poweroff","search","setting","share-alt","shopping-cart","tag-o","video-camera","cloud-o","star-o","environment-o","camera-o","team","customer-service","pay-circle-o","rocket","database","tool","wifi","idcard","medicine-box","coffee","safety","global","api","fork","android-o","apple-o"],HTTP_REQUEST_HEADER:["Accept","Accept-Charset","Accept-Encoding","Accept-Language","Accept-Datetime","Authorization","Cache-Control","Connection","Cookie","Content-Disposition","Content-Length","Content-MD5","Content-Type","Date","Expect","From","Host","If-Match","If-Modified-Since","If-None-Match","If-Range","If-Unmodified-Since","Max-Forwards","Origin","Pragma","Proxy-Authorization","Range","Referer","TE","User-Agent","Upgrade","Via","Warning","X-Requested-With","DNT","X-Forwarded-For","X-Forwarded-Host","X-Forwarded-Proto","Front-End-Https","X-Http-Method-Override","X-ATT-DeviceId","X-Wap-Profile","Proxy-Connection","X-UIDH","X-Csrf-Token"],METHOD_COLOR:{post:{bac:"#d2eafb",color:"#108ee9"},get:{bac:"#cfefdf",color:"#00a854"},put:{bac:"#fff3cf",color:"#ffbf00"},delete:{bac:"#fcdbd9",color:"#f04134"},head:{bac:"#fff3cf",color:"#ffbf00"},patch:{bac:"#fff3cf",color:"#ffbf00"},options:{bac:"#fff3cf",color:"#ffbf00"}},MOCK_SOURCE:[{name:"字符串",mock:"@string"},{name:"自然数",mock:"@natural"},{name:"浮点数",mock:"@float"},{name:"字符",mock:"@character"},{name:"布尔",mock:"@boolean"},{name:"url",mock:"@url"},{name:"域名",mock:"@domain"},{name:"ip地址",mock:"@ip"},{name:"id",mock:"@id"},{name:"guid",mock:"@guid"},{name:"当前时间",mock:"@now"},{name:"时间戳",mock:"@timestamp"},{name:"日期",mock:"@date"},{name:"时间",mock:"@time"},{name:"日期时间",mock:"@datetime"},{name:"图片连接",mock:"@image"},{name:"图片data",mock:"@imageData"},{name:"颜色",mock:"@color"},{name:"颜色hex",mock:"@hex"},{name:"颜色rgba",mock:"@rgba"},{name:"颜色rgb",mock:"@rgb"},{name:"颜色hsl",mock:"@hsl"},{name:"整数",mock:"@integer"},{name:"email",mock:"@email"},{name:"大段文本",mock:"@paragraph"},{name:"句子",mock:"@sentence"},{name:"单词",mock:"@word"},{name:"大段中文文本",mock:"@cparagraph"},{name:"中文标题",mock:"@ctitle"},{name:"标题",mock:"@title"},{name:"姓名",mock:"@name"},{name:"中文姓名",mock:"@cname"},{name:"中文姓",mock:"@cfirst"},{name:"中文名",mock:"@clast"},{name:"英文姓",mock:"@first"},{name:"英文名",mock:"@last"},{name:"中文句子",mock:"@csentence"},{name:"中文词组",mock:"@cword"},{name:"地址",mock:"@region"},{name:"省份",mock:"@province"},{name:"城市",mock:"@city"},{name:"地区",mock:"@county"},{name:"转换为大写",mock:"@upper"},{name:"转换为小写",mock:"@lower"},{name:"挑选（枚举）",mock:"@pick"},{name:"打乱数组",mock:"@shuffle"},{name:"协议",mock:"@protocol"}],IP_REGEXP:/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])(\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])){3}$/,docHref:{adv_mock_case:"https://hellosean1025.github.io/yapi/documents/mock.html",adv_mock_script:"https://hellosean1025.github.io/yapi/documents/adv_mock.html"}}},75:function(e,t,a){"use strict";var r=a(3);Object.defineProperty(t,"__esModule",{value:!0}),t.addMember=function(e){return{type:"yapi/project/ADD_PROJECT_MEMBER",payload:o.default.post("/api/project/add_member",e)}},t.addProject=function(e){var t=e.name,a=e.prd_host,r=e.basepath,n=e.desc,l=e.group_id,u=e.group_name,c=e.protocol,s=e.icon,d=e.color,p=e.project_type,m={name:t=(0,i.htmlFilter)(t),prd_host:a,protocol:c,basepath:r,desc:n,group_id:l,group_name:u,icon:s,color:d,project_type:p};return{type:f,payload:o.default.post("/api/project/add",m)}},t.changeMemberEmailNotice=function(e){return{type:"yapi/project/CHANGE_MEMBER_EMAIL_NOTICE",payload:o.default.post("/api/project/change_member_email_notice",e)}},t.changeMemberRole=function(e){return{type:"yapi/project/CHANGE_PROJECT_MEMBER",payload:o.default.post("/api/project/change_member_role",e)}},t.checkProjectName=function(e,t){return j.apply(this,arguments)},t.copyProjectMsg=function(e){return{type:"yapi/project/COPY_PROJECT_MSG",payload:o.default.post("/api/project/copy",e)}},t.default=void 0,t.delMember=function(e){return{type:"yapi/project/DEL_PROJECT_MEMBER",payload:o.default.post("/api/project/del_member",e)}},t.delProject=function(e){var t={id:e};return{type:p,payload:o.default.post("/api/project/del",t)}},t.fetchProjectList=function(e,t){return{type:"yapi/project/FETCH_PROJECT_LIST",payload:o.default.get("/api/project/list",{params:{group_id:e,page:t||1,limit:c.default.PAGE_LIMIT}})}},t.getEnv=function(e){return{type:"yapi/project/PROJECT_GET_ENV",payload:o.default.get("/api/project/get_env",{params:{project_id:e}})}},t.getProject=function(e){return E.apply(this,arguments)},t.getProjectMemberList=function(e){return{type:"yapi/project/GET_PEOJECT_MEMBER",payload:o.default.get("/api/project/get_member_list",{params:{id:e}})}},t.getToken=function(e){return _.apply(this,arguments)},t.handleSwaggerUrlData=function(e){return w.apply(this,arguments)},t.updateEnv=function(e){var t=e.env,a={id:e._id,env:t};return{type:"yapi/project/PROJECT_UPDATE_ENV",payload:o.default.post("/api/project/up_env",a)}},t.updateProject=function(e){var t=e.name,a=e.project_type,r=e.basepath,n=e.desc,l=e._id,u=e.env,c=e.group_id,s=e.switch_notice,d=e.strice,f=e.is_json5,p=e.tag,m={name:t=(0,i.htmlFilter)(t),project_type:a,basepath:r,switch_notice:s,desc:n,id:l,env:u,group_id:c,strice:d,is_json5:f,tag:p};return{type:"yapi/project/PROJECT_UPDATE",payload:o.default.post("/api/project/up",m)}},t.updateProjectMock=function(e){return{type:"yapi/project/PROJECT_UPDATE",payload:o.default.post("/api/project/up",e)}},t.updateProjectScript=function(e){return{type:"yapi/project/PROJECT_UPDATE",payload:o.default.post("/api/project/up",e)}},t.updateToken=function(e){return k.apply(this,arguments)},t.upsetProject=function(e){return{type:"yapi/project/PROJECT_UPSET",payload:o.default.post("/api/project/upset",e)}};var n=r(a(30)),l=r(a(31)),u=r(a(5)),o=r(a(44)),c=r(a(72)),i=a(68);function s(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function d(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?s(Object(a),!0).forEach((function(t){(0,u.default)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):s(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var f="yapi/project/PROJECT_ADD",p="yapi/project/PROJECT_DEL",m="yapi/project/GET_CURR_PROJECT",h="yapi/project/GET_TOKEN",y="yapi/project/UPDATE_TOKEN",v="yapi/project/CHECK_PROJECT_NAME",g="yapi/project/GET_SWAGGER_URL_DATA",b={isUpdateModalShow:!1,handleUpdateIndex:-1,projectList:[],projectMsg:{},userInfo:{},tableLoading:!0,total:0,currPage:1,token:"",currProject:{},projectEnv:{env:[{header:[]}]},swaggerUrlData:""};function E(){return(E=(0,l.default)(n.default.mark((function e(t){var a;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.default.get("/api/project/get?id="+t);case 2:return a=e.sent,e.abrupt("return",{type:m,payload:a});case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _(){return(_=(0,l.default)(n.default.mark((function e(t){return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{type:h,payload:o.default.get("/api/project/token",{params:{project_id:t}})});case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function k(){return(k=(0,l.default)(n.default.mark((function e(t){return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{type:y,payload:o.default.get("/api/project/update_token",{params:{project_id:t}})});case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function j(){return(j=(0,l.default)(n.default.mark((function e(t,a){return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{type:v,payload:o.default.get("/api/project/check_project_name",{params:{name:t,group_id:a}})});case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function w(){return(w=(0,l.default)(n.default.mark((function e(t){return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{type:g,payload:o.default.get("/api/project/swagger_url?url="+encodeURI(encodeURI(t)))});case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:b,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case m:return d(d({},e),{},{currProject:t.payload.data.data});case"yapi/project/FETCH_PROJECT_LIST":return d(d({},e),{},{projectList:t.payload.data.data.list,total:t.payload.data.data.total,userInfo:t.payload.data.data.userinfo});case f:case p:return e;case h:return d(d({},e),{},{token:t.payload.data.data});case"yapi/project/PROJECT_GET_ENV":return d(d({},e),{},{projectEnv:t.payload.data.data});case y:return d(d({},e),{},{token:t.payload.data.data.token});case v:case"yapi/project/COPY_PROJECT_MSG":return d({},e);case g:return d(d({},e),{},{swaggerUrlData:t.payload.data.data});default:return e}}},828:function(e,t,a){"use strict";var r=a(3);a(38);var n=r(a(39)),l=r(a(7)),u=r(a(174)),o=a(160),c=a(359),i=function(e){e=e||{};var t=(0,o.json_parse)(e);return t=c(t),JSON.stringify(t)};function s(e){function t(e){var t={},a=[];for(var r in e){var n=e[r].request.url+"|"+e[r].request.method;t[n]||(a.push(e[r]),t[n]=!0)}return a}function a(e){var t=[];if(e&&e.length)for(var a in e)t.push({name:e[a].name,value:e[a].value});return t}function r(e){var t=[];if(e&&"object"===(0,l.default)(e))for(var a in e)t.push({name:e[a].name,value:e[a].value,type:"text"});return t}function c(e){var t;return e=(t=e,u.default.parse(t)).pathname,(e=decodeURIComponent(e))?("/"!=(e=e.replace(/{{\w*}}/g,""))[0]&&(e="/"+e),e):""}function s(e,t){var n={title:"url",path:"url",method:"method",desc:"description",req_query:"queryString",req_body_form:"params",req_body_other:"text"};t=t||["title","path","method","req_query","req_body_type","req_body_form","req_body_other","res_body_type","res_body","req_headers"];var l,u={},s="json";for(var d in e.request.headers.forEach((function(e){if(!e||!e.name||!e.value)return null;/content-type/i.test(e.name)&&0===e.value.indexOf("application/json")?(s="json",l="application/json"):/content-type/i.test(e.name)&&0===e.value.indexOf("application/x-www-form-urlencoded")?(l="application/x-www-form-urlencoded",s="form"):/content-type/i.test(e.name)&&0===e.value.indexOf("multipart/form-data")&&(l="multipart/form-data",s="form")})),t)if("req_query"===(d=t[d]))u[d]=a.bind(this)(e.request[n[d]]);else if("req_body_form"===d&&"form"===s&&e.request.postData)"application/x-www-form-urlencoded"===l?u[d]=r.bind(this)(e.request.postData[n[d]]):"multipart/form-data"===l&&(u[d]=[]);else if("req_body_other"===d&&"json"===s&&e.request.postData)u.req_body_is_json_schema=!0,u[d]=i(e.request.postData.text);else if("req_headers"===d)u[d]=[{name:"Content-Type",value:l}];else if("req_body_type"===d)u[d]=s;else if("path"===d)u[d]=c.bind(this)(e.request[n[d]]);else if("title"===d){var f=c.bind(this)(e.request[n.path]);e.request[n[d]].indexOf(f)>-1?(u[d]=f,u[d]&&u[d].indexOf("/:")>-1&&(u[d]=u[d].substr(0,u[d].indexOf("/:")))):u[d]=e.request[n[d]]}else"res_body_type"===d?u[d]="json":"res_body"===d?(u.res_body_is_json_schema=!0,e.response.content.encoding&&"base64"==e.response.content.encoding?u[d]=i((0,o.unbase64)(e.response.content.text)):u[d]=i(e.response.content.text)):u[d]=e.request[n[d]];return u}if(!e||"object"!==(0,l.default)(e))return console.error("obj参数必需是一个对象"),null;e.har={name:"HAR",run:function(e){try{e=(e=(e=JSON.parse(e)).log.entries).filter((function(e){return!!e&&0===e.response.content.mimeType.indexOf("application/json")}));var a={apis:[]};if((e=t.bind(this)(e))&&e.length)for(var r in e){var l=s.bind(this)(e[r]);a.apis.push(l)}return a}catch(e){console.error(e),n.default.error("数据格式有误")}},desc:"使用chrome录制请求功能，具体使用请查看文档"}}e.exports=function(){this.bindHook("import_data",s)}},829:function(e,t,a){"use strict";var r=a(3),n=r(a(830)),l=r(a(1016));e.exports=function(){this.bindHook("interface_tab",(function(e){e.advMock={name:"高级Mock",component:n.default}})),this.bindHook("add_reducer",(function(e){e.mockCol=l.default}))}},830:function(e,t,a){"use strict";var r=a(3),n=a(7),l=r(a(30));a(33);var u=r(a(25)),o=r(a(58));a(134);var c=r(a(135));a(55);var i=r(a(45));a(36);var s=r(a(4));a(162);var d=r(a(127)),f=r(a(31));a(38);var p=r(a(39)),m=r(a(9)),h=r(a(10)),y=r(a(23)),v=r(a(11)),g=r(a(12)),b=r(a(13)),E=r(a(5));a(82);var _=r(a(84)),k=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=N(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),j=r(a(44)),w=r(a(0)),O=a(40),C=r(a(933)),x=r(a(373)),P=r(a(72));function N(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(N=function(e){return e?a:t})(e)}function M(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,b.default)(e);if(t){var n=(0,b.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,g.default)(this,a)}}var S=_.default.Item,I=function(e){(0,v.default)(r,e);var t,a=M(r);function r(e){var t;return(0,m.default)(this,r),t=a.call(this,e),(0,E.default)((0,y.default)(t),"handleSubmit",(function(e){e.preventDefault();var a={project_id:t.props.match.params.id,interface_id:t.props.match.params.actionId,mock_script:t.state.mock_script,enable:t.state.enable};j.default.post("/api/plugin/advmock/save",a).then((function(e){0===e.data.errcode?p.default.success("保存成功"):p.default.error(e.data.errmsg)}))})),(0,E.default)((0,y.default)(t),"onChange",(function(e){t.setState({enable:e})})),(0,E.default)((0,y.default)(t),"handleTapChange",(function(e){t.setState({tab:e.target.value})})),t.state={enable:!1,mock_script:"",tab:"case"},t}return(0,h.default)(r,[{key:"componentWillMount",value:function(){this.getAdvMockData()}},{key:"getAdvMockData",value:(t=(0,f.default)(l.default.mark((function e(){var t,a,r,n;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.props.match.params.actionId,e.next=3,j.default.get("/api/plugin/advmock/get?interface_id="+t);case 3:0===(a=e.sent).data.errcode&&(r=a.data.data,this.setState({enable:r.enable,mock_script:r.mock_script})),n=this,(0,x.default)({container:"mock-script",data:n.state.mock_script,onChange:function(e){n.setState({mock_script:e.text})}});case 7:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"render",value:function(){var e={labelCol:{sm:{span:4}},wrapperCol:{sm:{span:16}}},t={wrapperCol:{sm:{span:16,offset:11}}},a=this.state.tab,r="case"===a;return k.default.createElement("div",{style:{padding:"20px 10px"}},k.default.createElement("div",{style:{textAlign:"center",marginBottom:20}},k.default.createElement(d.default.Group,{value:a,size:"large",onChange:this.handleTapChange},k.default.createElement(d.default.Button,{value:"case"},"期望"),k.default.createElement(d.default.Button,{value:"script"},"脚本"))),k.default.createElement("div",{style:{display:r?"none":""}},k.default.createElement(_.default,{onSubmit:this.handleSubmit},k.default.createElement(S,(0,o.default)({label:k.default.createElement("span",null,"是否开启 ",k.default.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:P.default.docHref.adv_mock_script},k.default.createElement(i.default,{title:"点击查看文档"},k.default.createElement(s.default,{type:"question-circle-o"}))))},e),k.default.createElement(c.default,{checked:this.state.enable,onChange:this.onChange,checkedChildren:"开",unCheckedChildren:"关"})),k.default.createElement(S,(0,o.default)({label:"Mock脚本"},e),k.default.createElement("div",{id:"mock-script",style:{minHeight:"500px"}})),k.default.createElement(S,t,k.default.createElement(u.default,{type:"primary",htmlType:"submit"},"保存")))),k.default.createElement("div",{style:{display:r?"":"none"}},k.default.createElement(C.default,null)))}}]),r}(k.Component);(0,E.default)(I,"propTypes",{form:w.default.object,match:w.default.object}),e.exports=_.default.create()((0,O.withRouter)(I))},933:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(30));a(123);var u=r(a(126));a(55);var o=r(a(45));a(36);var c=r(a(4));a(230);var i=r(a(231));a(33);var s=r(a(25));a(38);var d,f,p,m=r(a(39)),h=r(a(31)),y=r(a(9)),v=r(a(10)),g=r(a(23)),b=r(a(11)),E=r(a(12)),_=r(a(13)),k=r(a(5)),j=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=D(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),w=a(22),O=r(a(44)),C=r(a(0)),x=a(40),P=a(990),N=a(68),M=r(a(72)),S=r(a(992)),I=a(68),R=r(a(79));function D(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(D=function(e){return e?a:t})(e)}function T(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function q(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?T(Object(a),!0).forEach((function(t){(0,k.default)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):T(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function L(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,_.default)(e);if(t){var n=(0,_.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,E.default)(this,a)}}var A=(0,w.connect)((function(e){return{list:e.mockCol.list,currInterface:e.inter.curdata,currProject:e.project.currProject}}),{fetchMockCol:P.fetchMockCol})(d=(0,x.withRouter)((p=f=function(e){(0,b.default)(a,e);var t=L(a);function a(e){var r;return(0,y.default)(this,a),r=t.call(this,e),(0,k.default)((0,g.default)(r),"state",{caseData:{},caseDesModalVisible:!1,isAdd:!1}),(0,k.default)((0,g.default)(r),"openModal",(function(e,t){return(0,h.default)(l.default.mark((function a(){var n,u;return l.default.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(!r.props.currInterface.res_body_is_json_schema||!t){a.next=5;break}return a.next=3,O.default.post("/api/interface/schema2json",{schema:(0,I.json5_parse)(r.props.currInterface.res_body),required:!0});case 3:n=a.sent,e.res_body=JSON.stringify(n.data);case 5:if(!r.props.currInterface.req_body_is_json_schema){a.next=10;break}return a.next=8,O.default.post("/api/interface/schema2json",{schema:(0,I.json5_parse)(r.props.currInterface.req_body_other),required:!0});case 8:u=a.sent,e.req_body_other=JSON.stringify(u.data);case 10:r.setState({isAdd:t,caseDesModalVisible:!0,caseData:e});case 11:case"end":return a.stop()}}),a)})))})),(0,k.default)((0,g.default)(r),"handleOk",function(){var e=(0,h.default)(l.default.mark((function e(t){var a,n,u;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return",null);case 2:return a=r.state.caseData,n=r.props.match.params.actionId,u=r.props.match.params.id,t=Object.assign(q(q({},t),{},{interface_id:n,project_id:u})),r.state.isAdd||(t.id=a._id),e.next=9,O.default.post("/api/plugin/advmock/case/save",t).then(function(){var e=(0,h.default)(l.default.mark((function e(t){return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==t.data.errcode){e.next=7;break}return m.default.success(r.state.isAdd?"添加成功":"保存成功"),e.next=4,r.props.fetchMockCol(n);case 4:r.setState({caseDesModalVisible:!1}),e.next=8;break;case 7:m.default.error(t.data.errmsg);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),(0,k.default)((0,g.default)(r),"deleteCase",function(){var e=(0,h.default)(l.default.mark((function e(t){var a;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=r.props.match.params.actionId,e.next=3,O.default.post("/api/plugin/advmock/case/del",{id:t}).then(function(){var e=(0,h.default)(l.default.mark((function e(t){return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==t.data.errcode){e.next=6;break}return m.default.success("删除成功"),e.next=4,r.props.fetchMockCol(a);case 4:e.next=7;break;case 6:m.default.error(t.data.errmsg);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),(0,k.default)((0,g.default)(r),"openMockCase",function(){var e=(0,h.default)(l.default.mark((function e(t){var a,n,u=arguments;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=!(u.length>1&&void 0!==u[1])||u[1],n=r.props.match.params.actionId,e.next=4,O.default.post("/api/plugin/advmock/case/hide",{id:t,enable:!a}).then(function(){var e=(0,h.default)(l.default.mark((function e(t){return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==t.data.errcode){e.next=6;break}return m.default.success("修改成功"),e.next=4,r.props.fetchMockCol(n);case 4:e.next=7;break;case 6:m.default.error(t.data.errmsg);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),r}return(0,v.default)(a,[{key:"componentWillMount",value:function(){var e=this.props.match.params.actionId;this.props.fetchMockCol(e)}},{key:"render",value:function(){var e=this,t=this.props,a=t.list,r=t.currInterface,n=this.state,l=n.isAdd,d=n.caseData,f=n.caseDesModalVisible,p="guest"===this.props.currProject.role,m={ip:"",ip_enable:!1,name:r.title,code:"200",delay:0,headers:[{name:"",value:""}],params:{},res_body:r.res_body},h={},y={};R.default.isArray(a)&&a.forEach((function(e){h[e.ip_enable?e.ip:""]="",y[e.username]=""}));var v=[{title:"期望名称",dataIndex:"name",key:"name"},{title:"ip",dataIndex:"ip",key:"ip",render:function(e,t){return t.ip_enable||(e=""),e},onFilter:function(e,t){return t.ip===e&&t.ip_enable||"无过滤"===e&&!t.ip_enable},filters:Object.keys(Object.assign(h)).map((function(e){return e||(e="无过滤"),{text:e,value:e}}))},{title:"创建人",dataIndex:"username",key:"username",onFilter:function(e,t){return t.username===e},filters:Object.keys(Object.assign(y)).map((function(e){return{text:e,value:e}}))},{title:"编辑时间",dataIndex:"up_time",key:"up_time",render:function(e){return(0,N.formatTime)(e)}},{title:"操作",dataIndex:"_id",key:"_id",render:function(t,a){return!p&&j.default.createElement("div",null,j.default.createElement("span",{style:{marginRight:5}},j.default.createElement(s.default,{size:"small",onClick:e.openModal(a)},"编辑")),j.default.createElement("span",{style:{marginRight:5}},j.default.createElement(i.default,{title:"你确定要删除这条期望?",onConfirm:function(){return e.deleteCase(t)},okText:"确定",cancelText:"取消"},j.default.createElement(s.default,{size:"small",onClick:function(){}},"删除"))),j.default.createElement("span",null,j.default.createElement(s.default,{size:"small",onClick:function(){return e.openMockCase(t,a.case_enable)}},a.case_enable?j.default.createElement("span",null,"已开启"):j.default.createElement("span",null,"未开启"))))}}];return j.default.createElement("div",null,j.default.createElement("div",{style:{marginBottom:8}},j.default.createElement(s.default,{type:"primary",onClick:this.openModal(m,!0),disabled:p},"添加期望"),j.default.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:M.default.docHref.adv_mock_case,style:{marginLeft:8}},j.default.createElement(o.default,{title:"点击查看文档"},j.default.createElement(c.default,{type:"question-circle-o"})))),j.default.createElement(u.default,{columns:v,dataSource:a,pagination:!1,rowKey:"_id"}),f&&j.default.createElement(S.default,{visible:f,isAdd:l,caseData:d,onOk:this.handleOk,onCancel:function(){return e.setState({caseDesModalVisible:!1})},ref:this.saveFormRef}))}}]),a}(j.Component),(0,k.default)(f,"propTypes",{list:C.default.array,currInterface:C.default.object,match:C.default.object,fetchMockCol:C.default.func,currProject:C.default.object}),d=p))||d)||d;t.default=A},990:function(e,t,a){"use strict";var r=a(3);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.fetchMockCol=function(e){return f.apply(this,arguments)};var n=r(a(30)),l=r(a(31)),u=r(a(5)),o=r(a(44));function c(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function i(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?c(Object(a),!0).forEach((function(t){(0,u.default)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):c(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var s="yapi/mockCol/FETCH_MOCK_COL",d={list:[]};function f(){return(f=(0,l.default)(n.default.mark((function e(t){var a;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.default.get("/api/plugin/advmock/case/list?interface_id="+t);case 2:return a=e.sent,e.abrupt("return",{type:s,payload:a.data});case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:d,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case s:return i(i({},e),{},{list:t.payload.data});default:return e}}},991:function(e,t,a){var r={"./zh-cn":521,"./zh-cn.js":521};function n(e){var t=l(e);return a(t)}function l(e){if(!a.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}n.keys=function(){return Object.keys(r)},n.resolve=l,e.exports=n,n.id=991},992:function(e,t,a){"use strict";var r=a(3),n=a(7);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a(53);var l=r(a(54));a(995);var u=r(a(998));a(33);var o=r(a(25));a(134);var c=r(a(135)),i=r(a(58));a(57);var s=r(a(51));a(36);var d=r(a(4));a(48);var f=r(a(47));a(64);var p=r(a(49));a(232);var m=r(a(245));a(38);var h=r(a(39)),y=r(a(7)),v=r(a(9)),g=r(a(10)),b=r(a(23)),E=r(a(11)),_=r(a(12)),k=r(a(13)),j=r(a(5));a(82);var w=r(a(84));a(71);var O=r(a(61)),C=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=L(t);if(a&&a.has(e))return a.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var o=l?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}r.default=e,a&&a.set(e,r);return r}(a(1)),x=r(a(0)),P=a(68),N=r(a(165)),M=r(a(72)),S=a(1014);a(1015);var I,R,D,T=a(22),q=r(a(143));function L(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(L=function(e){return e?a:t})(e)}function A(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function B(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?A(Object(a),!0).forEach((function(t){(0,j.default)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):A(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function W(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=(0,k.default)(e);if(t){var n=(0,k.default)(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return(0,_.default)(this,a)}}var G=O.default.Option,F=w.default.Item,U={labelCol:{span:5},wrapperCol:{span:12}},V={wrapperCol:{span:12,offset:5}},H=(0,T.connect)((function(e){return{currInterface:e.inter.curdata}}))((D=R=function(e){(0,E.default)(a,e);var t=W(a);function a(e){var r;(0,v.default)(this,a),r=t.call(this,e),(0,j.default)((0,b.default)(r),"preProcess",(function(e){try{e=JSON.parse(JSON.stringify(e))}catch(e){console.log(e)}e.params=e.params||{};var t=Object.keys(e.params).length?Object.keys(e.params).map((function(t){return{name:t,value:e.params[t]}})).filter((function(t){return"object"===(0,y.default)(t.value)&&(e.paramsForm="json"),"object"!==(0,y.default)(t.value)})):[{name:"",value:""}],a=e.headers&&e.headers.length?e.headers:[{name:"",value:""}];return e.code=""+e.code,e.params=JSON.stringify(e.params,null,2),e=(0,P.safeAssign)({ip:"",ip_enable:!1,name:"",code:"200",delay:0,headers:[{name:"",value:""}],paramsArr:[{name:"",value:""}],params:{},res_body:"",paramsForm:"form"},B(B({},e),{},{headers:a,paramsArr:t}))})),(0,j.default)((0,b.default)(r),"handleRequestBody",(function(e){r.setState({res_body:e.text})})),(0,j.default)((0,b.default)(r),"handleParams",(function(e){r.setState({params:e.text})})),(0,j.default)((0,b.default)(r),"addValues",(function(e){var t=(0,r.props.form.getFieldValue)(e);t=t.concat({name:"",value:""}),r.setState((0,j.default)({},e,t))})),(0,j.default)((0,b.default)(r),"removeValues",(function(e,t){var a=r.props.form,n=a.setFieldsValue,l=(0,a.getFieldValue)(e);l=l.filter((function(e,a){return t!==a})),n((0,j.default)({},e,l)),r.setState((0,j.default)({},e,l))})),(0,j.default)((0,b.default)(r),"getParamsKey",(function(){var e=r.props.currInterface,t=e.req_query,a=e.req_body_form,n=e.req_body_type,l=e.method,u=e.req_body_other,o=e.req_body_is_json_schema,c=e.req_params,i=[];if(t&&Array.isArray(t)&&t.forEach((function(e){i.push(e.name)})),c&&Array.isArray(c)&&c.forEach((function(e){i.push(e.name)})),M.default.HTTP_METHOD[l.toUpperCase()].request_body&&"form"===n)a&&Array.isArray(a)&&a.forEach((function(e){i.push(e.name)}));else if(M.default.HTTP_METHOD[l.toUpperCase()].request_body&&"json"===n&&u){var s;try{s=o?q.default.parse(r.props.caseData.req_body_other):q.default.parse(u),i=i.concat(Object.keys(s))}catch(e){console.log(e)}}return i})),(0,j.default)((0,b.default)(r),"endProcess",(function(e){var t=[],a={},n=r.state.paramsForm;if(e.headers&&Array.isArray(e.headers)&&e.headers.forEach((function(e){e.name&&t.push({name:e.name,value:e.value})})),e.paramsArr&&Array.isArray(e.paramsArr)&&e.paramsArr.forEach((function(e){e.name&&(a[e.name]=e.value)})),e.headers=t,"form"===n)e.params=a;else try{e.params=q.default.parse(e.params)}catch(e){return console.log(e),h.default.error("请求参数 json 格式有误，请修改"),!1}return delete e.paramsArr,e})),(0,j.default)((0,b.default)(r),"handleOk",(function(){r.props.form.validateFieldsAndScroll((function(e,t){e||(t.res_body=r.state.res_body,t.params=r.state.params,r.props.onOk(r.endProcess(t)))}))}));var n=r.props.caseData;return r.state=r.preProcess(n),r}return(0,g.default)(a,[{key:"render",value:function(){var e=this,t=this.props.form,a=t.getFieldDecorator,r=t.getFieldValue,n=this.props,h=n.isAdd,y=n.visible,v=n.onCancel,g=this.state,b=g.name,E=g.code,_=g.headers,k=g.ip,j=g.ip_enable,x=g.params,P=g.paramsArr,I=g.paramsForm,R=g.res_body,D=g.delay;this.props.form.initialValue;var T,q,L,A;return C.default.createElement(l.default,{title:h?"添加期望":"编辑期望",visible:y,maskClosable:!1,onOk:this.handleOk,width:780,onCancel:function(){return v()},afterClose:function(){return e.setState({paramsForm:"form"})},className:"case-des-modal"},C.default.createElement(w.default,{onSubmit:this.handleOk},C.default.createElement("h2",{className:"sub-title",style:{marginTop:0}},"基本信息"),C.default.createElement(F,(0,i.default)({},U,{label:"期望名称"}),a("name",{initialValue:b,rules:[{required:!0,message:"请输入期望名称！"}]})(C.default.createElement(f.default,{placeholder:"请输入期望名称"}))),C.default.createElement(F,(0,i.default)({},U,{label:"IP 过滤",className:"ip-filter"}),C.default.createElement(p.default,{span:6,className:"ip-switch"},C.default.createElement(F,null,a("ip_enable",{initialValue:j,valuePropName:"checked",rules:[{type:"boolean"}]})(C.default.createElement(c.default,null)))),C.default.createElement(p.default,{span:18},C.default.createElement("div",{style:{display:r("ip_enable")?"":"none"},className:"ip"},C.default.createElement(F,null,a("ip",r("ip_enable")?{initialValue:k,rules:[{pattern:M.default.IP_REGEXP,message:"请填写正确的 IP 地址",required:!0}]}:{})(C.default.createElement(f.default,{placeholder:"请输入过滤的 IP 地址"})))))),C.default.createElement(s.default,{className:"params-form",style:{marginBottom:8}},C.default.createElement(p.default,{span:12,offset:5},C.default.createElement(c.default,{size:"small",checkedChildren:"JSON",unCheckedChildren:"JSON",checked:"json"===I,onChange:function(t){e.setState({paramsForm:t?"json":"form"})}}))),(T=P,q="参数过滤",L=e.getParamsKey(),A="json"===I?"none":"",T.map((function(t,r){return C.default.createElement("div",{key:r,className:"paramsArr",style:{display:A}},C.default.createElement(F,(0,i.default)({},0===r?U:V,{wrapperCol:0===r?{span:19}:{span:19,offset:5},label:r?"":q}),C.default.createElement(s.default,{gutter:8},C.default.createElement(p.default,{span:10},C.default.createElement(F,null,a("paramsArr[".concat(r,"].name"),{initialValue:t.name})(C.default.createElement(m.default,{dataSource:L,placeholder:"参数名称",filterOption:function(e,t){return-1!==t.props.children.toUpperCase().indexOf(e.toUpperCase())}})))),C.default.createElement(p.default,{span:10},C.default.createElement(F,null,a("paramsArr[".concat(r,"].value"),{initialValue:t.value})(C.default.createElement(f.default,{placeholder:"参数值"})))),C.default.createElement(p.default,{span:4},T.length>1?C.default.createElement(d.default,{className:"dynamic-delete-button",type:"minus-circle-o",onClick:function(){return e.removeValues("paramsArr",r)}}):null))))}))),C.default.createElement(F,{wrapperCol:{span:6,offset:5},style:{display:"form"===I?"":"none"}},C.default.createElement(o.default,{size:"default",type:"primary",onClick:function(){return e.addValues("paramsArr")},style:{width:"100%"}},C.default.createElement(d.default,{type:"plus"})," 添加参数")),C.default.createElement(F,(0,i.default)({},U,{wrapperCol:{span:17},label:"参数过滤",style:{display:"form"===I?"none":""}}),C.default.createElement(N.default,{className:"pretty-editor",data:x,onChange:this.handleParams}),C.default.createElement(F,null,a("params","json"===I?{rules:[{validator:this.jsonValidator,message:"请输入正确的 JSON 字符串！"}]}:{})(C.default.createElement(f.default,{style:{display:"none"}})))),C.default.createElement("h2",{className:"sub-title"},"响应"),C.default.createElement(F,(0,i.default)({},U,{required:!0,label:"HTTP Code"}),a("code",{initialValue:E})(C.default.createElement(O.default,{showSearch:!0},S.httpCodes.map((function(e){return C.default.createElement(G,{key:""+e,value:""+e},""+e)}))))),C.default.createElement(F,(0,i.default)({},U,{label:"延时"}),a("delay",{initialValue:D,rules:[{required:!0,message:"请输入延时时间！",type:"integer"}]})(C.default.createElement(u.default,{placeholder:"请输入延时时间",min:0})),C.default.createElement("span",null,"ms")),function(t,r){var n=M.default.HTTP_REQUEST_HEADER;return t.map((function(l,u){return C.default.createElement("div",{key:u,className:"headers"},C.default.createElement(F,(0,i.default)({},0===u?U:V,{wrapperCol:0===u?{span:19}:{span:19,offset:5},label:u?"":r}),C.default.createElement(s.default,{gutter:8},C.default.createElement(p.default,{span:10},C.default.createElement(F,null,a("headers[".concat(u,"].name"),{initialValue:l.name})(C.default.createElement(m.default,{dataSource:n,placeholder:"参数名称",filterOption:function(e,t){return-1!==t.props.children.toUpperCase().indexOf(e.toUpperCase())}})))),C.default.createElement(p.default,{span:10},C.default.createElement(F,null,a("headers[".concat(u,"].value"),{initialValue:l.value})(C.default.createElement(f.default,{placeholder:"参数值"})))),C.default.createElement(p.default,{span:4},t.length>1?C.default.createElement(d.default,{className:"dynamic-delete-button",type:"minus-circle-o",onClick:function(){return e.removeValues("headers",u)}}):null))))}))}(_,"HTTP 头"),C.default.createElement(F,{wrapperCol:{span:6,offset:5}},C.default.createElement(o.default,{size:"default",type:"primary",onClick:function(){return e.addValues("headers")},style:{width:"100%"}},C.default.createElement(d.default,{type:"plus"})," 添加 HTTP 头")),C.default.createElement(F,(0,i.default)({},U,{wrapperCol:{span:17},label:"Body",required:!0}),C.default.createElement(F,null,C.default.createElement(N.default,{className:"pretty-editor",data:R,mode:"json"===this.props.currInterface.res_body_type?null:"text",onChange:this.handleRequestBody})))))}}]),a}(C.Component),(0,j.default)(R,"propTypes",{form:x.default.object,caseData:x.default.object,currInterface:x.default.object,onOk:x.default.func,onCancel:x.default.func,isAdd:x.default.bool,visible:x.default.bool}),I=D))||I,z=w.default.create()(H);t.default=z}},[[690,1,3,6,7,2,4,8,5,9]]]);