Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sass-admin
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
hqzhdj_app
sass-admin
Commits
2bdfeaae
Commit
2bdfeaae
authored
Apr 02, 2025
by
yanglang123
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增工作任务已下架新增,移动,删除功能
parent
f7f43b43
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
166 additions
and
29 deletions
+166
-29
src/pages/TrainingTools/Question/Create/AddTest.jsx
+0
-24
src/pages/TrainingTools/Question/Create/TestModal.jsx
+4
-3
src/pages/TrainingTools/Question/Details/index.css
+42
-0
src/pages/TrainingTools/Question/Details/index.jsx
+84
-2
src/pages/TrainingTools/Question/redux/actions.js
+34
-0
src/pages/TrainingTools/Question/redux/api.js
+2
-0
No files found.
src/pages/TrainingTools/Question/Create/AddTest.jsx
View file @
2bdfeaae
...
...
@@ -260,30 +260,6 @@ class AddTest extends Component {
required
:
this
.
addother
.
state
.
ismust
?
1
:
0
,
},
};
// console.log("777777777", param)
// return
// if( !(param.minSelectItem !== '' && param.minSelectItem <= param.questionOptions.length-1 && param.minSelectItem > 0)) {
// message.error('最少项错误')
// this.setState({
// confirmLoading: false,
// });
// return
// }
// // 判断最大可选
// if( param.maxSelectItem !== '' && param.maxSelectItem > param.questionOptions.length){
// message.error('最多项错误')
// this.setState({
// confirmLoading: false,
// });
// return
// }else if(param.maxSelectItem !== '' && param.minSelectItem !==''&& param.maxSelectItem < param.minSelectItem){
// message.error('最多项不能小于最少项')
// this.setState({
// confirmLoading: false,
// });
// return
// }
const
temp
=
{
questions
:
[{
id
:
editid
,
...
param
}],
researchId
:
surid
,
...
...
src/pages/TrainingTools/Question/Create/TestModal.jsx
View file @
2bdfeaae
...
...
@@ -323,7 +323,7 @@ class TestModal extends Component {
{
keys1
.
map
((
item
,
k
)
=>
{
// console.log(item.correct?item.correct!==0:false)
return
(
<
Row
gutter=
{
23
}
>
<
Row
key=
{
item
.
no
}
gutter=
{
23
}
>
<
FormItem
style=
{
{
display
:
"none"
}
}
>
{
getFieldDecorator
(
`no[${item.no}]`
,
{
initialValue
:
item
.
no
,
...
...
@@ -489,7 +489,7 @@ class TestModal extends Component {
</
Row
>
{
keys2
.
map
((
item
,
k
)
=>
{
return
(
<
Row
gutter=
{
23
}
>
<
Row
key=
{
item
.
no
}
gutter=
{
23
}
>
<
FormItem
style=
{
{
display
:
"none"
}
}
>
{
getFieldDecorator
(
`no[${item.no}]`
,
{
initialValue
:
item
.
no
,
...
...
@@ -705,7 +705,8 @@ class TestModal extends Component {
{
keys3
.
map
((
item
,
k
)
=>
{
// console.log(item)
return
(
<
Row
gutter=
{
23
}
>
// 添加 key 属性
<
Row
key=
{
item
.
no
}
gutter=
{
23
}
>
<
FormItem
style=
{
{
display
:
"none"
}
}
>
{
getFieldDecorator
(
`no[${item.no}]`
,
{
initialValue
:
item
.
no
,
...
...
src/pages/TrainingTools/Question/Details/index.css
0 → 100644
View file @
2bdfeaae
.survey-details
{
padding
:
20px
60px
;
}
.survey-details-title
:before
{
content
:
""
;
display
:
inline-block
;
width
:
5px
;
height
:
20px
;
background-color
:
#0e77ca
;
vertical-align
:
middle
;
margin-right
:
15px
;
}
.survey-details-pagination
{
text-align
:
center
;
padding
:
40px
0
;
}
.survey-details-return
{
display
:
block
;
width
:
100%
;
text-align
:
center
;
margin
:
40px
0
;
}
.dqorde
{
height
:
200px
;
text-align
:
center
;
line-height
:
200px
;
}
.survey-details
.ant-table-header
{
padding-bottom
:
20px
!important
;
}
.survey-details
.ant-table-fixed-header
.ant-table-scroll
.ant-table-header
{
overflow
:
hidden
;
}
.survey-addtest
.ant-table-header
{
padding-bottom
:
20px
!important
;
}
.survey-addtest
.ant-table-fixed-header
.ant-table-scroll
.ant-table-header
{
overflow
:
hidden
;
}
.marr10
{
margin-right
:
10px
;
}
src/pages/TrainingTools/Question/Details/index.jsx
View file @
2bdfeaae
...
...
@@ -23,6 +23,8 @@ import {
jumpTestFetch
,
jumpReset
,
editTestFetch
,
insertTestFetch
,
moveTestFetch
,
updateFetch
,
}
from
"../redux/actions"
;
// import Remind from '../../../../common/remind'
...
...
@@ -285,6 +287,26 @@ class Details extends Component {
});
this
.
props
.
jump
({
id
:
item
.
id
});
}
dremove
(
record
)
{
const
{
surid
}
=
this
.
props
;
this
.
props
.
edit
(
{
deleteIds
:
[
record
.
id
]
},
surid
,
this
.
state
.
pageNo
,
this
.
state
.
pageSize
);
}
//上移下移 1下移 2上移
handleMove
(
record
,
type
)
{
let
newNo
=
type
==
2
?
record
.
no
-
1
:
record
.
no
+
1
;
const
{
surid
}
=
this
.
props
;
this
.
props
.
move
(
{
questionId
:
record
.
id
,
no
:
newNo
},
surid
,
this
.
state
.
pageNo
,
this
.
state
.
pageSize
);
}
handleOk
()
{
const
{
surid
}
=
this
.
props
;
const
{
order
,
editstate
,
editid
}
=
this
.
state
;
...
...
@@ -573,13 +595,49 @@ class Details extends Component {
key
:
"operation"
,
width
:
100
,
render
:
(
text
,
record
)
=>
(
<
div
style=
{
{
display
:
"
inline
"
}
}
>
<
div
style=
{
{
display
:
"
flex
"
}
}
>
{
this
.
state
.
isupdata
==
1
&&
(
<
a
onClick=
{
()
=>
this
.
handleTestView
(
record
)
}
>
编辑
</
a
>
)
}
{
this
.
state
.
isupdata
==
2
&&
(
<
a
onClick=
{
()
=>
this
.
handleTestView1
(
record
)
}
>
查看
</
a
>
)
}
<
a
style=
{
{
marginLeft
:
"10px"
}
}
onClick=
{
()
=>
this
.
dremove
(
record
)
}
>
删除
</
a
>
{
record
.
no
===
1
?
(
<
a
style=
{
{
marginLeft
:
"10px"
}
}
onClick=
{
()
=>
this
.
handleMove
(
record
,
1
)
}
>
下移
</
a
>
)
:
tlist
.
list
.
length
===
record
.
no
?
(
<
a
style=
{
{
marginLeft
:
"10px"
}
}
onClick=
{
()
=>
this
.
handleMove
(
record
,
2
)
}
>
上移
</
a
>
)
:
(
<>
<
a
style=
{
{
marginLeft
:
"10px"
}
}
onClick=
{
()
=>
this
.
handleMove
(
record
,
2
)
}
>
上移
</
a
>
<
a
style=
{
{
marginLeft
:
"10px"
}
}
onClick=
{
()
=>
this
.
handleMove
(
record
,
1
)
}
>
下移
</
a
>
</>
)
}
</
div
>
),
},
...
...
@@ -706,7 +764,29 @@ class Details extends Component {
getFieldDecorator=
{
getFieldDecorator
}
changeTask=
{
this
.
changeTask
}
/>
<
p
className=
"survey-details-title"
>
问题列表
</
p
>
<
div
style=
{
{
display
:
"flex"
}
}
>
<
p
style=
{
{
marginRight
:
"15px"
}
}
className=
"survey-details-title"
>
问题列表
</
p
>
<
Button
type=
"primary"
onClick=
{
()
=>
{
this
.
setState
({
visibleQuestion
:
true
,
testItem
:
{},
editstate
:
false
,
editid
:
""
,
canEdit
:
true
,
});
}
}
>
添加问题
</
Button
>
</
div
>
<
div
>
<
Table
size=
"default"
...
...
@@ -886,6 +966,8 @@ function mapDispatchToProps(dispatch) {
update
:
(
obj
,
callback
)
=>
dispatch
(
updateFetch
(
obj
,
callback
)),
jumpreset
:
()
=>
dispatch
(
jumpReset
()),
edit
:
(
obj
,
id
,
no
,
size
)
=>
dispatch
(
editTestFetch
(
obj
,
id
,
no
,
size
)),
move
:
(
obj
,
id
,
no
,
size
)
=>
dispatch
(
moveTestFetch
(
obj
,
id
,
no
,
size
)),
insert
:
(
obj
,
no
,
size
)
=>
dispatch
(
insertTestFetch
(
obj
,
no
,
size
)),
};
}
...
...
src/pages/TrainingTools/Question/redux/actions.js
View file @
2bdfeaae
...
...
@@ -576,6 +576,40 @@ export function editTestFetch(params, surid, no, size) {
};
}
//编辑问题
export
function
moveTestFetch
(
params
,
surid
,
no
,
size
)
{
console
.
log
(
surid
);
let
param
=
{
...
params
,
researchId
:
surid
};
let
url
=
api
.
moveTestFetch
;
return
dispatch
=>
{
return
request
({
url
:
url
,
data
:
param
,
}).
then
(
res
=>
{
if
(
res
.
code
===
"1000"
)
{
dispatch
({
type
:
Types
.
EDIT_TEST
,
data
:
res
.
data
});
dispatch
(
getTestListFetch
({
researchId
:
surid
,
pageNo
:
no
,
pageSize
:
size
})
);
message
.
success
(
"操作成功"
);
}
else
{
message
.
success
(
"操作失败"
);
}
});
// return fetch(url2 + `/batch/update`, {type: 'post', data: param}).then((res) => {
//
// if (res.code === "1000") {
// dispatch({type: Types.EDIT_TEST, data: res.data})
// dispatch(getTestListFetch({researchId: surid, pageNo: no, pageSize: size}))
// message.success('操作成功');
// } else {
// message.success('操作失败');
// }
// })
};
}
//跳题
export
function
jumpTestFetch
(
param
)
{
// console.log(param)
...
...
src/pages/TrainingTools/Question/redux/api.js
View file @
2bdfeaae
...
...
@@ -25,6 +25,8 @@ export default {
editTestFetch
:
`POST
${
services
.
webManage
}
/researchQuestion/batch/update`
,
moveTestFetch
:
`POST
${
services
.
webManage
}
/researchQuestion/batch/updateNo`
,
jumpTestFetch
:
`GET
${
services
.
webManage
}
/researchQuestion/jump/question/list`
,
postNewsList
:
`GET
${
services
.
newMessage
}
/manage/message/getList`
,
...
...
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