Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wisdom-ces
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
wangqinghua
wisdom-ces
Commits
c5004ead
Commit
c5004ead
authored
Oct 17, 2018
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
color
parent
d16ab6c0
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
21 deletions
+31
-21
create.html
src/pages/surveyManage/item/create/create.html
+2
-1
create.ts
src/pages/surveyManage/item/create/create.ts
+28
-19
list.html
src/pages/surveyManage/list/list.html
+1
-1
No files found.
src/pages/surveyManage/item/create/create.html
View file @
c5004ead
...
...
@@ -43,7 +43,8 @@
<ion-item>
<ion-label
class=
"set-font"
color=
"primary"
>
必须回答
</ion-label>
<ion-toggle
checked=
"false"
></ion-toggle>
<ion-toggle
*
ngIf=
"isAns == 2"
[
checked
]="
false
"
(
ionChange
)="
isAnsChange
(
1
)"
></ion-toggle>
<ion-toggle
*
ngIf=
"isAns == 1"
[
checked
]="
true
"
(
ionChange
)="
isAnsChange
(
2
)"
></ion-toggle>
</ion-item>
<!--多选题-->
...
...
src/pages/surveyManage/item/create/create.ts
View file @
c5004ead
...
...
@@ -20,6 +20,7 @@ export class CreatePage {
temp
;
//问卷信息
title
;
//标题
index
=
0
;
//序号
isAns
=
2
;
//是否必答
quesDescList
=
[];
set
=
{
//设置
lastchange
:
'1'
,
...
...
@@ -34,13 +35,15 @@ export class CreatePage {
ionViewDidLoad
()
{
this
.
temp
=
this
.
navParams
.
get
(
'temp'
);
//问卷信息
if
(
this
.
navParams
.
get
(
'edit'
))
{
//编辑
if
(
this
.
navParams
.
get
(
'edit'
))
{
//编辑
this
.
editTemp
=
this
.
navParams
.
get
(
'edit'
);
this
.
editIndex
=
this
.
navParams
.
get
(
'index'
);
this
.
qType
=
this
.
editTemp
[
this
.
editIndex
].
quesType
;
this
.
title
=
this
.
editTemp
[
this
.
editIndex
].
title
;
this
.
isAns
=
this
.
editTemp
[
this
.
editIndex
].
isAns
;
this
.
quesDescList
=
this
.
editTemp
[
this
.
editIndex
].
quesDesc
;
}
else
{
//新增
console
.
log
(
this
.
editTemp
[
this
.
editIndex
]);
}
else
{
//新增
this
.
qType
=
this
.
navParams
.
get
(
'type'
);
//题目类型
}
}
...
...
@@ -52,7 +55,7 @@ export class CreatePage {
isNeed
:
1
,
// 1是 2否
index
:
this
.
index
};
//序号
this
.
index
++
;
this
.
index
++
;
this
.
quesDescList
.
push
(
option
);
}
...
...
@@ -60,13 +63,19 @@ export class CreatePage {
this
.
quesDescList
.
splice
(
i
,
1
);
}
//是否必答
isAnsChange
(
type
){
this
.
isAns
=
type
;
}
//提交编辑问卷
submitEdit
(){
if
(
!
this
.
check
()
)
{
submitEdit
()
{
if
(
!
this
.
check
())
{
return
false
;
}
let
newArr
=
[];
this
.
editTemp
[
this
.
editIndex
].
title
=
this
.
title
;
this
.
editTemp
[
this
.
editIndex
].
isAns
=
this
.
isAns
;
for
(
let
i
=
0
;
i
<
this
.
editTemp
.
length
;
i
++
)
{
const
arr
=
{
questionId
:
this
.
temp
.
id
,
...
...
@@ -104,11 +113,11 @@ export class CreatePage {
//提交问卷
submit
()
{
if
(
!
this
.
check
()
)
{
if
(
!
this
.
check
())
{
return
false
;
}
if
(
this
.
qType
==
1
)
{
if
(
this
.
qType
==
1
)
{
const
option1
=
{
option_title
:
'是'
,
//选项文字
canFill
:
2
,
// 1是 2否
...
...
@@ -157,24 +166,24 @@ export class CreatePage {
}
//校验
check
(){
if
(
!
this
.
title
)
{
this
.
appService
.
popToastView
(
'请输入标题'
,
'middle'
,
1000
);
check
()
{
if
(
!
this
.
title
)
{
this
.
appService
.
popToastView
(
'请输入标题'
,
'middle'
,
1000
);
return
false
;
}
if
(
this
.
qType
==
2
||
this
.
qType
==
3
)
{
if
(
this
.
quesDescList
.
length
==
0
)
{
this
.
appService
.
popToastView
(
'请输入选项'
,
'middle'
,
1000
);
if
(
this
.
qType
==
2
||
this
.
qType
==
3
)
{
if
(
this
.
quesDescList
.
length
==
0
)
{
this
.
appService
.
popToastView
(
'请输入选项'
,
'middle'
,
1000
);
return
false
;
}
else
{
}
else
{
let
index
=
0
;
this
.
quesDescList
.
forEach
((
res
)
=>
{
if
(
res
.
option_title
.
length
==
''
)
{
index
++
;
this
.
quesDescList
.
forEach
((
res
)
=>
{
if
(
res
.
option_title
.
length
==
''
)
{
index
++
;
}
});
if
(
index
>
0
)
{
this
.
appService
.
popToastView
(
'请输入选项'
,
'middle'
,
1000
);
if
(
index
>
0
)
{
this
.
appService
.
popToastView
(
'请输入选项'
,
'middle'
,
1000
);
return
false
;
}
...
...
src/pages/surveyManage/list/list.html
View file @
c5004ead
...
...
@@ -54,7 +54,7 @@
<p
class=
"survey-title"
>
{{temp?.title}}
</p>
<div
class=
"footter-opr"
>
<div
*
ngIf=
"swiperIndex == 0"
(
click
)="
edit
()"
><span>
编辑
</span></div>
<div
*
ngIf=
"swiperIndex == 1"
(
click
)="
look
()"
><span>
查看
</span></div>
<div
*
ngIf=
"swiperIndex == 1"
(
click
)="
edit
()"
><span>
查看
</span></div>
<div
*
ngIf=
"swiperIndex == 1"
(
click
)="
overDue
()"
><span>
设为过期
</span></div>
<div
*
ngIf=
"swiperIndex == 0"
(
click
)="
release
()"
><span>
发布
</span></div>
<div
*
ngIf=
"swiperIndex == 1 || swiperIndex == 2"
(
click
)="
result
()"
><span>
结果
</span></div>
...
...
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