Commit 2dbb5a24 authored by 徐一鸣's avatar 徐一鸣

申请的服务-详情页-申请的规格、申请时间字段显示异常

parent 4fc90ea0
......@@ -84,7 +84,6 @@
:header="listHeader"
:data="listData"
:padding-left="listPaddingLeft"
:select="listSelect"
@select="selectAction"
></list-table>
</div>
......
......@@ -16,20 +16,33 @@
:style="
now_service == index ? { borderBottom: '4px solid #f5ab4c' } : {}
"
>{{ item }}</div>
>
{{ item }}
</div>
</div>
<div class="type_box_select">
<info-list :list_arr="process_in_up_arr" v-if="now_service == 1&&process_in_up">
<info-list
:list_arr="process_in_up_arr"
v-if="now_service == 1 && process_in_up"
>
<div slot="service_port" class="service_port">
<el-select v-model="port_select" placeholder="" @change="change_port">
<el-select
v-model="port_select"
placeholder=""
@change="change_port"
>
<el-option
v-for="item in port_options"
:key="item.value"
:label="item.label"
:value="item.value">
:value="item.value"
>
</el-option>
</el-select>
<div class="port_bg_box" style="padding:20px;background-color:#f8f9fd;margin-top:10px;">
<div
class="port_bg_box"
style="padding:20px;background-color:#f8f9fd;margin-top:10px;"
>
<info-list :list_arr="port_solt_arr">
<table-um
:headers="req_solt_header_arr"
......@@ -37,36 +50,55 @@
:stripe="true"
slot="request_table"
></table-um>
<v-apaas-code :datas="req_solt_code_arr" slot="request_code" :readOnly="true"></v-apaas-code>
<v-apaas-code
:datas="req_solt_code_arr"
slot="request_code"
:readOnly="true"
></v-apaas-code>
<table-um
:headers="res_solt_header_arr"
:datas="res_solt_data"
:stripe="true"
slot="response_table"
></table-um>
<v-apaas-code :datas="res_solt_code_arr" slot="response_code" :readOnly="true"></v-apaas-code>
<v-apaas-code
:datas="res_solt_code_arr"
slot="response_code"
:readOnly="true"
></v-apaas-code>
</info-list>
</div>
</div>
</info-list>
<info-list :list_arr="perception_solt_arr" v-if="now_service == 1&&perception_in">
<info-list
:list_arr="perception_solt_arr"
v-if="now_service == 1 && perception_in"
>
<table-um
:headers="perception_req_solt_header_arr"
:datas="req_solt_data"
:stripe="true"
slot="request_table"
></table-um>
<v-apaas-code :datas="req_solt_code_arr" slot="request_code" :readOnly="true"></v-apaas-code>
<v-apaas-code
:datas="req_solt_code_arr"
slot="request_code"
:readOnly="true"
></v-apaas-code>
<table-um
:headers="perception_res_solt_header_arr"
:datas="res_solt_data"
:stripe="true"
slot="response_table"
></table-um>
<v-apaas-code :datas="res_solt_code_arr" slot="response_code" :readOnly="true"></v-apaas-code>
<v-apaas-code
:datas="res_solt_code_arr"
slot="response_code"
:readOnly="true"
></v-apaas-code>
</info-list>
<info-list
v-else
v-else
:list_arr="
now_service == 0
? list_arr
......@@ -87,11 +119,16 @@
:datas="res_table_arr"
slot="apply_table"
></table-um>
<v-apaas-code :datas="res_code_arr" slot="res_code" :readOnly="true"></v-apaas-code>
<process-card :data="use_approval_arr" slot="approval"></process-card>
<v-apaas-code
:datas="res_code_arr"
slot="res_code"
:readOnly="true"
></v-apaas-code>
<process-card
:data="use_approval_arr"
slot="approval"
></process-card>
</info-list>
</div>
</div>
</div>
......@@ -116,18 +153,18 @@ export default {
data() {
return {
use_approval_arr: [],
process_in_up:false,//是否是服务注册产生的
perception_in:false,//是否是感知服务
service_apply_type:1,//服务申请的方式,1:计次收费2:时长收费
port_select:'',
req_solt_code_arr:'',
res_solt_code_arr:'',
perception_req_solt_code_arr:'',
perception_res_solt_code_arr:'',
req_solt_data:[],
res_solt_data:[],
perception_req_solt_data:[],
perception_res_solt_data:[],
process_in_up: false, //是否是服务注册产生的
perception_in: false, //是否是感知服务
service_apply_type: 1, //服务申请的方式,1:计次收费2:时长收费
port_select: "",
req_solt_code_arr: "",
res_solt_code_arr: "",
perception_req_solt_code_arr: "",
perception_res_solt_code_arr: "",
req_solt_data: [],
res_solt_data: [],
perception_req_solt_data: [],
perception_res_solt_data: [],
req_solt_header_arr: [
{
prop: "name",
......@@ -189,7 +226,7 @@ export default {
align: "center",
width: 240,
},
],
],
perception_req_solt_header_arr: [
{
prop: "name",
......@@ -225,7 +262,7 @@ export default {
align: "center",
width: 240,
},
],
],
perception_res_solt_header_arr: [
{
prop: "name",
......@@ -261,9 +298,9 @@ export default {
align: "center",
width: 240,
},
],
port_options:[],
port_solt_arr:[
],
port_options: [],
port_solt_arr: [
{
title: "服务地址:",
info: "",
......@@ -301,7 +338,7 @@ export default {
solt_name: "response_code",
},
],
perception_solt_arr:[
perception_solt_arr: [
{
title: "接口文档:",
info: "",
......@@ -339,9 +376,9 @@ export default {
info: "",
type: "solt",
solt_name: "response_code",
}
},
],
process_in_up_arr:[
process_in_up_arr: [
{
title: "接口文档:",
info: "",
......@@ -353,7 +390,7 @@ export default {
info: "",
type: "solt",
solt_name: "service_port",
}
},
],
approval_arr: [
{
......@@ -477,7 +514,7 @@ export default {
service_header_arr: {
id: "",
isMap: false,
isProcess:false,
isProcess: false,
name: "",
first: [
{
......@@ -652,7 +689,7 @@ export default {
},
], // 响应参数-header
res_table_arr: [], // 响应参数
res_code_arr: ""
res_code_arr: "",
};
},
watch: {},
......@@ -662,16 +699,16 @@ export default {
},
mounted() {},
methods: {
change_port(val){
this.port_options.forEach(e => {
if(e.value == val){
this.$set(this.port_solt_arr[0],'info',e.value)
this.$set(this.port_solt_arr[1],'info',e.req_type)
this.$set(this.port_solt_arr[2],'info',e.encode_method)
this.req_solt_data = e.req_fields
this.res_solt_data = e.res_fields
this.req_solt_code_arr = e.req_fields_example
this.res_solt_code_arr = e.res_fields_example
change_port(val) {
this.port_options.forEach((e) => {
if (e.value == val) {
this.$set(this.port_solt_arr[0], "info", e.value);
this.$set(this.port_solt_arr[1], "info", e.req_type);
this.$set(this.port_solt_arr[2], "info", e.encode_method);
this.req_solt_data = e.req_fields;
this.res_solt_data = e.res_fields;
this.req_solt_code_arr = e.req_fields_example;
this.res_solt_code_arr = e.res_fields_example;
}
});
},
......@@ -726,79 +763,115 @@ export default {
? "#515fe7"
: "#e15260"
);
this.$set(this.service_header_arr["second"][0], "text", data.service_apply_info.urls[0].req_url);
this.$set(
this.service_header_arr["second"][0],
"text",
data.service_apply_info.urls[0].req_url
);
this.$set(this.service_header_arr, "url", data.cover);
//判断是否是服务注册出来的流程服务
if(data.data_service_type2 == 24&&data.workflows_id==0){
this.process_in_up = true
this.$set(this.process_in_up_arr[0],'info',data.doc_file.split('/')[data.doc_file.split('/').length-1])
this.$set(this.process_in_up_arr[0],'url',data.doc_file)
var temp_port_arr = []
data.urls.forEach(e => {
temp_port_arr.push({
label:e.req_name,
value:e.req_url,
able:e.state==-1?false:true,
...e
})
if (data.data_service_type2 == 24 && data.workflows_id == 0) {
this.process_in_up = true;
this.$set(
this.process_in_up_arr[0],
"info",
data.doc_file.split("/")[data.doc_file.split("/").length - 1]
);
this.$set(this.process_in_up_arr[0], "url", data.doc_file);
var temp_port_arr = [];
data.urls.forEach((e) => {
temp_port_arr.push({
label: e.req_name,
value: e.req_url,
able: e.state == -1 ? false : true,
...e,
});
this.port_options = temp_port_arr
if(this.port_options[0]){
this.port_select = this.port_options[0].value
this.$set(this.port_solt_arr[0],'info',this.port_options[0].value)
this.$set(this.port_solt_arr[1],'info',this.port_options[0].req_type)
this.$set(this.port_solt_arr[2],'info',this.port_options[0].encode_method)
this.req_solt_data = this.port_options[0].req_fields
this.res_solt_data = this.port_options[0].res_fields
this.req_solt_code_arr = this.port_options[0].req_fields_example
this.res_solt_code_arr = this.port_options[0].res_fields_example
}
}else{
this.process_in_up = false
}
if(data.service_data_type_1 == 10){
this.perception_in = true
this.$set(this.perception_solt_arr[0],'info',data.doc_file.split('/')[data.doc_file.split('/').length-1])
this.$set(this.perception_solt_arr[1],'info',data.urls[0].req_url)
this.$set(this.perception_solt_arr[2],'info',data.urls[0].encode_method)
this.req_solt_data = data.urls[0].req_fields
this.res_solt_data = data.urls[0].res_fields
this.req_solt_code_arr = data.urls[0].req_fields_example
this.res_solt_code_arr = data.urls[0].res_fields_example
}else{
this.perception_in = false
}
if(this.service_apply_type==1){
});
this.port_options = temp_port_arr;
if (this.port_options[0]) {
this.port_select = this.port_options[0].value;
this.$set(
this.service_header_arr["first"][2],
"text",
data.service_apply_info.service_end_time == "0001-01-01T00:00:00Z"
? "-"
: data.service_apply_info.service_end_time
.replace("T", " ")
.split("+")[0]
this.port_solt_arr[0],
"info",
this.port_options[0].value
);
this.$set(this.service_header_arr["first"][2],'name','可调用次数')
}else{
this.$set(
this.service_header_arr["first"][2],
"text",
data.service_apply_info.service_end_time == "0001-01-01T00:00:00Z"
? "-"
: data.service_apply_info.service_end_time
.replace("T", " ")
.split("+")[0]
this.port_solt_arr[1],
"info",
this.port_options[0].req_type
);
this.$set(
this.port_solt_arr[2],
"info",
this.port_options[0].encode_method
);
this.req_solt_data = this.port_options[0].req_fields;
this.res_solt_data = this.port_options[0].res_fields;
this.req_solt_code_arr = this.port_options[0].req_fields_example;
this.res_solt_code_arr = this.port_options[0].res_fields_example;
}
if(this.process_in_up){
var temp_sj = this.service_header_arr.first.pop()
this.service_header_arr.second = []
this.service_header_arr.second.push(temp_sj)
}
} else {
this.process_in_up = false;
}
if (data.service_data_type_1 == 10) {
this.perception_in = true;
this.$set(
this.perception_solt_arr[0],
"info",
data.doc_file.split("/")[data.doc_file.split("/").length - 1]
);
this.$set(
this.perception_solt_arr[1],
"info",
data.urls[0].req_url
);
this.$set(
this.perception_solt_arr[2],
"info",
data.urls[0].encode_method
);
this.req_solt_data = data.urls[0].req_fields;
this.res_solt_data = data.urls[0].res_fields;
this.req_solt_code_arr = data.urls[0].req_fields_example;
this.res_solt_code_arr = data.urls[0].res_fields_example;
} else {
this.perception_in = false;
}
if (this.service_apply_type == 1) {
this.$set(
this.service_header_arr["first"][2],
"text",
data.service_apply_info.service_end_time == "0001-01-01T00:00:00Z"
? "-"
: data.service_apply_info.service_end_time
.replace("T", " ")
.split("+")[0]
);
this.$set(
this.service_header_arr["first"][2],
"name",
"可调用次数"
);
} else {
this.$set(
this.service_header_arr["first"][2],
"text",
data.service_apply_info.service_end_time == "0001-01-01T00:00:00Z"
? "-"
: data.service_apply_info.service_end_time
.replace("T", " ")
.split("+")[0]
);
}
if (this.process_in_up) {
var temp_sj = this.service_header_arr.first.pop();
this.service_header_arr.second = [];
this.service_header_arr.second.push(temp_sj);
}
this.$set(this.list_arr[0], "info", data.descript);
this.$set(this.list_arr[1], "info", data.data_service_type2_name);
this.$set(
......@@ -857,16 +930,17 @@ export default {
"url",
data.service_apply_info.apply_file
);
this.$set(
this.apply_arr[6],
"info",
"访问次数:" +
data.service_apply_info.request_spcs.pv +
"/日," +
"访问量:" +
data.service_apply_info.request_spcs.count +
"/日"
);
let spcs = "";
if (data.service_apply_info.spcs_type === 1) {
spcs = `${data.service_apply_info.single_money}金币/${data.service_apply_info.spcs_count}次`;
} else {
spcs = `${data.service_apply_info.single_money}金币/${
data.service_apply_info.duration_unit == 1 ? "" : ""
}`;
}
this.$set(this.apply_arr[6], "info", spcs);
this.$set(
this.apply_arr[7],
"info",
......@@ -876,7 +950,7 @@ export default {
this.$set(
this.apply_arr[8],
"info",
data.service_apply_info.apply_time.replace("T", " ").split("+")[0]
data.service_apply_info.apply_time.replace(/T|Z/g, " ").split("+")[0]
);
this.$set(
this.apply_arr[9],
......@@ -938,7 +1012,7 @@ export default {
}
this.res_data = JSON.parse(data.res_fields);
})
.catch(function (response) {});
.catch(function(response) {});
},
},
};
......
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