Skip to content

Commit 2ebcb72

Browse files
committed
feat: style
1 parent 4a1a1ab commit 2ebcb72

File tree

1 file changed

+37
-17
lines changed

1 file changed

+37
-17
lines changed

src/views/system/notice/index.vue

Lines changed: 37 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,22 @@
1515
<el-button type="primary" @click="getList">Query</el-button>
1616
</el-form-item>
1717
</el-form>
18-
<div style="width: 100%; height: 500px">
18+
<div style="width: 100%; height: 600px">
1919
<el-auto-resizer>
2020
<template #default="{ height, width }">
2121
<el-table-v2 :columns="columns" :data="tableData" :width="width" :height="height" fixed />
2222
</template>
2323
</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>
3234
</div>
3335
</ContentWrap>
3436
</template>
@@ -37,6 +39,7 @@ import dayjs from 'dayjs'
3739
import { Column, ElPagination, ElTableV2, TableV2FixedDir } from 'element-plus'
3840
import * as NoticeApi from '@/api/system/notice'
3941
import { XTextButton } from '@/components/XButton'
42+
import { DictTag } from '@/components/DictTag'
4043
const { t } = useI18n() // 国际化
4144
4245
const columns: Column<any>[] = [
@@ -57,13 +60,19 @@ const columns: Column<any>[] = [
5760
key: 'type',
5861
dataKey: 'type',
5962
title: '公告类型',
60-
width: 180
63+
width: 180,
64+
cellRenderer: ({ cellData: type }) => (
65+
<DictTag type={DICT_TYPE.SYSTEM_NOTICE_TYPE} value={type}></DictTag>
66+
)
6167
},
6268
{
6369
key: 'status',
6470
dataKey: 'status',
6571
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+
)
6776
},
6877
{
6978
key: 'content',
@@ -85,15 +94,22 @@ const columns: Column<any>[] = [
8594
key: 'actionbtns',
8695
dataKey: 'actionbtns', //需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填id
8796
title: '操作', //显示在单元格表头的文本
88-
width: 80, //当前列的宽度,必须设置
97+
width: 160, //当前列的宽度,必须设置
8998
fixed: TableV2FixedDir.RIGHT, //是否固定列
9099
align: 'center',
91100
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+
</>
97113
)
98114
}
99115
]
@@ -115,6 +131,10 @@ const getList = async () => {
115131
tableTotal.value = res.total
116132
}
117133
134+
const handleUpdate = (id) => {
135+
console.info(id)
136+
}
137+
118138
const handleDelete = (id) => {
119139
console.info(id)
120140
}

0 commit comments

Comments
 (0)