Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
em
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
ichikawa
em
Commits
702df35c
Commit
702df35c
authored
Jan 18, 2024
by
Kim Gyeongeun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#56952 設問設定機能追加(チェックボックス動作バグ修正)
parent
9485d874
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
3 deletions
+37
-3
src/main/java/jp/agentec/sinaburocast/service/QuestionService.java
+20
-2
src/main/webapp/WEB-INF/view/user/enquete/enquete.html
+17
-1
No files found.
src/main/java/jp/agentec/sinaburocast/service/QuestionService.java
View file @
702df35c
...
...
@@ -321,13 +321,27 @@ public class QuestionService extends AbstractService<Question> {
*/
public
void
setQuestionDisable
(
List
<
Question
>
questionList
)
{
HashMap
<
Integer
,
Integer
>
requiredQuestionInfo
=
new
HashMap
<
Integer
,
Integer
>();
List
<
Integer
>
defaultAnswerIdList
=
new
ArrayList
<
Integer
>();
//初期表示情報セット
for
(
Question
question
:
questionList
)
{
for
(
Answer
answer
:
question
.
answerList
)
{
if
(
question
.
condRequiredQuestionNo
!=
null
&&
question
.
condRequiredQuestionNo
==
0
&&
requiredQuestionInfo
.
get
(
answer
.
answerId
)
==
null
)
{
if
(
answer
.
defaultFlg
==
0
&&
StringUtil
.
isBlank
(
answer
.
answerIdValue
))
{
continue
;}
//条件付回答設定の選択した値
if
(
answer
.
defaultFlg
==
0
&&
StringUtil
.
isNotBlank
(
answer
.
answerIdValue
))
{
requiredQuestionInfo
.
put
(
answer
.
answerId
,
1
);
}
//条件付回答設定のデフォルト値
if
(
answer
.
defaultFlg
==
1
)
{
defaultAnswerIdList
.
add
(
answer
.
answerId
);
}
}
}
}
//条件付回答設定IDがない場合、デフォルト値の回答IDをセット
if
(
requiredQuestionInfo
.
isEmpty
()
&&
CollectionUtils
.
isNotEmpty
(
defaultAnswerIdList
))
{
for
(
Integer
defaultAnswerId
:
defaultAnswerIdList
)
{
requiredQuestionInfo
.
put
(
defaultAnswerId
,
1
);
}
}
for
(
Question
question
:
questionList
)
{
...
...
@@ -336,8 +350,12 @@ public class QuestionService extends AbstractService<Question> {
&&
StringUtils
.
isNotBlank
(
question
.
condRequiredAnswer
))
{
List
<
String
>
requiredAnswerIdList
=
new
ArrayList
<
String
>(
Arrays
.
asList
(
question
.
condRequiredAnswer
.
split
(
","
)));
for
(
String
requiredAnswerId
:
requiredAnswerIdList
)
{
question
.
questionInitDisable
=
(
requiredQuestionInfo
.
get
(
IntegerConversionUtil
.
toInteger
(
requiredAnswerId
))
==
null
)
?
SinaburoConstant
.
initDisable
.
YES
:
SinaburoConstant
.
initDisable
.
NO
;
if
(
requiredQuestionInfo
.
get
(
IntegerConversionUtil
.
toInteger
(
requiredAnswerId
))
==
null
)
{
question
.
questionInitDisable
=
SinaburoConstant
.
initDisable
.
YES
;
}
else
{
question
.
questionInitDisable
=
SinaburoConstant
.
initDisable
.
NO
;
return
;
}
}
}
}
...
...
src/main/webapp/WEB-INF/view/user/enquete/enquete.html
View file @
702df35c
...
...
@@ -39,7 +39,23 @@ $(function() {
if
(
"${question.controlId}"
==
"0"
||
"${question.controlId}"
==
"1"
)
{
$
(
"#${answer.answerId}"
).
attr
(
"checked"
,
false
);
$
(
"#${answer.answerId}"
).
attr
(
"disabled"
,
true
);
}
else
if
(
"${question.controlId}"
==
"2"
)
{
}
else
if
(
$
(
this
).
attr
(
"type"
)
==
"radio"
&&
"${question.controlId}"
==
"2"
)
{
if
(
$
(
this
).
is
(
":checked"
))
{
var
array
=
"${question.condRequiredAnswer}"
.
split
(
","
);
var
judgeDisable
=
true
;
for
(
let
i
in
array
)
{
if
(
$
(
"#"
+
array
[
i
]).
is
(
":checked"
))
{
judgeDisable
=
false
;
break
;
}
}
if
(
judgeDisable
)
{
$
(
"#${question.questionId}"
).
val
(
''
);
$
(
"#${question.questionId}"
).
attr
(
"disabled"
,
true
);
}
}
else
{
$
(
"#${question.questionId}"
).
attr
(
"disabled"
,
false
);
}
}
else
if
(
"${question.controlId}"
==
"3"
||
"${question.controlId}"
==
"4"
||
"${question.controlId}"
==
"6"
)
{
$
(
"#${question.questionId}"
).
val
(
''
);
$
(
"#${question.questionId}"
).
attr
(
"disabled"
,
true
);
...
...
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