轮播图修改4
This commit is contained in:
parent
127fccf31e
commit
8d6c73e8ce
@ -8,7 +8,7 @@
|
|||||||
</a-space>
|
</a-space>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<a-table :row-selection="rowSelection" :columns="columns" :data-source="states.data" :pagination="pagination" :scroll="{ x:0,y: 430}" style="width: 85vw;">
|
<a-table :row-selection="rowSelection" :rowKey="record => record.id" :columns="columns" :data-source="states.data" :pagination="pagination" style="width: 84vw;">
|
||||||
|
|
||||||
|
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
@ -158,7 +158,7 @@ const showAddModal = () => {
|
|||||||
// // 翻页
|
// // 翻页
|
||||||
const pagination = computed(() => ({
|
const pagination = computed(() => ({
|
||||||
total: states.data.length,
|
total: states.data.length,
|
||||||
pageSize: 10,
|
pageSize: 5,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
||||||
@ -169,54 +169,54 @@ const columns = [
|
|||||||
dataIndex: 'author',
|
dataIndex: 'author',
|
||||||
key: 'author',
|
key: 'author',
|
||||||
resizable: true,
|
resizable: true,
|
||||||
width: 100,
|
// width: 100,
|
||||||
minWidth: 100,
|
// minWidth: 100,
|
||||||
maxWidth: 200,
|
// maxWidth: 200,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title:'图片',
|
title:'图片',
|
||||||
key: 'photo',
|
key: 'photo',
|
||||||
dataIndex: 'photo',
|
dataIndex: 'photo',
|
||||||
resizable: true,
|
resizable: true,
|
||||||
width: 150,
|
// width: 150,
|
||||||
maxWidth: 150,
|
// maxWidth: 150,
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '标题',
|
title: '标题',
|
||||||
dataIndex: 'title',
|
dataIndex: 'title',
|
||||||
key: 'title',
|
key: 'title',
|
||||||
width:150,
|
// width:150,
|
||||||
maxWidth: 150,
|
// maxWidth: 150,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '创建时间',
|
title: '创建时间',
|
||||||
dataIndex: 'createdAt',
|
dataIndex: 'createdAt',
|
||||||
key: 'createdAt',
|
key: 'createdAt',
|
||||||
width:200,
|
// width:200,
|
||||||
maxWidth: 200,
|
// maxWidth: 200,
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '图片地址',
|
|
||||||
dataIndex: 'image',
|
|
||||||
key: 'image',
|
|
||||||
width:250,
|
|
||||||
maxWidth: 250
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
// {
|
||||||
|
// title: '图片地址',
|
||||||
|
// dataIndex: 'image',
|
||||||
|
// key: 'image',
|
||||||
|
// width:250,
|
||||||
|
// maxWidth: 250
|
||||||
|
//
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
title: '排序',
|
title: '排序',
|
||||||
dataIndex: 'displayOrder',
|
dataIndex: 'displayOrder',
|
||||||
key: 'displayOrder',
|
key: 'displayOrder',
|
||||||
width:80,
|
width:80,
|
||||||
maxWidth: 80,
|
// maxWidth: 80,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '状态',
|
title: '状态',
|
||||||
key: 'isActive',
|
key: 'isActive',
|
||||||
dataIndex: 'isActive',
|
dataIndex: 'isActive',
|
||||||
width: 80,
|
// width: 80,
|
||||||
maxWidth: 80,
|
// maxWidth: 80,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
@ -363,14 +363,24 @@ const formState = reactive({
|
|||||||
isActive: false,
|
isActive: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// const rowSelection = {
|
||||||
|
// onChange: (selectedRowKeys, selectedRows) => {
|
||||||
|
// console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
|
||||||
|
// },
|
||||||
|
// getCheckboxProps: record => ({
|
||||||
|
// disabled: record.name === 'Disabled User',
|
||||||
|
// checked: record.id
|
||||||
|
// }),
|
||||||
|
// };
|
||||||
|
|
||||||
|
|
||||||
const rowSelection = {
|
const rowSelection = {
|
||||||
onChange: (selectedRowKeys, selectedRows) => {
|
onChange: (selectedRowKeys, selectedRows) => {
|
||||||
console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
|
console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
|
||||||
},
|
},
|
||||||
getCheckboxProps: record => ({
|
getCheckboxProps: (record) => ({
|
||||||
disabled: record.name === 'Disabled User',
|
// 设置每行选择框的属性
|
||||||
// Column configuration not to be checked
|
checked: record.id
|
||||||
name: record.name,
|
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user