managePlatform.vue
3.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<template>
<div class="app-body">
<Header title="博康中控管理平台" :sysInitTimeNum="sysTimeNum"></Header>
<div class="dv-content-body">
<!-- 顶部头表 -->
<div class="dv-content-body-head-list">
<headLeft ref="headLeft"></headLeft>
<headCenter ref="headCenter"></headCenter>
<headRight ref="headRight"></headRight>
</div>
<!-- 中间图表 -->
<div class="dv-content-body-center-list">
<bodyCenterLeft ref="bodyCenterLeft"></bodyCenterLeft>
<bodyCenter ref="bodyCenter"></bodyCenter>
<bodyCenterRight ref="bodyCenterRight"></bodyCenterRight>
</div>
<!-- 底部图表 -->
<div class="dv-content-body-bottom-list">
<footerLeft ref="footerLeft"></footerLeft>
<!-- <footerCenter ref="footerCenter"></footerCenter> -->
<footerRight ref="footerRight"></footerRight>
</div>
</div>
</div>
</template>
<script>
import Header from '@/layout/appHead'
import headLeft from '@/components/headLeft'
import headCenter from '@/components/headCenter'
import headRight from '@/components/headRight'
import bodyCenterLeft from '@/components/bodyCenterLeft'
import bodyCenter from '@/components/bodyCenter'
import bodyCenterRight from '@/components/bodyCenterRight'
import footerLeft from '@/components/footerLeft'
import footerCenter from '@/components/footerCenter'
import footerRight from '@/components/footerRight'
export default {
data() {
return {
// baseUrlOff: 'https://mock.apifox.cn/m1/3152972-0-default/api/Board/GetEquipmentInfo',
baseUrlOff: 'http://127.0.0.1:6001/api/BulletinBoard/Mes/V1/ReadData2',
baseUrlOnLine: window.appConfig.baseUrlOnLine,
sysData: {},
sysInitTimeNum: 20,
sysTimeNum: 20,
}
},
components: {
Header,
headLeft,
headCenter,
headRight,
bodyCenterLeft,
bodyCenterRight,
bodyCenter,
footerLeft,
footerCenter,
footerRight,
},
methods: {
getECSData() {
let opt = {
urlSuffix: window.baseOnLineOrOff ? this.baseUrlOnLine : this.baseUrlOff,
logTitle: 'ECS',
isUrlALL: true,
headers: false,
// isHanderAjaxSuccessActionLoad: true,
}
let callBackFn = (res) => {
if (!this.ajaxSuccessDataBefore(res, opt.logTitle)) return
this.$refs.headLeft.getData(this.sysData.todayTaskNum)
this.$refs.headCenter.getData(this.sysData.weekTaskNum)
this.$refs.headRight.getData(this.sysData.monthTaskNum)
let dataTable = {
header: ['设备', '可存盘', '实际入盘', '使用率'],
align: ['left'],
}
this.$refs.bodyCenterLeft.getData(this.sysData.locationInfos, dataTable)
this.$refs.bodyCenter.bingDataSource(this.sysData.equipmentInfos)
// 仓库运行(前24小时)
this.$refs.bodyCenterRight.bingDataSource(this.sysData.srmStatusBarChart)
// 堆机任务
this.$refs.footerLeft.bingDataSource(this.sysData.srmTaskBarChart, 'B')
// 报警信息(前24小时)
this.$refs.footerRight.bingDataSource(this.sysData.equipmentAlarms)
}
''.ajax(this, opt, callBackFn)
},
ajaxSuccessDataBefore(res, title) {
if (res.data == null) {
''.Log(title + '无数据', 'getData')
return false
}
return true
},
intInterval: function() {
''.intInterval(this, this.sysInitTimeNum, () => {
this.getECSData()
})
},
},
mounted() {
//eslint-disable-next-line no-debugger
debugger
this.getECSData()
// 【发布的时候要取消注释】
this.intInterval()
},
}
</script>
<style lang="scss" scoped>
.app-body {
height: 100%;
width: 100%;
.dv-content-body {
height: 90%;
width: 100%;
// background: rebeccapurple;
}
.dv-content-body-head-list {
display: flex;
justify-content: space-between;
align-items: center;
height: 25%;
}
.dv-content-body-center-list {
display: flex;
justify-content: space-between;
align-items: center;
height: 35%;
}
.dv-content-body-bottom-list {
display: flex;
height: 40%;
justify-content: space-between;
align-items: center;
}
}
</style>