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