李志伟 3 anni fa
parent
commit
cbbd8034f8
1 ha cambiato i file con 30 aggiunte e 19 eliminazioni
  1. 30
    19
      src/pages/Welcome.jsx

+ 30
- 19
src/pages/Welcome.jsx Vedi File

@@ -86,7 +86,7 @@ const Welcome = () => {
86 86
     history.push(`../OrderManage/dispatch.jsx?id=${val.orderId}`);
87 87
   }
88 88
   useEffect(() => {
89
-    getDispatchList({ isWarn: true }).then((res) => {
89
+    getDispatchList({ isWarn: true, pageSize: 500 }).then((res) => {
90 90
       setDispatchList(res.records)
91 91
     })
92 92
   }, [])
@@ -118,24 +118,35 @@ const Welcome = () => {
118 118
           </Col>
119 119
           <Col span={7} >
120 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>
121
+              {
122
+                dispatchList.length <= 8 ?
123
+                  <div style={{ height: '448px', width: '100%' }}>
124
+                    {dispatchList.map(item =>
125
+                      <div style={{ height: '60px' }} key={item.orderId} onClick={() => goDispatch(item)} >
126
+                        {item.personName + ' 于 ' + item.createDate + ' 下了一单请您尽快处理!'}
127
+                      </div>
128
+                    )}
129
+                  </div> :
130
+                  <Swiper
131
+                    height={60}
132
+                    style={{ height: '448px' }}
133
+                    autoplay={{
134
+                      delay: 1500,
135
+                      disableOnInteraction: false,
136
+                    }}
137
+                    loop
138
+                    loopAdditionalSlides={8}
139
+                    modules={[Autoplay]}
140
+                    direction="vertical"
141
+                  >
142
+                    {dispatchList.map((item) => (
143
+                      <SwiperSlide key={item.orderId} onClick={() => goDispatch(item)}>
144
+                        {item.personName + ' 于 ' + item.createDate + ' 下了一单请您尽快处理!'}
145
+                      </SwiperSlide>
146
+                    ))}
147
+                  </Swiper>
148
+              }
149
+
139 150
             </Card>
140 151
           </Col>
141 152
         </Row>