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
27b686a0
Commit
27b686a0
authored
Oct 14, 2022
by
chenshouchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加setShowCpuList设置时机
parent
d2ceda89
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
42 deletions
+35
-42
index.tsx
src/components/BusinessComponents/QueueSelect/index.tsx
+32
-41
index.tsx
src/views/Project/ProjectSubmitWork/index.tsx
+3
-1
No files found.
src/components/BusinessComponents/QueueSelect/index.tsx
View file @
27b686a0
...
...
@@ -93,38 +93,6 @@ const QueueSelect = (props: IQueueSelectProps) => {
];
},
[
originalCpuList
,
originalGpuList
]);
useEffect
(()
=>
{
let
resultList
:
Array
<
IShowCPULi
>
=
[];
originalCpuList
.
forEach
((
item
)
=>
{
const
targetIndex
=
resultList
.
findIndex
((
resultLi
)
=>
{
return
resultLi
.
name
===
item
.
name
;
});
if
(
targetIndex
===
-
1
)
{
resultList
.
push
({
name
:
item
.
name
,
picUrl
:
item
.
picUrl
,
cpuName
:
item
.
cpuName
,
coreNum
:
item
.
coreNum
,
partition
:
item
.
partition
,
memoryList
:
[
{
memory
:
item
.
memory
,
total
:
item
.
total
,
partition
:
item
.
partition
,
},
],
});
}
else
{
resultList
[
targetIndex
].
memoryList
.
push
({
memory
:
item
.
memory
,
total
:
item
.
total
,
partition
:
item
.
partition
,
});
}
});
setShowCpuList
(
resultList
);
},
[
originalCpuList
]);
const
cpuHeadCells
=
[
{
id
:
"type"
,
...
...
@@ -168,31 +136,54 @@ const QueueSelect = (props: IQueueSelectProps) => {
// 有初始值的话显示初始值
useEffect
(()
=>
{
let
resultList
:
Array
<
IShowCPULi
>
=
[];
originalCpuList
.
forEach
((
item
)
=>
{
const
targetIndex
=
resultList
.
findIndex
((
resultLi
)
=>
{
return
resultLi
.
name
===
item
.
name
;
});
if
(
targetIndex
===
-
1
)
{
resultList
.
push
({
name
:
item
.
name
,
picUrl
:
item
.
picUrl
,
cpuName
:
item
.
cpuName
,
coreNum
:
item
.
coreNum
,
partition
:
item
.
partition
,
memoryList
:
[
{
memory
:
item
.
memory
,
total
:
item
.
total
,
partition
:
item
.
partition
,
},
],
});
}
else
{
resultList
[
targetIndex
].
memoryList
.
push
({
memory
:
item
.
memory
,
total
:
item
.
total
,
partition
:
item
.
partition
,
});
}
});
if
(
open
&&
value
)
{
console
.
log
(
open
,
"open"
);
console
.
log
(
value
,
"value"
);
const
cpuActivePartitionIndex
=
originalCpuList
.
findIndex
(
(
li
)
=>
li
.
partition
===
value
);
console
.
log
(
cpuActivePartitionIndex
,
"cpuActivePartitionIndex"
);
let
cpuActivePartitionName
=
""
;
if
(
cpuActivePartitionIndex
!==
-
1
)
{
cpuActivePartitionName
=
originalCpuList
[
cpuActivePartitionIndex
].
name
;
}
const
showCpuListClone
:
Array
<
IShowCPULi
>
=
cloneDeep
(
showCpuList
);
if
(
cpuActivePartitionIndex
!==
-
1
)
{
showCpuListClone
.
forEach
((
li
,
index
)
=>
{
resultList
.
forEach
((
li
,
index
)
=>
{
if
(
li
.
name
===
cpuActivePartitionName
)
{
console
.
log
(
value
);
showCpuListClone
[
index
].
partition
=
value
;
resultList
[
index
].
partition
=
value
;
}
});
setShowCpuList
(
showCpuListClone
);
}
setActivePartition
(
value
);
}
setShowCpuList
(
resultList
);
// eslint-disable-next-line
},
[
open
,
value
]);
},
[
open
,
value
,
originalCpuList
]);
const
renderType
=
(
item
:
IShowCPULi
)
=>
{
return
(
...
...
src/views/Project/ProjectSubmitWork/index.tsx
View file @
27b686a0
...
...
@@ -93,8 +93,10 @@ const ProjectSubmitWork = observer(() => {
:
String
(
parameter
.
defaultValue
);
}
else
if
((
parameter
.
domType
||
""
).
toLowerCase
()
===
"radio"
)
{
value
=
false
;
}
else
if
((
parameter
.
domType
||
""
).
toLowerCase
()
===
"partition"
)
{
value
=
false
;
}
else
{
value
=
""
;
value
=
parameter
.
defaultValue
;
}
parameter
.
value
=
value
;
});
...
...
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