index.vue
3.2 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
<template>
<div v-loading="loading">
<div class="person-info">
<div class="font-box">
<span class="label">
工号:
</span>
<div class="content-box">
<span class="content-text"> {{ info.jobCode }}</span>
</div>
</div>
<div class="font-box">
<span class="label">
工号:
</span>
<div class="content-box">
<span class="content-text"> {{ info.jobCode }}</span>
</div>
</div>
<div class="font-box">
<span class="label">
工号:
</span>
<div class="content-box">
<span class="content-text"> {{ info.jobCode }}</span>
</div>
</div>
<div class="font-box">
<span class="label">
工号:
</span>
<div class="content-box">
<span class="content-text"> {{ info.jobCode }}</span>
</div>
</div>
</div>
<div style="display: flex;align-items: center;margin-bottom: 7px; color: #0CFCFC; font-size: 13px; margin-top: 15px;">
打卡详情</div>
<el-table :data="tableData" style="width: 100%;background-color: aliceblue;">
<el-table-column prop="date" label="打卡时间" width="120" />
<el-table-column prop="address" label="打卡地点" />
<el-table-column prop="result" label="打卡结果" />
</el-table>
</div>
</template>
<script setup>
const loading = ref(false);
const props = defineProps({
// 请求参数
jobCode: {
type: String,
required: true,
},
showFlag: {
type: Boolean,
required: true
}
})
/** 签到信息 */
const info = ref()
info.value = {
name: "",
lpName: "",
jobCode: "",
fleetName: ""
}
const tableData = ref(
[
{
date: "今天 10:33:33",
result: "正常",
address: "背景"
},
{
date: "今天 10:33:33",
result: "正常",
address: "背景"
},
{
date: "今天 10:33:33",
result: "正常",
address: "背景"
}
]
)
/** 处理信息 */
const handleInfo = (val) => {
loading.value = true
setTimeout(() => {
loading.value = false;
info.value = {
name: "张三",
lpName: "路牌",
jobCode: val,
fleetName: "三车队"
}
}, 1000);
}
const reset = () => {
info.value = {
name: "",
lpName: "",
jobCode: "",
fleetName: ""
}
}
watch(
() => props.showFlag,
(count, prevCount) => {
if (props.showFlag) {
handleInfo(props.jobCode);
} else {
reset()
}
}
)
</script>
<style scoped lang="scss">
.person-info {
width: 300px;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.font-box {
width: 50%;
box-sizing: border-box;
margin-top: 4px;
font-size: 13px;
display: flex;
align-items: center;
.label {
color: #0CFCFC;
font-family: "黑体", "圆体";
font-weight: 500;
width: 39px;
}
.content-box {
color: white;
width: 80px;
box-sizing: border-box;
padding: 2px;
text-align: center;
background-color: #03113F;
.content-text {
display: flex;
justify-content: center;
align-items: center;
}
}
}
}
</style>