Commit ec0ed47c by 无尘

fix: 修改前端参数

parent 36909478
<!DOCTYPE html><html><head><meta charset=utf-8><link rel="shortcut icon" href=./favicon.ico><title>API网关管理平台</title><link href=./static/css/app.b483df2c7156a20c3df569bcd38e2a20.css rel=stylesheet></head><body style="min-width: 1400px;"><div id=app></div><script src=//web-1251519181.file.myqcloud.com/lib/vue/2.6.6/vue.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vue-router/3.0.2/vue-router.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vuex/3.1.0/vuex.min.js></script><script src=//web-1251519181.file.myqcloud.com/components/img-preview.2.0.00.js></script><script>// Raven.config('https://3715a345910d4c768e7a1ec14619c2d5@sentry.io/1413672').install();</script><script type=text/javascript src=./static/js/manifest.18cacce57efac6028261.js></script><script type=text/javascript src=./static/js/vendor.bb8c036d7dd62f4cb37a.js></script><script type=text/javascript src=./static/js/app.434c40aceca40251eccb.js></script></body></html>
\ No newline at end of file
<!DOCTYPE html><html><head><meta charset=utf-8><link rel="shortcut icon" href=./favicon.ico><title>API网关管理平台</title><link href=./static/css/app.0cf44d6cfb8da510677ff7c353055d18.css rel=stylesheet></head><body style="min-width: 1400px;"><div id=app></div><script src=//web-1251519181.file.myqcloud.com/lib/vue/2.6.6/vue.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vue-router/3.0.2/vue-router.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vuex/3.1.0/vuex.min.js></script><script src=//web-1251519181.file.myqcloud.com/components/img-preview.2.0.00.js></script><script>// Raven.config('https://3715a345910d4c768e7a1ec14619c2d5@sentry.io/1413672').install();</script><script type=text/javascript src=./static/js/manifest.321268b46f7d059da61f.js></script><script type=text/javascript src=./static/js/vendor.bb8c036d7dd62f4cb37a.js></script><script type=text/javascript src=./static/js/app.434c40aceca40251eccb.js></script></body></html>
\ No newline at end of file
webpackJsonp([2],{"1i9K":function(t,e){},"1kTN":function(t,e){},GSUE:function(t,e){},GUiu:function(t,e){},"OF/v":function(t,e){},OSAk:function(t,e){},SldL:function(t,e){!function(e){"use strict";var a,r=Object.prototype,s=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",n=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag",c="object"==typeof t,p=e.regeneratorRuntime;if(p)c&&(t.exports=p);else{(p=e.regeneratorRuntime=c?t.exports:{}).wrap=D;var u="suspendedStart",d="suspendedYield",f="executing",b="completed",y={},h={};h[i]=function(){return this};var m=Object.getPrototypeOf,v=m&&m(m(K([])));v&&v!==r&&s.call(v,i)&&(h=v);var _=w.prototype=k.prototype=Object.create(h);C.prototype=_.constructor=w,w.constructor=C,w[l]=C.displayName="GeneratorFunction",p.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===C||"GeneratorFunction"===(e.displayName||e.name))},p.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l in t||(t[l]="GeneratorFunction")),t.prototype=Object.create(_),t},p.awrap=function(t){return{__await:t}},x(I.prototype),I.prototype[n]=function(){return this},p.AsyncIterator=I,p.async=function(t,e,a,r){var s=new I(D(t,e,a,r));return p.isGeneratorFunction(e)?s:s.next().then(function(t){return t.done?t.value:s.next()})},x(_),_[l]="Generator",_[i]=function(){return this},_.toString=function(){return"[object Generator]"},p.keys=function(t){var e=[];for(var a in t)e.push(a);return e.reverse(),function a(){for(;e.length;){var r=e.pop();if(r in t)return a.value=r,a.done=!1,a}return a.done=!0,a}},p.values=K,F.prototype={constructor:F,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=a,this.done=!1,this.delegate=null,this.method="next",this.arg=a,this.tryEntries.forEach(O),!t)for(var e in this)"t"===e.charAt(0)&&s.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=a)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,s){return n.type="throw",n.arg=t,e.next=r,s&&(e.method="next",e.arg=a),!!s}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],n=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var l=s.call(i,"catchLoc"),c=s.call(i,"finallyLoc");if(l&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var a=this.tryEntries.length-1;a>=0;--a){var r=this.tryEntries[a];if(r.tryLoc<=this.prev&&s.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var a=this.tryEntries[e];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),O(a),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var a=this.tryEntries[e];if(a.tryLoc===t){var r=a.completion;if("throw"===r.type){var s=r.arg;O(a)}return s}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:K(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=a),y}}}function D(t,e,a,r){var s=e&&e.prototype instanceof k?e:k,o=Object.create(s.prototype),i=new F(r||[]);return o._invoke=function(t,e,a){var r=u;return function(s,o){if(r===f)throw new Error("Generator is already running");if(r===b){if("throw"===s)throw o;return S()}for(a.method=s,a.arg=o;;){var i=a.delegate;if(i){var n=T(i,a);if(n){if(n===y)continue;return n}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(r===u)throw r=b,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);r=f;var l=g(t,e,a);if("normal"===l.type){if(r=a.done?b:d,l.arg===y)continue;return{value:l.arg,done:a.done}}"throw"===l.type&&(r=b,a.method="throw",a.arg=l.arg)}}}(t,a,i),o}function g(t,e,a){try{return{type:"normal",arg:t.call(e,a)}}catch(t){return{type:"throw",arg:t}}}function k(){}function C(){}function w(){}function x(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function I(t){var e;this._invoke=function(a,r){function o(){return new Promise(function(e,o){!function e(a,r,o,i){var n=g(t[a],t,r);if("throw"!==n.type){var l=n.arg,c=l.value;return c&&"object"==typeof c&&s.call(c,"__await")?Promise.resolve(c.__await).then(function(t){e("next",t,o,i)},function(t){e("throw",t,o,i)}):Promise.resolve(c).then(function(t){l.value=t,o(l)},i)}i(n.arg)}(a,r,e,o)})}return e=e?e.then(o,o):o()}}function T(t,e){var r=t.iterator[e.method];if(r===a){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=a,T(t,e),"throw"===e.method))return y;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var s=g(r,t.iterator,e.arg);if("throw"===s.type)return e.method="throw",e.arg=s.arg,e.delegate=null,y;var o=s.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=a),e.delegate=null,y):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,y)}function $(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function F(t){this.tryEntries=[{tryLoc:"root"}],t.forEach($,this),this.reset(!0)}function K(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(s.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=a,e.done=!0,e};return o.next=o}}return{next:S}}function S(){return{value:a,done:!0}}}(function(){return this}()||Function("return this")())},TN1V:function(t,e){},U0Ri:function(t,e){},U1k4:function(t,e){},Xxa5:function(t,e,a){t.exports=a("jyFz")},"Yns/":function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=a("319J"),s=a("fZjL"),o=a.n(s),i=a("Xxa5"),n=a.n(i),l=a("mvHQ"),c=a.n(l),p=a("exGp"),u=a.n(p),d=a("Kkt8"),f=a("l46T"),b=a("P9l9"),y=a("TUB1"),h=a("LlAa"),m={name:"create-base",components:{limitTextarea:d.a,limitInput:f.a},data:function(){return{apiInfoData:{interfaceId:"",interfaceVersionId:"",interfaceName:"",target:"1",optType:"get",interfaceUrl:"",interfaceDescribe:""},rules:{interfaceName:[{required:!0,message:"请输入API名称",trigger:"blur"}],interfaceUrl:[{required:!0,message:"请输入请求路径",trigger:"blur"}]}}},methods:{submitForm:function(t){var e=this;e.$refs[t].validate(function(a){if(!a)return!1;e.blurInterfaceUrl(t)})},blurInterfaceUrl:function(t){var e=this,a={update:!!e.$route.query.interfaceId,interfaceUrl:e.apiInfoData.interfaceUrl};Object(b.a)("/gateway-manage/is-exist-interface-url",a).then(function(a){var r=a.data;if("0000"==r.code)return r.result?(y.a.showmsg("接口已存在","warning"),!1):void("baseForm"==t&&(e.$emit("submitNext",e.apiInfoData),e.$store.dispatch("saveBaseInfo",e.apiInfoData)));h.a.errorMsg(r)}).catch(function(t){e.$message.error({duration:1e3,message:t.message})})},handleQuery:function(t,e,a){var r={type:"object",level:1,properties:{}};for(var s in e.frontParams.properties)e.frontParams.properties[s].frontOriginType==a&&this.$set(r.properties,e.frontParams.properties[s].currentKey,e.frontParams.properties[s]);return r},handleBack:function(t,e,a){var r={type:"object",level:1,properties:{}};for(var s in e.endParams.properties)e.endParams.properties[s].backendOriginType==a&&this.$set(r.properties,e.endParams.properties[s].rootKey,e.endParams.properties[s]);return r},handleConst:function(t,e){var a={type:"object",level:1,properties:{}};for(var r in e.endParams.properties)1==e.endParams.properties[r].constFlag&&this.$set(a.properties,e.endParams.properties[r].currentKey,e.endParams.properties[r]);return a},handleFontData:function(t){var e=this;return u()(n.a.mark(function a(){var r,s,o;return n.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return r=e,s=JSON.parse(c()(t)),o={protocol:s.protocol,requestType:s.requestType,frontBodyType:s.frontBodyType||"json",frontParams:{},headerData:{},queryData:{},bodyJsonData:{},bodyFormData:{}},a.next=5,r.handleQuery(o,s,"query");case 5:return o.queryData=a.sent,a.next=8,r.handleQuery(o,s,"header");case 8:if(o.headerData=a.sent,"POST"!=s.requestType||"form"!=s.frontBodyType){a.next=13;break}return a.next=12,r.handleQuery(o,s,"body");case 12:o.bodyFormData=a.sent;case 13:if("POST"!=s.requestType||"json"!=s.frontBodyType){a.next=17;break}return a.next=16,r.handleQuery(o,s,"body");case 16:o.bodyJsonData=a.sent;case 17:r.$store.dispatch("saveFrontInfo",o);case 18:case"end":return a.stop()}},a,e)}))()},handleBackData:function(t){var e=this;return u()(n.a.mark(function a(){var r,s,o;return n.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return r=e,s=JSON.parse(c()(t)),o={interfaceType:String(s.interfaceType),version:s.version,backendHttpPath:s.backendHttpPath||"",dubboInterface:s.dubboInterface||"",dubboMethod:s.dubboMethod||"",dubboVersion:s.dubboVersion||"",proxyCode:s.proxyCode||"",timeout:2e4,backHeaderData:{},backQueryData:{},backBodyJsonData:{},backBodyFormData:{},constData:{}},a.next=5,r.handleQuery(o,s,"query");case 5:return o.backQueryData=a.sent,a.next=8,r.handleQuery(o,s,"header");case 8:if(o.backHeaderData=a.sent,"POST"!=s.requestType||"form"!=s.frontBodyType){a.next=13;break}return a.next=12,r.handleQuery(o,s,"body");case 12:o.backBodyFormData=a.sent;case 13:if("POST"!=s.requestType||"json"!=s.frontBodyType){a.next=17;break}return a.next=16,r.handleQuery(o,s,"body");case 16:o.backBodyJsonData=a.sent;case 17:return a.next=19,r.handleConst(o,s);case 19:o.constData=a.sent,r.$store.dispatch("saveBackInfo",o);case 21:case"end":return a.stop()}},a,e)}))()},handleResultData:function(t){var e=JSON.parse(c()(t)),a={resultParams:e.resultParams,sucReturn:e.sucReturn,errReturn:e.errReturn,errCode:e.errCode};this.$store.dispatch("saveResultInfo",a)},getData:function(){var t=this,e={interfaceId:t.$route.query.interfaceId,interfaceVersionId:t.$route.query.interfaceVersionId};Object(b.a)("/gateway-manage/get-api",e).then(function(e){var a=e.data;if("0000"==a.code)return a.result.frontParams=JSON.parse(a.result.frontParams),a.result.endParams=JSON.parse(a.result.endParams),a.result.errCode=JSON.parse(a.result.errCode),a.result.resultParams=JSON.parse(a.result.resultParams),t.apiInfoData.interfaceId=a.result.interfaceId,t.apiInfoData.interfaceVersionId=a.result.interfaceVersionId,t.apiInfoData.interfaceName=a.result.interfaceName,t.apiInfoData.target=String(a.result.target),t.apiInfoData.optType=a.result.optType,t.apiInfoData.interfaceUrl=a.result.interfaceUrl,t.apiInfoData.interfaceDescribe=a.result.interfaceDescribe,t.handleFontData(a.result),t.handleBackData(a.result),t.handleResultData(a.result),!1;h.a.errorMsg(a)}).catch(function(e){t.$message.error({duration:1e3,message:e.message})})}},mounted:function(){this.$route.query.interfaceId&&!o()(this.$store.state.baseInfo).length&&this.getData(),o()(this.$store.state.baseInfo).length&&(this.apiInfoData=this.$store.state.baseInfo)}},v={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"base-info-show border-box"},[a("el-form",{ref:"baseForm",attrs:{"label-width":"104px",model:t.apiInfoData,rules:t.rules}},[a("el-form-item",{attrs:{label:"API名称:",prop:"interfaceName"}},[a("limitInput",{attrs:{inputWidth:329,inputValue:t.apiInfoData.interfaceName,holder:"请输入API名称",getByType:"word",maxLength:20},on:{"update:inputValue":function(e){t.$set(t.apiInfoData,"interfaceName",e)}}})],1),t._v(" "),a("el-form-item",{attrs:{label:"API类型:",prop:"target"}},[a("el-radio-group",{model:{value:t.apiInfoData.target,callback:function(e){t.$set(t.apiInfoData,"target",e)},expression:"apiInfoData.target"}},[a("el-radio",{attrs:{label:"1"}},[t._v("公开")]),t._v(" "),a("el-radio",{attrs:{label:"0"}},[t._v("私有")])],1)],1),t._v(" "),a("el-form-item",{attrs:{label:"访问类型:",prop:"optType"}},[a("el-select",{attrs:{placeholder:"请选择"},model:{value:t.apiInfoData.optType,callback:function(e){t.$set(t.apiInfoData,"optType",e)},expression:"apiInfoData.optType"}},[a("el-option",{attrs:{label:"list",value:"list"}}),t._v(" "),a("el-option",{attrs:{label:"delete",value:"delete"}}),t._v(" "),a("el-option",{attrs:{label:"update",value:"update"}}),t._v(" "),a("el-option",{attrs:{label:"get",value:"get"}}),t._v(" "),a("el-option",{attrs:{label:"search",value:"search"}})],1)],1),t._v(" "),a("el-form-item",{attrs:{label:"请求路径:",prop:"interfaceUrl"}},[a("el-input",{staticClass:"w-329",on:{blur:t.blurInterfaceUrl},model:{value:t.apiInfoData.interfaceUrl,callback:function(e){t.$set(t.apiInfoData,"interfaceUrl",e)},expression:"apiInfoData.interfaceUrl"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"描述:"}},[a("limit-textarea",{attrs:{inputWidth:500,inputValue:t.apiInfoData.interfaceDescribe,holder:"",getByType:"word",maxLength:100},on:{"update:inputValue":function(e){t.$set(t.apiInfoData,"interfaceDescribe",e)}}})],1),t._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:function(e){t.submitForm("baseForm")}}},[t._v("下一步")])],1)],1)],1)},staticRenderFns:[]};var _=a("VU/8")(m,v,!1,function(t){a("rzMK")},"data-v-3c8acab2",null).exports,D={name:"header-param",props:{itemData:{type:Object,default:function(){return{}}},frontOriginType:{type:String,default:function(){return""}}},data:function(){return{trData:{type:"object",properties:{name:{frontOriginType:this.frontOriginType,type:"string",currentKey:"name",isBackendField:0,defaultVal:"val",isRootKey:0,rootKey:"",objectClass:"",description:"描述",example:"示例",check:!0}}},keyLength:1}},methods:{blurKey:function(t,e){t.currentKey!=e&&(this.$set(this.itemData.properties,t.currentKey,t),this.$delete(this.itemData.properties,e))},handleDel:function(t,e,a){this.$delete(this.itemData.properties,e)},toAddItem:function(){var t=this.keyLength++;this.$set(this.itemData.properties,"field"+t,{frontOriginType:this.frontOriginType,backendOriginType:this.frontOriginType,type:"string",currentKey:"field"+t,isBackendField:0,defaultVal:"val",isRootKey:0,rootKey:"",objectClass:"",description:"描述",example:"示例",check:!0})}},watch:{itemData:function(t,e){this.trData=JSON.parse(c()(t))}},mounted:function(){this.trData=JSON.parse(c()(this.itemData))}},g={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{staticClass:"el-table el-table--fit el-table--enable-row-hover el-table--enable-row-transition",staticStyle:{width:"100%","table-layout":"fixed"}},[t._m(0),t._v(" "),a("div",{staticClass:"el-table__body-wrapper is-scrolling-none"},[a("div",{staticClass:"table-content"},[t._l(t.itemData.properties,function(e,r,s){return[a("table",{key:s+r+121,staticClass:"el-table__body",staticStyle:{width:"100%","table-layout":"fixed"},attrs:{cellspacing:"0",cellpadding:"0",border:"0"}},[a("tbody",[a("tr",{staticClass:"el-table__row"},[a("td",{staticClass:"el-table_1_column_1",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-input",{on:{blur:function(a){t.blurKey(e,r)}},model:{value:e.currentKey,callback:function(a){t.$set(e,"currentKey",a)},expression:"itemValue.currentKey"}})],1)]),t._v(" "),a("td",{staticClass:"el-table_1_column_2",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-select",{attrs:{placeholder:"请选择参数类型"},model:{value:e.type,callback:function(a){t.$set(e,"type",a)},expression:"itemValue.type"}},[a("el-option",{attrs:{label:"string",value:"string"}}),t._v(" "),a("el-option",{attrs:{label:"number",value:"number"}}),t._v(" "),a("el-option",{attrs:{label:"boolean",value:"boolean"}})],1)],1)]),t._v(" "),a("td",{staticClass:"el-table_1_column_3",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-checkbox",{model:{value:e.check,callback:function(a){t.$set(e,"check",a)},expression:"itemValue.check"}})],1)]),t._v(" "),a("td",{staticClass:"el-table_1_column_3",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-input",{model:{value:e.defaultVal,callback:function(a){t.$set(e,"defaultVal",a)},expression:"itemValue.defaultVal"}})],1)]),t._v(" "),a("td",{staticClass:"el-table_1_column_3",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-input",{model:{value:e.example,callback:function(a){t.$set(e,"example",a)},expression:"itemValue.example"}})],1)]),t._v(" "),a("td",{staticClass:"el-table_1_column_3",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-input",{model:{value:e.description,callback:function(a){t.$set(e,"description",a)},expression:"itemValue.description"}})],1)]),t._v(" "),a("td",{staticClass:"el-table_1_column_3",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-button",{attrs:{type:"text"},on:{click:function(a){t.handleDel(e,r,s)}}},[t._v("删除")])],1)])])])])]})],2)])]),t._v(" "),a("div",{staticClass:"add-line text-center",on:{click:t.toAddItem}},[a("i",{staticClass:"el-icon-circle-plus-outline color-5584FF"}),a("span",{staticClass:"color-5584FF font-14 p-l-4"},[t._v("添加行")])])])},staticRenderFns:[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"el-table__header-wrapper"},[a("table",{staticClass:"el-table__header",staticStyle:{width:"100%","table-layout":"fixed"},attrs:{cellspacing:"0",cellpadding:"0",border:"0"}},[a("thead",{staticClass:"has-gutter"},[a("tr",{},[a("th",{staticClass:"el-table_1_column_1 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("参数名")])]),t._v(" "),a("th",{staticClass:"el-table_1_column_2 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("参数类型")])]),t._v(" "),a("th",{staticClass:"el-table_1_column_3 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("必选")])]),t._v(" "),a("th",{staticClass:"el-table_1_column_4 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("默认值")])]),t._v(" "),a("th",{staticClass:"el-table_1_column_5 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("示例")])]),t._v(" "),a("th",{staticClass:"el-table_1_column_6 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("描述")])]),t._v(" "),a("th",{staticClass:"el-table_1_column_7 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("操作")])])])])])])}]};var k=a("VU/8")(D,g,!1,function(t){a("U0Ri")},"data-v-7c30b63f",null).exports,C={name:"body-row",props:{itemData:{type:Object,default:function(){return{}}},frontOriginType:{type:String,default:function(){return""}}},data:function(){return{trData:{},keyLength:1}},methods:{blurKey:function(t,e){t.currentKey!=e&&(this.$set(this.itemData.properties,t.currentKey,t),this.$delete(this.itemData.properties,e))},handleDel:function(t,e,a,r){this.handleDelData(this.itemData,t,e)},handleDelData:function(t,e,a){this.handleObjData(t,e,a)},handleObjData:function(t,e,a){for(var r in t)t[r]==e&&this.$delete(t.properties,a)},changeType:function(t,e,a,r){"string"!=t&&"boolean"!=t&&"number"!=t&&"object"!=t||(e.properties={},e.hasOwnProperty("items")&&this.$delete(e,"items")),"array"==t&&this.$set(e,"items",{parentKey:a,level:parseInt(r)+1,frontOriginType:this.frontOriginType,backendOriginType:this.frontOriginType,type:"string",isBackendField:0,defaultVal:"val",isRootKey:0,rootKey:"",objectClass:"",description:"描述",example:"示例",check:!0,properties:{}}),this.$forceUpdate()},handleAdd:function(t,e,a,r){var s=this.keyLength++;if("array"==t.type)return this.$set(t.items.properties,"field"+s,{parentKey:e,level:parseInt(r)+1,frontOriginType:this.frontOriginType,backendOriginType:this.frontOriginType,type:"string",currentKey:"field"+s,isBackendField:0,defaultVal:"val",isRootKey:0,rootKey:"",objectClass:"",description:"描述",example:"示例",check:!0,properties:{}}),this.$forceUpdate(),!1;this.$set(t.properties,"field"+s,{parentKey:e,level:parseInt(r)+1,frontOriginType:this.frontOriginType,backendOriginType:this.frontOriginType,type:"string",currentKey:"field"+s,isBackendField:0,defaultVal:"val",isRootKey:0,rootKey:"",objectClass:"",description:"描述",example:"示例",check:!0,properties:{}}),this.$forceUpdate()}},watch:{itemData:function(t,e){t&&(this.trData=JSON.parse(c()(t)))}},mounted:function(){this.trData=JSON.parse(c()(this.itemData))}},w={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[t._l(t.itemData.properties,function(e,r,s){return[a("table",{key:s+r+121,staticClass:"el-table__body",staticStyle:{width:"100%","table-layout":"fixed"},attrs:{cellspacing:"0",cellpadding:"0",border:"0"}},[a("tbody",[a("tr",{staticClass:"el-table__row"},[a("td",{staticClass:"el-table_1_column_1",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-input",{attrs:{disabled:2==e.level},on:{blur:function(a){t.blurKey(e,r)}},model:{value:e.currentKey,callback:function(a){t.$set(e,"currentKey",a)},expression:"itemValue.currentKey"}})],1)]),t._v(" "),a("td",{staticClass:"el-table_1_column_2",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-select",{attrs:{placeholder:"请选择参数类型"},on:{change:function(a){t.changeType(e.type,e,e.currentKey,e.level)}},model:{value:e.type,callback:function(a){t.$set(e,"type",a)},expression:"itemValue.type"}},[a("el-option",{attrs:{label:"string",value:"string"}}),t._v(" "),a("el-option",{attrs:{label:"number",value:"number"}}),t._v(" "),a("el-option",{attrs:{label:"boolean",value:"boolean"}}),t._v(" "),a("el-option",{attrs:{label:"object",value:"object"}}),t._v(" "),a("el-option",{attrs:{label:"array",value:"array"}})],1)],1)]),t._v(" "),a("td",{staticClass:"el-table_1_column_3",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-checkbox",{model:{value:e.check,callback:function(a){t.$set(e,"check",a)},expression:"itemValue.check"}})],1)]),t._v(" "),a("td",{staticClass:"el-table_1_column_3",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-input",{model:{value:e.defaultVal,callback:function(a){t.$set(e,"defaultVal",a)},expression:"itemValue.defaultVal"}})],1)]),t._v(" "),a("td",{staticClass:"el-table_1_column_3",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-input",{model:{value:e.example,callback:function(a){t.$set(e,"example",a)},expression:"itemValue.example"}})],1)]),t._v(" "),a("td",{staticClass:"el-table_1_column_3",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-input",{model:{value:e.description,callback:function(a){t.$set(e,"description",a)},expression:"itemValue.description"}})],1)]),t._v(" "),a("td",{staticClass:"el-table_1_column_3",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},["array"==e.type||"object"==e.type?a("el-button",{attrs:{type:"text"},on:{click:function(a){t.handleAdd(e,e.currentKey,s,e.level)}}},[t._v("添加子属性")]):t._e(),t._v(" "),2!=e.level?a("el-button",{attrs:{type:"text"},on:{click:function(a){t.handleDel(e.parentKey,e.currentKey,s,e.level)}}},[t._v("删除")]):t._e()],1)])])])]),t._v(" "),"array"==e.type&&Object.keys(e.items.properties).length?a("body-row",{key:s+"122"+r,staticClass:"el-table__row",staticStyle:{"padding-left":"10px"},attrs:{itemData:e.items}}):t._e(),t._v(" "),"object"==e.type&&Object.keys(e.properties).length?a("body-row",{key:s+"122"+r,staticClass:"el-table__row",staticStyle:{"padding-left":"10px"},attrs:{itemData:e}}):t._e()]})],2)},staticRenderFns:[]};var x=a("VU/8")(C,w,!1,function(t){a("TN1V")},"data-v-0637f5c0",null).exports,I={name:"create-front",components:{limitTextarea:d.a,limitInput:f.a,headerParam:k,bodyParam:x},data:function(){return{apiInfoData:{protocol:"http",requestType:"GET",frontBodyType:"json",frontParams:{},headerData:{},queryData:{},bodyJsonData:{},bodyFormData:{}},headerData:{type:"object",level:1,properties:{header:{level:2,currentKey:"header",frontOriginType:"header",backendOriginType:"header",type:"string",isBackendField:0,defaultVal:"val",isRootKey:0,rootKey:"",objectClass:"",description:"描述",example:"示例",check:!0,properties:{}}},required:[]},queryData:{type:"object",level:1,properties:{query:{level:2,currentKey:"query",frontOriginType:"query",backendOriginType:"query",type:"string",isBackendField:0,defaultVal:"val",isRootKey:0,rootKey:"",objectClass:"",description:"描述",example:"示例",check:!0,properties:{}}},required:[]},bodyJsonData:{type:"object",level:1,properties:{root:{level:2,currentKey:"root",frontOriginType:"body",backendOriginType:"body",type:"object",isBackendField:0,defaultVal:"val",isRootKey:0,rootKey:"",objectClass:"",description:"描述",example:"示例",check:!0,properties:{}}},required:[]},bodyFormData:{type:"object",level:1,properties:{root:{level:2,currentKey:"root",frontOriginType:"body",backendOriginType:"body",type:"string",isBackendField:0,defaultVal:"val",isRootKey:0,rootKey:"",objectClass:"",description:"描述",example:"示例",check:!0,properties:{}}},required:[]},rules:{requestType:[{required:!0,message:"请选择请求方法",trigger:"blur"}]}}},methods:{refreshData:function(t){this.frontData=t},submitback:function(){this.$emit("submitBack")},submitForm:function(t){var e=this;e.$refs[t].validate(function(t){if(!t)return!1;e.handleData()})},handleData:function(){if("POST"==this.apiInfoData.requestType&&"json"==this.apiInfoData.frontBodyType){if(o()(this.bodyFormData.properties.root.properties).length)for(var t in this.bodyFormData.properties.root.required=[],this.bodyFormData.properties.root.properties)this.bodyFormData.properties.root.properties[t].check&&this.bodyFormData.properties.root.required.push(t);this.apiInfoData.bodyJsonData=this.bodyJsonData}else this.apiInfoData.bodyJsonData={};if("POST"==this.apiInfoData.requestType&&"form"==this.apiInfoData.frontBodyType){if(o()(this.bodyFormData.properties).length)for(var e in this.bodyFormData.required=[],this.bodyFormData.properties)this.bodyFormData.properties[e].check&&this.bodyFormData.required.push(e);this.apiInfoData.bodyFormData=this.bodyFormData}else this.apiInfoData.bodyFormData={};if(o()(this.headerData.properties).length)for(var a in this.headerData.required=[],this.headerData.properties)this.headerData.properties[a].check&&this.headerData.required.push(a);if(o()(this.queryData.properties).length)for(var r in this.queryData.required=[],this.queryData.properties)this.queryData.properties[r].check&&this.queryData.required.push(r);this.apiInfoData.headerData=this.headerData,this.apiInfoData.queryData=this.queryData,this.$store.dispatch("saveFrontInfo",this.apiInfoData),this.$emit("submitNext",this.apiInfoData)},handleStoreData:function(){this.apiInfoData=JSON.parse(c()(this.$store.state.frontInfo)),this.headerData=this.apiInfoData.headerData,this.queryData=this.apiInfoData.queryData,this.bodyJsonData=this.apiInfoData.bodyJsonData,this.bodyFormData=this.apiInfoData.bodyFormData}},mounted:function(){o()(this.$store.state.frontInfo).length&&this.handleStoreData()}},T={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"base-info-show border-box"},[a("el-form",{ref:"baseForm",attrs:{"label-width":"104px",model:t.apiInfoData,rules:t.rules}},[a("el-form-item",{attrs:{label:"协议:",prop:"protocol"}},[t._v(t._s(t.apiInfoData.protocol))]),t._v(" "),a("el-form-item",{attrs:{label:"请求方法:",prop:"requestType"}},[a("el-select",{attrs:{placeholder:"请选择"},model:{value:t.apiInfoData.requestType,callback:function(e){t.$set(t.apiInfoData,"requestType",e)},expression:"apiInfoData.requestType"}},[a("el-option",{attrs:{label:"GET",value:"GET"}}),t._v(" "),a("el-option",{attrs:{label:"POST",value:"POST"}})],1)],1),t._v(" "),a("el-form-item",{staticClass:"color-303133 font-w-700",attrs:{label:"参数配置"}}),t._v(" "),a("el-form-item",{attrs:{label:"参数位置:"}},[a("div",{staticClass:"font-14 color-303133"},[t._v("header")])]),t._v(" "),a("el-form-item",{attrs:{label:""}},[a("header-param",{ref:"frontHeaderTable",attrs:{itemData:t.headerData,frontOriginType:"header"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"参数位置:"}},[a("div",{staticClass:"font-14 color-303133"},[t._v("query")])]),t._v(" "),a("el-form-item",{attrs:{label:""}},[a("header-param",{ref:"frontQueryTable",attrs:{itemData:t.queryData,frontOriginType:"query"}})],1),t._v(" "),"POST"==t.apiInfoData.requestType?a("el-form-item",{attrs:{label:"参数位置:"}},[a("div",{staticClass:"font-14 color-303133"},[t._v("body")]),t._v(" "),a("div",{staticClass:"font-14 color-303133"},[a("el-radio",{attrs:{label:"json"},model:{value:t.apiInfoData.frontBodyType,callback:function(e){t.$set(t.apiInfoData,"frontBodyType",e)},expression:"apiInfoData.frontBodyType"}},[t._v("json")]),t._v(" "),a("el-radio",{attrs:{label:"form"},model:{value:t.apiInfoData.frontBodyType,callback:function(e){t.$set(t.apiInfoData,"frontBodyType",e)},expression:"apiInfoData.frontBodyType"}},[t._v("form")])],1)]):t._e(),t._v(" "),"POST"==t.apiInfoData.requestType&&"json"==t.apiInfoData.frontBodyType?a("el-form-item",{attrs:{label:""}},[a("div",{staticClass:"body-param-wrap"},[a("div",{staticClass:"el-table el-table--fit el-table--enable-row-hover el-table--enable-row-transition",staticStyle:{width:"100%","table-layout":"fixed"}},[a("div",{staticClass:"el-table__header-wrapper"},[a("table",{staticClass:"el-table__header",staticStyle:{width:"100%","table-layout":"fixed"},attrs:{cellspacing:"0",cellpadding:"0",border:"0"}},[a("thead",{staticClass:"has-gutter"},[a("tr",{},[a("th",{staticClass:"el-table_1_column_1 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("参数名")])]),t._v(" "),a("th",{staticClass:"el-table_1_column_2 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("参数类型")])]),t._v(" "),a("th",{staticClass:"el-table_1_column_3 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("必选")])]),t._v(" "),a("th",{staticClass:"el-table_1_column_4 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("默认值")])]),t._v(" "),a("th",{staticClass:"el-table_1_column_5 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("示例")])]),t._v(" "),a("th",{staticClass:"el-table_1_column_6 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("描述")])]),t._v(" "),a("th",{staticClass:"el-table_1_column_7 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("操作")])])])])])]),t._v(" "),a("div",{staticClass:"el-table__body-wrapper is-scrolling-none"},[a("div",{staticClass:"table-content"},[a("body-param",{ref:"frontBodyJsonTable",attrs:{itemData:t.bodyJsonData,frontOriginType:"body"},on:{refreshData:t.refreshData}})],1)])])])]):t._e(),t._v(" "),"POST"==t.apiInfoData.requestType&&"form"==t.apiInfoData.frontBodyType?a("el-form-item",{attrs:{label:""}},[a("header-param",{ref:"frontBodyFormTable",attrs:{itemData:t.bodyFormData,frontOriginType:"body"}})],1):t._e(),t._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:t.submitback}},[t._v("上一步")]),t._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(e){t.submitForm("baseForm")}}},[t._v("下一步")])],1)],1)],1)},staticRenderFns:[]};var $=a("VU/8")(I,T,!1,function(t){a("cVL5")},"data-v-cd7a8b4c",null).exports,O={name:"back-table-row",props:{itemData:{type:[Object,Array],default:function(){return{}}}},data:function(){return{trData:{}}},watch:{itemData:function(t,e){this.trData=t}},mounted:function(){this.trData=this.itemData}},F={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[t._l(t.itemData.properties,function(e,r,s){return[a("table",{key:s+r+121,staticClass:"el-table__body",staticStyle:{width:"100%","table-layout":"fixed"},attrs:{cellspacing:"0",cellpadding:"0",border:"0"}},[a("tbody",[a("tr",{staticClass:"el-table__row"},[a("td",{staticClass:"el-table_1_column_1",staticStyle:{width:"36px"},attrs:{rowspan:"1",colspan:"1"}},["object"==e.type||"array"==e.type?a("div",{staticClass:"cell"},[a("i",{staticClass:"el-icon-minus"})]):t._e()]),t._v(" "),a("td",{staticClass:"el-table_1_column_1",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[t._v(t._s(r))])]),t._v(" "),a("td",{staticClass:"el-table_1_column_2",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[t._v(t._s(e.frontOriginType))])]),t._v(" "),a("td",{staticClass:"el-table_1_column_2",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[t._v(t._s(e.type))])])])])]),t._v(" "),"array"==e.type&&Object.keys(e.items.properties).length?a("back-table-row",{key:s+"122"+r,staticClass:"el-table__row",staticStyle:{"padding-left":"10px"},attrs:{itemData:e.items}}):t._e(),t._v(" "),"object"==e.type&&Object.keys(e.properties).length?a("back-table-row",{key:s+"122"+r,staticClass:"el-table__row",staticStyle:{"padding-left":"10px"},attrs:{itemData:e}}):t._e()]})],2)},staticRenderFns:[]};var K=a("VU/8")(O,F,!1,function(t){a("GUiu")},"data-v-a1d428da",null).exports,S={name:"back-table-row",props:{itemData:{type:[Object,Array],default:function(){return{}}},interfaceType:{type:String,default:function(){return"0"}}},data:function(){return{trData:{}}},methods:{blurKey:function(t,e){t.rootKey!=e&&(this.$set(this.itemData.properties,t.rootKey,t),this.$delete(this.itemData.properties,e))},changeCheck:function(t,e){if("object"==t.type&&o()(t.properties).length)for(var a in t.properties)t.properties[a].isRootKey=!1;if("array"==t.type&&o()(t.items.properties).length)for(var r in t.items.properties)t.items.properties[r].isRootKey=!1}},watch:{itemData:function(t,e){this.trData=JSON.parse(c()(t))}},mounted:function(){this.trData=JSON.parse(c()(this.itemData))}},j={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[t._l(t.itemData.properties,function(e,r,s){return[a("table",{key:s+r+121,staticClass:"el-table__body",staticStyle:{width:"100%","table-layout":"fixed"},attrs:{cellspacing:"0",cellpadding:"0",border:"0"}},[a("tbody",[a("tr",{staticClass:"el-table__row"},[a("td",{staticClass:"el-table_1_column_1",staticStyle:{width:"36px"},attrs:{rowspan:"1",colspan:"1"}},["object"==e.type||"array"==e.type?a("div",{staticClass:"cell"},[a("i",{staticClass:"el-icon-minus"})]):t._e()]),t._v(" "),a("td",{staticClass:"el-table_1_column_1",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-checkbox",{attrs:{disabled:t.itemData.isRootKey},on:{change:function(a){t.changeCheck(e,r)}},model:{value:e.isRootKey,callback:function(a){t.$set(e,"isRootKey",a)},expression:"itemValue.isRootKey"}})],1)]),t._v(" "),a("td",{staticClass:"el-table_1_column_1",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-input",{staticClass:"w-110",attrs:{placeholder:"请输入参数名"},on:{blur:function(a){t.blurKey(e,r)}},model:{value:e.rootKey,callback:function(a){t.$set(e,"rootKey",a)},expression:"itemValue.rootKey"}})],1)]),t._v(" "),"0"==t.interfaceType?a("td",{staticClass:"el-table_1_column_2",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-select",{attrs:{placeholder:"请选择参数位置"},model:{value:e.backendOriginType,callback:function(a){t.$set(e,"backendOriginType",a)},expression:"itemValue.backendOriginType"}},[a("el-option",{attrs:{label:"header",value:"header"}}),t._v(" "),a("el-option",{attrs:{label:"query",value:"query"}}),t._v(" "),a("el-option",{attrs:{label:"body",value:"body"}})],1)],1)]):t._e(),t._v(" "),a("td",{staticClass:"el-table_1_column_3",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[t._v(t._s(e.type))])]),t._v(" "),a("td",{staticClass:"el-table_1_column_4",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-input",{staticClass:"w-110",attrs:{placeholder:"请输入参数值"},model:{value:e.defaultVal,callback:function(a){t.$set(e,"defaultVal",a)},expression:"itemValue.defaultVal"}})],1)]),t._v(" "),"1"==t.interfaceType?a("td",{staticClass:"el-table_1_column_4",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-input",{staticClass:"w-110",attrs:{placeholder:"请输入包路径"},model:{value:e.objectClass,callback:function(a){t.$set(e,"objectClass",a)},expression:"itemValue.objectClass"}})],1)]):t._e(),t._v(" "),"1"==t.interfaceType?a("td",{staticClass:"el-table_1_column_4",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-input",{staticClass:"w-110",attrs:{placeholder:"请输入排序"},model:{value:e.sort,callback:function(a){t.$set(e,"sort",a)},expression:"itemValue.sort"}})],1)]):t._e()])])]),t._v(" "),"array"==e.type?a("back-table-row",{key:s+"122"+r,staticClass:"el-table__row child-row",attrs:{itemData:e.items}}):t._e(),t._v(" "),"object"==e.type?a("back-table-row",{key:s+"122"+r,staticClass:"el-table__row child-row",attrs:{itemData:e}}):t._e()]})],2)},staticRenderFns:[]};var q=a("VU/8")(S,j,!1,function(t){a("OSAk")},"data-v-0f24fbf8",null).exports,V={name:"back-constant",props:{itemData:{type:Object,default:function(){return{}}},interfaceType:{type:[String,Number],default:function(){return"0"}}},data:function(){return{trData:{type:"object",properties:{name:{backendOriginType:"query",type:"string",constFlag:!0,currentKey:"name",isBackendField:0,defaultVal:"val",isRootKey:0,rootKey:"",objectClass:"",description:"描述",example:"示例",check:!0}}},keyLength:1}},methods:{blurKey:function(t,e){t.currentKey!=e&&(this.$set(this.itemData.properties,t.currentKey,t),this.$delete(this.itemData.properties,e))},handleDel:function(t,e,a){this.$delete(this.itemData.properties,e)},toAddItem:function(){var t=this.keyLength++;this.$set(this.itemData.properties,"field"+t,{backendOriginType:"query",type:"string",currentKey:"field"+t,constFlag:!0,isBackendField:0,defaultVal:"val",isRootKey:0,rootKey:"",objectClass:"",description:"描述",example:"示例",check:!0})}},watch:{itemData:function(t,e){this.trData=JSON.parse(c()(t))},interfaceType:function(t,e){this.backType=t}},mounted:function(){this.trData=JSON.parse(c()(this.itemData))}},B={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{staticClass:"el-table el-table--fit el-table--enable-row-hover el-table--enable-row-transition",staticStyle:{width:"100%","table-layout":"fixed"}},[a("div",{staticClass:"el-table__header-wrapper"},[a("table",{staticClass:"el-table__header",staticStyle:{width:"100%","table-layout":"fixed"},attrs:{cellspacing:"0",cellpadding:"0",border:"0"}},[a("thead",{staticClass:"has-gutter"},[a("tr",{},[t._m(0),t._v(" "),"0"==t.interfaceType?a("th",{staticClass:"el-table_1_column_2 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("参数位置")])]):t._e(),t._v(" "),t._m(1),t._v(" "),t._m(2),t._v(" "),t._m(3)])])])]),t._v(" "),a("div",{staticClass:"el-table__body-wrapper is-scrolling-none"},[a("div",{staticClass:"table-content"},[t._l(t.itemData.properties,function(e,r,s){return[a("table",{key:s+r+121,staticClass:"el-table__body",staticStyle:{width:"100%","table-layout":"fixed"},attrs:{cellspacing:"0",cellpadding:"0",border:"0"}},[a("tbody",[a("tr",{staticClass:"el-table__row"},[a("td",{staticClass:"el-table_1_column_1",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-input",{attrs:{placeholder:"请输入参数名"},on:{blur:function(a){t.blurKey(e,r)}},model:{value:e.currentKey,callback:function(a){t.$set(e,"currentKey",a)},expression:"itemValue.currentKey"}})],1)]),t._v(" "),"0"==t.interfaceType?a("td",{staticClass:"el-table_1_column_2",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-select",{attrs:{placeholder:"请选择参数位置"},model:{value:e.backendOriginType,callback:function(a){t.$set(e,"backendOriginType",a)},expression:"itemValue.backendOriginType"}},[a("el-option",{attrs:{label:"header",value:"header"}}),t._v(" "),a("el-option",{attrs:{label:"query",value:"query"}}),t._v(" "),a("el-option",{attrs:{label:"body",value:"body"}})],1)],1)]):t._e(),t._v(" "),a("td",{staticClass:"el-table_1_column_2",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-select",{attrs:{placeholder:"请选择参数类型"},model:{value:e.type,callback:function(a){t.$set(e,"type",a)},expression:"itemValue.type"}},[a("el-option",{attrs:{label:"string",value:"string"}}),t._v(" "),a("el-option",{attrs:{label:"number",value:"number"}}),t._v(" "),a("el-option",{attrs:{label:"boolean",value:"boolean"}})],1)],1)]),t._v(" "),a("td",{staticClass:"el-table_1_column_3",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-input",{model:{value:e.defaultVal,callback:function(a){t.$set(e,"defaultVal",a)},expression:"itemValue.defaultVal"}})],1)]),t._v(" "),a("td",{staticClass:"el-table_1_column_3",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-button",{attrs:{type:"text"},on:{click:function(a){t.handleDel(e,r,s)}}},[t._v("删除")])],1)])])])])]})],2)])]),t._v(" "),a("div",{staticClass:"add-line text-center",on:{click:t.toAddItem}},[a("i",{staticClass:"el-icon-circle-plus-outline color-5584FF"}),a("span",{staticClass:"color-5584FF font-14 p-l-4"},[t._v("添加常量参数")])])])},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("th",{staticClass:"el-table_1_column_1 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[e("div",{staticClass:"cell"},[this._v("参数名")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("th",{staticClass:"el-table_1_column_2 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[e("div",{staticClass:"cell"},[this._v("参数类型")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("th",{staticClass:"el-table_1_column_4 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[e("div",{staticClass:"cell"},[this._v("参数值")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("th",{staticClass:"el-table_1_column_7 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[e("div",{staticClass:"cell"},[this._v("操作")])])}]};var P=a("VU/8")(V,B,!1,function(t){a("1i9K")},"data-v-b6b59a6a",null).exports,N={name:"create-backend",components:{limitTextarea:d.a,limitInput:f.a,backTableLeft:K,backConstant:P,backTableRight:q},data:function(){var t=this;return{apiInfoData:{interfaceType:"0",version:"",backendHttpPath:"",dubboInterface:"",dubboMethod:"",dubboVersion:"",proxyCode:"",timeout:2e4},backHeaderData:{},backQueryData:{},backBodyJsonData:{},backBodyFormData:{},rules:{version:[{required:!0,message:"请输入API版本号",trigger:"blur"}],backendHttpPath:[{required:!0,validator:function(e,a,r){""===a&&"0"==t.apiInfoData.interfaceType?r(new Error("请输入请求路径")):r()},trigger:"blur"}],timeout:[{required:!0,message:"请输入超时时长",trigger:"blur"}],dubboInterface:[{required:!0,validator:function(e,a,r){""===a&&"1"==t.apiInfoData.interfaceType?r(new Error("请输入dubbo接口名称")):r()},trigger:"blur"}],dubboMethod:[{required:!0,validator:function(e,a,r){""===a&&"1"==t.apiInfoData.interfaceType?r(new Error("请输入dubbo请求方法")):r()},trigger:"blur"}],dubboVersion:[{required:!0,validator:function(e,a,r){""===a&&"1"==t.apiInfoData.interfaceType?r(new Error("请输入请求版本号")):r()},trigger:"blur"}],proxyCode:[{required:!0,validator:function(e,a,r){""===a&&"1"==t.apiInfoData.interfaceType?r(new Error("请选择注册中心地址")):r()},trigger:"blur"}]},envSetOptions:[],constData:{type:"object",level:1,properties:{root:{level:2,currentKey:"root",constFlag:!0,backendOriginType:"header",type:"string",isBackendField:0,defaultVal:"val",isRootKey:0,rootKey:"",objectClass:"",description:"描述",example:"示例",check:!0,properties:{}}}}}},methods:{changeType:function(t){var e=this;e.$nextTick(function(){e.$refs.backForm.resetFields(),e.apiInfoData.interfaceType=t})},submitback:function(){this.$emit("submitBack")},submitForm:function(t){var e=this;e.$refs[t].validate(function(t){if(!t)return!1;e.handlebackData()})},handlebackData:function(){this.apiInfoData.backHeaderData=this.backHeaderData,this.apiInfoData.backQueryData=this.backQueryData,this.apiInfoData.backBodyJsonData=this.backBodyJsonData,this.apiInfoData.backBodyFormData=this.backBodyFormData,this.apiInfoData.constData=this.constData,this.$emit("submitNext",this.apiInfoData),this.$store.dispatch("saveBackInfo",this.apiInfoData)},getEnvSetData:function(){var t=this,e={search:t.searchValue,pageNum:t.currentPage,pageSize:100};Object(b.b)("/gateway-manage/page-proxy",e).then(function(e){var a=e.data;if("0000"==a.code)return t.envSetOptions=a.result.result||[],void(t.totalCount=a.result.totalCount);h.a.errorMsg(a)}).catch(function(e){t.$message.error({duration:1e3,message:e.message})})},handleFrontData:function(){var t=JSON.parse(c()(this.$store.state.frontInfo));if(o()(t.headerData).length){for(var e in t.headerData.properties)t.headerData.properties[e].isRootKey=!0,t.headerData.properties[e].rootKey=e,t.headerData.properties[e].backendOriginType=t.headerData.properties[e].frontOriginType,t.headerData.properties[e].isBackendField=1,t.headerData.properties[e].objectClass="",t.headerData.properties[e].sort=0;this.backHeaderData=JSON.parse(c()(t.headerData)),this.frontHeaderData=JSON.parse(c()(t.headerData))}if(o()(t.queryData).length){for(var a in t.queryData.properties)t.queryData.properties[a].isRootKey=!0,t.queryData.properties[a].rootKey=a,t.queryData.properties[a].backendOriginType=t.queryData.properties[a].frontOriginType,t.queryData.properties[a].isBackendField=1,t.queryData.properties[a].objectClass="",t.queryData.properties[a].sort=0;this.backQueryData=JSON.parse(c()(t.queryData)),this.frontQueryData=JSON.parse(c()(t.queryData))}if(o()(t.bodyFormData).length){for(var r in t.bodyFormData.properties)t.bodyFormData.properties[r].isRootKey=!0,t.bodyFormData.properties[r].rootKey=r,t.bodyFormData.properties[r].backendOriginType=t.bodyFormData.properties[r].frontOriginType,t.bodyFormData.properties[r].isBackendField=1,t.bodyFormData.properties[r].objectClass="",t.bodyFormData.properties[r].sort=0;this.backBodyFormData=JSON.parse(c()(t.bodyFormData)),this.frontBodyFormData=JSON.parse(c()(t.bodyFormData))}if(o()(t.bodyJsonData).length){for(var s in t.bodyJsonData.properties)t.bodyJsonData.properties[s].isRootKey=!0,t.bodyJsonData.properties[s].rootKey=s,t.bodyJsonData.properties[s].backendOriginType=t.bodyJsonData.properties[s].frontOriginType,t.bodyJsonData.properties[s].isBackendField=1,t.bodyJsonData.properties[s].objectClass="",t.bodyJsonData.properties[s].sort=0;this.backBodyJsonData=JSON.parse(c()(t.bodyJsonData)),this.frontBodyJsonData=JSON.parse(c()(t.bodyJsonData))}this.$forceUpdate()},handleStoreData:function(){this.apiInfoData=JSON.parse(c()(this.$store.state.backInfo)),this.constData=this.apiInfoData.constData}},mounted:function(){this.getEnvSetData(),this.handleFrontData(),o()(this.$store.state.backInfo).length&&this.handleStoreData()}},J={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"back-info-show border-box"},[a("el-form",{ref:"backForm",attrs:{"label-width":"129px",model:t.apiInfoData,rules:t.rules}},[a("el-form-item",{attrs:{label:"后端服务:",prop:"interfaceType"}},[a("el-radio-group",{on:{change:t.changeType},model:{value:t.apiInfoData.interfaceType,callback:function(e){t.$set(t.apiInfoData,"interfaceType",e)},expression:"apiInfoData.interfaceType"}},[a("el-radio",{attrs:{label:"0"}},[t._v("http")]),t._v(" "),a("el-radio",{attrs:{label:"1"}},[t._v("dubbo")])],1)],1),t._v(" "),a("el-form-item",{attrs:{label:"API版本号",prop:"version"}},[a("limitInput",{attrs:{inputWidth:329,inputValue:t.apiInfoData.version,holder:"请输入API版本号",getByType:"word",maxLength:20},on:{"update:inputValue":function(e){t.$set(t.apiInfoData,"version",e)}}})],1),t._v(" "),1==t.apiInfoData.interfaceType?a("el-form-item",{attrs:{label:"dubbo接口名称:",prop:"dubboInterface"}},[a("limitInput",{attrs:{inputWidth:329,inputValue:t.apiInfoData.dubboInterface,holder:"请输入dubbo接口名称",getByType:"word",maxLength:20},on:{"update:inputValue":function(e){t.$set(t.apiInfoData,"dubboInterface",e)}}})],1):t._e(),t._v(" "),1==t.apiInfoData.interfaceType?a("el-form-item",{attrs:{label:"dubbo请求方法:",prop:"dubboMethod"}},[a("limitInput",{attrs:{inputWidth:329,inputValue:t.apiInfoData.dubboMethod,holder:"请输入dubbo请求方法",getByType:"word",maxLength:20},on:{"update:inputValue":function(e){t.$set(t.apiInfoData,"dubboMethod",e)}}})],1):t._e(),t._v(" "),0==t.apiInfoData.interfaceType?a("el-form-item",{attrs:{label:"请求路径:",prop:"backendHttpPath"}},[a("el-input",{staticClass:"w-329",model:{value:t.apiInfoData.backendHttpPath,callback:function(e){t.$set(t.apiInfoData,"backendHttpPath",e)},expression:"apiInfoData.backendHttpPath"}})],1):t._e(),t._v(" "),1==t.apiInfoData.interfaceType?a("el-form-item",{attrs:{label:"注册中心地址:",prop:"proxyCode"}},[a("el-select",{attrs:{placeholder:"请选择"},model:{value:t.apiInfoData.proxyCode,callback:function(e){t.$set(t.apiInfoData,"proxyCode",e)},expression:"apiInfoData.proxyCode"}},t._l(t.envSetOptions,function(t){return a("el-option",{key:t.proxyCode,attrs:{label:t.proxyName,value:t.proxyCode}})}))],1):t._e(),t._v(" "),1==t.apiInfoData.interfaceType?a("el-form-item",{attrs:{label:"请求版本号",prop:"dubboVersion"}},[a("limitInput",{attrs:{inputWidth:329,inputValue:t.apiInfoData.dubboVersion,holder:"请输入请求版本号",getByType:"word",maxLength:20},on:{"update:inputValue":function(e){t.$set(t.apiInfoData,"dubboVersion",e)}}})],1):t._e(),t._v(" "),a("el-form-item",{attrs:{label:"超时时长:",prop:"timeout"}},[a("el-input-number",{attrs:{"controls-position":"right",min:1,max:1e9},model:{value:t.apiInfoData.timeout,callback:function(e){t.$set(t.apiInfoData,"timeout",e)},expression:"apiInfoData.timeout"}})],1),t._v(" "),a("el-form-item",{staticClass:"color-303133 font-w-700",attrs:{label:"参数配置"}},[a("div",{staticClass:"back-data-wrap font-0"},[a("div",{staticClass:"el-table el-table--fit el-table--enable-row-hover el-table--enable-row-transition inline-block vertical-top",staticStyle:{width:"30%","table-layout":"fixed"}},[a("div",{staticClass:"el-table__header-wrapper"},[a("table",{staticClass:"el-table__header",staticStyle:{width:"100%","table-layout":"fixed"},attrs:{cellspacing:"0",cellpadding:"0",border:"0"}},[a("thead",{staticClass:"has-gutter"},[a("tr",{},[a("th",{staticClass:"el-table_1_column_1 is-leaf",staticStyle:{width:"36px"},attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"})]),t._v(" "),a("th",{staticClass:"el-table_1_column_1 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("参数名")])]),t._v(" "),a("th",{staticClass:"el-table_1_column_2 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("参数位置")])]),t._v(" "),a("th",{staticClass:"el-table_1_column_3 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("参数类型")])])])])])]),t._v(" "),a("div",{staticClass:"el-table__body-wrapper is-scrolling-none back-table-left"},[a("div",{staticClass:"table-content"},[t.backHeaderData.properties&&Object.keys(t.backHeaderData.properties).length?a("back-table-left",{attrs:{itemData:t.frontHeaderData}}):t._e(),t._v(" "),t.backQueryData.properties&&Object.keys(t.backQueryData.properties).length?a("back-table-left",{attrs:{itemData:t.frontQueryData}}):t._e(),t._v(" "),t.backBodyJsonData.properties&&Object.keys(t.backBodyJsonData.properties).length?a("back-table-left",{attrs:{itemData:t.frontBodyJsonData}}):t._e(),t._v(" "),t.backBodyFormData.properties&&Object.keys(t.backBodyFormData.properties).length?a("back-table-left",{attrs:{itemData:t.frontBodyFormData}}):t._e()],1)])]),t._v(" "),a("div",{staticClass:"el-table el-table--fit el-table--enable-row-hover el-table--enable-row-transition inline-block vertical-top",staticStyle:{width:"70%","table-layout":"fixed"}},[a("div",{staticClass:"el-table__header-wrapper"},[a("table",{staticClass:"el-table__header",staticStyle:{width:"100%","table-layout":"fixed"},attrs:{cellspacing:"0",cellpadding:"0",border:"0"}},[a("thead",{staticClass:"has-gutter"},[a("tr",{},[a("th",{staticClass:"el-table_1_column_1 is-leaf",staticStyle:{width:"36px"},attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"})]),t._v(" "),a("th",{staticClass:"el-table_1_column_1 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("是否后端参数")])]),t._v(" "),a("th",{staticClass:"el-table_1_column_1 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("参数名映射")])]),t._v(" "),0==t.apiInfoData.interfaceType?a("th",{staticClass:"el-table_1_column_2 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("参数位置")])]):t._e(),t._v(" "),a("th",{staticClass:"el-table_1_column_3 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("参数类型")])]),t._v(" "),a("th",{staticClass:"el-table_1_column_4 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("参数值")])]),t._v(" "),1==t.apiInfoData.interfaceType?a("th",{staticClass:"el-table_1_column_4 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("包路径")])]):t._e(),t._v(" "),1==t.apiInfoData.interfaceType?a("th",{staticClass:"el-table_1_column_4 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("排序")])]):t._e()])])])]),t._v(" "),a("div",{staticClass:"el-table__body-wrapper is-scrolling-none"},[a("div",{staticClass:"table-content"},[t.backHeaderData.properties&&Object.keys(t.backHeaderData.properties).length?a("back-table-right",{attrs:{itemData:t.backHeaderData,interfaceType:t.apiInfoData.interfaceType}}):t._e(),t._v(" "),t.backQueryData.properties&&Object.keys(t.backQueryData.properties).length?a("back-table-right",{attrs:{itemData:t.backQueryData,interfaceType:t.apiInfoData.interfaceType}}):t._e(),t._v(" "),t.backBodyJsonData.properties&&Object.keys(t.backBodyJsonData.properties).length?a("back-table-right",{attrs:{itemData:t.backBodyJsonData,interfaceType:t.apiInfoData.interfaceType}}):t._e(),t._v(" "),t.backBodyFormData.properties&&Object.keys(t.backBodyFormData.properties).length?a("back-table-right",{attrs:{itemData:t.backBodyFormData,interfaceType:t.apiInfoData.interfaceType}}):t._e()],1)])])]),t._v(" "),a("div",{staticClass:"constant-wrap"},[a("back-constant",{attrs:{itemData:t.constData,interfaceType:t.apiInfoData.interfaceType}})],1)]),t._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:t.submitback}},[t._v("上一步")]),t._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(e){t.submitForm("backForm")}}},[t._v("下一步")])],1)],1)],1)},staticRenderFns:[]};var R=a("VU/8")(N,J,!1,function(t){a("U1k4")},"data-v-1c9d1fb6",null).exports,E=a("woOf"),L=a.n(E),U={name:"body-row",props:{itemData:{type:Object,default:function(){return{}}}},data:function(){return{trData:{},keyLength:1}},methods:{blurKey:function(t,e){t.currentKey!=e&&(this.$set(this.itemData.properties,t.currentKey,t),this.$delete(this.itemData.properties,e))},updateKey:function(t){for(var e in t)e!=t[e].currentKey&&(t[e].pkey=t[t[e].currentKey]=t[e],this.$delete(t,e)),t[e]&&"object"==t[e].type&&o()(t[e].properties).length&&this.updateKey(t[e].properties),t[e]&&"array"==t[e].type&&o()(t[e].items.properties).length&&this.updateKey(t[e].items.properties)},handleDel:function(t,e,a,r){var s=this;return u()(n.a.mark(function a(){var r;return n.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return r=s,a.next=3,r.updateKey(r.itemData.properties);case 3:if(t){a.next=6;break}return r.$delete(r.itemData.properties,e),a.abrupt("return",!1);case 6:r.handleDelData(r.itemData,t,e);case 7:case"end":return a.stop()}},a,s)}))()},handleDelData:function(t,e,a){this.handleObjData(t,e,a)},handleObjData:function(t,e,a){for(var r in t)t[r]==e&&this.$delete(t.properties,a)},changeType:function(t,e,a,r){"string"!=t&&"boolean"!=t&&"number"!=t&&"object"!=t||(e.properties={},e.hasOwnProperty("items")&&this.$delete(e,"items")),"array"==t&&this.$set(e,"items",{parentKey:a,level:parseInt(r)+1,type:"string",defaultVal:"val",description:"描述",example:"示例",properties:{}}),this.$forceUpdate()},handleAdd:function(t,e,a,r){var s=this.keyLength++;if("array"==t.type)return this.$set(t.items.properties,"field"+s,{parentKey:e,level:parseInt(r)+1,type:"string",currentKey:"field"+s,defaultVal:"val",description:"描述",example:"示例",properties:{}}),this.$forceUpdate(),!1;this.$set(t.properties,"field"+s,{parentKey:e,level:parseInt(r)+1,type:"string",currentKey:"field"+s,defaultVal:"val",description:"描述",example:"示例",properties:{}}),this.$forceUpdate()}},watch:{itemData:function(t,e){t&&(this.trData=JSON.parse(c()(t)))}},mounted:function(){this.trData=JSON.parse(c()(this.itemData))}},A={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[t._l(t.itemData.properties,function(e,r,s){return[a("table",{key:s+r+121,staticClass:"el-table__body",staticStyle:{width:"100%","table-layout":"fixed"},attrs:{cellspacing:"0",cellpadding:"0",border:"0"}},[a("tbody",[a("tr",{staticClass:"el-table__row"},[a("td",{staticClass:"el-table_1_column_1",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-input",{attrs:{disabled:"array"==e.type||"object"==e.type},on:{blur:function(a){t.blurKey(e,r)}},model:{value:e.currentKey,callback:function(a){t.$set(e,"currentKey",a)},expression:"itemValue.currentKey"}})],1)]),t._v(" "),a("td",{staticClass:"el-table_1_column_2",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-select",{attrs:{placeholder:"请选择参数类型"},on:{change:function(a){t.changeType(e.type,e,e.currentKey,e.level)}},model:{value:e.type,callback:function(a){t.$set(e,"type",a)},expression:"itemValue.type"}},[a("el-option",{attrs:{label:"string",value:"string"}}),t._v(" "),a("el-option",{attrs:{label:"number",value:"number"}}),t._v(" "),a("el-option",{attrs:{label:"boolean",value:"boolean"}}),t._v(" "),a("el-option",{attrs:{label:"object",value:"object"}}),t._v(" "),a("el-option",{attrs:{label:"array",value:"array"}})],1)],1)]),t._v(" "),a("td",{staticClass:"el-table_1_column_3",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-input",{model:{value:e.example,callback:function(a){t.$set(e,"example",a)},expression:"itemValue.example"}})],1)]),t._v(" "),a("td",{staticClass:"el-table_1_column_3",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},["array"==e.type||"object"==e.type?a("el-button",{attrs:{type:"text"},on:{click:function(a){t.handleAdd(e,e.currentKey,s,e.level)}}},[t._v("添加子属性")]):t._e(),t._v(" "),a("el-button",{attrs:{type:"text"},on:{click:function(a){t.handleDel(e.parentKey,e.currentKey,s,e.level)}}},[t._v("删除")])],1)])])])]),t._v(" "),"array"==e.type&&Object.keys(e.items.properties).length?a("body-row",{key:s+"122"+r,staticClass:"el-table__row",staticStyle:{"padding-left":"10px"},attrs:{itemData:e.items}}):t._e(),t._v(" "),"object"==e.type&&Object.keys(e.properties).length?a("body-row",{key:s+"122"+r,staticClass:"el-table__row",staticStyle:{"padding-left":"10px"},attrs:{itemData:e}}):t._e()]})],2)},staticRenderFns:[]};var H=a("VU/8")(U,A,!1,function(t){a("1kTN")},"data-v-0344bb74",null).exports,Q=a("jvWE"),G={name:"create-front",components:{limitTextarea:d.a,limitInput:f.a,headerParam:k,resultTable:H},data:function(){return{apiInfoData:{resultParams:{},sucReturn:"",errReturn:"",errCode:[]},errCode:[],errOptions:[],resultParams:{type:"object",level:1,properties:{root:{level:2,currentKey:"root",type:"object",defaultVal:"val",description:"描述",example:"示例",properties:{}}}},rules:{sucReturn:[{required:!0,message:"请输入成功返回示例",trigger:"blur"}],errReturn:[{required:!0,message:"请输入失败返回示例",trigger:"blur"}]},keyLength:1}},methods:{remoteMethod:function(t){""!==t?this.getErrcodeData(t):this.errOptions=[]},changeErr:function(t,e,a){t&&this.errOptions.forEach(function(e){t==e.errorCode&&(a.error_info=e.errorInfo)})},toAddItem:function(){var t=this.keyLength++;this.$set(this.resultParams.properties,"field"+t,{level:2,parentKey:"",type:"string",currentKey:"field"+t,defaultVal:"val",description:"描述",example:"示例",properties:{}})},delErrorCode:function(t){this.apiInfoData.errCode.splice(t,1)},addErrCodeItem:function(){this.apiInfoData.errCode.push({error_code:"",error_info:"",orig_error_code:""})},submitback:function(){this.$emit("submitBack")},submitForm:Object(Q.a)(function(t){var e=this;e.$refs[t].validate(function(t){if(!t)return!1;e.handleFrontBackData()})},500),handleFrontData:function(){var t={type:"object",level:1,properties:{},required:[]},e=JSON.parse(c()(this.$store.state.frontInfo));return t.properties=L()(e.queryData.properties,e.headerData.properties),"POST"==e.requestType&&"json"==e.frontBodyType&&(t.properties=L()(e.queryData.properties,e.headerData.properties,e.bodyJsonData.properties)),"POST"==e.requestType&&"form"==e.frontBodyType&&(t.properties=L()(e.queryData.properties,e.headerData.properties,e.bodyFormData.properties)),t},handleBackData:function(){var t={type:"object",level:1,properties:{},required:[]},e=JSON.parse(c()(this.$store.state.backInfo));return t.properties=L()(e.backQueryData.properties,e.backHeaderData.properties,e.constData.properties),t},handleFrontBackData:function(){var t=this;return u()(n.a.mark(function e(){var a,r,s;return n.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=t,e.next=3,a.handleFrontData();case 3:return r=e.sent,e.next=6,a.handleBackData();case 6:return s=e.sent,e.next=9,a.toPostApi(r,s);case 9:case"end":return e.stop()}},e,t)}))()},toPostApi:function(t,e){var a=this,r={interfaceName:a.$store.state.baseInfo.interfaceName,interfaceGroupId:a.$route.query.interfaceGroupId,interfaceUrl:a.$store.state.baseInfo.interfaceUrl,interfaceDescribe:a.$store.state.baseInfo.interfaceDescribe,projectId:a.$route.query.projectId,target:a.$store.state.baseInfo.target,optType:a.$store.state.baseInfo.optType,protocol:a.$store.state.frontInfo.protocol,requestType:a.$store.state.frontInfo.requestType,frontParams:c()(t),interfaceType:a.$store.state.backInfo.interfaceType,version:a.$store.state.backInfo.version,backendHttpPath:a.$store.state.backInfo.backendHttpPath,dubboInterface:a.$store.state.backInfo.dubboInterface,dubboMethod:a.$store.state.backInfo.dubboMethod,dubboVersion:a.$store.state.backInfo.dubboVersion,proxyCode:a.$store.state.backInfo.proxyCode,timeout:a.$store.state.backInfo.timeout,endParams:c()(e),resultParams:c()(a.resultParams),sucReturn:a.apiInfoData.sucReturn,errReturn:a.apiInfoData.errReturn,errCode:c()(a.apiInfoData.errCode),interfaceId:a.$store.state.baseInfo.interfaceId,interfaceVersionId:a.$store.state.baseInfo.interfaceVersionId};Object(b.b)(a.$store.state.baseInfo.interfaceId?"/gateway-manage/update-api":"/gateway-manage/create-api",r).then(function(t){var e=t.data;if("0000"==e.code)return y.a.showmsg("保存成功","success"),a.$store.dispatch("clearApiData"),void a.$router.push("/apiList");h.a.errorMsg(e)}).catch(function(t){a.$message.error({duration:1e3,message:t.message})})},getErrcodeData:function(t){var e=this,a={pageNum:1,pageSize:100,search:t};Object(b.b)("/gateway-manage/page-error-setting",a).then(function(t){var a=t.data;"0000"!=a.code?h.a.errorMsg(a):e.errOptions=a.result.result||[]}).catch(function(t){e.$message.error({duration:1e3,message:t.message})})},handleStoreData:function(){this.apiInfoData=JSON.parse(c()(this.$store.state.resultInfo))}},mounted:function(){this.getErrcodeData(),this.$route.query.interfaceId&&this.handleStoreData()}},M={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"result-info-show border-box"},[a("el-form",{ref:"resultForm",attrs:{"label-width":"114px",model:t.apiInfoData,rules:t.rules}},[a("el-form-item",{attrs:{label:"返回类型:"}},[t._v("json")]),t._v(" "),a("el-form-item",{attrs:{label:"返回参数:"}},[a("div",{staticClass:"body-param-wrap"},[a("div",{staticClass:"el-table el-table--fit el-table--enable-row-hover el-table--enable-row-transition",staticStyle:{width:"100%","table-layout":"fixed"}},[a("div",{staticClass:"el-table__header-wrapper"},[a("table",{staticClass:"el-table__header",staticStyle:{width:"100%","table-layout":"fixed"},attrs:{cellspacing:"0",cellpadding:"0",border:"0"}},[a("thead",{staticClass:"has-gutter"},[a("tr",{},[a("th",{staticClass:"el-table_1_column_1 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("参数名")])]),t._v(" "),a("th",{staticClass:"el-table_1_column_2 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("参数类型")])]),t._v(" "),a("th",{staticClass:"el-table_1_column_5 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("示例值")])]),t._v(" "),a("th",{staticClass:"el-table_1_column_7 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("操作")])])])])])]),t._v(" "),a("div",{staticClass:"el-table__body-wrapper is-scrolling-none"},[a("div",{staticClass:"table-content"},[a("result-table",{ref:"resultBodyTable",attrs:{itemData:t.resultParams},on:{refreshData:t.refreshData}}),t._v(" "),a("div",{staticClass:"add-line text-center",on:{click:t.toAddItem}},[a("i",{staticClass:"el-icon-circle-plus-outline color-5584FF"}),a("span",{staticClass:"color-5584FF font-14 p-l-4"},[t._v("添加行")])])],1)])])])]),t._v(" "),a("el-form-item",{attrs:{label:"错误码映射:",prop:"errCode"}},[a("el-table",{staticStyle:{width:"100%"},attrs:{data:t.apiInfoData.errCode}},[a("el-table-column",{attrs:{label:"原始错误码"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticClass:"cell"},[a("el-input",{attrs:{placeholder:"请输入原始错误码"},model:{value:e.row.orig_error_code,callback:function(a){t.$set(e.row,"orig_error_code",a)},expression:"scope.row.orig_error_code"}})],1)]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"错误码映射"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticClass:"cell"},[a("el-select",{attrs:{placeholder:"请选择映射错误码"},on:{change:function(a){t.changeErr(a,e.$index,e.row)}},model:{value:e.row.error_code,callback:function(a){t.$set(e.row,"error_code",a)},expression:"scope.row.error_code"}},t._l(t.errOptions,function(t){return a("el-option",{key:t.errorCode,attrs:{label:t.errorCode,value:t.errorCode}})}))],1)]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"错误信息"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticClass:"cell"},[a("el-input",{attrs:{placeholder:"请输入错误信息"},model:{value:e.row.error_info,callback:function(a){t.$set(e.row,"error_info",a)},expression:"scope.row.error_info"}})],1)]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"操作"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticClass:"cell"},[a("el-button",{attrs:{type:"text"},on:{click:function(a){t.delErrorCode(e.$index)}}},[t._v("删除")])],1)]}}])})],1),t._v(" "),a("div",{staticClass:"add-line add-err-line text-center",on:{click:t.addErrCodeItem}},[a("i",{staticClass:"el-icon-circle-plus-outline color-5584FF"}),a("span",{staticClass:"color-5584FF font-14 p-l-4"},[t._v("添加错误码配置")])])],1),t._v(" "),a("el-form-item",{attrs:{label:"成功返回示例:",prop:"sucReturn"}},[a("el-input",{staticClass:"w-389",attrs:{type:"textarea",rows:3,placeholder:"请输入内容"},model:{value:t.apiInfoData.sucReturn,callback:function(e){t.$set(t.apiInfoData,"sucReturn",e)},expression:"apiInfoData.sucReturn"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"失败返回示例:",prop:"errReturn"}},[a("el-input",{staticClass:"w-389",attrs:{type:"textarea",rows:3,placeholder:"请输入内容"},model:{value:t.apiInfoData.errReturn,callback:function(e){t.$set(t.apiInfoData,"errReturn",e)},expression:"apiInfoData.errReturn"}})],1),t._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:t.submitback}},[t._v("上一步")]),t._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(e){t.submitForm("resultForm")}}},[t._v("完 成")])],1)],1)],1)},staticRenderFns:[]};var W=a("VU/8")(G,M,!1,function(t){a("OF/v")},"data-v-f40825fe",null).exports,z={name:"createApi",components:{navBread:r.a,createBase:_,createFront:$,createBackend:R,createResult:W},data:function(){return{navPath:[{name:"API管理",path:"/apiProgram"},{name:"API列表",path:"/apiList"},{name:"创建API",path:""}],activeStep:1,stepData:[{stepName:"基础信息"},{stepName:"前端配置"},{stepName:"后端配置"},{stepName:"定义返回"}],projectId:this.$route.query.projectId,interfaceGroupId:this.$route.query.interfaceGroupId}},methods:{submitNext:function(){this.activeStep++},submitBack:function(){this.activeStep--}},watch:{$route:{handler:function(t,e){},deep:!0}},mounted:function(){this.$emit("showTab",22)},beforeDestroy:function(){this.$store.dispatch("clearApiData")}},Y={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"api-body-content border-box"},[a("div",{staticClass:"common-nav"},[a("nav-bread",{attrs:{navPath:t.navPath}})],1),t._v(" "),a("div",{staticClass:"api-body-main common-body-main border-box",staticStyle:{height:"auto"}},[a("div",{staticClass:"api-main-content border-box"},[a("div",{staticClass:"create-api-body"},[a("div",{staticClass:"create-api-step font-0"},t._l(t.stepData,function(e,r){return a("div",{key:r+e.stepName,class:["api-step-cell inline-block border-box",r+1==t.activeStep?"active-step":""],style:{width:100/t.stepData.length+"%","max-width":100/t.stepData.length+"%"}},[a("div",{staticClass:"api-step-cell_inner border-box"},[r<t.stepData.length-1?a("div",{staticClass:"api-step-cell_line"}):t._e(),t._v(" "),a("div",{staticClass:"api-step-cell_title"},[a("div",{staticClass:"el-step__icon is-text inline-block"},[a("div",{staticClass:"el-step__icon-inner font-14"},[t._v(t._s(r+1))])]),t._v(" "),a("div",{staticClass:"api-step-cell_txt p-lr-10 bg-fff inline-block font-16"},[t._v(t._s(e.stepName))])])])])})),t._v(" "),"1"==t.activeStep?a("div",{staticClass:"create-api-base"},[a("create-base",{on:{submitNext:t.submitNext}})],1):t._e(),t._v(" "),"2"==t.activeStep?a("div",{staticClass:"create-api-front"},[a("create-front",{on:{submitBack:t.submitBack,submitNext:t.submitNext}})],1):t._e(),t._v(" "),"3"==t.activeStep?a("div",{staticClass:"create-api-back"},[a("create-backend",{on:{submitBack:t.submitBack,submitNext:t.submitNext}})],1):t._e(),t._v(" "),"4"==t.activeStep?a("div",{staticClass:"create-api-result"},[a("create-result",{on:{submitBack:t.submitBack,submitNext:t.submitNext}})],1):t._e()])])])])},staticRenderFns:[]};var X=a("VU/8")(z,Y,!1,function(t){a("GSUE")},"data-v-55fb519b",null);e.default=X.exports},cVL5:function(t,e){},exGp:function(t,e,a){"use strict";e.__esModule=!0;var r,s=a("//Fk"),o=(r=s)&&r.__esModule?r:{default:r};e.default=function(t){return function(){var e=t.apply(this,arguments);return new o.default(function(t,a){return function r(s,i){try{var n=e[s](i),l=n.value}catch(t){return void a(t)}if(!n.done)return o.default.resolve(l).then(function(t){r("next",t)},function(t){r("throw",t)});t(l)}("next")})}}},jyFz:function(t,e,a){var r=function(){return this}()||Function("return this")(),s=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,o=s&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,t.exports=a("SldL"),s)r.regeneratorRuntime=o;else try{delete r.regeneratorRuntime}catch(t){r.regeneratorRuntime=void 0}},rzMK:function(t,e){}});
\ No newline at end of file
webpackJsonp([2],{"1i9K":function(t,e){},"1kTN":function(t,e){},"3Xh1":function(t,e){},GSUE:function(t,e){},GUiu:function(t,e){},"OF/v":function(t,e){},OSAk:function(t,e){},SldL:function(t,e){!function(e){"use strict";var a,r=Object.prototype,s=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",n=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag",c="object"==typeof t,p=e.regeneratorRuntime;if(p)c&&(t.exports=p);else{(p=e.regeneratorRuntime=c?t.exports:{}).wrap=D;var u="suspendedStart",d="suspendedYield",f="executing",b="completed",y={},h={};h[i]=function(){return this};var m=Object.getPrototypeOf,v=m&&m(m(K([])));v&&v!==r&&s.call(v,i)&&(h=v);var _=w.prototype=k.prototype=Object.create(h);C.prototype=_.constructor=w,w.constructor=C,w[l]=C.displayName="GeneratorFunction",p.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===C||"GeneratorFunction"===(e.displayName||e.name))},p.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l in t||(t[l]="GeneratorFunction")),t.prototype=Object.create(_),t},p.awrap=function(t){return{__await:t}},x(I.prototype),I.prototype[n]=function(){return this},p.AsyncIterator=I,p.async=function(t,e,a,r){var s=new I(D(t,e,a,r));return p.isGeneratorFunction(e)?s:s.next().then(function(t){return t.done?t.value:s.next()})},x(_),_[l]="Generator",_[i]=function(){return this},_.toString=function(){return"[object Generator]"},p.keys=function(t){var e=[];for(var a in t)e.push(a);return e.reverse(),function a(){for(;e.length;){var r=e.pop();if(r in t)return a.value=r,a.done=!1,a}return a.done=!0,a}},p.values=K,F.prototype={constructor:F,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=a,this.done=!1,this.delegate=null,this.method="next",this.arg=a,this.tryEntries.forEach(O),!t)for(var e in this)"t"===e.charAt(0)&&s.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=a)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,s){return n.type="throw",n.arg=t,e.next=r,s&&(e.method="next",e.arg=a),!!s}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],n=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var l=s.call(i,"catchLoc"),c=s.call(i,"finallyLoc");if(l&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var a=this.tryEntries.length-1;a>=0;--a){var r=this.tryEntries[a];if(r.tryLoc<=this.prev&&s.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var a=this.tryEntries[e];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),O(a),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var a=this.tryEntries[e];if(a.tryLoc===t){var r=a.completion;if("throw"===r.type){var s=r.arg;O(a)}return s}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:K(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=a),y}}}function D(t,e,a,r){var s=e&&e.prototype instanceof k?e:k,o=Object.create(s.prototype),i=new F(r||[]);return o._invoke=function(t,e,a){var r=u;return function(s,o){if(r===f)throw new Error("Generator is already running");if(r===b){if("throw"===s)throw o;return j()}for(a.method=s,a.arg=o;;){var i=a.delegate;if(i){var n=T(i,a);if(n){if(n===y)continue;return n}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(r===u)throw r=b,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);r=f;var l=g(t,e,a);if("normal"===l.type){if(r=a.done?b:d,l.arg===y)continue;return{value:l.arg,done:a.done}}"throw"===l.type&&(r=b,a.method="throw",a.arg=l.arg)}}}(t,a,i),o}function g(t,e,a){try{return{type:"normal",arg:t.call(e,a)}}catch(t){return{type:"throw",arg:t}}}function k(){}function C(){}function w(){}function x(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function I(t){var e;this._invoke=function(a,r){function o(){return new Promise(function(e,o){!function e(a,r,o,i){var n=g(t[a],t,r);if("throw"!==n.type){var l=n.arg,c=l.value;return c&&"object"==typeof c&&s.call(c,"__await")?Promise.resolve(c.__await).then(function(t){e("next",t,o,i)},function(t){e("throw",t,o,i)}):Promise.resolve(c).then(function(t){l.value=t,o(l)},i)}i(n.arg)}(a,r,e,o)})}return e=e?e.then(o,o):o()}}function T(t,e){var r=t.iterator[e.method];if(r===a){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=a,T(t,e),"throw"===e.method))return y;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var s=g(r,t.iterator,e.arg);if("throw"===s.type)return e.method="throw",e.arg=s.arg,e.delegate=null,y;var o=s.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=a),e.delegate=null,y):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,y)}function $(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function F(t){this.tryEntries=[{tryLoc:"root"}],t.forEach($,this),this.reset(!0)}function K(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(s.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=a,e.done=!0,e};return o.next=o}}return{next:j}}function j(){return{value:a,done:!0}}}(function(){return this}()||Function("return this")())},TN1V:function(t,e){},U0Ri:function(t,e){},U1k4:function(t,e){},Xxa5:function(t,e,a){t.exports=a("jyFz")},"Yns/":function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=a("319J"),s=a("fZjL"),o=a.n(s),i=a("Xxa5"),n=a.n(i),l=a("mvHQ"),c=a.n(l),p=a("exGp"),u=a.n(p),d=a("Kkt8"),f=a("l46T"),b=a("P9l9"),y=a("TUB1"),h=a("LlAa"),m={name:"create-base",components:{limitTextarea:d.a,limitInput:f.a},data:function(){return{apiInfoData:{interfaceId:"",interfaceVersionId:"",interfaceName:"",target:"1",optType:"get",interfaceUrl:"",interfaceDescribe:""},rules:{interfaceName:[{required:!0,message:"请输入API名称",trigger:"blur"}],interfaceUrl:[{required:!0,message:"请输入请求路径",trigger:"blur"}]}}},methods:{submitForm:function(t){var e=this;e.$refs[t].validate(function(a){if(!a)return!1;e.blurInterfaceUrl(t)})},blurInterfaceUrl:function(t){var e=this,a={update:!!e.$route.query.interfaceId,interfaceUrl:e.apiInfoData.interfaceUrl};Object(b.a)("/gateway-manage/is-exist-interface-url",a).then(function(a){var r=a.data;if("0000"==r.code)return r.result?(y.a.showmsg("接口已存在","warning"),!1):void("baseForm"==t&&(e.$emit("submitNext",e.apiInfoData),e.$store.dispatch("saveBaseInfo",e.apiInfoData)));h.a.errorMsg(r)}).catch(function(t){e.$message.error({duration:1e3,message:t.message})})},handleQuery:function(t,e,a){var r={type:"object",level:1,properties:{}};for(var s in e.frontParams.properties)e.frontParams.properties[s].frontOriginType==a&&this.$set(r.properties,e.frontParams.properties[s].currentKey,e.frontParams.properties[s]);return r},handleBack:function(t,e,a){var r={type:"object",level:1,properties:{}};for(var s in e.endParams.properties)e.endParams.properties[s].backendOriginType==a&&this.$set(r.properties,e.endParams.properties[s].rootKey,e.endParams.properties[s]);return r},handleConst:function(t,e){var a={type:"object",level:1,properties:{}};for(var r in e.endParams.properties)1==e.endParams.properties[r].constFlag&&this.$set(a.properties,e.endParams.properties[r].currentKey,e.endParams.properties[r]);return a},handleFontData:function(t){var e=this;return u()(n.a.mark(function a(){var r,s,o;return n.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return r=e,s=JSON.parse(c()(t)),o={protocol:s.protocol,requestType:s.requestType,frontBodyType:s.frontBodyType||"json",frontParams:{},headerData:{},queryData:{},bodyJsonData:{},bodyFormData:{}},a.next=5,r.handleQuery(o,s,"query");case 5:return o.queryData=a.sent,a.next=8,r.handleQuery(o,s,"header");case 8:if(o.headerData=a.sent,"POST"!=s.requestType||"form"!=s.frontBodyType){a.next=13;break}return a.next=12,r.handleQuery(o,s,"body");case 12:o.bodyFormData=a.sent;case 13:if("POST"!=s.requestType||"json"!=s.frontBodyType){a.next=17;break}return a.next=16,r.handleQuery(o,s,"body");case 16:o.bodyJsonData=a.sent;case 17:r.$store.dispatch("saveFrontInfo",o);case 18:case"end":return a.stop()}},a,e)}))()},handleBackData:function(t){var e=this;return u()(n.a.mark(function a(){var r,s,o;return n.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return r=e,s=JSON.parse(c()(t)),o={interfaceType:String(s.interfaceType),version:s.version,backendHttpPath:s.backendHttpPath||"",dubboInterface:s.dubboInterface||"",dubboMethod:s.dubboMethod||"",dubboVersion:s.dubboVersion||"",proxyCode:s.proxyCode||"",timeout:2e4,backHeaderData:{},backQueryData:{},backBodyJsonData:{},backBodyFormData:{},constData:{}},a.next=5,r.handleQuery(o,s,"query");case 5:return o.backQueryData=a.sent,a.next=8,r.handleQuery(o,s,"header");case 8:if(o.backHeaderData=a.sent,"POST"!=s.requestType||"form"!=s.frontBodyType){a.next=13;break}return a.next=12,r.handleQuery(o,s,"body");case 12:o.backBodyFormData=a.sent;case 13:if("POST"!=s.requestType||"json"!=s.frontBodyType){a.next=17;break}return a.next=16,r.handleQuery(o,s,"body");case 16:o.backBodyJsonData=a.sent;case 17:return a.next=19,r.handleConst(o,s);case 19:o.constData=a.sent,r.$store.dispatch("saveBackInfo",o);case 21:case"end":return a.stop()}},a,e)}))()},handleResultData:function(t){var e=JSON.parse(c()(t)),a={resultParams:e.resultParams,sucReturn:e.sucReturn,errReturn:e.errReturn,errCode:e.errCode};this.$store.dispatch("saveResultInfo",a)},getData:function(){var t=this,e={interfaceId:t.$route.query.interfaceId,interfaceVersionId:t.$route.query.interfaceVersionId};Object(b.a)("/gateway-manage/get-api",e).then(function(e){var a=e.data;if("0000"==a.code)return a.result.frontParams=JSON.parse(a.result.frontParams),a.result.endParams=JSON.parse(a.result.endParams),a.result.errCode=JSON.parse(a.result.errCode),a.result.resultParams=JSON.parse(a.result.resultParams),t.apiInfoData.interfaceId=a.result.interfaceId,t.apiInfoData.interfaceVersionId=a.result.interfaceVersionId,t.apiInfoData.interfaceName=a.result.interfaceName,t.apiInfoData.target=String(a.result.target),t.apiInfoData.optType=a.result.optType,t.apiInfoData.interfaceUrl=a.result.interfaceUrl,t.apiInfoData.interfaceDescribe=a.result.interfaceDescribe,t.handleFontData(a.result),t.handleBackData(a.result),t.handleResultData(a.result),!1;h.a.errorMsg(a)}).catch(function(e){t.$message.error({duration:1e3,message:e.message})})}},mounted:function(){this.$route.query.interfaceId&&!o()(this.$store.state.baseInfo).length&&this.getData(),o()(this.$store.state.baseInfo).length&&(this.apiInfoData=this.$store.state.baseInfo)}},v={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"base-info-show border-box"},[a("el-form",{ref:"baseForm",attrs:{"label-width":"104px",model:t.apiInfoData,rules:t.rules}},[a("el-form-item",{attrs:{label:"API名称:",prop:"interfaceName"}},[a("limitInput",{attrs:{inputWidth:329,inputValue:t.apiInfoData.interfaceName,holder:"请输入API名称",getByType:"word",maxLength:20},on:{"update:inputValue":function(e){t.$set(t.apiInfoData,"interfaceName",e)}}})],1),t._v(" "),a("el-form-item",{attrs:{label:"API类型:",prop:"target"}},[a("el-radio-group",{model:{value:t.apiInfoData.target,callback:function(e){t.$set(t.apiInfoData,"target",e)},expression:"apiInfoData.target"}},[a("el-radio",{attrs:{label:"1"}},[t._v("公开")]),t._v(" "),a("el-radio",{attrs:{label:"0"}},[t._v("私有")])],1)],1),t._v(" "),a("el-form-item",{attrs:{label:"访问类型:",prop:"optType"}},[a("el-select",{attrs:{placeholder:"请选择"},model:{value:t.apiInfoData.optType,callback:function(e){t.$set(t.apiInfoData,"optType",e)},expression:"apiInfoData.optType"}},[a("el-option",{attrs:{label:"list",value:"list"}}),t._v(" "),a("el-option",{attrs:{label:"delete",value:"delete"}}),t._v(" "),a("el-option",{attrs:{label:"update",value:"update"}}),t._v(" "),a("el-option",{attrs:{label:"get",value:"get"}}),t._v(" "),a("el-option",{attrs:{label:"search",value:"search"}})],1)],1),t._v(" "),a("el-form-item",{attrs:{label:"请求路径:",prop:"interfaceUrl"}},[a("el-input",{staticClass:"w-329",on:{blur:t.blurInterfaceUrl},model:{value:t.apiInfoData.interfaceUrl,callback:function(e){t.$set(t.apiInfoData,"interfaceUrl",e)},expression:"apiInfoData.interfaceUrl"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"描述:"}},[a("limit-textarea",{attrs:{inputWidth:500,inputValue:t.apiInfoData.interfaceDescribe,holder:"",getByType:"word",maxLength:100},on:{"update:inputValue":function(e){t.$set(t.apiInfoData,"interfaceDescribe",e)}}})],1),t._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:function(e){t.submitForm("baseForm")}}},[t._v("下一步")])],1)],1)],1)},staticRenderFns:[]};var _=a("VU/8")(m,v,!1,function(t){a("rzMK")},"data-v-3c8acab2",null).exports,D={name:"header-param",props:{itemData:{type:Object,default:function(){return{}}},frontOriginType:{type:String,default:function(){return""}}},data:function(){return{trData:{type:"object",properties:{name:{frontOriginType:this.frontOriginType,type:"string",currentKey:"name",isBackendField:0,defaultVal:"val",isRootKey:0,rootKey:"",objectClass:"",description:"描述",example:"示例",check:!0}}},keyLength:1}},methods:{blurKey:function(t,e){t.currentKey!=e&&(this.$set(this.itemData.properties,t.currentKey,t),this.$delete(this.itemData.properties,e))},handleDel:function(t,e,a){this.$delete(this.itemData.properties,e)},toAddItem:function(){var t=this.keyLength++;this.$set(this.itemData.properties,"field"+t,{frontOriginType:this.frontOriginType,backendOriginType:this.frontOriginType,type:"string",currentKey:"field"+t,isBackendField:0,defaultVal:"val",isRootKey:0,rootKey:"",objectClass:"",description:"描述",example:"示例",check:!0})}},watch:{itemData:function(t,e){this.trData=JSON.parse(c()(t))}},mounted:function(){this.trData=JSON.parse(c()(this.itemData))}},g={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{staticClass:"el-table el-table--fit el-table--enable-row-hover el-table--enable-row-transition",staticStyle:{width:"100%","table-layout":"fixed"}},[t._m(0),t._v(" "),a("div",{staticClass:"el-table__body-wrapper is-scrolling-none"},[a("div",{staticClass:"table-content"},[t._l(t.itemData.properties,function(e,r,s){return[a("table",{key:s+r+121,staticClass:"el-table__body",staticStyle:{width:"100%","table-layout":"fixed"},attrs:{cellspacing:"0",cellpadding:"0",border:"0"}},[a("tbody",[a("tr",{staticClass:"el-table__row"},[a("td",{staticClass:"el-table_1_column_1",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-input",{on:{blur:function(a){t.blurKey(e,r)}},model:{value:e.currentKey,callback:function(a){t.$set(e,"currentKey",a)},expression:"itemValue.currentKey"}})],1)]),t._v(" "),a("td",{staticClass:"el-table_1_column_2",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-select",{attrs:{placeholder:"请选择参数类型"},model:{value:e.type,callback:function(a){t.$set(e,"type",a)},expression:"itemValue.type"}},[a("el-option",{attrs:{label:"string",value:"string"}}),t._v(" "),a("el-option",{attrs:{label:"number",value:"number"}}),t._v(" "),a("el-option",{attrs:{label:"boolean",value:"boolean"}})],1)],1)]),t._v(" "),a("td",{staticClass:"el-table_1_column_3",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-checkbox",{model:{value:e.check,callback:function(a){t.$set(e,"check",a)},expression:"itemValue.check"}})],1)]),t._v(" "),a("td",{staticClass:"el-table_1_column_3",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-input",{model:{value:e.defaultVal,callback:function(a){t.$set(e,"defaultVal",a)},expression:"itemValue.defaultVal"}})],1)]),t._v(" "),a("td",{staticClass:"el-table_1_column_3",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-input",{model:{value:e.example,callback:function(a){t.$set(e,"example",a)},expression:"itemValue.example"}})],1)]),t._v(" "),a("td",{staticClass:"el-table_1_column_3",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-input",{model:{value:e.description,callback:function(a){t.$set(e,"description",a)},expression:"itemValue.description"}})],1)]),t._v(" "),a("td",{staticClass:"el-table_1_column_3",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-button",{attrs:{type:"text"},on:{click:function(a){t.handleDel(e,r,s)}}},[t._v("删除")])],1)])])])])]})],2)])]),t._v(" "),a("div",{staticClass:"add-line text-center",on:{click:t.toAddItem}},[a("i",{staticClass:"el-icon-circle-plus-outline color-5584FF"}),a("span",{staticClass:"color-5584FF font-14 p-l-4"},[t._v("添加行")])])])},staticRenderFns:[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"el-table__header-wrapper"},[a("table",{staticClass:"el-table__header",staticStyle:{width:"100%","table-layout":"fixed"},attrs:{cellspacing:"0",cellpadding:"0",border:"0"}},[a("thead",{staticClass:"has-gutter"},[a("tr",{},[a("th",{staticClass:"el-table_1_column_1 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("参数名")])]),t._v(" "),a("th",{staticClass:"el-table_1_column_2 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("参数类型")])]),t._v(" "),a("th",{staticClass:"el-table_1_column_3 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("必选")])]),t._v(" "),a("th",{staticClass:"el-table_1_column_4 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("默认值")])]),t._v(" "),a("th",{staticClass:"el-table_1_column_5 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("示例")])]),t._v(" "),a("th",{staticClass:"el-table_1_column_6 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("描述")])]),t._v(" "),a("th",{staticClass:"el-table_1_column_7 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("操作")])])])])])])}]};var k=a("VU/8")(D,g,!1,function(t){a("U0Ri")},"data-v-7c30b63f",null).exports,C={name:"body-row",props:{itemData:{type:Object,default:function(){return{}}},frontOriginType:{type:String,default:function(){return""}}},data:function(){return{trData:{},keyLength:1}},methods:{blurKey:function(t,e){t.currentKey!=e&&(this.$set(this.itemData.properties,t.currentKey,t),this.$delete(this.itemData.properties,e))},handleDel:function(t,e,a,r){this.handleDelData(this.itemData,t,e)},handleDelData:function(t,e,a){this.handleObjData(t,e,a)},handleObjData:function(t,e,a){for(var r in t)t[r]==e&&this.$delete(t.properties,a)},changeType:function(t,e,a,r){"string"!=t&&"boolean"!=t&&"number"!=t&&"object"!=t||(e.properties={},e.hasOwnProperty("items")&&this.$delete(e,"items")),"array"==t&&this.$set(e,"items",{parentKey:a,level:parseInt(r)+1,frontOriginType:this.frontOriginType,backendOriginType:this.frontOriginType,type:"string",isBackendField:0,defaultVal:"val",isRootKey:0,rootKey:"",objectClass:"",description:"描述",example:"示例",check:!0,properties:{}}),this.$forceUpdate()},handleAdd:function(t,e,a,r){var s=this.keyLength++;if("array"==t.type)return this.$set(t.items.properties,"field"+s,{parentKey:e,level:parseInt(r)+1,frontOriginType:this.frontOriginType,backendOriginType:this.frontOriginType,type:"string",currentKey:"field"+s,isBackendField:0,defaultVal:"val",isRootKey:0,rootKey:"",objectClass:"",description:"描述",example:"示例",check:!0,properties:{}}),this.$forceUpdate(),!1;this.$set(t.properties,"field"+s,{parentKey:e,level:parseInt(r)+1,frontOriginType:this.frontOriginType,backendOriginType:this.frontOriginType,type:"string",currentKey:"field"+s,isBackendField:0,defaultVal:"val",isRootKey:0,rootKey:"",objectClass:"",description:"描述",example:"示例",check:!0,properties:{}}),this.$forceUpdate()}},watch:{itemData:function(t,e){t&&(this.trData=JSON.parse(c()(t)))}},mounted:function(){this.trData=JSON.parse(c()(this.itemData))}},w={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[t._l(t.itemData.properties,function(e,r,s){return[a("table",{key:s+r+121,staticClass:"el-table__body",staticStyle:{width:"100%","table-layout":"fixed"},attrs:{cellspacing:"0",cellpadding:"0",border:"0"}},[a("tbody",[a("tr",{staticClass:"el-table__row"},[a("td",{staticClass:"el-table_1_column_1",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-input",{attrs:{disabled:2==e.level},on:{blur:function(a){t.blurKey(e,r)}},model:{value:e.currentKey,callback:function(a){t.$set(e,"currentKey",a)},expression:"itemValue.currentKey"}})],1)]),t._v(" "),a("td",{staticClass:"el-table_1_column_2",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-select",{attrs:{placeholder:"请选择参数类型"},on:{change:function(a){t.changeType(e.type,e,e.currentKey,e.level)}},model:{value:e.type,callback:function(a){t.$set(e,"type",a)},expression:"itemValue.type"}},[a("el-option",{attrs:{label:"string",value:"string"}}),t._v(" "),a("el-option",{attrs:{label:"number",value:"number"}}),t._v(" "),a("el-option",{attrs:{label:"boolean",value:"boolean"}}),t._v(" "),a("el-option",{attrs:{label:"object",value:"object"}}),t._v(" "),a("el-option",{attrs:{label:"array",value:"array"}})],1)],1)]),t._v(" "),a("td",{staticClass:"el-table_1_column_3",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-checkbox",{model:{value:e.check,callback:function(a){t.$set(e,"check",a)},expression:"itemValue.check"}})],1)]),t._v(" "),a("td",{staticClass:"el-table_1_column_3",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-input",{model:{value:e.defaultVal,callback:function(a){t.$set(e,"defaultVal",a)},expression:"itemValue.defaultVal"}})],1)]),t._v(" "),a("td",{staticClass:"el-table_1_column_3",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-input",{model:{value:e.example,callback:function(a){t.$set(e,"example",a)},expression:"itemValue.example"}})],1)]),t._v(" "),a("td",{staticClass:"el-table_1_column_3",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-input",{model:{value:e.description,callback:function(a){t.$set(e,"description",a)},expression:"itemValue.description"}})],1)]),t._v(" "),a("td",{staticClass:"el-table_1_column_3",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},["array"==e.type||"object"==e.type?a("el-button",{attrs:{type:"text"},on:{click:function(a){t.handleAdd(e,e.currentKey,s,e.level)}}},[t._v("添加子属性")]):t._e(),t._v(" "),2!=e.level?a("el-button",{attrs:{type:"text"},on:{click:function(a){t.handleDel(e.parentKey,e.currentKey,s,e.level)}}},[t._v("删除")]):t._e()],1)])])])]),t._v(" "),"array"==e.type&&Object.keys(e.items.properties).length?a("body-row",{key:s+"122"+r,staticClass:"el-table__row",staticStyle:{"padding-left":"10px"},attrs:{itemData:e.items}}):t._e(),t._v(" "),"object"==e.type&&Object.keys(e.properties).length?a("body-row",{key:s+"122"+r,staticClass:"el-table__row",staticStyle:{"padding-left":"10px"},attrs:{itemData:e}}):t._e()]})],2)},staticRenderFns:[]};var x=a("VU/8")(C,w,!1,function(t){a("TN1V")},"data-v-0637f5c0",null).exports,I={name:"create-front",components:{limitTextarea:d.a,limitInput:f.a,headerParam:k,bodyParam:x},data:function(){return{apiInfoData:{protocol:"http",requestType:"GET",frontBodyType:"json",frontParams:{},headerData:{},queryData:{},bodyJsonData:{},bodyFormData:{}},headerData:{type:"object",level:1,properties:{header:{level:2,currentKey:"header",frontOriginType:"header",backendOriginType:"header",type:"string",isBackendField:0,defaultVal:"val",isRootKey:0,rootKey:"",objectClass:"",description:"描述",example:"示例",check:!0,properties:{}}},required:[]},queryData:{type:"object",level:1,properties:{query:{level:2,currentKey:"query",frontOriginType:"query",backendOriginType:"query",type:"string",isBackendField:0,defaultVal:"val",isRootKey:0,rootKey:"",objectClass:"",description:"描述",example:"示例",check:!0,properties:{}}},required:[]},bodyJsonData:{type:"object",level:1,properties:{root:{level:2,currentKey:"root",frontOriginType:"body",backendOriginType:"body",type:"object",isBackendField:0,defaultVal:"val",isRootKey:0,rootKey:"",objectClass:"",description:"描述",example:"示例",check:!0,properties:{}}},required:[]},bodyFormData:{type:"object",level:1,properties:{root:{level:2,currentKey:"root",frontOriginType:"body",backendOriginType:"body",type:"string",isBackendField:0,defaultVal:"val",isRootKey:0,rootKey:"",objectClass:"",description:"描述",example:"示例",check:!0,properties:{}}},required:[]},rules:{requestType:[{required:!0,message:"请选择请求方法",trigger:"blur"}]}}},methods:{refreshData:function(t){this.frontData=t},submitback:function(){this.$emit("submitBack")},submitForm:function(t){var e=this;e.$refs[t].validate(function(t){if(!t)return!1;e.handleData()})},handleData:function(){if("POST"==this.apiInfoData.requestType&&"json"==this.apiInfoData.frontBodyType){if(o()(this.bodyFormData.properties.root.properties).length)for(var t in this.bodyFormData.properties.root.required=[],this.bodyFormData.properties.root.properties)this.bodyFormData.properties.root.properties[t].check&&this.bodyFormData.properties.root.required.push(t);this.apiInfoData.bodyJsonData=this.bodyJsonData}else this.apiInfoData.bodyJsonData={};if("POST"==this.apiInfoData.requestType&&"form"==this.apiInfoData.frontBodyType){if(o()(this.bodyFormData.properties).length)for(var e in this.bodyFormData.required=[],this.bodyFormData.properties)this.bodyFormData.properties[e].check&&this.bodyFormData.required.push(e);this.apiInfoData.bodyFormData=this.bodyFormData}else this.apiInfoData.bodyFormData={};if(o()(this.headerData.properties).length)for(var a in this.headerData.required=[],this.headerData.properties)this.headerData.properties[a].check&&this.headerData.required.push(a);if(o()(this.queryData.properties).length)for(var r in this.queryData.required=[],this.queryData.properties)this.queryData.properties[r].check&&this.queryData.required.push(r);this.apiInfoData.headerData=this.headerData,this.apiInfoData.queryData=this.queryData,this.$store.dispatch("saveFrontInfo",this.apiInfoData),this.$emit("submitNext",this.apiInfoData)},handleStoreData:function(){this.apiInfoData=JSON.parse(c()(this.$store.state.frontInfo)),this.headerData=this.apiInfoData.headerData,this.queryData=this.apiInfoData.queryData;this.bodyJsonData=o()(this.apiInfoData.bodyJsonData).length?this.apiInfoData.bodyJsonData:{type:"object",level:1,properties:{root:{level:2,currentKey:"root",frontOriginType:"body",backendOriginType:"body",type:"object",isBackendField:0,defaultVal:"val",isRootKey:0,rootKey:"",objectClass:"",description:"描述",example:"示例",check:!0,properties:{}}},required:[]},this.bodyFormData=o()(this.apiInfoData.bodyFormData).length?this.apiInfoData.bodyFormData:{type:"object",level:1,properties:{root:{level:2,currentKey:"root",frontOriginType:"body",backendOriginType:"body",type:"string",isBackendField:0,defaultVal:"val",isRootKey:0,rootKey:"",objectClass:"",description:"描述",example:"示例",check:!0,properties:{}}},required:[]}}},mounted:function(){o()(this.$store.state.frontInfo).length&&this.handleStoreData()}},T={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"base-info-show border-box"},[a("el-form",{ref:"baseForm",attrs:{"label-width":"104px",model:t.apiInfoData,rules:t.rules}},[a("el-form-item",{attrs:{label:"协议:",prop:"protocol"}},[t._v(t._s(t.apiInfoData.protocol))]),t._v(" "),a("el-form-item",{attrs:{label:"请求方法:",prop:"requestType"}},[a("el-select",{attrs:{placeholder:"请选择"},model:{value:t.apiInfoData.requestType,callback:function(e){t.$set(t.apiInfoData,"requestType",e)},expression:"apiInfoData.requestType"}},[a("el-option",{attrs:{label:"GET",value:"GET"}}),t._v(" "),a("el-option",{attrs:{label:"POST",value:"POST"}})],1)],1),t._v(" "),a("el-form-item",{staticClass:"color-303133 font-w-700",attrs:{label:"参数配置"}}),t._v(" "),a("el-form-item",{attrs:{label:"参数位置:"}},[a("div",{staticClass:"font-14 color-303133"},[t._v("header")])]),t._v(" "),a("el-form-item",{attrs:{label:""}},[a("header-param",{ref:"frontHeaderTable",attrs:{itemData:t.headerData,frontOriginType:"header"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"参数位置:"}},[a("div",{staticClass:"font-14 color-303133"},[t._v("query")])]),t._v(" "),a("el-form-item",{attrs:{label:""}},[a("header-param",{ref:"frontQueryTable",attrs:{itemData:t.queryData,frontOriginType:"query"}})],1),t._v(" "),"POST"==t.apiInfoData.requestType?a("el-form-item",{attrs:{label:"参数位置:"}},[a("div",{staticClass:"font-14 color-303133"},[t._v("body")]),t._v(" "),a("div",{staticClass:"font-14 color-303133"},[a("el-radio",{attrs:{label:"json"},model:{value:t.apiInfoData.frontBodyType,callback:function(e){t.$set(t.apiInfoData,"frontBodyType",e)},expression:"apiInfoData.frontBodyType"}},[t._v("json")]),t._v(" "),a("el-radio",{attrs:{label:"form"},model:{value:t.apiInfoData.frontBodyType,callback:function(e){t.$set(t.apiInfoData,"frontBodyType",e)},expression:"apiInfoData.frontBodyType"}},[t._v("form")])],1)]):t._e(),t._v(" "),"POST"==t.apiInfoData.requestType&&"json"==t.apiInfoData.frontBodyType?a("el-form-item",{attrs:{label:""}},[a("div",{staticClass:"body-param-wrap"},[a("div",{staticClass:"el-table el-table--fit el-table--enable-row-hover el-table--enable-row-transition",staticStyle:{width:"100%","table-layout":"fixed"}},[a("div",{staticClass:"el-table__header-wrapper"},[a("table",{staticClass:"el-table__header",staticStyle:{width:"100%","table-layout":"fixed"},attrs:{cellspacing:"0",cellpadding:"0",border:"0"}},[a("thead",{staticClass:"has-gutter"},[a("tr",{},[a("th",{staticClass:"el-table_1_column_1 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("参数名")])]),t._v(" "),a("th",{staticClass:"el-table_1_column_2 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("参数类型")])]),t._v(" "),a("th",{staticClass:"el-table_1_column_3 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("必选")])]),t._v(" "),a("th",{staticClass:"el-table_1_column_4 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("默认值")])]),t._v(" "),a("th",{staticClass:"el-table_1_column_5 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("示例")])]),t._v(" "),a("th",{staticClass:"el-table_1_column_6 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("描述")])]),t._v(" "),a("th",{staticClass:"el-table_1_column_7 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("操作")])])])])])]),t._v(" "),a("div",{staticClass:"el-table__body-wrapper is-scrolling-none"},[a("div",{staticClass:"table-content"},[a("body-param",{ref:"frontBodyJsonTable",attrs:{itemData:t.bodyJsonData,frontOriginType:"body"},on:{refreshData:t.refreshData}})],1)])])])]):t._e(),t._v(" "),"POST"==t.apiInfoData.requestType&&"form"==t.apiInfoData.frontBodyType?a("el-form-item",{attrs:{label:""}},[a("header-param",{ref:"frontBodyFormTable",attrs:{itemData:t.bodyFormData,frontOriginType:"body"}})],1):t._e(),t._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:t.submitback}},[t._v("上一步")]),t._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(e){t.submitForm("baseForm")}}},[t._v("下一步")])],1)],1)],1)},staticRenderFns:[]};var $=a("VU/8")(I,T,!1,function(t){a("3Xh1")},"data-v-84fc2b9c",null).exports,O={name:"back-table-row",props:{itemData:{type:[Object,Array],default:function(){return{}}}},data:function(){return{trData:{}}},watch:{itemData:function(t,e){this.trData=t}},mounted:function(){this.trData=this.itemData}},F={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[t._l(t.itemData.properties,function(e,r,s){return[a("table",{key:s+r+121,staticClass:"el-table__body",staticStyle:{width:"100%","table-layout":"fixed"},attrs:{cellspacing:"0",cellpadding:"0",border:"0"}},[a("tbody",[a("tr",{staticClass:"el-table__row"},[a("td",{staticClass:"el-table_1_column_1",staticStyle:{width:"36px"},attrs:{rowspan:"1",colspan:"1"}},["object"==e.type||"array"==e.type?a("div",{staticClass:"cell"},[a("i",{staticClass:"el-icon-minus"})]):t._e()]),t._v(" "),a("td",{staticClass:"el-table_1_column_1",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[t._v(t._s(r))])]),t._v(" "),a("td",{staticClass:"el-table_1_column_2",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[t._v(t._s(e.frontOriginType))])]),t._v(" "),a("td",{staticClass:"el-table_1_column_2",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[t._v(t._s(e.type))])])])])]),t._v(" "),"array"==e.type&&Object.keys(e.items.properties).length?a("back-table-row",{key:s+"122"+r,staticClass:"el-table__row",staticStyle:{"padding-left":"10px"},attrs:{itemData:e.items}}):t._e(),t._v(" "),"object"==e.type&&Object.keys(e.properties).length?a("back-table-row",{key:s+"122"+r,staticClass:"el-table__row",staticStyle:{"padding-left":"10px"},attrs:{itemData:e}}):t._e()]})],2)},staticRenderFns:[]};var K=a("VU/8")(O,F,!1,function(t){a("GUiu")},"data-v-a1d428da",null).exports,j={name:"back-table-row",props:{itemData:{type:[Object,Array],default:function(){return{}}},interfaceType:{type:String,default:function(){return"0"}}},data:function(){return{trData:{}}},methods:{blurKey:function(t,e){t.rootKey!=e&&(this.$set(this.itemData.properties,t.rootKey,t),this.$delete(this.itemData.properties,e))},changeCheck:function(t,e){if("object"==t.type&&o()(t.properties).length)for(var a in t.properties)t.properties[a].isRootKey=!1;if("array"==t.type&&o()(t.items.properties).length)for(var r in t.items.properties)t.items.properties[r].isRootKey=!1}},watch:{itemData:function(t,e){this.trData=JSON.parse(c()(t))}},mounted:function(){this.trData=JSON.parse(c()(this.itemData))}},S={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[t._l(t.itemData.properties,function(e,r,s){return[a("table",{key:s+r+121,staticClass:"el-table__body",staticStyle:{width:"100%","table-layout":"fixed"},attrs:{cellspacing:"0",cellpadding:"0",border:"0"}},[a("tbody",[a("tr",{staticClass:"el-table__row"},[a("td",{staticClass:"el-table_1_column_1",staticStyle:{width:"36px"},attrs:{rowspan:"1",colspan:"1"}},["object"==e.type||"array"==e.type?a("div",{staticClass:"cell"},[a("i",{staticClass:"el-icon-minus"})]):t._e()]),t._v(" "),a("td",{staticClass:"el-table_1_column_1",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-checkbox",{attrs:{disabled:t.itemData.isRootKey},on:{change:function(a){t.changeCheck(e,r)}},model:{value:e.isRootKey,callback:function(a){t.$set(e,"isRootKey",a)},expression:"itemValue.isRootKey"}})],1)]),t._v(" "),a("td",{staticClass:"el-table_1_column_1",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-input",{staticClass:"w-110",attrs:{placeholder:"请输入参数名"},on:{blur:function(a){t.blurKey(e,r)}},model:{value:e.rootKey,callback:function(a){t.$set(e,"rootKey",a)},expression:"itemValue.rootKey"}})],1)]),t._v(" "),"0"==t.interfaceType?a("td",{staticClass:"el-table_1_column_2",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-select",{attrs:{placeholder:"请选择参数位置"},model:{value:e.backendOriginType,callback:function(a){t.$set(e,"backendOriginType",a)},expression:"itemValue.backendOriginType"}},[a("el-option",{attrs:{label:"header",value:"header"}}),t._v(" "),a("el-option",{attrs:{label:"query",value:"query"}}),t._v(" "),a("el-option",{attrs:{label:"body",value:"body"}})],1)],1)]):t._e(),t._v(" "),a("td",{staticClass:"el-table_1_column_3",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[t._v(t._s(e.type))])]),t._v(" "),a("td",{staticClass:"el-table_1_column_4",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-input",{staticClass:"w-110",attrs:{placeholder:"请输入参数值"},model:{value:e.defaultVal,callback:function(a){t.$set(e,"defaultVal",a)},expression:"itemValue.defaultVal"}})],1)]),t._v(" "),"1"==t.interfaceType?a("td",{staticClass:"el-table_1_column_4",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-input",{staticClass:"w-110",attrs:{placeholder:"请输入包路径"},model:{value:e.objectClass,callback:function(a){t.$set(e,"objectClass",a)},expression:"itemValue.objectClass"}})],1)]):t._e(),t._v(" "),"1"==t.interfaceType?a("td",{staticClass:"el-table_1_column_4",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-input",{staticClass:"w-110",attrs:{placeholder:"请输入排序"},model:{value:e.sort,callback:function(a){t.$set(e,"sort",a)},expression:"itemValue.sort"}})],1)]):t._e()])])]),t._v(" "),"array"==e.type?a("back-table-row",{key:s+"122"+r,staticClass:"el-table__row child-row",attrs:{itemData:e.items}}):t._e(),t._v(" "),"object"==e.type?a("back-table-row",{key:s+"122"+r,staticClass:"el-table__row child-row",attrs:{itemData:e}}):t._e()]})],2)},staticRenderFns:[]};var q=a("VU/8")(j,S,!1,function(t){a("OSAk")},"data-v-0f24fbf8",null).exports,V={name:"back-constant",props:{itemData:{type:Object,default:function(){return{}}},interfaceType:{type:[String,Number],default:function(){return"0"}}},data:function(){return{trData:{type:"object",properties:{name:{backendOriginType:"query",type:"string",constFlag:!0,currentKey:"name",isBackendField:0,defaultVal:"val",isRootKey:0,rootKey:"",objectClass:"",description:"描述",example:"示例",check:!0}}},keyLength:1}},methods:{blurKey:function(t,e){t.currentKey!=e&&(this.$set(this.itemData.properties,t.currentKey,t),this.$delete(this.itemData.properties,e))},handleDel:function(t,e,a){this.$delete(this.itemData.properties,e)},toAddItem:function(){var t=this.keyLength++;this.$set(this.itemData.properties,"field"+t,{backendOriginType:"query",type:"string",currentKey:"field"+t,constFlag:!0,isBackendField:0,defaultVal:"val",isRootKey:0,rootKey:"",objectClass:"",description:"描述",example:"示例",check:!0})}},watch:{itemData:function(t,e){this.trData=JSON.parse(c()(t))},interfaceType:function(t,e){this.backType=t}},mounted:function(){this.trData=JSON.parse(c()(this.itemData))}},B={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{staticClass:"el-table el-table--fit el-table--enable-row-hover el-table--enable-row-transition",staticStyle:{width:"100%","table-layout":"fixed"}},[a("div",{staticClass:"el-table__header-wrapper"},[a("table",{staticClass:"el-table__header",staticStyle:{width:"100%","table-layout":"fixed"},attrs:{cellspacing:"0",cellpadding:"0",border:"0"}},[a("thead",{staticClass:"has-gutter"},[a("tr",{},[t._m(0),t._v(" "),"0"==t.interfaceType?a("th",{staticClass:"el-table_1_column_2 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("参数位置")])]):t._e(),t._v(" "),t._m(1),t._v(" "),t._m(2),t._v(" "),t._m(3)])])])]),t._v(" "),a("div",{staticClass:"el-table__body-wrapper is-scrolling-none"},[a("div",{staticClass:"table-content"},[t._l(t.itemData.properties,function(e,r,s){return[a("table",{key:s+r+121,staticClass:"el-table__body",staticStyle:{width:"100%","table-layout":"fixed"},attrs:{cellspacing:"0",cellpadding:"0",border:"0"}},[a("tbody",[a("tr",{staticClass:"el-table__row"},[a("td",{staticClass:"el-table_1_column_1",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-input",{attrs:{placeholder:"请输入参数名"},on:{blur:function(a){t.blurKey(e,r)}},model:{value:e.currentKey,callback:function(a){t.$set(e,"currentKey",a)},expression:"itemValue.currentKey"}})],1)]),t._v(" "),"0"==t.interfaceType?a("td",{staticClass:"el-table_1_column_2",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-select",{attrs:{placeholder:"请选择参数位置"},model:{value:e.backendOriginType,callback:function(a){t.$set(e,"backendOriginType",a)},expression:"itemValue.backendOriginType"}},[a("el-option",{attrs:{label:"header",value:"header"}}),t._v(" "),a("el-option",{attrs:{label:"query",value:"query"}}),t._v(" "),a("el-option",{attrs:{label:"body",value:"body"}})],1)],1)]):t._e(),t._v(" "),a("td",{staticClass:"el-table_1_column_2",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-select",{attrs:{placeholder:"请选择参数类型"},model:{value:e.type,callback:function(a){t.$set(e,"type",a)},expression:"itemValue.type"}},[a("el-option",{attrs:{label:"string",value:"string"}}),t._v(" "),a("el-option",{attrs:{label:"number",value:"number"}}),t._v(" "),a("el-option",{attrs:{label:"boolean",value:"boolean"}})],1)],1)]),t._v(" "),a("td",{staticClass:"el-table_1_column_3",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-input",{model:{value:e.defaultVal,callback:function(a){t.$set(e,"defaultVal",a)},expression:"itemValue.defaultVal"}})],1)]),t._v(" "),a("td",{staticClass:"el-table_1_column_3",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-button",{attrs:{type:"text"},on:{click:function(a){t.handleDel(e,r,s)}}},[t._v("删除")])],1)])])])])]})],2)])]),t._v(" "),a("div",{staticClass:"add-line text-center",on:{click:t.toAddItem}},[a("i",{staticClass:"el-icon-circle-plus-outline color-5584FF"}),a("span",{staticClass:"color-5584FF font-14 p-l-4"},[t._v("添加常量参数")])])])},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("th",{staticClass:"el-table_1_column_1 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[e("div",{staticClass:"cell"},[this._v("参数名")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("th",{staticClass:"el-table_1_column_2 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[e("div",{staticClass:"cell"},[this._v("参数类型")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("th",{staticClass:"el-table_1_column_4 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[e("div",{staticClass:"cell"},[this._v("参数值")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("th",{staticClass:"el-table_1_column_7 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[e("div",{staticClass:"cell"},[this._v("操作")])])}]};var P=a("VU/8")(V,B,!1,function(t){a("1i9K")},"data-v-b6b59a6a",null).exports,N={name:"create-backend",components:{limitTextarea:d.a,limitInput:f.a,backTableLeft:K,backConstant:P,backTableRight:q},data:function(){var t=this;return{apiInfoData:{interfaceType:"0",version:"",backendHttpPath:"",dubboInterface:"",dubboMethod:"",dubboVersion:"",proxyCode:"",timeout:2e4},backHeaderData:{},backQueryData:{},backBodyJsonData:{},backBodyFormData:{},rules:{version:[{required:!0,message:"请输入API版本号",trigger:"blur"}],backendHttpPath:[{required:!0,validator:function(e,a,r){""===a&&"0"==t.apiInfoData.interfaceType?r(new Error("请输入请求路径")):r()},trigger:"blur"}],timeout:[{required:!0,message:"请输入超时时长",trigger:"blur"}],dubboInterface:[{required:!0,validator:function(e,a,r){""===a&&"1"==t.apiInfoData.interfaceType?r(new Error("请输入dubbo接口名称")):r()},trigger:"blur"}],dubboMethod:[{required:!0,validator:function(e,a,r){""===a&&"1"==t.apiInfoData.interfaceType?r(new Error("请输入dubbo请求方法")):r()},trigger:"blur"}],dubboVersion:[{required:!0,validator:function(e,a,r){""===a&&"1"==t.apiInfoData.interfaceType?r(new Error("请输入请求版本号")):r()},trigger:"blur"}],proxyCode:[{required:!0,validator:function(e,a,r){""===a&&"1"==t.apiInfoData.interfaceType?r(new Error("请选择注册中心地址")):r()},trigger:"blur"}]},envSetOptions:[],constData:{type:"object",level:1,properties:{root:{level:2,currentKey:"root",constFlag:!0,backendOriginType:"header",type:"string",isBackendField:0,defaultVal:"val",isRootKey:0,rootKey:"",objectClass:"",description:"描述",example:"示例",check:!0,properties:{}}}}}},methods:{changeType:function(t){var e=this;e.$nextTick(function(){e.$refs.backForm.resetFields(),e.apiInfoData.interfaceType=t})},submitback:function(){this.$emit("submitBack")},submitForm:function(t){var e=this;e.$refs[t].validate(function(t){if(!t)return!1;e.handlebackData()})},handlebackData:function(){this.apiInfoData.backHeaderData=this.backHeaderData,this.apiInfoData.backQueryData=this.backQueryData,this.apiInfoData.backBodyJsonData=this.backBodyJsonData,this.apiInfoData.backBodyFormData=this.backBodyFormData,this.apiInfoData.constData=this.constData,this.$emit("submitNext",this.apiInfoData),this.$store.dispatch("saveBackInfo",this.apiInfoData)},getEnvSetData:function(){var t=this,e={search:t.searchValue,pageNum:t.currentPage,pageSize:100};Object(b.b)("/gateway-manage/page-proxy",e).then(function(e){var a=e.data;if("0000"==a.code)return t.envSetOptions=a.result.result||[],void(t.totalCount=a.result.totalCount);h.a.errorMsg(a)}).catch(function(e){t.$message.error({duration:1e3,message:e.message})})},handleFrontData:function(){var t=JSON.parse(c()(this.$store.state.frontInfo));if(o()(t.headerData).length){for(var e in t.headerData.properties)t.headerData.properties[e].isRootKey=!0,t.headerData.properties[e].rootKey=e,t.headerData.properties[e].backendOriginType=t.headerData.properties[e].frontOriginType,t.headerData.properties[e].isBackendField=1,t.headerData.properties[e].objectClass="",t.headerData.properties[e].sort=0;this.backHeaderData=JSON.parse(c()(t.headerData)),this.frontHeaderData=JSON.parse(c()(t.headerData))}if(o()(t.queryData).length){for(var a in t.queryData.properties)t.queryData.properties[a].isRootKey=!0,t.queryData.properties[a].rootKey=a,t.queryData.properties[a].backendOriginType=t.queryData.properties[a].frontOriginType,t.queryData.properties[a].isBackendField=1,t.queryData.properties[a].objectClass="",t.queryData.properties[a].sort=0;this.backQueryData=JSON.parse(c()(t.queryData)),this.frontQueryData=JSON.parse(c()(t.queryData))}if(o()(t.bodyFormData).length){for(var r in t.bodyFormData.properties)t.bodyFormData.properties[r].isRootKey=!0,t.bodyFormData.properties[r].rootKey=r,t.bodyFormData.properties[r].backendOriginType=t.bodyFormData.properties[r].frontOriginType,t.bodyFormData.properties[r].isBackendField=1,t.bodyFormData.properties[r].objectClass="",t.bodyFormData.properties[r].sort=0;this.backBodyFormData=JSON.parse(c()(t.bodyFormData)),this.frontBodyFormData=JSON.parse(c()(t.bodyFormData))}if(o()(t.bodyJsonData).length){for(var s in t.bodyJsonData.properties)t.bodyJsonData.properties[s].isRootKey=!0,t.bodyJsonData.properties[s].rootKey=s,t.bodyJsonData.properties[s].backendOriginType=t.bodyJsonData.properties[s].frontOriginType,t.bodyJsonData.properties[s].isBackendField=1,t.bodyJsonData.properties[s].objectClass="",t.bodyJsonData.properties[s].sort=0;this.backBodyJsonData=JSON.parse(c()(t.bodyJsonData)),this.frontBodyJsonData=JSON.parse(c()(t.bodyJsonData))}this.$forceUpdate()},handleStoreData:function(){this.apiInfoData=JSON.parse(c()(this.$store.state.backInfo)),this.constData=this.apiInfoData.constData}},mounted:function(){this.getEnvSetData(),this.handleFrontData(),o()(this.$store.state.backInfo).length&&this.handleStoreData()}},R={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"back-info-show border-box"},[a("el-form",{ref:"backForm",attrs:{"label-width":"129px",model:t.apiInfoData,rules:t.rules}},[a("el-form-item",{attrs:{label:"后端服务:",prop:"interfaceType"}},[a("el-radio-group",{on:{change:t.changeType},model:{value:t.apiInfoData.interfaceType,callback:function(e){t.$set(t.apiInfoData,"interfaceType",e)},expression:"apiInfoData.interfaceType"}},[a("el-radio",{attrs:{label:"0"}},[t._v("http")]),t._v(" "),a("el-radio",{attrs:{label:"1"}},[t._v("dubbo")])],1)],1),t._v(" "),a("el-form-item",{attrs:{label:"API版本号",prop:"version"}},[a("limitInput",{attrs:{inputWidth:329,inputValue:t.apiInfoData.version,holder:"请输入API版本号",getByType:"word",maxLength:20},on:{"update:inputValue":function(e){t.$set(t.apiInfoData,"version",e)}}})],1),t._v(" "),1==t.apiInfoData.interfaceType?a("el-form-item",{attrs:{label:"dubbo接口名称:",prop:"dubboInterface"}},[a("limitInput",{attrs:{inputWidth:329,inputValue:t.apiInfoData.dubboInterface,holder:"请输入dubbo接口名称",getByType:"word",maxLength:20},on:{"update:inputValue":function(e){t.$set(t.apiInfoData,"dubboInterface",e)}}})],1):t._e(),t._v(" "),1==t.apiInfoData.interfaceType?a("el-form-item",{attrs:{label:"dubbo请求方法:",prop:"dubboMethod"}},[a("limitInput",{attrs:{inputWidth:329,inputValue:t.apiInfoData.dubboMethod,holder:"请输入dubbo请求方法",getByType:"word",maxLength:20},on:{"update:inputValue":function(e){t.$set(t.apiInfoData,"dubboMethod",e)}}})],1):t._e(),t._v(" "),0==t.apiInfoData.interfaceType?a("el-form-item",{attrs:{label:"请求路径:",prop:"backendHttpPath"}},[a("el-input",{staticClass:"w-329",model:{value:t.apiInfoData.backendHttpPath,callback:function(e){t.$set(t.apiInfoData,"backendHttpPath",e)},expression:"apiInfoData.backendHttpPath"}})],1):t._e(),t._v(" "),1==t.apiInfoData.interfaceType?a("el-form-item",{attrs:{label:"注册中心地址:",prop:"proxyCode"}},[a("el-select",{attrs:{placeholder:"请选择"},model:{value:t.apiInfoData.proxyCode,callback:function(e){t.$set(t.apiInfoData,"proxyCode",e)},expression:"apiInfoData.proxyCode"}},t._l(t.envSetOptions,function(t){return a("el-option",{key:t.proxyCode,attrs:{label:t.proxyName,value:t.proxyCode}})}))],1):t._e(),t._v(" "),1==t.apiInfoData.interfaceType?a("el-form-item",{attrs:{label:"请求版本号",prop:"dubboVersion"}},[a("limitInput",{attrs:{inputWidth:329,inputValue:t.apiInfoData.dubboVersion,holder:"请输入请求版本号",getByType:"word",maxLength:20},on:{"update:inputValue":function(e){t.$set(t.apiInfoData,"dubboVersion",e)}}})],1):t._e(),t._v(" "),a("el-form-item",{attrs:{label:"超时时长:",prop:"timeout"}},[a("el-input-number",{attrs:{"controls-position":"right",min:1,max:1e9},model:{value:t.apiInfoData.timeout,callback:function(e){t.$set(t.apiInfoData,"timeout",e)},expression:"apiInfoData.timeout"}})],1),t._v(" "),a("el-form-item",{staticClass:"color-303133 font-w-700",attrs:{label:"参数配置"}},[a("div",{staticClass:"back-data-wrap font-0"},[a("div",{staticClass:"el-table el-table--fit el-table--enable-row-hover el-table--enable-row-transition inline-block vertical-top",staticStyle:{width:"30%","table-layout":"fixed"}},[a("div",{staticClass:"el-table__header-wrapper"},[a("table",{staticClass:"el-table__header",staticStyle:{width:"100%","table-layout":"fixed"},attrs:{cellspacing:"0",cellpadding:"0",border:"0"}},[a("thead",{staticClass:"has-gutter"},[a("tr",{},[a("th",{staticClass:"el-table_1_column_1 is-leaf",staticStyle:{width:"36px"},attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"})]),t._v(" "),a("th",{staticClass:"el-table_1_column_1 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("参数名")])]),t._v(" "),a("th",{staticClass:"el-table_1_column_2 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("参数位置")])]),t._v(" "),a("th",{staticClass:"el-table_1_column_3 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("参数类型")])])])])])]),t._v(" "),a("div",{staticClass:"el-table__body-wrapper is-scrolling-none back-table-left"},[a("div",{staticClass:"table-content"},[t.backHeaderData.properties&&Object.keys(t.backHeaderData.properties).length?a("back-table-left",{attrs:{itemData:t.frontHeaderData}}):t._e(),t._v(" "),t.backQueryData.properties&&Object.keys(t.backQueryData.properties).length?a("back-table-left",{attrs:{itemData:t.frontQueryData}}):t._e(),t._v(" "),t.backBodyJsonData.properties&&Object.keys(t.backBodyJsonData.properties).length?a("back-table-left",{attrs:{itemData:t.frontBodyJsonData}}):t._e(),t._v(" "),t.backBodyFormData.properties&&Object.keys(t.backBodyFormData.properties).length?a("back-table-left",{attrs:{itemData:t.frontBodyFormData}}):t._e()],1)])]),t._v(" "),a("div",{staticClass:"el-table el-table--fit el-table--enable-row-hover el-table--enable-row-transition inline-block vertical-top",staticStyle:{width:"70%","table-layout":"fixed"}},[a("div",{staticClass:"el-table__header-wrapper"},[a("table",{staticClass:"el-table__header",staticStyle:{width:"100%","table-layout":"fixed"},attrs:{cellspacing:"0",cellpadding:"0",border:"0"}},[a("thead",{staticClass:"has-gutter"},[a("tr",{},[a("th",{staticClass:"el-table_1_column_1 is-leaf",staticStyle:{width:"36px"},attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"})]),t._v(" "),a("th",{staticClass:"el-table_1_column_1 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("是否后端参数")])]),t._v(" "),a("th",{staticClass:"el-table_1_column_1 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("参数名映射")])]),t._v(" "),0==t.apiInfoData.interfaceType?a("th",{staticClass:"el-table_1_column_2 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("参数位置")])]):t._e(),t._v(" "),a("th",{staticClass:"el-table_1_column_3 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("参数类型")])]),t._v(" "),a("th",{staticClass:"el-table_1_column_4 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("参数值")])]),t._v(" "),1==t.apiInfoData.interfaceType?a("th",{staticClass:"el-table_1_column_4 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("包路径")])]):t._e(),t._v(" "),1==t.apiInfoData.interfaceType?a("th",{staticClass:"el-table_1_column_4 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("排序")])]):t._e()])])])]),t._v(" "),a("div",{staticClass:"el-table__body-wrapper is-scrolling-none"},[a("div",{staticClass:"table-content"},[t.backHeaderData.properties&&Object.keys(t.backHeaderData.properties).length?a("back-table-right",{attrs:{itemData:t.backHeaderData,interfaceType:t.apiInfoData.interfaceType}}):t._e(),t._v(" "),t.backQueryData.properties&&Object.keys(t.backQueryData.properties).length?a("back-table-right",{attrs:{itemData:t.backQueryData,interfaceType:t.apiInfoData.interfaceType}}):t._e(),t._v(" "),t.backBodyJsonData.properties&&Object.keys(t.backBodyJsonData.properties).length?a("back-table-right",{attrs:{itemData:t.backBodyJsonData,interfaceType:t.apiInfoData.interfaceType}}):t._e(),t._v(" "),t.backBodyFormData.properties&&Object.keys(t.backBodyFormData.properties).length?a("back-table-right",{attrs:{itemData:t.backBodyFormData,interfaceType:t.apiInfoData.interfaceType}}):t._e()],1)])])]),t._v(" "),a("div",{staticClass:"constant-wrap"},[a("back-constant",{attrs:{itemData:t.constData,interfaceType:t.apiInfoData.interfaceType}})],1)]),t._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:t.submitback}},[t._v("上一步")]),t._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(e){t.submitForm("backForm")}}},[t._v("下一步")])],1)],1)],1)},staticRenderFns:[]};var J=a("VU/8")(N,R,!1,function(t){a("U1k4")},"data-v-1c9d1fb6",null).exports,E=a("woOf"),L=a.n(E),U={name:"body-row",props:{itemData:{type:Object,default:function(){return{}}}},data:function(){return{trData:{},keyLength:1}},methods:{blurKey:function(t,e){t.currentKey!=e&&(this.$set(this.itemData.properties,t.currentKey,t),this.$delete(this.itemData.properties,e))},updateKey:function(t){for(var e in t)e!=t[e].currentKey&&(t[e].pkey=t[t[e].currentKey]=t[e],this.$delete(t,e)),t[e]&&"object"==t[e].type&&o()(t[e].properties).length&&this.updateKey(t[e].properties),t[e]&&"array"==t[e].type&&o()(t[e].items.properties).length&&this.updateKey(t[e].items.properties)},handleDel:function(t,e,a,r){var s=this;return u()(n.a.mark(function a(){var r;return n.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return r=s,a.next=3,r.updateKey(r.itemData.properties);case 3:if(t){a.next=6;break}return r.$delete(r.itemData.properties,e),a.abrupt("return",!1);case 6:r.handleDelData(r.itemData,t,e);case 7:case"end":return a.stop()}},a,s)}))()},handleDelData:function(t,e,a){this.handleObjData(t,e,a)},handleObjData:function(t,e,a){for(var r in t)t[r]==e&&this.$delete(t.properties,a)},changeType:function(t,e,a,r){"string"!=t&&"boolean"!=t&&"number"!=t&&"object"!=t||(e.properties={},e.hasOwnProperty("items")&&this.$delete(e,"items")),"array"==t&&this.$set(e,"items",{parentKey:a,level:parseInt(r)+1,type:"string",defaultVal:"val",description:"描述",example:"示例",properties:{}}),this.$forceUpdate()},handleAdd:function(t,e,a,r){var s=this.keyLength++;if("array"==t.type)return this.$set(t.items.properties,"field"+s,{parentKey:e,level:parseInt(r)+1,type:"string",currentKey:"field"+s,defaultVal:"val",description:"描述",example:"示例",properties:{}}),this.$forceUpdate(),!1;this.$set(t.properties,"field"+s,{parentKey:e,level:parseInt(r)+1,type:"string",currentKey:"field"+s,defaultVal:"val",description:"描述",example:"示例",properties:{}}),this.$forceUpdate()}},watch:{itemData:function(t,e){t&&(this.trData=JSON.parse(c()(t)))}},mounted:function(){this.trData=JSON.parse(c()(this.itemData))}},A={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[t._l(t.itemData.properties,function(e,r,s){return[a("table",{key:s+r+121,staticClass:"el-table__body",staticStyle:{width:"100%","table-layout":"fixed"},attrs:{cellspacing:"0",cellpadding:"0",border:"0"}},[a("tbody",[a("tr",{staticClass:"el-table__row"},[a("td",{staticClass:"el-table_1_column_1",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-input",{attrs:{disabled:"array"==e.type||"object"==e.type},on:{blur:function(a){t.blurKey(e,r)}},model:{value:e.currentKey,callback:function(a){t.$set(e,"currentKey",a)},expression:"itemValue.currentKey"}})],1)]),t._v(" "),a("td",{staticClass:"el-table_1_column_2",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-select",{attrs:{placeholder:"请选择参数类型"},on:{change:function(a){t.changeType(e.type,e,e.currentKey,e.level)}},model:{value:e.type,callback:function(a){t.$set(e,"type",a)},expression:"itemValue.type"}},[a("el-option",{attrs:{label:"string",value:"string"}}),t._v(" "),a("el-option",{attrs:{label:"number",value:"number"}}),t._v(" "),a("el-option",{attrs:{label:"boolean",value:"boolean"}}),t._v(" "),a("el-option",{attrs:{label:"object",value:"object"}}),t._v(" "),a("el-option",{attrs:{label:"array",value:"array"}})],1)],1)]),t._v(" "),a("td",{staticClass:"el-table_1_column_3",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},[a("el-input",{model:{value:e.example,callback:function(a){t.$set(e,"example",a)},expression:"itemValue.example"}})],1)]),t._v(" "),a("td",{staticClass:"el-table_1_column_3",attrs:{rowspan:"1",colspan:"1"}},[a("div",{staticClass:"cell"},["array"==e.type||"object"==e.type?a("el-button",{attrs:{type:"text"},on:{click:function(a){t.handleAdd(e,e.currentKey,s,e.level)}}},[t._v("添加子属性")]):t._e(),t._v(" "),a("el-button",{attrs:{type:"text"},on:{click:function(a){t.handleDel(e.parentKey,e.currentKey,s,e.level)}}},[t._v("删除")])],1)])])])]),t._v(" "),"array"==e.type&&Object.keys(e.items.properties).length?a("body-row",{key:s+"122"+r,staticClass:"el-table__row",staticStyle:{"padding-left":"10px"},attrs:{itemData:e.items}}):t._e(),t._v(" "),"object"==e.type&&Object.keys(e.properties).length?a("body-row",{key:s+"122"+r,staticClass:"el-table__row",staticStyle:{"padding-left":"10px"},attrs:{itemData:e}}):t._e()]})],2)},staticRenderFns:[]};var H=a("VU/8")(U,A,!1,function(t){a("1kTN")},"data-v-0344bb74",null).exports,Q=a("jvWE"),G={name:"create-front",components:{limitTextarea:d.a,limitInput:f.a,headerParam:k,resultTable:H},data:function(){return{apiInfoData:{resultParams:{},sucReturn:"",errReturn:"",errCode:[]},errCode:[],errOptions:[],resultParams:{type:"object",level:1,properties:{root:{level:2,currentKey:"root",type:"object",defaultVal:"val",description:"描述",example:"示例",properties:{}}}},rules:{sucReturn:[{required:!0,message:"请输入成功返回示例",trigger:"blur"}],errReturn:[{required:!0,message:"请输入失败返回示例",trigger:"blur"}]},keyLength:1}},methods:{remoteMethod:function(t){""!==t?this.getErrcodeData(t):this.errOptions=[]},changeErr:function(t,e,a){t&&this.errOptions.forEach(function(e){t==e.errorCode&&(a.error_info=e.errorInfo)})},toAddItem:function(){var t=this.keyLength++;this.$set(this.resultParams.properties,"field"+t,{level:2,parentKey:"",type:"string",currentKey:"field"+t,defaultVal:"val",description:"描述",example:"示例",properties:{}})},delErrorCode:function(t){this.apiInfoData.errCode.splice(t,1)},addErrCodeItem:function(){this.apiInfoData.errCode.push({error_code:"",error_info:"",orig_error_code:""})},submitback:function(){this.$emit("submitBack")},submitForm:Object(Q.a)(function(t){var e=this;e.$refs[t].validate(function(t){if(!t)return!1;e.handleFrontBackData()})},500),handleFrontData:function(){var t={type:"object",level:1,properties:{},required:[]},e=JSON.parse(c()(this.$store.state.frontInfo));return t.properties=L()(e.queryData.properties,e.headerData.properties),"POST"==e.requestType&&"json"==e.frontBodyType&&(t.properties=L()(e.queryData.properties,e.headerData.properties,e.bodyJsonData.properties)),"POST"==e.requestType&&"form"==e.frontBodyType&&(t.properties=L()(e.queryData.properties,e.headerData.properties,e.bodyFormData.properties)),t},handleBackData:function(){var t={type:"object",level:1,properties:{},required:[]},e=JSON.parse(c()(this.$store.state.backInfo));return t.properties=L()(e.backQueryData.properties,e.backHeaderData.properties,e.constData.properties),t},handleFrontBackData:function(){var t=this;return u()(n.a.mark(function e(){var a,r,s;return n.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=t,e.next=3,a.handleFrontData();case 3:return r=e.sent,e.next=6,a.handleBackData();case 6:return s=e.sent,e.next=9,a.toPostApi(r,s);case 9:case"end":return e.stop()}},e,t)}))()},toPostApi:function(t,e){var a=this,r={interfaceName:a.$store.state.baseInfo.interfaceName,interfaceGroupId:a.$route.query.interfaceGroupId,interfaceUrl:a.$store.state.baseInfo.interfaceUrl,interfaceDescribe:a.$store.state.baseInfo.interfaceDescribe,projectId:a.$route.query.projectId,target:a.$store.state.baseInfo.target,optType:a.$store.state.baseInfo.optType,protocol:a.$store.state.frontInfo.protocol,requestType:a.$store.state.frontInfo.requestType,frontParams:c()(t),interfaceType:a.$store.state.backInfo.interfaceType,version:a.$store.state.backInfo.version,backendHttpPath:a.$store.state.backInfo.backendHttpPath,dubboInterface:a.$store.state.backInfo.dubboInterface,dubboMethod:a.$store.state.backInfo.dubboMethod,dubboVersion:a.$store.state.backInfo.dubboVersion,proxyCode:a.$store.state.backInfo.proxyCode,timeout:a.$store.state.backInfo.timeout,endParams:c()(e),resultParams:c()(a.resultParams),sucReturn:a.apiInfoData.sucReturn,errReturn:a.apiInfoData.errReturn,errCode:c()(a.apiInfoData.errCode),interfaceId:a.$store.state.baseInfo.interfaceId,interfaceVersionId:a.$store.state.baseInfo.interfaceVersionId};Object(b.b)(a.$store.state.baseInfo.interfaceId?"/gateway-manage/update-api":"/gateway-manage/create-api",r).then(function(t){var e=t.data;if("0000"==e.code)return y.a.showmsg("保存成功","success"),a.$store.dispatch("clearApiData"),void a.$router.push("/apiList");h.a.errorMsg(e)}).catch(function(t){a.$message.error({duration:1e3,message:t.message})})},getErrcodeData:function(t){var e=this,a={pageNum:1,pageSize:100,search:t};Object(b.b)("/gateway-manage/page-error-setting",a).then(function(t){var a=t.data;"0000"!=a.code?h.a.errorMsg(a):e.errOptions=a.result.result||[]}).catch(function(t){e.$message.error({duration:1e3,message:t.message})})},handleStoreData:function(){this.apiInfoData=JSON.parse(c()(this.$store.state.resultInfo))}},mounted:function(){this.getErrcodeData(),this.$route.query.interfaceId&&this.handleStoreData()}},M={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"result-info-show border-box"},[a("el-form",{ref:"resultForm",attrs:{"label-width":"114px",model:t.apiInfoData,rules:t.rules}},[a("el-form-item",{attrs:{label:"返回类型:"}},[t._v("json")]),t._v(" "),a("el-form-item",{attrs:{label:"返回参数:"}},[a("div",{staticClass:"body-param-wrap"},[a("div",{staticClass:"el-table el-table--fit el-table--enable-row-hover el-table--enable-row-transition",staticStyle:{width:"100%","table-layout":"fixed"}},[a("div",{staticClass:"el-table__header-wrapper"},[a("table",{staticClass:"el-table__header",staticStyle:{width:"100%","table-layout":"fixed"},attrs:{cellspacing:"0",cellpadding:"0",border:"0"}},[a("thead",{staticClass:"has-gutter"},[a("tr",{},[a("th",{staticClass:"el-table_1_column_1 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("参数名")])]),t._v(" "),a("th",{staticClass:"el-table_1_column_2 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("参数类型")])]),t._v(" "),a("th",{staticClass:"el-table_1_column_5 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("示例值")])]),t._v(" "),a("th",{staticClass:"el-table_1_column_7 is-leaf",attrs:{colspan:"1",rowspan:"1"}},[a("div",{staticClass:"cell"},[t._v("操作")])])])])])]),t._v(" "),a("div",{staticClass:"el-table__body-wrapper is-scrolling-none"},[a("div",{staticClass:"table-content"},[a("result-table",{ref:"resultBodyTable",attrs:{itemData:t.resultParams},on:{refreshData:t.refreshData}}),t._v(" "),a("div",{staticClass:"add-line text-center",on:{click:t.toAddItem}},[a("i",{staticClass:"el-icon-circle-plus-outline color-5584FF"}),a("span",{staticClass:"color-5584FF font-14 p-l-4"},[t._v("添加行")])])],1)])])])]),t._v(" "),a("el-form-item",{attrs:{label:"错误码映射:",prop:"errCode"}},[a("el-table",{staticStyle:{width:"100%"},attrs:{data:t.apiInfoData.errCode}},[a("el-table-column",{attrs:{label:"原始错误码"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticClass:"cell"},[a("el-input",{attrs:{placeholder:"请输入原始错误码"},model:{value:e.row.orig_error_code,callback:function(a){t.$set(e.row,"orig_error_code",a)},expression:"scope.row.orig_error_code"}})],1)]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"错误码映射"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticClass:"cell"},[a("el-select",{attrs:{placeholder:"请选择映射错误码"},on:{change:function(a){t.changeErr(a,e.$index,e.row)}},model:{value:e.row.error_code,callback:function(a){t.$set(e.row,"error_code",a)},expression:"scope.row.error_code"}},t._l(t.errOptions,function(t){return a("el-option",{key:t.errorCode,attrs:{label:t.errorCode,value:t.errorCode}})}))],1)]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"错误信息"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticClass:"cell"},[a("el-input",{attrs:{placeholder:"请输入错误信息"},model:{value:e.row.error_info,callback:function(a){t.$set(e.row,"error_info",a)},expression:"scope.row.error_info"}})],1)]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"操作"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticClass:"cell"},[a("el-button",{attrs:{type:"text"},on:{click:function(a){t.delErrorCode(e.$index)}}},[t._v("删除")])],1)]}}])})],1),t._v(" "),a("div",{staticClass:"add-line add-err-line text-center",on:{click:t.addErrCodeItem}},[a("i",{staticClass:"el-icon-circle-plus-outline color-5584FF"}),a("span",{staticClass:"color-5584FF font-14 p-l-4"},[t._v("添加错误码配置")])])],1),t._v(" "),a("el-form-item",{attrs:{label:"成功返回示例:",prop:"sucReturn"}},[a("el-input",{staticClass:"w-389",attrs:{type:"textarea",rows:3,placeholder:"请输入内容"},model:{value:t.apiInfoData.sucReturn,callback:function(e){t.$set(t.apiInfoData,"sucReturn",e)},expression:"apiInfoData.sucReturn"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"失败返回示例:",prop:"errReturn"}},[a("el-input",{staticClass:"w-389",attrs:{type:"textarea",rows:3,placeholder:"请输入内容"},model:{value:t.apiInfoData.errReturn,callback:function(e){t.$set(t.apiInfoData,"errReturn",e)},expression:"apiInfoData.errReturn"}})],1),t._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:t.submitback}},[t._v("上一步")]),t._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(e){t.submitForm("resultForm")}}},[t._v("完 成")])],1)],1)],1)},staticRenderFns:[]};var W=a("VU/8")(G,M,!1,function(t){a("OF/v")},"data-v-f40825fe",null).exports,z={name:"createApi",components:{navBread:r.a,createBase:_,createFront:$,createBackend:J,createResult:W},data:function(){return{navPath:[{name:"API管理",path:"/apiProgram"},{name:"API列表",path:"/apiList"},{name:"创建API",path:""}],activeStep:1,stepData:[{stepName:"基础信息"},{stepName:"前端配置"},{stepName:"后端配置"},{stepName:"定义返回"}],projectId:this.$route.query.projectId,interfaceGroupId:this.$route.query.interfaceGroupId}},methods:{submitNext:function(){this.activeStep++},submitBack:function(){this.activeStep--}},watch:{$route:{handler:function(t,e){},deep:!0}},mounted:function(){this.$emit("showTab",22)},beforeDestroy:function(){this.$store.dispatch("clearApiData")}},X={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"api-body-content border-box"},[a("div",{staticClass:"common-nav"},[a("nav-bread",{attrs:{navPath:t.navPath}})],1),t._v(" "),a("div",{staticClass:"api-body-main common-body-main border-box",staticStyle:{height:"auto"}},[a("div",{staticClass:"api-main-content border-box"},[a("div",{staticClass:"create-api-body"},[a("div",{staticClass:"create-api-step font-0"},t._l(t.stepData,function(e,r){return a("div",{key:r+e.stepName,class:["api-step-cell inline-block border-box",r+1==t.activeStep?"active-step":""],style:{width:100/t.stepData.length+"%","max-width":100/t.stepData.length+"%"}},[a("div",{staticClass:"api-step-cell_inner border-box"},[r<t.stepData.length-1?a("div",{staticClass:"api-step-cell_line"}):t._e(),t._v(" "),a("div",{staticClass:"api-step-cell_title"},[a("div",{staticClass:"el-step__icon is-text inline-block"},[a("div",{staticClass:"el-step__icon-inner font-14"},[t._v(t._s(r+1))])]),t._v(" "),a("div",{staticClass:"api-step-cell_txt p-lr-10 bg-fff inline-block font-16"},[t._v(t._s(e.stepName))])])])])})),t._v(" "),"1"==t.activeStep?a("div",{staticClass:"create-api-base"},[a("create-base",{on:{submitNext:t.submitNext}})],1):t._e(),t._v(" "),"2"==t.activeStep?a("div",{staticClass:"create-api-front"},[a("create-front",{on:{submitBack:t.submitBack,submitNext:t.submitNext}})],1):t._e(),t._v(" "),"3"==t.activeStep?a("div",{staticClass:"create-api-back"},[a("create-backend",{on:{submitBack:t.submitBack,submitNext:t.submitNext}})],1):t._e(),t._v(" "),"4"==t.activeStep?a("div",{staticClass:"create-api-result"},[a("create-result",{on:{submitBack:t.submitBack,submitNext:t.submitNext}})],1):t._e()])])])])},staticRenderFns:[]};var Y=a("VU/8")(z,X,!1,function(t){a("GSUE")},"data-v-55fb519b",null);e.default=Y.exports},exGp:function(t,e,a){"use strict";e.__esModule=!0;var r,s=a("//Fk"),o=(r=s)&&r.__esModule?r:{default:r};e.default=function(t){return function(){var e=t.apply(this,arguments);return new o.default(function(t,a){return function r(s,i){try{var n=e[s](i),l=n.value}catch(t){return void a(t)}if(!n.done)return o.default.resolve(l).then(function(t){r("next",t)},function(t){r("throw",t)});t(l)}("next")})}}},jyFz:function(t,e,a){var r=function(){return this}()||Function("return this")(),s=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,o=s&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,t.exports=a("SldL"),s)r.regeneratorRuntime=o;else try{delete r.regeneratorRuntime}catch(t){r.regeneratorRuntime=void 0}},rzMK:function(t,e){}});
\ No newline at end of file
!function(e){var n=window.webpackJsonp;window.webpackJsonp=function(r,o,a){for(var f,d,i,u=0,b=[];u<r.length;u++)d=r[u],t[d]&&b.push(t[d][0]),t[d]=0;for(f in o)Object.prototype.hasOwnProperty.call(o,f)&&(e[f]=o[f]);for(n&&n(r,o,a);b.length;)b.shift()();if(a)for(u=0;u<a.length;u++)i=c(c.s=a[u]);return i};var r={},t={21:0};function c(n){if(r[n])return r[n].exports;var t=r[n]={i:n,l:!1,exports:{}};return e[n].call(t.exports,t,t.exports,c),t.l=!0,t.exports}c.e=function(e){var n=t[e];if(0===n)return new Promise(function(e){e()});if(n)return n[2];var r=new Promise(function(r,c){n=t[e]=[r,c]});n[2]=r;var o=document.getElementsByTagName("head")[0],a=document.createElement("script");a.type="text/javascript",a.charset="utf-8",a.async=!0,a.timeout=12e4,c.nc&&a.setAttribute("nonce",c.nc),a.src=c.p+"static/js/"+e+"."+{0:"8d33a005548cc91f2535",1:"0ebe3ead93207dc78a78",2:"69653651feeddbe5df87",3:"9d8da2e9b9ec2f268553",4:"5cf354492baf8ad83eda",5:"e704f35bae2785ada05b",6:"03233da003452ba92dd2",7:"4cb82e13df0c0c5b4b13",8:"b7ed0abeb26ad276c2a5",9:"bd4ba95c34a584a7dc76",10:"638039a7b39908980436",11:"80fde13c3f372ead3f07",12:"3b9c756b15cf547445f5",13:"369e10e7c7f25760058c",14:"9825bb69e60b8030c230",15:"cb7b875c24b40e9cb6e0",16:"59c1113679bef2e96538",17:"9647068d2291863c5016",18:"37321ffca9347a60b988"}[e]+".js";var f=setTimeout(d,12e4);function d(){a.onerror=a.onload=null,clearTimeout(f);var n=t[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),t[e]=void 0)}return a.onerror=a.onload=d,o.appendChild(a),r},c.m=e,c.c=r,c.d=function(e,n,r){c.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},c.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(n,"a",n),n},c.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},c.p="./",c.oe=function(e){throw console.error(e),e}}([]);
\ No newline at end of file
!function(e){var n=window.webpackJsonp;window.webpackJsonp=function(r,o,a){for(var f,d,i,u=0,b=[];u<r.length;u++)d=r[u],t[d]&&b.push(t[d][0]),t[d]=0;for(f in o)Object.prototype.hasOwnProperty.call(o,f)&&(e[f]=o[f]);for(n&&n(r,o,a);b.length;)b.shift()();if(a)for(u=0;u<a.length;u++)i=c(c.s=a[u]);return i};var r={},t={21:0};function c(n){if(r[n])return r[n].exports;var t=r[n]={i:n,l:!1,exports:{}};return e[n].call(t.exports,t,t.exports,c),t.l=!0,t.exports}c.e=function(e){var n=t[e];if(0===n)return new Promise(function(e){e()});if(n)return n[2];var r=new Promise(function(r,c){n=t[e]=[r,c]});n[2]=r;var o=document.getElementsByTagName("head")[0],a=document.createElement("script");a.type="text/javascript",a.charset="utf-8",a.async=!0,a.timeout=12e4,c.nc&&a.setAttribute("nonce",c.nc),a.src=c.p+"static/js/"+e+"."+{0:"8d33a005548cc91f2535",1:"0ebe3ead93207dc78a78",2:"7e899ba24a5d98c157c2",3:"9d8da2e9b9ec2f268553",4:"5cf354492baf8ad83eda",5:"e704f35bae2785ada05b",6:"03233da003452ba92dd2",7:"4cb82e13df0c0c5b4b13",8:"b7ed0abeb26ad276c2a5",9:"bd4ba95c34a584a7dc76",10:"638039a7b39908980436",11:"80fde13c3f372ead3f07",12:"3b9c756b15cf547445f5",13:"369e10e7c7f25760058c",14:"9825bb69e60b8030c230",15:"cb7b875c24b40e9cb6e0",16:"59c1113679bef2e96538",17:"9647068d2291863c5016",18:"37321ffca9347a60b988"}[e]+".js";var f=setTimeout(d,12e4);function d(){a.onerror=a.onload=null,clearTimeout(f);var n=t[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),t[e]=void 0)}return a.onerror=a.onload=d,o.appendChild(a),r},c.m=e,c.c=r,c.d=function(e,n,r){c.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},c.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(n,"a",n),n},c.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},c.p="./",c.oe=function(e){throw console.error(e),e}}([]);
\ No newline at end of file
......@@ -289,8 +289,54 @@ export default {
that.apiInfoData = JSON.parse(JSON.stringify(that.$store.state.frontInfo));
that.headerData = that.apiInfoData.headerData;
that.queryData = that.apiInfoData.queryData;
that.bodyJsonData = that.apiInfoData.bodyJsonData;
that.bodyFormData = that.apiInfoData.bodyFormData;
const bodyJsonData = {
type: 'object',
level: 1,
properties: {
root: {
level: 2,
currentKey: 'root',
frontOriginType: 'body', //来源类型 query,body,header
backendOriginType: 'body',
type: 'object',
isBackendField: 0, //是否后端字段
defaultVal: 'val', //默认值
isRootKey: 0, //是否是后端参数字段
rootKey: '', //后端参数字段
objectClass: '', //如果是object 并且是dubbo
description: '描述',
example: '示例',
check: true,
properties: {}
}
},
required: []
};
const bodyFormData = {
type: 'object',
level: 1,
properties: {
root: {
level: 2,
currentKey: 'root',
frontOriginType: 'body', //来源类型 query,body,header
backendOriginType: 'body',
type: 'string',
isBackendField: 0, //是否后端字段
defaultVal: 'val', //默认值
isRootKey: 0, //是否是后端参数字段
rootKey: '', //后端参数字段
objectClass: '', //如果是object 并且是dubbo
description: '描述',
example: '示例',
check: true,
properties: {}
}
},
required: []
};
that.bodyJsonData = Object.keys(that.apiInfoData.bodyJsonData).length ? that.apiInfoData.bodyJsonData : bodyJsonData;
that.bodyFormData = Object.keys(that.apiInfoData.bodyFormData).length ? that.apiInfoData.bodyFormData : bodyFormData;
}
},
mounted() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment