From 072df6816fe467d8b98219cca6fded4070b3f231 Mon Sep 17 00:00:00 2001 From: zhangjun1 Date: Tue, 12 May 2020 18:19:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=95=B0=E6=8D=AE=E8=AF=B7?= =?UTF-8?q?=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/serviceDetail.vue | 164 ++++++++++++-------- src/pages/serviceEdit.vue | 172 +++++++++++++++++++-- src/pages/workPlace.vue | 299 +++++++++++++++++++++++------------- src/utils/common.js | 4 +- static/servicedetail.json | 74 +++++++++ static/serviceedit.json | 18 +++ static/workpalce.json | 111 +++++++++++++ 7 files changed, 647 insertions(+), 195 deletions(-) create mode 100644 static/servicedetail.json create mode 100644 static/serviceedit.json create mode 100644 static/workpalce.json diff --git a/src/pages/serviceDetail.vue b/src/pages/serviceDetail.vue index de3e188..edb86af 100644 --- a/src/pages/serviceDetail.vue +++ b/src/pages/serviceDetail.vue @@ -9,8 +9,8 @@
- - + +

服务运行概况

@@ -19,30 +19,30 @@ @@ -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 096d75d..729ffb0 100644 --- a/src/pages/serviceEdit.vue +++ b/src/pages/serviceEdit.vue @@ -85,7 +85,7 @@ -
+
{{item}}
-
+
+
+

是否开启:

+
+

最大连接数:

+ +
+ +
+

是否开启:

+
+

最大连接数:

+ +
+

有效时间:

+ + + + + +
+
+ +
+

是否开启:

+
+
+
+
+
取消
+
保存
+
@@ -101,6 +136,7 @@