Commit 880c9ac9 authored by wangqinghua's avatar wangqinghua

color

parent 2584ca53
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
"proxies": [ "proxies": [
{ {
"path": "/wisdomgroup", "path": "/wisdomgroup",
"proxyUrl": "http://180.168.156.212:2931/wisdomgroup" "proxyUrl": "http://10.10.200.19:8080/wisdomgroup"
} }
] ]
} }
\ No newline at end of file
...@@ -54,6 +54,7 @@ export class JoinDetailPage { ...@@ -54,6 +54,7 @@ export class JoinDetailPage {
this.sign(); this.sign();
this.notJoin(); this.notJoin();
this.signAll(); this.signAll();
// this.init();
} }
//全部 //全部
...@@ -145,4 +146,14 @@ export class JoinDetailPage { ...@@ -145,4 +146,14 @@ export class JoinDetailPage {
} }
init(){
const data = {
name:'刘',
};
this.appService.ObserverHttpForm('/wisdomgroup/modules/activity/signAllByName/',this.acitivityid,data).
subscribe((res)=>{
})
}
} }
...@@ -34,7 +34,7 @@ export class ReportDetailPage { ...@@ -34,7 +34,7 @@ export class ReportDetailPage {
this.premanager = this.navParams.get('item'); this.premanager = this.navParams.get('item');
this.title = this.navParams.get("title"); this.title = this.navParams.get("title");
this.id = this.navParams.get("id"); this.id = this.navParams.get("id");
// this.init();
} }
ionViewDidEnter(){ ionViewDidEnter(){
...@@ -111,4 +111,15 @@ export class ReportDetailPage { ...@@ -111,4 +111,15 @@ export class ReportDetailPage {
this.navCtrl.push('OutGoingReportEditPage', { premanager: this.premanager }); this.navCtrl.push('OutGoingReportEditPage', { premanager: this.premanager });
} }
//查询人员
init(){
const data = {
name:'刘',
id:this.id
};
this.appService.ObserverHttpPostOption('/wisdomgroup/modules/premanager/getUserAboutPre',data).
subscribe((res)=>{
})
}
} }
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<ion-list> <ion-list>
<ion-item class="margin-bottom-20"> <ion-item class="margin-bottom-20">
<ion-label color="primary" class="ques-title" stacked><span class="color-red">*</span>标题</ion-label> <ion-label color="primary" class="ques-title" stacked><span class="color-red">*</span>标题</ion-label>
<ion-input type="text" [(ngModel)]="titile" placeholder="请输入标题"></ion-input> <ion-input type="text" [(ngModel)]="title" placeholder="请输入标题"></ion-input>
</ion-item> </ion-item>
<div class="create-content margin-bottom-20" *ngIf="qType != 4 && qType != 1"> <div class="create-content margin-bottom-20" *ngIf="qType != 4 && qType != 1">
<p class="item-type">选项</p> <p class="item-type">选项</p>
...@@ -66,5 +66,6 @@ ...@@ -66,5 +66,6 @@
</div> </div>
</ion-list> </ion-list>
<button class="submit-btn submit" (click)="submit()">确认</button> <button *ngIf="!this.editTemp" class="submit-btn submit" (click)="submit()">确认</button>
<button *ngIf="this.editTemp" class="submit-btn submit" (click)="submitEdit()">确认</button>
</ion-content> </ion-content>
...@@ -12,9 +12,13 @@ import {message} from "../../../../app/main"; ...@@ -12,9 +12,13 @@ import {message} from "../../../../app/main";
}) })
export class CreatePage { export class CreatePage {
//编辑
editTemp;
editIndex;
qType; //题目类型 qType; //题目类型
temp; //问卷信息 temp; //问卷信息
titile; //标题 title; //标题
index = 0; //序号 index = 0; //序号
quesDescList = []; quesDescList = [];
set = { //设置 set = { //设置
...@@ -29,8 +33,16 @@ export class CreatePage { ...@@ -29,8 +33,16 @@ export class CreatePage {
} }
ionViewDidLoad() { ionViewDidLoad() {
this.qType = this.navParams.get('type'); this.temp = this.navParams.get('temp'); //问卷信息
this.temp = this.navParams.get('temp'); 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.quesDescList = this.editTemp[this.editIndex].quesDesc;
}else{ //新增
this.qType = this.navParams.get('type'); //题目类型
}
} }
addOption() { addOption() {
...@@ -48,8 +60,54 @@ export class CreatePage { ...@@ -48,8 +60,54 @@ export class CreatePage {
this.quesDescList.splice(i, 1); this.quesDescList.splice(i, 1);
} }
//提交编辑问卷
submitEdit(){
if( !this.check() ){
return false;
}
let newArr = [];
this.editTemp[this.editIndex].title = this.title;
for (let i = 0; i < this.editTemp.length; i++) {
const arr = {
questionId: this.temp.id,
isAns: this.editTemp[i].isAns,
quesType: this.editTemp[i].quesType,
title: this.editTemp[i].title,
limit: this.editTemp[i].limit, //问答的字数限制
quesDesc: this.editTemp[i].quesDesc,
minOps: this.editTemp[i].minOps,
maxOps: this.editTemp[i].maxOps,
index: this.editTemp[i].index //序号
};
newArr.push(arr);
}
const data = {
array: JSON.stringify(newArr),
id: this.temp.id
};
console.log(newArr);
const toast = this.toastCtrl.create(message);
this.appService.ObserverHttpPost('/wisdomgroup/modules/question/saveQuestion', data)
.subscribe(
(res) => {
toast.setMessage('编辑成功');
toast.present();
setTimeout((res) => {
this.navCtrl.push('EditPage', {
temp: this.temp
});
}, 1000)
}
)
}
//提交问卷
submit() { submit() {
// this.navCtrl.push('EditPage');
if( !this.check() ){
return false;
}
if( this.qType == 1 ){ if( this.qType == 1 ){
const option1 = { const option1 = {
option_title: '是', //选项文字 option_title: '是', //选项文字
...@@ -71,7 +129,7 @@ export class CreatePage { ...@@ -71,7 +129,7 @@ export class CreatePage {
questionId: this.temp.id, questionId: this.temp.id,
isAns: 1, isAns: 1,
quesType: this.qType, quesType: this.qType,
title: this.titile, title: this.title,
limit: 1000, //问答的字数限制 limit: 1000, //问答的字数限制
quesDesc: this.quesDescList, quesDesc: this.quesDescList,
minOps: 0, minOps: 0,
...@@ -98,4 +156,31 @@ export class CreatePage { ...@@ -98,4 +156,31 @@ export class CreatePage {
) )
} }
//校验
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);
return false;
}else{
let index = 0;
this.quesDescList.forEach((res)=>{
if(res.option_title.length == ''){
index ++;
}
});
if(index > 0){
this.appService.popToastView('请输入选项','middle',1000);
return false;
}
}
}
return true;
}
} }
...@@ -10,8 +10,9 @@ ...@@ -10,8 +10,9 @@
<ion-content class="bgc-e7e8ed"> <ion-content class="bgc-e7e8ed">
<ion-list> <ion-list>
<ion-item> <ion-item class="padding-left-16">
<ion-label class="padding-left-16">{{temp.title}}</ion-label> <ion-input class="padding-left-16" [(ngModel)]="temp.title"></ion-input>
<!--<ion-label class="padding-left-16">{{temp.title}}</ion-label>-->
</ion-item> </ion-item>
<div class="question-list"> <div class="question-list">
<ion-item *ngFor="let item of contentList;let i = index" (click)="itemEdit(i)"> <ion-item *ngFor="let item of contentList;let i = index" (click)="itemEdit(i)">
...@@ -36,9 +37,9 @@ ...@@ -36,9 +37,9 @@
</ng-container> </ng-container>
</div> </div>
<div class="item-opra" *ngIf="editIndex == i"> <div class="item-opra" *ngIf="editIndex == i">
<div (click)="itemEdit(item)"><span>编辑</span></div> <div (click)="goEdit(i)"><span>编辑</span></div>
<div (click)="itemUp(item)"><span>上移</span></div> <div (click)="itemUp(i)"><span>上移</span></div>
<div (click)="itemDown(item)"><span>下移</span></div> <div (click)="itemDown(i)"><span>下移</span></div>
<div (click)="itemDelete(i)"><span>删除</span></div> <div (click)="itemDelete(i)"><span>删除</span></div>
</div> </div>
</ion-item> </ion-item>
......
...@@ -4,6 +4,7 @@ import {SelectTypePage} from "../select-type/select-type"; ...@@ -4,6 +4,7 @@ import {SelectTypePage} from "../select-type/select-type";
import {AppService} from "../../../../service/appHttpService"; import {AppService} from "../../../../service/appHttpService";
import {message} from "../../../../app/main"; import {message} from "../../../../app/main";
import {MinePage} from "../../../tabs/mine/mine"; import {MinePage} from "../../../tabs/mine/mine";
import {CreatePage} from "../create/create";
@IonicPage() @IonicPage()
@Component({ @Component({
...@@ -33,6 +34,7 @@ export class EditPage { ...@@ -33,6 +34,7 @@ export class EditPage {
ionViewDidEnter() { ionViewDidEnter() {
this.temp = this.navParams.get('temp'); this.temp = this.navParams.get('temp');
console.log(this.temp);
this.getDetail(); this.getDetail();
const length = this.navCtrl.length(); const length = this.navCtrl.length();
if(length > 5){ if(length > 5){
...@@ -66,14 +68,36 @@ export class EditPage { ...@@ -66,14 +68,36 @@ export class EditPage {
this.editIndex = index; this.editIndex = index;
} }
//上移 goEdit(index){
itemUp(item) { console.log(index);
this.navCtrl.push('CreatePage',{
edit:this.contentList,
index:index,
temp:this.temp
});
}
swapArray(arr, index1, index2) {
arr[index1] = arr.splice(index2, 1, arr[index1])[0];
return arr;
} }
//下移 //上移
itemDown(item) { itemUp(index) {
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{
// alert('已经处于置顶,无法上移');
}
} }
//删除 //删除
...@@ -115,6 +139,16 @@ export class EditPage { ...@@ -115,6 +139,16 @@ export class EditPage {
//保存 //保存
save() { save() {
//更新问卷信息
// this.appService.ObserverHttpPostParamsBody('/wisdomgroup/modules/question/update/',this.temp.id,this.temp).
// subscribe((res)=>{
//
// },(err)=>{
//
// });
//更新题目信息
let newArr = []; let newArr = [];
for (let i = 0; i < this.contentList.length; i++) { for (let i = 0; i < this.contentList.length; i++) {
const arr = { const arr = {
......
...@@ -146,6 +146,17 @@ export class AppService { ...@@ -146,6 +146,17 @@ export class AppService {
} }
ObserverHttpPostBody(url,data) {
return this.http.post(url, data,{
headers: new Headers({
// "Accept": "application/json",
// "Content-Type": "application/json"
'Content-Type': 'application/x-www-form-urlencoded,charset=UTF-8'
})
});
}
ObserverHttpPostForm(url, params) { ObserverHttpPostForm(url, params) {
return this.http.post(url, null, { //本地 return this.http.post(url, null, { //本地
params: params, params: params,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment