Merge pull request #140 from SuanmoSuanyangTechnology/fix/web_zy
Fix/web zy
This commit is contained in:
@@ -13,7 +13,7 @@ const { Content } = Layout;
|
|||||||
|
|
||||||
// 认证布局组件,使用useRouteGuard hook进行路由鉴权
|
// 认证布局组件,使用useRouteGuard hook进行路由鉴权
|
||||||
const AuthLayout: FC = () => {
|
const AuthLayout: FC = () => {
|
||||||
const { getUserInfo, getStorageType } = useUser();
|
const { getUserInfo } = useUser();
|
||||||
// 使用路由守卫hook处理认证和权限检查
|
// 使用路由守卫hook处理认证和权限检查
|
||||||
useRouteGuard('manage');
|
useRouteGuard('manage');
|
||||||
// 自动更新面包屑导航
|
// 自动更新面包屑导航
|
||||||
@@ -24,7 +24,6 @@ const AuthLayout: FC = () => {
|
|||||||
window.location.href = `/#/login`;
|
window.location.href = `/#/login`;
|
||||||
} else {
|
} else {
|
||||||
getUserInfo()
|
getUserInfo()
|
||||||
getStorageType()
|
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
|||||||
@@ -67,8 +67,8 @@ const OrderDetail = forwardRef<OrderDetailRef, { getProductType: (type: string)
|
|||||||
onCancel={handleClose}
|
onCancel={handleClose}
|
||||||
width={1000}
|
width={1000}
|
||||||
>
|
>
|
||||||
<Descriptions title={t('pricing.orderInfo')} column={2} items={formatItems()} classNames={{ label: 'rb:w-40' }} />
|
<Descriptions title={t('pricing.orderInfo')} column={2} items={formatItems()} classNames={{ label: 'rb:w-50' }} />
|
||||||
<Descriptions title={t('pricing.orderPayInfo')} column={2} items={formatPayItems()} classNames={{ label: 'rb:w-40' }} className="rb:mt-6!" />
|
<Descriptions title={t('pricing.orderPayInfo')} column={2} items={formatPayItems()} classNames={{ label: 'rb:w-50' }} className="rb:mt-6!" />
|
||||||
</RbModal>
|
</RbModal>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -60,25 +60,23 @@ const InnerToolModal = forwardRef<InnerToolModalRef, InnerToolModalProps>(({
|
|||||||
...values.config,
|
...values.config,
|
||||||
}
|
}
|
||||||
} as any)
|
} as any)
|
||||||
.then(() => {
|
.then((res: any) => {
|
||||||
handleClose()
|
message.success(t('common.saveSuccess'));
|
||||||
message.success(t('common.saveSuccess'))
|
testConnection(res.tool_id || editVo?.id)
|
||||||
refreshTable()
|
.finally(() => {
|
||||||
|
setLoading(false);
|
||||||
|
handleClose();
|
||||||
|
refreshTable()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
setLoading(false);
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log('err', err)
|
console.log('err', err)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
const handleTestConnection = () => {
|
|
||||||
testConnection(editVo.id)
|
|
||||||
.then(() => {
|
|
||||||
message.success(t('tool.testConnectionSuccess'));
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
refreshTable()
|
|
||||||
})
|
|
||||||
};
|
|
||||||
|
|
||||||
// 暴露给父组件的方法
|
// 暴露给父组件的方法
|
||||||
useImperativeHandle(ref, () => ({
|
useImperativeHandle(ref, () => ({
|
||||||
@@ -91,12 +89,9 @@ const InnerToolModal = forwardRef<InnerToolModalRef, InnerToolModalProps>(({
|
|||||||
title={`${editVo.name} ${t('tool.config')}`}
|
title={`${editVo.name} ${t('tool.config')}`}
|
||||||
open={visible}
|
open={visible}
|
||||||
onCancel={handleClose}
|
onCancel={handleClose}
|
||||||
|
okText={t('tool.saveAndTest')}
|
||||||
|
onOk={handleSave}
|
||||||
confirmLoading={loading}
|
confirmLoading={loading}
|
||||||
footer={[
|
|
||||||
<Button onClick={handleClose}>{t('common.cancel')}</Button>,
|
|
||||||
<Button onClick={handleTestConnection}>{t('tool.textLink')}</Button>,
|
|
||||||
<Button type="primary" loading={loading} onClick={handleSave}>{t('common.save')}</Button>,
|
|
||||||
]}
|
|
||||||
>
|
>
|
||||||
{editVo?.config_data?.tool_class && config && <>
|
{editVo?.config_data?.tool_class && config && <>
|
||||||
<RbAlert className="rb:mb-3">
|
<RbAlert className="rb:mb-3">
|
||||||
|
|||||||
@@ -972,10 +972,10 @@ export const useWorkflowGraph = ({
|
|||||||
} else if (data.config[key] && 'defaultValue' in data.config[key] && key !== 'knowledge_retrieval') {
|
} else if (data.config[key] && 'defaultValue' in data.config[key] && key !== 'knowledge_retrieval') {
|
||||||
itemConfig[key] = data.config[key].defaultValue
|
itemConfig[key] = data.config[key].defaultValue
|
||||||
} else if (key === 'knowledge_retrieval' && data.config[key] && 'defaultValue' in data.config[key]) {
|
} else if (key === 'knowledge_retrieval' && data.config[key] && 'defaultValue' in data.config[key]) {
|
||||||
const { knowledge_bases } = data.config[key].defaultValue
|
const { knowledge_bases } = data.config[key].defaultValue || {}
|
||||||
itemConfig = {
|
itemConfig = {
|
||||||
...itemConfig,
|
...itemConfig,
|
||||||
...data.config[key].defaultValue,
|
...(data.config[key].defaultValue || {}),
|
||||||
knowledge_bases: knowledge_bases?.map((vo: any) => {
|
knowledge_bases: knowledge_bases?.map((vo: any) => {
|
||||||
const kb_config = vo.config || { similarity_threshold: vo.similarity_threshold, strategy: vo.strategy, top_k: vo.top_k, weight: vo.weight }
|
const kb_config = vo.config || { similarity_threshold: vo.similarity_threshold, strategy: vo.strategy, top_k: vo.top_k, weight: vo.weight }
|
||||||
return { kb_id: vo.kb_id || vo.id, ...kb_config, }
|
return { kb_id: vo.kb_id || vo.id, ...kb_config, }
|
||||||
|
|||||||
Reference in New Issue
Block a user