|
|
|
|
@ -7,15 +7,31 @@ const Option = Select.Option;
|
|
|
|
|
|
|
|
|
|
const ComponentCoding = () => {
|
|
|
|
|
const [serverUrl, setServerUrl] = useState('https://arco.design/vue/component/button');
|
|
|
|
|
const [localProjectPath, setLocalProjectPath] = useState('');
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
// 监听导航事件
|
|
|
|
|
const handleNavigateToTab = (event: CustomEvent) => {
|
|
|
|
|
if (event.detail.path === 'componentCoding' && event.detail.localProjectPath) {
|
|
|
|
|
setLocalProjectPath(event.detail.localProjectPath);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
document.addEventListener('navigateToTab', handleNavigateToTab as EventListener);
|
|
|
|
|
|
|
|
|
|
return () => {
|
|
|
|
|
document.removeEventListener('navigateToTab', handleNavigateToTab as EventListener);
|
|
|
|
|
};
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
const uri = process.env.NEXT_PUBLIC_DEV_CODE_SERVER_HOST;
|
|
|
|
|
const codeServerFolderPre = '/app/data';
|
|
|
|
|
const tempData = '/000000/admin_testcode1/master';
|
|
|
|
|
setServerUrl(`${uri}?folder=${codeServerFolderPre}${tempData}`);
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 使用传入的localProjectPath或默认值
|
|
|
|
|
const path = localProjectPath || '/000000/admin_testcode1/master';
|
|
|
|
|
setServerUrl(`${uri}?folder=${codeServerFolderPre}${path}`);
|
|
|
|
|
}, [localProjectPath]);
|
|
|
|
|
|
|
|
|
|
const componentScreening = () => {
|
|
|
|
|
// 将数据结构修改为级联结构
|
|
|
|
|
|