Commit 23c72226 by 无尘

fix: 修改参数

parent 12be2c95
<!DOCTYPE html><html><head><meta charset=utf-8><link rel="shortcut icon" href=./favicon.ico><title>API网关管理平台</title><link href=./static/css/app.81708ea45054ec4ddb66911c9a624c0f.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.4b775c128b30bc98fa30.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> <!DOCTYPE html><html><head><meta charset=utf-8><link rel="shortcut icon" href=./favicon.ico><title>API网关管理平台</title><link href=./static/css/app.0b5fd48b58f3162d8f3e4a615530c6b3.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.15b78cbf256c053bf487.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 \ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
!function(e){var n=window.webpackJsonp;window.webpackJsonp=function(r,c,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 c)Object.prototype.hasOwnProperty.call(c,f)&&(e[f]=c[f]);for(n&&n(r,c,a);b.length;)b.shift()();if(a)for(u=0;u<a.length;u++)i=o(o.s=a[u]);return i};var r={},t={21:0};function o(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,o),t.l=!0,t.exports}o.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,o){n=t[e]=[r,o]});n[2]=r;var c=document.getElementsByTagName("head")[0],a=document.createElement("script");a.type="text/javascript",a.charset="utf-8",a.async=!0,a.timeout=12e4,o.nc&&a.setAttribute("nonce",o.nc),a.src=o.p+"static/js/"+e+"."+{0:"8d33a005548cc91f2535",1:"0ebe3ead93207dc78a78",2:"60335f8876960ffe9161",3:"90cd20f184165abb5d81",4:"dbac6029f8f49f9aed96",5:"e704f35bae2785ada05b",6:"03233da003452ba92dd2",7:"4cb82e13df0c0c5b4b13",8:"b7ed0abeb26ad276c2a5",9:"56e39a7db187d5965631",10:"638039a7b39908980436",11:"80fde13c3f372ead3f07",12:"3b9c756b15cf547445f5",13:"818eee5a82f374d898fc",14:"9825bb69e60b8030c230",15:"cb7b875c24b40e9cb6e0",16:"59c1113679bef2e96538",17:"180df87ba95cffdf25b7",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,c.appendChild(a),r},o.m=e,o.c=r,o.d=function(e,n,r){o.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},o.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(n,"a",n),n},o.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},o.p="./",o.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,b,d,i=0,u=[];i<r.length;i++)b=r[i],t[b]&&u.push(t[b][0]),t[b]=0;for(f in o)Object.prototype.hasOwnProperty.call(o,f)&&(e[f]=o[f]);for(n&&n(r,o,a);u.length;)u.shift()();if(a)for(i=0;i<a.length;i++)d=c(c.s=a[i]);return d};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:"b615c0825625ca5c07be",3:"76c04489edeb65a5f020",4:"dbac6029f8f49f9aed96",5:"e704f35bae2785ada05b",6:"03233da003452ba92dd2",7:"4cb82e13df0c0c5b4b13",8:"b7ed0abeb26ad276c2a5",9:"56e39a7db187d5965631",10:"638039a7b39908980436",11:"80fde13c3f372ead3f07",12:"3b9c756b15cf547445f5",13:"818eee5a82f374d898fc",14:"9825bb69e60b8030c230",15:"cb7b875c24b40e9cb6e0",16:"59c1113679bef2e96538",17:"180df87ba95cffdf25b7",18:"37321ffca9347a60b988"}[e]+".js";var f=setTimeout(b,12e4);function b(){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=b,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
...@@ -322,7 +322,7 @@ export default { ...@@ -322,7 +322,7 @@ export default {
height: 440px; height: 440px;
} }
.backend-set-wrap { .backend-set-wrap {
height: 510px; min-height: 510px;
} }
.back-result-wrap { .back-result-wrap {
} }
......
<!--
<back-const-table :itemData="itemData" :interfaceType="interfaceType"></back-const-table>
import backConstTable from '@/components/api/back-const-table.vue';
-->
<template>
<div>
<div class="el-table el-table--fit el-table--enable-row-hover el-table--enable-row-transition" style="width: 100%; table-layout: fixed;">
<div class="el-table__header-wrapper">
<table cellspacing="0" cellpadding="0" border="0" class="el-table__header" style="width: 100%; table-layout: fixed;">
<thead class="has-gutter">
<tr class="">
<th colspan="1" rowspan="1" class="el-table_1_column_1 is-leaf">
<div class="cell">参数名</div>
</th>
<th v-if="interfaceType == '0'" colspan="1" rowspan="1" class="el-table_1_column_2 is-leaf">
<div class="cell">参数位置</div>
</th>
<th colspan="1" rowspan="1" class="el-table_1_column_2 is-leaf">
<div class="cell">参数类型</div>
</th>
<th colspan="1" rowspan="1" class="el-table_1_column_4 is-leaf">
<div class="cell">参数值</div>
</th>
</tr>
</thead>
</table>
</div>
<div class="el-table__body-wrapper is-scrolling-none">
<div class="table-content">
<template v-for="(itemValue, itemName, index) in itemData.properties">
<table v-if="itemValue.constFlag" cellspacing="0" cellpadding="0" border="0" class="el-table__body" style="width: 100%; table-layout: fixed;" :key="index + itemName + 121">
<tbody>
<tr class="el-table__row">
<td rowspan="1" colspan="1" class="el-table_1_column_1">
<div class="cell">
{{ itemValue.currentKey }}
</div>
</td>
<td v-if="interfaceType == '0'" rowspan="1" colspan="1" class="el-table_1_column_2">
<div class="cell">
{{ itemValue.backendOriginType }}
</div>
</td>
<td rowspan="1" colspan="1" class="el-table_1_column_2">
<div class="cell">
{{ itemValue.type }}
</div>
</td>
<td rowspan="1" colspan="1" class="el-table_1_column_3">
<div class="cell">
{{ itemValue.defaultVal }}
</div>
</td>
</tr>
</tbody>
</table>
</template>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'back-constant',
props: {
itemData: {
type: Object,
default() {
return {};
}
},
interfaceType: {
type: [String, Number],
default() {
return '0';
}
}
},
data() {
return {
trData: {}
};
},
watch: {
itemData: function(newData, oldData) {
const that = this;
that.trData = JSON.parse(JSON.stringify(newData));
}
},
mounted() {
const that = this;
// console.log(that.itemData);
that.trData = JSON.parse(JSON.stringify(that.itemData));
}
};
</script>
<style lang="less" scoped>
.w-320 {
width: 320px;
}
.m-t-14 {
margin-top: 14px;
}
.add-line {
height: 48px;
line-height: 48px;
border-bottom: 1px solid #e4e7ed;
cursor: pointer;
}
.el-table th {
padding: 7px 0;
}
</style>
...@@ -6,7 +6,7 @@ import backTableRight from '@/components/api/back-table-right.vue'; ...@@ -6,7 +6,7 @@ import backTableRight from '@/components/api/back-table-right.vue';
<template> <template>
<div> <div>
<template v-for="(itemValue, itemName, index) in itemData.properties"> <template v-for="(itemValue, itemName, index) in itemData.properties">
<table cellspacing="0" cellpadding="0" border="0" class="el-table__body" style="width: 100%;table-layout: fixed;" :key="index + itemName + 121"> <table v-if="!itemValue.constFlag" cellspacing="0" cellpadding="0" border="0" class="el-table__body" style="width: 100%;table-layout: fixed;" :key="index + itemName + 121">
<tbody> <tbody>
<tr class="el-table__row"> <tr class="el-table__row">
<td rowspan="1" colspan="1" class="el-table_1_column_1" style="width: 36px;"> <td rowspan="1" colspan="1" class="el-table_1_column_1" style="width: 36px;">
...@@ -18,8 +18,8 @@ import backTableRight from '@/components/api/back-table-right.vue'; ...@@ -18,8 +18,8 @@ import backTableRight from '@/components/api/back-table-right.vue';
<td rowspan="1" colspan="1" class="el-table_1_column_2"> <td rowspan="1" colspan="1" class="el-table_1_column_2">
<div class="cell">{{ itemValue.type }}</div> <div class="cell">{{ itemValue.type }}</div>
</td> </td>
<td rowspan="1" colspan="1" class="el-table_1_column_3"> <td v-if="interfaceType == 1" rowspan="1" colspan="1" class="el-table_1_column_3">
<div class="cell">{{ itemValue.type }}</div> <div class="cell">{{ itemValue.objectClass }}</div>
</td> </td>
<td rowspan="1" colspan="1" class="el-table_1_column_4"> <td rowspan="1" colspan="1" class="el-table_1_column_4">
<div class="cell">{{ itemValue.defaultVal }}</div> <div class="cell">{{ itemValue.defaultVal }}</div>
...@@ -41,6 +41,12 @@ export default { ...@@ -41,6 +41,12 @@ export default {
default() { default() {
return {}; return {};
} }
},
interfaceType: {
type: [String, Number],
default() {
return '0';
}
} }
}, },
data() { data() {
......
...@@ -6,7 +6,7 @@ import backTableTr from '@/components/api/back-table-tr.vue'; ...@@ -6,7 +6,7 @@ import backTableTr from '@/components/api/back-table-tr.vue';
<template> <template>
<div> <div>
<template v-for="(itemValue, itemName, index) in itemData.properties"> <template v-for="(itemValue, itemName, index) in itemData.properties">
<table cellspacing="0" cellpadding="0" border="0" class="el-table__body" style="width: 100%;table-layout: fixed;" :key="index + itemName + 121"> <table v-if="!itemValue.constFlag" cellspacing="0" cellpadding="0" border="0" class="el-table__body" style="width: 100%;table-layout: fixed;" :key="index + itemName + 121">
<tbody> <tbody>
<tr class="el-table__row"> <tr class="el-table__row">
<td rowspan="1" colspan="1" class="el-table_1_column_1" style="width: 36px;"> <td rowspan="1" colspan="1" class="el-table_1_column_1" style="width: 36px;">
...@@ -16,7 +16,7 @@ import backTableTr from '@/components/api/back-table-tr.vue'; ...@@ -16,7 +16,7 @@ import backTableTr from '@/components/api/back-table-tr.vue';
<div class="cell">{{ itemName }}</div> <div class="cell">{{ itemName }}</div>
</td> </td>
<td rowspan="1" colspan="1" class="el-table_1_column_2"> <td rowspan="1" colspan="1" class="el-table_1_column_2">
<div class="cell">{{ itemValue.originType }}</div> <div class="cell">{{ itemValue.frontOriginType }}</div>
</td> </td>
<td rowspan="1" colspan="1" class="el-table_1_column_2"> <td rowspan="1" colspan="1" class="el-table_1_column_2">
<div class="cell">{{ itemValue.type }}</div> <div class="cell">{{ itemValue.type }}</div>
......
<!-- <!--
<backend-info-show></backend-info-show> <backend-info-show :apiData=""></backend-info-show>
import backendInfoShow from '@/components/api/backend-info-show.vue'; import backendInfoShow from '@/components/api/backend-info-show.vue';
--> -->
...@@ -76,7 +76,7 @@ import backendInfoShow from '@/components/api/backend-info-show.vue'; ...@@ -76,7 +76,7 @@ import backendInfoShow from '@/components/api/backend-info-show.vue';
<th colspan="1" rowspan="1" class="el-table_1_column_2 is-leaf"> <th colspan="1" rowspan="1" class="el-table_1_column_2 is-leaf">
<div class="cell">参数类型映射</div> <div class="cell">参数类型映射</div>
</th> </th>
<th colspan="1" rowspan="1" class="el-table_1_column_3 is-leaf"> <th v-if="apiInfoData.interfaceType == 1" colspan="1" rowspan="1" class="el-table_1_column_3 is-leaf">
<div class="cell">包名</div> <div class="cell">包名</div>
</th> </th>
<th colspan="1" rowspan="1" class="el-table_1_column_4 is-leaf"> <th colspan="1" rowspan="1" class="el-table_1_column_4 is-leaf">
...@@ -88,23 +88,28 @@ import backendInfoShow from '@/components/api/backend-info-show.vue'; ...@@ -88,23 +88,28 @@ import backendInfoShow from '@/components/api/backend-info-show.vue';
</div> </div>
<div class="el-table__body-wrapper is-scrolling-none"> <div class="el-table__body-wrapper is-scrolling-none">
<div class="table-content"> <div class="table-content">
<back-table-right :itemData="apiInfoData.endParams"></back-table-right> <back-table-right :interfaceType="apiInfoData.interfaceType" :itemData="apiInfoData.endParams"></back-table-right>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="常量参数:">
<back-const-table :itemData="apiInfoData.endParams" :interfaceType="apiInfoData.interfaceType"></back-const-table>
</el-form-item>
</el-form> </el-form>
</div> </div>
</template> </template>
<script> <script>
import backTableTr from '@/components/api/back-table-tr.vue'; import backTableTr from '@/components/api/back-table-tr.vue';
import backTableRight from '@/components/api/back-table-right.vue'; import backTableRight from '@/components/api/back-table-right.vue';
import backConstTable from '@/components/api/back-const-table.vue';
export default { export default {
name: 'backend-info-show', name: 'backend-info-show',
components: { components: {
backTableTr, backTableTr,
backTableRight backTableRight,
backConstTable
}, },
props: { props: {
apiData: { apiData: {
...@@ -124,7 +129,7 @@ export default { ...@@ -124,7 +129,7 @@ export default {
type: 'object', //object,array,string,number,boolean, type: 'object', //object,array,string,number,boolean,
properties: { properties: {
name: { name: {
originType: 'query', //来源类型 query,body,header backendOriginType: 'query', //来源类型 query,body,header
type: 'object', type: 'object',
isBackendField: 0, //是否后端字段 isBackendField: 0, //是否后端字段
defaultVal: 'val', //默认值 defaultVal: 'val', //默认值
...@@ -136,7 +141,7 @@ export default { ...@@ -136,7 +141,7 @@ export default {
required: [], required: [],
properties: { properties: {
nameId: { nameId: {
originType: 'query', //来源类型 query,body,header backendOriginType: 'query', //来源类型 query,body,header
type: 'object', type: 'object',
isBackendField: 0, //是否后端字段 isBackendField: 0, //是否后端字段
defaultVal: 'val', //默认值 defaultVal: 'val', //默认值
...@@ -147,18 +152,7 @@ export default { ...@@ -147,18 +152,7 @@ export default {
check: true, check: true,
properties: { properties: {
age: { age: {
originType: 'query', //来源类型 query,body,header backendOriginType: 'query', //来源类型 query,body,header
type: 'string',
isBackendField: 0, //是否后端字段
defaultVal: 'val', //默认值
isRootKey: 0, //是否是后端参数字段
rootKey: '', //后端参数字段
objectClass: '', //如果是object 并且是dubbo
description: '描述',
check: true
},
email: {
originType: 'query', //来源类型 query,body,header
type: 'string', type: 'string',
isBackendField: 0, //是否后端字段 isBackendField: 0, //是否后端字段
defaultVal: 'val', //默认值 defaultVal: 'val', //默认值
...@@ -171,17 +165,6 @@ export default { ...@@ -171,17 +165,6 @@ export default {
} }
} }
} }
},
id: {
originType: 'query', //来源类型 query,body,header
type: 'string',
isBackendField: 0, //是否后端字段
defaultVal: 'val', //默认值
isRootKey: 0, //是否是后端参数字段
rootKey: '', //后端参数字段
objectClass: '', //如果是object 并且是dubbo
description: '描述',
check: true
} }
}, },
required: [] required: []
......
...@@ -27,6 +27,9 @@ import frontInfoShow from '@/components/api/frontend-info-show.vue'; ...@@ -27,6 +27,9 @@ import frontInfoShow from '@/components/api/frontend-info-show.vue';
<th colspan="1" rowspan="1" class="el-table_1_column_1 is-leaf"> <th colspan="1" rowspan="1" class="el-table_1_column_1 is-leaf">
<div class="cell">参数名</div> <div class="cell">参数名</div>
</th> </th>
<th colspan="1" rowspan="1" class="el-table_1_column_1 is-leaf">
<div class="cell">参数位置</div>
</th>
<th colspan="1" rowspan="1" class="el-table_1_column_2 is-leaf"> <th colspan="1" rowspan="1" class="el-table_1_column_2 is-leaf">
<div class="cell">参数类型</div> <div class="cell">参数类型</div>
</th> </th>
...@@ -88,54 +91,7 @@ export default { ...@@ -88,54 +91,7 @@ export default {
description: '描述', description: '描述',
check: true, check: true,
required: [], required: [],
properties: { properties: {}
nameId: {
originType: 'query', //来源类型 query,body,header
type: 'object',
isBackendField: 0, //是否后端字段
defaultVal: 'val', //默认值
isRootKey: 0, //是否是后端参数字段
rootKey: '', //后端参数字段
objectClass: '', //如果是object 并且是dubbo
description: '描述',
check: true,
properties: {
age: {
originType: 'query', //来源类型 query,body,header
type: 'string',
isBackendField: 0, //是否后端字段
defaultVal: 'val', //默认值
isRootKey: 0, //是否是后端参数字段
rootKey: '', //后端参数字段
objectClass: '', //如果是object 并且是dubbo
description: '描述',
check: true
},
email: {
originType: 'query', //来源类型 query,body,header
type: 'string',
isBackendField: 0, //是否后端字段
defaultVal: 'val', //默认值
isRootKey: 0, //是否是后端参数字段
rootKey: '', //后端参数字段
objectClass: '', //如果是object 并且是dubbo
description: '描述',
check: true
}
}
}
}
},
id: {
originType: 'query', //来源类型 query,body,header
type: 'string',
isBackendField: 0, //是否后端字段
defaultVal: 'val', //默认值
isRootKey: 0, //是否是后端参数字段
rootKey: '', //后端参数字段
objectClass: '', //如果是object 并且是dubbo
description: '描述',
check: true
} }
}, },
required: [] required: []
......
...@@ -15,6 +15,9 @@ import tableTr from '@/components/api/table-tr.vue'; ...@@ -15,6 +15,9 @@ import tableTr from '@/components/api/table-tr.vue';
<td rowspan="1" colspan="1" class="el-table_1_column_1"> <td rowspan="1" colspan="1" class="el-table_1_column_1">
<div class="cell">{{ itemName }}</div> <div class="cell">{{ itemName }}</div>
</td> </td>
<td rowspan="1" colspan="1" class="el-table_1_column_1">
<div class="cell">{{ itemValue.frontOriginType }}</div>
</td>
<td rowspan="1" colspan="1" class="el-table_1_column_2"> <td rowspan="1" colspan="1" class="el-table_1_column_2">
<div class="cell">{{ itemValue.type }}</div> <div class="cell">{{ itemValue.type }}</div>
</td> </td>
......
<!-- <!--
<back-constant :itemData="itemData" :originType="originType"></back-constant> <back-constant :itemData="itemData" :interfaceType="interfaceType"></back-constant>
import backConstant from '@/components/createApi/back-constant.vue'; import backConstant from '@/components/createApi/back-constant.vue';
--> -->
...@@ -42,7 +42,7 @@ import backConstant from '@/components/createApi/back-constant.vue'; ...@@ -42,7 +42,7 @@ import backConstant from '@/components/createApi/back-constant.vue';
</td> </td>
<td v-if="interfaceType == '0'" rowspan="1" colspan="1" class="el-table_1_column_2"> <td v-if="interfaceType == '0'" rowspan="1" colspan="1" class="el-table_1_column_2">
<div class="cell"> <div class="cell">
<el-select v-model="itemValue.originType" placeholder="请选择参数位置"> <el-select v-model="itemValue.backendOriginType" placeholder="请选择参数位置">
<el-option label="header" value="header"></el-option> <el-option label="header" value="header"></el-option>
<el-option label="query" value="query"></el-option> <el-option label="query" value="query"></el-option>
<el-option label="body" value="body"></el-option> <el-option label="body" value="body"></el-option>
...@@ -89,7 +89,7 @@ export default { ...@@ -89,7 +89,7 @@ export default {
} }
}, },
interfaceType: { interfaceType: {
type: String, type: [String, Number],
default() { default() {
return '0'; return '0';
} }
...@@ -101,7 +101,7 @@ export default { ...@@ -101,7 +101,7 @@ export default {
type: 'object', type: 'object',
properties: { properties: {
name: { name: {
originType: this.originType, //来源类型 query,body,header backendOriginType: 'query', //来源类型 query,body,header
type: 'string', type: 'string',
currentKey: 'name', currentKey: 'name',
isBackendField: 0, //是否后端字段 isBackendField: 0, //是否后端字段
...@@ -119,18 +119,35 @@ export default { ...@@ -119,18 +119,35 @@ export default {
}; };
}, },
methods: { methods: {
/**
* key 输入变化
*/
blurKey(obj, oldKey) {
const that = this;
if (obj.currentKey != oldKey) {
that.$set(that.itemData.properties, obj.currentKey, obj);
that.$delete(that.itemData.properties, oldKey);
}
// console.log(obj, that.itemData);
},
/**
* 删除
*/
handleDel(obj, itemKey, index) { handleDel(obj, itemKey, index) {
const that = this; const that = this;
// that.$emit('input', that.trData); // that.$emit('input', that.trData);
that.$delete(that.trData.properties, itemKey); that.$delete(that.trData.properties, itemKey);
}, },
/**
* 添加
*/
toAddItem() { toAddItem() {
const that = this; const that = this;
// console.log(that.trData.properties); // console.log(that.trData.properties);
let length = that.keyLength++; let length = that.keyLength++;
// console.log(Object.keys(that.trData.properties), length, that.trData.properties); // console.log(Object.keys(that.trData.properties), length, that.trData.properties);
that.$set(that.trData.properties, 'field' + length, { that.$set(that.trData.properties, 'field' + length, {
originType: that.originType, //来源类型 query,body,header backendOriginType: 'query', //来源类型 query,body,header
type: 'string', type: 'string',
currentKey: 'field' + length, currentKey: 'field' + length,
isBackendField: 0, //是否后端字段 isBackendField: 0, //是否后端字段
......
<!-- <!--
<back-table-right></back-table-right> <back-table-right :itemData="itemData" :interfaceType="interfaceType"></back-table-right>
import backTableRight from '@/components/createApi/back-table-right.vue'; import backTableRight from '@/components/createApi/back-table-right.vue';
--> -->
......
...@@ -215,7 +215,7 @@ export default { ...@@ -215,7 +215,7 @@ export default {
level: 2, level: 2,
currentKey: 'root', currentKey: 'root',
constFlag: true, constFlag: true,
originType: 'header', //来源类型 query,body,header backendOriginType: 'header', //来源类型 query,body,header
type: 'string', type: 'string',
isBackendField: 0, //是否后端字段 isBackendField: 0, //是否后端字段
defaultVal: 'val', //默认值 defaultVal: 'val', //默认值
......
...@@ -122,7 +122,7 @@ export default { ...@@ -122,7 +122,7 @@ export default {
}; };
for (let key in allData.frontParams.properties) { for (let key in allData.frontParams.properties) {
if (allData.frontParams.properties[key].frontOriginType == type) { if (allData.frontParams.properties[key].frontOriginType == type) {
that.$set(newObj, allData.frontParams.properties[key].currentKey, allData.frontParams.properties[key]); that.$set(newObj.properties, allData.frontParams.properties[key].currentKey, allData.frontParams.properties[key]);
} }
} }
return newObj; return newObj;
...@@ -139,7 +139,7 @@ export default { ...@@ -139,7 +139,7 @@ export default {
}; };
for (let key in allData.endParams.properties) { for (let key in allData.endParams.properties) {
if (allData.endParams.properties[key].backendOriginType == type) { if (allData.endParams.properties[key].backendOriginType == type) {
that.$set(newObj, allData.endParams.properties[key].rootKey, allData.endParams.properties[key]); that.$set(newObj.properties, allData.endParams.properties[key].rootKey, allData.endParams.properties[key]);
} }
} }
return newObj; return newObj;
...@@ -153,7 +153,7 @@ export default { ...@@ -153,7 +153,7 @@ export default {
}; };
for (let key in allData.endParams.properties) { for (let key in allData.endParams.properties) {
if (allData.endParams.properties[key].constFlag == true) { if (allData.endParams.properties[key].constFlag == true) {
that.$set(newObj, allData.endParams.properties[key].currentKey, allData.endParams.properties[key]); that.$set(newObj.properties, allData.endParams.properties[key].currentKey, allData.endParams.properties[key]);
} }
} }
return newObj; return newObj;
......
...@@ -245,6 +245,7 @@ export default { ...@@ -245,6 +245,7 @@ export default {
const that = this; const that = this;
if (that.apiInfoData.requestType == 'POST' && that.frontOriginType == 'json') { if (that.apiInfoData.requestType == 'POST' && that.frontOriginType == 'json') {
if (Object.keys(that.bodyFormData.properties.root.properties).length) { if (Object.keys(that.bodyFormData.properties.root.properties).length) {
that.bodyFormData.properties.root.required = [];
for (const key in that.bodyFormData.properties.root.properties) { for (const key in that.bodyFormData.properties.root.properties) {
if (that.bodyFormData.properties.root.properties[key].check) { if (that.bodyFormData.properties.root.properties[key].check) {
that.bodyFormData.properties.root.required.push(key); that.bodyFormData.properties.root.required.push(key);
...@@ -257,6 +258,7 @@ export default { ...@@ -257,6 +258,7 @@ export default {
} }
if (that.apiInfoData.requestType == 'POST' && that.frontOriginType == 'form') { if (that.apiInfoData.requestType == 'POST' && that.frontOriginType == 'form') {
if (Object.keys(that.bodyFormData.properties).length) { if (Object.keys(that.bodyFormData.properties).length) {
that.bodyFormData.required = [];
for (const key in that.bodyFormData.properties) { for (const key in that.bodyFormData.properties) {
if (that.bodyFormData.properties[key].check) { if (that.bodyFormData.properties[key].check) {
that.bodyFormData.required.push(key); that.bodyFormData.required.push(key);
...@@ -268,6 +270,7 @@ export default { ...@@ -268,6 +270,7 @@ export default {
that.apiInfoData.bodyFormData = {}; that.apiInfoData.bodyFormData = {};
} }
if (Object.keys(that.headerData.properties).length) { if (Object.keys(that.headerData.properties).length) {
that.headerData.required = [];
for (const key in that.headerData.properties) { for (const key in that.headerData.properties) {
if (that.headerData.properties[key].check) { if (that.headerData.properties[key].check) {
that.headerData.required.push(key); that.headerData.required.push(key);
...@@ -275,6 +278,7 @@ export default { ...@@ -275,6 +278,7 @@ export default {
} }
} }
if (Object.keys(that.queryData.properties).length) { if (Object.keys(that.queryData.properties).length) {
that.queryData.required = [];
for (const key in that.queryData.properties) { for (const key in that.queryData.properties) {
if (that.queryData.properties[key].check) { if (that.queryData.properties[key].check) {
that.queryData.required.push(key); that.queryData.required.push(key);
...@@ -289,6 +293,10 @@ export default { ...@@ -289,6 +293,10 @@ export default {
handleStoreData() { handleStoreData() {
const that = this; const that = this;
that.apiInfoData = JSON.parse(JSON.stringify(that.$store.state.frontInfo)); 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;
} }
}, },
mounted() { mounted() {
......
...@@ -276,6 +276,7 @@ export default { ...@@ -276,6 +276,7 @@ export default {
dubboInterface: that.$store.state.backInfo.dubboInterface, dubboInterface: that.$store.state.backInfo.dubboInterface,
dubboMethod: that.$store.state.backInfo.dubboMethod, // dubbo 请求方法 dubboMethod: that.$store.state.backInfo.dubboMethod, // dubbo 请求方法
dubboVersion: that.$store.state.backInfo.dubboVersion, // dubbo版本号 dubboVersion: that.$store.state.backInfo.dubboVersion, // dubbo版本号
proxyCode: that.$store.state.backInfo.proxyCode, // 注册中心地址
timeout: that.$store.state.backInfo.timeout, // 超时 timeout: that.$store.state.backInfo.timeout, // 超时
endParams: JSON.stringify(endParams), // 返回 endParams: JSON.stringify(endParams), // 返回
resultParams: JSON.stringify(that.resultParams), // 返回结果 resultParams: JSON.stringify(that.resultParams), // 返回结果
......
...@@ -125,7 +125,7 @@ export default { ...@@ -125,7 +125,7 @@ export default {
that.$emit('showTab', 22); that.$emit('showTab', 22);
}, },
beforeDestroy() { beforeDestroy() {
this.$store.dispatch('clearData'); this.$store.dispatch('clearApiData');
} }
}; };
</script> </script>
......
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