Commit 1ed605ac by 无尘

fix: 修改导入数据属性

parent fcaf141f
<!DOCTYPE html><html><head><meta charset=utf-8><link rel="shortcut icon" href=./favicon.ico><title>API网关管理平台</title><link href=./static/css/app.d36536f3e6a6b03d810c4eceeceb9b81.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 src=//web-1251519181.file.myqcloud.com/components/input.2.0.15.js></script><script src=//web-1251519181.file.myqcloud.com/components/delete.2.0.01.js></script><script type=text/javascript src=./static/js/manifest.ad48e6493109b55e42e0.js></script><script type=text/javascript src=./static/js/vendor.71dc162eb690bf6a36a0.js></script><script type=text/javascript src=./static/js/app.9c166ead6e4a1e024065.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.2b00d5c727966d90b5b44417d78e1289.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 src=//web-1251519181.file.myqcloud.com/components/input.2.0.15.js></script><script src=//web-1251519181.file.myqcloud.com/components/delete.2.0.01.js></script><script type=text/javascript src=./static/js/manifest.46796dcc61179f1f037f.js></script><script type=text/javascript src=./static/js/vendor.71dc162eb690bf6a36a0.js></script><script type=text/javascript src=./static/js/app.80268ec4d989f50283bc.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,o,c){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,c);b.length;)b.shift()();if(c)for(u=0;u<c.length;u++)i=a(a.s=c[u]);return i};var r={},t={24:0};function a(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,a),t.l=!0,t.exports}a.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,a){n=t[e]=[r,a]});n[2]=r;var o=document.getElementsByTagName("head")[0],c=document.createElement("script");c.type="text/javascript",c.charset="utf-8",c.async=!0,c.timeout=12e4,a.nc&&c.setAttribute("nonce",a.nc),c.src=a.p+"static/js/"+e+"."+{0:"52863aa1d72d31066413",1:"0ebe3ead93207dc78a78",2:"d023aeaa24913addda1f",3:"ee2db5932cf0c94dec20",4:"42639b6df28493f31a16",5:"842d518baa251c8fedc4",6:"52e14b1f79af7d86f42f",7:"b2a85a42ddd430235a63",8:"81460c8c66d06cfea732",9:"c98145195e68a6e13faf",10:"638039a7b39908980436",11:"f27d1de28264fbbe30ff",12:"ccbc18453e41490e2dba",13:"b109164d2be44afb7733",14:"9825bb69e60b8030c230",15:"6700988b665e14f99d41",16:"6e70f43452cbef826036",17:"8354f7b686256ddf47fb",18:"e7685f45ec4dd5b70ae4",19:"40fd9824f7542ed7f56d",20:"c163ea91d150e0ca1cb1",21:"55879284ad4d1f03fbe0"}[e]+".js";var f=setTimeout(d,12e4);function d(){c.onerror=c.onload=null,clearTimeout(f);var n=t[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),t[e]=void 0)}return c.onerror=c.onload=d,o.appendChild(c),r},a.m=e,a.c=r,a.d=function(e,n,r){a.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},a.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(n,"a",n),n},a.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},a.p="./",a.oe=function(e){throw console.error(e),e}}([]);
\ No newline at end of file
!function(e){var n=window.webpackJsonp;window.webpackJsonp=function(r,a,f){for(var c,d,i,u=0,b=[];u<r.length;u++)d=r[u],t[d]&&b.push(t[d][0]),t[d]=0;for(c in a)Object.prototype.hasOwnProperty.call(a,c)&&(e[c]=a[c]);for(n&&n(r,a,f);b.length;)b.shift()();if(f)for(u=0;u<f.length;u++)i=o(o.s=f[u]);return i};var r={},t={24: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 a=document.getElementsByTagName("head")[0],f=document.createElement("script");f.type="text/javascript",f.charset="utf-8",f.async=!0,f.timeout=12e4,o.nc&&f.setAttribute("nonce",o.nc),f.src=o.p+"static/js/"+e+"."+{0:"52863aa1d72d31066413",1:"0ebe3ead93207dc78a78",2:"919ea292f4ef6e6d60f6",3:"ee2db5932cf0c94dec20",4:"42639b6df28493f31a16",5:"842d518baa251c8fedc4",6:"52e14b1f79af7d86f42f",7:"b2a85a42ddd430235a63",8:"81460c8c66d06cfea732",9:"c98145195e68a6e13faf",10:"638039a7b39908980436",11:"f27d1de28264fbbe30ff",12:"ccbc18453e41490e2dba",13:"b109164d2be44afb7733",14:"9825bb69e60b8030c230",15:"6700988b665e14f99d41",16:"6e70f43452cbef826036",17:"8354f7b686256ddf47fb",18:"e7685f45ec4dd5b70ae4",19:"40fd9824f7542ed7f56d",20:"c163ea91d150e0ca1cb1",21:"55879284ad4d1f03fbe0"}[e]+".js";var c=setTimeout(d,12e4);function d(){f.onerror=f.onload=null,clearTimeout(c);var n=t[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),t[e]=void 0)}return f.onerror=f.onload=d,a.appendChild(f),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
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: 无尘 * @Author: 无尘
* @Date: 2019-08-12 15:11:33 * @Date: 2019-08-12 15:11:33
* @LastEditors : 无尘 * @LastEditors : 无尘
* @LastEditTime : 2020-01-10 16:36:26 * @LastEditTime : 2020-01-13 11:45:32
--> -->
<!-- <!--
<header-param :itemData="itemData"></header-param> <header-param :itemData="itemData"></header-param>
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
* @version: 1.0.0 * @version: 1.0.0
* @Author: 无尘 * @Author: 无尘
* @Date: 2019-08-07 17:17:50 * @Date: 2019-08-07 17:17:50
* @LastEditors: 无尘 * @LastEditors : 无尘
* @LastEditTime: 2019-10-15 14:29:55 * @LastEditTime : 2020-01-13 11:43:43
--> -->
<!-- <!--
<create-base></create-base> <create-base></create-base>
...@@ -308,6 +308,10 @@ export default { ...@@ -308,6 +308,10 @@ export default {
if (item[childKey]['isRootKey']) { if (item[childKey]['isRootKey']) {
parentKey.isRootKeyFlag = true; // 这里是必须的 parentKey.isRootKeyFlag = true; // 这里是必须的
} }
// 为了以后切换type可以监听到属性,需要预制属性
if (item[childKey].type != 'array' && item[childKey].type != 'object') {
item[childKey].properties = {};
}
if (item[childKey].type == 'array' && Object.keys(item[childKey].items.properties).length) { if (item[childKey].type == 'array' && Object.keys(item[childKey].items.properties).length) {
await that.handleArrObjData(item[childKey].items.properties, item[childKey]); await that.handleArrObjData(item[childKey].items.properties, item[childKey]);
} }
...@@ -337,6 +341,10 @@ export default { ...@@ -337,6 +341,10 @@ export default {
if (allData.properties[key].frontOriginType == type) { if (allData.properties[key].frontOriginType == type) {
that.$set(newObj.properties, allData.properties[key].currentKey, allData.properties[key]); that.$set(newObj.properties, allData.properties[key].currentKey, allData.properties[key]);
} }
// 为了以后切换type可以监听到属性,需要预制属性
if (allData.properties[key].type != 'array' && allData.properties[key].type != 'object') {
allData.properties[key].properties = {};
}
// console.log(allData.properties[key]); // console.log(allData.properties[key]);
// 如果有数组出现 // 如果有数组出现
if (allData.properties[key].type == 'array' && Object.keys(allData.properties[key].items.properties).length) { if (allData.properties[key].type == 'array' && Object.keys(allData.properties[key].items.properties).length) {
...@@ -364,8 +372,7 @@ export default { ...@@ -364,8 +372,7 @@ export default {
that.apiInfoData.requestType = 'POST'; that.apiInfoData.requestType = 'POST';
that.apiInfoData.frontBodyType = 'json'; that.apiInfoData.frontBodyType = 'json';
} }
// console.log('dubbo数据:json//', JSON.stringify(that.bodyJsonData));
// console.log(that.bodyJsonData);
// 如果返回没有 bodyRoot,需要添加默认的 // 如果返回没有 bodyRoot,需要添加默认的
let bodyJsonData = { let bodyJsonData = {
type: 'object', type: 'object',
...@@ -523,7 +530,7 @@ export default { ...@@ -523,7 +530,7 @@ export default {
that.apiInfoData.queryData = that.queryData; that.apiInfoData.queryData = that.queryData;
that.$store.dispatch('saveFrontInfo', that.apiInfoData); that.$store.dispatch('saveFrontInfo', that.apiInfoData);
that.$emit('submitNext', that.apiInfoData); that.$emit('submitNext', that.apiInfoData);
console.log('front:', that.apiInfoData); // console.log('front:', that.apiInfoData);
}, },
/** /**
* 处理状态中的前端数据 * 处理状态中的前端数据
...@@ -581,7 +588,7 @@ export default { ...@@ -581,7 +588,7 @@ export default {
}, },
required: [] required: []
}; };
// console.log(that.apiInfoData.bodyJsonData); // console.log('状态中:json//',JSON.stringify(that.apiInfoData.bodyJsonData));
that.bodyJsonData = Object.keys(that.apiInfoData.bodyJsonData).length ? that.apiInfoData.bodyJsonData : bodyJsonData; that.bodyJsonData = Object.keys(that.apiInfoData.bodyJsonData).length ? that.apiInfoData.bodyJsonData : bodyJsonData;
that.bodyFormData = Object.keys(that.apiInfoData.bodyFormData).length ? that.apiInfoData.bodyFormData : bodyFormData; that.bodyFormData = Object.keys(that.apiInfoData.bodyFormData).length ? that.apiInfoData.bodyFormData : bodyFormData;
} }
......
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