feat(component-coding): 添加组件编码页面空状态显示

master
钟良源 2 weeks ago
parent e14b74fe33
commit 52d7edc08c

@ -1,6 +1,6 @@
import React, { useEffect, useState, useRef } from 'react'; import React, { useEffect, useState, useRef } from 'react';
import styles from './style/index.module.less'; import styles from './style/index.module.less';
import { Button, Select, Space, Message, Modal, Input } from '@arco-design/web-react'; import { Button, Select, Space, Message, Modal, Input, Empty } from '@arco-design/web-react';
import { IconFullscreen, IconFullscreenExit } from '@arco-design/web-react/icon'; import { IconFullscreen, IconFullscreenExit } from '@arco-design/web-react/icon';
import { useSelector, useDispatch } from 'react-redux'; import { useSelector, useDispatch } from 'react-redux';
import { getMyComponentList } from '@/api/componentBase'; import { getMyComponentList } from '@/api/componentBase';
@ -149,7 +149,8 @@ const ComponentCoding = () => {
const uri = getCodeServerUri(); const uri = getCodeServerUri();
// 使用传入的localProjectPath或默认值 // 使用传入的localProjectPath或默认值
const path = componentCoding.localProjectPath || '/000000/admin_testcode1/master'; const path = componentCoding.localProjectPath;
if (!path) return;
setServerUrl(`${uri}?folder=${codeServerFolderPre}${path}`); setServerUrl(`${uri}?folder=${codeServerFolderPre}${path}`);
}, [componentCoding]); }, [componentCoding]);
@ -267,7 +268,18 @@ const ComponentCoding = () => {
)} )}
</div> </div>
</div> </div>
{serverUrl ?
(
<iframe width="100%" height="100%" frameBorder={0} src={serverUrl} ref={iframeRef} /> <iframe width="100%" height="100%" frameBorder={0} src={serverUrl} ref={iframeRef} />
)
:
(
<div className={styles['empty-container']}>
<Empty
description="暂无组件编码,请选择需要编码的组件"
></Empty>
</div>
)}
</div> </div>

@ -52,5 +52,18 @@
} }
} }
} }
.empty-container {
display: flex;
align-content: center;
justify-content: center;
width: 100%;
height: 100%;
:global(.arco-empty) {
display: flex;
align-items: center;
}
}
} }
} }
Loading…
Cancel
Save