fix: merge
This commit is contained in:
parent
78e423cc50
commit
d682234293
|
@ -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>
|
|
@ -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: 'edit',
|
||||||
|
// disabled: true,
|
||||||
|
text: "编辑"
|
||||||
|
},
|
||||||
|
{
|
||||||
key: 'delete',
|
key: 'delete',
|
||||||
disabled: true,
|
disabled: true,
|
||||||
text: "删除"
|
text: "删除"
|
||||||
}]
|
}
|
||||||
|
]
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue