| | |
| | | ProTable, |
| | | LightFilter, |
| | | } from '@ant-design/pro-components'; |
| | | import { PlusOutlined, ExportOutlined, DownOutlined } from '@ant-design/icons'; |
| | | import { PlusOutlined, ExportOutlined, DownOutlined, DeleteOutlined, ExclamationCircleOutlined } from '@ant-design/icons'; |
| | | import Http from '@/utils/http'; |
| | | import Edit from './components/edit' |
| | | import Pwd from './components/pwd' |
| | |
| | | <Button |
| | | type="link" |
| | | danger |
| | | key="batchRemove" |
| | | key="remove" |
| | | onClick={async () => { |
| | | Modal.confirm({ |
| | | title: '删除', |
| | |
| | | blockNode |
| | | defaultExpandAll // 异步加载失效 |
| | | expandedKeys={deptExpandedKeys} |
| | | onExpand={setDeptExpandedKeys} |
| | | onExpand={setDeptExpandedKeys} |
| | | treeData={deptTreeData} |
| | | switcherIcon={<DownOutlined />} |
| | | onSelect={(selectedKeys, info) => { |
| | |
| | | actions: [ |
| | | <Button |
| | | type="primary" |
| | | danger |
| | | key="removeBatch" |
| | | hidden={selectedRows?.length === 0} |
| | | onClick={async () => { |
| | | Modal.confirm({ |
| | | title: '是否确认删除所选数据项?', |
| | | icon: <ExclamationCircleOutlined />, |
| | | content: '请谨慎操作', |
| | | async onOk() { |
| | | const success = await handleRemove(selectedRows); |
| | | if (success) { |
| | | setSelectedRows([]); |
| | | actionRef.current.reload(); |
| | | } |
| | | }, |
| | | onCancel() { }, |
| | | }); |
| | | }} |
| | | > |
| | | <DeleteOutlined /> |
| | | 删除 |
| | | </Button>, |
| | | <Button |
| | | type="primary" |
| | | key="save" |
| | | onClick={async () => { |
| | | setModalVisible(true) |
| | |
| | | } |
| | | }) |
| | | } |
| | | tableAlertRender={false} |
| | | rowSelection={{ |
| | | onChange: (ids, rows) => { |
| | | setSelectedRows(rows); |
| | |
| | | }} |
| | | /> |
| | | </Col> |
| | | |
| | | {selectedRows?.length > 0 && ( |
| | | <FooterToolbar |
| | | extra={ |
| | | <div> |
| | | 已选择 |
| | | <a style={{ fontWeight: 600 }}>{selectedRows.length}</a> |
| | | 项 |
| | | </div> |
| | | } |
| | | > |
| | | <Button |
| | | key="remove" |
| | | danger |
| | | onClick={async () => { |
| | | Modal.confirm({ |
| | | title: '删除', |
| | | content: '确定删除该项吗?', |
| | | onOk: async () => { |
| | | const success = await handleRemove(selectedRows); |
| | | if (success) { |
| | | setSelectedRows([]); |
| | | actionRef.current?.reloadAndRest?.(); |
| | | } |
| | | }, |
| | | }); |
| | | }} |
| | | > |
| | | 批量删除 |
| | | </Button> |
| | | </FooterToolbar> |
| | | )} |
| | | |
| | | <Edit |
| | | open={modalVisible} |