From 8fd75ca3e2519c869cb0b7f27f1f4b9c6628d859 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 15 Dec 2020 14:06:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 4 +- src/components/Duration/Duration.js | 182 ++++++++------ src/components/Duration/Duration.vue | 8 +- src/components/FastEd/FastEd.vue | 2 +- src/components/RFID/RFID.vue | 3 +- src/components/Statistics/Statistics.js | 290 +++++++++++++---------- src/components/Statistics/Statistics.vue | 9 +- src/config/api.js | 21 +- 8 files changed, 291 insertions(+), 228 deletions(-) diff --git a/.env.development b/.env.development index 8bb3b82..3f976ee 100644 --- a/.env.development +++ b/.env.development @@ -1,8 +1,8 @@ VUE_APP_MODE=development VUE_APP_NODE_ENV=development VUE_APP_SCENE=greenvalley -VUE_APP_BASE_URL=http://www.sxwikionline.com/ -VUE_APP_API_URL=http://www.sxwikionline.com/gateway +VUE_APP_BASE_URL=http://test.tall.wiki/ +VUE_APP_API_URL=http://test.tall.wiki/gateway VUE_APP_PROXY_URL=/gateway VUE_APP_PUBLIC_PATH=/greenvalley VUE_APP_MSG_URL=wss://test.tall.wiki/websocket/message/v4.0/ws diff --git a/src/components/Duration/Duration.js b/src/components/Duration/Duration.js index 9049792..aedb10d 100644 --- a/src/components/Duration/Duration.js +++ b/src/components/Duration/Duration.js @@ -1,85 +1,111 @@ -var option = { - // title: { - // left: '10%', - // textStyle: { - // fontWeight: 'normal', - // color: '#fff', //标题颜色 - // }, - // text: '急救时长分析', - // }, - tooltip: { trigger: 'axis' }, - legend: { - x: 'center', - y: 'bottom', - data: ['我院记录', '国际水准', '当前数据'], - textStyle: { - fontWeight: 'normal', - color: '#ccc', //标题颜色 - }, - }, - grid: { - left: '3%', - // right: '4%', - bottom: '10%', - containLabel: true, +import { getPointTime } from 'config/api'; + +const mixin = { + data() { + return { + pointTimeCurrentList: [], + pointTimeHospital: [], + pointTimeInternation: [], + }; }, - xAxis: { - type: 'category', - boundaryGap: false, - data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'], - axisLabel: { - textStyle: { - fontWeight: 'normal', - color: '#ccc', //标题颜色 - }, + + computed: { + option() { + return { + tooltip: { trigger: 'axis' }, + legend: { + x: 'center', + y: 'bottom', + data: ['我院记录', '国际水准', '当前数据'], + textStyle: { + fontWeight: 'normal', + color: '#ccc', //标题颜色 + }, + }, + grid: { + left: '3%', + // right: '4%', + bottom: '10%', + containLabel: true, + }, + xAxis: { + type: 'category', + boundaryGap: false, + data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'], + axisLabel: { + textStyle: { + fontWeight: 'normal', + color: '#ccc', //标题颜色 + }, + }, + }, + yAxis: { + type: 'value', + name: '秒', + axisLabel: { + textStyle: { + fontWeight: 'normal', + color: '#ccc', //标题颜色 + }, + }, + nameTextStyle: { color: '#ccc' }, + splitLine: { + show: true, + lineStyle: { + type: 'dashed', + color: '#ccc', + }, + }, + }, + series: [ + { + name: '我院记录', + type: 'line', + stack: '总量', + symbolSize: 6, + // symbol: 'star', + data: this.pointTimeHospital, + color: 'rgb(18, 131, 227)', + }, + { + name: '国际水准', + type: 'line', + stack: '总量', + symbolSize: 6, + data: this.pointTimeInternation, + color: 'rgb(30, 231, 231)', + }, + { + name: '当前数据', + type: 'line', + stack: '总量', + symbolSize: 6, + data: this.pointTimeCurrentList, + color: 'rgb(227, 18, 187)', + }, + ], + }; }, }, - yAxis: { - type: 'value', - name: '秒', - interval: 200, - axisLabel: { - textStyle: { - fontWeight: 'normal', - color: '#ccc', //标题颜色 - }, - }, - nameTextStyle: { color: '#ccc' }, - splitLine: { - show: true, - lineStyle: { - type: 'dashed', - color: '#ccc', - }, + + methods: { + async getData() { + try { + const params = { param: { id: 0 } }; + const res = await getPointTime(params); + const { code, msg, data } = res.data; + if (code === 200) { + this.pointTimeCurrentList = data.pointTimeCurrentList; + this.pointTimeHospital = data.pointTimeHospital; + this.pointTimeInternation = data.pointTimeInternation; + } else { + console.log(msg); + } + } catch (error) { + console.log(error); + } }, }, - series: [ - { - name: '我院记录', - type: 'line', - stack: '总量', - symbolSize: 6, - // symbol: 'star', - data: [120, 132, 101, 134, 90, 230, 210], - color: 'rgb(18, 131, 227)', - }, - { - name: '国际水准', - type: 'line', - stack: '总量', - symbolSize: 6, - data: [220, 182, 191, 234, 290, 330, 310], - color: 'rgb(30, 231, 231)', - }, - { - name: '当前数据', - type: 'line', - stack: '总量', - symbolSize: 6, - data: [150, 232, 201, 154, 190, 330, 410], - color: 'rgb(227, 18, 187)', - }, - ], }; -export default option; +export default mixin; diff --git a/src/components/Duration/Duration.vue b/src/components/Duration/Duration.vue index 1b39d61..65ac701 100644 --- a/src/components/Duration/Duration.vue +++ b/src/components/Duration/Duration.vue @@ -5,9 +5,10 @@