Yansen hace 2 años
padre
commit
d3037fa3ec

+ 10
- 0
src/pages/check/index.jsx Ver fichero

@@ -12,6 +12,7 @@ export default (props) => {
12 12
 
13 13
   const navigate = useNavigate();
14 14
   const actionRef = React.useRef();
15
+  const [messageApi, contextHolder] = message.useMessage();
15 16
 
16 17
   const onDelete = (item) => {
17 18
     deleteTaCheck(item.checkId).then(() => {
@@ -26,8 +27,16 @@ export default (props) => {
26 27
   }
27 28
 
28 29
   const onCalc = (row) => {
30
+    messageApi.open({
31
+      type: 'loading',
32
+      content: '正在计算, 请稍候...',
33
+      duration: 0,
34
+    });
29 35
     calcScoreTaCheck(row.checkId).then(() => {
36
+      messageApi.destroy();
30 37
       actionRef.current.reload();
38
+    }).catch(() => {
39
+      messageApi.destroy();
31 40
     });
32 41
   }
33 42
 
@@ -126,6 +135,7 @@ export default (props) => {
126 135
 
127 136
   return (
128 137
     <Page>
138
+      {contextHolder}
129 139
       <ProTable
130 140
         actionRef={actionRef}
131 141
         rowKey="checkId"

+ 2
- 2
src/pages/home/components/AssignedCharts.jsx Ver fichero

@@ -1,10 +1,10 @@
1 1
 import React, { useState } from 'react';
2 2
 import { Card } from 'antd';
3 3
 import * as echarts from 'echarts/core';
4
-import RangeDate from './RangeDate';
5
-import * as dayjs from 'dayjs';
4
+import dayjs from 'dayjs';
6 5
 import Chart from '@/components/chart';
7 6
 import { getStatIssue } from "@/service/stat";
7
+import RangeDate from './RangeDate';
8 8
 
9 9
 export default React.forwardRef((props, ref) => {
10 10
   const [option, setOption] = useState({});

+ 2
- 6
src/pages/home/components/ProblemCharts.jsx Ver fichero

@@ -5,13 +5,10 @@ import Chart from '@/components/chart';
5 5
 import { getStatProblem } from "@/service/stat";
6 6
 
7 7
 export default (props) => {
8
-
9 8
   const [option, setOption] = useState({});
10
-  console.log('---------->', option)
11 9
 
12 10
   React.useEffect(() => {
13 11
     getStatProblem().then((res) => {
14
-      console.log('====================>', res.map(x => x.name))
15 12
       setOption({
16 13
         tooltip: {
17 14
           trigger: 'axis',
@@ -62,9 +59,8 @@ export default (props) => {
62 59
           }
63 60
         ]
64 61
       });
65
-    });
66
-  }, [0]);
67
-
62
+    }).catch(console.error);
63
+  }, []);
68 64
 
69 65
   return (
70 66
     <Card title="问题分类">

+ 1
- 1
src/pages/home/components/RangeDate.jsx Ver fichero

@@ -1,6 +1,6 @@
1 1
 import React, { useState } from 'react';
2 2
 import { Radio, DatePicker, Button } from 'antd';
3
-import * as dayjs from 'dayjs';
3
+import dayjs from 'dayjs';
4 4
 // import * as isLeapYear from 'dayjs/plugin/isLeapYear' // 导入插件
5 5
 // import 'dayjs/locale/zh-cn' // 导入本地化语言
6 6