fix: merge
This commit is contained in:
parent
78e423cc50
commit
d682234293
|
@ -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>
|
|
@ -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>
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue