fix: 修复卡片、搜索跳转

This commit is contained in:
yuwenbinjie
2025-10-17 17:42:59 +08:00
parent 478773d022
commit b6c5b2ec30
6 changed files with 18 additions and 13 deletions

View File

@ -266,7 +266,7 @@ export const PluginPanel: React.FC<PluginPanelProps> = ({
}
if (auth_mode === PluginAuthMode.NeedInstalled) {
return (
<ActivatePopover id={id}>
<ActivatePopover id={productId}>
<Tag color="yellow" className="font-medium !py-2px !px-4px !h-20px">
</Tag>
@ -491,6 +491,7 @@ export const PluginPanel: React.FC<PluginPanelProps> = ({
data-testid="plugin-panel-item-pluginapi"
isAdded={isAdded}
pluginApi={api}
productId={productInfo?.id}
from={from}
auth_mode={auth_mode}
workflowNodes={

View File

@ -60,6 +60,7 @@ export interface PluginItemProps {
isLocalPlugin?: boolean;
connectors?: string[];
auth_mode?: PluginAuthMode;
productId?: string;
}
interface OverflowTagItem {
@ -81,8 +82,9 @@ export const PluginItem: React.FC<PluginItemProps> = ({
isLocalPlugin,
connectors,
auth_mode,
productId,
}) => {
const { name, desc, parameters, debug_example, plugin_id } = pluginApi;
const { name, desc, parameters, debug_example } = pluginApi;
const { exampleNode, doShowExample } = useViewExample();
const [isMouseIn, { setFalse, setTrue }] = useBoolean(false);
@ -225,7 +227,7 @@ export const PluginItem: React.FC<PluginItemProps> = ({
trigger={isDisabled ? 'hover' : 'custom'}
>
<ActivatePopover
id={plugin_id}
id={productId}
show={auth_mode === PluginAuthMode.NeedInstalled}
>
<UIButton

View File

@ -43,10 +43,11 @@ export const PluginCard: FC<PluginCardProps> = props => (
className={cls(styles.plugin, props.className)}
shadowMode="default"
onClick={() => {
window.open(
`https://www.coze.cn/store/plugin/${props?.meta_info?.id}`,
'_blank',
);
const url = props?.plugin_extra?.jump_saas_url;
if (url) {
window.open(url, '_blank');
}
}}
>
<div className={styles['plugin-wrapper']}>

View File

@ -117,7 +117,7 @@ export const RecommendItem = (props: RecommendItemProps) => {
'store_search_suggestion',
);
window.open(entityUrl);
window.open(entityUrl, '_blank');
};
useItemSelect({
...{ isSelected, ableKeyPressJump },
@ -130,9 +130,11 @@ export const RecommendItem = (props: RecommendItemProps) => {
search_word: inputValue,
action: 'click_results',
});
window.open(
// @ts-expect-error -- linter-disable-autofix
getEntityUrl(entityType, item?.meta_info?.id),
'_blank',
);
},
// @ts-expect-error -- linter-disable-autofix

View File

@ -66,7 +66,10 @@ export const getEntityUrl = (
const fromQuery = from ? `?from=${from}` : '';
switch (entityType) {
case ProductEntityType.Plugin:
return id ? `/explore/plugin/${id}${fromQuery}` : '/explore/plugin';
case ProductEntityType.SaasPlugin:
return id
? `https://www.coze.cn/store/plugin/${id}${fromQuery}`
: '/explore/plugin';
default:
return '#';
}

View File

@ -51,10 +51,6 @@ const getFilterOption = () => {
value: PAID_PLUGIN_VALUE,
text: I18n.t('only_show_paid_plugins'),
});
options.push({
value: LOCAL_PLUGIN_VALUE,
text: I18n.t('store_show_service_plugin'),
});
}
return options;
};