feat: 插件弹窗增加开关控制

This commit is contained in:
yuwenbinjie
2025-10-16 18:27:49 +08:00
committed by lijunwen.gigoo
parent fe003af0c4
commit c47ae0bfeb
4 changed files with 31 additions and 11 deletions

View File

@ -5332,6 +5332,12 @@ importers:
'@coze-common/assets':
specifier: workspace:*
version: link:../../common/assets
'@coze-studio/api-schema':
specifier: workspace:*
version: link:../../arch/api-schema
ahooks:
specifier: 3.7.8
version: 3.7.8(patch_hash=sa4ddrxdk2yhjzudeck6u5ww3i)(react@18.2.0)
classnames:
specifier: ^2.3.2
version: 2.5.1

View File

@ -21,6 +21,8 @@
"@coze-arch/coze-design": "0.0.6-alpha.346d77",
"@coze-arch/i18n": "workspace:*",
"@coze-common/assets": "workspace:*",
"@coze-studio/api-schema": "workspace:*",
"ahooks": "^3.7.8",
"classnames": "^2.3.2"
},
"devDependencies": {

View File

@ -13,8 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import classNames from 'classnames';
import { useRequest } from 'ahooks';
import { explore } from '@coze-studio/api-schema';
import { I18n } from '@coze-arch/i18n';
import { IconCozDesktopFill, IconCozCoze } from '@coze-arch/coze-design/icons';
import { useSpaceStore } from '@coze-arch/bot-studio-store';
@ -48,6 +49,12 @@ export const PluginFilter: React.FC<PluginFilterProps> = ({
}) => {
const spaceType = useSpaceStore(store => store.space.space_type);
const defaultId = getDefaultPluginCategory().id;
const { data: enableSaaSPlugin } = useRequest(async () => {
const res = await explore.PublicGetMarketPluginConfig({});
return res.data?.enable_saas_plugin || false;
});
const onChangeAfterDiff = (freshType: typeof type) => {
// If you are searching, leave the search blank
if (isSearching) {
@ -103,17 +110,19 @@ export const PluginFilter: React.FC<PluginFilterProps> = ({
</div>
</div>
<div className={s['tool-content-area']}>
<div
className={classNames(s['tool-tag-list-cell'], {
[s.active]: type === PluginFilterType.Coze,
})}
onClick={() => onChangeAfterDiff(PluginFilterType.Coze)}
>
<IconCozCoze className={s['tool-tag-list-cell-icon']} />
Coze.cn
{enableSaaSPlugin ? (
<div className={s['tool-content-area']}>
<div
className={classNames(s['tool-tag-list-cell'], {
[s.active]: type === PluginFilterType.Coze,
})}
onClick={() => onChangeAfterDiff(PluginFilterType.Coze)}
>
<IconCozCoze className={s['tool-tag-list-cell-icon']} />
Coze.cn
</div>
</div>
</div>
) : null}
</>
) : null}
</div>

View File

@ -12,6 +12,9 @@
"include": ["src"],
"exclude": ["node_modules", "dist"],
"references": [
{
"path": "../../arch/api-schema/tsconfig.build.json"
},
{
"path": "../../arch/bot-api/tsconfig.build.json"
},