Commit f1521f2d authored by wuyongsheng's avatar wuyongsheng

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

parent 2fccb697
......@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-06-21 20:03:56
* @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
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......
......@@ -2,7 +2,7 @@
* @Author: 吴永生 15770852798@163.com
* @Date: 2022-08-15 15:03:10
* @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
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -26,13 +26,12 @@ export const getDatasetPath = (path: string) => {
// 根据outputs的路径获取数据集的名称
export const getDatasetName = (path: string) => {
let name = "";
let nameIndex = path.indexOf("/.dataset/") + 10;
const lastIndex = path.lastIndexOf("/");
if (nameIndex !== -1 && lastIndex !== -1) {
name = path.slice(nameIndex, lastIndex);
let name='';
const arr = path.split('/.dataset/');
if(arr.length === 2) {
name = arr[1]
}
return name;
return name
};
/** 根据批节点 判断是否在同一个批 */
......
......@@ -234,9 +234,9 @@ const BatchOperatorFlow = (props: IProps) => {
};
/** node节点 */
const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes);
const [nodes, setNodes] = useNodesState(initialNodes);
/** 连线数组 */
const [edges, setEdges, onEdgesChange] = useEdgesState(initialEdges);
const [edges, setEdges] = useEdgesState(initialEdges);
useEffect(() => {
setEdges(initialEdges);
......@@ -367,6 +367,16 @@ const BatchOperatorFlow = (props: IProps) => {
setInSideFlowNodeId("");
}, []);
const onNodesChange = (val: any)=>{
// 自定义change事件 不允许react flow组件本身删除事件
return
}
const onEdgesChange = (val: any) =>{
// 自定义change事件 不允许react flow组件本身删除事件
return;
}
const reactFlowParams =
flowType === "edit"
? {
......
......@@ -434,9 +434,9 @@ const Flow = (props: IProps) => {
};
/** node节点 */
const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes);
const [nodes, setNodes] = useNodesState(initialNodes);
/** 连线数组 */
const [edges, setEdges, onEdgesChange] = useEdgesState(initialEdges);
const [edges, setEdges] = useEdgesState(initialEdges);
useEffect(() => {
setEdges(initialEdges);
......@@ -638,6 +638,16 @@ const Flow = (props: IProps) => {
[setSelectedBatchNodeId]
);
const onNodesChange = (val: any)=>{
// 自定义change事件 不允许react flow组件本身删除事件
return
}
const onEdgesChange = (val: any) =>{
// 自定义change事件 不允许react flow组件本身删除事件
return;
}
const reactFlowParams =
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