diff --git a/src/pages/componentDevelopment/componentDeployment/index.tsx b/src/pages/componentDevelopment/componentDeployment/index.tsx index f51f61f..0990a55 100644 --- a/src/pages/componentDevelopment/componentDeployment/index.tsx +++ b/src/pages/componentDevelopment/componentDeployment/index.tsx @@ -1,67 +1,82 @@ import React, { useState } from 'react'; import styles from './style/index.module.less'; -import { Button, Input, Radio, Space } from '@arco-design/web-react'; +import { Button, Input, Modal, Radio, Space } from '@arco-design/web-react'; import { IconSearch } from '@arco-design/web-react/icon'; import CollapseList from './collapseList'; import { startStatusConstant } from '@/const/isdp/componentDeploy'; +import ConfigTutorial from '@/pages/componentDevelopment/componentEnv/configTutorial'; const ComponentDeployment = () => { const [searchKeyword, setSearchKeyword] = useState(''); const [selectedStatus, setSelectedStatus] = useState(undefined); + const [tutorialVisible, setTutorialVisible] = useState(false); // 状态选项配置 const statusOptions = [ { label: '全部', value: undefined }, - { label: '启用中', value: "RUN" }, - { label: '已下架', value: "STOP" } + { label: '启用中', value: 'RUN' }, + { label: '已下架', value: 'STOP' } ]; return ( -
-
- setSelectedStatus(value)} - name="button-radio-group" - > - {statusOptions.map((item) => { - return ( - - {({ checked }) => { - return ( - - ); - }} - - ); - })} - - - - } - placeholder={'搜索'} - style={{ width: 236 }} - value={searchKeyword} - onChange={(value) => setSearchKeyword(value)} - onPressEnter={() => { - // 触发搜索 - }} - /> - - -
-
- + {statusOptions.map((item) => { + return ( + + {({ checked }) => { + return ( + + ); + }} + + ); + })} + + + + } + placeholder={'搜索'} + style={{ width: 236 }} + value={searchKeyword} + onChange={(value) => setSearchKeyword(value)} + onPressEnter={() => { + // 触发搜索 + }} + /> + + +
+
+ +
- + + setTutorialVisible(false)} + footer={null} + style={{ top: 20, width: '100%' }} + > + + + ); }; diff --git a/src/pages/componentDevelopment/componentEnv/configTutorial.tsx b/src/pages/componentDevelopment/componentEnv/configTutorial.tsx index 8c8b8cd..db17950 100644 --- a/src/pages/componentDevelopment/componentEnv/configTutorial.tsx +++ b/src/pages/componentDevelopment/componentEnv/configTutorial.tsx @@ -1,15 +1,24 @@ import React, { useEffect, useState } from 'react'; import ReactMarkdown from 'react-markdown'; -const ConfigTutorial = () => { +type tutorialTypeProps = { + tutorialType: 'env' | 'compInstance'; +}; + +const ConfigTutorial: React.FC = ({ tutorialType }) => { const [markdown, setMarkdown] = useState(''); useEffect(() => { - fetch('/assets/环境配置教程.md') + const fileMap = { + env: '/assets/环境配置教程.md', + compInstance: '/assets/组件实例指引.md' + }; + + fetch(fileMap[tutorialType]) .then(response => response.text()) .then(text => setMarkdown(text)) .catch(error => console.error('Error loading markdown file:', error)); - }, []); + }, [tutorialType]); return (
diff --git a/src/pages/componentDevelopment/componentEnv/envExtra.tsx b/src/pages/componentDevelopment/componentEnv/envExtra.tsx index 42989d3..56a46fa 100644 --- a/src/pages/componentDevelopment/componentEnv/envExtra.tsx +++ b/src/pages/componentDevelopment/componentEnv/envExtra.tsx @@ -155,7 +155,7 @@ const EnvExtra = ({ currentEnvData }) => { footer={null} style={{ top: 20, width: '100%' }} > - + );