提交修改

pull/1/head
yuanye 4 years ago
parent 975e9bac8d
commit cda2afa74f
  1. 4
      src/app/admin/system/system-role/system-role.component.html
  2. 24
      src/app/admin/system/system.module.ts
  3. 93
      src/app/admin/user/user-list/user-list.component.html
  4. 4
      src/app/admin/user/user-list/user-list.component.scss
  5. 68
      src/app/admin/user/user-list/user-list.component.ts
  6. 14
      src/app/admin/user/user-routing.module.ts
  7. 24
      src/app/admin/user/user.module.ts
  8. 2
      src/app/app-common.module.ts
  9. 5
      src/app/app-routing.module.ts
  10. 1
      src/app/pipes/index.ts
  11. 21
      src/app/pipes/system.pipe.ts
  12. 2
      src/app/services/icon.service.ts
  13. 18
      src/app/services/user.service.ts
  14. BIN
      src/assets/admin/navigation/icon.png
  15. BIN
      src/assets/admin/navigation/icon1.png
  16. 5
      src/environments/environment.ts
  17. BIN
      src/favicon.ico
  18. 9
      src/styles.scss

@ -45,9 +45,7 @@
<tr *ngFor="let data of ajaxTable.data"> <tr *ngFor="let data of ajaxTable.data">
<td>{{data.roleName}}</td> <td>{{data.roleName}}</td>
<td> <td>
<span *ngIf="data.roleType == 0">超级管理员</span> <span>{{data.roleType | system}}</span>
<span *ngIf="data.roleType == 1">就业局</span>
<span *ngIf="data.roleType == 2">培训机构</span>
</td> </td>
<td>{{data.roleDesc}}</td> <td>{{data.roleDesc}}</td>
<td> <td>

@ -15,18 +15,20 @@ import {RichtextModule} from '../../common/richtext/richtext.module';
import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module'; import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module';
import {RegionSelectorModule} from '../../common/region-selector/region-selector.module'; import {RegionSelectorModule} from '../../common/region-selector/region-selector.module';
import { PositionRelComponent } from './position-rel/position-rel.component'; import { PositionRelComponent } from './position-rel/position-rel.component';
import {AppCommonModule} from '../../app-common.module';
@NgModule({ @NgModule({
declarations: [SystemOrganizationComponent, SystemRoleComponent, SystemRoleShowComponent, SystemUserComponent, MenuComponent, PermissionComponent, PositionRelComponent], declarations: [SystemOrganizationComponent, SystemRoleComponent, SystemRoleShowComponent, SystemUserComponent, MenuComponent, PermissionComponent, PositionRelComponent],
imports: [ imports: [
CommonModule, CommonModule,
SystemRoutingModule, SystemRoutingModule,
NgZorroAntdModule, NgZorroAntdModule,
FormsModule, FormsModule,
ReactiveFormsModule, ReactiveFormsModule,
NgxNeditorModule, NgxNeditorModule,
RichtextModule, RichtextModule,
BreadcrumbModule, BreadcrumbModule,
RegionSelectorModule RegionSelectorModule,
] AppCommonModule
]
}) })
export class SystemModule { } export class SystemModule { }

