|
@@ -1,21 +1,15 @@
|
1
|
|
-import React, { useEffect, useRef, useCallback, useState } from 'react';
|
|
1
|
+import React, { useRef, useCallback, useState } from 'react';
|
2
|
2
|
import { connect, history } from 'umi';
|
3
|
3
|
import { PageContainer } from '@ant-design/pro-layout';
|
4
|
4
|
import ProTable from '@ant-design/pro-table';
|
5
|
|
-import { PlusOutlined, MenuOutlined } from '@ant-design/icons';
|
|
5
|
+import { PlusOutlined } from '@ant-design/icons';
|
6
|
6
|
import { Button, Popconfirm, Image, Space, notification } from 'antd';
|
7
|
|
-import { sortableContainer, sortableElement, sortableHandle } from 'react-sortable-hoc';
|
8
|
7
|
import request, { queryTable } from '@/utils/request';
|
9
|
|
-import arrayMove from 'array-move';
|
10
|
8
|
|
11
|
|
-const SortableItem = sortableElement((props) => <tr {...props} />);
|
12
|
|
-const SortableContainer = sortableContainer((props) => <tbody {...props} />);
|
13
|
|
-
|
14
|
|
-const typeList = { post: '科普' };
|
15
|
9
|
// const stateList = { post: '科普' };
|
16
|
10
|
|
17
|
|
-const SchoolList = (props) => {
|
18
|
|
- const [loading, setLoading] = useState(false);
|
|
11
|
+const SchoolList = () => {
|
|
12
|
+ const [, setLoading] = useState(false);
|
19
|
13
|
|
20
|
14
|
const ref = useRef();
|
21
|
15
|
const handleSchoolClick = useCallback((id) => {
|
|
@@ -30,10 +24,9 @@ const SchoolList = (props) => {
|
30
|
24
|
|
31
|
25
|
const deleteSchoolClick = (id) => {
|
32
|
26
|
setLoading(true);
|
33
|
|
- console.log(ref, 'ref');
|
34
|
27
|
|
35
|
28
|
request(`/school/${id}`, { method: 'delete' })
|
36
|
|
- .then((res) => {
|
|
29
|
+ .then(() => {
|
37
|
30
|
notification.success({ message: '删除成功' });
|
38
|
31
|
ref.current.submit();
|
39
|
32
|
})
|