From 83f1a68164f81a5bde29b60801150c8e8e67eb1f Mon Sep 17 00:00:00 2001
From: jiaming <743192023@qq.com>
Date: Wed, 12 Dec 2018 18:48:32 +0800
Subject: [PATCH] fixed bug
---
src/views/electronicFile/index.vue | 387 +++++++++++++++++------------
src/views/manageDesk/index.vue | 216 ++++++++++------
2 files changed, 360 insertions(+), 243 deletions(-)
diff --git a/src/views/electronicFile/index.vue b/src/views/electronicFile/index.vue
index 4ac9c01..fb1f930 100644
--- a/src/views/electronicFile/index.vue
+++ b/src/views/electronicFile/index.vue
@@ -2,7 +2,7 @@
-
+
@@ -116,15 +116,20 @@ export default {
data () {
return {
technicalSupport: '技术支持:河南东方世纪交通科技股份有限公司',
- topMiddleTitle: '漯周界-机电运维管理台',
+ topMiddleTitle: '机电运维管理台',
- // 上部左边第一个卡片数据
- topLeftCard1Data: ['22.0', '66', '0'],
- // 上部左边第二个卡片数据
- topLeftCard2Data: ['0.1', '66', '0'],
+ // 上部左边卡片数据
+ chart1Data: {
+ monthSum: 0,
+ lastMonthSum: 81,
+ lastYearMonthSum: 0,
+ personDayAvg: 0.1,
+ personLastMonthDayAvg: 0.3,
+ personLastYearMonthDayAvg: 0
+ },
// 上部右边第一个图表数据
- topRightChart1Data: {
+ chart2Data: {
data: [
{
data: [
@@ -154,11 +159,12 @@ export default {
fixed: 2,
num: 10,
unit: '%'
- }
+ },
+ labelLine: ['设备完好率']
},
// 上部右边第二个图表数据
- topRightChart2Data: {
+ chart3Data: {
data: [
{
data: [
@@ -221,64 +227,70 @@ export default {
},
// 底部左边第一个图表数据
- bottomLeftChart1Data: {
- data: [
- {
- value: 19,
- title: '监控系统'
- },
- {
- value: 16,
- title: '收费系统'
- },
- {
- value: 24,
- title: '通信系统'
- },
- {
- value: 14,
- title: '供配电系统'
- },
- {
- value: 27,
- title: '其他'
- }
- ],
- color: ['#00c0ff', '#3de7c9', '#fff']
+ chart4Data: {
+ data: {
+ data: [
+ {
+ value: 19,
+ title: '监控系统'
+ },
+ {
+ value: 16,
+ title: '收费系统'
+ },
+ {
+ value: 24,
+ title: '通信系统'
+ },
+ {
+ value: 14,
+ title: '供配电系统'
+ },
+ {
+ value: 27,
+ title: '其他'
+ }
+ ],
+ color: ['#00c0ff', '#3de7c9', '#fff']
+ },
+ deviceNormalPercent: 99.01
},
// 底部左边第二个图表数据
- bottomLeftChart2Data: {
- data: [
- {
- value: 0.38,
- title: '8小时以内'
- },
- {
- value: 0.57,
- title: '24小时以内'
- },
- {
- value: 0.7,
- title: '48小时以内'
- },
- {
- value: 0.78,
- title: '72小时以内'
- },
- {
- value: 0.22,
- title: '大于72小时'
- }
- ],
- color: ['#00c0ff', '#3de7c9'],
- arcArea: [0.3, 0.7],
- arcGap: 5,
- fontSize: 12
+ chart5Data: {
+ data: {
+ data: [
+ {
+ value: 0.38,
+ title: '8小时以内'
+ },
+ {
+ value: 0.57,
+ title: '24小时以内'
+ },
+ {
+ value: 0.7,
+ title: '48小时以内'
+ },
+ {
+ value: 0.78,
+ title: '72小时以内'
+ },
+ {
+ value: 0.22,
+ title: '大于72小时'
+ }
+ ],
+ color: ['#00c0ff', '#3de7c9'],
+ arcArea: [0.3, 0.7],
+ arcGap: 5,
+ fontSize: 12
+ },
+ avgTime: 55.1
},
// 底部右边第一个滚动榜单数据
- bottomRightScrollBorad1Data: {
+ chart6Data: {
data: [
{
title: '赵亚伟',
@@ -317,7 +329,7 @@ export default {
},
// 底部右边第二个滚动榜单数据
- bottomRightScrollBorad2Data: {
+ chart7Data: {
data: [
{
title: '液晶显示器',
@@ -379,7 +391,7 @@ export default {
},
// 底部右边第四个滚动榜单数据
- bottomRightScrollBorad4Data: {
+ chart9Data: {
data: [
{
title: '收费广场',
@@ -403,10 +415,58 @@ export default {
}
],
showItemNum: 4
- }
+ },
+
+ path: '/rest/datav/manage/interface/list',
+ paths: []
+ }
+ },
+ methods: {
+ async init () {
+ const { getAllPaths, getChartsData } = this
+
+ await getAllPaths()
+
+ await getChartsData()
+ },
+ getAllPaths () {
+ const { path, $http: { get } } = this
+
+ return get(path).then(({ code, data }) => {
+ if (code === 'success') {
+ this.paths = data.interfaces
+
+ this.topMiddleTitle = data.title
+ } else {
+ console.error('数据返回异常!')
+ }
+ }).catch(e => {
+ console.error('DataV接口数据异常!')
+ })
+ },
+ getChartsData () {
+ const { paths, getChartData, getChartsData } = this
+
+ return Promise.all(paths.map(path => getChartData(path))).then(e => setTimeout(getChartsData, 30000))
+ },
+ async getChartData ({ number, url }) {
+ const { $http: { get } } = this
+
+ if (!url) return
+
+ return get(url).then(({ code, data }) => {
+ if (code === 'success') {
+ this[`chart${number}Data`] = data
+ } else {
+ console.error(`${number}接口异常`)
+ }
+ }).catch(e => console.error(`${number}接口异常`))
}
},
created () {
+ const { init } = this
+
+ init()
}
}