Commit 6e152037 by 和金晶

主数据删除前添加确认

parent 36f75f98
import { useEffect, useMemo, useState } from 'react'; import { useEffect, useMemo, useState } from 'react';
import { Space, Button, Input, Pagination, Tooltip } from 'antd'; import { Space, Button, Input, Pagination, Tooltip,Modal } from 'antd';
import { useContextMenu, Menu as RcMenu, Item as RcItem } from "react-contexify"; import { useContextMenu, Menu as RcMenu, Item as RcItem } from "react-contexify";
import ResizeableTable from '../../../ResizeableTable'; import ResizeableTable from '../../../ResizeableTable';
...@@ -27,6 +27,8 @@ const DefineTable = (props) => { ...@@ -27,6 +27,8 @@ const DefineTable = (props) => {
const [pagination, setPagination] = useState({pageNum: 1, pageSize: 20}); const [pagination, setPagination] = useState({pageNum: 1, pageSize: 20});
const {pageNum, pageSize} = pagination; const {pageNum, pageSize} = pagination;
const [modal, contextHolder] = Modal.useModal();
useEffect(() => { useEffect(() => {
setCheckedKeys([]); setCheckedKeys([]);
...@@ -133,6 +135,10 @@ const DefineTable = (props) => { ...@@ -133,6 +135,10 @@ const DefineTable = (props) => {
} }
const onBatchDeleteClick = () => { const onBatchDeleteClick = () => {
modal.confirm({
title: '是否确认删除该条数据?',
content: '',
onOk: () => {
setDeleteLoading(true); setDeleteLoading(true);
dispatch({ dispatch({
type: 'msd.deleteModels', type: 'msd.deleteModels',
...@@ -151,6 +157,8 @@ const DefineTable = (props) => { ...@@ -151,6 +157,8 @@ const DefineTable = (props) => {
} }
}); });
} }
});
}
const onSearchInputChange = (value) => { const onSearchInputChange = (value) => {
setKeyword(value); setKeyword(value);
...@@ -246,6 +254,7 @@ const DefineTable = (props) => { ...@@ -246,6 +254,7 @@ const DefineTable = (props) => {
编辑 编辑
</RcItem> </RcItem>
</RcMenu> </RcMenu>
{contextHolder}
</div> </div>
); );
} }
......
import { useMemo, useState, useEffect } from 'react'; import { useMemo, useState, useEffect } from 'react';
import { Space, Button, Input, Pagination, Tooltip } from 'antd'; import { Space, Button, Input, Pagination, Tooltip,Modal } from 'antd';
import { useContextMenu, Menu as RcMenu, Item as RcItem } from "react-contexify"; import { useContextMenu, Menu as RcMenu, Item as RcItem } from "react-contexify";
import ResizeableTable from '../../../ResizeableTable'; import ResizeableTable from '../../../ResizeableTable';
...@@ -30,6 +30,7 @@ const ManageTable = (props) => { ...@@ -30,6 +30,7 @@ const ManageTable = (props) => {
const [importDataDrawerVisible, setImportDataDrawerVisible] = useState(false); const [importDataDrawerVisible, setImportDataDrawerVisible] = useState(false);
const {pageNum, pageSize} = pagination; const {pageNum, pageSize} = pagination;
const [modal,contextHolder] = Modal.useModal();
const columns = useMemo(() => { const columns = useMemo(() => {
const newColumns = [ const newColumns = [
...@@ -140,6 +141,10 @@ const ManageTable = (props) => { ...@@ -140,6 +141,10 @@ const ManageTable = (props) => {
} }
const onBatchDeleteClick = () => { const onBatchDeleteClick = () => {
modal.confirm({
title: '是否确认删除该条数据?',
content: '',
onOk: () => {
setDeleteLoading(true); setDeleteLoading(true);
dispatch({ dispatch({
type: 'msd.deleteDatas', type: 'msd.deleteDatas',
...@@ -156,6 +161,8 @@ const ManageTable = (props) => { ...@@ -156,6 +161,8 @@ const ManageTable = (props) => {
} }
}); });
} }
});
}
const onSearchInputChange = (value) => { const onSearchInputChange = (value) => {
setKeyword(value); setKeyword(value);
...@@ -276,6 +283,7 @@ const ManageTable = (props) => { ...@@ -276,6 +283,7 @@ const ManageTable = (props) => {
编辑 编辑
</RcItem> </RcItem>
</RcMenu> </RcMenu>
{contextHolder}
</div> </div>
); );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment