config-rule-row.vue
1.9 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
<template>
<div class="config-rule-row">
<div class="config-rule-row__info">
<div class="config-rule-row__title">{{ title }}</div>
<div v-if="description" class="config-rule-row__desc">{{ description }}</div>
</div>
<div class="config-rule-row__controls">
<el-form-item label="天数" label-width="48px" class="config-rule-row__item">
<el-input-number
v-model="daysValue"
:min="0"
:max="3650"
:precision="0"
:step="1"
controls-position="right"
placeholder="0=不限制"
/>
<span class="config-rule-row__suffix">天(0=不限制)</span>
</el-form-item>
</div>
</div>
</template>
<script>
export default {
name: 'ConfigRuleRow',
props: {
title: {
type: String,
required: true
},
description: {
type: String,
default: ''
},
days: {
type: Number,
default: 0
}
},
computed: {
daysValue: {
get() {
return this.days
},
set(val) {
this.$emit('update:days', val)
}
}
}
}
</script>
<style lang="scss" scoped>
.config-rule-row {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 24px;
padding: 14px 0;
border-bottom: 1px solid #ebeef5;
&:last-child {
border-bottom: none;
padding-bottom: 0;
}
&__info {
flex: 1;
min-width: 0;
}
&__title {
font-size: 14px;
font-weight: 500;
color: #303133;
line-height: 22px;
}
&__desc {
margin-top: 4px;
font-size: 13px;
color: #909399;
line-height: 1.6;
}
&__controls {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: flex-end;
flex-shrink: 0;
}
&__item {
margin-bottom: 0;
}
&__suffix {
margin-left: 6px;
color: #909399;
font-size: 13px;
white-space: nowrap;
}
}
</style>