Commit 900aa82f authored by 徐一鸣's avatar 徐一鸣

注册发布的服务服务详情fixed

parent 908bcba0
......@@ -34,12 +34,19 @@
v-if="now_service == 0 || now_service == 1"
>
<table-um
:headers="header_arr"
:headers="req_header_arr"
:datas="req_data"
:stripe="true"
slot="req_table"
></table-um>
<v-apaas-code :datas="req_code_arr" slot="req_code"></v-apaas-code>
<table-um
:headers="res_header_arr"
:datas="res_data"
:stripe="true"
slot="zd_table"
slot="res_table"
></table-um>
<v-apaas-code :datas="code_arr" slot="zd_code"></v-apaas-code>
<v-apaas-code :datas="res_code_arr" slot="res_code"></v-apaas-code>
</info-list>
<div v-show="now_service == 2">
<p class="service_title"><span></span>服务运行概况</p>
......@@ -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;
......
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