@ -0,0 +1,93 @@
<!-- start 面包屑 -->
<app-breadcrumb></app-breadcrumb>
<!-- end 面包屑 -->
<!--条件搜索-->
<div class="inner-content">
<form nz-form [formGroup]="searchForm" (ngSubmit)="getRequest(true , searchForm.value)">
<div nz-row>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="6">用户名称</nz-form-label>
<nz-form-control [nzSpan]="16">
<input nz-input formControlName="name"/>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="6">电话</nz-form-label>
<nz-form-control [nzSpan]="16">
<input nz-input formControlName="phone"/>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="6">注册时间</nz-form-label>
<nz-form-control [nzSpan]="16">
<nz-range-picker [nzShowTime]="{ nzFormat: 'HH:mm' }" formControlName="regTime"></nz-range-picker>
</nz-form-control>
</nz-form-item>
</div>
</div>
<div nz-row>
<div nz-col nzSpan="24" class="search-button">
<button nz-button nzType="primary"><i nz-icon nzType="search" nzTheme="outline"></i>搜索</button>
<button nz-button nzType="default" (click)="resetForm()"><i nz-icon nzType="reload" nzTheme="outline"></i>重置</button>
</div>
</div>
</form>
</div>
<div class="inner-content">
<span>共计 {{total}} 条数据</span>
<nz-table
#ajaxTable
nzShowSizeChanger
[nzFrontPagination]="false"
[nzData]="requestData"
[nzLoading]="loading"
[nzTotal]="total"
[(nzPageIndex)]="pageNum"
[(nzPageSize)]="pageSize"
[nzScroll]="{ x: '1200px' }"
(nzPageIndexChange)="getRequest(false , searchForm.value)"
(nzPageSizeChange)="getRequest(false , searchForm.value)">
<thead nzSingleSort>
<tr>
<th nzWidth="50px">编号</th>
<th nzWidth="80px">用户名称</th>
<th nzWidth="70px">用户头像</th>
<th nzWidth="100px">用户电话</th>
<th nzWidth="50px">性别</th>
<th nzWidth="50px">金币数量</th>
<th nzWidth="100px">注册时间</th>
<th nzWidth="50px">状态</th>
<th nzWidth="80px" nzRight="0px">操作</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of ajaxTable.data; let i = index">
<td>{{i+1}}</td>
<td>{{data.name}}</td>
<td>
<img class="head_img" src="{{data.headerImg}}" onerror="this.src='../../../../assets/admin/navigation/icon.png'" alt="">
</td>
<td>{{data.phone}}</td>
<td>{{data.sex}}</td>
<td>{{data.gold}}</td>
<td>{{data.regTime | date: 'yyyy-MM-dd HH:mm'}}</td>
<td>{{data.status ===1 ? '正常' : '禁用'}}</td>
<td nzRight="0px" class="table-td-operation">
<!-- <a (click)='getDetails(data.id)'><i nz-icon nzType="search" nzTheme="outline" nz-tooltip="详情"></i></a>-->
<!-- <a *ngIf="data.status !== 2" (click)="getEdit(data.id)"><i nz-icon nzType="form" nzTheme="outline" nz-tooltip="修改"></i></a>-->
<!-- <a *ngIf="data.status !== 2 && data.status !== 3 " (click)='getAudit(data.id)'><i nz-icon nzType="audit" nzTheme="outline" nz-tooltip="提交审核"></i></a>-->
<!-- <a *ngIf="data.status !== 2 && data.status !== 3 " (click)='getDelete(data.id)'><i nz-icon nzType="delete" nzTheme="outline" nz-tooltip="删除"></i></a>-->
</td>
</tr>
</tbody>
</nz-table>
</div>

@ -0,0 +1,4 @@
.head_img {
height: 60px;
width: 60px;
}

@ -0,0 +1,68 @@
import { Component, OnInit } from '@angular/core';
import {FormBuilder, FormGroup} from '@angular/forms';
import {UserService} from '../../../services/user.service';
import {NzMessageService} from 'ng-zorro-antd';
@Component({
selector: 'app-user-list',
templateUrl: './user-list.component.html',
styleUrls: ['./user-list.component.scss']
})
export class UserListComponent implements OnInit {
searchForm: FormGroup; // 搜索框
requestData = []; // 列表数据
total: number; // 页码
pageNum = 1; // 页码
pageSize = 10; // 条码
loading = true;
regTime;
constructor(
private form: FormBuilder,
private user: UserService,
private message: NzMessageService
) { }
ngOnInit(): void {
this.init();
}
public init(): void {
this.searchForm = this.form.group({
name: [null],
phone: [null],
regTime: [null],
});
this.getRequest(true , this.searchForm.value);
}
// 查询列表
public getRequest(reset: boolean = false , whereObject: object) {
if (whereObject['regTime'] != null && whereObject['regTime'].length !== 0) {
whereObject['regTimeStart'] = whereObject['regTime'][0];
whereObject['regTimeEnd'] = whereObject['regTime'][1];
}
this.loading = false;
if (reset) {
this.pageNum = 1;
}
whereObject['pageNum'] = this.pageNum;
whereObject['pageSize'] = this.pageSize;
this.user.getListUser( whereObject, data => {
console.log(data);
if (data['return_code'] === '000000') {
this.requestData = data['return_data'].list;
this.total = data['return_data'].total;
} else {
this.message.error(data['return_msg']);
}
});
}
// 重置
public resetForm(): void {
this.searchForm.reset();
}
}

@ -0,0 +1,14 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import {UserListComponent} from './user-list/user-list.component';
const routes: Routes = [
{ path: 'user-list', component: UserListComponent },
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class UserRoutingModule { }

@ -0,0 +1,24 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { UserRoutingModule } from './user-routing.module';
import { UserListComponent } from './user-list/user-list.component';
import {NgZorroAntdModule} from 'ng-zorro-antd';
import {SeparateModule} from '../../common/separate/separate.module';
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module';
@NgModule({
declarations: [UserListComponent],
imports: [
CommonModule,
UserRoutingModule,
NgZorroAntdModule,
SeparateModule,
ReactiveFormsModule,
FormsModule,
BreadcrumbModule
]
})
export class UserModule { }

@ -10,6 +10,7 @@ import {NgxNeditorModule} from '@notadd/ngx-neditor';
// 管道 // 管道
import {TimesPipe , TextareaPipe} from './pipes'; import {TimesPipe , TextareaPipe} from './pipes';
import { SystemPipe } from './pipes/system.pipe';
@ -17,6 +18,7 @@ import {TimesPipe , TextareaPipe} from './pipes';
const PIPES = [ const PIPES = [
TimesPipe, TimesPipe,
TextareaPipe, TextareaPipe,
SystemPipe,
]; ];

@ -21,6 +21,11 @@ const routes: Routes = [
loadChildren: () => import('./admin/index/index.module').then(m => m.IndexModule), loadChildren: () => import('./admin/index/index.module').then(m => m.IndexModule),
canActivate: [InitGuardService] canActivate: [InitGuardService]
}, },
{
path: 'user',
loadChildren: () => import('./admin/user/user.module').then(m => m.UserModule),
canActivate: [InitGuardService]
},
{ {
path: 'system', path: 'system',
loadChildren: () => import('./admin/system/system.module').then(m => m.SystemModule), loadChildren: () => import('./admin/system/system.module').then(m => m.SystemModule),

@ -1,2 +1,3 @@
export * from './commons/times.pipe'; export * from './commons/times.pipe';
export * from './commons/textarea.pipe'; export * from './commons/textarea.pipe';
export * from './system.pipe';

@ -0,0 +1,21 @@
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'system'
})
export class SystemPipe implements PipeTransform {
transform(value: number): string {
switch (value) {
case 0:
return '超级管理员';
case 1:
return '区域账号';
case 2:
return '商户账号';
case 3:
return '门店账号';
}
}
}

@ -12,7 +12,7 @@ export class IconService {
constructor(private iconService: NzIconService) { constructor(private iconService: NzIconService) {
this.iconService.fetchFromIconfont({ this.iconService.fetchFromIconfont({
scriptUrl: 'https://at.alicdn.com/t/font_1696267_9oscf8i6pgt.js' scriptUrl: 'https://at.alicdn.com/t/font_2413274_o08racrjdz.js'
}); });
} }
} }

@ -1,13 +1,17 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import {environment} from '../../environments/environment'; import {environment} from '../../environments/environment';
import {HttpClient} from '@angular/common/http'; import {HttpClient} from '@angular/common/http';
import {CommonsService} from './commons.service';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
}) })
export class UserService { export class UserService {
constructor(private http: HttpClient) { } constructor(
private http: HttpClient,
private common: CommonsService
) { }
/** /**
* *
@ -32,4 +36,16 @@ export class UserService {
}); });
} }
/**
*
*
* @param paramsObject
* @param callBack
*/
public getListUser(paramsObject: object, callBack) {
this.http.get(environment.baseUrl + 'highUser/getListUser?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
callBack(data);
});
}
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

@ -11,11 +11,10 @@ export const environment = {
// baseUrl: 'https://newtalent.shinwoten.cn/crest/', // baseUrl: 'https://newtalent.shinwoten.cn/crest/',
// baseUrl: 'https://192.168.3.5:8301/crest/', // baseUrl: 'https://192.168.3.5:8301/crest/',
// baseUrl: 'http://localhost:8301/crest/', // 测试环境服务器地址(请求数据地址) baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址)
baseUrl: 'https://newtalent.shinwoten.cn/crest/', // baseUrl: 'https://newtalent.shinwoten.cn/crest/',
imageUrl: 'https://newtalent.shinwoten.cn/filesystem/', imageUrl: 'https://newtalent.shinwoten.cn/filesystem/',
}; };
/* /*

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

@ -25,9 +25,18 @@
margin-bottom: 20px; margin-bottom: 20px;
margin-top: 20px; margin-top: 20px;
} }
.right-btn {
float: right;
}
.search-button{ .search-button{
text-align: center; text-align: center;
} }
.search-button button{ .search-button button{
margin-left: 10px; margin-left: 10px;
} }
.operating-button {
float: right;
}
.operating-button button {
margin-bottom: 15px;
}

Loading…
Cancel
Save