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
size="small"
: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"
:page-size-options="[12, 24, 48, 60, 100]"
/>
</div>
</div>
@ -135,33 +140,30 @@ const modelChange = (type: keyof typeof ModelEnum) => {
//
const handleSearch = async (params1?: Record<string, any>) => {
const resp = await props.request({
pageSize: 10,
pageSize: 12,
pageIndex: 1,
...params1
})
if(resp.status === 200){
dataSource.value = [ // resp.result?.data ||
{
key: '1',
name: '胡彦斌',
age: 32,
address: '西湖区湖底公园1号',
},
{
key: '2',
name: '胡彦祖',
age: 42,
address: '西湖区湖底公园1号',
},
],
dataSource.value = resp.result?.data || []
pageIndex.value = resp.result?.pageIndex || 0
pageSize.value = resp.result?.pageSize || 6
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(() => {
@ -226,9 +228,9 @@ watchEffect(() => {
margin-top: 20px;
display: flex;
justify-content: flex-end;
// position: absolute;
// right: 24px;
// bottom: 24px;
/deep/ .ant-pagination-item {
display: none !important;
}
}
}
</style>

View File

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