1 |
- (window.webpackJsonp=window.webpackJsonp||[]).push([[6],{"./src/module/devCenter/ApiTestPage.jsx":function(e,t,a){"use strict";t.__esModule=!0;var i=m(a("./node_modules/babel-runtime/helpers/jsx.js")),s=m(a("./node_modules/babel-runtime/helpers/classCallCheck.js")),n=m(a("./node_modules/babel-runtime/helpers/possibleConstructorReturn.js")),o=m(a("./node_modules/babel-runtime/helpers/inherits.js")),d=a("./node_modules/react/index.js"),l=(m(d),m(a("./node_modules/prop-types/index.js")),m(a("./node_modules/styled-components/dist/styled-components.browser.esm.js"))),r=m(a("./src/module/devCenter/components/ApiNav.jsx")),p=m(a("./src/module/devCenter/components/ApiDoc.jsx")),u=m(a("./src/containers/toJS.jsx")),c=a("./src/components/index.js"),f=m(a("./src/redux/services/devCenter.js"));function m(e){return e&&e.__esModule?e:{default:e}}var h=l.default.div.withConfig({displayName:"ApiTestPage__ApiTestPageWrapper",componentId:"sc-1banmkk-0"})(["display:flex;flex-flow:row;flex:1 1 auto;"]),v=(0,u.default)(r.default),g=l.default.div.withConfig({displayName:"ApiTestPage__ApiContext",componentId:"sc-1banmkk-1"})(["flex:1;min-height:450px;.swagger-ui{.information-container{display:none;}h4.opblock-tag{display:none;}}"]),b=(0,i.default)(c.LoadingIndicator,{}),x=function(e){function t(a){(0,s.default)(this,t);var i=(0,n.default)(this,e.call(this,a));return i.fetchApiList=function(){i.setState({loadingApiList:!0}),f.default.getServicesApi(i.props.serviceId).then((function(e){var t=_.get(e.data,"[0].apiId");i.setState({apiList:e.data,activeApi:t,loadingApiList:!1}),i.fetchApiJson(t)})).catch((function(){i.setState({loadingApiList:!1})}))},i.fetchApiJson=function(e){i.setState({loadingApiJson:!0}),f.default.getApiJsonInfo(e).then((function(e){i.setState({apiJson:e.data,loadingApiJson:!1})})).catch((function(){i.setState({loadingApiJson:!1})}))},i.handleChangeApi=function(e){i.setState({activeApi:e}),i.fetchApiJson(e)},i.state={activeApi:"",apiList:[],apiJson:{},loadingApiList:!1,loadingApiJson:!1},i}return(0,o.default)(t,e),t.prototype.componentDidMount=function(){this.props.serviceId&&this.fetchApiList()},t.prototype.render=function(){var e=this.state,t=e.activeApi,a=e.apiList,s=e.apiJson,n=e.loadingApiList,o=e.loadingApiJson;return(0,i.default)(h,{},void 0,(0,i.default)(v,{loadingApiList:n,activeApi:t,apiList:a,serviceName:this.props.serviceName,handleChangeApi:this.handleChangeApi}),(0,i.default)(g,{},void 0,o?b:(0,i.default)(p.default,{apiJson:s})))},t}(d.Component);t.default=x},"./src/module/devCenter/DevCenterTabPage.jsx":function(e,t,a){"use strict";t.__esModule=!0;var i=m(a("./node_modules/babel-runtime/helpers/jsx.js")),s=m(a("./node_modules/babel-runtime/helpers/classCallCheck.js")),n=m(a("./node_modules/babel-runtime/helpers/possibleConstructorReturn.js")),o=m(a("./node_modules/babel-runtime/helpers/inherits.js")),d=m(a("./node_modules/antd/es/tabs/index.js"));a("./node_modules/antd/es/tabs/style/index.js");var l=m(a("./node_modules/react/index.js")),r=m(a("./node_modules/lodash/lodash.js")),p=m(a("./node_modules/styled-components/dist/styled-components.browser.esm.js")),u=(m(a("./node_modules/prop-types/index.js")),m(a("./src/module/devCenter/ApiTestPage.jsx"))),c=m(a("./src/module/devCenter/apiDoc/ApiDocPage.jsx")),f=a("./node_modules/react-router-dom/esm/react-router-dom.js");function m(e){return e&&e.__esModule?e:{default:e}}var h=d.default.TabPane,v=p.default.div.withConfig({displayName:"DevCenterTabPage__TabsWrapper",componentId:"sc-1fvk6hz-0"})(["width:100%;position:relative;display:flex;background:#fff;padding-left:16px;.page-title{font-size:24px;color:#1f2d3d;letter-spacing:2px;position:absolute;}.ant-tabs{display:flex;flex:1 auto;flex-direction:column;.ant-tabs-bar{margin:0 0 10px 0;}.ant-tabs-nav-scroll{display:flex;}.ant-tabs-tab{font-size:16px;color:#1f2d3d;letter-spacing:1px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;}.ant-tabs-content{flex:1 auto;}.ant-tabs-tab-disabled{pointer-events:none;color:rgba(0,0,0,0.25);}.ant-tabs-tabpane-active{padding:0;height:100%;}}"]),g=p.default.div.withConfig({displayName:"DevCenterTabPage__TabsDiv",componentId:"sc-1fvk6hz-1"})(["width:100%;height:100%;position:relative;background-color:#ffff;min-height:500px;"]),b=function(e){function t(a){(0,s.default)(this,t);var i=(0,n.default)(this,e.call(this,a));return i.onChange=function(e){i.setState({tab:e})},i.serviceId=r.default.get(a.location,"state.serviceId"),i.serviceName=r.default.get(a.location,"state.serviceName"),i.profile=r.default.get(a.location,"state.profile"),i.state={tab:"api-test"},i}return(0,o.default)(t,e),t.prototype.render=function(){return(0,i.default)(v,{},void 0,(0,i.default)(d.default,{animated:!1,activeKey:this.state.tab,onChange:this.onChange},void 0,(0,i.default)(h,{tab:"API\u6d4b\u8bd5"},"api-test",(0,i.default)(g,{},void 0,(0,i.default)(u.default,{serviceId:this.serviceId,serviceName:this.serviceName,profile:this.profile}))),(0,i.default)(h,{tab:"API\u6587\u6863"},"api-doc",(0,i.default)(g,{style:{padding:16}},void 0,(0,i.default)(c.default,{serviceId:this.serviceId,serviceName:this.serviceName})))))},t}(l.default.Component);t.default=(0,f.withRouter)(b)},"./src/module/devCenter/components/ApiNav.jsx":function(e,t,a){"use strict";t.__esModule=!0,t.default=void 0;var i=c(a("./node_modules/antd/es/tooltip/index.js")),s=c(a("./node_modules/antd/es/tag/index.js")),n=c(a("./node_modules/babel-runtime/helpers/jsx.js")),o=c(a("./node_modules/babel-runtime/helpers/classCallCheck.js")),d=c(a("./node_modules/babel-runtime/helpers/possibleConstructorReturn.js")),l=c(a("./node_modules/babel-runtime/helpers/inherits.js"));a("./node_modules/antd/es/tooltip/style/index.js"),a("./node_modules/antd/es/tag/style/index.js");var r=a("./node_modules/react/index.js"),p=(c(r),c(a("./node_modules/prop-types/index.js")),a("./src/module/devCenter/components/styled.jsx")),u=a("./src/components/index.js");function c(e){return e&&e.__esModule?e:{default:e}}var f={GET:"blue",POST:"green",PUT:"gold",PATCH:"orange",DELETE:"red"},m=(0,n.default)(u.LoadingIndicator,{}),h=function(e){function t(a){(0,o.default)(this,t);var i=(0,d.default)(this,e.call(this,a));return i.state={},i}return(0,l.default)(t,e),t.prototype.render=function(){var e=this.props,t=e.apiList,a=e.activeApi,o=e.handleChangeApi,d=e.loadingApiList;return(0,n.default)(p.ApiNavWrapper,{},void 0,(0,n.default)("div",{className:"navTitle"},void 0,(0,n.default)("span",{},void 0,this.props.serviceName)),(0,n.default)("div",{className:"api-items"},void 0,d?m:(0,n.default)("ul",{},void 0,t.map((function(e){return(0,n.default)("li",{className:"api-item "+(a===e.apiId?"api-item-active":""),"data-id":e.apiId,onClick:function(){return o(e.apiId)}},e.apiId,(0,n.default)("div",{className:"api-title"},void 0,(0,n.default)(s.default,{color:f[_.toUpper(e.httpMethod)]},void 0,_.toUpper(e.httpMethod)),_.isEmpty(_.trim(e.apiDesc))?(0,n.default)("span",{},void 0,e.apiName):(0,n.default)(i.default,{title:_.isEmpty(_.trim(e.apiDesc))?e.apiName:e.apiDesc,placement:"right"},void 0,(0,n.default)("span",{},void 0,e.apiName))),(0,n.default)("div",{className:"api-desc",dangerouslySetInnerHTML:{__html:""+e.path}}))})))))},t}(r.PureComponent);t.default=h}}]);
|