import snippets from './snippets'; import baseTableProps from '../_props/table/base-table-props'; import { BUILT_IN_ACTIONBAR_BUTTONS } from '@/constants'; import { isPageDesigner, isDev } from '../_utils/utils'; import { actionBarButtonsProps, columnsProps } from '../_props'; import { version } from '../../package.json'; const editTableProps = baseTableProps(true, false).map((item: any) => { if (item.name === 'columns') { return { ...columnsProps(true) }; } if (item.name === 'actionBarButtons') { return { ...actionBarButtonsProps(BUILT_IN_ACTIONBAR_BUTTONS, true), }; } return item; }); export default { snippets, // 列表页显示组件 group: '基础组件', category: isPageDesigner() || isDev ? '基础元素' : '容器元素', componentName: 'RsEditTable', title: '编辑表格', priority: 33, npm: { package: 'components-page', version, exportName: 'RsEditTable', main: 'src\\index.tsx', destructuring: true, subName: '', }, props: editTableProps, configure: { supports: { style: true, events: [ { name: 'onTreeMarkChange', template: "onTreeMarkChange(checked){\n// 点击表格中树组件下方标记时触发\nconsole.log('onTreeMarkChange', checked);\n}\n", }, { name: 'onTreeSelect', template: "onTreeSelect(value, node){\n// 选中树节点时触发\nconsole.log('onTreeSelect', value, node);\n}\n", }, { name: 'onTreeNodeDrop', template: 'onTreeNodeDrop(info, position){\n return true; \n}\n', }, { name: 'onExpand', template: "onExpand(expanded, record){\n// 展开/收起行时触发\nconsole.log('onExpand', expanded, record);\n}\n", }, { name: 'onSelectChange', template: "onSelectChange(selected){\n// 选中行时触发\nconsole.log('onSelectChange', selected);\n}\n", }, { name: 'onRowClick', template: "onRowClick(record, rowIndex){\n/**\n * 点击行时触发\n * `record` - 当前行数据 \n * `rowIndex` - 当前行索引\n */\n console.log('onRowClick', record, rowIndex);\n}\n", }, { name: 'onExpandableSelectChange', template: "onExpandableSelectChange(selected){\n// 展开中表格选中行时触发\nconsole.log('onExpandableSelectChange', selected);\n}\n", }, ], }, }, };