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
ae4a75f2
Commit
ae4a75f2
authored
Sep 15, 2025
by
chengming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
投票优化
parent
df3681e1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
145 additions
and
116 deletions
+145
-116
src/pages/Dashboard/index.js
+1
-1
src/pages/TrainingTools/Question/Details/index.jsx
+44
-42
src/pages/TrainingTools/Question/index.jsx
+28
-19
src/pages/TrainingTools/Survey/Details/index.jsx
+35
-34
src/pages/TrainingTools/Survey/index.jsx
+37
-20
No files found.
src/pages/Dashboard/index.js
View file @
ae4a75f2
...
...
@@ -469,7 +469,7 @@ class homePage extends Component {
xAxis
:
[
{
type
:
"category"
,
data
:
[
"一次合格率"
,
"
补考
合格率"
],
data
:
[
"一次合格率"
,
"合格率"
],
boundaryGap
:
[
"0%"
,
"0%"
],
axisLine
:
{
show
:
false
,
// 确保显示 Y 轴线
...
...
src/pages/TrainingTools/Question/Details/index.jsx
View file @
ae4a75f2
...
...
@@ -241,7 +241,8 @@ class Details extends Component {
companyCode
+
"/"
+
siteCode
+
"/index/tool/question/question-management"
"/index/tool/question/question-management?tab="
+
(
this
.
state
.
isupdata
==
1
?
"2"
:
"1"
)
);
}
});
...
...
@@ -504,46 +505,46 @@ class Details extends Component {
</
div
>
),
},
{
title
:
"跳题策略"
,
dataIndex
:
"action"
,
key
:
"action"
,
width
:
300
,
render
:
(
text
,
record
)
=>
(
<
div
>
<
div
>
<
Select
style=
{
{
width
:
"200px"
}
}
defaultValue=
{
record
.
jumpNum
?
`跳转至编号${record.jumpNum}题目`
:
record
.
jumpType
==
1
?
-
1
:
-
2
}
disabled
onChange=
{
value
=>
this
.
handleSelectChange
(
value
,
record
)
}
onDropdownVisibleChange=
{
open
=>
this
.
jump
(
open
,
record
)
}
getPopupContainer=
{
()
=>
document
.
getElementById
(
"djump"
)
}
>
<
Option
value=
{
-
2
}
>
按顺序填写下一题
</
Option
>
{
record
.
type
==
1
?
(
<
Option
value=
{
-
1
}
>
按选项跳题
</
Option
>
)
:
null
}
{
children
}
</
Select
>
{
record
.
jumpType
==
1
?
(
<
a
style=
{
{
marginLeft
:
"20px"
}
}
onClick=
{
()
=>
this
.
showdanxuan
(
record
)
}
>
查看选项跳题规则
</
a
>
)
:
null
}
</
div
>
</
div
>
),
},
//
{
//
title: "跳题策略",
//
dataIndex: "action",
//
key: "action",
//
width: 300,
//
render: (text, record) => (
//
<div>
//
<div>
//
<Select
//
style={{ width: "200px" }}
//
defaultValue={
//
record.jumpNum
//
? `跳转至编号${record.jumpNum}题目`
//
: record.jumpType == 1
//
? -1
//
: -2
//
}
//
onChange={value => this.handleSelectChange(value, record)}
//
onDropdownVisibleChange={open => this.jump(open, record)}
//
getPopupContainer={() => document.getElementById("djump")}
//
>
//
<Option value={-2}>按顺序填写下一题</Option>
//
{record.type == 1 ? (
//
<Option value={-1}>按选项跳题</Option>
//
) : null}
//
{children}
//
</Select>
//
{record.jumpType == 1 ? (
//
<a
//
style={{ marginLeft: "20px" }}
//
onClick={() => this.showdanxuan(record)}
//
>
//
查看选项跳题规则
//
</a>
//
) : null}
//
</div>
//
</div>
//
),
//
},
{
title
:
"操作"
,
dataIndex
:
"operation"
,
...
...
@@ -763,7 +764,8 @@ class Details extends Component {
companyCode
+
"/"
+
siteCode
+
"/index/tool/question/question-management"
"/index/tool/question/question-management?tab="
+
(
this
.
state
.
isupdata
==
1
?
"2"
:
"1"
)
}
>
<
Button
>
返回
</
Button
>
...
...
src/pages/TrainingTools/Question/index.jsx
View file @
ae4a75f2
...
...
@@ -25,7 +25,7 @@ import {
import
Breadcrumb
from
"@/common/Breadcrumb"
;
const
TabPane
=
Tabs
.
TabPane
;
import
styles
from
"./style/index.less"
;
import
{
withRouter
}
from
"react-router-dom"
;
var
companyCode
=
location
.
pathname
.
split
(
"/"
)[
1
];
var
siteCode
=
location
.
pathname
.
split
(
"/"
)[
2
];
...
...
@@ -55,23 +55,32 @@ class Survey extends Component {
}
componentDidMount
()
{
this
.
props
.
getlist
({
state
:
1
,
pageNo
:
1
,
pageSize
:
20
,
bizType
:
1
});
this
.
props
.
getlist
({
state
:
2
,
pageNo
:
1
,
pageSize
:
20
,
bizType
:
1
const
searchParams
=
new
URLSearchParams
(
this
.
props
.
location
.
search
);
const
tab
=
searchParams
.
get
(
'tab'
);
const
initialKey
=
tab
?
parseInt
(
tab
)
:
1
;
this
.
setState
({
key
:
initialKey
},
()
=>
{
// 根据初始key设置对应的action和deleteBtn状态
this
.
callback
(
initialKey
.
toString
());
// 加载对应状态的数据
this
.
props
.
getlist
({
state
:
initialKey
,
pageNo
:
1
,
pageSize
:
20
,
bizType
:
1
});
});
this
.
props
.
getlist
({
state
:
0
,
pageNo
:
1
,
pageSize
:
20
,
bizType
:
1
// 同时加载其他状态的数据(可选)
const
otherStates
=
[
1
,
2
,
0
].
filter
(
state
=>
state
!==
initialKey
);
otherStates
.
forEach
(
state
=>
{
this
.
props
.
getlist
({
state
:
state
,
pageNo
:
1
,
pageSize
:
20
,
bizType
:
1
});
});
}
...
...
@@ -464,7 +473,7 @@ class Survey extends Component {
</
div
>
<
Tabs
className=
{
styles
.
survey_tabs
}
defaultActiveKey=
"1"
activeKey=
{
this
.
state
.
key
.
toString
()
}
onChange=
{
this
.
callback
}
>
<
TabPane
tab=
"已上架"
key=
"1"
>
...
...
@@ -558,4 +567,4 @@ function mapDispatchToProps(dispatch) {
};
}
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
Survey
);
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
withRouter
(
Survey
)
);
src/pages/TrainingTools/Survey/Details/index.jsx
View file @
ae4a75f2
...
...
@@ -164,10 +164,11 @@ class Details extends Component {
console
.
log
(
"跳转"
,
this
.
props
);
this
.
props
.
history
.
push
(
"/"
+
companyCode
+
"/"
+
siteCode
+
"/index/tool/survey/survey-management"
companyCode
+
"/"
+
siteCode
+
"/index/tool/survey/survey-management?tab="
+
(
this
.
state
.
isupdata
==
1
?
"2"
:
"1"
)
);
}
});
...
...
@@ -221,7 +222,7 @@ class Details extends Component {
const
param
=
{
type
:
values
.
type
,
content
:
values
.
content
,
contentAppendixUrl
:
this
.
state
.
fileUrl
?
this
.
state
.
fileUrl
:
""
,
contentAppendixUrl
:
this
.
state
.
fileUrl
?
this
.
state
.
fileUrl
:
this
.
state
.
testItem
.
contentAppendixUrl
?
this
.
state
.
testItem
.
contentAppendixUrl
:
""
,
needAnswer
:
values
.
needAnswer
?
1
:
0
,
questionOptions
:
objs
,
maxSelectItem
:
values
.
needAnswer2
?
values
.
maxSelectItem
:
""
,
...
...
@@ -294,16 +295,15 @@ class Details extends Component {
},
defaultUrl
:
this
.
state
.
testItem
.
contentAppendixUrl
?
[
{
uid
:
1
,
status
:
"done"
,
url
:
this
.
state
.
testItem
.
contentAppendixUrl
,
name
:
this
.
state
.
testItem
.
contentAppendixUrl
.
split
(
"prefix="
)[
1
],
},
]
{
uid
:
1
,
status
:
"done"
,
url
:
this
.
state
.
testItem
.
contentAppendixUrl
,
name
:
this
.
state
.
testItem
.
contentAppendixUrl
.
split
(
"prefix="
)[
1
],
},
]
:
[],
};
const
formItemLayout
=
{
labelCol
:
{
span
:
6
},
wrapperCol
:
{
span
:
14
},
...
...
@@ -427,25 +427,25 @@ class Details extends Component {
<
Input
defaultValue=
{
details
.
point
}
disabled
/>
</
FormItem
>
{
// 修改
details
.
remind
?
(
<
MessageRemind
formItemLayout=
{
formItemLayout
}
style=
{
{
marginLeft
:
"170px"
}
}
relationId=
{
this
.
id
}
remind=
{
details
.
remind
}
usable=
{
true
}
relationType=
{
3
}
wrappedComponentRef=
{
form
=>
(
this
.
messageRemind
=
form
)
}
/>
)
:
(
<
MessageRemind
formItemLayout=
{
formItemLayout
}
style=
{
{
marginLeft
:
"170px"
}
}
relationType=
{
3
}
usable=
{
true
}
wrappedComponentRef=
{
form
=>
(
this
.
messageRemind
=
form
)
}
/>
)
}
details
.
remind
?
(
<
MessageRemind
formItemLayout=
{
formItemLayout
}
style=
{
{
marginLeft
:
"170px"
}
}
relationId=
{
this
.
id
}
remind=
{
details
.
remind
}
usable=
{
true
}
relationType=
{
3
}
wrappedComponentRef=
{
form
=>
(
this
.
messageRemind
=
form
)
}
/>
)
:
(
<
MessageRemind
formItemLayout=
{
formItemLayout
}
style=
{
{
marginLeft
:
"170px"
}
}
relationType=
{
3
}
usable=
{
true
}
wrappedComponentRef=
{
form
=>
(
this
.
messageRemind
=
form
)
}
/>
)
}
<
div
style=
{
{
display
:
"flex"
,
...
...
@@ -491,7 +491,8 @@ class Details extends Component {
companyCode
+
"/"
+
siteCode
+
"/index/tool/survey/survey-management"
"/index/tool/survey/survey-management?tab="
+
(
this
.
state
.
isupdata
==
1
?
"2"
:
"1"
)
}
>
<
Button
>
返回
</
Button
>
...
...
@@ -518,7 +519,7 @@ class Details extends Component {
<
LinkUser
type=
{
this
.
type
==
"2"
?
"look"
:
""
}
invisible=
{
false
}
getData=
{
()
=>
{}
}
getData=
{
()
=>
{
}
}
initData=
{
details
.
authorizes
}
types=
{
"research"
}
groupTypes=
{
"research"
}
...
...
src/pages/TrainingTools/Survey/index.jsx
View file @
ae4a75f2
...
...
@@ -25,7 +25,8 @@ import {
import
Breadcrumb
from
"@/common/Breadcrumb"
;
const
TabPane
=
Tabs
.
TabPane
;
import
styles
from
"./style/index.less"
;
// 在import部分添加
import
{
withRouter
}
from
"react-router-dom"
;
var
companyCode
=
location
.
pathname
.
split
(
"/"
)[
1
];
var
siteCode
=
location
.
pathname
.
split
(
"/"
)[
2
];
...
...
@@ -54,21 +55,36 @@ class Survey extends Component {
this
.
handleEdit
=
this
.
handleEdit
.
bind
(
this
);
}
// 修改componentDidMount方法
componentDidMount
()
{
this
.
props
.
getlist
({
state
:
1
,
pageNo
:
1
,
pageSize
:
20
,
});
this
.
props
.
getlist
({
state
:
2
,
pageNo
:
1
,
pageSize
:
20
,
// 解析URL参数
const
searchParams
=
new
URLSearchParams
(
this
.
props
.
location
.
search
);
const
tab
=
searchParams
.
get
(
'tab'
);
const
initialKey
=
tab
?
parseInt
(
tab
)
:
1
;
this
.
setState
({
key
:
initialKey
},
()
=>
{
// 根据初始key设置对应的action和deleteBtn状态
this
.
callback
(
initialKey
.
toString
());
// 加载对应状态的数据
this
.
props
.
getlist
({
state
:
initialKey
,
pageNo
:
1
,
pageSize
:
20
,
});
});
this
.
props
.
getlist
({
state
:
0
,
pageNo
:
1
,
pageSize
:
20
,
// 同时加载其他状态的数据(可选)
const
otherStates
=
[
1
,
2
,
0
].
filter
(
state
=>
state
!==
initialKey
);
otherStates
.
forEach
(
state
=>
{
this
.
props
.
getlist
({
state
:
state
,
pageNo
:
1
,
pageSize
:
20
,
});
});
}
...
...
@@ -114,7 +130,7 @@ class Survey extends Component {
{
searchValue
,
},
function
()
{
function
()
{
this
.
setState
(
{
pageNo
:
1
,
...
...
@@ -281,8 +297,8 @@ class Survey extends Component {
key
===
1
?
record
.
releaseTime
:
key
===
2
?
record
.
unReleaseTime
:
record
.
createTime
?
record
.
unReleaseTime
:
record
.
createTime
).
format
(
"YYYY-MM-DD HH:mm"
)
}
</
span
>
),
...
...
@@ -307,7 +323,7 @@ class Survey extends Component {
)
:
key
==
2
?
(
<
Link
to=
{
`/${companyCode}/${siteCode}/index/tool/survey/survey-management/details/${record.id}/1`
}
// to=
{`/
$
{
companyCode
}/
$
{
siteCode
}/
index
/
tool
/
survey
/
survey
-
management
/
create
/
$
{
record
.
id
}`}
// to=
{`/
$
{
companyCode
}/
$
{
siteCode
}/
index
/
tool
/
survey
/
survey
-
management
/
create
/
$
{
record
.
id
}`}
>
<
span
className=
{
styles
.
survey_list_btn
}
...
...
@@ -442,7 +458,7 @@ class Survey extends Component {
</
div
>
<
Tabs
className=
{
styles
.
survey_tabs
}
defaultActiveKey=
"1"
activeKey=
{
this
.
state
.
key
.
toString
()
}
onChange=
{
this
.
callback
}
>
<
TabPane
tab=
"已上架"
key=
"1"
>
...
...
@@ -536,4 +552,4 @@ function mapDispatchToProps(dispatch) {
};
}
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
Survey
);
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
withRouter
(
Survey
)
);
\ No newline at end of file
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