Commit 35b9ac41 authored by wangqinghua's avatar wangqinghua

通讯录更新

部分UI优化
parent 4fffb7b1
......@@ -43,11 +43,8 @@ export class MyApp {
private mobileAccess: MobileAccessibility,
private splashScreen: SplashScreen, private storage: Storage, private loginSer: LoginService) {
this.platform.ready().then(() => {
//app字体不跟随手机字体大小变化
this.mobileAccess.usePreferredTextZoom(false);
this.splashScreen.hide();
this.statusBar.show();
this.statusBar.overlaysWebView(false);
this.statusBar.backgroundColorByHexString('#5991CA');
......@@ -63,6 +60,7 @@ export class MyApp {
} else {
this.rootPage = LoginPage;
}
this.splashScreen.hide();
}
);
this.storage.get('area').then(
......
import * as Mock from 'mockjs'; // export const SERVER_API_URL = '/shfrdj'; export const SERVER_API_URL = 'http://61.152.117.206/shfrdj'; Mock.setup( { timeout:50, } ); export const institutionalNature = [ {label:'挂牌机构',value:'8'}, {label:'内设机构',value:'7'}, {label:'派驻机关',value:'6'}, {label:'派出机构',value:'5'}, {label:'分支机构',value:'4'}, {label:'临时机构',value:'3'}, {label:'议事协调机构',value:'2'}, {label:'挂靠机构',value:'1'}, ]
\ No newline at end of file
import * as Mock from 'mockjs'; export const SERVER_API_URL = '/shfrdj';// export const SERVER_API_URL = 'http://61.152.117.206/shfrdj'; Mock.setup( { timeout:50, } ); export const institutionalNature = [ {label:'挂牌机构',value:'8'}, {label:'内设机构',value:'7'}, {label:'派驻机关',value:'6'}, {label:'派出机构',value:'5'}, {label:'分支机构',value:'4'}, {label:'临时机构',value:'3'}, {label:'议事协调机构',value:'2'}, {label:'挂靠机构',value:'1'}, ]
\ No newline at end of file
......
import {AlertController, App, Events} from 'ionic-angular';import {HttpEvent, HttpHandler, HttpInterceptor, HttpRequest, HttpResponse} from '@angular/common/http';import {Injectable} from '@angular/core';import {Storage} from '@ionic/storage'; import {Observable} from 'rxjs';import {_throw} from 'rxjs/observable/throw';import {CommonService} from "./common.service";import {GlobalData} from "./GlobleData"; /** * http拦截器 增加token信息 */ @Injectable()export class InterceptorProvider implements HttpInterceptor { constructor(private storage: Storage, private alertCtrl: AlertController, private events: Events, private commonSer: CommonService, private app: App, private globle: GlobalData) { } // Intercepts all HTTP requests! intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> { const data = this.storage.get(''); return Observable.fromPromise(data) .mergeMap(data => { let clonedReq = this.addToken(request, data); return next.handle(clonedReq).do(res => { if (res instanceof HttpResponse) { this.message(res.body); } }, (error) => { let msg = error.message; this.errorMessage(error); // Pass the error to the caller of the function return _throw(error); }, () => { }) }); } // Adds the token to your headers if it exists private addToken(request: HttpRequest<any>, token: any) { let body; if (request.method == "POST") { body = Object.assign(request.body, {}); if (this.globle.token) { body = Object.assign(body, {"token": this.globle.token}); } if (this.globle.userObj && this.globle.userObj.userid) { body = Object.assign(body, {"userid": this.globle.userObj.userid}); } } if (token) { let clone: HttpRequest<any>; if (request.method == "POST") { clone = request.clone({ setHeaders: { // "Accept": `application/json`, 'Content-Type': `application/json;charset=UTF-8`, }, body: body }); } else { clone = request.clone({ setHeaders: { // "Accept": `application/json`, 'Content-Type': `application/json;charset=UTF-8`, }, }); } return clone; } return request; } //code message message(data) { if (data.code) { let code = data.code; if (code == "401") { this.commonSer.toast("登录已过期"); this.storage.clear(); this.events.publish('toLogin'); } else if (code == "-1") { let alert = this.alertCtrl.create({ title: "提示", message: `${data.msg}。`, buttons: ['确定'] }); alert.present(); } if (code == 500) { let alert = this.alertCtrl.create({ title: "提示", message: `${data.msg}。`, buttons: ['确定'] }); alert.present(); } } } //error message errorMessage(data) { if (data.status) { let code = data.status; if (code != 200) { const error = JSON.parse(data.error); let alert = this.alertCtrl.create({ title: "错误", message: `${data.error.errorMsg},错误码:${code}。`, buttons: ['确定'] }); alert.present(); } } } }
\ No newline at end of file
import {AlertController, App, Events} from 'ionic-angular';import {HttpEvent, HttpHandler, HttpInterceptor, HttpRequest, HttpResponse} from '@angular/common/http';import {Injectable} from '@angular/core';import {Storage} from '@ionic/storage'; import {Observable} from 'rxjs';import {_throw} from 'rxjs/observable/throw';import {CommonService} from "./common.service";import {GlobalData} from "./GlobleData"; /** * http拦截器 增加token信息 */ @Injectable()export class InterceptorProvider implements HttpInterceptor { constructor(private storage: Storage, private alertCtrl: AlertController, private events: Events, private commonSer: CommonService, private app: App, private globle: GlobalData) { } // Intercepts all HTTP requests! intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> { const data = this.storage.get(''); return Observable.fromPromise(data) .mergeMap(data => { let clonedReq = this.addToken(request, data); return next.handle(clonedReq).do(res => { if (res instanceof HttpResponse) { this.message(res.body); } }, (error) => { let msg = error.message; this.errorMessage(error); // Pass the error to the caller of the function return _throw(error); }, () => { }) }); } // Adds the token to your headers if it exists private addToken(request: HttpRequest<any>, token: any) { let body; if (request.method == "POST") { body = Object.assign(request.body, {}); if (this.globle.token) { body = Object.assign(body, {"token": this.globle.token}); } if (this.globle.userObj && this.globle.userObj.userid) { body = Object.assign(body, {"userid": this.globle.userObj.userid}); } } if (token) { let clone: HttpRequest<any>; if (request.method == "POST") { clone = request.clone({ setHeaders: { // "Accept": `application/json`, 'Content-Type': `application/json;charset=UTF-8`, }, body: body }); } else { clone = request.clone({ setHeaders: { // "Accept": `application/json`, 'Content-Type': `application/json;charset=UTF-8`, }, }); } return clone; } return request; } //code message message(data) { if (data.code) { let code = data.code; if (code == "401") { this.commonSer.toast("登录已过期"); this.storage.clear(); this.events.publish('toLogin'); } else if (code == "-1") { let alert = this.alertCtrl.create({ title: "提示", message: `${data.msg}。`, buttons: ['确定'] }); alert.present(); } if (code == 500) { let alert = this.alertCtrl.create({ title: "提示", message: `${data.msg}。`, buttons: ['确定'] }); alert.present(); } } } //error message errorMessage(data) { if (data.status) { let code = data.status; if (code != 200) { let alert = this.alertCtrl.create({ title: "错误", message: `错误码:${code}。`, buttons: ['确定'] }); alert.present(); } } } }
\ No newline at end of file
......
......@@ -214,6 +214,6 @@
<button class="submit-btn submit" (click)="sureSubmit()">确定</button>
</ng-container>
<ng-container *ngIf="!isShow">
<p text-center>请至PC端操作</p>
<p class="tips">提示:请至PC端操作</p>
</ng-container>
</ion-content>
......@@ -132,4 +132,11 @@ page-deal-detail {
height: 100%;
margin: 0;
}
.tips {
text-align: center;
padding: 20px 0;
background-color: #F2F2F2;
color: #4a89f9;
}
}
......@@ -17,21 +17,25 @@
</ion-list>
<div class="content-box">
<div class="content-box-item " (click)="changeType(0)">
<p class="item-title {{type.option == 0?'bgc-5991CA':''}} ">全部</p>
<p class="item-count">{{type.allList.length}}</p>
</div>
<div class="content-box-item " (click)="changeType(1)">
<p class="item-title {{type.option == 1?'bgc-5991CA':''}} ">设立</p>
<p class="item-count">{{type.setList.length}}</p>
<p class="item-count">{{type.setList.length}}</p>
</div>
<div class="content-box-item" (click)="changeType(2)">
<p class="item-title {{type.option == 2?'bgc-5991CA':''}}">变更</p>
<p class="item-count">{{type.changeList.length}}</p>
<p class="item-count">{{type.changeList.length}}</p>
</div>
<div class="content-box-item" (click)="changeType(3)">
<p class="item-title {{type.option == 3?'bgc-5991CA':''}}">注销</p>
<p class="item-count">{{type.cancelList.length}}</p>
<p class="item-count">{{type.cancelList.length}}</p>
</div>
<div class="content-box-item" (click)="changeType(4)">
<p class="item-title {{type.option == 4?'bgc-5991CA':''}}">补领</p>
<p class="item-count">{{type.getList.length}}</p>
<p class="item-count">{{type.getList.length}}</p>
</div>
</div>
......@@ -46,7 +50,8 @@
<div class="inner-button">
<div class="text-right">
<span (click)="goToDetail(item)" *ngIf="item.status == '1'" class="btn color1">受理</span>
<span (click)="handleClick(item,$event)" *ngIf="item.status == '1' && mineInfo.roles == 1 && item.dbtype == '0'"
<span (click)="handleClick(item,$event)"
*ngIf="item.status == '1' && mineInfo.roles == 1 && item.dbtype == '0'"
class="btn color1 db">督办事项</span>
<span (click)="goToDetail(item)" *ngIf="item.status == '2'" class="btn color2">审核</span>
<span (click)="goToDetail(item)" *ngIf="item.status == '3'" class="btn color3">审批</span>
......
......@@ -53,7 +53,7 @@ page-deal {
}
.content-box-item {
width: 25%;
width: 20%;
height: 65px;
margin: 8px 7px;
display: flex;
......
......@@ -24,7 +24,8 @@ export class DealPage {
]
};
type = {
option: 1,
option: 0,
allList: [],
list: [],
setList: [], //设立 1
changeList: [], //变更 2
......@@ -64,10 +65,12 @@ export class DealPage {
(res) => {
loading.dismiss();
if (res.page.list) {
this.type.allList = res.page.list;
this.type.setList = res.page.list.filter(e => e.flow == 1);
this.type.changeList = res.page.list.filter(e => e.flow == 2);
this.type.cancelList = res.page.list.filter(e => e.flow == 3);
this.type.getList = res.page.list.filter(e => e.flow == 4);
if (this.type.option == 0) this.type.list = this.type.allList;
if (this.type.option == 1) this.type.list = (this.type.setList);
if (this.type.option == 2) this.type.list = (this.type.changeList);
if (this.type.option == 3) this.type.list = (this.type.cancelList);
......@@ -81,10 +84,11 @@ export class DealPage {
changeType(type) {
this.type.option = type;
this.type.list = [];
if (type == 1) this.type.list = (this.type.setList);
if (type == 2) this.type.list = (this.type.changeList);
if (type == 3) this.type.list = (this.type.cancelList);
if (type == 4) this.type.list = (this.type.getList);
if (type == 0) this.type.list = this.type.allList;
if (type == 1) this.type.list = this.type.setList;
if (type == 2) this.type.list = this.type.changeList;
if (type == 3) this.type.list = this.type.cancelList;
if (type == 4) this.type.list = this.type.getList;
}
//督办操作
......
......@@ -9,7 +9,7 @@
<ion-list>
<p class="person-tips">基础信息(如需修改,请联系人事处)</p>
<p class="person-tips">基础信息</p>
<ion-item>
<div class="info-item">
<span class="info-span">头像</span>
......@@ -56,7 +56,7 @@
</ion-list>
<button class="call-btn" (click)="call(personInfo?.telephone)">拨打座机</button>
<button class="call-btn" (click)="call(personInfo?.telPhone)">拨打座机</button>
<button class="call-btn" (click)="call(personInfo?.mobilePhone)">拨打手机</button>
</ion-content>
import {Component} from '@angular/core';
import {IonicPage, NavController, NavParams} from 'ionic-angular';
import {CommonService} from "../../../core/common.service";
@Component({
......@@ -10,7 +11,8 @@ export class ContactDetailPage {
personInfo;
constructor(public navCtrl: NavController, public navParams: NavParams) {
constructor(public navCtrl: NavController, public navParams: NavParams,
private commonSer: CommonService) {
this.personInfo = this.navParams.get('person');
}
......@@ -19,11 +21,11 @@ export class ContactDetailPage {
}
call(phone) {
if (!phone) {
this.commonSer.toast('暂无号码');
return
}
window.location.href = "tel:" + phone;
}
addcontactPersons() {
}
}
......@@ -3,6 +3,7 @@ import {IonicPage, NavController, NavParams} from 'ionic-angular';
import {ContactDetailPage} from "../contact-detail/contact-detail";
import * as Mock from "mockjs";
import {HomeService} from "../home.service";
import {GlobalData} from "../../../core/GlobleData";
@Component({
selector: 'page-contact-list',
......@@ -17,6 +18,7 @@ export class ContactListPage {
}
constructor(public navCtrl: NavController, public navParams: NavParams,
private globle:GlobalData,
private homeSer: HomeService) {
this.area = this.navParams.get('area');
}
......@@ -29,7 +31,8 @@ export class ContactListPage {
getPersonList() {
const data = {
page: 1,
limit: 1000
limit: 1000,
areacode:this.area.code
};
this.homeSer.getOrgList(data).subscribe(
(res) => {
......
......@@ -21,21 +21,25 @@
</div>
</div>
<div class="content-box">
<div class="content-box-item " (click)="changeType(0)">
<p class="item-title {{type.option == 0?'bgc-5991CA':''}} ">全部</p>
<p class="item-count">{{type.allList.length}}</p>
</div>
<div class="content-box-item " (click)="changeType(1)">
<p class="item-title {{type.option == 1?'bgc-5991CA':''}} ">设立</p>
<p class="item-count">{{type.setList.length}}</p>
<p class="item-count">{{type.setList.length}}</p>
</div>
<div class="content-box-item" (click)="changeType(2)">
<p class="item-title {{type.option == 2?'bgc-5991CA':''}}">变更</p>
<p class="item-count">{{type.changeList.length}}</p>
<p class="item-count">{{type.changeList.length}}</p>
</div>
<div class="content-box-item" (click)="changeType(3)">
<p class="item-title {{type.option == 3?'bgc-5991CA':''}}">注销</p>
<p class="item-count">{{type.cancelList.length}}</p>
<p class="item-count">{{type.cancelList.length}}</p>
</div>
<div class="content-box-item" (click)="changeType(4)">
<p class="item-title {{type.option == 4?'bgc-5991CA':''}}">补领</p>
<p class="item-count">{{type.getList.length}}</p>
<p class="item-count">{{type.getList.length}}</p>
</div>
</div>
......
......@@ -23,8 +23,9 @@ export class DoVerityPage {
]
};
type = {
option: 1,
option: 0,
list: [],
allList: [],
setList: [], //设立 1
changeList: [], //变更 2
cancelList: [], //注销 3
......@@ -59,7 +60,6 @@ export class DoVerityPage {
}
changeOption() {
this.type.list = [];
const loading = this.loadCtrl.create();
loading.present();
const data = {
......@@ -73,14 +73,16 @@ export class DoVerityPage {
(res) => {
loading.dismiss();
if (res.page.list) {
this.type.allList = res.page.list;
this.type.setList = res.page.list.filter(e => e.flow == 1);
this.type.changeList = res.page.list.filter(e => e.flow == 2);
this.type.cancelList = res.page.list.filter(e => e.flow == 3);
this.type.getList = res.page.list.filter(e => e.flow == 4);
if (this.type.option == 1) this.type.list = this.type.list.concat(this.type.setList);
if (this.type.option == 2) this.type.list = this.type.list.concat(this.type.changeList);
if (this.type.option == 3) this.type.list = this.type.list.concat(this.type.cancelList);
if (this.type.option == 4) this.type.list = this.type.list.concat(this.type.getList);
if (this.type.option == 0) this.type.list = this.type.allList;
if (this.type.option == 1) this.type.list = this.type.setList;
if (this.type.option == 2) this.type.list = this.type.changeList;
if (this.type.option == 3) this.type.list = this.type.cancelList;
if (this.type.option == 4) this.type.list = this.type.getList;
}
}
)
......@@ -89,11 +91,11 @@ export class DoVerityPage {
//change
changeType(type) {
this.type.option = type;
this.type.list = [];
if (type == 1) this.type.list = this.type.list.concat(this.type.setList);
if (type == 2) this.type.list = this.type.list.concat(this.type.changeList);
if (type == 3) this.type.list = this.type.list.concat(this.type.cancelList);
if (type == 4) this.type.list = this.type.list.concat(this.type.getList);
if (type == 0) this.type.list = this.type.allList;
if (type == 1) this.type.list = this.type.setList;
if (type == 2) this.type.list = this.type.changeList;
if (type == 3) this.type.list = this.type.cancelList;
if (type == 4) this.type.list = this.type.getList;
}
handleClick(item, e) {
......
......@@ -46,15 +46,15 @@
<div class="data">
<div>
<p>单位数</p>
<p>{{unitsInfo?.hj.unitcount}}</p>
<p>8776</p>
</div>
<div>
<p>编制数</p>
<p>{{unitsInfo?.hj.bianzhicount}}</p>
<p>242567</p>
</div>
<div>
<p>实有数</p>
<p>{{unitsInfo?.hj.shiyoucount}}</p>
<p>232345</p>
</div>
</div>
</div>
......
......@@ -53,85 +53,74 @@ export class HomePage {
const data = {
yearmonth: this.yearmonth,
};
this.homeSer.units(data).subscribe(
(res) => {
if (res) {
this.unitsInfo = res.list;
const ser = [
{name: "单位数", value: this.unitsInfo.hj.unitcount},
{name: "编制数", value: this.unitsInfo.hj.bianzhicount},
{name: "实有数", value: this.unitsInfo.hj.shiyoucount},
];
this.echartData = {
grid: {
left: "8%",
right: "10%",
width: "90%",
height: "70%",
containLabel: true
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
crossStyle: {
color: '#999'
}
}
},
legend: {
data: ['实际在编人员数', '编制数', '单位数']
},
xAxis: [
{
type: 'category',
data: ['9月', '10月', '11月'],
axisPointer: {
type: 'shadow'
}
}
],
yAxis: [
{
type: 'value',
name: '人数',
axisLabel: {
formatter: '{value} 人'
}
},
{
type: 'value',
name: '单位数',
axisLabel: {
formatter: '{value} 个'
}
}
],
series: [
{
name: '实际在编人员数',
type: 'bar',
data: [221345, 222456, 232345],
color: ['#5baad2']
},
{
name: '编制数',
type: 'bar',
data: [222345, 233456, 242567],
color: ['#6de0d2']
},
{
name: '单位数',
type: 'line',
yAxisIndex: 1,
data: [6271, 7913, 8776],
color: ['#feda66']
}
]
};
this.echartData = {
grid: {
left: "8%",
right: "10%",
width: "90%",
height: "70%",
containLabel: true
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
crossStyle: {
color: '#999'
}
}
},
legend: {
data: ['实际在编人员数', '编制数', '单位数']
},
xAxis: [
{
type: 'category',
data: ['9月', '10月', '11月'],
axisPointer: {
type: 'shadow'
}
}
],
yAxis: [
{
type: 'value',
name: '人数',
axisLabel: {
formatter: '{value} 人'
}
},
{
type: 'value',
name: '单位数',
axisLabel: {
formatter: '{value} 个'
}
}
}
)
],
series: [
{
name: '实际在编人员数',
type: 'bar',
data: [221345, 222456, 232345],
color: ['#5baad2']
},
{
name: '编制数',
type: 'bar',
data: [222345, 233456, 242567],
color: ['#6de0d2']
},
{
name: '单位数',
type: 'line',
yAxisIndex: 1,
data: [6271, 7913, 8776],
color: ['#feda66']
}
]
};
}
......
......@@ -20,7 +20,7 @@
</ion-item>
<ion-item>
<span>当前版本</span>
<span float-right>v0.0.1</span>
<span float-right>v0.66</span>
</ion-item>
</ion-list>
</ion-content>
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