|
|
@ -1,6 +1,6 @@ |
|
|
|
import { useState, useEffect } from "react"; |
|
|
|
import { Progress } from "antd"; |
|
|
|
import "./bluetooth.scss"; |
|
|
|
import "./sync.scss"; |
|
|
|
import { update } from "../services/ktj/org"; |
|
|
|
export default function SyncData(props:{isShowModal:boolean, closeModal:Function}) { |
|
|
|
//同步科天健基础数据
|
|
|
@ -22,7 +22,7 @@ export default function SyncData(props:{isShowModal:boolean, closeModal:Function |
|
|
|
useEffect(() => { |
|
|
|
const intervalId = setInterval(() => { |
|
|
|
if (percent < 100) { |
|
|
|
const randomIncrement = Math.floor(Math.random() * 5) + 1; |
|
|
|
const randomIncrement = Math.floor(Math.random() * 3) + 1; |
|
|
|
const newProgress = Math.min(percent + randomIncrement, 100); |
|
|
|
setPercent(newProgress); |
|
|
|
} else { |
|
|
@ -39,7 +39,7 @@ export default function SyncData(props:{isShowModal:boolean, closeModal:Function |
|
|
|
|
|
|
|
const styleObj:any = { |
|
|
|
position: "absolute", |
|
|
|
margintop: "-200px", |
|
|
|
marginTop: "-200px", |
|
|
|
color: "#0051b9", |
|
|
|
fontSize: "20px" |
|
|
|
} |
|
|
@ -48,11 +48,11 @@ export default function SyncData(props:{isShowModal:boolean, closeModal:Function |
|
|
|
<> |
|
|
|
|
|
|
|
<div |
|
|
|
className="fixed inset-0 bg-red opacity-50 z-50 cursor-pointer flex justify-center items-center" style={{background:"#efefef"}} |
|
|
|
className="fixed inset-0 bg-red opacity-50 z-50 cursor-pointer flex justify-center items-center" style={{background:"#202020"}} |
|
|
|
> |
|
|
|
<div className="flex w-[60vw] justify-center items-center margin-auto"> |
|
|
|
<div style={styleObj}>正在进行数据同步</div> |
|
|
|
<Progress type="circle" percent={percent} style={{color:"#3796e4"}}/> |
|
|
|
<div className="flex w-[60vw] justify-center items-center margin-auto"> |
|
|
|
<Progress type="circle" format={(percent) => <span style={{ color: '#0051b9' }}>{percent}%</span>} percent={percent}/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</> |
|
|
|