zlisen 4 年之前
父節點
當前提交
bfe12416bc

+ 21
- 0
config/routes.js 查看文件

195
                     menuCode: 'report.student',
195
                     menuCode: 'report.student',
196
                     component: './Statistic/StudentData',
196
                     component: './Statistic/StudentData',
197
                   },
197
                   },
198
+                  {
199
+                    path: '/report/student/saveNum',
200
+                    name: '收藏记录',
201
+                    menuCode: 'report.student',
202
+                    component: './Statistic/SaveNum',
203
+                    hideInMenu: true,
204
+                  },
205
+                  {
206
+                    path: '/report/student/readedNum',
207
+                    name: '阅读记录',
208
+                    menuCode: 'report.student',
209
+                    component: './Statistic/ReadedNum',
210
+                    hideInMenu: true,
211
+                  },
212
+                  {
213
+                    path: '/report/student/pointNum',
214
+                    name: '积分记录',
215
+                    menuCode: 'report.student',
216
+                    component: './Statistic/PointNum',
217
+                    hideInMenu: true,
218
+                  },
198
                 ],
219
                 ],
199
               },
220
               },
200
               {
221
               {

+ 1
- 1
src/pages/Medical/Visit/List/index.jsx 查看文件

13
   const [school, setSchool] = useState({});
13
   const [school, setSchool] = useState({});
14
 
14
 
15
   const handleMedicalClick = (row) => {
15
   const handleMedicalClick = (row) => {
16
-    console.log(school, 'school');
16
+
17
     history.push(
17
     history.push(
18
       row
18
       row
19
         ? `/medical/visit/edit?id=${row?.serialNo}&schoolId=${row?.schoolId}`
19
         ? `/medical/visit/edit?id=${row?.serialNo}&schoolId=${row?.schoolId}`

+ 53
- 0
src/pages/Statistic/PointNum.jsx 查看文件

1
+import React from 'react';
2
+import { connect, history } from 'umi';
3
+import { Button } from 'antd';
4
+import { PageContainer } from '@ant-design/pro-layout';
5
+import ProTable from '@ant-design/pro-table';
6
+import { queryTable } from '@/utils/request';
7
+
8
+const SaveNum = () => {
9
+
10
+  const columns = [
11
+    {
12
+      title: '科普名称',
13
+      key: 'name',
14
+      dataIndex: 'name',
15
+    },
16
+    {
17
+      title: '积分',
18
+      key: 'point',
19
+      dataIndex: 'point',
20
+    },
21
+    {
22
+      title: '获取时间',
23
+      key: 'date',
24
+      dataIndex: 'date',
25
+      valueType: 'dateTime',
26
+    },
27
+  ];
28
+
29
+  return (
30
+    <PageContainer
31
+      header={{
32
+        extra: [
33
+          <Button key="1" onClick={() => history.go('-1')}>
34
+            返回
35
+          </Button>,
36
+        ],
37
+      }}
38
+    >
39
+      <ProTable
40
+        toolbar={{
41
+          title:<div><span>{'姓名'}</span><span style={{marginLeft: '30vw'}}>总积分:{}</span></div>,
42
+        }}
43
+        columns={columns}
44
+        search={false}
45
+        // request={queryTable('/statis/student-data')}
46
+        rowKey="personId"
47
+        options={false}
48
+      />
49
+    </PageContainer>
50
+  );
51
+};
52
+
53
+export default SaveNum

+ 7
- 1
src/pages/Statistic/PostData.jsx 查看文件

1
 import React, { useEffect, useMemo, useRef } from 'react';
1
 import React, { useEffect, useMemo, useRef } from 'react';
2
-import { connect } from 'umi';
2
+import { connect,history } from 'umi';
3
 import moment from 'moment';
3
 import moment from 'moment';
4
 import { PageContainer } from '@ant-design/pro-layout';
4
 import { PageContainer } from '@ant-design/pro-layout';
5
 import ProTable from '@ant-design/pro-table';
5
 import ProTable from '@ant-design/pro-table';
6
 import { queryTable } from '@/utils/request';
6
 import { queryTable } from '@/utils/request';
7
+import {Space} from 'antd'
7
 
8
 
8
 const PostData = (props) => {
9
 const PostData = (props) => {
9
   const tableRef = useRef()
10
   const tableRef = useRef()
78
       dataIndex: 'uv',
79
       dataIndex: 'uv',
79
       hideInSearch: true,
80
       hideInSearch: true,
80
       sorter: true,
81
       sorter: true,
82
+      render: (text, row) => (
83
+        <Space size="middle">
84
+          {text?<a onClick={() =>  history.push(`/report/student?postId=${row.postId}`)}>{text}</a>:0}
85
+        </Space>
86
+      ),
81
     },
87
     },
82
     {
88
     {
83
       title: '浏览量',
89
       title: '浏览量',

+ 58
- 0
src/pages/Statistic/ReadedNum.jsx 查看文件

1
+import React  from 'react';
2
+import { connect, history } from 'umi';
3
+import { Button } from 'antd';
4
+import { PageContainer } from '@ant-design/pro-layout';
5
+import ProTable from '@ant-design/pro-table';
6
+import request, { queryTable } from '@/utils/request';
7
+
8
+const ReadedNum = () => {
9
+
10
+  const columns = [
11
+    {
12
+      title: '科普名称',
13
+      key: 'name',
14
+      dataIndex: 'name',
15
+    },
16
+    {
17
+      title: '阅读时长',
18
+      key: 'name1',
19
+      dataIndex: 'name1',
20
+    },
21
+    {
22
+      title: '阅读进度',
23
+      key: 'name2',
24
+      dataIndex: 'name2',
25
+    },
26
+    {
27
+      title: '最后时间',
28
+      key: 'date',
29
+      dataIndex: 'date',
30
+      valueType: 'dateTime',
31
+    },
32
+  ];
33
+
34
+  return (
35
+    <PageContainer
36
+      header={{
37
+        extra: [
38
+          <Button key="1" onClick={() => history.go('-1')}>
39
+            返回
40
+          </Button>,
41
+        ],
42
+      }}
43
+    >
44
+      <ProTable
45
+        toolbar={{
46
+          title:<div><span>姓名</span><span style={{marginLeft: '30vw'}}>阅读量</span></div>
47
+        }}
48
+        columns={columns}
49
+        search={false}
50
+        // request={queryTable('/statis/student-data')}
51
+        rowKey="personId"
52
+        options={false}
53
+      />
54
+    </PageContainer>
55
+  );
56
+};
57
+
58
+export default ReadedNum

+ 51
- 0
src/pages/Statistic/SaveNum.jsx 查看文件

1
+import React from 'react';
2
+import { connect, history } from 'umi';
3
+import { Button } from 'antd';
4
+import { PageContainer } from '@ant-design/pro-layout';
5
+import ProTable from '@ant-design/pro-table';
6
+import request, { queryTable } from '@/utils/request';
7
+
8
+const SaveNum = () => {
9
+
10
+
11
+  const columns = [
12
+    {
13
+      title: '科普名称',
14
+      key: 'name',
15
+      dataIndex: 'name',
16
+    },
17
+    {
18
+      title: '收藏时间',
19
+      key: 'date',
20
+      dataIndex: 'date',
21
+      valueType: 'dateTime',
22
+    },
23
+  ];
24
+
25
+
26
+  return (
27
+    <PageContainer
28
+      header={{
29
+        extra: [
30
+          <Button key="1" onClick={() => history.go('-1')}>
31
+            返回
32
+          </Button>,
33
+        ],
34
+      }}
35
+    >
36
+      <ProTable
37
+        toolbar={{
38
+          title:<div><span>{'姓名'}</span><span style={{marginLeft: '30vw'}}>收藏数:{}</span></div>,
39
+          
40
+        }}
41
+        columns={columns}
42
+        search={false}
43
+        // request={queryTable('/statis/student-data')}
44
+        rowKey="personId"
45
+        options={false}
46
+      />
47
+    </PageContainer>
48
+  );
49
+};
50
+
51
+export default SaveNum

+ 61
- 3
src/pages/Statistic/StudentData.jsx 查看文件

1
 import React, { useEffect, useMemo, useRef, useState } from 'react';
1
 import React, { useEffect, useMemo, useRef, useState } from 'react';
2
-import { connect } from 'umi';
2
+import { connect, history } from 'umi';
3
+import {Space, Button} from 'antd'
3
 import { PageContainer } from '@ant-design/pro-layout';
4
 import { PageContainer } from '@ant-design/pro-layout';
4
 import ProTable from '@ant-design/pro-table';
5
 import ProTable from '@ant-design/pro-table';
5
 import request, { queryTable } from '@/utils/request';
6
 import request, { queryTable } from '@/utils/request';
6
 
7
 
7
-const StudentData = () => {
8
+const StudentData = (props) => {
9
+  const { postId } = props.location.query;
10
+
8
   const tableRef = useRef()
11
   const tableRef = useRef()
9
   const [schoolDict, setSchoolDict] = useState({})
12
   const [schoolDict, setSchoolDict] = useState({})
13
+  
14
+
15
+  const toSave =(row)=>{
16
+
17
+    if(row.savedNum>0){
18
+      history.push(`/report/student/savenum?schoolId=${row?.schoolId}&personId=${row.personId}`);
19
+     
20
+      
21
+    }
22
+
23
+  }
24
+
25
+  const toReade =(row)=>{
26
+
27
+    if(row.readedNum>0){
28
+      history.push(`/report/student/readednum?schoolId=${row?.schoolId}&personId=${row.personId}`);
29
+    }
30
+
31
+  }
32
+  const toPoint =(row)=>{
33
+
34
+    if(row.pointNum>0){
35
+      history.push(`/report/student/pointnum?schoolId=${row?.schoolId}&personId=${row.personId}`);
36
+    }
10
 
37
 
38
+  }
39
+  
11
   const columns = useMemo(() => [
40
   const columns = useMemo(() => [
12
     {
41
     {
13
       title: '排名',
42
       title: '排名',
39
       dataIndex: 'savedNum',
68
       dataIndex: 'savedNum',
40
       hideInSearch: true,
69
       hideInSearch: true,
41
       sorter: true,
70
       sorter: true,
71
+      render: (text, row) => (
72
+        <Space size="middle">
73
+          {text?<a onClick={() => toSave(row)}>{text}</a>:0}
74
+        </Space>
75
+      ),
42
     },
76
     },
43
     {
77
     {
44
       title: '阅读文章数',
78
       title: '阅读文章数',
46
       dataIndex: 'readedNum',
80
       dataIndex: 'readedNum',
47
       hideInSearch: true,
81
       hideInSearch: true,
48
       sorter: true,
82
       sorter: true,
83
+      render: (text, row) => (
84
+        <Space size="middle">
85
+          {text?<a onClick={() => toReade(row)}>{text}</a>:0}
86
+        </Space>
87
+      ),
49
     },
88
     },
50
     {
89
     {
51
       title: '总积分',
90
       title: '总积分',
53
       dataIndex: 'pointNum',
92
       dataIndex: 'pointNum',
54
       hideInSearch: true,
93
       hideInSearch: true,
55
       sorter: true,
94
       sorter: true,
95
+      render: (text, row) => (
96
+        <Space size="middle">
97
+          {text?<a onClick={() => toPoint(row)}>{text}</a>:0}
98
+        </Space>
99
+      ),
56
     },
100
     },
57
     {
101
     {
58
       title: '学分',
102
       title: '学分',
82
   }, [])
126
   }, [])
83
 
127
 
84
   return (
128
   return (
85
-    <PageContainer>
129
+    <PageContainer
130
+    header={{
131
+      extra: [
132
+        postId&&<Button key="1" onClick={() => history.go('-1')}>
133
+          返回
134
+        </Button>,
135
+      ],
136
+    }}>
86
       <ProTable
137
       <ProTable
87
         actionRef={tableRef}
138
         actionRef={tableRef}
88
         columns={columns}
139
         columns={columns}
140
+        params={{postId}}
89
         request={queryTable('/statis/student-data')}
141
         request={queryTable('/statis/student-data')}
90
         rowKey="personId"
142
         rowKey="personId"
91
         search={{
143
         search={{
92
           labelWidth: '4em',
144
           labelWidth: '4em',
145
+          defaultCollapsed: false,
146
+          optionRender: (searchConfig, formProps, dom) => [
147
+            ...dom.reverse(),
148
+            <Button key="out"  type="primary">导出</Button>,
149
+          ],
93
         }}
150
         }}
151
+       
94
         options={false}
152
         options={false}
95
       />
153
       />
96
     </PageContainer>
154
     </PageContainer>