|
@@ -1,7 +1,7 @@
|
|
|
-import {Divider, message, Modal} from 'antd';
|
|
|
+import {message, Modal} from 'antd';
|
|
|
import React, {useRef, useState} from 'react';
|
|
|
import {PageHeaderWrapper} from '@ant-design/pro-layout';
|
|
|
-import ProTable, {ActionType, ProColumns} from '@ant-design/pro-table';
|
|
|
+import ProTable, {ActionType, ProColumns, TableDropdown} from '@ant-design/pro-table';
|
|
|
import {SorterResult} from 'antd/es/table/interface';
|
|
|
import {TableListItem} from './data.d';
|
|
|
import service from './service';
|
|
@@ -134,7 +134,6 @@ const TableList: React.FC<{}> = () => {
|
|
|
>
|
|
|
查看
|
|
|
</a>
|
|
|
- <Divider type="vertical"/>
|
|
|
<a
|
|
|
onClick={(e) => {
|
|
|
e.stopPropagation();
|
|
@@ -143,27 +142,33 @@ const TableList: React.FC<{}> = () => {
|
|
|
>
|
|
|
修改
|
|
|
</a>
|
|
|
- <Divider type="vertical"/>
|
|
|
- <a
|
|
|
- onClick={async () => {
|
|
|
- confirm({
|
|
|
- title: '确定删除吗?',
|
|
|
- icon: <ExclamationCircleOutlined/>,
|
|
|
- content: '删除后无法恢复',
|
|
|
- okText: '确定',
|
|
|
- okType: 'danger',
|
|
|
- cancelText: '取消',
|
|
|
- onOk() {
|
|
|
- deleteMemory(record);
|
|
|
- },
|
|
|
- onCancel() {
|
|
|
- console.log('Cancel');
|
|
|
- },
|
|
|
- });
|
|
|
+ <TableDropdown
|
|
|
+ key="actionGroup"
|
|
|
+ menus={[
|
|
|
+ { key: 'restart', name: '重新复习' },
|
|
|
+ { key: 'delete', name: '删除' },
|
|
|
+ ]}
|
|
|
+ onSelect={async (key)=>{
|
|
|
+ if (key === 'restart') {
|
|
|
+ await service.restart(record);
|
|
|
+ }else if (key === 'delete') {
|
|
|
+ confirm({
|
|
|
+ title: '确定删除吗?',
|
|
|
+ icon: <ExclamationCircleOutlined/>,
|
|
|
+ content: '删除后无法恢复',
|
|
|
+ okText: '确定',
|
|
|
+ okType: 'danger',
|
|
|
+ cancelText: '取消',
|
|
|
+ onOk() {
|
|
|
+ deleteMemory(record);
|
|
|
+ },
|
|
|
+ onCancel() {
|
|
|
+ console.log('Cancel');
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }
|
|
|
}}
|
|
|
- >
|
|
|
- 删除
|
|
|
- </a>
|
|
|
+ />
|
|
|
</>
|
|
|
),
|
|
|
},
|
|
@@ -210,9 +215,12 @@ const TableList: React.FC<{}> = () => {
|
|
|
setFormValues(record);
|
|
|
setShowVisible(true);
|
|
|
},
|
|
|
- onContextMenu: event => {},
|
|
|
- onMouseEnter: event => {}, // 鼠标移入行
|
|
|
- onMouseLeave: event => {},
|
|
|
+ onContextMenu: event => {
|
|
|
+ },
|
|
|
+ onMouseEnter: event => {
|
|
|
+ }, // 鼠标移入行
|
|
|
+ onMouseLeave: event => {
|
|
|
+ },
|
|
|
};
|
|
|
}}
|
|
|
/>
|