From 2e0d60e8344450328b1ead2a1ba3a6add3224b07 Mon Sep 17 00:00:00 2001 From: Odboy Date: Sun, 1 Feb 2026 10:24:57 +0800 Subject: [PATCH] =?UTF-8?q?feat(dev):=20=E6=B7=BB=E5=8A=A0=E5=8F=AF?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E8=A1=A8=E6=A0=BC=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 CuteEditTable 组件实现表格行内编辑功能 - 支持 input 和 select 类型的单元格编辑 - 提供行删除、上移、下移操作按钮 - 集成到 CuteSimpleTableDemo 演示页面 - 配置可编辑表格的数据源和字段定义 - 实现表格数据变更的双向绑定机制 --- .../views/components/dev/CuteEditTable.vue | 174 ++++++++++++++++++ .../componentsDemo/CuteSimpleTableDemo.vue | 28 ++- 2 files changed, 197 insertions(+), 5 deletions(-) create mode 100644 cutejava-front/src/views/components/dev/CuteEditTable.vue diff --git a/cutejava-front/src/views/components/dev/CuteEditTable.vue b/cutejava-front/src/views/components/dev/CuteEditTable.vue new file mode 100644 index 00000000..2ba4713e --- /dev/null +++ b/cutejava-front/src/views/components/dev/CuteEditTable.vue @@ -0,0 +1,174 @@ + + + + + + + diff --git a/cutejava-front/src/views/componentsDemo/CuteSimpleTableDemo.vue b/cutejava-front/src/views/componentsDemo/CuteSimpleTableDemo.vue index 8746088f..7b18fb49 100644 --- a/cutejava-front/src/views/componentsDemo/CuteSimpleTableDemo.vue +++ b/cutejava-front/src/views/componentsDemo/CuteSimpleTableDemo.vue @@ -99,6 +99,9 @@ + + + @@ -111,18 +114,33 @@ import CuteFormDrawer from '@/views/components/dev/CuteFormDrawer' import { FormatRowDateTimeStr } from '@/utils/KitUtil' import CuteButton from '@/views/components/dev/CuteButton.vue' import CuteTransfer from '@/views/components/dev/CuteTransfer.vue' +import CuteEditTable from '@/views/components/dev/CuteEditTable.vue' export default { name: 'CuteSimpleTableDemo', - components: { CuteTransfer, CuteButton, CuteFormDrawer, CuteFormDialog, CuteSimpleTable }, + components: { CuteEditTable, CuteTransfer, CuteButton, CuteFormDrawer, CuteFormDialog, CuteSimpleTable }, data() { return { modeDataSource: [ { id: 1, name: '小明', description: '小明牛P' }, - { id: 2, name: '小明', description: '小明牛P' }, - { id: 3, name: '小明', description: '小明牛P' }, - { id: 4, name: '小明', description: '小明牛P' }, - { id: 5, name: '小明', description: '小明牛P' } + { id: 4, name: '小绿', description: '小绿牛P' }, + { id: 5, name: '小黄', description: '小黄牛P' }, + { id: 6, name: '小紫', description: '小紫牛P' }, + { id: 17, name: '小郑', description: '小郑牛P' }, + { id: 18, name: '小王', description: '小王牛P' } + ], + editTableSchema: [ + { name: 'name', title: '姓名', type: 'input' }, + { name: 'sex', title: '性别', type: 'select', dataSource: [{ label: '男', value: 'nn' }, { label: '女', value: 'mm' }] }, + { name: 'description', title: '描述', type: 'input' } + ], + editTableDataSource: [ + { id: 1, name: '小明', sex: 'mm', description: '小明牛P' }, + { id: 4, name: '小绿', sex: 'nn', description: '小绿牛P' }, + { id: 5, name: '小黄', sex: 'nn', description: '小黄牛P' }, + { id: 6, name: '小紫', sex: 'nn', description: '小紫牛P' }, + { id: 17, name: '小郑', sex: 'mm', description: '小郑牛P' }, + { id: 18, name: '小王', sex: 'nn', description: '小王牛P' } ], form: { model: {