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
2584ca53
Commit
2584ca53
authored
Oct 16, 2018
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
color
parent
6bcf8c40
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
50 deletions
+61
-50
list.ts
src/pages/surveyManage/list/list.ts
+61
-50
No files found.
src/pages/surveyManage/list/list.ts
View file @
2584ca53
...
...
@@ -7,40 +7,41 @@ import {EditPage} from "../item/edit/edit";
declare
var
Swiper
;
@
IonicPage
()
@
Component
({
selector
:
'page-list'
,
templateUrl
:
'list.html'
,
selector
:
'page-list'
,
templateUrl
:
'list.html'
,
})
export
class
ListPage
{
@
ViewChild
(
'contentSlides'
)
contentSlides
:
Slides
;
@
ViewChild
(
'contentSlides'
)
contentSlides
:
Slides
;
contentList
=
<
any
>
[
{
datalist
:[]
datalist
:
[]
}
];
];
menuList
=
[
{
name
:
'草稿箱'
},
{
name
:
'已发布'
},
{
name
:
'已过期'
}
{
name
:
'草稿箱'
},
{
name
:
'已发布'
},
{
name
:
'已过期'
}
];
showOp
=
false
;
swiperIndex
;
swiper
;
temp
;
//选中的item
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
public
appService
:
AppService
)
{
}
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
public
appService
:
AppService
)
{
}
ionViewDidEnter
()
{
this
.
initSwiper
();
this
.
selectPageMenu
(
0
);
this
.
swiperIndex
=
0
;
}
ionViewDidEnter
()
{
this
.
initSwiper
();
this
.
selectPageMenu
(
0
);
this
.
swiperIndex
=
0
;
}
initSwiper
(){
initSwiper
()
{
this
.
swiper
=
new
Swiper
(
'.pageMenuSlides .swiper-container'
,
{
//设置slider容器能够同时显示的slides数量(
slidesPreView
:
3
,
...
...
@@ -70,12 +71,12 @@ export class ListPage {
selectPageMenu
(
index
)
{
const
data
=
{
state
:
index
+
1
state
:
index
+
1
};
this
.
appService
.
ObserverHttpGet
(
'/wisdomgroup/modules/question/findByState'
,
data
)
this
.
appService
.
ObserverHttpGet
(
'/wisdomgroup/modules/question/findByState'
,
data
)
.
subscribe
(
(
res
:
Response
)
=>
{
this
.
contentList
=
res
.
json
();
(
res
:
Response
)
=>
{
this
.
contentList
=
res
.
json
();
}
);
this
.
swiperIndex
=
index
;
...
...
@@ -93,65 +94,75 @@ export class ListPage {
//显示问卷操作
showOpra
(
item
){
this
.
temp
=
item
;
this
.
showOp
=
true
;
showOpra
(
item
)
{
this
.
temp
=
item
;
this
.
showOp
=
true
;
}
//创建
create
(){
// this.showOp = false;
create
()
{
this
.
navCtrl
.
push
(
'DesicrPage'
);
}
//查看
look
(){
look
()
{
this
.
showOp
=
false
;
this
.
navCtrl
.
push
(
'EditPage'
,{
temp
:
this
.
temp
});
this
.
navCtrl
.
push
(
'EditPage'
,
{
temp
:
this
.
temp
});
}
//设为过期
overDue
(){
this
.
appService
.
ObserverHttpGetAdd
(
'/wisdomgroup/modules/question/outdate/'
,
this
.
temp
.
id
)
.
subscribe
((
res
)
=>
{
overDue
()
{
this
.
appService
.
alert
(
'确定将该问卷设为过期吗'
,(
res
)
=>
{
this
.
appService
.
ObserverHttpGetAdd
(
'/wisdomgroup/modules/question/outdate/'
,
this
.
temp
.
id
)
.
subscribe
((
res
)
=>
{
this
.
appService
.
popToastView
(
'问卷状态已更新'
,
'middle'
,
1000
);
this
.
selectPageMenu
(
this
.
swiperIndex
);
})
})
}
//发布
release
(){
this
.
appService
.
ObserverHttpGetAdd
(
'/wisdomgroup/modules/question/submit/'
,
this
.
temp
.
id
)
.
subscribe
((
res
)
=>
{
this
.
selectPageMenu
(
this
.
swiperIndex
);
})
release
()
{
this
.
appService
.
alert
(
'确定发布该问卷吗'
,
(
res
)
=>
{
this
.
appService
.
ObserverHttpGetAdd
(
'/wisdomgroup/modules/question/submit/'
,
this
.
temp
.
id
)
.
subscribe
((
res
)
=>
{
this
.
appService
.
popToastView
(
'发布成功'
,
'middle'
,
1000
);
this
.
selectPageMenu
(
this
.
swiperIndex
);
})
}
)
}
//结果
result
(){
result
()
{
this
.
showOp
=
false
;
this
.
navCtrl
.
push
(
'ResultPage'
);
this
.
navCtrl
.
push
(
'ResultPage'
);
}
//复制
copy
(){
this
.
appService
.
ObserverHttpGetOption
(
'/wisdomgroup/modules/question/copyQuestion'
,
{
id
:
this
.
temp
.
id
})
.
subscribe
((
res
)
=>
{
copy
()
{
this
.
appService
.
ObserverHttpGetOption
(
'/wisdomgroup/modules/question/copyQuestion'
,
{
id
:
this
.
temp
.
id
})
.
subscribe
((
res
)
=>
{
this
.
selectPageMenu
(
this
.
swiperIndex
);
})
}
//删除
delete
(){
this
.
appService
.
ObserverHttpGet
(
'/wisdomgroup/modules/question/delete'
,{
id
:
this
.
temp
.
id
})
.
subscribe
((
res
)
=>
{
console
.
log
(
res
);
this
.
selectPageMenu
(
0
);
this
.
showOp
=
false
;
})
delete
()
{
this
.
appService
.
alert
(
'确定删除该问卷吗'
,(
res
)
=>
{
this
.
appService
.
ObserverHttpGet
(
'/wisdomgroup/modules/question/delete'
,
{
id
:
this
.
temp
.
id
})
.
subscribe
((
res
)
=>
{
this
.
appService
.
popToastView
(
'删除成功'
,
'middle'
,
1000
);
this
.
selectPageMenu
(
0
);
this
.
showOp
=
false
;
})
})
}
cancle
(){
this
.
showOp
=
false
;
cancle
()
{
this
.
showOp
=
false
;
}
}
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