Skip to content

Commit c480d5b

Browse files
committed
2.2.2
1.修复了自动化测试中接口不能自动同步的bug 2.在接口参数中,添加了JSON Array编辑选项 3.修复了net.js代理里Access-Control-Expose-Headers为空的bug
1 parent f4aef03 commit c480d5b

24 files changed

+301
-129
lines changed

SBDoc/html/component/inparamBody.vue

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
<el-option value="application/xml" label="XML(application/xml)"></el-option>
1313
<el-option value="text/xml" label="XML(text/xml)"></el-option>
1414
<el-option value="application/javascript" label="JAVASCRIPT"></el-option>
15+
</el-select>&nbsp;&nbsp;&nbsp;&nbsp;
16+
<el-select v-model="rawJSONType" v-if="info.type==1 && info.rawType==2">
17+
<el-option :value="0" label="Object"></el-option>
18+
<el-option :value="1" label="Array"></el-option>
1519
</el-select>
1620
</el-row>
1721
<table width="100%" v-if="info.type==0">
@@ -96,6 +100,22 @@
96100
info:function () {
97101
return this.$store.state.bodyInfo
98102
},
103+
rawJSONType:{
104+
get:function () {
105+
return this.info.rawJSONType
106+
},
107+
set:function (val) {
108+
this.info.rawJSONType=val;
109+
if(val)
110+
{
111+
this.info.rawJSON=this.$store.state.rawJSONArray;
112+
}
113+
else
114+
{
115+
this.info.rawJSON=this.$store.state.rawJSONObject;
116+
}
117+
}
118+
},
99119
rawType:{
100120
get:function () {
101121
var type="";

SBDoc/html/component/inparamBodyJSON.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
&nbsp;
1212
</el-col>
1313
<el-col class="col" :span="22">
14-
<el-input style="width: 90%;" placeholder="请填写名称" v-model.trim="item.name" v-if="item.name!=null" @focus="focus(item)" @blur="blur(item)" :disabled="true"></el-input>
14+
<el-input style="width: 90%;" placeholder="请填写名称" v-model.trim="item.name" v-if="item.name!=null && (level!=0 || type!=1)" @focus="focus(item)" @blur="blur(item)" :disabled="true"></el-input>
1515
<el-input style="width: 90%;" placeholder="该字段没有名称" disabled v-else></el-input>
1616
</el-col>
1717
</td>
@@ -60,6 +60,9 @@
6060
computed:{
6161
arr:function () {
6262
return this.source?this.source:this.$store.state.bodyInfo.rawJSON
63+
},
64+
type:function () {
65+
return this.$store.state.bodyInfo.rawJSONType;
6366
}
6467
},
6568
methods:{
@@ -98,7 +101,7 @@
98101
},
99102
add:function (arr) {
100103
arr.push({
101-
name:(this.parent && this.parent.type==3)?null:"",
104+
name:((this.parent && this.parent.type==3) || (this.level==0 && this.type==1))?null:"",
102105
must:1,
103106
type:0,
104107
remark:"",

SBDoc/html/dist/vendor.bundle.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SBDoc/html/projectinfo/storeInterface.js

Lines changed: 59 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,27 @@ module.exports=new Vuex.Store({
3333
rawTextRemark:"",
3434
rawFileRemark:"",
3535
rawText:"",
36-
rawJSON:[{
37-
name:"",
38-
must:1,
39-
type:0,
40-
remark:"",
41-
show:1,
42-
mock:"",
43-
drag:1
44-
}]
36+
rawJSON:[],
37+
rawJSONType:0
4538
},
39+
rawJSONObject:[{
40+
name:"",
41+
must:1,
42+
type:0,
43+
remark:"",
44+
show:1,
45+
mock:"",
46+
drag:1
47+
}],
48+
rawJSONArray:[{
49+
name:null,
50+
must:1,
51+
type:0,
52+
remark:"",
53+
show:1,
54+
mock:"",
55+
drag:1
56+
}],
4657
outInfo:{
4758
type:0,
4859
rawRemark:"",
@@ -135,6 +146,7 @@ module.exports=new Vuex.Store({
135146
var bJSON=false,obj={};
136147
if(state.bodyInfo.type==1 && state.bodyInfo.rawType==2 && state.bodyInfo.rawJSON)
137148
{
149+
obj=state.bodyInfo.rawJSONType==0?{}:[];
138150
bJSON=true;
139151
var result=helper.resultSave(state.bodyInfo.rawJSON);
140152
helper.convertToJSON(result,obj);
@@ -143,6 +155,7 @@ module.exports=new Vuex.Store({
143155
return helper.mock(state.outInfo.rawMock,info);
144156
},
145157
rawJSON:function (state) {
158+
var obj=state.bodyInfo.rawJSONType==0?{}:[];
146159
var obj={};
147160
var result=helper.resultSave(state.bodyInfo.rawJSON);
148161
helper.convertToJSON(result,obj);
@@ -249,21 +262,32 @@ module.exports=new Vuex.Store({
249262
drag:1,
250263
mock:""
251264
})
265+
state.rawJSONObject=[{
266+
name:"",
267+
must:1,
268+
type:0,
269+
remark:"",
270+
show:1,
271+
mock:"",
272+
drag:1
273+
}];
274+
state.rawJSONArray=[{
275+
name:null,
276+
must:1,
277+
type:0,
278+
remark:"",
279+
show:1,
280+
mock:"",
281+
drag:1
282+
}];
252283
state.bodyInfo={
253284
type:0,
254285
rawType:0,
255286
rawTextRemark:"",
256287
rawFileRemark:"",
257288
rawText:"",
258-
rawJSON:[{
259-
name:"",
260-
must:1,
261-
type:0,
262-
remark:"",
263-
show:1,
264-
mock:"",
265-
drag:1
266-
}]
289+
rawJSON:state.rawJSONObject,
290+
rawJSONType:0
267291
};
268292
state.outInfo={
269293
type:0,
@@ -375,21 +399,25 @@ module.exports=new Vuex.Store({
375399
{
376400
Vue.set(state.bodyInfo,"rawFileRemark","");
377401
}
402+
if(state.bodyInfo.rawJSONType===undefined)
403+
{
404+
Vue.set(state.bodyInfo,"rawJSONType",0);
405+
}
378406
if(state.bodyInfo.rawJSON==undefined)
379407
{
380-
Vue.set(state.bodyInfo,"rawJSON",[{
381-
name:"",
382-
must:1,
383-
type:0,
384-
remark:"",
385-
show:1,
386-
mock:"",
387-
drag:1
388-
}]);
408+
Vue.set(state.bodyInfo,"rawJSON",state.rawJSONObject);
389409
}
390410
else
391411
{
392412
helper.initResultShow(state.bodyInfo.rawJSON);
413+
if(state.bodyInfo.rawJSONType==0)
414+
{
415+
state.rawJSONObject=state.bodyInfo.rawJSON;
416+
}
417+
else
418+
{
419+
state.rawJSONArray=state.bodyInfo.rawJSON;
420+
}
393421
}
394422
var bFind=false;
395423
for(var i=0;i<state.header.length;i++)
@@ -417,9 +445,10 @@ module.exports=new Vuex.Store({
417445
var result=[];
418446
for(var key in obj)
419447
{
420-
helper.handleResultData(key,obj[key],result,null,1)
448+
helper.handleResultData(key,obj[key],result,null,1,null,1)
421449
}
422450
state.bodyInfo.rawJSON=result;
451+
state.bodyInfo.rawJSONType=(obj instanceof Array)?1:0;
423452
state.bodyInfo.rawText="";
424453
state.bodyInfo.rawType=2;
425454
}
@@ -689,15 +718,8 @@ module.exports=new Vuex.Store({
689718
rawTextRemark:"",
690719
rawFileRemark:"",
691720
rawText:"",
692-
rawJSON:[{
693-
name:"",
694-
must:1,
695-
type:0,
696-
remark:"",
697-
show:1,
698-
mock:"",
699-
drag:1
700-
}]
721+
rawJSON:context.state.rawJSONObject,
722+
rawJSONType:0
701723

702724
},
703725
outInfo:{

SBDoc/html/util/helper.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ helper.format=function (txt,mix,outParam,status) {
803803
};
804804
}
805805

806-
helper.handleResultData=function (name,data,result,originObj,show) {
806+
helper.handleResultData=function (name,data,result,originObj,show,bArr) {
807807
name=typeof(name)=="string"?name:null;
808808
if(typeof(data)=="string")
809809
{
@@ -871,8 +871,19 @@ helper.handleResultData=function (name,data,result,originObj,show) {
871871
result.push(obj);
872872
if(data.length>0)
873873
{
874-
var resultObj=originObj?((originObj.data && originObj.data.length>0)?originObj.data[0]:null):null;
875-
arguments.callee(null,data[0],obj.data,resultObj,show)
874+
if(bArr)
875+
{
876+
for(var i=0;i<data.length;i++)
877+
{
878+
var resultObj=originObj?((originObj.data && originObj.data.length>0)?originObj.data[i]:null):null;
879+
arguments.callee(null,data[i],obj.data,resultObj,show,input)
880+
}
881+
}
882+
else
883+
{
884+
var resultObj=originObj?((originObj.data && originObj.data.length>0)?originObj.data[0]:null):null;
885+
arguments.callee(null,data[0],obj.data,resultObj,show,input)
886+
}
876887
}
877888
}
878889
else if(typeof(data)=="object" && !(data instanceof Array))

0 commit comments

Comments
 (0)