We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
提问前先看看:
https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md
使用EditableProTable配合 ProForm 使用时,出现取消行动点删除整行的情况。 经排查, action?.startEditable?.(record.uuid, record); 这个需要使用第二个参数,不然就会出现我上诉提到的问题。
取消不用删整行
<ProForm initialValues={{ table: [ { uuid: '624748504', title: '活动名称一', decs: '这个活动真好玩', state: 'open', created_at: 1590486176000, update_at: 1590486176000, }, { uuid: '624691229', title: '活动名称二', decs: '这个活动真好玩', state: 'closed', created_at: 1590481162000, update_at: 1590481162000, }, ], }} validateTrigger="onBlur" > <EditableProTable rowKey="uuid" scroll={{ x: 960, }} headerTitle="可编辑表格" maxLength={5} name="table" columns={[ { title: '活动名称', dataIndex: 'title', formItemProps: () => { return { rules: [{ required: true, message: '此项为必填项' }], }; }, width: '30%', }, { title: '状态', key: 'state', dataIndex: 'state', valueType: 'select', valueEnum: { all: { text: '全部', status: 'Default' }, open: { text: '未解决', status: 'Error', }, closed: { text: '已解决', status: 'Success', }, }, }, { title: '描述', dataIndex: 'decs', }, { title: '活动时间', dataIndex: 'created_at', valueType: 'date', }, { title: '操作', valueType: 'option', width: 200, render: (text, record, _, action) => [ <a key="editable" onClick={() => { action?.startEditable?.(record.uuid); }} > 编辑 </a>, ], }, ]} editable={{ type: 'multiple', editableKeys, onChange: setEditableRowKeys, actionRender: (row, config, defaultDom) => { return [defaultDom.save, defaultDom.delete, defaultDom.cancel]; }, }} /> <ProForm.Item> <ProCard title="表格数据" headerBordered collapsible defaultCollapsed > <ProFormDependency name={['table']}> {({ table }) => { return ( <ProFormField ignoreFormItem fieldProps={{ style: { width: '100%', }, }} mode="read" valueType="jsonCode" text={JSON.stringify(table)} /> ); }} </ProFormDependency> </ProCard> </ProForm.Item> </ProForm>
The text was updated successfully, but these errors were encountered:
No branches or pull requests
提问前先看看:
https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md
🐛 bug 描述
📷 复现步骤
🏞 期望结果
取消不用删整行
💻 复现代码
<ProForm initialValues={{ table: [ { uuid: '624748504', title: '活动名称一', decs: '这个活动真好玩', state: 'open', created_at: 1590486176000, update_at: 1590486176000, }, { uuid: '624691229', title: '活动名称二', decs: '这个活动真好玩', state: 'closed', created_at: 1590481162000, update_at: 1590481162000, }, ], }} validateTrigger="onBlur" > <EditableProTable rowKey="uuid" scroll={{ x: 960, }} headerTitle="可编辑表格" maxLength={5} name="table" columns={[ { title: '活动名称', dataIndex: 'title', formItemProps: () => { return { rules: [{ required: true, message: '此项为必填项' }], }; }, width: '30%', }, { title: '状态', key: 'state', dataIndex: 'state', valueType: 'select', valueEnum: { all: { text: '全部', status: 'Default' }, open: { text: '未解决', status: 'Error', }, closed: { text: '已解决', status: 'Success', }, }, }, { title: '描述', dataIndex: 'decs', }, { title: '活动时间', dataIndex: 'created_at', valueType: 'date', }, { title: '操作', valueType: 'option', width: 200, render: (text, record, _, action) => [ <a key="editable" onClick={() => { action?.startEditable?.(record.uuid); }} > 编辑 </a>, ], }, ]} editable={{ type: 'multiple', editableKeys, onChange: setEditableRowKeys, actionRender: (row, config, defaultDom) => { return [defaultDom.save, defaultDom.delete, defaultDom.cancel]; }, }} /> <ProForm.Item> <ProCard title="表格数据" headerBordered collapsible defaultCollapsed > <ProFormDependency name={['table']}> {({ table }) => { return ( <ProFormField ignoreFormItem fieldProps={{ style: { width: '100%', }, }} mode="read" valueType="jsonCode" text={JSON.stringify(table)} /> ); }} </ProFormDependency> </ProCard> </ProForm.Item> </ProForm>
© 版本信息
The text was updated successfully, but these errors were encountered: