headRight2.vue
3.76 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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<template>
<div>
<!-- <div class="title-text">立库统计</div> -->
<div style="width: 100%; height: 100%; position: relative; left: 0vw; top: 0vw;border: 2px solid #3879c9;">
<div class="title-text">立库统计</div>
<div class="location">
<div class="box left-box">
<div class="item">
<div class="name">总库存库位</div>
<div class="value">{{ form.v_total_locations }}</div>
</div>
<div class="item">
<div class="name">使用率</div>
<div class="value">{{ form.v_usage_rate }}%</div>
</div>
<div class="item">
<div class="name">当日入库</div>
<div class="value">{{ form.v_today_in }}</div>
</div>
<div class="item">
<div class="name">当月入库</div>
<div class="value">{{ form.v_month_in }}</div>
</div>
</div>
<div class="box">
<div class="item">
<div class="name">已用</div>
<div class="value">{{ form.v_used_locations }}</div>
</div>
<div class="item">
<div class="name">未用</div>
<div class="value">{{ form.v_free_locations }}</div>
</div>
<div class="item">
<div class="name">当日出库</div>
<div class="value">{{ form.v_today_out }}</div>
</div>
<div class="item">
<div class="name">当月出库</div>
<div class="value">{{ form.v_month_out }}</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
baseUrlOff: 'http://172.16.30.219:5221/api/Index/GetFWSWebStatsInfo',
baseUrlOnLine: window.appConfig.baseUrlintThree,
form: {},
sysInitTimeNum: 5,
sysData: {
v_total_locations: 0,
v_usage_rate: 0,
v_today_in: 0,
v_month_in: 0,
v_used_locations: 0,
v_free_locations: 0,
v_today_out: 0,
v_month_out: 0,
},
}
},
methods: {
getDataInfo() {
let opt = {
urlSuffix: window.baseOnLineOrOff ? this.baseUrlOnLine : this.baseUrlOff,
logTitle: 'AGV-立库统计',
isUrlALL: true,
headers: window.baseOnLineOrOff,
header: window.baseOnLineOrOff,
// isHanderAjaxSuccessActionLoad: true,
// type: 'post',
}
let callBackFn = (res) => {
if (!this.ajaxSuccessDataBefore(res, opt.logTitle)) return
this.form = res.data.data
}
''.ajax(this, opt, callBackFn)
},
ajaxSuccessDataBefore(res, title) {
if (res.data.data == null || res.data.data.length == 0) {
this.form = {}
''.Log(title + '无数据', 'getData')
return false
}
return true
},
intInterval: function () {
// ''.intInterval(this, this.sysInitTimeNum, () => {
// this.getDataInfo()
// })
setInterval(() => {
this.getDataInfo()
}, 30000)
},
},
mounted() {
debugger
this.getDataInfo()
this.intInterval()
},
}
</script>
<style lang="scss" scoped>
.title-text {
width: 100%;
height: 1vh;
font-size: 1.5vh;
font-weight: 600;
color: #fff;
text-align: left;
}
.location {
height: 100%;
display: flex;
// border: 2px solid #3879c9;
justify-content: space-between;
align-items: center;
margin: 0px 0 10px 7px;
}
.box {
flex: 1;
/* 左右各占50%宽度 */
height: 100%;
display: flex;
flex-direction: column;
/* 内部item上下排列 */
justify-content: space-around;
/* item均匀分布 */
align-items: center;
/* item水平居中 */
}
/* 每个小项样式:宽85%、高18%、边框、内部左右排列 */
.item {
width: 80%;
height: 17%;
border-radius: 5px;
border: 1px solid #67c8fb;
display: flex;
justify-content: space-between;
/* 名称左、数值右 */
align-items: center;
/* 内容垂直居中 */
padding: 0 5px;
/* 内容不贴边框 */
background-color: #062448;
}
/* 名称/数值样式区分 */
.name {
color: #fff;
font-size: 14px;
}
.value {
color: #67c8fb;
font-size: 18px;
font-weight: bold;
}
</style>