| | |
| | | (instance: TableActionType, formInstance: UseTableMethod) => void, |
| | | TableActionType & { |
| | | getForm: () => FormActionType; |
| | | } |
| | | }, |
| | | ] { |
| | | const tableRef = ref<Nullable<TableActionType>>(null); |
| | | const loadedRef = ref<Nullable<boolean>>(false); |
| | |
| | | { |
| | | immediate: true, |
| | | deep: true, |
| | | } |
| | | }, |
| | | ); |
| | | } |
| | | |
| | |
| | | const table = unref(tableRef); |
| | | if (!table) { |
| | | error( |
| | | 'The table instance has not been obtained yet, please make sure the table is presented when performing the table operation!' |
| | | 'The table instance has not been obtained yet, please make sure the table is presented when performing the table operation!', |
| | | ); |
| | | } |
| | | return table as TableActionType; |
| | |
| | | }, |
| | | getDataSource: () => { |
| | | return getTableInstance().getDataSource(); |
| | | }, |
| | | getRawDataSource: () => { |
| | | return getTableInstance().getRawDataSource(); |
| | | }, |
| | | getColumns: ({ ignoreIndex = false }: { ignoreIndex?: boolean } = {}) => { |
| | | const columns = getTableInstance().getColumns({ ignoreIndex }) || []; |
| | |
| | | updateTableDataRecord: (rowKey: string | number, record: Recordable) => { |
| | | return getTableInstance().updateTableDataRecord(rowKey, record); |
| | | }, |
| | | findTableDataRecord: (rowKey: string | number) => { |
| | | return getTableInstance().findTableDataRecord(rowKey); |
| | | }, |
| | | getRowSelection: () => { |
| | | return toRaw(getTableInstance().getRowSelection()); |
| | | }, |