fix: merge

This commit is contained in:
100011797 2023-01-11 10:01:28 +08:00
parent 78e423cc50
commit d682234293
2 changed files with 42 additions and 33 deletions

View File

@ -53,8 +53,13 @@
<a-pagination <a-pagination
size="small" size="small"
:total="total" :total="total"
:show-total="total => `第 ${1} - ${1} 条/总共 ${total} 条`" :showQuickJumper="false"
:showSizeChanger="true"
v-model:current="pageIndex"
v-model:page-size="pageSize"
:show-total="(total, range) => `第 ${range[0]} - ${range[1]} 条/总共 ${total} 条`"
@change="pageChange" @change="pageChange"
:page-size-options="[12, 24, 48, 60, 100]"
/> />
</div> </div>
</div> </div>
@ -135,33 +140,30 @@ const modelChange = (type: keyof typeof ModelEnum) => {
// //
const handleSearch = async (params1?: Record<string, any>) => { const handleSearch = async (params1?: Record<string, any>) => {
const resp = await props.request({ const resp = await props.request({
pageSize: 10, pageSize: 12,
pageIndex: 1, pageIndex: 1,
...params1 ...params1
}) })
if(resp.status === 200){ if(resp.status === 200){
dataSource.value = [ // resp.result?.data || dataSource.value = resp.result?.data || []
{
key: '1',
name: '胡彦斌',
age: 32,
address: '西湖区湖底公园1号',
},
{
key: '2',
name: '胡彦祖',
age: 42,
address: '西湖区湖底公园1号',
},
],
pageIndex.value = resp.result?.pageIndex || 0 pageIndex.value = resp.result?.pageIndex || 0
pageSize.value = resp.result?.pageSize || 6 pageSize.value = resp.result?.pageSize || 6
total.value = resp.result?.total || 0 total.value = resp.result?.total || 0
} }
} }
const pageChange = () => { const pageChange = (page: number, size: number) => {
if(pageSize.value === size) {
handleSearch({
pageSize: size,
pageIndex: page,
})
} else {
handleSearch({
pageSize: size,
pageIndex: 1,
})
}
} }
watchEffect(() => { watchEffect(() => {
@ -226,9 +228,9 @@ watchEffect(() => {
margin-top: 20px; margin-top: 20px;
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
// position: absolute; /deep/ .ant-pagination-item {
// right: 24px; display: none !important;
// bottom: 24px; }
} }
} }
</style> </style>

View File

@ -3,19 +3,19 @@
<JTable <JTable
:columns="[ :columns="[
{ {
title: '名', title: '',
dataIndex: 'name', dataIndex: 'name',
key: 'name', key: 'name',
}, },
{ {
title: '年龄', title: 'ID',
dataIndex: 'age', dataIndex: 'id',
key: 'age', key: 'id',
}, },
{ {
title: '住址', title: '分类',
dataIndex: 'address', dataIndex: 'classifiedName',
key: 'address', key: 'classifiedName',
}, },
]" ]"
:actions="actions" :actions="actions"
@ -40,11 +40,18 @@ import server from "@/utils/request";
import CardBox from '@/components/CardBox/index.vue'; import CardBox from '@/components/CardBox/index.vue';
const request = (data: any) => server.post(`/device-product/_query`, data) const request = (data: any) => server.post(`/device-product/_query`, data)
const actions = [{ const actions = [
key: 'delete', {
disabled: true, key: 'edit',
text: "删除" // disabled: true,
}] text: "编辑"
},
{
key: 'delete',
disabled: true,
text: "删除"
}
]
</script> </script>