Commit 47834f23 authored by wuyongsheng's avatar wuyongsheng

Merge branch 'feat-20220801' into 'staging'

Feat 20220801

See merge request !71
parents 5b01ddce f1521f2d
/*
* @Author: 吴永生 15770852798@163.com
* @Date: 2022-07-11 11:49:55
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-08-23 16:46:45
* @FilePath: /bkunyun/src/store/modules/currentProject.ts
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import { makeAutoObservable } from "mobx";
type projectInfo = {
id?: string;
......@@ -12,14 +20,22 @@ type productInfo = {
name?: string;
};
const sessionStorageCurrentProjectInfo = JSON.parse(
sessionStorage.getItem("currentProjectInfo") || "{}"
/** 用户信息 */
let userInfo: any;
try {
userInfo = JSON.parse(localStorage.getItem("userInfo") || "{}");
} catch {
console.error("获取用户信息 出错");
}
const localStorageCurrentProjectInfo = JSON.parse(
localStorage.getItem(`currentProjectInfo_${userInfo.name}`) || "{}"
);
const sessionStorageCurrentProductInfo = JSON.parse(
sessionStorage.getItem("currentProductInfo") || "{}"
const localStorageCurrentProductInfo = JSON.parse(
localStorage.getItem(`currentProductInfo_${userInfo.name}`) || "{}"
);
const sessionStorageProjectList = JSON.parse(
sessionStorage.getItem("projectList") || "[]"
const localStorageProjectList = JSON.parse(
localStorage.getItem(`projectList_${userInfo.name}`) || "[]"
);
class currentProject {
......@@ -28,22 +44,22 @@ class currentProject {
}
// 选中的项目
currentProjectInfo: projectInfo = sessionStorageCurrentProjectInfo;
currentProjectInfo: projectInfo = localStorageCurrentProjectInfo;
// 选中的产品下的项目列表
projectList: Array<projectInfo> = sessionStorageProjectList;
projectList: Array<projectInfo> = localStorageProjectList;
// 选中的产品
currentProductInfo: productInfo = sessionStorageCurrentProductInfo;
currentProductInfo: productInfo = localStorageCurrentProductInfo;
setProjectList = (list: Array<projectInfo>) => {
this.projectList = list;
sessionStorage.setItem("projectList", JSON.stringify(list));
localStorage.setItem(`projectList_${userInfo.name}`, JSON.stringify(list));
};
changeProject = (project: projectInfo) => {
this.currentProjectInfo = project;
sessionStorage.setItem("currentProjectInfo", JSON.stringify(project));
localStorage.setItem(`currentProjectInfo_${userInfo.name}`, JSON.stringify(project));
};
changeProductInfo = (productInfo: productInfo) => {
this.currentProductInfo = productInfo;
sessionStorage.setItem("currentProductInfo", JSON.stringify(productInfo));
localStorage.setItem(`currentProductInfo_${userInfo.name}`, JSON.stringify(productInfo));
};
}
......
/*
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-06-07 18:37:53
* @LastEditors: 吴永生#A02208 yongsheng.wu@wholion.com
* @LastEditTime: 2022-06-15 17:49:27
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-08-23 11:19:11
* @FilePath: /bkunyun/src/utils/util.ts
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -67,7 +67,7 @@ export const getTokenInfo = () => {
return val;
};
const IsNumberLetterChineseReg = new RegExp("^[A-Za-z0-9\u4e00-\u9fa5]+$");
const IsNumberLetterChineseReg = new RegExp("^[A-Za-z0-9\u4e00-\u9fa5]{1,50}$");
export const checkIsNumberLetterChinese = (string: string) => {
return IsNumberLetterChineseReg.test(string);
......
......@@ -21,7 +21,7 @@ const CustomOperator = observer((props: IProps) => {
const Message = useMessage();
const [operatorList, setOperatorList] = useState<ITask[]>(initOperatorList);
const [saveFormDialog, setSaveFormDialog] = useState(false);
const [inputActive, setInputActive] = useState(true);
const [inputActive, setInputActive] = useState(false);
// const [showCustomOperator, setShowCustomOperator] = useState(false);
/** 设置选中唯一标识符 */
......
......@@ -125,7 +125,7 @@ const SeeDataset = observer((props: ISeeDatasetProps) => {
"sdf",
"sdf2d",
"sdf3d",
"smiles",
// "smiles",
].includes(item)
) {
arr.push({ label: item, value: item });
......
......@@ -75,7 +75,7 @@
font-size: 14px;
}
.outputItemName{
max-width: 190px;
max-width: 172px;
white-space: nowrap;
display: block;
overflow: hidden;
......
......@@ -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
};
/** 根据批节点 判断是否在同一个批 */
......
......@@ -50,7 +50,6 @@ const BatchOperatorFlow = (props: IProps) => {
showVersion = false,
...other
} = props;
console.log(tasks);
/** 自定义的节点类型 */
const nodeTypes = useMemo(() => {
return { batchNode: BatchNode, flowNode: FlowNode };
......@@ -235,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);
......@@ -368,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"
? {
......
......@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-07-12 11:29:46
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-08-22 16:47:06
* @LastEditTime: 2022-08-22 19:16:06
* @FilePath: /bkunyun/src/views/Project/components/Flow/components/FlowNode/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -98,7 +98,7 @@ const FlowNode = (props: any) => {
);
})
: null}
<div>
<div style={{display: 'flex', alignItems: 'center'}}>
<span style={{fontSize: '12px', lineHeight: '24px'}}>{title || ""} {showVersion && version}</span>
{flowType !== "edit" && isCheck ? (
<span className={styles.successDot}></span>
......
......@@ -11,7 +11,7 @@ import ReactFlow, {
import { useCallback, useEffect, useMemo, useState } from "react";
import { uuid } from "@/utils/util";
import { IEdge, IParameter, ITask } from "../../ProjectSubmitWork/interface";
import { IParameter, ITask } from "../../ProjectSubmitWork/interface";
import { ILine } from "./interface";
import BatchNode from "./components/BatchNode";
import FlowNode from "./components/FlowNode";
......@@ -61,7 +61,7 @@ const Flow = (props: IProps) => {
showControls = true,
...other
} = props;
console.log(tasks);
/** 自定义的节点类型 */
const nodeTypes = useMemo(() => {
return { batchNode: BatchNode, flowNode: FlowNode };
......@@ -221,7 +221,7 @@ const Flow = (props: IProps) => {
// const nodesInputAndOutputStatus = useCallback(
// (id: string) => {
// /** 所有的连线 */
// const lineArr: IEdge[] = [];
// const lineArr: ] = [];
// tasks?.length &&
// tasks.forEach((item) => {
// item.edges?.length && lineArr.push(...item.edges);
......@@ -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"
? {
......
/*
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-07-15 15:47:16
* @LastEditors: 吴永生#A02208 yongsheng.wu@wholion.com
* @LastEditTime: 2022-07-15 16:30:59
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-08-23 11:32:19
* @FilePath: /bkunyun/src/views/WorkFlowEdit/components/SaveCustomTemplate/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -107,7 +107,7 @@ const SaveCustomTemplate = (props: IProps) => {
helperText: "必须输入模板名称",
});
return false;
} else if (title.length > 15) {
} else if (title.length > 50) {
setTitleHelper({
error: true,
helperText: "格式不正确,必须在15字符以内,仅限大小写字母、数字、中文",
......
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