优化批量删除和删除提示
This commit is contained in:
@ -1,7 +1,7 @@
|
|||||||
import { UnorderedListOutlined } from "@ant-design/icons"
|
import { UnorderedListOutlined } from "@ant-design/icons"
|
||||||
import ProTable, { ActionType, ProColumns } from "@ant-design/pro-table"
|
import ProTable, { ActionType, ProColumns } from "@ant-design/pro-table"
|
||||||
import tableProps from '@/utils/tableProps';
|
import tableProps from '@/utils/tableProps';
|
||||||
import { Button, Card, Divider, message, Spin } from "antd"
|
import { Button, Card, Divider, message, Modal, Popconfirm, Spin } from "antd"
|
||||||
import React, { useEffect, useRef, useState } from "react"
|
import React, { useEffect, useRef, useState } from "react"
|
||||||
import BiddingDocument from "./components/BiddingDocument"
|
import BiddingDocument from "./components/BiddingDocument"
|
||||||
import {
|
import {
|
||||||
@ -95,7 +95,9 @@ const BiddingDocumentList: React.FC<{}> = (props) => {
|
|||||||
let btn1 = (
|
let btn1 = (
|
||||||
<>
|
<>
|
||||||
<Button hidden={btnAuthority(['ebtp-agency-project-manager', 'ebtp-purchase'])} type="text" onClick={() => toEdit(record)}>修改</Button>
|
<Button hidden={btnAuthority(['ebtp-agency-project-manager', 'ebtp-purchase'])} type="text" onClick={() => toEdit(record)}>修改</Button>
|
||||||
<Button hidden={btnAuthority(['ebtp-agency-project-manager', 'ebtp-purchase'])} type="text" onClick={() => toRemove(record)}>删除</Button>
|
<Popconfirm title="确定删除吗?" onConfirm={() => toRemove(record)}>
|
||||||
|
<Button hidden={btnAuthority(['ebtp-agency-project-manager', 'ebtp-purchase'])} type="text">删除</Button>
|
||||||
|
</Popconfirm>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
let btn2 = (
|
let btn2 = (
|
||||||
@ -172,6 +174,9 @@ const BiddingDocumentList: React.FC<{}> = (props) => {
|
|||||||
}
|
}
|
||||||
const toRemoveMore = () => {
|
const toRemoveMore = () => {
|
||||||
if (selectedRowsState.length != 0) {
|
if (selectedRowsState.length != 0) {
|
||||||
|
Modal.confirm({
|
||||||
|
title: '确定删除吗?',
|
||||||
|
onOk: () => {
|
||||||
setPageloading(true);
|
setPageloading(true);
|
||||||
let param = []
|
let param = []
|
||||||
for (const item of selectedRowsState) {
|
for (const item of selectedRowsState) {
|
||||||
@ -187,6 +192,13 @@ const BiddingDocumentList: React.FC<{}> = (props) => {
|
|||||||
setSelectedRows([]);
|
setSelectedRows([]);
|
||||||
actionRef?.current?.reloadAndRest?.();
|
actionRef?.current?.reloadAndRest?.();
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
onCancel: () => {
|
||||||
|
setSelectedRows([]);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
message.warn('请选择要删除的资审文件');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user