瀏覽代碼

Merge branch 'dev' of http://git.ycjcjy.com/ubpa/pc-admin into dev

李志伟 3 年之前
父節點
當前提交
4a06d7a6c7

+ 1
- 1
src/pages/dashboard/components/BannerStatis.jsx 查看文件

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

+ 3
- 3
src/pages/dashboard/components/OrgSummary.jsx 查看文件

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

+ 10
- 3
src/pages/dashboard/components/ReportList.jsx 查看文件

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

src/services/comm.js → src/services/statis.js 查看文件

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