Commit f1521f2d authored by wuyongsheng's avatar wuyongsheng

fix: 自定义算子删除bug修复

parent 2fccb697
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com * @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-06-21 20:03:56 * @Date: 2022-06-21 20:03:56
* @LastEditors: 吴永生 15770852798@163.com * @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-08-22 16:22:29 * @LastEditTime: 2022-08-23 19:27:18
* @FilePath: /bkunyun/src/views/Project/ProjectSubmitWork/index.tsx * @FilePath: /bkunyun/src/views/Project/ProjectSubmitWork/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴永生 15770852798@163.com * @Author: 吴永生 15770852798@163.com
* @Date: 2022-08-15 15:03:10 * @Date: 2022-08-15 15:03:10
* @LastEditors: 吴永生 15770852798@163.com * @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-08-15 15:43:16 * @LastEditTime: 2022-08-23 19:39:21
* @FilePath: /bkunyun/src/views/Project/ProjectJobDetail/utils.ts * @FilePath: /bkunyun/src/views/Project/ProjectJobDetail/utils.ts
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
...@@ -26,13 +26,12 @@ export const getDatasetPath = (path: string) => { ...@@ -26,13 +26,12 @@ export const getDatasetPath = (path: string) => {
// 根据outputs的路径获取数据集的名称 // 根据outputs的路径获取数据集的名称
export const getDatasetName = (path: string) => { export const getDatasetName = (path: string) => {
let name = ""; let name='';
let nameIndex = path.indexOf("/.dataset/") + 10; const arr = path.split('/.dataset/');
const lastIndex = path.lastIndexOf("/"); if(arr.length === 2) {
if (nameIndex !== -1 && lastIndex !== -1) { name = arr[1]
name = path.slice(nameIndex, lastIndex);
} }
return name; return name
}; };
/** 根据批节点 判断是否在同一个批 */ /** 根据批节点 判断是否在同一个批 */
......
...@@ -234,9 +234,9 @@ const BatchOperatorFlow = (props: IProps) => { ...@@ -234,9 +234,9 @@ const BatchOperatorFlow = (props: IProps) => {
}; };
/** node节点 */ /** node节点 */
const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes); const [nodes, setNodes] = useNodesState(initialNodes);
/** 连线数组 */ /** 连线数组 */
const [edges, setEdges, onEdgesChange] = useEdgesState(initialEdges); const [edges, setEdges] = useEdgesState(initialEdges);
useEffect(() => { useEffect(() => {
setEdges(initialEdges); setEdges(initialEdges);
...@@ -367,6 +367,16 @@ const BatchOperatorFlow = (props: IProps) => { ...@@ -367,6 +367,16 @@ const BatchOperatorFlow = (props: IProps) => {
setInSideFlowNodeId(""); setInSideFlowNodeId("");
}, []); }, []);
const onNodesChange = (val: any)=>{
// 自定义change事件 不允许react flow组件本身删除事件
return
}
const onEdgesChange = (val: any) =>{
// 自定义change事件 不允许react flow组件本身删除事件
return;
}
const reactFlowParams = const reactFlowParams =
flowType === "edit" flowType === "edit"
? { ? {
......
...@@ -434,9 +434,9 @@ const Flow = (props: IProps) => { ...@@ -434,9 +434,9 @@ const Flow = (props: IProps) => {
}; };
/** node节点 */ /** node节点 */
const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes); const [nodes, setNodes] = useNodesState(initialNodes);
/** 连线数组 */ /** 连线数组 */
const [edges, setEdges, onEdgesChange] = useEdgesState(initialEdges); const [edges, setEdges] = useEdgesState(initialEdges);
useEffect(() => { useEffect(() => {
setEdges(initialEdges); setEdges(initialEdges);
...@@ -638,6 +638,16 @@ const Flow = (props: IProps) => { ...@@ -638,6 +638,16 @@ const Flow = (props: IProps) => {
[setSelectedBatchNodeId] [setSelectedBatchNodeId]
); );
const onNodesChange = (val: any)=>{
// 自定义change事件 不允许react flow组件本身删除事件
return
}
const onEdgesChange = (val: any) =>{
// 自定义change事件 不允许react flow组件本身删除事件
return;
}
const reactFlowParams = const reactFlowParams =
flowType === "edit" flowType === "edit"
? { ? {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment