TipsBox.vue
2.09 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
<template>
<div :class="['tips-box',{finish: step == 3}, {hide:hideTips}]">
<div class="text flex">
<img
:src="info.icon"
class="icon"
>
{{info.text}}
</div>
<template v-if="info.description">
<div class="description">{{info.description}}</div>
</template>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'TipsBox',
props: {
step: [Number, String],
tableData: {
type: Array,
default: () => []
}
},
data () {
return {
step_1: {
icon: require('./images/info-1.png'),
text: '请选择离职员工与接手员工,系统将自动扫描名下资产。'
},
step_2: {
icon: require('./images/info-2.png'),
text: '注意:涉及实物交接',
description: '检测到部分车辆已签署代保管协议。请点击表格右侧的 [上传凭证] 按钮,针对每一辆高风险车辆上传对应的交接单或合影。'
},
step_3: {
icon: require('./images/info-3.png'),
text: '交接成功',
description: '本地权限已变更。'
},
}
},
computed: {
info () {
return this[`step_${this.step}`]
},
hideTips () {
const { tableData, step } = this
let flag = false
if (step == 2) {
let len = tableData.findIndex(item => item.signCustodyStatus)
console.log(len)
if (len == -1) flag = true
}
return flag
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang='scss'>
.flex {
display: flex;
align-items: center;
}
.tips-box {
border-radius: 4px;
background: #fafafa;
padding: 16px 20px;
color: #333333;
.text {
font-size: 16px;
font-weight: 700;
.icon {
width: 24px;
height: 24px;
margin-right: 8px;
}
}
.description {
font-size: 14px;
margin-top: 20px;
line-height: 20px;
}
}
.hide{
display: none;
}
.finish {
.text {
justify-content: center;
}
.description {
margin-top: 8px;
color: #999999;
text-align: center;
}
}
</style>