服务运行概况
@@ -19,30 +19,30 @@
-
运行中
+
{{yx_state.state}}
-
1200ms
-
最大响应时间:180000ms
+
{{yx_state.averageTime}}
+
最大响应时间:{{yx_state.maxTime}}
-
39dps
-
最大吞吐率:120dps
+
{{yx_state.averageTraffic}}
+
最大吞吐率:{{yx_state.maxTraffic}}
-
300MB
+
{{yx_state.memory}}
@@ -97,6 +97,7 @@ import exampleIcon from "@/pages/example_icon"
import Topology from "@/components/topology.vue";
import serviceHeader from '../components/service-header'
import dialogAction from "@/components/dialog-action";
+import { getRole } from "../utils/common";
export default {
components:{
infoList,
@@ -110,39 +111,27 @@ export default {
},
data() {
return {
- now_user: 2, //0:普通用户,1:组织管理员,2:超级管理员
+ now_user: 0, //0:普通用户,1:组织管理员,2:超级管理员
buy_style:0,
+ responseParamUrl:'',
+ codeExampleUrl:'',
+ yx_state:{
+ "state":"",
+ "averageTime":"",
+ "maxTime":"",
+ "averageTraffic":"",
+ "maxTraffic":"",
+ "memory":""
+ },
service_arr:[
['服务基本信息','接口详细信息','服务运行状态'],
['服务基本信息','接口详细信息','服务运行状态','服务计费规则'],
['服务基本信息','接口详细信息','服务运行状态','服务规格'],
],
service_header_arr:{
- name:'地市GDP基础数据',
- first:[
- {
- name:'服务类型',
- text:'数据服务',
- },
- {
- name:'申请次数',
- text:39,
- },
- {
- name:'调用次数',
- text:319,
- },
- {
- name:'服务状态',
- text:'上架中',
- },
- ],
- second:[
- {
- name:'服务接口地址',
- text:'http://localhost:8084/cszh/rest/yxtz/zdrylx?code=430100000000',
- },
- ],
+ name:'',
+ first:[],
+ second:[],
fixed:true,
},
now_service:0,
@@ -392,19 +381,19 @@ export default {
servicead_arr:[
{
title:'请求方式:',
- info:'get'
+ info:''
},
{
title:'请求参数:',
- info:'无请求参数'
+ info:''
},
{
title:'请求示例:',
- info:'无请求示例'
+ info:''
},
{
title:'编码格式:',
- info:'UTF-8'
+ info:''
},
{
title:'响应参数:',
@@ -420,32 +409,7 @@ export default {
},
],
- list_arr:[
- {
- title:'服务描述:',
- info:'提供贵州省2019年各市州的GDP数据。'
- },
- {
- title:'服务领域:',
- info:'经济建设'
- },
- {
- title:'所属组织:',
- info:'北京比格大数据有限公司'
- },
- {
- title:'开放程度:',
- info:'共享'
- },
- {
- title:'接口编码:',
- info:'chart'
- },
- {
- title:'注册发布时间:',
- info:'2019-02-17 21:09:23'
- },
- ],
+ list_arr:[],
}
},
watch:{
@@ -455,21 +419,85 @@ export default {
}
}
},
+ created(){
+ this.now_user = this.$store.state.role
+ getRole().then(data => {
+ this.now_user = data;
+ this.$store.commit('rolefun',data)
+ this.getServiceInfo()
+ this.getInterfaceInfo()
+ this.getServiceBaseInfo()
+ this.getServiceyxztInfo()
+
+ });
+ },
mounted(){
- console.log(this.$store.state.role);
+
},
methods:{
- getData() {
- let url = "./static/antv.json";
+ getData() {
+ let url = "/static/antv.json";
this.$http
.get(url)
.then(response => {
this.datas = response.data.elements;
})
.catch(function(response) {
- this.error = true;
+
});
},
+ getServiceInfo(){
+ this.$http
+ .get('/static/servicedetail.json')
+ .then(response => {
+ let data = response.data.data
+ this.$set(this.service_header_arr,'name',data.serviceInfo.name)
+ this.$set(this.service_header_arr,'first',data.serviceInfo.first)
+ this.$set(this.service_header_arr,'second',data.serviceInfo.second)
+ })
+ .catch(function(response) {
+
+ });
+ },
+ getInterfaceInfo(){
+ this.$http
+ .get('/static/servicedetail.json')
+ .then(response => {
+ let data = response.data.data
+ this.$set(this.servicead_arr[0],'info',data.serviceinterfaceinfo.type)
+ this.$set(this.servicead_arr[1],'info',data.serviceinterfaceinfo.requestParam)
+ this.$set(this.servicead_arr[2],'info',data.serviceinterfaceinfo.example)
+ this.$set(this.servicead_arr[3],'info',data.serviceinterfaceinfo.format)
+ this.responseParamUrl = data.serviceinterfaceinfo.responseParamUrl
+ this.codeExampleUrl = data.serviceinterfaceinfo.codeExampleUrl
+ })
+ .catch(function(response) {
+
+ });
+ },
+ getServiceBaseInfo(){
+ this.$http
+ .get('/static/servicedetail.json')
+ .then(response => {
+ let data = response.data.data
+ this.list_arr = data.servicebaseinfo
+ })
+ .catch(function(response) {
+
+ });
+ },
+ getServiceyxztInfo(){
+ this.$http
+ .get('/static/servicedetail.json')
+ .then(response => {
+ let data = response.data.data
+ this.yx_state = data.serviceyxzt
+ })
+ .catch(function(response) {
+
+ });
+ },
+
}
};
diff --git a/src/pages/serviceEdit.vue b/src/pages/serviceEdit.vue
index 096d75d962ef63ef7c381551c002978863bb2ee2..729ffb00811f7458e640fb074cba3e1a79b8623e 100644
--- a/src/pages/serviceEdit.vue
+++ b/src/pages/serviceEdit.vue
@@ -85,7 +85,7 @@
-