From 2dbb5a24046b5d5f1de5d7bfc5875302d61d7969 Mon Sep 17 00:00:00 2001 From: xuyiming Date: Wed, 11 Nov 2020 13:35:07 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=9A=84=E6=9C=8D=E5=8A=A1-?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5-=E7=94=B3=E8=AF=B7=E7=9A=84?= =?UTF-8?q?=E8=A7=84=E6=A0=BC=E3=80=81=E7=94=B3=E8=AF=B7=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E6=98=BE=E7=A4=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/apass-list.vue | 1 - .../workbench/fwgl/apply_service_detail.vue | 322 +++++++++++------- 2 files changed, 198 insertions(+), 125 deletions(-) diff --git a/src/components/apass-list.vue b/src/components/apass-list.vue index 55439b7..f0817f7 100644 --- a/src/components/apass-list.vue +++ b/src/components/apass-list.vue @@ -84,7 +84,6 @@ :header="listHeader" :data="listData" :padding-left="listPaddingLeft" - :select="listSelect" @select="selectAction" > diff --git a/src/pages/workbench/fwgl/apply_service_detail.vue b/src/pages/workbench/fwgl/apply_service_detail.vue index d370dca..fd951ec 100644 --- a/src/pages/workbench/fwgl/apply_service_detail.vue +++ b/src/pages/workbench/fwgl/apply_service_detail.vue @@ -16,20 +16,33 @@ :style=" now_service == index ? { borderBottom: '4px solid #f5ab4c' } : {} " - >{{ item }} + > + {{ item }} +
- +
- + + :value="item.value" + > -
+
- + - +
- + - + - + - - + + - -
@@ -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) {}); }, }, }; -- 2.26.0