From 97344e68f5abb144d9e5d4ad273108858dbcfba2 Mon Sep 17 00:00:00 2001 From: kailong321200875 <321200875@qq.com> Date: Fri, 11 Aug 2023 17:48:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DTable=E6=8F=92?= =?UTF-8?q?=E6=A7=BD=E4=BC=A0=E5=8F=82=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Table/src/Table.vue | 4 ++-- src/views/Authorization/Department/Department.vue | 10 +++++----- src/views/Authorization/Menu/Menu.vue | 12 ++++++------ src/views/Authorization/Role/Role.vue | 6 +++--- src/views/Authorization/User/User.vue | 2 +- src/views/Components/Table/DefaultTable.vue | 4 ++-- src/views/Components/Table/TreeTable.vue | 4 ++-- src/views/Components/Table/UseTableDemo.vue | 4 ++-- src/views/Example/Dialog/ExampleDialog.vue | 6 +++--- src/views/Example/Page/ExamplePage.vue | 6 +++--- 10 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/components/Table/src/Table.vue b/src/components/Table/src/Table.vue index c3ab442..5ae728c 100644 --- a/src/components/Table/src/Table.vue +++ b/src/components/Table/src/Table.vue @@ -362,7 +362,7 @@ export default defineComponent({ return children && children.length ? renderTreeTableColumn(children) : props?.slots?.default - ? props.slots.default(args) + ? props.slots.default(...args) : v?.formatter ? v?.formatter?.(data.row, data.column, get(data.row, v.field), data.$index) : isImageUrl @@ -459,7 +459,7 @@ export default defineComponent({ return children && children.length ? renderTreeTableColumn(children) : props?.slots?.default - ? props.slots.default(args) + ? props.slots.default(...args) : v?.formatter ? v?.formatter?.(data.row, data.column, get(data.row, v.field), data.$index) : isImageUrl diff --git a/src/views/Authorization/Department/Department.vue b/src/views/Authorization/Department/Department.vue index 864226a..6d52381 100644 --- a/src/views/Authorization/Department/Department.vue +++ b/src/views/Authorization/Department/Department.vue @@ -85,7 +85,7 @@ const crudSchemas = reactive([ table: { slots: { default: (data: any) => { - return <>{data[0].row.departmentName} + return <>{data.row.departmentName} } } }, @@ -119,7 +119,7 @@ const crudSchemas = reactive([ table: { slots: { default: (data: any) => { - const status = data[0].row.status + const status = data.row.status return ( <> @@ -215,13 +215,13 @@ const crudSchemas = reactive([ default: (data: any) => { return ( <> - action(data[0].row, 'edit')}> + action(data.row, 'edit')}> {t('exampleDemo.edit')} - action(data[0].row, 'detail')}> + action(data.row, 'detail')}> {t('exampleDemo.detail')} - delData(data[0].row)}> + delData(data.row)}> {t('exampleDemo.del')} diff --git a/src/views/Authorization/Menu/Menu.vue b/src/views/Authorization/Menu/Menu.vue index 9927185..cf43ef4 100644 --- a/src/views/Authorization/Menu/Menu.vue +++ b/src/views/Authorization/Menu/Menu.vue @@ -41,7 +41,7 @@ const tableColumns = reactive([ label: t('menu.icon'), slots: { default: (data: any) => { - const icon = data[0].row.meta.icon + const icon = data.row.meta.icon if (icon) { return ( <> @@ -59,7 +59,7 @@ const tableColumns = reactive([ label: t('menu.permission'), slots: { default: (data: any) => { - const permission = data[0].row.meta.permission + const permission = data.row.meta.permission return permission ? <>{permission.join(', ')} : null } } @@ -69,7 +69,7 @@ const tableColumns = reactive([ label: t('menu.component'), slots: { default: (data: any) => { - const component = data[0].row.component + const component = data.row.component return <>{component === '#' ? '顶级目录' : component === '##' ? '子目录' : component} } } @@ -85,8 +85,8 @@ const tableColumns = reactive([ default: (data: any) => { return ( <> - - {data[0].row.status === 1 ? t('userDemo.enable') : t('userDemo.disable')} + + {data.row.status === 1 ? t('userDemo.enable') : t('userDemo.disable')} ) @@ -99,7 +99,7 @@ const tableColumns = reactive([ width: 240, slots: { default: (data: any) => { - const row = data[0].row + const row = data.row return ( <> action(row, 'edit')}> diff --git a/src/views/Authorization/Role/Role.vue b/src/views/Authorization/Role/Role.vue index 68096af..42a7923 100644 --- a/src/views/Authorization/Role/Role.vue +++ b/src/views/Authorization/Role/Role.vue @@ -47,8 +47,8 @@ const tableColumns = reactive([ default: (data: any) => { return ( <> - - {data[0].row.status === 1 ? t('userDemo.enable') : t('userDemo.disable')} + + {data.row.status === 1 ? t('userDemo.enable') : t('userDemo.disable')} ) @@ -69,7 +69,7 @@ const tableColumns = reactive([ width: 240, slots: { default: (data: any) => { - const row = data[0].row + const row = data.row return ( <> action(row, 'edit')}> diff --git a/src/views/Authorization/User/User.vue b/src/views/Authorization/User/User.vue index 6f7720d..ccb95ca 100644 --- a/src/views/Authorization/User/User.vue +++ b/src/views/Authorization/User/User.vue @@ -150,7 +150,7 @@ const crudSchemas = reactive([ width: 240, slots: { default: (data: any) => { - const row = data[0].row as DepartmentUserItem + const row = data.row as DepartmentUserItem return ( <> action(row, 'edit')}> diff --git a/src/views/Components/Table/DefaultTable.vue b/src/views/Components/Table/DefaultTable.vue index 13a6fb0..b06eef2 100644 --- a/src/views/Components/Table/DefaultTable.vue +++ b/src/views/Components/Table/DefaultTable.vue @@ -1,7 +1,7 @@ diff --git a/src/views/Components/Table/TreeTable.vue b/src/views/Components/Table/TreeTable.vue index c97bc88..5ca4b53 100644 --- a/src/views/Components/Table/TreeTable.vue +++ b/src/views/Components/Table/TreeTable.vue @@ -1,7 +1,7 @@ diff --git a/src/views/Components/Table/UseTableDemo.vue b/src/views/Components/Table/UseTableDemo.vue index 9b78a90..78c9dbf 100644 --- a/src/views/Components/Table/UseTableDemo.vue +++ b/src/views/Components/Table/UseTableDemo.vue @@ -30,8 +30,8 @@ const columns = reactive([ field: 'expand', type: 'expand', slots: { - default: (data: TableSlotDefault[]) => { - const { row } = data[0] + default: (data: TableSlotDefault) => { + const { row } = data return (
diff --git a/src/views/Example/Dialog/ExampleDialog.vue b/src/views/Example/Dialog/ExampleDialog.vue index b544247..cec4b40 100644 --- a/src/views/Example/Dialog/ExampleDialog.vue +++ b/src/views/Example/Dialog/ExampleDialog.vue @@ -212,13 +212,13 @@ const crudSchemas = reactive([ default: (data: any) => { return ( <> - action(data[0].row, 'edit')}> + action(data.row, 'edit')}> {t('exampleDemo.edit')} - action(data[0].row, 'detail')}> + action(data.row, 'detail')}> {t('exampleDemo.detail')} - delData(data[0].row)}> + delData(data.row)}> {t('exampleDemo.del')} diff --git a/src/views/Example/Page/ExamplePage.vue b/src/views/Example/Page/ExamplePage.vue index b5db6c1..459e1b4 100644 --- a/src/views/Example/Page/ExamplePage.vue +++ b/src/views/Example/Page/ExamplePage.vue @@ -229,13 +229,13 @@ const crudSchemas = reactive([ default: (data: any) => { return ( <> - action(data[0].row, 'edit')}> + action(data.row, 'edit')}> {t('exampleDemo.edit')} - action(data[0].row, 'detail')}> + action(data.row, 'detail')}> {t('exampleDemo.detail')} - delData(data[0].row)}> + delData(data.row)}> {t('exampleDemo.del')}