mirror of
https://gitee.com/nocobase/nocobase.git
synced 2024-12-04 05:08:42 +08:00
fix: table configuration delete button problem (#1764)
* fix: table configuration delete button problem * fix: change copy * refactor: optimize code --------- Co-authored-by: Rairn <958414905@qq.com>
This commit is contained in:
parent
7feeda4906
commit
d0edc6ce3f
@ -161,10 +161,9 @@ const CurrentFields = (props) => {
|
||||
type: 'checkbox',
|
||||
onChange: (selectedRowKeys) => {
|
||||
setState((state) => {
|
||||
const result = [...(state.selectedRowKeys || []), ...selectedRowKeys];
|
||||
return {
|
||||
...state,
|
||||
selectedRowKeys: result,
|
||||
selectedRowKeys,
|
||||
};
|
||||
});
|
||||
},
|
||||
@ -312,7 +311,6 @@ export const CollectionFields = (props) => {
|
||||
];
|
||||
|
||||
const fields = getCurrentCollectionFields(name);
|
||||
|
||||
const groups = {
|
||||
pf: [],
|
||||
association: [],
|
||||
@ -357,7 +355,6 @@ export const CollectionFields = (props) => {
|
||||
fields: groups.system,
|
||||
},
|
||||
];
|
||||
|
||||
dataSource.push(
|
||||
...inherits
|
||||
.map((key) => {
|
||||
@ -408,7 +405,6 @@ export const CollectionFields = (props) => {
|
||||
);
|
||||
const addProps = { type: 'primary' };
|
||||
const syncProps = { type: 'primary' };
|
||||
|
||||
return (
|
||||
<ResourceActionProvider {...resourceActionProps}>
|
||||
<FormContext.Provider value={form}>
|
||||
|
@ -2,6 +2,7 @@ import { useField, useForm } from '@formily/react';
|
||||
import { message } from 'antd';
|
||||
import omit from 'lodash/omit';
|
||||
import { useEffect } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useCollection, useCollectionManager } from '.';
|
||||
import { useCompile } from '..';
|
||||
import { useRequest } from '../api-client';
|
||||
@ -378,8 +379,12 @@ export const useDestroyAction = () => {
|
||||
export const useBulkDestroyAction = () => {
|
||||
const { state, setState, refresh } = useResourceActionContext();
|
||||
const { resource } = useResourceContext();
|
||||
const { t } = useTranslation();
|
||||
return {
|
||||
async run() {
|
||||
if (!state?.selectedRowKeys?.length) {
|
||||
return message.error(t('Please select the records you want to delete'));
|
||||
}
|
||||
await resource.destroy({
|
||||
filterByTk: state?.selectedRowKeys || [],
|
||||
});
|
||||
|
@ -217,6 +217,7 @@ export default {
|
||||
"Edit collection": "编辑数据表",
|
||||
"Configure fields": "配置字段",
|
||||
"Configure columns": "配置字段",
|
||||
"Please select the records you want to delete": "请选择要删除的记录",
|
||||
"Edit field": "编辑字段",
|
||||
"Override": "重写",
|
||||
"Override field": "重写字段",
|
||||
|
Loading…
Reference in New Issue
Block a user