Commit 8a43ce98 authored by wuyongsheng's avatar wuyongsheng

fix: loading修改

parent b35fe90f
......@@ -15,6 +15,7 @@ type IMyCircularProgressProps = {
minHeight?: string;
maxHeight?: string;
zIndex?: number;
isBackground?: boolean;
};
const MyCircularProgress = (props: IMyCircularProgressProps) => {
......@@ -24,6 +25,7 @@ const MyCircularProgress = (props: IMyCircularProgressProps) => {
maxHeight = "100vh",
zIndex = "100",
children,
isBackground = true
} = props;
if (loading) {
if (children) {
......@@ -40,7 +42,7 @@ const MyCircularProgress = (props: IMyCircularProgressProps) => {
position: "absolute",
top: 0,
opacity: 0.6,
background: "#fff",
background: isBackground ? '#FFF': 'none',
zIndex: zIndex,
}}
></div>
......
......@@ -38,7 +38,7 @@ const LogView = (props: LogViewProps) => {
const [leftButtonColor, setLeftButtonColor] = useState("#585D62");
const [rightButtonColor, setRightButtonColor] = useState("#585D62");
const [logLoading, setLogLoading] = useState<boolean>(true)
const [logLoading, setLogLoading] = useState<boolean>(false)
useEffect(() => {
......@@ -47,6 +47,7 @@ const LogView = (props: LogViewProps) => {
// 请求日志文本
useEffect(() => {
setLogText("");
if (logPath) {
setLogLoading(true)
const path = logPath.slice(12);
......@@ -57,7 +58,7 @@ const LogView = (props: LogViewProps) => {
)?.then((res) => {
setLogText(res.data);
}).finally(()=>{
// setLogLoading(false)
setLogLoading(false)
});
} else {
setLogText("");
......@@ -185,7 +186,7 @@ const LogView = (props: LogViewProps) => {
<ChevronRightIcon />
</div>
</div>
<MyCircularProgress loading={logLoading} >
<MyCircularProgress loading={logLoading} isBackground={false}>
<div className={style.logViewContent}>{logText}</div>
<div className={style.logViewBottom}>
<MyButton text="下载当前日志" onClick={handleDownLoad} />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment