Merge branch 'develop-2'

This commit is contained in:
zhouyuejun
2018-12-15 10:32:08 +08:00
7 changed files with 141 additions and 53 deletions
@@ -7,11 +7,19 @@
<nz-form-item >
<nz-form-label class="left">关键词</nz-form-label>
<nz-form-control nzSpan="17">
<input nz-input [(ngModel)]='search.keyword' placeholder="请输入角色名称">
<input nz-input [(ngModel)]='search.keyword' placeholder="请输入关键词">
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<div nz-col nzSpan="9">
<nz-form-item >
<nz-form-label class="left">时间</nz-form-label>
<nz-form-control nzSpan="20">
<nz-range-picker [(ngModel)]="dateRange" (ngModelChange)="onChange($event)" nzShowTime></nz-range-picker>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="6">
<nz-form-item >
<nz-form-control nzSpan="24">
<button class="mr10" nz-button nzType="primary" (click)="queryTable()"><i nz-icon type="search"></i>查询</button>
@@ -19,9 +27,7 @@
</nz-form-control>
</nz-form-item>
</div>
</div>
<div class="table-operation-box">
<button (click)="addModify(1)" nz-button nzType="primary"><i nz-icon type="plus" theme="outline"></i>新增</button>
</div>
</div>
<app-request-status *ngIf='statusParamsTable.status!=4' [statusParams]='statusParamsTable'></app-request-status>
@@ -29,24 +35,20 @@
<nz-table [nzShowPagination]='false' #dataSet [nzData]="tableData">
<thead>
<tr>
<th>时间</th>
<th></th>
<th>账号</th>
<th>日志类别</th>
<th>操作类别</th>
<th>描述</th>
<th>登录ip</th>
<th>序号</th>
<th>用户</th>
<th>模块</th>
<th>操作内容</th>
<th>操作时间</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let item of dataSet.data">
<td>{{item.log_datetime| date:'yyyy-MM-dd HH:mm:ss'}}</td>
<td>{{item.real_name}}</td>
<tr *ngFor="let item of dataSet.data;let i=index">
<td>{{i+1}}</td>
<td>{{item.user_name}}</td>
<td>{{logType[item.log_type]}}</td>
<td>{{item.opt_type}}</td>
<td>{{item.model_name}}</td>
<td>{{item.summary}}</td>
<td>{{item.login_ip}}</td>
<td>{{item.log_datetime| date:'yyyy-MM-dd HH:mm:ss'}}</td>
</tr>
</tbody>
</nz-table>
@@ -34,6 +34,7 @@ export class OperationLogsComponent implements OnInit {
'UPDATE':'修改',
'DELETE':'删除',
};
dateRange = [];
constructor(
private http:HttpClientService,
private router:Router,
@@ -48,16 +49,23 @@ export class OperationLogsComponent implements OnInit {
})
this.queryTable();
}
onChange(result: Date): void {
this.search.date_start=new Date(result[0]).getTime();
this.search.date_end=new Date(result[1]).getTime();
}
//重置,重置搜索条件
reset(){
this.search.page_index=1;
this.search.page_size=10;
this.search.keyword='';
this.search.date_start='';
this.search.date_end='';
this.queryTable();
}
//获取列表
queryTable():void{
this.statusParamsTable.status=1;
this.tableData=[];
this.http.get('/sysapi/oplog/list',this.search).subscribe((json)=>{
if(json.is_success){
this.tableData=json.body.recordList;
@@ -90,12 +90,13 @@ export class ColorSettingsComponent implements OnInit {
//获取列表
queryTable():void{
this.statusParamsData.status=1;
this.tableData=[];
this.DataList=[];
this.http.get('/adminapi/settings/uisettings',{groupCode:'userSettingColor'}).subscribe((json)=>{
if(json.is_success){
this.statusParamsData.status=3;
let data=json.body;
this.tableData=json.body;
this.DataList=[];
//当data为空是,初始化
//判断data是否为空,空的时候则为最初的初始化;如果不为空,则有设置过个人设置的某个模块
if(data&&data.length>0){
@@ -4,7 +4,8 @@
<div class="ant-transfer-list">
<div class="ant-transfer-list-header">可选列({{sourceList.length}}</div>
<div class="ant-transfer-list-body">
<ul class="ant-transfer-list-content">
<app-request-status [statusParams]='statusParamsData'></app-request-status>
<ul class="ant-transfer-list-content" *ngIf='statusParamsData.status==3'>
<li (click)="selectNode(item,i,1)" [ngClass]="{'bg':moveIndex==i&&selectedType==1}" class="ant-transfer-list-content-item ng-star-inserted" *ngFor="let item of sourceList;let i=index"><label class="ant-checkbox-wrapper ng-untouched ng-pristine ng-valid"><span>{{item.COL_CN}}</span></label></li>
<div class="self-row-tips" *ngIf="!(sourceList.length>0)">暂无数据</div>
</ul>
@@ -28,8 +29,8 @@
</div>
</div>
<div class="self-row-footer">
<button (click)='saveSelf()' nzTitle="保存配置" nzPlacement="top" nz-tooltip nz-button nzType="primary"><i class="fa fa-check" aria-hidden="true"></i> 确定</button>
<button (click)='cancelSelf()' nzTitle="取消配置" nzPlacement="top" nz-tooltip nz-button nzType="default"><i class="fa fa-times" aria-hidden="true"></i> 取消</button>
<button (click)='saveSelf()' [nzLoading]="isLoadingSave" nzPlacement="top" nz-tooltip nz-button nzType="primary">保存</button>
<button (click)='cancelSelf()' nzPlacement="top" nz-tooltip nz-button nzType="default">取消</button>
</div>
</div>
</div>
@@ -1,44 +1,72 @@
import { Component, OnInit } from '@angular/core';
import { HttpClientService } from '../../../../services/http-client.service';
import { NzMessageService } from 'ng-zorro-antd';
@Component({
selector: 'app-msg-alert-warning',
templateUrl: './msg-alert-warning.component.html',
styleUrls: ['./msg-alert-warning.component.scss']
styleUrls: ['./msg-alert-warning.component.scss'],
providers:[HttpClientService]
})
export class MsgAlertWarningComponent implements OnInit {
public list: any[] = []; //原始数据项
public sourceList: any[] = []; //临时数据项-可选项
public defaultData:any=[]; //默认的全部可选项
public targetList:any=[]; //临时数据项-已选项
public disableRight:any=true; //单个右移控制按钮可选状态 true 禁止选择 false可选择
public disabledLeft:any=true; //单个左移控制按钮可选状态 true 禁止选择 false可选择
public selectedType:any=''; //当前选中项所在项目 1在可选项 2在已选项框
public moveIndex:any='false';
constructor() { }
isLoadingSave:any=false;
statusParamsData:any={ //获取接口的状态,0请求失败 1请求前 2请求中 3请求成功,有数据 4请求成功,无数据
status:1,
}
constructor(
private http:HttpClientService,
private message: NzMessageService,
) { }
ngOnInit() {
this.list=[{"COL_CODE":"FLNO", "COL_CN":"航班号", "COL_ORDER":"10"}, {"COL_CODE":"ALCD", "COL_CN":"航空公司", "COL_ORDER":"8"}, {"COL_CODE":"FLIN", "COL_CN":"航线类别", "COL_ORDER":"4"}, {"COL_CODE":"FLTY", "COL_CN":"航班类别", "COL_ORDER":"5"}, {"COL_CODE":"MVIN", "COL_CN":"航向指示", "COL_ORDER":"9"}, {"COL_CODE":"TRML", "COL_CN":"候机楼", "COL_ORDER":"7"}, {"COL_CODE":"RENO", "COL_CN":"飞机号", "COL_ORDER":"3"}, {"COL_CODE":"SODT", "COL_CN":"计划到达/出发", "COL_ORDER":"13"}, {"COL_CODE":"ESTT", "COL_CN":"预计到达/出发", "COL_ORDER":"14"}, {"COL_CODE":"ACTT", "COL_CN":"实际到达/出发", "COL_ORDER":"15"}, {"COL_CODE":"STND", "COL_CN":"停机位", "COL_ORDER":"16"}, {"COL_CODE":"ORDER", "COL_CN":"排序", "COL_ORDER":"17"} ]
/*
备注:实际数据中,把原始数据录入到临时变量中,方便取消按钮,重置数据
这里数组复制不能用浅复制sourceList=list;而是要用深度复制,this.sourceList=[...this.list]
*/
//深度复制
this.list.forEach(item=>{
let option=this.deepCopy(item);
this.sourceList.push(option);
})
this.defaultData=[
{"COL_CODE":" FLOP-CNCL", "COL_CN":"航班取消"},
{"COL_CODE":" FLOP-FRET", "COL_CN":"航班返回"},
{"COL_CODE":" FLOP-FDIV", "COL_CN":"航班备降"},
{"COL_CODE":" FLOP-FDEL", "COL_CN":"航班删除"},
{"COL_CODE":" FLOP-DELY", "COL_CN":"航班延误"},
{"COL_CODE":" FLOP-ACTT", "COL_CN":"实际时间"},
{"COL_CODE":" FLOP-GTDT", "COL_CN":"登机门消息"},
{"COL_CODE":" FLOP-PSDT", "COL_CN":"机位变更"},
{"COL_CODE":" FLOP-ESTT", "COL_CN":"预计到达时间"},
{"COL_CODE":" FLOP-PADT", "COL_CN":"前站起飞"},
{"COL_CODE":" FLOP-CKDT", "COL_CN":"值机柜台"},
{"COL_CODE":" FLOP-BOTM", "COL_CN":"登机开始"},
{"COL_CODE":" FLOP-CLDT", "COL_CN":"行李转盘"},
{"COL_CODE":" FLOP-ROUT", "COL_CN":"航班航线"},
{"COL_CODE":" FLOP-VIPP", "COL_CN":"航班VIP"},
{"COL_CODE":" FLOP-HNAG", "COL_CN":"服务代理"},
{"COL_CODE":" FLOP-FLBG", "COL_CN":"首末件行李到达"},
{"COL_CODE":" FLOP-RENO", "COL_CN":"飞机号变更"},
{"COL_CODE":" FLOP-ABTM", "COL_CN":"登桥撤桥"},
{"COL_CODE":" FLOP-CHOT", "COL_CN":"上下轮档"},
{"COL_CODE":" FLOP-TRML", "COL_CN":"航站楼"},
]
this.queryTable();
}
//对象数组深度复制
deepCopy(data){
let itemObj={
bgColor:'#fafafa',
};
let itemObj={};
for(let key in data){
itemObj[key]=data[key];
}
return itemObj;
}
//数组深度复制构造
listsCope(sourceList,targetList){
sourceList.forEach(item=>{
let option=this.deepCopy(item);
targetList.push(option);
})
}
//左右选择项目 type 1右移 2左移 3全部右移 4全部左移
moveCross(type){
let index=this.moveIndex;
@@ -87,19 +115,67 @@ export class MsgAlertWarningComponent implements OnInit {
}
//保存-自定义列显示保存
saveSelf(){
console.log(this.targetList);
console.log(this.sourceList);
let content={
defaultData:this.defaultData,
sourceList:this.sourceList,
targetList:this.targetList,
}
let settingContent=JSON.stringify(content);
let params:any={
envCode:'web',
groupCode:'userSettingMsgAlert',
settingContent:settingContent,
}
this.isLoadingSave=true;
console.log(params);
this.http.post('/adminapi/settings/uisettings',params).subscribe((json)=>{
this.isLoadingSave=false;
if(json.is_success){
this.message.success(`保存成功!`);
this.queryTable();
}else{
this.message.error(`保存失败!`);
}
})
}
//重置数据
cancelSelf(){
this.queryTable();
}
//获取列表
queryTable():void{
this.statusParamsData.status=1;
this.list=[];
this.sourceList=[];
//等后台接口出来后,重置this.sourceList this.targetList
//深度复制
this.list.forEach(item=>{
let option=this.deepCopy(item);
this.sourceList.push(option);
})
this.targetList=[];
this.http.get('/adminapi/settings/uisettings',{groupCode:'userSettingMsgAlert'}).subscribe((json)=>{
if(json.is_success){
this.statusParamsData.status=3;
let data=json.body;
//当data为空是,初始化
this.listsCope(this.defaultData,this.list);
//判断data是否为空,空的时候则为最初的初始化;如果不为空,则有设置过个人设置的某个模块
if(data&&data.length>0){
data.forEach(item=>{
if(item.settingContent){
console.log(222)
let content=JSON.parse(item.settingContent);
this.listsCope(content.sourceList,this.sourceList);
this.listsCope(content.targetList,this.targetList);
}else{
console.log(3333)
this.listsCope(this.list,this.sourceList);
}
})
}else{
console.log(5555)
//接口数据为空,说明各个模块设置都为未初始化,可选项则为默认全部列
this.listsCope(this.list,this.sourceList);
}
}else{
this.statusParamsData.status=0;
}
})
}
}
@@ -251,14 +251,15 @@ export class PersonalSettingsComponent implements OnInit {
//获取列表
queryTable():void{
this.statusParamsData.status=1;
this.list=[];
this.sourceList=[];
this.targetList=[];
this.colsData='';
this.http.get('/adminapi/settings/uisettings',{groupCode:'userSettingCol'}).subscribe((json)=>{
if(json.is_success){
this.statusParamsData.status=3;
let data=json.body;
this.colsData=json.body;
this.list=[];
this.sourceList=[];
this.targetList=[];
//当data为空是,初始化
this.listsCope(this.defaultCols,this.list);
//判断data是否为空,空的时候则为最初的初始化;如果不为空,则有设置过个人设置的某个模块
@@ -27,8 +27,6 @@ export class RoleManagementComponent implements OnInit {
page_size:'10',
role_name:'',
}
visible = false; //用户详情抽屉框显示隐藏
userDetail:any={}; //用户详情
constructor(
private http:HttpClientService,
@@ -73,6 +71,7 @@ export class RoleManagementComponent implements OnInit {
//获取列表
queryTable():void{
this.statusParamsTable.status=1;
this.tableData=[];
this.http.get('/sysapi/setting/role/list',this.search).subscribe((json)=>{
if(json.is_success){
this.tableData=json.body.list;