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
a1ee678e
Commit
a1ee678e
authored
Jul 18, 2022
by
chenshouchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 修改组件文件目录结构 , 优化代码
parent
93c48fe7
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
3 additions
and
226 deletions
+3
-226
NoProject.module.css
...ponents/BusinessComponents/NoProject/NoProject.module.css
+0
-0
NoProject.tsx
src/components/BusinessComponents/NoProject/NoProject.tsx
+0
-0
index.ts
src/components/BusinessComponents/NoProject/index.ts
+0
-0
InformationDisplay.module.css
...mponents/InformationDisplay/InformationDisplay.module.css
+0
-0
InformationDisplay.tsx
...ommonComponents/InformationDisplay/InformationDisplay.tsx
+0
-0
index.ts
src/components/CommonComponents/InformationDisplay/index.ts
+0
-0
index.module.css
src/components/FileSelect/index.module.css
+0
-34
index.tsx
src/components/FileSelect/index.tsx
+0
-187
index.tsx
src/views/Project/ProjectData/index.tsx
+1
-2
index.tsx
src/views/Project/ProjectSetting/BaseInfo/index.tsx
+1
-1
index.tsx
src/views/Project/ProjectSetting/index.tsx
+1
-1
index.tsx
src/views/Project/components/Flow/index.tsx
+0
-1
No files found.
src/components/NoProject/NoProject.module.css
→
src/components/
BusinessComponents/
NoProject/NoProject.module.css
View file @
a1ee678e
File moved
src/components/NoProject/NoProject.tsx
→
src/components/
BusinessComponents/
NoProject/NoProject.tsx
View file @
a1ee678e
File moved
src/components/NoProject/index.ts
→
src/components/
BusinessComponents/
NoProject/index.ts
View file @
a1ee678e
File moved
src/components/InformationDisplay/InformationDisplay.module.css
→
src/components/
CommonComponents/
InformationDisplay/InformationDisplay.module.css
View file @
a1ee678e
File moved
src/components/InformationDisplay/InformationDisplay.tsx
→
src/components/
CommonComponents/
InformationDisplay/InformationDisplay.tsx
View file @
a1ee678e
File moved
src/components/InformationDisplay/index.ts
→
src/components/
CommonComponents/
InformationDisplay/index.ts
View file @
a1ee678e
File moved
src/components/FileSelect/index.module.css
deleted
100644 → 0
View file @
93c48fe7
.rootTitle
{
border-radius
:
4px
4px
0
0
;
background-color
:
rgba
(
25
,
118
,
210
,
0.08
);
/* background-color: rgba(25, 118, 210, 0.5); */
line-height
:
44px
;
color
:
rgba
(
30
,
38
,
51
,
1
);
font-size
:
14px
;
font-weight
:
600
;
display
:
flex
;
justify-content
:
flex-start
;
align-items
:
center
;
}
.rootTitleActive
{
background-color
:
rgba
(
25
,
118
,
210
,
0.2
);
}
.bigFolderIcon
{
margin
:
0
9px
;
}
.treeLabel
{
display
:
flex
;
justify-content
:
flex-start
;
align-items
:
center
;
}
.treeLabelText
{
line-height
:
44px
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
-o-text-overflow
:
ellipsis
;
white-space
:
nowrap
;
width
:
320px
;
}
.labelFolderIcon
{
margin-right
:
9px
;
}
src/components/FileSelect/index.tsx
deleted
100644 → 0
View file @
93c48fe7
import
MyDialog
from
"../mui/Dialog"
;
import
{
useStores
}
from
"@/store"
;
import
{
observer
}
from
"mobx-react-lite"
;
import
{
toJS
}
from
"mobx"
;
import
{
useEffect
,
useState
}
from
"react"
;
import
CloudEController
from
"@/api/fileserver/CloudEController"
;
import
MyTreeView
from
"@/components/mui/MyTreeView"
;
import
classNames
from
"classnames"
;
import
bigFolderIcon
from
"@/assets/project/bigFolderIcon.svg"
;
import
folderIcon
from
"@/assets/project/folderIcon.svg"
;
import
dataSetIcon
from
"@/assets/project/dataSetIcon.svg"
;
import
fileIcon
from
"@/assets/project/fileIcon.svg"
;
import
useMyRequest
from
"@/hooks/useMyRequest"
;
import
{
getDataFind
}
from
"@/api/project_api"
;
import
style
from
"./index.module.css"
;
import
_
from
"lodash"
;
type
FileSelectProps
=
{
open
:
boolean
;
onConfirm
:
any
;
onClose
:
any
;
type
?:
"file"
|
"dataset"
|
"path"
;
};
const
FileSelect
=
observer
((
props
:
FileSelectProps
)
=>
{
const
{
onConfirm
,
type
=
"path"
}
=
props
;
// const { onConfirm, type = "dataset" } = props;
const
{
currentProjectStore
}
=
useStores
();
const
projectId
=
toJS
(
currentProjectStore
.
currentProjectInfo
.
id
);
const
fileToken
=
toJS
(
currentProjectStore
.
currentProjectInfo
.
filetoken
);
const
[
treeData
,
setTreeData
]
=
useState
<
Array
<
any
>>
([]);
const
[
rootActive
,
setRootActive
]
=
useState
(
true
);
const
[
newPath
,
setNewPath
]
=
useState
(
"/"
);
// 获取某路径下的数据集
const
{
run
:
getDataFindRun
}
=
useMyRequest
(
getDataFind
,
{
onSuccess
:
(
res
:
any
)
=>
{
const
dataSetList
=
res
.
data
.
map
((
item
:
any
)
=>
{
return
{
...
item
,
type
:
"dataset"
,
dir
:
`/
${
item
.
path
}
`
,
subdirs
:
""
,
};
});
let
treeDataArr
=
_
.
cloneDeep
(
treeData
);
if
(
newPath
===
"/"
)
{
treeDataArr
=
_
.
uniqWith
([...
treeDataArr
,
...
dataSetList
],
_
.
isEqual
);
setTreeData
(
treeDataArr
);
}
else
{
let
pathArr
:
Array
<
any
>
=
newPath
.
split
(
"/"
);
pathArr
.
shift
();
let
reduceResult
=
pathArr
.
reduce
((
result
,
path
)
=>
{
if
(
Array
.
isArray
(
result
))
{
result
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
if
(
item
.
name
===
path
)
{
result
=
result
[
index
];
}
});
}
else
if
(
Array
.
isArray
(
result
.
subdirs
))
{
result
.
subdirs
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
if
(
item
.
name
===
path
)
{
result
=
result
.
subdirs
[
index
];
}
});
}
else
{
result
=
result
.
subdirs
;
}
return
result
;
},
treeDataArr
);
if
(
Array
.
isArray
(
reduceResult
.
subdirs
))
{
reduceResult
.
subdirs
=
_
.
uniqWith
(
[...
reduceResult
.
subdirs
,
...
dataSetList
],
_
.
isEqual
);
}
else
{
reduceResult
.
subdirs
=
dataSetList
;
}
treeDataArr
=
_
.
uniqWith
(
treeDataArr
,
_
.
isEqual
);
setTreeData
(
treeDataArr
);
}
},
});
useEffect
(()
=>
{
if
(
type
===
"dataset"
)
{
getDataFindRun
({
projectId
:
projectId
as
string
,
path
:
newPath
===
"/"
?
"/"
:
`
${
newPath
}
/`
,
});
}
},
[
newPath
,
getDataFindRun
,
projectId
,
type
]);
useEffect
(()
=>
{
if
(
fileToken
&&
projectId
)
{
CloudEController
.
JobOutFileDirtree
(
"/"
,
fileToken
,
projectId
,
false
)?.
then
((
res
:
any
)
=>
{
if
(
Array
.
isArray
(
res
.
data
))
{
setTreeData
(
res
.
data
);
}
else
{
setTreeData
([]);
}
if
(
type
===
"dataset"
)
{
getDataFindRun
({
projectId
:
projectId
as
string
,
path
:
"/"
,
// path: path === "/" ? "/" : `${path}/`,
});
}
});
}
},
[
projectId
,
fileToken
,
type
,
getDataFindRun
]);
// const renderLabel = (labelNmae: string) => {
const
renderLabel
=
(
node
:
any
)
=>
{
return
(
<
span
className=
{
style
.
treeLabel
}
>
{
node
.
type
===
"directory"
&&
(
<
img
className=
{
style
.
labelFolderIcon
}
src=
{
folderIcon
}
alt=
""
/>
)
}
{
node
.
type
===
"dataset"
&&
(
<
img
className=
{
style
.
labelFolderIcon
}
src=
{
dataSetIcon
}
alt=
""
/>
)
}
{
node
.
type
!==
"directory"
&&
node
.
type
!==
"dataset"
&&
(
<
img
className=
{
style
.
labelFolderIcon
}
src=
{
fileIcon
}
alt=
""
/>
)
}
<
span
className=
{
style
.
treeLabelText
}
>
{
node
.
name
}
</
span
>
</
span
>
);
};
const
handleRoot
=
()
=>
{
setNewPath
(
"/"
);
setRootActive
(
true
);
};
const
onNodeSelect
=
(
a
:
any
,
b
:
any
)
=>
{
setNewPath
(
b
);
setRootActive
(
false
);
};
// 给路径去掉第一个'/'然后结尾加上文件名 方便后面直接使用
const
idFunc
=
(
item
:
any
)
=>
{
return
`
${
item
.
dir
.
substr
(
1
)}${
item
.
name
}
`
;
};
const
fileSelectOnConfirm
=
()
=>
{
onConfirm
(
newPath
);
};
return
(
<
MyDialog
open=
{
props
.
open
}
onClose=
{
props
.
onClose
}
onConfirm=
{
fileSelectOnConfirm
}
title=
{
type
}
>
<
div
className=
{
classNames
({
[
style
.
rootTitle
]:
true
,
[
style
.
rootTitleActive
]:
rootActive
,
})
}
onClick=
{
handleRoot
}
>
<
img
className=
{
style
.
bigFolderIcon
}
src=
{
bigFolderIcon
}
alt=
""
/>
ProjectData
</
div
>
<
MyTreeView
treeData=
{
treeData
}
renderLabel=
{
renderLabel
}
onNodeSelect=
{
onNodeSelect
}
idFunc=
{
idFunc
}
treeViewSx=
{
{
width
:
400
,
overflow
:
"hidden"
,
}
}
></
MyTreeView
>
</
MyDialog
>
);
});
export
default
FileSelect
;
src/views/Project/ProjectData/index.tsx
View file @
a1ee678e
...
...
@@ -21,11 +21,10 @@ import { useStores } from "@/store";
import
CloudEController
from
"@/api/fileserver/CloudEController"
;
import
{
toJS
}
from
"mobx"
;
import
moment
from
"moment"
;
import
NoProject
from
"@/components/NoProject"
;
import
NoProject
from
"@/components/
BusinessComponents/
NoProject"
;
import
usePass
from
"@/hooks/usePass"
;
import
{
storageUnitFromB
}
from
"@/utils/util"
;
import
{
useLocation
}
from
"react-router-dom"
;
import
FileSelect
from
"@/components/BusinessComponents/FileSelect"
;
import
{
getDataFind
,
getDataFileSearch
}
from
"@/api/project_api"
;
const
theme
=
createTheme
({
...
...
src/views/Project/ProjectSetting/BaseInfo/index.tsx
View file @
a1ee678e
...
...
@@ -19,7 +19,7 @@ import {
import
{
useStores
}
from
"@/store"
;
import
{
toJS
}
from
"mobx"
;
import
{
observer
}
from
"mobx-react-lite"
;
import
InformationDisplay
from
"@/components/InformationDisplay"
;
import
InformationDisplay
from
"@/components/
CommonComponents/
InformationDisplay"
;
import
classnames
from
"classnames"
;
import
{
Button
,
TextField
}
from
"@mui/material"
;
import
LoadingButton
from
"@mui/lab/LoadingButton"
;
...
...
src/views/Project/ProjectSetting/index.tsx
View file @
a1ee678e
...
...
@@ -10,7 +10,7 @@ import { memo, useMemo } from "react";
import
{
Box
}
from
"@mui/system"
;
import
{
useStores
}
from
"@/store/index"
;
import
NoProject
from
"@/components/NoProject"
;
import
NoProject
from
"@/components/
BusinessComponents/
NoProject"
;
import
{
observer
}
from
"mobx-react-lite"
;
import
projectImg
from
"@/assets/project/projectIconSmall.svg"
;
import
ProjectMembers
from
"./ProjectMembers"
;
...
...
src/views/Project/components/Flow/index.tsx
View file @
a1ee678e
...
...
@@ -9,7 +9,6 @@ import ReactFlow, {
Edge
,
}
from
"react-flow-renderer"
;
import
{
useCallback
,
useEffect
,
useMemo
,
useState
}
from
"react"
;
import
_
from
"lodash"
;
import
{
uuid
}
from
"@/utils/util"
;
import
{
IEdge
,
IParameter
,
ITask
}
from
"../../ProjectSubmitWork/interface"
;
...
...
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