Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xiaomai-cloud-class-web
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiaomai-cloud-class
xiaomai-cloud-class-web
Commits
b3ffb2aa
Commit
b3ffb2aa
authored
Mar 09, 2021
by
zhangleyuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:修改培训任务排序模块
parent
e5794c62
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
8 deletions
+18
-8
src/modules/plan-manage/components/TrainingTask.jsx
+18
-8
No files found.
src/modules/plan-manage/components/TrainingTask.jsx
View file @
b3ffb2aa
...
...
@@ -2,7 +2,7 @@
* @Author: zhangleyuan
* @Date: 2021-02-20 16:45:51
* @LastEditors: zhangleyuan
* @LastEditTime: 2021-03-0
8 20:59:14
* @LastEditTime: 2021-03-0
9 10:04:40
* @Description: 描述一下
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -192,9 +192,12 @@ class TrainingTask extends React.Component {
console
.
log
(
"newIndex"
,
newIndex
);
if
(
oldIndex
!==
newIndex
)
{
const
newData
=
arrayMove
([].
concat
(
dataSource
),
oldIndex
,
newIndex
).
filter
(
el
=>
!!
el
);
console
.
log
(
"newData"
,
newData
)
this
.
setState
({
dataSource
:
newData
});
this
.
setState
({
dataSource
:
[...
newData
]
});
}
};
onTaskSortEnd
=
({
oldIndex
,
newIndex
})
=>
{
...
...
@@ -204,7 +207,9 @@ class TrainingTask extends React.Component {
console
.
log
(
"newIndex"
,
newIndex
);
if
(
oldIndex
!==
newIndex
)
{
const
newData
=
arrayMove
([].
concat
(
dataSource
),
oldIndex
,
newIndex
).
filter
(
el
=>
!!
el
);
console
.
log
(
"newData"
,
newData
)
this
.
setState
({
dataSource
:
newData
});
}
};
...
...
@@ -246,6 +251,7 @@ class TrainingTask extends React.Component {
taskName
:
''
,
index
:
dataSource
.
length
,
type
:
'input'
,
open
:
false
,
courseList
:[
]
}
...
...
@@ -341,6 +347,11 @@ class TrainingTask extends React.Component {
renderTaskItem
=
(
record
,
index
)
=>
{
return
<
div
>
<
span
>
<
span
></
span
>
</
span
>
{
record
.
type
===
'input'
?
<
Form
>
<
Form
.
Item
...
...
@@ -386,7 +397,7 @@ class TrainingTask extends React.Component {
const
{
data
}
=
this
.
props
;
return
(
<
div
className=
"training-task"
>
{
/*
<Table
<
Table
pagination=
{
false
}
dataSource=
{
dataSource
}
columns=
{
this
.
parseTaskColumns
()
}
...
...
@@ -418,19 +429,18 @@ class TrainingTask extends React.Component {
row
:
this
.
DraggableBodyRow
,
},
}
}
/> */
}
<
SortableTaskContainer
/>
{
/* <SortableTaskContainer
useDragHandle
disableAutoscroll
helperClass="row-dragging"
onSortEnd={this.onTaskSortEnd}
>
{
data
.
map
((
item
,
index
)
=>
{data
Source
.map((item, index) =>
<SortableTaskItem taskItem={this.renderTaskItem(item,index)} index={index}>
</SortableTaskItem>
)}
</
SortableTaskContainer
>
</SortableTaskContainer>
*/
}
<
div
><
Button
onClick=
{
()
=>
this
.
addTask
()
}
><
span
>
+
</
span
><
span
>
添加任务
</
span
></
Button
></
div
>
{
relatedCourseModalVisible
&&
...
...
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