upperClothTwo.vue
4.37 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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
<template>
<div class="app-body">
<Header title="长沙货叉预装台看板#P502" :sysInitTimeNum="sysTimeNum"></Header>
<div class="dv-content-body">
<div class="container">
<!-- 左侧卡片 -->
<div class="card">
<div class="card-header">
<div class="header-item">
<div class="label">站台</div>
<div class="value">P1001</div>
</div>
<div class="header-item">
<div class="label">部件名称</div>
<div class="value">{{ denTalbe.projectName }}</div>
</div>
<div class="header-item">
<div class="label">项目号</div>
<div class="value">{{ denTalbe.projectCode }}</div>
</div>
<div class="header-item">
<div class="label">图号</div>
<div class="value">{{ denTalbe.drawno }}</div>
</div>
</div>
<table>
<thead>
<tr>
<th>#</th>
<th>工序名称</th>
<th>加工名称</th>
<th>状态</th>
</tr>
</thead>
<tbody>
<tr v-for="(item1, index) in denTalbe.detailList" :key="index">
<td>{{ index + 1 }}</td>
<td>{{ item1.craftName }}</td>
<td>{{ item1.programCode }}</td>
<td v-if="item1.status == 0">待加工</td>
<td v-if="item1.status == 1" class="status-undone">加工中</td>
<td v-if="item1.status == 2" class="status-done">加工完成</td>
</tr>
</tbody>
</table>
</div>
<!-- 右侧图片:修复跨域 + 强制显示 -->
<div class="card card-img-box">
<img style="width:80%;height: 95%;" crossorigin="anonymous" :src="denTalbe.img" />
</div>
</div>
</div>
</div>
</template>
<script>
import Header from '@/layout/appHead'
export default {
data() {
return {
baseUrlOff: 'http://172.16.43.82:6002/api/BulletinBoard/Mes/V1/ReadData3',
baseUrlOnLine: window.appConfig.baseUrlintSeven,
sysData: {},
sysInitTimeNum: 20,
sysTimeNum: 20,
denTalbe: {},
}
},
components: {
Header,
},
methods: {
setData() {
let opt = {
urlSuffix: window.baseOnLineOrOff ? this.baseUrlOnLine : this.baseUrlOnLine,
logTitle: '#P502',
isUrlALL: true,
headers: false,
isHanderAjaxSuccessActionLoad: true,
}
let callBackFn = (res) => {
if (!this.ajaxSuccessDataBefore(res, opt.logTitle)) return
this.denTalbe = res.data.result
console.log('图片地址 ===>', this.denTalbe.img)
}
''.ajax(this, opt, callBackFn)
},
ajaxSuccessDataBefore(res, title) {
if (!res || !res.data || res.data.result == null) {
this.sysData = []
''.Log(title + '无数据', 'getData')
return false
}
return true
},
intInterval: function() {
''.intInterval(this, this.sysInitTimeNum, () => {
this.setData()
})
},
},
mounted() {
this.setData()
this.intInterval()
},
}
</script>
<style lang="scss" scoped>
.app-body {
height: 100%;
width: 100%;
}
.dv-content-body {
height: 90%;
width: 100%;
}
.container {
display: flex;
width: 99vw;
height: 49vw;
margin-left: 0.5vw;
gap: 0.5vw;
}
.card {
flex: 1;
background-color: rgba(10, 26, 58, 0.8);
border: 1px solid #00bfff;
border-radius: 0.5vw;
padding: 0.5vw;
box-sizing: border-box;
}
/* 图片容器 */
.card-img-box {
display: flex;
align-items: center;
justify-content: center;
}
.card-img-box img {
display: block;
width: 90%;
height: auto;
object-fit: contain;
}
/* 头部布局 一行两个 写死 */
.card-header {
width: 100%;
height: 15vw;
overflow: hidden;
}
.header-item {
float: left;
width: 48%;
height: 6vw;
margin-bottom: 1vw;
background-color: rgba(0, 60, 120, 0.6);
border: 1px solid #00bfff;
border-radius: 0.3vw;
text-align: center;
padding: 0.5vw;
box-sizing: border-box;
}
.header-item:nth-child(2n) {
float: right;
}
.header-item .label {
font-size: 1.2vw;
color: #b0e0ff;
height: 2.5vw;
line-height: 2.5vw;
}
.header-item .value {
font-size: 1.8vw;
font-weight: bold;
color: #00ccff;
height: 2.5vw;
line-height: 2.5vw;
}
/* 表格样式 完全不动 */
table {
width: 100%;
border-collapse: collapse;
}
th,
td {
border: 1px solid #00bfff;
padding: 0.5vw;
text-align: center;
font-size: 1.2vw;
color: #fff;
}
th {
background-color: #007acc;
color: #fff;
}
tr:nth-child(odd) {
background-color: rgba(0, 40, 80, 0.6);
}
tr:nth-child(even) {
background-color: rgba(0, 60, 100, 0.6);
}
.status-done {
color: #00ff88;
}
.status-undone {
color: #ffff66;
}
</style>