import { Tabs, Breadcrumb, Space } from 'antd'; import React from 'react'; import { connect, history } from 'umi'; import ClassDataSourceTable from './ClassDataSourceTable'; import ClassDimensionTable from './ClassDimensionTable'; import ClassMetricTable from './ClassMetricTable'; import PermissionSection from './Permission/PermissionSection'; // import EntitySettingSection from './Entity/EntitySettingSection'; import ChatSettingSection from '../ChatSetting/ChatSettingSection'; import OverView from './OverView'; import styles from './style.less'; import type { StateType } from '../model'; import { HomeOutlined, FundViewOutlined } from '@ant-design/icons'; import { ISemantic } from '../data'; import SemanticGraphCanvas from '../SemanticGraphCanvas'; import RecommendedQuestionsSection from '../components/Entity/RecommendedQuestionsSection'; import DatabaseTable from '../components/Database/DatabaseTable'; import type { Dispatch } from 'umi'; type Props = { isModel: boolean; activeKey: string; modelList: ISemantic.IModelItem[]; handleModelChange: (model?: ISemantic.IModelItem) => void; onBackDomainBtnClick?: () => void; onMenuChange?: (menuKey: string) => void; domainManger: StateType; dispatch: Dispatch; }; const DomainManagerTab: React.FC = ({ isModel, activeKey, modelList, domainManger, handleModelChange, onBackDomainBtnClick, onMenuChange, }) => { const defaultTabKey = 'xflow'; const { selectDomainId, domainList, selectModelId, selectModelName, selectDomainName } = domainManger; const tabItem = [ { label: '模型管理', key: 'overview', children: ( { handleModelChange(model); }} /> ), }, { label: '权限管理', key: 'permissonSetting', children: , }, { label: '数据库管理', key: 'database', children: , }, ].filter((item) => { const target = domainList.find((domain) => domain.id === selectDomainId); if (target?.hasEditPermission) { return true; } return item.key !== 'permissonSetting'; }); const isModelItem = [ { label: '画布', key: 'xflow', children: (
), }, { label: '数据源', key: 'dataSource', children: , }, { label: '维度', key: 'dimenstion', children: , }, { label: '指标', key: 'metric', children: , }, // { // label: '实体', // key: 'entity', // children: , // }, { label: '权限管理', key: 'permissonSetting', children: , }, { label: '问答设置', key: 'chatSetting', children: , }, { label: '推荐问题', key: 'recommendedQuestions', children: , }, ].filter((item) => { if (window.RUNNING_ENV === 'semantic') { return !['chatSetting', 'recommendedQuestions'].includes(item.key); } return item; }); return ( <> { onBackDomainBtnClick?.(); }} style={selectModelName ? {} : { color: '#296df3', fontWeight: 'bold' }} > {selectDomainName} ), }, { type: 'separator', separator: selectModelName ? '/' : '', }, { title: selectModelName ? ( { history.push(`/model/${selectDomainId}/${selectModelId}/`); }} style={{ color: '#296df3' }} > {selectModelName} ) : undefined, }, ]} /> { onMenuChange?.(menuKey); }} /> ); }; export default connect(({ domainManger }: { domainManger: StateType }) => ({ domainManger, }))(DomainManagerTab);