15
15
<el-button type =" primary" @click =" getList" >Query</el-button >
16
16
</el-form-item >
17
17
</el-form >
18
- <div style =" width : 100% ; height : 500 px " >
18
+ <div style =" width : 100% ; height : 600 px " >
19
19
<el-auto-resizer >
20
20
<template #default =" { height , width } " >
21
21
<el-table-v2 :columns =" columns" :data =" tableData" :width =" width" :height =" height" fixed />
22
22
</template >
23
23
</el-auto-resizer >
24
- <el-pagination
25
- :current-page =" queryParms.pageNo"
26
- :page-size =" queryParms.pageSize"
27
- layout =" total, prev, pager, next"
28
- :total =" tableTotal"
29
- @size-change =" getList"
30
- @current-change =" getList"
31
- />
24
+ <div class =" mt-2" >
25
+ <el-pagination
26
+ :current-page =" queryParms.pageNo"
27
+ :page-size =" queryParms.pageSize"
28
+ layout =" total, prev, pager, next"
29
+ :total =" tableTotal"
30
+ @size-change =" getList"
31
+ @current-change =" getList"
32
+ />
33
+ </div >
32
34
</div >
33
35
</ContentWrap >
34
36
</template >
@@ -37,6 +39,7 @@ import dayjs from 'dayjs'
37
39
import { Column , ElPagination , ElTableV2 , TableV2FixedDir } from ' element-plus'
38
40
import * as NoticeApi from ' @/api/system/notice'
39
41
import { XTextButton } from ' @/components/XButton'
42
+ import { DictTag } from ' @/components/DictTag'
40
43
const { t } = useI18n () // 国际化
41
44
42
45
const columns: Column <any >[] = [
@@ -57,13 +60,19 @@ const columns: Column<any>[] = [
57
60
key: ' type' ,
58
61
dataKey: ' type' ,
59
62
title: ' 公告类型' ,
60
- width: 180
63
+ width: 180 ,
64
+ cellRenderer : ({ cellData : type }) => (
65
+ <DictTag type = { DICT_TYPE .SYSTEM_NOTICE_TYPE } value = { type } ></DictTag >
66
+ )
61
67
},
62
68
{
63
69
key: ' status' ,
64
70
dataKey: ' status' ,
65
71
title: t (' common.status' ),
66
- width: 180
72
+ width: 180 ,
73
+ cellRenderer : ({ cellData : status }) => (
74
+ <DictTag type = { DICT_TYPE .COMMON_STATUS } value = { status } ></DictTag >
75
+ )
67
76
},
68
77
{
69
78
key: ' content' ,
@@ -85,15 +94,22 @@ const columns: Column<any>[] = [
85
94
key: ' actionbtns' ,
86
95
dataKey: ' actionbtns' , // 需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填id
87
96
title: ' 操作' , // 显示在单元格表头的文本
88
- width: 80 , // 当前列的宽度,必须设置
97
+ width: 160 , // 当前列的宽度,必须设置
89
98
fixed: TableV2FixedDir .RIGHT , // 是否固定列
90
99
align: ' center' ,
91
100
cellRenderer : ({ cellData : id }) => (
92
- <XTextButton
93
- preIcon = " ep:delete"
94
- title = { t (' action.del' )}
95
- onClick = { handleDelete .bind (this , id )}
96
- ></XTextButton >
101
+ <>
102
+ <XTextButton
103
+ preIcon = " ep:delete"
104
+ title = { t (' action.edit' )}
105
+ onClick = { handleUpdate .bind (this , id )}
106
+ ></XTextButton >
107
+ <XTextButton
108
+ preIcon = " ep:delete"
109
+ title = { t (' action.del' )}
110
+ onClick = { handleDelete .bind (this , id )}
111
+ ></XTextButton >
112
+ </>
97
113
)
98
114
}
99
115
]
@@ -115,6 +131,10 @@ const getList = async () => {
115
131
tableTotal .value = res .total
116
132
}
117
133
134
+ const handleUpdate = (id ) => {
135
+ console .info (id )
136
+ }
137
+
118
138
const handleDelete = (id ) => {
119
139
console .info (id )
120
140
}
0 commit comments