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
d4bcbf04
Commit
d4bcbf04
authored
Oct 18, 2018
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
color
parent
1c2cc2ef
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
268 additions
and
175 deletions
+268
-175
wisdom-ces.iml
.idea/wisdom-ces.iml
+1
-0
README.md
README.md
+9
-0
batch-detail.html
src/pages/activity/batch-detail/batch-detail.html
+2
-2
batch-detail.ts
src/pages/activity/batch-detail/batch-detail.ts
+0
-10
duty.html
src/pages/dutyALl/duty/duty.html
+5
-1
survery.html
src/pages/mine/mySurvey/survery/survery.html
+23
-7
survery.ts
src/pages/mine/mySurvey/survery/survery.ts
+21
-3
survey-preview.html
src/pages/mine/mySurvey/survey-preview/survey-preview.html
+2
-1
survey-write.html
src/pages/mine/mySurvey/survey-write/survey-write.html
+75
-66
survey-write.scss
src/pages/mine/mySurvey/survey-write/survey-write.scss
+1
-0
survey-write.ts
src/pages/mine/mySurvey/survey-write/survey-write.ts
+10
-6
edit.ts
src/pages/surveyManage/item/edit/edit.ts
+35
-32
set.html
src/pages/surveyManage/item/set/set.html
+2
-2
set.ts
src/pages/surveyManage/item/set/set.ts
+65
-44
list.html
src/pages/surveyManage/list/list.html
+1
-1
list.ts
src/pages/surveyManage/list/list.ts
+16
-0
No files found.
.idea/wisdom-ces.iml
View file @
d4bcbf04
...
...
@@ -7,6 +7,7 @@
<excludeFolder
url=
"file://$MODULE_DIR$/platforms/android"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/temp"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/tmp"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/www"
/>
</content>
<content
url=
"file://$MODULE_DIR$/platforms/android"
/>
<orderEntry
type=
"inheritedJdk"
/>
...
...
README.md
View file @
d4bcbf04
...
...
@@ -167,3 +167,12 @@ ionic cordova plugin add cordova-plugin-badge
"proxyUrl": "http://10.10.200.11:8080/wisdomgroup"
如果build android 报错了请在platforms/build.gradle里面的最后添加如下代码:
configurations.all {
resolutionStrategy {
force 'com.android.support:support-v4:27.1.0'
}}
//app自动更新安装打开功能中 android 8以上的权限有限制;需要在 platforms/android/app/src/main/AndroidManifest.xml文件里面
将 targetSdkVersion的值改为23即可;android SDK版本降低可以
src/pages/activity/batch-detail/batch-detail.html
View file @
d4bcbf04
...
...
@@ -35,8 +35,8 @@
<div
class=
"button-right"
>
<!--是否报名了>时间是否截止->人数是否满了->-->
<ng-container
*
ngIf=
"batch.order"
>
<span
*
ngIf=
"
!isFlag
"
class=
"button-btn button-btn2"
(
click
)="
sureCancelOrder
()"
>
取消报名
</span>
<span
*
ngIf=
"isFlag"
class=
"button-btn button-btn1"
(
click
)="
reelectBatch
()"
>
订单确认
</span>
<span
*
ngIf=
"
batch.order.orderstate == 1
"
class=
"button-btn button-btn2"
(
click
)="
sureCancelOrder
()"
>
取消报名
</span>
<span
*
ngIf=
"batch.order.orderstate == 2"
class=
"button-btn button-btn1"
(
click
)="
reelectBatch
()"
>
订单确认
</span>
</ng-container>
<ng-container
*
ngIf=
"!batch.order"
>
<!--时间截止-->
...
...
src/pages/activity/batch-detail/batch-detail.ts
View file @
d4bcbf04
...
...
@@ -14,8 +14,6 @@ declare var Swiper;
})
export
class
BatchDetailPage
{
@
ViewChild
(
'contentSlides'
)
contentSlides
:
Slides
;
isFlag
=
false
;
//是否过截止日期
batch
=
{
batchEndDate
:
''
,
signUp
:
true
,
...
...
@@ -42,14 +40,6 @@ export class BatchDetailPage {
this
.
order
=
this
.
batch
.
order
;
}
//判断是否过截止日期
const
nowDate
=
new
Date
().
getTime
();
const
endDate
=
new
Date
(
this
.
batch
.
batchEndDate
).
getTime
();
console
.
log
(
this
.
batch
);
if
(
nowDate
>
endDate
){
this
.
isFlag
=
true
;
//已过截止日期
}
}
initSwiper
(){
...
...
src/pages/dutyALl/duty/duty.html
View file @
d4bcbf04
...
...
@@ -2,7 +2,11 @@
<ion-navbar>
<ion-title>
值班情况
</ion-title>
<span
(
click
)="
sigUp
()"
float-right
class=
"margin-right-10 color-fff"
>
值班签到
</span>
<ion-buttons
end
>
<button
ion-button
(
click
)="
sigUp
()"
>
<span
ion-text
class=
"color-fff margin-right-10"
>
值班签到
</span>
</button>
</ion-buttons>
</ion-navbar>
<div
class=
"duty"
>
...
...
src/pages/mine/mySurvey/survery/survery.html
View file @
d4bcbf04
...
...
@@ -11,26 +11,42 @@
<ion-list>
<ng-container
*
ngIf=
"list.length > 0"
>
<ng-container
*
ngFor=
"let item of list"
>
<ng-container
*
ngIf=
"item?.writeSelf != 0"
>
<ion-item
class=
"item-list margin-bottom-10"
>
<div
class=
"item"
>
<div
class=
"item"
(
click
)="
goToResult
(
item
)"
>
<div
class=
"item-header padding-15-0"
>
<div
class=
"item-header-style"
>
<span
class=
"item-title"
>
{{item.title}}
</span>
<!--<span float-right class="done" *ngIf="item.state==1 ">未发布</span>-->
<span
*
ngIf=
"item?.writeSelf != 0"
float-right
class=
"done"
>
已完成
</span>
<span
*
ngIf=
"item?.writeSelf == 0"
float-right
class=
"done"
>
未完成
</span>
<!--<span float-right class="done" *ngIf="item.state==3 ">已过期</span>-->
<span
float-right
class=
"done"
>
已完成
</span>
</div>
</div>
<div
class=
"content-button padding-15-0"
>
<span>
参与人员:
</span>
<span
*
ngIf=
"item.groupName"
>
{{item.groupName}}
</span>
<span
*
ngIf=
"!item.groupName"
>
全体人员
</span>
<span
*
ngIf=
"item?.writeSelf == 0"
float-right
class=
"join"
(
click
)="
geToWrite
(
item
)"
>
参与
</span>
<span
*
ngIf=
"item?.writeSelf != 0"
float-right
class=
"look"
(
click
)="
goToResult
(
item
)"
>
查看
</span>
<span
float-right
class=
"look"
>
查看
</span>
</div>
</div>
</ion-item>
</ng-container>
<ng-container
*
ngIf=
"item?.writeSelf == 0"
>
<ion-item
class=
"item-list margin-bottom-10"
>
<div
class=
"item"
(
click
)="
geToWrite
(
item
)"
>
<div
class=
"item-header padding-15-0"
>
<div
class=
"item-header-style"
>
<span
class=
"item-title"
>
{{item.title}}
</span>
<span
float-right
class=
"done"
>
未完成
</span>
</div>
</div>
<div
class=
"content-button padding-15-0"
>
<span>
参与人员:
</span>
<span
*
ngIf=
"item.groupName"
>
{{item.groupName}}
</span>
<span
*
ngIf=
"!item.groupName"
>
全体人员
</span>
<span
float-right
class=
"join"
>
参与
</span>
</div>
</div>
</ion-item>
</ng-container>
</ng-container>
</ng-container>
</ion-list>
...
...
src/pages/mine/mySurvey/survery/survery.ts
View file @
d4bcbf04
import
{
Component
}
from
'@angular/core'
;
import
{
IonicPage
,
NavController
,
NavParams
}
from
'ionic-angular'
;
import
{
IonicPage
,
LoadingController
,
NavController
,
NavParams
}
from
'ionic-angular'
;
import
{
AppService
}
from
"../../../../service/appHttpService"
;
import
{
Storage
}
from
"@ionic/storage"
;
...
...
@@ -12,17 +12,35 @@ export class SurveryPage {
userId
;
list
=
[];
loading
;
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
public
appService
:
AppService
,
public
storage
:
Storage
)
{}
public
appService
:
AppService
,
public
storage
:
Storage
,
public
loadingCtrl
:
LoadingController
)
{}
ionViewDidLoad
(){
this
.
loading
=
this
.
loadingCtrl
.
create
({
content
:
'请稍等...'
,
// dismissOnPageChange: true,
enableBackdropDismiss
:
true
});
this
.
loading
.
present
();
this
.
getList
();
}
ionViewDidEnter
()
{
this
.
getList
();
}
getList
(){
this
.
storage
.
get
(
"user"
).
then
((
res
)
=>
{
this
.
appService
.
ObserverHttpGetAdd
(
'/wisdomgroup/modules/question/findQuesByUserId/'
,
res
.
id
)
.
subscribe
((
res
)
=>
{
if
(
this
.
loading
){
this
.
loading
.
dismiss
();
}
this
.
list
=
res
.
json
().
datalist
;
})
});
// this.getSurveyList()
}
getSurveyList
(){
...
...
src/pages/mine/mySurvey/survey-preview/survey-preview.html
View file @
d4bcbf04
...
...
@@ -45,7 +45,8 @@
</div>
</ion-list>
<ng-container
*
ngIf=
"survey?.isOpenName == '否'"
>
<!--0 不公开 1 公开-->
<ng-container
*
ngIf=
"survey?.isopen == 1"
>
<button
class=
"submit-btn submit"
(
click
)="
goToResult
()"
>
查看问卷结果
</button>
</ng-container>
</ion-content>
src/pages/mine/mySurvey/survey-write/survey-write.html
View file @
d4bcbf04
<ion-header>
<ion-navbar>
<ion-title>
问卷回答
</ion-title>
</ion-navbar>
<ion-navbar>
<ion-title>
问卷回答
</ion-title>
</ion-navbar>
</ion-header>
<ion-content>
<ion-list>
<ion-item>
<ion-label
class=
"padding-left-16"
>
{{item?.title}}
</ion-label>
</ion-item>
<div
class=
"question-list"
>
<ion-item
*
ngFor=
"let item of ansArr;let i = index"
>
<div
class=
"item-content"
>
<!--判断题-->
<p><span
class=
"color-red"
*
ngIf=
"item.isAns == 1"
>
*
</span>
{{i +1}}、
<span
*
ngIf=
"item.quesType == 1"
>
(判断)
</span>
<span
*
ngIf=
"item.quesType == 2"
>
(单选)
</span>
<span
*
ngIf=
"item.quesType == 3"
>
(多选)
</span>
<span
*
ngIf=
"item.quesType == 4"
>
(问答)
</span>
{{item.title}}
</p>
<div
class=
"padding-0-30"
>
<ng-container
*
ngIf=
"item.quesType == 1"
>
<p>
<label>
<input
[(
ngModel
)]="
item
.
answerdesc
"
name=
"{{item.questionQueId}}"
value=
"0"
type=
"radio"
>
是
<span
class=
"input-radio"
></span>
</label>
</p>
<p>
<label>
<input
[(
ngModel
)]="
item
.
answerdesc
"
name=
"{{item.questionQueId}}"
value=
"1"
type=
"radio"
>
否
<span
class=
"input-radio"
></span>
</label>
</p>
</ng-container>
<!--单选题-->
<ng-container
*
ngIf=
"item.quesType == 2"
>
<ng-container
*
ngFor=
" let option1 of item.quesDesc;let optIndex = index;"
>
<p>
<label>
<input
[(
ngModel
)]="
item
.
answerdesc
"
type=
"radio"
value=
"{{optIndex}}"
name=
"{{item.questionQueId}}"
>
{{option1.option_title}}
<span
class=
"input-radio"
></span>
</label>
</p>
</ng-container>
</ng-container>
<!--多选题-->
<ng-container
*
ngIf=
"item.quesType == 3"
>
<ng-container
*
ngFor=
" let option2 of item.quesDesc;let quesIndex = index;"
>
<p>
<label>
<input
type=
"checkbox"
(
change
)="
mutiSelect
(
i
,
quesIndex
)"
value=
"{{quesIndex}}"
>
{{option2.option_title}}
<span
class=
"input-check"
></span>
</label>
</p>
</ng-container>
</ng-container>
<!--问答题-->
<ng-container
*
ngIf=
"item.quesType == 4"
>
<textarea
[(
ngModel
)]="
item
.
answerdesc
"
class=
"content-textarea"
></textarea>
</ng-container>
</div>
<ion-list>
<ion-item>
<ion-label
class=
"padding-left-16"
>
{{item?.title}}
</ion-label>
</ion-item>
<div
class=
"question-list"
>
<ion-item
*
ngFor=
"let item of ansArr;let i = index"
>
<div
class=
"item-content"
>
<!--判断题-->
<p><span
class=
"color-red"
*
ngIf=
"item.isAns == 1"
>
*
</span>
{{i +1}}、
<span
*
ngIf=
"item.quesType == 1"
>
(判断)
</span>
<span
*
ngIf=
"item.quesType == 2"
>
(单选)
</span>
<span
*
ngIf=
"item.quesType == 3"
>
(多选)
</span>
<span
*
ngIf=
"item.quesType == 4"
>
(问答)
</span>
{{item.title}}
</p>
<div
class=
"padding-0-30"
>
<ng-container
*
ngIf=
"item.quesType == 1"
>
<p>
<label>
<input
[(
ngModel
)]="
item
.
answerdesc
"
name=
"{{item.questionQueId}}"
value=
"0"
type=
"radio"
>
是
<span
class=
"input-radio"
></span>
</label>
</p>
<p>
<label>
<input
[(
ngModel
)]="
item
.
answerdesc
"
name=
"{{item.questionQueId}}"
value=
"1"
type=
"radio"
>
否
<span
class=
"input-radio"
></span>
</label>
</p>
</ng-container>
<!--单选题-->
<ng-container
*
ngIf=
"item.quesType == 2"
>
<ng-container
*
ngFor=
" let option1 of item.quesDesc;let optIndex = index;"
>
<p>
<label>
<input
[(
ngModel
)]="
item
.
answerdesc
"
type=
"radio"
value=
"{{optIndex}}"
name=
"{{item.questionQueId}}"
>
{{option1.option_title}}
<span
class=
"input-radio"
></span>
</label>
</p>
</ng-container>
</ng-container>
<!--多选题-->
<ng-container
*
ngIf=
"item.quesType == 3"
>
<ng-container
*
ngFor=
" let option2 of item.quesDesc;let quesIndex = index;"
>
<p>
<label>
<input
type=
"checkbox"
(
change
)="
mutiSelect
(
i
,
quesIndex
)"
value=
"{{quesIndex}}"
>
{{option2.option_title}}
<span
class=
"input-check"
></span>
</label>
</p>
</ng-container>
</ng-container>
<!--问答题-->
<ng-container
*
ngIf=
"item.quesType == 4"
>
<textarea
[(
ngModel
)]="
item
.
answerdesc
"
class=
"content-textarea"
></textarea>
</ng-container>
</div>
</div>
</ion-item>
</div>
</ion-item>
</div>
</ion-list>
</ion-list>
<p
class=
"text-center"
>
<label>
<input
type=
"checkbox"
[(
ngModel
)]="
isans
"
>
<span
class=
"input-check"
></span>
<span>
匿名回答
</span>
</label>
</p>
<button
class=
"submit-btn submit"
(
click
)="
confirm
()"
>
提交
</button>
<button
class=
"submit-btn submit"
(
click
)="
confirm
()"
>
提交
</button>
</ion-content>
src/pages/mine/mySurvey/survey-write/survey-write.scss
View file @
d4bcbf04
...
...
@@ -49,6 +49,7 @@ page-survey-write {
position
:
absolute
;
width
:
10px
;
top
:
-4px
;
left
:
0px
;
height
:
10px
;
font-size
:
1
.5rem
;
font-weight
:
bold
;
...
...
src/pages/mine/mySurvey/survey-write/survey-write.ts
View file @
d4bcbf04
...
...
@@ -10,6 +10,7 @@ import {AppService} from "../../../../service/appHttpService";
})
export
class
SurveyWritePage
{
isans
;
item
;
temp
;
ansArr
=
[];
...
...
@@ -25,9 +26,9 @@ export class SurveyWritePage {
getDetail
()
{
const
id
=
''
;
this
.
appService
.
ObserverHttpGetAdd
(
'/wisdomgroup/modules/question/
findQuesByQuestionId
/'
,
this
.
item
.
id
)
this
.
appService
.
ObserverHttpGetAdd
(
'/wisdomgroup/modules/question/
edit
/'
,
this
.
item
.
id
)
.
subscribe
((
res
)
=>
{
this
.
temp
=
res
.
json
().
datalist
;
this
.
temp
=
res
.
json
().
data
.
ques
.
data
list
;
for
(
let
i
=
0
;
i
<
this
.
temp
.
length
;
i
++
)
{
const
data
=
{
'questionId'
:
this
.
temp
[
i
].
questionId
,
...
...
@@ -52,7 +53,6 @@ export class SurveyWritePage {
}
else
{
this
.
ansArr
[
i
].
answerdesc
+=
","
+
index
;
}
console
.
log
(
this
.
ansArr
[
i
]);
}
confirm
(){
...
...
@@ -68,6 +68,11 @@ export class SurveyWritePage {
}
let
arrData
=
[];
if
(
this
.
isans
){
this
.
isans
=
1
;
}
else
{
this
.
isans
=
2
;
}
for
(
let
i
=
0
;
i
<
this
.
ansArr
.
length
;
i
++
)
{
if
(
this
.
ansArr
[
i
].
quesType
==
3
)
{
let
length
=
this
.
ansArr
[
i
].
answerdesc
.
length
;
...
...
@@ -77,14 +82,13 @@ export class SurveyWritePage {
'questionId'
:
this
.
ansArr
[
i
].
questionId
,
'questionQueId'
:
this
.
ansArr
[
i
].
questionQueId
,
'answerdesc'
:
this
.
ansArr
[
i
].
answerdesc
,
'isans'
:
this
.
ansArr
[
i
].
isA
ns
'isans'
:
this
.
isa
ns
};
arrData
.
push
(
data
);
}
console
.
log
(
arrData
);
const
qData
=
{
'array'
:
JSON
.
stringify
(
arrData
)
}
}
;
this
.
appService
.
ObserverHttpPost
(
'/wisdomgroup/modules/question/create/quesuser'
,
qData
)
.
subscribe
((
res
)
=>
{
this
.
navCtrl
.
pop
();
...
...
src/pages/surveyManage/item/edit/edit.ts
View file @
d4bcbf04
...
...
@@ -13,15 +13,16 @@ import {CreatePage} from "../create/create";
})
export
class
EditPage
{
tempId
;
editIndex
;
temp
=
{
title
:
''
,
id
:
''
,
explai
:
''
,
//问卷说明
usergroup
:
null
,
//用户组id
isopen
:
null
,
//是否公开
isans
:
null
,
//是否匿名
state
:
null
//状态
explai
:
''
,
//问卷说明
usergroup
:
null
,
//用户组id
isopen
:
null
,
//是否公开
isans
:
null
,
//是否匿名
state
:
null
//状态
};
contentList
=
[];
...
...
@@ -31,19 +32,22 @@ export class EditPage {
}
ionViewDidEnter
()
{
this
.
temp
=
this
.
navParams
.
get
(
'temp'
);
console
.
log
(
this
.
temp
);
this
.
tempId
=
this
.
navParams
.
get
(
'temp'
).
id
;
this
.
getDetail
();
const
length
=
this
.
navCtrl
.
length
();
if
(
length
>
5
)
{
this
.
navCtrl
.
remove
(
3
,
length
-
4
);
if
(
length
>
5
)
{
this
.
navCtrl
.
remove
(
3
,
length
-
4
);
}
}
//问卷详情
getDetail
()
{
this
.
appService
.
ObserverHttpGet
(
'/wisdomgroup/modules/question/findQuesByQuestionId'
,
{
id
:
this
.
temp
.
id
})
//问卷详情
this
.
appService
.
ObserverHttpPostAdd
(
'/wisdomgroup/modules/question/edit/'
,
this
.
tempId
).
subscribe
((
res
)
=>
{
this
.
temp
=
res
.
json
().
data
;
});
//问卷题目详情
this
.
appService
.
ObserverHttpGet
(
'/wisdomgroup/modules/question/findQuesByQuestionId'
,
{
id
:
this
.
tempId
})
.
subscribe
(
(
res
)
=>
{
this
.
contentList
=
res
.
json
().
datalist
;
...
...
@@ -66,12 +70,12 @@ export class EditPage {
this
.
editIndex
=
index
;
}
goEdit
(
index
){
goEdit
(
index
)
{
console
.
log
(
index
);
this
.
navCtrl
.
push
(
'CreatePage'
,{
edit
:
this
.
contentList
,
index
:
index
,
temp
:
this
.
temp
this
.
navCtrl
.
push
(
'CreatePage'
,
{
edit
:
this
.
contentList
,
index
:
index
,
temp
:
this
.
temp
});
}
...
...
@@ -82,18 +86,18 @@ export class EditPage {
//上移
itemUp
(
index
)
{
if
(
index
!=
0
)
{
this
.
swapArray
(
this
.
contentList
,
index
,
index
-
1
);
}
else
{
if
(
index
!=
0
)
{
this
.
swapArray
(
this
.
contentList
,
index
,
index
-
1
);
}
else
{
alert
(
'已经处于置底,无法下移'
);
}
}
//下移
itemDown
(
index
)
{
if
(
index
+
1
!=
this
.
contentList
.
length
)
{
this
.
swapArray
(
this
.
contentList
,
index
,
index
+
1
);
}
else
{
if
(
index
+
1
!=
this
.
contentList
.
length
)
{
this
.
swapArray
(
this
.
contentList
,
index
,
index
+
1
);
}
else
{
// alert('已经处于置顶,无法上移');
}
}
...
...
@@ -131,7 +135,7 @@ export class EditPage {
//设置
set
()
{
this
.
navCtrl
.
push
(
'SetPage'
,
{
temp
:
this
.
temp
id
:
this
.
temp
.
id
});
}
...
...
@@ -139,18 +143,17 @@ export class EditPage {
save
()
{
const
bodyData
=
{
title
:
this
.
temp
.
title
,
//问卷标题
explai
:
this
.
temp
.
explai
,
//问卷说明
usergroup
:
this
.
temp
.
usergroup
,
//用户组id
isopen
:
this
.
temp
.
isopen
,
//是否公开
isans
:
this
.
temp
.
isans
,
//是否匿名
state
:
this
.
temp
.
state
//状态
title
:
this
.
temp
.
title
,
//问卷标题
explai
:
this
.
temp
.
explai
,
//问卷说明
usergroup
:
this
.
temp
.
usergroup
,
//用户组id
isopen
:
this
.
temp
.
isopen
,
//是否公开
isans
:
this
.
temp
.
isans
,
//是否匿名
state
:
this
.
temp
.
state
//状态
};
//更新问卷信息
this
.
appService
.
ObserverHttpForm
(
'/wisdomgroup/modules/question/update/'
,
this
.
temp
.
id
,
bodyData
).
subscribe
((
res
)
=>
{
this
.
appService
.
ObserverHttpForm
(
'/wisdomgroup/modules/question/update/'
,
this
.
temp
.
id
,
bodyData
).
subscribe
((
res
)
=>
{
},
(
err
)
=>
{
},
(
err
)
=>
{
});
...
...
src/pages/surveyManage/item/set/set.html
View file @
d4bcbf04
...
...
@@ -13,12 +13,12 @@
<ion-item>
<ion-label>
问卷结果公开
</ion-label>
<ion-toggle
[(
ngModel
)]="
temp
.
isopen
"
></ion-toggle>
<ion-toggle
[(
ngModel
)]="
isopen
"
></ion-toggle>
</ion-item>
<ion-item>
<ion-label>
匿名回答
</ion-label>
<ion-toggle
[(
ngModel
)]="
temp
.
isans
"
></ion-toggle>
<ion-toggle
[(
ngModel
)]="
isans
"
></ion-toggle>
</ion-item>
</ion-list>
...
...
src/pages/surveyManage/item/set/set.ts
View file @
d4bcbf04
import
{
Component
}
from
'@angular/core'
;
import
{
IonicPage
,
NavController
,
NavParams
}
from
'ionic-angular'
;
import
{
Component
}
from
'@angular/core'
;
import
{
IonicPage
,
NavController
,
NavParams
}
from
'ionic-angular'
;
import
{
AppService
}
from
"../../../../service/appHttpService"
;
@
IonicPage
()
@
Component
({
selector
:
'page-set'
,
templateUrl
:
'set.html'
,
selector
:
'page-set'
,
templateUrl
:
'set.html'
,
})
export
class
SetPage
{
id
;
// 问卷ID;
isans
;
//匿名
isopen
;
//公开
temp
=
{
id
:
''
,
isopen
:
null
,
isans
:
null
,
title
:
''
,
explai
:
''
,
usergroup
:
''
,
state
:
''
id
:
''
,
isopen
:
null
,
isans
:
null
,
title
:
''
,
explai
:
''
,
usergroup
:
''
,
state
:
''
};
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
public
appService
:
AppService
)
{
}
ionViewDidLoad
()
{
this
.
temp
=
this
.
navParams
.
get
(
'temp'
);
console
.
log
(
this
.
temp
);
}
save
(){
if
(
this
.
temp
.
isans
==
true
||
this
.
temp
.
isans
==
1
){
this
.
temp
.
isans
=
1
;
}
else
{
this
.
temp
.
isans
=
0
;
}
if
(
this
.
temp
.
isopen
==
true
||
this
.
temp
.
isopen
==
1
){
this
.
temp
.
isopen
=
1
;
}
else
{
this
.
temp
.
isopen
=
0
;
}
const
data
=
{
id
:
this
.
temp
.
id
,
title
:
this
.
temp
.
title
,
//问卷标题
explai
:
this
.
temp
.
explai
,
//问卷说明
usergroup
:
this
.
temp
.
usergroup
,
//用户组id
isopen
:
this
.
temp
.
isopen
,
//是否公开
isans
:
this
.
temp
.
isans
,
//是否匿名
state
:
this
.
temp
.
state
//状态
};
console
.
log
(
this
.
temp
);
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
public
appService
:
AppService
)
{
}
ionViewDidLoad
()
{
this
.
id
=
this
.
navParams
.
get
(
'id'
);
this
.
appService
.
ObserverHttpPostAdd
(
'/wisdomgroup/modules/question/edit/'
,
this
.
id
).
subscribe
((
res
)
=>
{
this
.
temp
=
res
.
json
().
data
;
if
(
this
.
temp
.
isans
==
1
)
{
this
.
isans
=
true
;
}
else
{
this
.
isans
=
false
;
}
if
(
this
.
temp
.
isopen
==
1
)
{
this
.
isopen
=
true
;
}
else
{
this
.
isopen
=
false
;
}
});
}
save
()
{
//是否匿名
console
.
log
(
this
.
isans
);
if
(
this
.
isans
==
true
||
this
.
isans
==
1
)
{
this
.
temp
.
isans
=
1
;
}
else
{
this
.
temp
.
isans
=
2
;
}
console
.
log
(
this
.
temp
.
isans
);
//是否公开问卷结果
if
(
this
.
isopen
==
true
||
this
.
isopen
==
1
)
{
this
.
temp
.
isopen
=
1
;
}
else
{
this
.
temp
.
isopen
=
0
;
}
const
data
=
{
id
:
this
.
temp
.
id
,
title
:
this
.
temp
.
title
,
//问卷标题
explai
:
this
.
temp
.
explai
,
//问卷说明
usergroup
:
this
.
temp
.
usergroup
,
//用户组id
isopen
:
this
.
temp
.
isopen
,
//是否公开
isans
:
this
.
temp
.
isans
,
//是否匿名
state
:
this
.
temp
.
state
//状态
};
this
.
appService
.
ObserverHttpPost
(
'/wisdomgroup/modules/question/updateOnApp'
,
data
)
.
subscribe
((
res
)
=>
{
if
(
res
)
{
.
subscribe
((
res
)
=>
{
if
(
res
)
{
this
.
navCtrl
.
pop
();
}
})
}
}
}
src/pages/surveyManage/list/list.html
View file @
d4bcbf04
...
...
@@ -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>
...
...
src/pages/surveyManage/list/list.ts
View file @
d4bcbf04
...
...
@@ -139,7 +139,23 @@ export class ListPage {
})
}
)
}
//取消发布
cancel
(){
// 0 清除 1 不清除
const
data
=
{
'isdelete'
:
'0'
}
this
.
appService
.
alert
(
'确定取消发布该问卷吗'
,
(
res
)
=>
{
this
.
appService
.
ObserverHttpGetAdd
(
'/wisdomgroup/modules/question/cancel/'
,
this
.
temp
.
id
)
.
subscribe
((
res
)
=>
{
this
.
appService
.
popToastView
(
'取消发布成功'
,
'middle'
,
1000
);
this
.
selectPageMenu
(
this
.
swiperIndex
);
})
}
)
}
//结果
...
...
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