import { utils } from '@schema-render/core-react' import { Rate, Switch, Tag } from 'antd' import ImagesPreview from '../components/ImagesPreview' import { STYLE_CODE } from '../constants/style' import type { ITableProps } from '../typings/table' import { isEmpty } from '../utils/common' import CommaNumber from './CommaNumber' import LongText from './LongText' import LongTextModal from './LongTextModal' const { isArray } = utils export const BUILT_IN_VALUE_TYPES: ITableProps['registerValueType'] = { /** * 代码块 */ code: ({ value, options }) => { return (
{value}
)
},
/**
* 百分比
*/
percent: ({ value }) => (isEmpty(value) ? '-' : `${value}%`),
/**
* 状态开关
*/
switch: ({ value, options }) =>