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
sunyihao
bkunyun
Commits
24d0d635
Commit
24d0d635
authored
Jul 08, 2022
by
chenshouchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删除不必要的引用
parent
72f8ff82
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
546 additions
and
579 deletions
+546
-579
CloudEController.ts
src/api/fileserver/CloudEController.ts
+1
-1
Table.jsx
src/components/Material.Ui/Table.jsx
+3
-14
Button.tsx
src/components/mui/Button.tsx
+0
-0
MyTreeView.tsx
src/components/mui/MyTreeView.tsx
+55
-57
usePass.ts
src/hooks/usePass.ts
+1
-1
index.tsx
src/index.tsx
+34
-21
helper.ts
src/utils/helper.ts
+2
-1
index.tsx
src/views/Project/ProjectData/DeleteDialog/index.tsx
+172
-172
index.tsx
src/views/Project/ProjectData/MoveFile/index.tsx
+0
-0
ChangePermission.tsx
...ectSetting/ProjectMembers/components/ChangePermission.tsx
+78
-78
index.tsx
src/views/Project/ProjectSetting/index.tsx
+33
-33
simpleDialog.tsx
...rojectWorkbench/workbenchList/components/simpleDialog.tsx
+18
-19
simpleDialog.tsx
...ctWorkbench/workbenchTemplate/components/simpleDialog.tsx
+18
-19
templateBox.tsx
...ectWorkbench/workbenchTemplate/components/templateBox.tsx
+75
-75
index.tsx
src/views/WorkFlowEdit/components/ParameterSetting/index.tsx
+56
-88
No files found.
src/api/fileserver/CloudEController.ts
View file @
24d0d635
...
...
@@ -4,7 +4,7 @@ import axios from "axios";
// import { Actions, Constants } from '../../../../commons/utils/constants'
// import MessageUtil from '../../../../commons/utils/MessageUtil'
// import ApiUtils from '../../../../commons/utils/ApiUtils'
import
{
APIOPTION
,
urlToken
,
ZONEID
}
from
"./raysyncApi"
;
import
{
APIOPTION
,
urlToken
}
from
"./raysyncApi"
;
// import UserStore from '../../../../console/common/stores/UserStore'
import
{
ApiUtils
}
from
"./utils"
;
import
Base64
from
"crypto-js/enc-base64"
;
...
...
src/components/Material.Ui/Table.jsx
View file @
24d0d635
...
...
@@ -9,7 +9,6 @@ import Paper from "@mui/material/Paper";
import
Checkbox
from
"@mui/material/Checkbox"
;
// import Spin from "./Spin";
import
EnhancedTableToolbarComponent
from
"./Table/EnhancedTableToolbar"
import
EnhancedTableHeadComponent
from
"./Table/EnhancedTableHead"
import
{
getComparator
,
stableSort
,
useStyles
}
from
"./Table/function"
;
import
ActionsComponent
from
"./Table/ActionsComponent"
...
...
@@ -20,11 +19,10 @@ export default function EnhancedTable(props) {
const
classes
=
useStyles
;
const
[
order
,
setOrder
]
=
React
.
useState
(
"asc"
);
const
[
orderBy
,
setOrderBy
]
=
React
.
useState
(
""
);
const
{
headCells
,
rows
,
footer
=
true
,
elevation1
,
tableStyle
,
tablecellstyle
,
tableContainerStyle
,
stickyheader
,
TableHeadClasses
,
onRowClick
,
defaultRow
,
minHeight
=
''
,
borderBottom
=
''
,
onDoubleClick
,
const
{
headCells
,
rows
,
footer
=
true
,
elevation1
,
tableStyle
,
tablecellstyle
,
tableContainerStyle
,
stickyheader
,
onRowClick
,
defaultRow
,
minHeight
=
''
,
borderBottom
=
''
,
onDoubleClick
,
load
,
size
,
checkboxData
,
rowsPerPage
=
10
,
initSelected
,
page
=
0
,
changePage
=
function
()
{
},
toolbar
,
count
,
param
,
disabledparam
=
"id"
,
headTableCellCheckbox
,
RowHeight
=
''
,
CellWidth
=
''
,
rowHover
,
TableNodataPadding
=
''
,
TableNodataLineHeight
=
''
,
tableBoySx
}
=
props
;
const
[
selected
,
setSelected
]
=
React
.
useState
(
initSelected
||
[]);
const
[
rowsPerPageOptions
,
setRowsPerPageOptions
]
=
React
.
useState
(
initSelected
||
[
5
,
10
,
20
,
50
,
{
value
:
-
1
,
label
:
'All'
}]);
// const [spin, setSpin] = React.useState(false)
const
[
rowsPerPageOptions
]
=
React
.
useState
(
initSelected
||
[
5
,
10
,
20
,
50
,
{
value
:
-
1
,
label
:
'All'
}]);
const
[
onRow
,
setOnRow
]
=
React
.
useState
(
''
)
// 重置复选框选中选项
...
...
@@ -63,10 +61,6 @@ export default function EnhancedTable(props) {
setSelected
([]);
checkboxData
([]);
};
// React.useEffect(() => {
// setSpin(load)
// }, [load]);
const
handleClick
=
(
event
,
name
)
=>
{
const
selectedIndex
=
selected
.
indexOf
(
name
);
let
newSelected
=
[];
...
...
@@ -97,7 +91,7 @@ export default function EnhancedTable(props) {
const
isSelected
=
(
name
)
=>
selected
.
indexOf
(
name
)
!==
-
1
;
const
emptyRows
=
rowsPerPage
-
Math
.
min
(
rowsPerPage
,
rows
.
length
-
page
*
rowsPerPage
);
//
const emptyRows = rowsPerPage - Math.min(rowsPerPage, rows.length - page * rowsPerPage);
const
renderTableCellValue
=
useCallback
(((
item
,
row
,
index
)
=>
{
if
(
...
...
@@ -209,11 +203,6 @@ export default function EnhancedTable(props) {
</
TableRow
>
);
})
}
{
/* {emptyRows > 0 && (
<TableRow style={{ height: (dense ? 33 : 53) * emptyRows }}>
<TableCell colSpan={6} />
</TableRow>
)} */
}
</
TableBody
>
</
Table
>
</
TableContainer
>
...
...
src/components/mui/Button.tsx
View file @
24d0d635
This diff is collapsed.
Click to expand it.
src/components/mui/MyTreeView.tsx
View file @
24d0d635
...
...
@@ -4,74 +4,72 @@ import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown";
import
TreeItem
from
"@mui/lab/TreeItem"
;
interface
TreeItemType
{
id
:
string
;
name
:
string
;
disabled
?:
boolean
;
subdirs
?:
readonly
TreeItemType
[];
id
:
string
;
name
:
string
;
disabled
?:
boolean
;
subdirs
?:
readonly
TreeItemType
[];
}
type
MyTreeViewProps
=
{
treeData
:
Array
<
TreeItemType
>
;
onNodeFocus
?:
(
event
:
object
,
value
:
string
)
=>
void
;
// 点击某一项的回调
onNodeSelect
?:
(
event
:
object
,
value
:
Array
<
any
>
|
string
)
=>
void
;
// 点击某一项的回调
onNodeToggle
?:
(
event
:
object
,
nodeIds
:
Array
<
any
>
)
=>
void
;
// 点击某一项的回调
renderLabel
?:
(
node
:
any
)
=>
React
.
ReactNode
;
treeViewSx
?:
any
;
defaultExpanded
?:
Array
<
string
>
;
idKey
?:
string
;
idFunc
?:
(
node
:
any
)
=>
string
;
treeData
:
Array
<
TreeItemType
>
;
onNodeFocus
?:
(
event
:
object
,
value
:
string
)
=>
void
;
// 点击某一项的回调
onNodeSelect
?:
(
event
:
object
,
value
:
Array
<
any
>
|
string
)
=>
void
;
// 点击某一项的回调
onNodeToggle
?:
(
event
:
object
,
nodeIds
:
Array
<
any
>
)
=>
void
;
// 点击某一项的回调
renderLabel
?:
(
node
:
any
)
=>
React
.
ReactNode
;
treeViewSx
?:
any
;
defaultExpanded
?:
Array
<
string
>
;
idFunc
?:
(
node
:
any
)
=>
string
;
};
interface
RenderTree
{
id
:
string
|
number
;
name
:
string
;
disabled
?:
boolean
;
subdirs
?:
readonly
RenderTree
[];
id
:
string
|
number
;
name
:
string
;
disabled
?:
boolean
;
subdirs
?:
readonly
RenderTree
[];
}
const
MyTreeView
=
(
props
:
MyTreeViewProps
)
=>
{
const
{
treeData
=
[],
renderLabel
,
treeViewSx
,
onNodeFocus
,
onNodeSelect
,
onNodeToggle
,
defaultExpanded
,
idKey
,
idFunc
,
}
=
props
;
const
{
treeData
=
[],
renderLabel
,
treeViewSx
,
onNodeFocus
,
onNodeSelect
,
onNodeToggle
,
defaultExpanded
,
idFunc
,
}
=
props
;
const
renderTreeObj
=
(
nodes
:
RenderTree
,
index
:
number
)
=>
(
<
TreeItem
key=
{
nodes
.
id
||
`${nodes.name}${index}`
}
nodeId=
{
String
(
idFunc
?
idFunc
(
nodes
)
:
nodes
.
id
||
`${nodes.name}${index}`
)
}
label=
{
renderLabel
===
undefined
?
nodes
.
name
:
renderLabel
(
nodes
)
}
disabled=
{
nodes
?.
disabled
?
true
:
false
}
>
{
Array
.
isArray
(
nodes
.
subdirs
)
?
nodes
.
subdirs
.
map
((
node
,
i
)
=>
renderTreeObj
(
node
,
i
))
:
null
}
</
TreeItem
>
);
const
renderTreeObj
=
(
nodes
:
RenderTree
,
index
:
number
)
=>
(
<
TreeItem
key=
{
nodes
.
id
||
`${nodes.name}${index}`
}
nodeId=
{
String
(
idFunc
?
idFunc
(
nodes
)
:
nodes
.
id
||
`${nodes.name}${index}`
)
}
label=
{
renderLabel
===
undefined
?
nodes
.
name
:
renderLabel
(
nodes
)
}
disabled=
{
nodes
?.
disabled
?
true
:
false
}
>
{
Array
.
isArray
(
nodes
.
subdirs
)
?
nodes
.
subdirs
.
map
((
node
,
i
)
=>
renderTreeObj
(
node
,
i
))
:
null
}
</
TreeItem
>
);
return
(
<
TreeView
defaultCollapseIcon=
{
<
ArrowRightIcon
/>
}
defaultExpandIcon=
{
<
ArrowDropDownIcon
/>
}
onNodeFocus=
{
onNodeFocus
}
onNodeSelect=
{
onNodeSelect
}
onNodeToggle=
{
onNodeToggle
}
defaultExpanded=
{
defaultExpanded
}
sx=
{
{
...
treeViewSx
}
}
>
{
treeData
.
map
((
treeItem
,
index
)
=>
{
return
renderTreeObj
(
treeItem
,
index
);
})
}
</
TreeView
>
);
return
(
<
TreeView
defaultCollapseIcon=
{
<
ArrowRightIcon
/>
}
defaultExpandIcon=
{
<
ArrowDropDownIcon
/>
}
onNodeFocus=
{
onNodeFocus
}
onNodeSelect=
{
onNodeSelect
}
onNodeToggle=
{
onNodeToggle
}
defaultExpanded=
{
defaultExpanded
}
sx=
{
{
...
treeViewSx
}
}
>
{
treeData
.
map
((
treeItem
,
index
)
=>
{
return
renderTreeObj
(
treeItem
,
index
);
})
}
</
TreeView
>
);
};
export
default
MyTreeView
;
src/hooks/usePass.ts
View file @
24d0d635
...
...
@@ -75,7 +75,7 @@ const usePass = () => {
}
return
false
;
},
[
permissionStore
.
allRoutes
]
[
permissionStore
.
allRoutes
,
currentProjectStore
]
);
return
isPass
;
...
...
src/index.tsx
View file @
24d0d635
...
...
@@ -7,35 +7,48 @@ import { Provider } from "mobx-react";
import
{
stores
}
from
"@/store/index"
;
import
{
MySnackbarProvider
}
from
"@/components/MySnackbar"
;
import
"@/mocks/index"
;
import
'./assets/style/public.css'
import
{
createTheme
,
ThemeProvider
,
styled
}
from
'@mui/material/styles'
;
import
"./assets/style/public.css"
;
import
{
createTheme
,
ThemeProvider
}
from
"@mui/material/styles"
;
const
root
=
ReactDOM
.
createRoot
(
document
.
getElementById
(
"root"
)
as
HTMLElement
document
.
getElementById
(
"root"
)
as
HTMLElement
);
const
theme
=
createTheme
({
typography
:
{
fontFamily
:
[
'Roboto'
,
'Helvetica'
,
'Tahoma'
,
'Arial'
,
'"PingFang SC"'
,
'"Hiragino Sans GB"'
,
'"Heiti SC"'
,
'"WenQuanYi Micro Hei"'
,
'sans-serif'
,
'"Apple Color Emoji"'
,
'"Segoe UI Emoji"'
,
'"Segoe UI Symbol"'
].
join
(
','
),
},
palette
:
{
primary
:
{
main
:
'#136EFA'
},
secondary
:
{
main
:
'#F44335'
}
}
typography
:
{
fontFamily
:
[
"Roboto"
,
"Helvetica"
,
"Tahoma"
,
"Arial"
,
'"PingFang SC"'
,
'"Hiragino Sans GB"'
,
'"Heiti SC"'
,
'"WenQuanYi Micro Hei"'
,
"sans-serif"
,
'"Apple Color Emoji"'
,
'"Segoe UI Emoji"'
,
'"Segoe UI Symbol"'
,
].
join
(
","
),
},
palette
:
{
primary
:
{
main
:
"#136EFA"
},
secondary
:
{
main
:
"#F44335"
},
},
});
root
.
render
(
<
React
.
StrictMode
>
<
ThemeProvider
theme=
{
theme
}
>
<
Provider
{
...
stores
}
>
<
MySnackbarProvider
alertSx=
{
{
boxShadow
:
"0px 2px 4px 0px rgb(0 0 0 / 8%)"
}
}
>
<
MyRouter
></
MyRouter
>
</
MySnackbarProvider
>
</
Provider
>
</
ThemeProvider
>
</
React
.
StrictMode
>
<
React
.
StrictMode
>
<
ThemeProvider
theme=
{
theme
}
>
<
Provider
{
...
stores
}
>
<
MySnackbarProvider
alertSx=
{
{
boxShadow
:
"0px 2px 4px 0px rgb(0 0 0 / 8%)"
}
}
>
<
MyRouter
></
MyRouter
>
</
MySnackbarProvider
>
</
Provider
>
</
ThemeProvider
>
</
React
.
StrictMode
>
);
// If you want to start measuring performance in your app, pass a function
...
...
src/utils/helper.ts
View file @
24d0d635
...
...
@@ -36,6 +36,6 @@ export const verifyLettersNumbersCertainChars5 = (str: string) => {
if
(
getTrueLength
(
str
)
>
127
)
{
return
false
;
}
let
validString
=
/^
[\u
4e00-
\u
9fa5_0-9a-zA-Z
\
/
-_.
]
+$/
;
let
validString
=
/^
[\u
4e00-
\u
9fa5_0-9a-zA-Z
/
-_.
]
+$/
;
return
validString
.
test
(
str
);
};
\ No newline at end of file
src/views/Project/ProjectData/DeleteDialog/index.tsx
View file @
24d0d635
import
React
,
{
use
State
,
use
ImperativeHandle
,
useMemo
}
from
"react"
;
import
React
,
{
useImperativeHandle
,
useMemo
}
from
"react"
;
import
MyDialog
from
"@/components/mui/MyDialog"
;
import
{
useMessage
}
from
"@/components/MySnackbar"
;
...
...
@@ -7,177 +7,177 @@ import { getDataFileDel, getDataFileDelPackage } from "@/api/project_api";
import
useMyRequest
from
"@/hooks/useMyRequest"
;
const
DeleteDialog
=
(
props
:
any
)
=>
{
const
{
path
,
projectId
,
fileToken
,
currentOperateFile
,
selectIds
,
refresh
,
showList
,
}
=
props
;
const
Message
=
useMessage
();
let
deleteFileDialogRef
:
any
=
React
.
createRef
();
const
showDialog
=
()
=>
{
deleteFileDialogRef
.
current
.
handleClickOpen
();
};
useImperativeHandle
(
props
.
onRef
,
()
=>
{
return
{
showDialog
:
showDialog
,
};
});
const
{
run
:
getDataFileDelRun
}
=
useMyRequest
(
getDataFileDel
,
{
onSuccess
:
(
res
:
any
)
=>
{
successDelete
();
},
});
const
{
run
:
getDataFileDelPackageRun
}
=
useMyRequest
(
getDataFileDelPackage
,
{
onSuccess
:
(
res
:
any
)
=>
{
successDelete
();
},
}
);
const
successDelete
=
()
=>
{
Message
.
success
(
"删除成功!"
);
deleteFileDialogRef
?.
current
?.
handleClose
();
refresh
();
};
const
deletePathProvidedToDataSet
=
useMemo
(()
=>
{
return
path
===
"/"
?
"/"
:
`
${
path
}
/`
;
},
[
path
]);
const
deletePathProvidedFileServer
=
useMemo
(()
=>
{
return
path
===
"/"
?
`
${
path
}
`
:
`
${
path
}
/`
;
},
[
path
]);
// 删除
const
handleSubmit
=
()
=>
{
if
(
!
currentOperateFile
)
{
// 批量删除
// 要删除的数据集
const
datSetDeleteList
=
showList
.
filter
((
item
:
any
)
=>
{
return
selectIds
.
indexOf
(
item
.
name
)
!==
-
1
&&
item
.
type
===
"dataSet"
;
});
// 要删除的文件夹
const
folderDeleteList
=
showList
.
filter
((
item
:
any
)
=>
{
return
selectIds
.
indexOf
(
item
.
name
)
!==
-
1
&&
item
.
type
===
"directory"
;
});
// 要删除的文件
const
fileDeleteList
=
showList
.
filter
((
item
:
any
)
=>
{
return
(
selectIds
.
indexOf
(
item
.
name
)
!==
-
1
&&
item
.
type
!==
"dataSet"
&&
item
.
type
!==
"directory"
);
});
if
(
datSetDeleteList
.
length
>
0
)
{
dataSetsDelete
(
datSetDeleteList
);
}
if
(
folderDeleteList
.
length
>
0
)
{
foldersDelete
(
folderDeleteList
);
}
if
(
fileDeleteList
.
length
>
0
)
{
filesDelete
(
fileDeleteList
);
}
}
else
{
if
(
currentOperateFile
.
type
===
"dataSet"
)
{
dataSetDelete
();
}
else
if
(
currentOperateFile
.
type
===
"directory"
)
{
folerDelete
();
}
else
{
fileDelete
();
}
}
};
// 删除单个数据集
const
dataSetDelete
=
()
=>
{
getDataFileDelRun
({
projectId
:
projectId
as
string
,
names
:
currentOperateFile
.
name
,
path
:
deletePathProvidedToDataSet
,
});
};
// 删除单个文件夹
const
folerDelete
=
()
=>
{
fileDelete
();
const
names
=
currentOperateFile
.
name
;
dataSetInFolerDelete
(
names
);
};
// 删除文件夹中的数据集
const
dataSetInFolerDelete
=
(
names
:
string
)
=>
{
getDataFileDelPackageRun
({
projectId
:
projectId
as
string
,
names
,
path
:
deletePathProvidedToDataSet
,
});
};
// 删除单个文件
const
fileDelete
=
()
=>
{
CloudEController
.
JobOutFileDel
(
`
${
deletePathProvidedFileServer
}${
currentOperateFile
.
name
}
`
,
fileToken
as
string
,
projectId
as
string
)?.
then
((
res
)
=>
{
successDelete
();
});
};
// 删除多个数据集
const
dataSetsDelete
=
(
datSetDeleteList
:
Array
<
any
>
)
=>
{
getDataFileDelRun
({
projectId
:
projectId
as
string
,
names
:
datSetDeleteList
.
map
((
item
:
any
)
=>
item
.
name
).
join
(
","
),
path
:
deletePathProvidedToDataSet
,
});
};
// 删除多个文件夹
const
foldersDelete
=
(
folderDeleteList
:
Array
<
any
>
)
=>
{
filesDelete
(
folderDeleteList
);
const
names
=
folderDeleteList
.
map
((
item
:
any
)
=>
item
.
name
).
join
(
","
);
dataSetInFolerDelete
(
names
);
};
// 删除多个文件
const
filesDelete
=
(
fileDeleteList
:
Array
<
any
>
)
=>
{
const
deletePath
=
fileDeleteList
.
map
((
item
:
any
)
=>
{
return
`
${
deletePathProvidedFileServer
}${
item
.
name
}
`
;
})
.
join
(
" "
);
CloudEController
.
JobOutFileDel
(
deletePath
,
fileToken
as
string
,
projectId
as
string
)?.
then
((
res
)
=>
{
successDelete
();
});
};
const
submitloading
=
false
;
return
(
<
MyDialog
handleSubmit=
{
handleSubmit
}
onRef=
{
deleteFileDialogRef
}
title=
"提示"
submitloading=
{
submitloading
}
>
{
currentOperateFile
?
"确认删除该数据吗?"
:
`确认删除这${selectIds.length}条数据吗?`
}
</
MyDialog
>
);
const
{
path
,
projectId
,
fileToken
,
currentOperateFile
,
selectIds
,
refresh
,
showList
,
}
=
props
;
const
Message
=
useMessage
();
let
deleteFileDialogRef
:
any
=
React
.
createRef
();
const
showDialog
=
()
=>
{
deleteFileDialogRef
.
current
.
handleClickOpen
();
};
useImperativeHandle
(
props
.
onRef
,
()
=>
{
return
{
showDialog
:
showDialog
,
};
});
const
{
run
:
getDataFileDelRun
}
=
useMyRequest
(
getDataFileDel
,
{
onSuccess
:
(
res
:
any
)
=>
{
successDelete
();
},
});
const
{
run
:
getDataFileDelPackageRun
}
=
useMyRequest
(
getDataFileDelPackage
,
{
onSuccess
:
(
res
:
any
)
=>
{
successDelete
();
},
}
);
const
successDelete
=
()
=>
{
Message
.
success
(
"删除成功!"
);
deleteFileDialogRef
?.
current
?.
handleClose
();
refresh
();
};
const
deletePathProvidedToDataSet
=
useMemo
(()
=>
{
return
path
===
"/"
?
"/"
:
`
${
path
}
/`
;
},
[
path
]);
const
deletePathProvidedFileServer
=
useMemo
(()
=>
{
return
path
===
"/"
?
`
${
path
}
`
:
`
${
path
}
/`
;
},
[
path
]);
// 删除
const
handleSubmit
=
()
=>
{
if
(
!
currentOperateFile
)
{
// 批量删除
// 要删除的数据集
const
datSetDeleteList
=
showList
.
filter
((
item
:
any
)
=>
{
return
selectIds
.
indexOf
(
item
.
name
)
!==
-
1
&&
item
.
type
===
"dataSet"
;
});
// 要删除的文件夹
const
folderDeleteList
=
showList
.
filter
((
item
:
any
)
=>
{
return
selectIds
.
indexOf
(
item
.
name
)
!==
-
1
&&
item
.
type
===
"directory"
;
});
// 要删除的文件
const
fileDeleteList
=
showList
.
filter
((
item
:
any
)
=>
{
return
(
selectIds
.
indexOf
(
item
.
name
)
!==
-
1
&&
item
.
type
!==
"dataSet"
&&
item
.
type
!==
"directory"
);
});
if
(
datSetDeleteList
.
length
>
0
)
{
dataSetsDelete
(
datSetDeleteList
);
}
if
(
folderDeleteList
.
length
>
0
)
{
foldersDelete
(
folderDeleteList
);
}
if
(
fileDeleteList
.
length
>
0
)
{
filesDelete
(
fileDeleteList
);
}
}
else
{
if
(
currentOperateFile
.
type
===
"dataSet"
)
{
dataSetDelete
();
}
else
if
(
currentOperateFile
.
type
===
"directory"
)
{
folerDelete
();
}
else
{
fileDelete
();
}
}
};
// 删除单个数据集
const
dataSetDelete
=
()
=>
{
getDataFileDelRun
({
projectId
:
projectId
as
string
,
names
:
currentOperateFile
.
name
,
path
:
deletePathProvidedToDataSet
,
});
};
// 删除单个文件夹
const
folerDelete
=
()
=>
{
fileDelete
();
const
names
=
currentOperateFile
.
name
;
dataSetInFolerDelete
(
names
);
};
// 删除文件夹中的数据集
const
dataSetInFolerDelete
=
(
names
:
string
)
=>
{
getDataFileDelPackageRun
({
projectId
:
projectId
as
string
,
names
,
path
:
deletePathProvidedToDataSet
,
});
};
// 删除单个文件
const
fileDelete
=
()
=>
{
CloudEController
.
JobOutFileDel
(
`
${
deletePathProvidedFileServer
}${
currentOperateFile
.
name
}
`
,
fileToken
as
string
,
projectId
as
string
)?.
then
((
res
)
=>
{
successDelete
();
});
};
// 删除多个数据集
const
dataSetsDelete
=
(
datSetDeleteList
:
Array
<
any
>
)
=>
{
getDataFileDelRun
({
projectId
:
projectId
as
string
,
names
:
datSetDeleteList
.
map
((
item
:
any
)
=>
item
.
name
).
join
(
","
),
path
:
deletePathProvidedToDataSet
,
});
};
// 删除多个文件夹
const
foldersDelete
=
(
folderDeleteList
:
Array
<
any
>
)
=>
{
filesDelete
(
folderDeleteList
);
const
names
=
folderDeleteList
.
map
((
item
:
any
)
=>
item
.
name
).
join
(
","
);
dataSetInFolerDelete
(
names
);
};
// 删除多个文件
const
filesDelete
=
(
fileDeleteList
:
Array
<
any
>
)
=>
{
const
deletePath
=
fileDeleteList
.
map
((
item
:
any
)
=>
{
return
`
${
deletePathProvidedFileServer
}${
item
.
name
}
`
;
})
.
join
(
" "
);
CloudEController
.
JobOutFileDel
(
deletePath
,
fileToken
as
string
,
projectId
as
string
)?.
then
((
res
)
=>
{
successDelete
();
});
};
const
submitloading
=
false
;
return
(
<
MyDialog
handleSubmit=
{
handleSubmit
}
onRef=
{
deleteFileDialogRef
}
title=
"提示"
submitloading=
{
submitloading
}
>
{
currentOperateFile
?
"确认删除该数据吗?"
:
`确认删除这${selectIds.length}条数据吗?`
}
</
MyDialog
>
);
};
export
default
DeleteDialog
;
src/views/Project/ProjectData/MoveFile/index.tsx
View file @
24d0d635
This diff is collapsed.
Click to expand it.
src/views/Project/ProjectSetting/ProjectMembers/components/ChangePermission.tsx
View file @
24d0d635
...
...
@@ -7,7 +7,7 @@
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
// import Dialog from "@/components/Material.Ui/Dialog";
import
{
memo
,
useEffect
,
use
Memo
,
use
State
}
from
"react"
;
import
{
memo
,
useEffect
,
useState
}
from
"react"
;
import
{
observer
}
from
"mobx-react-lite"
;
import
{
toJS
}
from
"mobx"
;
...
...
@@ -19,91 +19,91 @@ import { IDialogInfo } from "../interface";
import
{
useMessage
}
from
"@/components/MySnackbar"
;
interface
IProps
{
setPermissionDialog
:
(
val
:
IDialogInfo
)
=>
void
;
permissionDialog
:
IDialogInfo
;
getTableList
:
()
=>
void
;
setPermissionDialog
:
(
val
:
IDialogInfo
)
=>
void
;
permissionDialog
:
IDialogInfo
;
getTableList
:
()
=>
void
;
}
const
ChangePermission
=
observer
((
props
:
IProps
)
=>
{
const
{
permissionDialog
,
setPermissionDialog
,
getTableList
}
=
props
;
const
{
permissionDialog
,
setPermissionDialog
,
getTableList
}
=
props
;
const
{
currentProjectStore
}
=
useStores
();
const
Message
=
useMessage
();
const
http
=
useHttp
();
const
{
currentProjectStore
}
=
useStores
();
const
Message
=
useMessage
();
const
http
=
useHttp
();
const
[
selectOptions
,
setSelectOptions
]
=
useState
<
IOption
[]
>
([]);
const
[
selectValue
,
setSelectValue
]
=
useState
<
IOption
|
undefined
>
();
const
[
selectOptions
,
setSelectOptions
]
=
useState
<
IOption
[]
>
([]);
const
[
selectValue
,
setSelectValue
]
=
useState
<
IOption
|
undefined
>
();
useEffect
(()
=>
{
if
(
permissionDialog
?.
isShow
)
{
http
.
get
<
IResponse
<
any
>
>
("/cpp/project/listroles").then((res) =
>
{
const
arr
=
[];
const
{
data
}
=
res
;
for
(
const
key
in
data
)
{
arr
.
push
({
label
:
String
(
data
[
key
]),
value
:
key
,
});
}
setSelectOptions
(
arr
);
}
);
}
}, [http, permissionDialog]);
useEffect
(()
=>
{
if
(
permissionDialog
?.
isShow
)
{
http
.
get
<
IResponse
<
any
>
>
("/cpp/project/listroles").then((res) =
>
{
const
arr
=
[];
const
{
data
}
=
res
;
for
(
const
key
in
data
)
{
arr
.
push
({
label
:
String
(
data
[
key
]),
value
:
key
,
});
}
setSelectOptions
(
arr
);
}
);
}
}, [http, permissionDialog]);
const changePermission = (val: any) =
>
{
setSelectValue
(
val
);
}
;
const onClose = () =
>
{
setPermissionDialog
({
isShow
:
false
,
username
:
""
});
}
;
const onConfirm = () =
>
{
const
projectInfo
=
toJS
(
currentProjectStore
?.
currentProjectInfo
);
http
.
put
<
IResponse
<
any
>>
(
`/cpp/project/updateuserrole?id=${projectInfo?.id || ""}&username=${
permissionDialog.username
}&role=${selectValue?.value}`
)
.
then
((
res
)
=>
{
const
{
errorCode
}
=
res
;
if
(
errorCode
===
0
)
{
Message
.
success
(
"更改成功!"
);
getTableList
();
setPermissionDialog
({
isShow
:
false
,
username
:
""
});
}
});
}
;
const changePermission = (val: any) =
>
{
setSelectValue
(
val
);
}
;
const onClose = () =
>
{
setPermissionDialog
({
isShow
:
false
,
username
:
""
});
}
;
const onConfirm = () =
>
{
const
projectInfo
=
toJS
(
currentProjectStore
?.
currentProjectInfo
);
http
.
put
<
IResponse
<
any
>>
(
`/cpp/project/updateuserrole?id=${projectInfo?.id || ""}&username=${
permissionDialog.username
}&role=${selectValue?.value}`
)
.
then
((
res
)
=>
{
const
{
errorCode
}
=
res
;
if
(
errorCode
===
0
)
{
Message
.
success
(
"更改成功!"
);
getTableList
();
setPermissionDialog
({
isShow
:
false
,
username
:
""
});
}
});
}
;
useEffect(() =
>
{
const
defaultValue
=
selectOptions
.
filter
(
(
every
)
=>
every
.
value
===
permissionDialog
?.
projectRole
);
if
(
defaultValue
?.
length
)
{
setSelectValue
(
defaultValue
[
0
]);
}
else
{
setSelectValue
({
value
:
"VIEWER"
,
label
:
"查看者"
});
}
}
, [permissionDialog, selectOptions]);
return (
<>
<
Dialog
open=
{
permissionDialog
?.
isShow
}
onClose=
{
onClose
}
onConfirm=
{
onConfirm
}
title=
"更改权限"
>
<
div
style=
{
{
marginTop
:
12
}
}
>
<
MySelect
title=
"项目权限"
value=
{
selectValue
}
onChange=
{
changePermission
}
options=
{
selectOptions
}
size=
"small"
/>
</
div
>
</
Dialog
>
</>
);
useEffect(() =
>
{
const
defaultValue
=
selectOptions
.
filter
(
(
every
)
=>
every
.
value
===
permissionDialog
?.
projectRole
);
if
(
defaultValue
?.
length
)
{
setSelectValue
(
defaultValue
[
0
]);
}
else
{
setSelectValue
({
value
:
"VIEWER"
,
label
:
"查看者"
});
}
}
, [permissionDialog, selectOptions]);
return (
<>
<
Dialog
open=
{
permissionDialog
?.
isShow
}
onClose=
{
onClose
}
onConfirm=
{
onConfirm
}
title=
"更改权限"
>
<
div
style=
{
{
marginTop
:
12
}
}
>
<
MySelect
title=
"项目权限"
value=
{
selectValue
}
onChange=
{
changePermission
}
options=
{
selectOptions
}
size=
"small"
/>
</
div
>
</
Dialog
>
</>
);
});
export default memo(ChangePermission);
src/views/Project/ProjectSetting/index.tsx
View file @
24d0d635
...
...
@@ -6,7 +6,7 @@
* @FilePath: /bkunyun/src/views/Project/ProjectSetting/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import
{
memo
,
use
State
,
use
Memo
}
from
"react"
;
import
{
memo
,
useMemo
}
from
"react"
;
import
{
Box
}
from
"@mui/system"
;
import
{
useStores
}
from
"@/store/index"
;
...
...
@@ -18,39 +18,39 @@ import BaseInfo from "./BaseInfo";
import
Tabs
from
"@/components/mui/Tabs"
;
const
ProjectSetting
=
observer
(()
=>
{
const
{
currentProjectStore
}
=
useStores
();
const
tabList
=
useMemo
(()
=>
{
return
[
{
label
:
"项目成员"
,
value
:
"projectMember"
,
component
:
<
ProjectMembers
/>,
},
{
label
:
"基础信息"
,
value
:
"baseInfo"
,
component
:
<
BaseInfo
/>,
},
];
},
[]);
const
{
currentProjectStore
}
=
useStores
();
const
tabList
=
useMemo
(()
=>
{
return
[
{
label
:
"项目成员"
,
value
:
"projectMember"
,
component
:
<
ProjectMembers
/>,
},
{
label
:
"基础信息"
,
value
:
"baseInfo"
,
component
:
<
BaseInfo
/>,
},
];
},
[]);
if
(
currentProjectStore
.
currentProjectInfo
.
name
)
{
return
(
<
div
style=
{
{
padding
:
24
}
}
>
<
div
style=
{
{
display
:
"flex"
,
alignItems
:
"center"
}
}
>
<
img
src=
{
projectImg
}
alt=
"项目logo"
/>
<
span
style=
{
{
marginLeft
:
12
}
}
>
{
currentProjectStore
.
currentProjectInfo
.
name
}
</
span
>
</
div
>
<
Box
sx=
{
{
width
:
"100%"
,
typography
:
"body1"
}
}
>
<
Tabs
tabList=
{
tabList
}
/>
</
Box
>
</
div
>
);
}
else
{
return
<
NoProject
/>;
}
if
(
currentProjectStore
.
currentProjectInfo
.
name
)
{
return
(
<
div
style=
{
{
padding
:
24
}
}
>
<
div
style=
{
{
display
:
"flex"
,
alignItems
:
"center"
}
}
>
<
img
src=
{
projectImg
}
alt=
"项目logo"
/>
<
span
style=
{
{
marginLeft
:
12
}
}
>
{
currentProjectStore
.
currentProjectInfo
.
name
}
</
span
>
</
div
>
<
Box
sx=
{
{
width
:
"100%"
,
typography
:
"body1"
}
}
>
<
Tabs
tabList=
{
tabList
}
/>
</
Box
>
</
div
>
);
}
else
{
return
<
NoProject
/>;
}
});
export
default
memo
(
ProjectSetting
);
src/views/Project/ProjectWorkbench/workbenchList/components/simpleDialog.tsx
View file @
24d0d635
import
{
memo
,
useCallback
,
useEffect
,
useMemo
,
useState
}
from
"react"
;
import
styles
from
"../index.module.css"
;
import
{
memo
}
from
"react"
;
import
{
Box
,
Typography
}
from
"@mui/material"
;
import
Button
from
"@mui/material/Button"
;
import
Dialog
from
"@/components/mui/Dialog"
;
const
SimpleDialog
=
(
props
:
any
)
=>
{
const
{
openDialog
,
closeDialog
,
onConfirm
,
text
,
title
}
=
props
;
const
{
openDialog
,
closeDialog
,
onConfirm
,
text
,
title
}
=
props
;
return
(
<
>
<
Dialog
open=
{
openDialog
}
onClose=
{
closeDialog
}
onConfirm=
{
onConfirm
}
title=
{
title
}
>
<
Box
>
<
Typography
sx=
{
{
fontSize
:
'14px'
,
fontWeight
:
'400'
}
}
>
{
text
}
</
Typography
>
</
Box
>
</
Dialog
>
</>
);
return
(
<>
<
Dialog
open=
{
openDialog
}
onClose=
{
closeDialog
}
onConfirm=
{
onConfirm
}
title=
{
title
}
>
<
Box
>
<
Typography
sx=
{
{
fontSize
:
"14px"
,
fontWeight
:
"400"
}
}
>
{
text
}
</
Typography
>
</
Box
>
</
Dialog
>
</>
);
};
export
default
memo
(
SimpleDialog
);
src/views/Project/ProjectWorkbench/workbenchTemplate/components/simpleDialog.tsx
View file @
24d0d635
import
{
memo
,
useCallback
,
useEffect
,
useMemo
,
useState
}
from
"react"
;
import
styles
from
"../index.module.css"
;
import
{
memo
}
from
"react"
;
import
{
Box
,
Typography
}
from
"@mui/material"
;
import
Button
from
"@mui/material/Button"
;
import
Dialog
from
"@/components/mui/Dialog"
;
const
SimpleDialog
=
(
props
:
any
)
=>
{
const
{
openDialog
,
closeDialog
,
onConfirm
,
text
,
title
}
=
props
;
const
{
openDialog
,
closeDialog
,
onConfirm
,
text
,
title
}
=
props
;
return
(
<
>
<
Dialog
open=
{
openDialog
}
onClose=
{
closeDialog
}
onConfirm=
{
onConfirm
}
title=
{
title
}
>
<
Box
>
<
Typography
sx=
{
{
fontSize
:
'14px'
,
fontWeight
:
'400'
}
}
>
{
text
}
</
Typography
>
</
Box
>
</
Dialog
>
</>
);
return
(
<>
<
Dialog
open=
{
openDialog
}
onClose=
{
closeDialog
}
onConfirm=
{
onConfirm
}
title=
{
title
}
>
<
Box
>
<
Typography
sx=
{
{
fontSize
:
"14px"
,
fontWeight
:
"400"
}
}
>
{
text
}
</
Typography
>
</
Box
>
</
Dialog
>
</>
);
};
export
default
memo
(
SimpleDialog
);
src/views/Project/ProjectWorkbench/workbenchTemplate/components/templateBox.tsx
View file @
24d0d635
...
...
@@ -6,7 +6,7 @@
* @FilePath: /bkunyun/src/views/Project/ProjectWorkbench/workbenchTemplate/components/templateBox.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import
{
memo
,
useCallback
,
useEffect
,
useMemo
,
useState
}
from
"react"
;
import
{
memo
,
useCallback
}
from
"react"
;
import
styles
from
"../index.module.css"
;
import
{
Box
,
Typography
}
from
"@mui/material"
;
import
Button
from
"@/components/mui/Button"
;
...
...
@@ -14,82 +14,82 @@ import usePass from "@/hooks/usePass";
import
{
useNavigate
}
from
"react-router-dom"
;
const
TemplateBox
=
(
props
:
any
)
=>
{
const
info
=
props
.
data
;
const
isPass
=
usePass
();
const
navigate
=
useNavigate
();
const
info
=
props
.
data
;
const
isPass
=
usePass
();
const
navigate
=
useNavigate
();
const
addTemplateBlock
=
useCallback
(
(
id
:
string
)
=>
{
navigate
(
`/product/cadd/projectSubmitWork`
,
{
state
:
{
id
},
});
},
[
navigate
]
);
const
addTemplateBlock
=
useCallback
(
(
id
:
string
)
=>
{
navigate
(
`/product/cadd/projectSubmitWork`
,
{
state
:
{
id
},
});
},
[
navigate
]
);
return
(
<
Box
className=
{
styles
.
templateBlock
}
>
<
Box
>
<
Typography
sx=
{
{
fontSize
:
"14px"
,
fontWeight
:
"600"
,
color
:
"#1E2633"
,
marginBottom
:
"4px"
,
overflow
:
"hidden"
,
textOverflow
:
"ellipsis"
,
}
}
>
{
info
.
title
}
</
Typography
>
<
Box
sx=
{
{
display
:
"flex"
,
marginBottom
:
"8px"
}
}
>
<
Typography
sx=
{
{
fontSize
:
"12px"
,
fontWeight
:
"400"
,
color
:
"#1370FF"
,
marginRight
:
"24px"
,
}
}
>
版本:
{
info
.
version
}
</
Typography
>
<
Typography
sx=
{
{
fontSize
:
"12px"
,
fontWeight
:
"400"
,
color
:
"#1370FF"
}
}
>
更新时间:
{
info
.
updateTime
}
</
Typography
>
</
Box
>
<
Typography
className=
{
styles
.
templateDescText
}
>
{
info
.
description
}
</
Typography
>
</
Box
>
<
Box
sx=
{
{
display
:
"flex"
,
justifyContent
:
"end"
,
}
}
>
{
isPass
(
"PROJECT_WORKBENCH_FLOES_USE"
,
"MANAGER"
)
&&
(
<
Button
size=
{
"small"
}
text=
{
"删除模版"
}
click=
{
()
=>
{
props
.
startDialog
(
info
.
id
);
}
}
style=
{
{
backgroundColor
:
"#F0F2F5"
,
color
:
"#565C66"
}
}
/>
)
}
{
isPass
(
"PROJECT_WORKBENCH_FLOES_USE"
,
"USER"
)
&&
(
<
Button
size=
{
"small"
}
text=
{
"使用模版"
}
click=
{
()
=>
addTemplateBlock
(
info
.
id
)
}
style=
{
{
marginLeft
:
"12px"
}
}
/>
)
}
</
Box
>
</
Box
>
);
return
(
<
Box
className=
{
styles
.
templateBlock
}
>
<
Box
>
<
Typography
sx=
{
{
fontSize
:
"14px"
,
fontWeight
:
"600"
,
color
:
"#1E2633"
,
marginBottom
:
"4px"
,
overflow
:
"hidden"
,
textOverflow
:
"ellipsis"
,
}
}
>
{
info
.
title
}
</
Typography
>
<
Box
sx=
{
{
display
:
"flex"
,
marginBottom
:
"8px"
}
}
>
<
Typography
sx=
{
{
fontSize
:
"12px"
,
fontWeight
:
"400"
,
color
:
"#1370FF"
,
marginRight
:
"24px"
,
}
}
>
版本:
{
info
.
version
}
</
Typography
>
<
Typography
sx=
{
{
fontSize
:
"12px"
,
fontWeight
:
"400"
,
color
:
"#1370FF"
}
}
>
更新时间:
{
info
.
updateTime
}
</
Typography
>
</
Box
>
<
Typography
className=
{
styles
.
templateDescText
}
>
{
info
.
description
}
</
Typography
>
</
Box
>
<
Box
sx=
{
{
display
:
"flex"
,
justifyContent
:
"end"
,
}
}
>
{
isPass
(
"PROJECT_WORKBENCH_FLOES_USE"
,
"MANAGER"
)
&&
(
<
Button
size=
{
"small"
}
text=
{
"删除模版"
}
click=
{
()
=>
{
props
.
startDialog
(
info
.
id
);
}
}
style=
{
{
backgroundColor
:
"#F0F2F5"
,
color
:
"#565C66"
}
}
/>
)
}
{
isPass
(
"PROJECT_WORKBENCH_FLOES_USE"
,
"USER"
)
&&
(
<
Button
size=
{
"small"
}
text=
{
"使用模版"
}
click=
{
()
=>
addTemplateBlock
(
info
.
id
)
}
style=
{
{
marginLeft
:
"12px"
}
}
/>
)
}
</
Box
>
</
Box
>
);
};
export
default
memo
(
TemplateBox
);
src/views/WorkFlowEdit/components/ParameterSetting/index.tsx
View file @
24d0d635
import
styles
from
"./index.module.css"
;
import
{
ITask
,
IParameter
,
//
IParameter,
}
from
"../../../Project/ProjectSubmitWork/interface"
;
import
noTemplate
from
"@/assets/project/noTemplate.svg"
;
import
{
useEffect
,
useMemo
,
use
Ref
,
use
State
}
from
"react"
;
import
{
useEffect
,
useMemo
,
useState
}
from
"react"
;
import
classNames
from
"classnames"
;
type
IParameterSettingProps
=
{
...
...
@@ -15,16 +15,15 @@ type IParameterSettingProps = {
const
ParameterSetting
=
(
props
:
IParameterSettingProps
)
=>
{
const
{
templateConfigInfo
,
taskId
}
=
props
;
const
[
descRef
,
setDescRef
]
=
useState
<
any
>
(
useRef
());
const
[
descHeight
,
setDescHeight
]
=
useState
(
0
);
const
[
isShowAllDese
,
setIsShowAllDese
]
=
useState
(
false
);
const
div
=
document
.
getElementById
(
"descHeight"
);
useEffect
(()
=>
{
const
div
=
document
.
getElementById
(
"descHeight"
);
if
(
div
)
{
setDescHeight
(
div
.
offsetHeight
);
}
},
[
d
escRef
]);
},
[
d
iv
]);
const
taskInfo
:
ITask
|
null
=
useMemo
(()
=>
{
if
(
!
taskId
)
{
...
...
@@ -42,100 +41,69 @@ const ParameterSetting = (props: IParameterSettingProps) => {
},
[
templateConfigInfo
,
taskId
]);
// 输入参数
const
inParameters
:
Array
<
IParameter
>
=
useMemo
(()
=>
{
if
(
!
taskInfo
)
{
return
[];
}
else
{
return
taskInfo
.
parameters
.
filter
(
(
parameter
)
=>
parameter
.
parameterGroup
===
"in"
);
}
},
[
taskInfo
]);
//
const inParameters: Array<IParameter> = useMemo(() => {
//
if (!taskInfo) {
//
return [];
//
} else {
//
return taskInfo.parameters.filter(
//
(parameter) => parameter.parameterGroup === "in"
//
);
//
}
//
}, [taskInfo]);
// 输出参数
const
outParameters
:
Array
<
IParameter
>
=
useMemo
(()
=>
{
if
(
!
taskInfo
)
{
return
[];
}
else
{
return
taskInfo
.
parameters
.
filter
(
(
parameter
)
=>
parameter
.
parameterGroup
===
"out"
);
}
},
[
taskInfo
]);
//
//
输出参数
//
const outParameters: Array<IParameter> = useMemo(() => {
//
if (!taskInfo) {
//
return [];
//
} else {
//
return taskInfo.parameters.filter(
//
(parameter) => parameter.parameterGroup === "out"
//
);
//
}
//
}, [taskInfo]);
// 基础参数
const
basisParameters
:
Array
<
IParameter
>
=
useMemo
(()
=>
{
if
(
!
taskInfo
)
{
return
[];
}
else
{
return
taskInfo
.
parameters
.
filter
(
(
parameter
)
=>
parameter
.
parameterGroup
===
"basis"
);
}
},
[
taskInfo
]);
//
//
基础参数
//
const basisParameters: Array<IParameter> = useMemo(() => {
//
if (!taskInfo) {
//
return [];
//
} else {
//
return taskInfo.parameters.filter(
//
(parameter) => parameter.parameterGroup === "basis"
//
);
//
}
//
}, [taskInfo]);
// 高级选项
const
seniorParameters
:
Array
<
IParameter
>
=
useMemo
(()
=>
{
if
(
!
taskInfo
)
{
return
[];
}
else
{
return
taskInfo
.
parameters
.
filter
(
(
parameter
)
=>
parameter
.
parameterGroup
===
"senior"
);
}
},
[
taskInfo
]);
//
//
高级选项
//
const seniorParameters: Array<IParameter> = useMemo(() => {
//
if (!taskInfo) {
//
return [];
//
} else {
//
return taskInfo.parameters.filter(
//
(parameter) => parameter.parameterGroup === "senior"
//
);
//
}
//
}, [taskInfo]);
// 硬件配置
const
hardwareParameters
:
Array
<
IParameter
>
=
useMemo
(()
=>
{
if
(
!
taskInfo
)
{
return
[];
}
else
{
return
taskInfo
.
parameters
.
filter
(
(
parameter
)
=>
parameter
.
parameterGroup
===
"hardware"
);
}
},
[
taskInfo
]);
//
//
硬件配置
//
const hardwareParameters: Array<IParameter> = useMemo(() => {
//
if (!taskInfo) {
//
return [];
//
} else {
//
return taskInfo.parameters.filter(
//
(parameter) => parameter.parameterGroup === "hardware"
//
);
//
}
//
}, [taskInfo]);
return
(
<
div
className=
{
styles
.
parameterSetting
}
>
{
/* <div className={styles.taskInfo}>
<div className={styles.taskTitle}>taskTitle</div>
<div className={styles.taskVersion}>version</div>
<div
className={styles.taskDescriptionHeight}
id="descHeight"
ref={descRef}
>
埃里克梵蒂冈和艰苦拉萨规定了卡号是德国埃里克梵蒂冈和艰苦拉萨规定了卡号是德国埃里克梵蒂冈和艰苦拉萨规定了卡号是德国埃里克梵蒂冈和艰苦拉萨规定了卡号是德国埃里克梵蒂冈和艰苦拉萨规定了卡号是德国埃里克梵蒂冈和艰苦拉萨规定了卡号是德国
</div>
<div
className={classNames({
[styles.taskDescriptionAll]: isShowAllDese,
[styles.taskDescription]: !isShowAllDese,
})}
>
埃里克梵蒂冈和艰苦拉萨规定了卡号是德国埃里克梵蒂冈和艰苦拉萨规定了卡号是德国埃里克梵蒂冈和艰苦拉萨规定了卡号是德国埃里克梵蒂冈和艰苦拉萨规定了卡号是德国埃里克梵蒂冈和艰苦拉萨规定了卡号是德国埃里克梵蒂冈和艰苦拉萨规定了卡号是德国
{descHeight > 60 && (
<span
className={styles.descButton}
onClick={() => setIsShowAllDese(!isShowAllDese)}
>
{isShowAllDese ? "收起" : "展开"}
</span>
)}
</div>
</div> */
}
{
taskInfo
&&
(
<
div
className=
{
styles
.
taskInfo
}
>
<
div
className=
{
styles
.
taskTitle
}
>
{
taskInfo
.
title
||
"-"
}
</
div
>
<
div
className=
{
styles
.
taskVersion
}
>
版本:
{
taskInfo
.
version
||
"-"
}
</
div
>
<
div
className=
{
styles
.
taskDescriptionHeight
}
id=
"descHeight"
ref=
{
descRef
}
>
<
div
className=
{
styles
.
taskDescriptionHeight
}
id=
"descHeight"
>
{
taskInfo
.
description
||
"-"
}
</
div
>
<
div
...
...
@@ -156,12 +124,12 @@ const ParameterSetting = (props: IParameterSettingProps) => {
</
div
>
</
div
>
)
}
{
/* {
!taskInfo && (
{
!
taskInfo
&&
(
<
div
className=
{
styles
.
noData
}
>
<
img
src=
{
noTemplate
}
alt=
""
className=
{
styles
.
noDataImg
}
/>
<
span
className=
{
styles
.
noDataText
}
>
选中任意算子进行参数设置
</
span
>
</
div
>
)}
*/
}
)
}
</
div
>
);
};
...
...
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