소스 검색

Merge branch 'dev1.0' of http://git.ycjcjy.com/civilized_city/pc-admin into dev1.0

lisenzhou 2 년 전
부모
커밋
411235b2f6

+ 10
- 0
src/pages/check/index.jsx 파일 보기

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

+ 1
- 1
src/pages/home/components/AssignedCharts.jsx 파일 보기

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

+ 2
- 6
src/pages/home/components/ProblemCharts.jsx 파일 보기

5
 import { getStatProblem } from "@/service/stat";
5
 import { getStatProblem } from "@/service/stat";
6
 
6
 
7
 export default (props) => {
7
 export default (props) => {
8
-
9
   const [option, setOption] = useState({});
8
   const [option, setOption] = useState({});
10
-  console.log('---------->', option)
11
 
9
 
12
   React.useEffect(() => {
10
   React.useEffect(() => {
13
     getStatProblem().then((res) => {
11
     getStatProblem().then((res) => {
14
-      console.log('====================>', res.map(x => x.name))
15
       setOption({
12
       setOption({
16
         tooltip: {
13
         tooltip: {
17
           trigger: 'axis',
14
           trigger: 'axis',
94
           // }
91
           // }
95
         ]
92
         ]
96
       });
93
       });
97
-    });
98
-  }, [0]);
99
-
94
+    }).catch(console.error);
95
+  }, []);
100
 
96
 
101
   return (
97
   return (
102
     <Card title="问题分类">
98
     <Card title="问题分类">

+ 1
- 1
src/pages/home/components/RangeDate.jsx 파일 보기

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