Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
bkunyun
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
bkunyun
Commits
2fccb697
Commit
2fccb697
authored
Aug 23, 2022
by
wuyongsheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加当前用户项目缓存
parent
e9493716
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
17 deletions
+32
-17
currentProject.ts
src/store/modules/currentProject.ts
+28
-12
index.tsx
src/views/Project/ProjectData/SeeDataset/index.tsx
+1
-1
index.tsx
...ct/components/Flow/components/BatchOperatorFlow/index.tsx
+0
-1
index.tsx
src/views/Project/components/Flow/index.tsx
+3
-3
No files found.
src/store/modules/currentProject.ts
View file @
2fccb697
/*
* @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
session
StorageCurrentProductInfo
=
JSON
.
parse
(
sessionStorage
.
getItem
(
"currentProductInfo"
)
||
"{}"
const
local
StorageCurrentProductInfo
=
JSON
.
parse
(
localStorage
.
getItem
(
`currentProductInfo_
${
userInfo
.
name
}
`
)
||
"{}"
);
const
session
StorageProjectList
=
JSON
.
parse
(
sessionStorage
.
getItem
(
"projectList"
)
||
"[]"
const
local
StorageProjectList
=
JSON
.
parse
(
localStorage
.
getItem
(
`projectList_
${
userInfo
.
name
}
`
)
||
"[]"
);
class
currentProject
{
...
...
@@ -28,22 +44,22 @@ class currentProject {
}
// 选中的项目
currentProjectInfo
:
projectInfo
=
session
StorageCurrentProjectInfo
;
currentProjectInfo
:
projectInfo
=
local
StorageCurrentProjectInfo
;
// 选中的产品下的项目列表
projectList
:
Array
<
projectInfo
>
=
session
StorageProjectList
;
projectList
:
Array
<
projectInfo
>
=
local
StorageProjectList
;
// 选中的产品
currentProductInfo
:
productInfo
=
session
StorageCurrentProductInfo
;
currentProductInfo
:
productInfo
=
local
StorageCurrentProductInfo
;
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
));
};
}
...
...
src/views/Project/ProjectData/SeeDataset/index.tsx
View file @
2fccb697
...
...
@@ -125,7 +125,7 @@ const SeeDataset = observer((props: ISeeDatasetProps) => {
"sdf"
,
"sdf2d"
,
"sdf3d"
,
"smiles"
,
//
"smiles",
].
includes
(
item
)
)
{
arr
.
push
({
label
:
item
,
value
:
item
});
...
...
src/views/Project/components/Flow/components/BatchOperatorFlow/index.tsx
View file @
2fccb697
...
...
@@ -50,7 +50,6 @@ const BatchOperatorFlow = (props: IProps) => {
showVersion
=
false
,
...
other
}
=
props
;
console
.
log
(
tasks
);
/** 自定义的节点类型 */
const
nodeTypes
=
useMemo
(()
=>
{
return
{
batchNode
:
BatchNode
,
flowNode
:
FlowNode
};
...
...
src/views/Project/components/Flow/index.tsx
View file @
2fccb697
...
...
@@ -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);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment