Commit 1107bce6 authored by wuyongsheng's avatar wuyongsheng

Merge branch 'feat-20221012-environment' into 'master'

fix: loading修改

See merge request !213
parents b35fe90f 8a43ce98
...@@ -15,6 +15,7 @@ type IMyCircularProgressProps = { ...@@ -15,6 +15,7 @@ type IMyCircularProgressProps = {
minHeight?: string; minHeight?: string;
maxHeight?: string; maxHeight?: string;
zIndex?: number; zIndex?: number;
isBackground?: boolean;
}; };
const MyCircularProgress = (props: IMyCircularProgressProps) => { const MyCircularProgress = (props: IMyCircularProgressProps) => {
...@@ -24,6 +25,7 @@ const MyCircularProgress = (props: IMyCircularProgressProps) => { ...@@ -24,6 +25,7 @@ const MyCircularProgress = (props: IMyCircularProgressProps) => {
maxHeight = "100vh", maxHeight = "100vh",
zIndex = "100", zIndex = "100",
children, children,
isBackground = true
} = props; } = props;
if (loading) { if (loading) {
if (children) { if (children) {
...@@ -40,7 +42,7 @@ const MyCircularProgress = (props: IMyCircularProgressProps) => { ...@@ -40,7 +42,7 @@ const MyCircularProgress = (props: IMyCircularProgressProps) => {
position: "absolute", position: "absolute",
top: 0, top: 0,
opacity: 0.6, opacity: 0.6,
background: "#fff", background: isBackground ? '#FFF': 'none',
zIndex: zIndex, zIndex: zIndex,
}} }}
></div> ></div>
......
...@@ -38,7 +38,7 @@ const LogView = (props: LogViewProps) => { ...@@ -38,7 +38,7 @@ const LogView = (props: LogViewProps) => {
const [leftButtonColor, setLeftButtonColor] = useState("#585D62"); const [leftButtonColor, setLeftButtonColor] = useState("#585D62");
const [rightButtonColor, setRightButtonColor] = useState("#585D62"); const [rightButtonColor, setRightButtonColor] = useState("#585D62");
const [logLoading, setLogLoading] = useState<boolean>(true) const [logLoading, setLogLoading] = useState<boolean>(false)
useEffect(() => { useEffect(() => {
...@@ -47,6 +47,7 @@ const LogView = (props: LogViewProps) => { ...@@ -47,6 +47,7 @@ const LogView = (props: LogViewProps) => {
// 请求日志文本 // 请求日志文本
useEffect(() => { useEffect(() => {
setLogText("");
if (logPath) { if (logPath) {
setLogLoading(true) setLogLoading(true)
const path = logPath.slice(12); const path = logPath.slice(12);
...@@ -57,7 +58,7 @@ const LogView = (props: LogViewProps) => { ...@@ -57,7 +58,7 @@ const LogView = (props: LogViewProps) => {
)?.then((res) => { )?.then((res) => {
setLogText(res.data); setLogText(res.data);
}).finally(()=>{ }).finally(()=>{
// setLogLoading(false) setLogLoading(false)
}); });
} else { } else {
setLogText(""); setLogText("");
...@@ -185,7 +186,7 @@ const LogView = (props: LogViewProps) => { ...@@ -185,7 +186,7 @@ const LogView = (props: LogViewProps) => {
<ChevronRightIcon /> <ChevronRightIcon />
</div> </div>
</div> </div>
<MyCircularProgress loading={logLoading} > <MyCircularProgress loading={logLoading} isBackground={false}>
<div className={style.logViewContent}>{logText}</div> <div className={style.logViewContent}>{logText}</div>
<div className={style.logViewBottom}> <div className={style.logViewBottom}>
<MyButton text="下载当前日志" onClick={handleDownLoad} /> <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