add secondary.tsx (#4946)

* add secondary.tsx

* fix

---------

Co-authored-by: dreamer6680 <146868355@qq.com>
This commit is contained in:
dreamer6680
2025-06-03 22:05:07 +08:00
committed by GitHub
parent 4adb8b7e6f
commit c1f8d5b032
2 changed files with 387 additions and 26 deletions

View File

@@ -9,7 +9,7 @@ import List from '@/pageComponents/dataset/list/List';
import { DatasetsContext } from './context';
import DatasetContextProvider from './context';
import { useContextSelector } from 'use-context-selector';
import MyMenu from '@fastgpt/web/components/common/MyMenu';
import MyMenu from '@fastgpt/web/components/common/MyMenu/secondary';
import { AddIcon } from '@chakra-ui/icons';
import { useUserStore } from '@/web/support/user/useUserStore';
import MyIcon from '@fastgpt/web/components/common/Icon';
@@ -169,31 +169,42 @@ const Dataset = () => {
{
children: [
{
icon: 'core/dataset/externalDatasetColor',
label: t('dataset:api_file'),
description: t('dataset:external_file_dataset_desc'),
onClick: () => onSelectDatasetType(DatasetTypeEnum.apiDataset)
},
...(feConfigs?.show_dataset_feishu !== false
? [
{
icon: 'core/dataset/feishuDatasetColor',
label: t('dataset:feishu_dataset'),
description: t('dataset:feishu_dataset_desc'),
onClick: () => onSelectDatasetType(DatasetTypeEnum.feishu)
}
]
: []),
...(feConfigs?.show_dataset_yuque !== false
? [
{
icon: 'core/dataset/yuqueDatasetColor',
label: t('dataset:yuque_dataset'),
description: t('dataset:yuque_dataset_desc'),
onClick: () => onSelectDatasetType(DatasetTypeEnum.yuque)
}
]
: [])
icon: 'core/dataset/otherDataset',
label: t('dataset:other_dataset'),
description: t('dataset:external_other_dataset_desc'),
menuList: [
{
children: [
{
icon: 'core/dataset/externalDatasetColor',
label: t('dataset:api_file'),
description: t('dataset:external_file_dataset_desc'),
onClick: () => onSelectDatasetType(DatasetTypeEnum.apiDataset)
},
...(feConfigs?.show_dataset_feishu !== false
? [
{
icon: 'core/dataset/feishuDatasetColor',
label: t('dataset:feishu_dataset'),
description: t('dataset:feishu_dataset_desc'),
onClick: () => onSelectDatasetType(DatasetTypeEnum.feishu)
}
]
: []),
...(feConfigs?.show_dataset_yuque !== false
? [
{
icon: 'core/dataset/yuqueDatasetColor',
label: t('dataset:yuque_dataset'),
description: t('dataset:yuque_dataset_desc'),
onClick: () => onSelectDatasetType(DatasetTypeEnum.yuque)
}
]
: [])
]
}
]
}
]
},
{