import type { ReactNode } from 'react'; import { memo } from 'react'; import { EditableProTable } from '@ant-design/pro-components'; import { useProTableList } from './hook'; import { Tooltip, Popconfirm, Input, Space, Select, Button, Switch } from 'antd'; import { defaultTableRow } from './const'; import style from './index.less'; import { find } from 'lodash'; import { MinusCircleOutlined, PlusCircleOutlined } from '@ant-design/icons'; import { FormattedMessage } from 'umi'; interface recordProps { /** * @description 其他属性 */ recordCreatorProps?: any; /** * @description 需要的options */ tableRow?: any; /** * @description datasource */ value?: API.DataSourceType[]; /** * @description onChange */ onChange?: (value?: API.DataSourceType[]) => void; /** * @description operate是否存在 true(默认值) false */ inOperate?: boolean; /** * @description 新增一行是否需要校验 true(默认值) false */ isRequire?: boolean; /** * @description key 是否唯一 */ isUniqueKey?: boolean; /** * hiddenOrNotOperate 是否隐藏操作列 【异或,not】选项 默认隐藏 */ hiddenOrNotOperate?: boolean; } const options = [ { value: 'and', label: '与' }, { value: 'xor', label: '异或' }, { value: 'or', label: '或' }, ]; const OperateRender = ({ dataSource, row, onChange }) => { // debugger; const target = find(dataSource, (item) => { return item.id === row.id; }); return ( <>