ImportLogDialog.vue
2.54 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
<template>
<el-dialog
title="导入日志"
:visible.sync="visible"
:before-close="handleClose"
>
<ht-table
ref="htTable"
:data="tableData"
:pageResult="pageResult"
quick-search-props="name,account"
:show-export="false"
:default-sorter="[{direction: 'DESC', property: 'create_time_'}]"
:showCustomColumn="false"
:header-cell-class-name="headerCellClassName"
@load="loadData"
>
<template>
<ht-table-column type="index" width="50" align="center" label="序号" />
<ht-table-column
prop="name"
label="导入人"
:sortable="true"
:show-overflow-tooltip="true"
/>
<ht-table-column prop="account" label="导入账号" />
<ht-table-column
prop="importTime"
label="导入时间"
:sortable="true"
/>
<ht-table-column
prop="status"
label="导入状态"
:render-header="renderHeaderMethod"
:filters="filters"
>
<template v-slot="{row}">
<span :class="[row.status == 'success'?'green-color':'red-color']">{{
statusMap[row.status]
}}</span>
</template>
</ht-table-column>
</template>
</ht-table>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose" type="primary">关闭</el-button>
</span>
</el-dialog>
</template>
<script>
import tableHeaderFilter from '@/mixins/tableHeaderFilter.js'
export default {
name: 'ImportLogDialog',
mixins: [tableHeaderFilter],
props: {
visible: {
type: Boolean,
default: false
}
},
data() {
return {
tableData: [
{
name: '管理员',
account: 'admin',
importTime: '2022-04-15 11:00:00',
status: 'success'
},
{
name: '管理员',
account: 'admin',
importTime: '2022-04-15 11:00:00',
status: 'fail'
}
],
pageResult: {
page: 1,
pageSize: 20,
total: 0
},
statusMap: {
success: '导入成功',
fail: '导入失败'
}
}
},
computed: {
filters() {
return Object.keys(this.statusMap).map(item => {
return {
text: this.statusMap[item],
value: item
}
})
}
},
methods: {
handleClose() {
this.$emit('update:visible', false)
},
loadData(params, cb) {
cb()
}
}
}
</script>
<style lang="scss" scoped></style>