|
@@ -15,26 +15,22 @@
|
15
|
15
|
highlight-current-row
|
16
|
16
|
stripe
|
17
|
17
|
>
|
18
|
|
- <el-table-column align="center" label="ID" width="95">
|
19
|
|
- <template slot-scope="scope">
|
20
|
|
- {{ scope.$index + 1 }}
|
21
|
|
- </template>
|
22
|
|
- </el-table-column>
|
|
18
|
+ <el-table-column align="center" label="ID" width="100" prop="activityId" />
|
23
|
19
|
<el-table-column label="活动时间">
|
24
|
20
|
<template slot-scope="scope">
|
25
|
21
|
{{ scope.row.startDate | toDayMini }} - {{ scope.row.endDate | toDayMini }}
|
26
|
22
|
</template>
|
27
|
23
|
</el-table-column>
|
28
|
24
|
<el-table-column label="活动名称" prop="name" />
|
29
|
|
- <el-table-column label="活动状态">
|
|
25
|
+ <el-table-column label="活动状态" align="center" width="200">
|
30
|
26
|
<template slot-scope="scope">
|
31
|
27
|
<el-tag
|
32
|
|
- :type="scope.row.status === 1 ? 'primary' : 'info'"
|
|
28
|
+ :type="scope.row.status | statusTagFormat"
|
33
|
29
|
disable-transitions
|
34
|
30
|
>{{ scope.row.status | statusFormat }}</el-tag>
|
35
|
31
|
</template>
|
36
|
32
|
</el-table-column>
|
37
|
|
- <el-table-column label="操作">
|
|
33
|
+ <el-table-column label="操作" align="center" width="200">
|
38
|
34
|
<template slot-scope="scope">
|
39
|
35
|
<el-button size="mini" type="primary" plain @click="handleEdit(scope.row)">编辑</el-button>
|
40
|
36
|
</template>
|
|
@@ -74,6 +70,19 @@ export default {
|
74
|
70
|
'已过期'
|
75
|
71
|
]
|
76
|
72
|
return statusMap[status]
|
|
73
|
+ },
|
|
74
|
+
|
|
75
|
+ statusTagFormat(status) {
|
|
76
|
+ if (status === null || status === undefined) {
|
|
77
|
+ return undefined
|
|
78
|
+ }
|
|
79
|
+
|
|
80
|
+ const statusMap = [
|
|
81
|
+ 'warning',
|
|
82
|
+ 'success',
|
|
83
|
+ 'info'
|
|
84
|
+ ]
|
|
85
|
+ return statusMap[status]
|
77
|
86
|
}
|
78
|
87
|
},
|
79
|
88
|
data() {
|
|
@@ -118,7 +127,7 @@ export default {
|
118
|
127
|
},
|
119
|
128
|
|
120
|
129
|
handleEdit(row) {
|
121
|
|
- this.$router.push({ name: 'warm.detail', params: { id: row.activityId }})
|
|
130
|
+ this.$router.push({ name: 'warm.detail', query: { id: row.activityId }})
|
122
|
131
|
},
|
123
|
132
|
|
124
|
133
|
handleSizeChange(size) {
|