李志伟 3 anos atrás
pai
commit
797bf6a138
1 arquivos alterados com 44 adições e 3 exclusões
  1. 44
    3
      src/pages/Welcome.jsx

+ 44
- 3
src/pages/Welcome.jsx Ver arquivo

@@ -3,10 +3,16 @@ import { PageContainer } from '@ant-design/pro-layout';
3 3
 import { Card, Row, Col } from 'antd';
4 4
 import { useIntl } from 'umi';
5 5
 import WCard from '@/components/WelcomeCard'
6
+import { Swiper, SwiperSlide } from 'swiper/react';
7
+import { Autoplay } from 'swiper';
8
+import 'swiper/css';
6 9
 import Bar from '@/components/Bar/index.jsx';
7 10
 import Pie from '@/components/Pie';
8 11
 import PieArea from '@/components/PieArea';
12
+import { history } from 'umi';
13
+import { getDispatchList } from '@/services/dispatch'
9 14
 import './Welcome.less'
15
+import { useEffect } from 'react';
10 16
 
11 17
 const Welcome = () => {
12 18
   const intl = useIntl();
@@ -75,6 +81,15 @@ const Welcome = () => {
75 81
     { name: '农药机', value: 650 },
76 82
     { name: '其他', value: 180 },
77 83
   ]);
84
+  const [dispatchList, setDispatchList] = useState([])
85
+  const goDispatch = (val) => {
86
+    history.push(`../OrderManage/dispatch.jsx?id=${val.orderId}`);
87
+  }
88
+  useEffect(() => {
89
+    getDispatchList({ isWarn: true }).then((res) => {
90
+      setDispatchList(res.records)
91
+    })
92
+  }, [])
78 93
   return (
79 94
     <PageContainer>
80 95
       <div className="welcome">
@@ -94,10 +109,36 @@ const Welcome = () => {
94 109
             </Col>
95 110
           </Row>
96 111
         </div>
97
-        <Card style={{ marginTop: '32px' }}>
98
-          <Bar h='500px' title='本年度预约订单数据概览' opt={centerData} />
99
-        </Card>
100 112
 
113
+        <Row justify='space-between'>
114
+          <Col span={16}>
115
+            <Card style={{ marginTop: '32px' }}>
116
+              <Bar h='500px' title='本年度预约订单数据概览' opt={centerData} />
117
+            </Card>
118
+          </Col>
119
+          <Col span={7} >
120
+            <Card title='待调度订单' style={{ marginTop: '32px', height: '548px' }} >
121
+              <Swiper
122
+                height={60}
123
+                style={{ height: '448px' }}
124
+                autoplay={{
125
+                  delay: 1500,
126
+                  disableOnInteraction: false,
127
+                }}
128
+                loop
129
+                loopAdditionalSlides={8}
130
+                modules={[Autoplay]}
131
+                direction="vertical"
132
+              >
133
+                {dispatchList.map((item) => (
134
+                  <SwiperSlide key={item.orderId} onClick={() => goDispatch(item)}>
135
+                    {item.personName + ' 于 ' + item.createDate + ' 下了一单请您尽快处理!'}
136
+                  </SwiperSlide>
137
+                ))}
138
+              </Swiper>
139
+            </Card>
140
+          </Col>
141
+        </Row>
101 142
         <div className='flex bottom'>
102 143
           <Card className='flex-1 card'>
103 144
             <Bar h='300px' title='农机状态统计' opt={machineryStatus} />