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
41126371
Commit
41126371
authored
Sep 26, 2018
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
问卷调查
parent
1b2d899b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
97 additions
and
12 deletions
+97
-12
duty.ts
src/pages/dutyALl/duty/duty.ts
+2
-2
edit.html
src/pages/surveyManage/item/edit/edit.html
+1
-1
edit.ts
src/pages/surveyManage/item/edit/edit.ts
+71
-5
select-type.html
src/pages/surveyManage/item/select-type/select-type.html
+13
-4
select-type.scss
src/pages/surveyManage/item/select-type/select-type.scss
+10
-0
No files found.
src/pages/dutyALl/duty/duty.ts
View file @
41126371
...
...
@@ -81,7 +81,7 @@ export class DutyPage {
};
this
.
appService
.
ObserverHttpGetOption
(
'/wisdomgroup/schedule/getScheduleInfo'
,
data
)
.
subscribe
((
res
)
=>
{
this
.
dayObj
=
res
;
this
.
dayObj
=
res
.
json
()
;
});
const
data1
=
{
...
...
@@ -90,7 +90,7 @@ export class DutyPage {
};
this
.
appService
.
ObserverHttpGetOption
(
'/wisdomgroup/schedule/getScheduleInfo'
,
data1
)
.
subscribe
((
res
)
=>
{
this
.
nightObj
=
res
;
this
.
nightObj
=
res
.
json
()
;
});
}
...
...
src/pages/surveyManage/item/edit/edit.html
View file @
41126371
...
...
@@ -39,7 +39,7 @@
<div
(
click
)="
itemEdit
(
item
)"
><span>
编辑
</span></div>
<div
(
click
)="
itemUp
(
item
)"
><span>
上移
</span></div>
<div
(
click
)="
itemDown
(
item
)"
><span>
下移
</span></div>
<div
(
click
)="
itemDelete
(
i
tem
)"
><span>
删除
</span></div>
<div
(
click
)="
itemDelete
(
i
)"
><span>
删除
</span></div>
</div>
</ion-item>
</div>
...
...
src/pages/surveyManage/item/edit/edit.ts
View file @
41126371
import
{
Component
}
from
'@angular/core'
;
import
{
IonicPage
,
NavController
,
NavParams
,
ModalController
}
from
'ionic-angular'
;
import
{
IonicPage
,
NavController
,
NavParams
,
ModalController
,
ToastController
,
AlertController
}
from
'ionic-angular'
;
import
{
SelectTypePage
}
from
"../select-type/select-type"
;
import
{
AppService
}
from
"../../../../service/appHttpService"
;
import
{
message
}
from
"../../../../app/main"
;
@
IonicPage
()
@
Component
({
...
...
@@ -13,11 +14,12 @@ export class EditPage {
editIndex
;
temp
=
{
title
:
''
,
id
:
''
id
:
''
,
};
contentList
=
[];
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
public
modalCtrl
:
ModalController
,
public
appService
:
AppService
)
{
public
modalCtrl
:
ModalController
,
public
appService
:
AppService
,
public
toastCtrl
:
ToastController
,
public
alertCtrl
:
AlertController
)
{
}
qList
=
[
{
name
:
'测试'
},
...
...
@@ -28,7 +30,7 @@ export class EditPage {
ionViewDidEnter
()
{
this
.
temp
=
this
.
navParams
.
get
(
'temp'
);
this
.
getDetail
();
this
.
getDetail
();
}
getDetail
(){
...
...
@@ -55,6 +57,39 @@ export class EditPage {
this
.
editIndex
=
index
;
}
//上移
itemUp
(
item
){
}
//下移
itemDown
(
item
){
}
//删除
itemDelete
(
index
){
const
confirm
=
this
.
alertCtrl
.
create
({
title
:
'确认删除该题目?'
,
buttons
:
[
{
text
:
'取消'
,
handler
:
()
=>
{
console
.
log
(
'Disagree clicked'
);
}
},
{
text
:
'确认'
,
handler
:
()
=>
{
this
.
contentList
.
splice
(
index
,
1
);
this
.
editIndex
=
null
;
}
}
]
});
confirm
.
present
();
}
//查看
look
(){
this
.
navCtrl
.
push
(
'DetailPage'
,{
...
...
@@ -71,7 +106,38 @@ export class EditPage {
//保存
save
(){
let
newArr
=
[];
for
(
let
i
=
0
;
i
<
this
.
contentList
.
length
;
i
++
){
const
arr
=
{
questionId
:
this
.
temp
.
id
,
isAns
:
this
.
contentList
[
i
].
isAns
,
quesType
:
this
.
contentList
[
i
].
quesType
,
title
:
this
.
contentList
[
i
].
title
,
limit
:
this
.
contentList
[
i
].
limit
,
//问答的字数限制
quesDesc
:
this
.
contentList
[
i
].
quesDesc
,
minOps
:
this
.
contentList
[
i
].
minOps
,
maxOps
:
this
.
contentList
[
i
].
maxOps
,
index
:
this
.
contentList
[
i
].
index
//序号
};
newArr
.
push
(
arr
);
}
console
.
log
(
newArr
);
const
data
=
{
array
:
JSON
.
stringify
(
newArr
),
id
:
this
.
temp
.
id
};
console
.
log
(
data
);
const
toast
=
this
.
toastCtrl
.
create
(
message
);
this
.
appService
.
ObserverHttpPost
(
'/wisdomgroup/modules/question/saveQuestion'
,
data
)
.
subscribe
(
(
res
)
=>
{
toast
.
setMessage
(
'编辑成功'
);
toast
.
present
();
setTimeout
((
res
)
=>
{
this
.
getDetail
();
},
2000
)
}
)
}
}
src/pages/surveyManage/item/select-type/select-type.html
View file @
41126371
...
...
@@ -9,9 +9,18 @@
<ion-content
padding
>
<p
class=
"title"
>
请选择需要添加的题型
</p>
<div>
<p><button
class=
"submit-btn submit"
(
click
)="
select
(
1
)"
>
判断题
</button></p>
<p><button
class=
"submit-btn submit"
(
click
)="
select
(
2
)"
>
单选题
</button></p>
<p><button
class=
"submit-btn submit"
(
click
)="
select
(
3
)"
>
多选题
</button></p>
<p><button
class=
"submit-btn submit"
(
click
)="
select
(
4
)"
>
问答题
</button></p>
<p><button
class=
"submit-btn submit"
(
click
)="
select
(
1
)"
>
<img
src=
"../../../../assets/imgs/survey/judge.png"
alt=
""
>
<span>
判断题
</span>
</button></p>
<p><button
class=
"submit-btn submit"
(
click
)="
select
(
2
)"
>
<img
src=
"../../../../assets/imgs/survey/single.png"
alt=
""
>
<span>
单选题
</span></button></p>
<p><button
class=
"submit-btn submit"
(
click
)="
select
(
3
)"
>
<img
src=
"../../../../assets/imgs/survey/multi.png"
alt=
""
>
<span>
多选题
</span></button></p>
<p><button
class=
"submit-btn submit"
(
click
)="
select
(
4
)"
>
<img
src=
"../../../../assets/imgs/survey/qa.png"
alt=
""
>
<span>
问答题
</span></button></p>
</div>
</ion-content>
src/pages/surveyManage/item/select-type/select-type.scss
View file @
41126371
...
...
@@ -3,4 +3,14 @@ page-select-type {
font-size
:
1
.6rem
;
margin-bottom
:
3rem
;
}
img
{
width
:
2
.2rem
;
vertical-align
:
middle
;
}
.submit-btn
{
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
color
:
#333333
;
}
}
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