import { Button, Dropdown, Menu, Space, Tooltip } from '@arco-design/web-react'; import { IconEdit, IconEye, IconMoreVertical, } from '@arco-design/web-react/icon'; import { isFunction } from 'lodash-es'; import React, { useMemo } from 'react'; import type { BasicRecord } from '../../api'; import type { ViewType } from '../../context/viewtype'; import { useTranslation } from '../../i18n'; import { ListDeleteAction } from './actions/DeleteAction'; import type { ListTableCustomAction, ListTableProps } from './ListTable'; export function useListTableColumns( props: ListTableProps, showTableDrawer: (viewType: ViewType, record: BasicRecord) => void ) { const { t } = useTranslation(); const { action } = props; const columns = useMemo(() => { const c = [...props.fields] .map((fieldHandler) => fieldHandler('list')) .filter((item) => !item.hidden) .map((item) => item.columnProps); if (action) { c.push({ key: 'actions', title: t('tushan.list.actions'), fixed: 'right', render: (val, record) => { return ( {action.detail && (