index.vue
1.81 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
<template>
<div>
<template v-for="(list, id) in tableData">
<div class="layout-wrap" :key="id">
<el-row :gutter="30">
<template v-for="(params, index) in layoutParams">
<el-col :span="12" :key="index">
<div class="label-wrap">
<label>{{ params.label }}</label>
<span>{{ list[params.prop] ? list[params.prop] : '--' }}</span>
</div>
</el-col>
</template>
</el-row>
</div>
</template>
</div>
</template>
<script>
export default {
name: 'layout-row',
props: {
//获取的数据
layoutData: {
type: Array,
default: () => []
},
layoutParams: {
type: Array,
default: () => []
},
isHidden: {
type: Boolean,
default: false
}
},
computed: {
tableData() {
return this.isHidden ? this.layoutData : this.layoutData.slice(0, 1)
}
},
created() {}
}
</script>
<style scoped lang="scss">
.layout-wrap {
padding: 20px 0;
box-sizing: border-box;
background: #f5f5f5;
margin-bottom: 10px;
.el-row {
&:last-child {
margin-bottom: -20px;
}
.el-col {
margin-bottom: 16px;
}
.label-wrap {
display: flex;
align-items: center;
margin: 0 10%;
min-width: 80%;
label {
font-size: 14px;
font-weight: 400;
color: #666666;
line-height: 20px;
text-align: right;
min-width: 30%;
display: inline-block;
}
span {
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
text-align: left;
min-width: 260px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: inline-block;
}
}
}
}
</style>