From 900aa82fc6d9baa7a3198589e68b25f8aac7883b Mon Sep 17 00:00:00 2001 From: xuyiming Date: Tue, 11 Aug 2020 15:39:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=A8=E5=86=8C=E5=8F=91=E5=B8=83=E7=9A=84?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E6=9C=8D=E5=8A=A1=E8=AF=A6=E6=83=85fixed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/workbench/fwgl/serviceDetail.vue | 160 ++++++++++++++------- 1 file changed, 111 insertions(+), 49 deletions(-) diff --git a/src/pages/workbench/fwgl/serviceDetail.vue b/src/pages/workbench/fwgl/serviceDetail.vue index 306fa83..cc2114f 100644 --- a/src/pages/workbench/fwgl/serviceDetail.vue +++ b/src/pages/workbench/fwgl/serviceDetail.vue @@ -34,12 +34,19 @@ v-if="now_service == 0 || now_service == 1" > + + - +

服务运行概况

@@ -218,10 +225,76 @@ export default { memory: "", }, service_use_arr: [], - res_data: [], //响应参数 + req_header_arr: [ + { + prop: "name", + label: "字段编码", + minWidth: "20%", + align: "left", + }, + { + prop: "label", + label: "字段名称", + minWidth: "20%", + align: "center", + }, + { + prop: "show_type", + label: "字段类型", + width: "100px", + align: "center", + }, + { + prop: "descript", + label: "字段说明", + minWidth: "30%", + align: "left", + }, + { + prop: "is_must", + label: "是否必须", + width: "120px", + align: "center", + }, + ], // 请求参数-header + req_data: [], // 请求参数 + req_code_arr: "", // 请求示例 + res_header_arr: [ + { + prop: "name", + label: "字段编码", + minWidth: "20%", + align: "left", + }, + { + prop: "label", + label: "字段名称", + minWidth: "20%", + align: "center", + }, + { + prop: "show_type", + label: "字段类型", + width: "100px", + align: "center", + }, + { + prop: "descript", + label: "字段说明", + minWidth: "30%", + align: "left", + }, + { + prop: "example", + label: "字段示例数值", + width: "120px", + align: "center", + }, + ], // 响应参数-header + res_data: [], // 响应参数 + res_code_arr: "", // 响应示例 buy_type: "", sizeset_flag: false, //规格设置是否显示 - code_arr: "", service_arr: [ ["服务基本信息", "接口详细信息", "服务运行状态"], ["服务基本信息", "接口详细信息", "服务运行状态", "服务计费规则"], @@ -262,38 +335,6 @@ export default { }, now_service: 0, datas: {}, - header_arr: [ - { - prop: "name", - label: "字段编码", - minWidth: "20%", - align: "left", - }, - { - prop: "label", - label: "字段名称", - minWidth: "20%", - align: "center", - }, - { - prop: "show_type", - label: "字段类型", - width: "100px", - align: "center", - }, - { - prop: "descript", - label: "字段说明", - minWidth: "30%", - align: "left", - }, - { - prop: "example", - label: "字段示例数值", - width: "120px", - align: "left", - }, - ], header_use_arr: [ { prop: "dydw", @@ -409,10 +450,14 @@ export default { { title: "请求参数:", info: "", + type: "solt", + solt_name: "req_table", }, { title: "请求示例:", info: "", + type: "solt", + solt_name: "req_code", }, { title: "编码格式:", @@ -422,13 +467,13 @@ export default { title: "响应参数:", info: "", type: "solt", - solt_name: "zd_table", + solt_name: "res_table", }, { title: "响应示例:", info: "", type: "solt", - solt_name: "zd_code", + solt_name: "res_code", }, ], service_type_arr: [ @@ -629,20 +674,37 @@ export default { "info", data.create_time.replace("T", " ").split("+")[0] ); + + // 接口详情信息 this.$set( this.servicead_arr[0], "info", this.request_arr[data.req_type - 1] - ); - this.$set( - this.servicead_arr[1], - "info", - data.req_query ? data.req_query : "无" - ); - this.$set(this.servicead_arr[2], "info", data.req_fields); - this.$set(this.servicead_arr[3], "info", data.encode_method); - this.code_arr = data.res_fields_example; - this.res_data = JSON.parse(data.res_fields); + ); // 请求方式 + this.req_data = JSON.parse(data.req_fields || data.req_query || "[]"); // 请求参数 + if (this.req_data.length === 0) { + this.$set(this.servicead_arr[1], "type", ""); + this.$set(this.servicead_arr[1], "info", "无请求参数"); + } + this.req_code_arr = data.req_fields_example || data.req_query_example || ""; // 请求示例 + if (!this.req_code_arr) { + this.$set(this.servicead_arr[2], "type", ""); + this.$set(this.servicead_arr[2], "info", "无请求示例"); + + } + this.$set(this.servicead_arr[3], "info", data.encode_method); // 编码格式 + this.res_data = JSON.parse(data.res_fields || "[]"); // 响应参数 + if (this.res_data.length === 0) { + this.$set(this.servicead_arr[4], "type", ""); + this.$set(this.servicead_arr[4], "info", "无响应参数"); + } + this.res_code_arr = data.res_fields_example || ""; // 响应示例 + if (!this.res_code_arr) { + this.$set(this.servicead_arr[5], "type", ""); + this.$set(this.servicead_arr[5], "info", "无响应示例"); + } + // 接口详情信息 end + this.service_size_data = data.request_spcs_info; this.size_arr_down = data.request_spcs_info; this.buy_type = data.request_spcs_info[0].type; -- 2.26.0