|
@@ -7,7 +7,7 @@ import UpdateForm from '@/pages/Memory/components/UpdateForm';
|
|
|
import {TableListItem} from '../MemoryList/data.d';
|
|
|
import service from './service';
|
|
|
import styles from './index.less';
|
|
|
-import {ExclamationCircleOutlined} from '@ant-design/icons/lib';
|
|
|
+import {DownOutlined, ExclamationCircleOutlined} from '@ant-design/icons/lib';
|
|
|
import {getRandom, getTextFromHtml} from "@/utils/utils";
|
|
|
|
|
|
enum Step {
|
|
@@ -24,6 +24,7 @@ interface State {
|
|
|
|
|
|
const TableList: React.FC<{}> = () => {
|
|
|
const [btnDisable, setBtnDisable] = useState(false);
|
|
|
+ const [showMore, setShowMore] = useState(false);
|
|
|
let counting = false;
|
|
|
|
|
|
const {confirm} = Modal;
|
|
@@ -245,84 +246,82 @@ const TableList: React.FC<{}> = () => {
|
|
|
简单
|
|
|
</Button>
|
|
|
<span> </span>
|
|
|
- <Button
|
|
|
- type="primary"
|
|
|
- disabled={btnDisable}
|
|
|
- onClick={async () => {
|
|
|
- setBtnDisable(true);
|
|
|
- memoryRes(await service.delay(memory));
|
|
|
- }}
|
|
|
- >
|
|
|
- 搁置
|
|
|
- </Button>
|
|
|
- <p/>
|
|
|
- <div>
|
|
|
- <Button
|
|
|
- type="primary"
|
|
|
- disabled={btnDisable}
|
|
|
- onClick={async () => {
|
|
|
- setBtnDisable(true);
|
|
|
- memoryRes(await service.restart(memory));
|
|
|
- }}
|
|
|
- >
|
|
|
- 重新开始复习
|
|
|
- </Button>
|
|
|
- <span> </span>
|
|
|
- <Button
|
|
|
- type="primary"
|
|
|
- disabled={btnDisable}
|
|
|
- onClick={async () => {
|
|
|
- setBtnDisable(true);
|
|
|
- memoryRes(await service.noMemory(memory));
|
|
|
- }}
|
|
|
- >
|
|
|
- 不在复习
|
|
|
- </Button>
|
|
|
- <span> </span>
|
|
|
- <Button
|
|
|
- type="primary"
|
|
|
- disabled={btnDisable}
|
|
|
- onClick={async () => {
|
|
|
- confirm({
|
|
|
- title: '确定删除吗?',
|
|
|
- icon: <ExclamationCircleOutlined/>,
|
|
|
- content: '删除后无法恢复',
|
|
|
- okText: '确定',
|
|
|
- okType: 'danger',
|
|
|
- cancelText: '取消',
|
|
|
- async onOk() {
|
|
|
+
|
|
|
+ <Button type="text" onClick={() => {
|
|
|
+ setShowMore(!showMore);
|
|
|
+ }}><DownOutlined/></Button>
|
|
|
+ {showMore ? (
|
|
|
+ <div>
|
|
|
+ <p/>
|
|
|
+ <div>
|
|
|
+ <Button
|
|
|
+ type="primary"
|
|
|
+ disabled={btnDisable}
|
|
|
+ onClick={async () => {
|
|
|
+ setBtnDisable(true);
|
|
|
+ memoryRes(await service.delay(memory));
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 搁置
|
|
|
+ </Button>
|
|
|
+ <span> </span>
|
|
|
+ <Button
|
|
|
+ type="primary"
|
|
|
+ disabled={btnDisable}
|
|
|
+ onClick={async () => {
|
|
|
setBtnDisable(true);
|
|
|
- memoryRes(await service.delete(memory));
|
|
|
- },
|
|
|
- onCancel() {
|
|
|
- console.log('Cancel');
|
|
|
- },
|
|
|
- });
|
|
|
- }}
|
|
|
- >
|
|
|
- 删除
|
|
|
- </Button>
|
|
|
- </div>
|
|
|
- <p/>
|
|
|
- <div>
|
|
|
- <Button
|
|
|
- type="primary"
|
|
|
- onClick={() => {
|
|
|
- setState({step: Step.ADD});
|
|
|
- }}
|
|
|
- >
|
|
|
- 编辑
|
|
|
- </Button>
|
|
|
- <span> </span>
|
|
|
- <Button
|
|
|
- type="primary"
|
|
|
- onClick={() => {
|
|
|
- setState({step: Step.MAIN});
|
|
|
- }}
|
|
|
- >
|
|
|
- 关闭
|
|
|
- </Button>
|
|
|
- </div>
|
|
|
+ memoryRes(await service.restart(memory));
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 重新复习
|
|
|
+ </Button>
|
|
|
+ <span> </span>
|
|
|
+ <Button
|
|
|
+ type="primary"
|
|
|
+ disabled={btnDisable}
|
|
|
+ onClick={async () => {
|
|
|
+ confirm({
|
|
|
+ title: '确定删除吗?',
|
|
|
+ icon: <ExclamationCircleOutlined/>,
|
|
|
+ content: '删除后无法恢复',
|
|
|
+ okText: '确定',
|
|
|
+ okType: 'danger',
|
|
|
+ cancelText: '取消',
|
|
|
+ async onOk() {
|
|
|
+ setBtnDisable(true);
|
|
|
+ memoryRes(await service.delete(memory));
|
|
|
+ },
|
|
|
+ onCancel() {
|
|
|
+ console.log('Cancel');
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 删除
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ <p/>
|
|
|
+ <div>
|
|
|
+ <Button
|
|
|
+ type="primary"
|
|
|
+ onClick={() => {
|
|
|
+ setState({step: Step.ADD});
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 编辑
|
|
|
+ </Button>
|
|
|
+ <span> </span>
|
|
|
+ <Button
|
|
|
+ type="primary"
|
|
|
+ onClick={() => {
|
|
|
+ setState({step: Step.MAIN});
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 关闭
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ ) : null}
|
|
|
</div>
|
|
|
</div>
|
|
|
) : (
|