张延森 3 vuotta sitten
vanhempi
commit
d72f7666e4

+ 1
- 1
src/pages/dashboard/components/BannerStatis.jsx Näytä tiedosto

2
 import { history } from 'umi';
2
 import { history } from 'umi';
3
 import { Card, Row, Col } from 'antd'
3
 import { Card, Row, Col } from 'antd'
4
 import { AppstoreOutlined, MacCommandOutlined, TeamOutlined, UsergroupDeleteOutlined, UsergroupAddOutlined } from '@ant-design/icons'
4
 import { AppstoreOutlined, MacCommandOutlined, TeamOutlined, UsergroupDeleteOutlined, UsergroupAddOutlined } from '@ant-design/icons'
5
-import { getcomm } from '@/services/comm';
5
+import { getcomm } from '@/services/statis';
6
 import StatisCard from './StatisCard';
6
 import StatisCard from './StatisCard';
7
 import StatisGroup from './StatisGroup';
7
 import StatisGroup from './StatisGroup';
8
 
8
 

+ 3
- 3
src/pages/dashboard/components/OrgSummary.jsx Näytä tiedosto

1
 import { useEffect, useState, useCallback } from 'react';
1
 import { useEffect, useState, useCallback } from 'react';
2
 import Echart from '@/components/echart/echart'
2
 import Echart from '@/components/echart/echart'
3
 import { Card } from 'antd'
3
 import { Card } from 'antd'
4
-import { getList } from '@/services/org'
4
+import { getAllOrgPersonNum } from '@/services/statis'
5
 
5
 
6
 const barOption = {
6
 const barOption = {
7
   color: ['#08507b'],
7
   color: ['#08507b'],
83
   const queryList = useCallback(() => {
83
   const queryList = useCallback(() => {
84
     setLoading(true)
84
     setLoading(true)
85
 
85
 
86
-    getList({ pageSize: 500, qType: 'statis' }).then((res) => {
86
+    getAllOrgPersonNum().then((res) => {
87
       setLoading(false)
87
       setLoading(false)
88
-      setList((res.records || []).reverse())
88
+      setList((res || []).reverse())
89
     }).catch(err => {
89
     }).catch(err => {
90
       setLoading(false)
90
       setLoading(false)
91
     })
91
     })

+ 10
- 3
src/pages/dashboard/components/ReportList.jsx Näytä tiedosto

54
   )
54
   )
55
 }
55
 }
56
 
56
 
57
+const showNum = 8;
58
+
57
 export default (props) => {
59
 export default (props) => {
58
   const [loading, setLoading] = useState(false)
60
   const [loading, setLoading] = useState(false)
59
   const [list, setList] = useState([])
61
   const [list, setList] = useState([])
62
+  const [disabled, setDisabled] = useState(false)
60
 
63
 
61
   const queryList = useCallback(() => {
64
   const queryList = useCallback(() => {
62
     setLoading(true)
65
     setLoading(true)
78
     queryList()
81
     queryList()
79
   }, [])
82
   }, [])
80
 
83
 
84
+  useEffect(() => {
85
+    setDisabled(!list || list.length <= showNum)
86
+  }, [list])
87
+
81
   return (
88
   return (
82
     <Card title="今日提交记录" loading={loading} bodyStyle={{ height: '600px' }}>
89
     <Card title="今日提交记录" loading={loading} bodyStyle={{ height: '600px' }}>
83
       <List style={{ height: '100%', overflow: 'hidden' }} itemLayout="horizontal">
90
       <List style={{ height: '100%', overflow: 'hidden' }} itemLayout="horizontal">
84
         <Carousel
91
         <Carousel
85
-          autoplay
86
-          infinite
92
+          autoplay={!disabled}
93
+          infinite={!disabled}
87
           rtl
94
           rtl
88
-          slidesToShow={8}
95
+          slidesToShow={showNum}
89
           slidesToScroll={1}
96
           slidesToScroll={1}
90
           dot={false}
97
           dot={false}
91
           dotPosition="right"
98
           dotPosition="right"

src/services/comm.js → src/services/statis.js Näytä tiedosto

2
 
2
 
3
 // 获取首页卡片信息
3
 // 获取首页卡片信息
4
 export const getcomm = (params) => request('/statis/comm', { params });
4
 export const getcomm = (params) => request('/statis/comm', { params });
5
+
6
+// 获取企业信息汇总
7
+export const getAllOrgPersonNum = () => request('/statis/org/total');