浏览代码

修复bug

v2.0
suomingxiang 2 天前
父节点
当前提交
41768e1408

二进制
public/images/title.png 查看文件


二进制
public/images/titlev1.png 查看文件


二进制
public/video/maps.mp4 查看文件


二进制
public/video/mapxl.mp4 查看文件


+ 7
- 6
src/pages/components/Header/Header.less 查看文件

23
             height: 54px;
23
             height: 54px;
24
             margin-right: 30px;
24
             margin-right: 30px;
25
             margin-top: 28px;
25
             margin-top: 28px;
26
-            margin-left: 192px;
26
+            margin-left: 360px;
27
         }
27
         }
28
         .title{
28
         .title{
29
-            width: 746px;
30
-            height: 60px;
31
-            margin-top: 34px;
29
+            width: 380px;
30
+            height: 74px;
31
+            margin-top: 22px;
32
+            margin-left: 20px;
32
         }
33
         }
33
         &::after{
34
         &::after{
34
             content: '';
35
             content: '';
35
             width: 2px;
36
             width: 2px;
36
             height: 64px;
37
             height: 64px;
37
             position: absolute;
38
             position: absolute;
38
-            left: 354px;
39
-            top: 25px;
39
+            left: 530px;
40
+            top: 27px;
40
             background-color: #606060;
41
             background-color: #606060;
41
         }
42
         }
42
     }
43
     }

+ 8
- 3
src/pages/components/Header/Header.tsx 查看文件

10
     return `${year}-${month}-${day}`;
10
     return `${year}-${month}-${day}`;
11
 };
11
 };
12
 
12
 
13
+const formatTime = (date: Date) => {
14
+    return date.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit', second: '2-digit' });
15
+};
13
 const Header: React.FC = () => {
16
 const Header: React.FC = () => {
14
     const [date,setDate] = useState<string>(formatDate(new Date()));
17
     const [date,setDate] = useState<string>(formatDate(new Date()));
15
-    const [time, setTime] = useState<Date>(new Date());
18
+    const [time, setTime] = useState<string>(formatTime(new Date()));
16
 
19
 
17
     useEffect(() => {
20
     useEffect(() => {
18
         const intervalId = setInterval(() => {
21
         const intervalId = setInterval(() => {
19
-            setTime(new Date());
22
+            const now = new Date()
23
+            setDate(formatDate(now)); // 更新日期
24
+            setTime(formatTime(now));
20
         }, 1000); // 每秒更新一次
25
         }, 1000); // 每秒更新一次
21
 
26
 
22
         // 清理定时器
27
         // 清理定时器
32
             <div className={styles.logo}><img src={logo} alt="" /></div>
37
             <div className={styles.logo}><img src={logo} alt="" /></div>
33
             <div className={styles.title}><img src={title} alt="" /></div>
38
             <div className={styles.title}><img src={title} alt="" /></div>
34
         </div>
39
         </div>
35
-        <div className={styles.time}>{date} {time.toLocaleTimeString()}</div>
40
+        <div className={styles.time}>{date} {time}</div>
36
     </div>
41
     </div>
37
   ); 
42
   ); 
38
 };
43
 };

+ 2
- 2
src/pages/index.tsx 查看文件

37
     getNumericalData,
37
     getNumericalData,
38
     getNumericalData2,
38
     getNumericalData2,
39
     getNumericalData3,
39
     getNumericalData3,
40
-} from '../services/chartApi';
41
-// } from '../services/chartStatic';
40
+// } from '../services/chartApi';
41
+} from '../services/chartStatic';
42
 import magnifierImg from '../../public/images/magnifier.png';
42
 import magnifierImg from '../../public/images/magnifier.png';
43
 import videoMask from '../../public/images/videoMask.png';
43
 import videoMask from '../../public/images/videoMask.png';
44
 import maps from '../../public/video/maps.mp4';
44
 import maps from '../../public/video/maps.mp4';

+ 29
- 0
src/services/chartStatic.ts 查看文件

102
         yearOrder :410240,
102
         yearOrder :410240,
103
     });
103
     });
104
 }
104
 }
105
+
106
+// 大屏数值数据
107
+export async function getNumericalData2 (){
108
+    return({
109
+        totalSalesAmount:24894,
110
+        totalOrder:4404824,
111
+        numberServicePersonnel:2583955,
112
+        numberAirborneCustomers:658879,
113
+        todaySalesVolume :1423253,
114
+        yearSalesVolume :122342,
115
+        todayOrder :1282,
116
+        yearOrder :410240,
117
+    });
118
+}
119
+
120
+
121
+// 大屏数值数据
122
+export async function getNumericalData3 (){
123
+    return({
124
+        totalSalesAmount:24894,
125
+        totalOrder:4404824,
126
+        numberServicePersonnel:2583955,
127
+        numberAirborneCustomers:658879,
128
+        todaySalesVolume :1423253,
129
+        yearSalesVolume :122342,
130
+        todayOrder :1282,
131
+        yearOrder :410240,
132
+    });
133
+}

正在加载...
取消
保存