zlisen 4 years ago
parent
commit
f8a1e2bee7

+ 4
- 4
src/pages/Cms/Banner/List/index.jsx View File

@@ -1,4 +1,4 @@
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';
@@ -16,8 +16,8 @@ const SortableContainer = sortableContainer((props) => <tbody {...props} />);
16 16
 const typeList = { post: '科普' };
17 17
 // const stateList = { post: '科普' };
18 18
 
19
-const BannerList = (props) => {
20
-  const [loading, setLoading] = useState(false);
19
+const BannerList = () => {
20
+  const [, setLoading] = useState(false);
21 21
   const [dataSource, setDataSource] = useState([]);
22 22
   const ref = useRef();
23 23
   const handleBannerClick = useCallback((id) => {
@@ -35,7 +35,7 @@ const BannerList = (props) => {
35 35
     console.log(ref, 'ref');
36 36
 
37 37
     request(`/banner/${id}`, { method: 'delete' })
38
-      .then((res) => {
38
+      .then(() => {
39 39
         notification.success({ message: '删除成功' });
40 40
         ref.current.submit();
41 41
       })

+ 3
- 3
src/pages/Cms/Hot/Edit/index.jsx View File

@@ -4,7 +4,7 @@ import { PageContainer } from '@ant-design/pro-layout';
4 4
 import Container from '@/components/Container';
5 5
 import request from '@/utils/request';
6 6
 
7
-import ProForm, { ProFormText, ProFormSelect } from '@ant-design/pro-form';
7
+import ProForm, { ProFormSelect } from '@ant-design/pro-form';
8 8
 import UploadImage from '@/components/UploadImage';
9 9
 import { notification, Form } from 'antd';
10 10
 
@@ -36,7 +36,7 @@ const HotEdit = (props) => {
36 36
     if (!id) {
37 37
       setLoading(true);
38 38
       return request('/topic', { method: 'post', data: values })
39
-        .then((res) => {
39
+        .then(() => {
40 40
           // props.onChange(res)
41 41
           // form.setFieldsValue(res)
42 42
           notification.info({ message: '添加成功' });
@@ -138,4 +138,4 @@ const HotEdit = (props) => {
138 138
   );
139 139
 };
140 140
 
141
-export default connect((s) => ({}))(HotEdit);
141
+export default connect(() => ({}))(HotEdit);

+ 5
- 12
src/pages/Student/School/List/index.jsx View File

@@ -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
       })

+ 5
- 5
src/pages/Student/Student/List/index.jsx View File

@@ -1,4 +1,4 @@
1
-import React, { useEffect, useRef, useCallback, useState } from 'react';
1
+import React, { 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';
@@ -9,8 +9,8 @@ import request, { queryTable } from '@/utils/request';
9 9
 const typeList = { post: '科普' };
10 10
 // const stateList = { post: '科普' };
11 11
 
12
-const BannerList = (props) => {
13
-  const [loading, setLoading] = useState(false);
12
+const BannerList = () => {
13
+  const [, setLoading] = useState(false);
14 14
   const handleBannerClick = useCallback((id) => {
15 15
     history.push(id ? `/cms/banner/edit?id=${id}` : '/cms/banner/edit');
16 16
   }, []);
@@ -25,9 +25,9 @@ const BannerList = (props) => {
25 25
     setLoading(true);
26 26
 
27 27
     request(`/banner/${id}`, { method: 'delete' })
28
-      .then((res) => {
28
+      .then(() => {
29 29
         notification.success({ message: '删除成功' });
30
-        ref.current.submit();
30
+        // ref.current.submit();
31 31
       })
32 32
       .catch((e) => {
33 33
         setLoading(false);