张延森 4 years ago
parent
commit
df94a46d52
2 changed files with 12 additions and 23 deletions
  1. 4
    5
      src/pages/Student/Student/Edit/index.jsx
  2. 8
    18
      src/pages/Student/Student/List/index.jsx

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

@@ -1,11 +1,11 @@
1 1
 import React, { useEffect, useState } from 'react';
2
-import { connect, history } from 'umi';
2
+import { history } from 'umi';
3 3
 import { PageContainer } from '@ant-design/pro-layout';
4 4
 import Container from '@/components/Container';
5 5
 import request from '@/utils/request';
6 6
 import { notification, Card, Descriptions, Divider, Image, Button } from 'antd';
7 7
 
8
-const BannerEdit = (props) => {
8
+const StudentEdit = (props) => {
9 9
   const { id } = props.location.query;
10 10
   const [loading, setLoading] = useState(false);
11 11
   const [data, setData] = useState({});
@@ -13,7 +13,7 @@ const BannerEdit = (props) => {
13 13
   useEffect(() => {
14 14
     if (id) {
15 15
       setLoading(true);
16
-      request(`/person/${id}`)
16
+      request(`/student/${id}`)
17 17
         .then((res) => {
18 18
           setData(res);
19 19
           setLoading(false);
@@ -47,7 +47,6 @@ const BannerEdit = (props) => {
47 47
               <Descriptions.Item label="姓名">{data.name}</Descriptions.Item>
48 48
               <Descriptions.Item label="性别">{data.sex === 1 ? '男':'女'}</Descriptions.Item>
49 49
               <Descriptions.Item label="积分">{data.personData?.pointNum}</Descriptions.Item>
50
-              <Descriptions.Item label="微信昵称">{data.nickName}</Descriptions.Item>
51 50
               <Descriptions.Item label="联系方式">{data.phone}</Descriptions.Item>
52 51
               <Descriptions.Item label="邮箱">{data.email}</Descriptions.Item>
53 52
             </Descriptions>
@@ -66,4 +65,4 @@ const BannerEdit = (props) => {
66 65
   );
67 66
 };
68 67
 
69
-export default connect(() => ({}))(BannerEdit);
68
+export default StudentEdit;

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

@@ -1,5 +1,5 @@
1 1
 import React, { useCallback } from 'react';
2
-import { connect, history } from 'umi';
2
+import { history } from 'umi';
3 3
 import { Space } from 'antd';
4 4
 import { PageContainer } from '@ant-design/pro-layout';
5 5
 import ProTable from '@ant-design/pro-table';
@@ -17,7 +17,7 @@ const StudentList = () => {
17 17
   const columns = [
18 18
     {
19 19
       title: '编号',
20
-      dataIndex: 'personId',
20
+      dataIndex: 'studentId',
21 21
       align: 'center',
22 22
       width: 300,
23 23
       hideInSearch: true,
@@ -27,12 +27,6 @@ const StudentList = () => {
27 27
       dataIndex: 'name',
28 28
       align: 'center',
29 29
     },
30
-    {
31
-      title: '微信昵称',
32
-      dataIndex: 'nickName',
33
-      align: 'center',
34
-      hideInSearch: true,
35
-    },
36 30
     {
37 31
       title: '联系方式',
38 32
       dataIndex: 'phone',
@@ -68,7 +62,7 @@ const StudentList = () => {
68 62
       hideInSearch: true,
69 63
       render: (text, record) => (
70 64
         <Space size="middle">
71
-          <a onClick={() => handleStudentClick(record.personId)}>用户详情 </a>
65
+          <a onClick={() => handleStudentClick(record.studentId)}>用户详情 </a>
72 66
         </Space>
73 67
       ),
74 68
     },
@@ -78,17 +72,13 @@ const StudentList = () => {
78 72
     <PageContainer>
79 73
       <ProTable
80 74
         columns={columns}
81
-        request={queryTable('/person')}
82
-        rowKey="personId"
83
-        headerTitle="学校列表"
84
-        search={{
85
-          labelWidth: '4em',
86
-        }}
75
+        request={queryTable('/student')}
76
+        rowKey="studentId"
77
+        headerTitle="学生列表"
78
+        search={{ labelWidth: '4em' }}
87 79
       />
88 80
     </PageContainer>
89 81
   );
90 82
 };
91 83
 
92
-export default connect((s) => ({
93
-  typeList: s.post.typeList,
94
-}))(StudentList);
84
+export default StudentList;