b527bb26 by 蔡俊立

接口服务

1 parent 9e058b07
...@@ -74,7 +74,7 @@ export default { ...@@ -74,7 +74,7 @@ export default {
74 interfaceMethods: ['webapi','webservice'], 74 interfaceMethods: ['webapi','webservice'],
75 interfaceTypes: [ 75 interfaceTypes: [
76 {'label': '工作流服务平台','value':'1'}, 76 {'label': '工作流服务平台','value':'1'},
77 {'label': '管理平台','value':'2'}, 77 {'label': '权限平台','value':'2'},
78 {'label': '定时器服务','value':'3'}, 78 {'label': '定时器服务','value':'3'},
79 {'label': '其他第三方平台','value':'4'}, 79 {'label': '其他第三方平台','value':'4'},
80 ], 80 ],
......
1 <template> 1 <template>
2 <dialogBox title="调用接口" @submitForm="submitForm" saveButton="调用" width="50%" :isFullscreen="false" 2 <dialogBox title="调用接口" @submitForm="submitForm" saveButton="调用" width="50%" :isFullscreen="false"
3 @closeDialog="closeDialog" v-model="value"> 3 @closeDialog="closeDialog" v-model="value">
4 <el-descriptions class="margin-top" :column="1" :size="16" border> 4 <el-descriptions class="margin-top" :column="1" :size="16" border style="height:600px">
5 <el-descriptions-item> 5 <el-descriptions-item>
6 <template slot="label" style="width:200px">接口代码</template>{{ruleForm.interfaceCode}} 6 <template slot="label" style="width:200px">接口代码</template>{{ruleForm.interfaceCode}}
7 </el-descriptions-item> 7 </el-descriptions-item>
...@@ -15,16 +15,21 @@ ...@@ -15,16 +15,21 @@
15 <template slot="label">接口方式</template>{{ruleForm.interfaceMethod}} 15 <template slot="label">接口方式</template>{{ruleForm.interfaceMethod}}
16 </el-descriptions-item> 16 </el-descriptions-item>
17 <el-descriptions-item> 17 <el-descriptions-item>
18 <template slot="label">接口类型</template>{{ruleForm.interfaceType}} 18 <template slot="label">接口类型</template>{{getInterfaceType(ruleForm.interfaceType)}}
19 </el-descriptions-item> 19 </el-descriptions-item>
20 <el-descriptions-item> 20 <el-descriptions-item>
21 <template slot="label">接口参数</template><el-input v-model="interfaceParams" type="textarea" :rows="4"></el-input> 21 <template slot="label">接口参数</template><el-input v-model="interfaceParams" type="textarea" :rows="4"></el-input>
22 </el-descriptions-item> 22 </el-descriptions-item>
23 <el-descriptions-item> 23 <el-descriptions-item>
24 <template slot="label">调用状态</template>{{returnMessage.statusCode}} 24 <template slot="label">调用状态</template>
25 <div style="color:green" v-if="returnMessage">{{returnMessage.statusCode}}</div>
26 <div style="color:red" v-else>ERROR</div>
25 </el-descriptions-item> 27 </el-descriptions-item>
26 <el-descriptions-item> 28 <el-descriptions-item>
27 <template slot="label">返回结果</template>{{returnMessage.body}} 29 <div slot="label" style="height:150px">返回结果
30 </div>
31 <div v-if="returnMessage">{{returnMessage.body}}</div>
32 <div v-else>无效的接口CODE,请检查接口配置</div>
28 </el-descriptions-item> 33 </el-descriptions-item>
29 </el-descriptions> 34 </el-descriptions>
30 </dialogBox> 35 </dialogBox>
...@@ -46,7 +51,7 @@ export default { ...@@ -46,7 +51,7 @@ export default {
46 interfaceMethods: ['webapi','webservice'], 51 interfaceMethods: ['webapi','webservice'],
47 interfaceTypes: [ 52 interfaceTypes: [
48 {'label': '工作流服务平台','value':'1'}, 53 {'label': '工作流服务平台','value':'1'},
49 {'label': '管理平台','value':'2'}, 54 {'label': '权限平台','value':'2'},
50 {'label': '定时器服务','value':'3'}, 55 {'label': '定时器服务','value':'3'},
51 {'label': '其他第三方平台','value':'4'}, 56 {'label': '其他第三方平台','value':'4'},
52 ], 57 ],
...@@ -60,11 +65,11 @@ export default { ...@@ -60,11 +65,11 @@ export default {
60 submitForm () { 65 submitForm () {
61 var formdata = new FormData(); 66 var formdata = new FormData();
62 formdata.append("interfaceCode", this.ruleForm.interfaceCode); 67 formdata.append("interfaceCode", this.ruleForm.interfaceCode);
68 formdata.append("interfaceType", this.ruleForm.interfaceType);
63 formdata.append("params", this.interfaceParams); 69 formdata.append("params", this.interfaceParams);
64 interfaceRetrieve(formdata).then(res => { 70 interfaceRetrieve(formdata).then(res => {
65 if(res.code == 200){ 71 if(res.code == 200){
66 this.returnMessage = res.result 72 this.returnMessage = res.result
67
68 } 73 }
69 }) 74 })
70 }, 75 },
...@@ -77,10 +82,27 @@ export default { ...@@ -77,10 +82,27 @@ export default {
77 this.$emit("input", false); 82 this.$emit("input", false);
78 this.interfaceParams = '{\n\n}' 83 this.interfaceParams = '{\n\n}'
79 this.returnMessage = {} 84 this.returnMessage = {}
85 },
86 //获取接口类型
87 getInterfaceType(code){
88 let name = ''
89 for (let item of this.interfaceTypes) {
90 if (item.value == code) {
91 name = item.label;
92 break;
93 }
94 }
95 return name;
80 } 96 }
81 } 97 }
82 } 98 }
83 </script> 99 </script>
84 <style scoped lang="scss"> 100 <style scoped lang="scss">
85 @import "~@/styles/mixin.scss"; 101 @import "~@/styles/mixin.scss";
102 /deep/ .is-bordered-label{
103 width:100px
104 }
105 /deep/ .el-descriptions-item__content:nth-last-child(){
106 height: 100px;
107 }
86 </style> 108 </style>
......
...@@ -49,7 +49,7 @@ class data extends filter { ...@@ -49,7 +49,7 @@ class data extends filter {
49 case '1': 49 case '1':
50 return <div>工作流服务平台</div> 50 return <div>工作流服务平台</div>
51 case '2': 51 case '2':
52 return <div>管理平台</div> 52 return <div>权限平台</div>
53 case '3': 53 case '3':
54 return <div>定时器服务</div> 54 return <div>定时器服务</div>
55 case '4': 55 case '4':
......