轮播图修改4

This commit is contained in:
妖姐 2024-02-29 21:39:54 +08:00
parent 127fccf31e
commit 8d6c73e8ce

View File

@ -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,
}), }),
}; };