From 0a8ef5bb4f7a7725f3d1d8151f902e44cd02be7b Mon Sep 17 00:00:00 2001 From: zhangjun1 Date: Fri, 19 Jun 2020 11:55:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=93=E6=89=91=E5=9B=BE=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fwgl/approval_service_detail.vue | 72 ++++++++++--------- src/pages/workbench/fwgl/serviceDetail.vue | 18 +++-- src/pages/workbench/fwgl/serviceEdit.vue | 16 +++++ 3 files changed, 67 insertions(+), 39 deletions(-) diff --git a/src/pages/workbench/fwgl/approval_service_detail.vue b/src/pages/workbench/fwgl/approval_service_detail.vue index c84a940..9e64c05 100644 --- a/src/pages/workbench/fwgl/approval_service_detail.vue +++ b/src/pages/workbench/fwgl/approval_service_detail.vue @@ -19,8 +19,8 @@
- -
+ +

审批结果:

@@ -274,10 +274,11 @@ export default { console.log(this.level); if(this.userInfo){ this.now_user = this.level + this.get_service_info() }else{ this.getCurrentUser() } - this.get_service_info() + }, mounted() {}, methods: { @@ -289,6 +290,7 @@ export default { console.log("--- user info ---"); this.$store.commit("userInfofun", data.data); this.now_user = this.level + this.get_service_info() console.log(this.level); } else { console.log(data.errMsg); @@ -351,43 +353,45 @@ export default { this.$set(this.list_arr[6], "info", data.service_apply_info.apply_file.split('/')[data.service_apply_info.apply_file.split('/').length - 1]); this.$set(this.list_arr[6], "url", data.service_apply_info.apply_file); this.$set(this.list_arr[8], "info", data.service_apply_info.duration+data.service_apply_info.duration_unit); - this.$set(this.list_arr[9], "info", data.request_spcs_info); + this.$set(this.list_arr[9], "info", "访问次数:"+data.service_apply_info.request_spcs.pv+"/日 访问量:"+data.service_apply_info.request_spcs.count+"/日"); this.id = data.service_apply_info.id if(data.service_apply_info.approval_status!==0){ this.servicead_arr[this.now_user].splice(1,1) } - if(!((now_user==1&&service_header_arr['first'][2]!=='待审批')||now_user==2)){ + if(!((this.now_user==1&&this.service_header_arr['first'][2].text!=='待审批')||this.now_user==2)){ this.servicead_arr[this.now_user].splice(0,1) } - data.service_apply_info.approval_process.forEach(e => { - this.approval_arr[this.now_user].push( - { - title:e.level==1?'一级审批':'二级审批', - result:e.status==-1?'审批未通过':e.status==0?'审批中':'审批通过', - } - ) - if(e.status!==0){ - this.approval_arr[this.now_user][this.approval_arr[this.now_user].length - 1]['arr']=[ - { - title:'审批时间:', - info:e.approval_time.split('+')[0].replace("T",' ') - }, - { - title:'审批单位:', - info:e.user_info.department_name - }, - { - title:'审批人:', - info:e.user_info.user_name - }, - { - title:'审批意见:', - info:e.comments - }, - ] - - } - }); + if(data.service_apply_info.approval_process){ + data.service_apply_info.approval_process.forEach(e => { + this.approval_arr[this.now_user].push( + { + title:e.level==1?'一级审批':'二级审批', + result:e.status==-1?'审批未通过':e.status==0?'审批中':'审批通过', + } + ) + if(e.status!==0){ + this.approval_arr[this.now_user][this.approval_arr[this.now_user].length - 1]['arr']=[ + { + title:'审批时间:', + info:e.approval_time.split('+')[0].replace("T",' ') + }, + { + title:'审批单位:', + info:e.user_info.department_name + }, + { + title:'审批人:', + info:e.user_info.user_name + }, + { + title:'审批意见:', + info:e.comments + }, + ] + + } + }); + } console.log(this.approval_arr); this.zd_table_arr = data.service_apply_info.res_fields?JSON.parse(data.service_apply_info.res_fields):[] }) diff --git a/src/pages/workbench/fwgl/serviceDetail.vue b/src/pages/workbench/fwgl/serviceDetail.vue index 6a9448b..33a1195 100644 --- a/src/pages/workbench/fwgl/serviceDetail.vue +++ b/src/pages/workbench/fwgl/serviceDetail.vue @@ -691,13 +691,21 @@ export default { getServiceyxztInfo() { this.$http - .get("/static/servicedetail1.json") + .get(`/apaas/istio/service/apaas-proxy/overview/apaas-proxy-${this.$route.params.id}`) .then((response) => { - console.log(response); - let data = response.data.data; - this.yx_state = data.serviceyxzt; + if(response.data.success){ + let data = response.data.data + this.yx_state={ + state: data.appState=='running'?'运行中':'等待中', + averageTime: data.respTime.avg+'ms', + maxTime: data.respTime.max+'ms', + averageTraffic: data.throughput.avg+'dps', + maxTraffic: data.throughput.max+'dps', + memory: data.resource.memory+'MB', + } + } }) - .catch(function(response) {}); + }, }, }; diff --git a/src/pages/workbench/fwgl/serviceEdit.vue b/src/pages/workbench/fwgl/serviceEdit.vue index df0b9ff..4d174d7 100644 --- a/src/pages/workbench/fwgl/serviceEdit.vue +++ b/src/pages/workbench/fwgl/serviceEdit.vue @@ -310,6 +310,22 @@ export default { .catch(function(response) {}); }, setService(){ + if(this.open){ + if(this.maxline){ + + }else{ + this.$message.error('请输入最大连接数') + return + } + } + if(this.open1){ + if(this.maxline1&&this.usetime1&&this.timevalue){ + + }else{ + this.$message.error('请输入所需参数') + return + } + } var temp = { id:parseInt(this.$route.params.id), "name": this.form.name, -- 2.26.0