fix(web): left port not support add node
This commit is contained in:
@@ -77,13 +77,11 @@ const AddChatVariable = forwardRef<AddChatVariableRef, AddChatVariableProps>(({
|
|||||||
renderItem={(item, index) => (
|
renderItem={(item, index) => (
|
||||||
<List.Item>
|
<List.Item>
|
||||||
<div key={index} className="rb:relative rb:p-[12px_16px] rb:bg-[#FBFDFF] rb:cursor-pointer rb-border rb:rounded-lg">
|
<div key={index} className="rb:relative rb:p-[12px_16px] rb:bg-[#FBFDFF] rb:cursor-pointer rb-border rb:rounded-lg">
|
||||||
<Flex align="center" justify="space-between">
|
<Flex align="center" justify="space-between" className="rb:leading-4 rb:max-w-[calc(100%-60px)]">
|
||||||
<div className="rb:leading-4">
|
<div className="rb:flex-1 rb:font-medium rb:whitespace-break-spaces rb:wrap-break-word rb:line-clamp-1">{item.name}</div>
|
||||||
<span className="rb:font-medium">{item.name}</span>
|
<div className="rb:text-[12px] rb:text-[#5B6167] rb:font-regular"> ({t(`workflow.config.parameter-extractor.${item.type}`)})</div>
|
||||||
<span className="rb:text-[12px] rb:text-[#5B6167] rb:font-regular"> ({t(`workflow.config.parameter-extractor.${item.type}`)})</span>
|
|
||||||
</div>
|
|
||||||
</Flex>
|
</Flex>
|
||||||
<div className="rb:mt-1 rb:text-[12px] rb:text-[#5B6167] rb:font-regular rb:leading-5 rb:wrap-break-word rb:line-clamp-1">{item.description}</div>
|
<div className="rb:mt-1 rb:text-[12px] rb:text-[#5B6167] rb:font-regular rb:leading-5 rb:wrap-break-word rb:line-clamp-1 rb:max-w-[calc(100%-60px)]">{item.description}</div>
|
||||||
<Flex gap={12} className="rb:absolute rb:right-4 rb:top-[50%] rb:transform-[translateY(-50%)] rb:bg-white">
|
<Flex gap={12} className="rb:absolute rb:right-4 rb:top-[50%] rb:transform-[translateY(-50%)] rb:bg-white">
|
||||||
<div
|
<div
|
||||||
className="rb:size-5 rb:cursor-pointer rb:bg-cover rb:bg-[url('@/assets/images/editBorder.svg')] rb:hover:bg-[url('@/assets/images/editBg.svg')]"
|
className="rb:size-5 rb:cursor-pointer rb:bg-cover rb:bg-[url('@/assets/images/editBorder.svg')] rb:hover:bg-[url('@/assets/images/editBg.svg')]"
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ const VariableList: FC<VariableListProps> = ({
|
|||||||
className="rb:cursor-pointer rb:group rb:py-2! rb:pl-2.5! rb:pr-2! rb:text-[12px] rb:bg-[#F6F6F6] rb-border rb:rounded-lg"
|
className="rb:cursor-pointer rb:group rb:py-2! rb:pl-2.5! rb:pr-2! rb:text-[12px] rb:bg-[#F6F6F6] rb-border rb:rounded-lg"
|
||||||
onClick={() => handleEditVariable(index, vo)}
|
onClick={() => handleEditVariable(index, vo)}
|
||||||
>
|
>
|
||||||
<span className="rb:font-medium rb:flex-1">{vo.name}·{vo.description}</span>
|
<span className="rb:font-medium rb:flex-1 rb:whitespace-break-spaces rb:wrap-break-word rb:line-clamp-1">{vo.name}·{vo.description}</span>
|
||||||
|
|
||||||
<Space size={8}>
|
<Space size={8}>
|
||||||
{vo.required && <span className="rb:py-px rb:px-2 rb:bg-white rb-border rb:rounded-sm">{t('workflow.config.start.required')}</span>}
|
{vo.required && <span className="rb:py-px rb:px-2 rb:bg-white rb-border rb:rounded-sm">{t('workflow.config.start.required')}</span>}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: ZhaoYing
|
* @Author: ZhaoYing
|
||||||
* @Date: 2026-02-03 15:17:48
|
* @Date: 2026-02-03 15:17:48
|
||||||
* @Last Modified by: ZhaoYing
|
* @Last Modified by: ZhaoYing
|
||||||
* @Last Modified time: 2026-04-28 13:49:11
|
* @Last Modified time: 2026-05-06 14:30:46
|
||||||
*/
|
*/
|
||||||
import { Clipboard, Graph, Keyboard, MiniMap, Node, Snapline, History, type Edge } from '@antv/x6';
|
import { Clipboard, Graph, Keyboard, MiniMap, Node, Snapline, History, type Edge } from '@antv/x6';
|
||||||
import { register } from '@antv/x6-react-shape';
|
import { register } from '@antv/x6-react-shape';
|
||||||
@@ -990,6 +990,12 @@ export const useWorkflowGraph = ({
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const portElement = e.target as HTMLElement;
|
const portElement = e.target as HTMLElement;
|
||||||
const rect = portElement.getBoundingClientRect();
|
const rect = portElement.getBoundingClientRect();
|
||||||
|
const clickPort = node.getPorts().find(p => p.id === port)
|
||||||
|
const portGroup = clickPort?.group
|
||||||
|
|
||||||
|
if (portGroup === 'left') {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Create temporary popover trigger element
|
// Create temporary popover trigger element
|
||||||
const tempDiv = document.createElement('div');
|
const tempDiv = document.createElement('div');
|
||||||
|
|||||||
Reference in New Issue
Block a user