diff --git a/src/app/admin/system/system-role/system-role.component.html b/src/app/admin/system/system-role/system-role.component.html index f3f6251..b22c6a0 100644 --- a/src/app/admin/system/system-role/system-role.component.html +++ b/src/app/admin/system/system-role/system-role.component.html @@ -45,9 +45,7 @@ {{data.roleName}} - 超级管理员 - 就业局 - 培训机构 + {{data.roleType | system}} {{data.roleDesc}} diff --git a/src/app/admin/system/system.module.ts b/src/app/admin/system/system.module.ts index 9bc27e7..516d838 100644 --- a/src/app/admin/system/system.module.ts +++ b/src/app/admin/system/system.module.ts @@ -15,18 +15,20 @@ import {RichtextModule} from '../../common/richtext/richtext.module'; import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module'; import {RegionSelectorModule} from '../../common/region-selector/region-selector.module'; import { PositionRelComponent } from './position-rel/position-rel.component'; +import {AppCommonModule} from '../../app-common.module'; @NgModule({ declarations: [SystemOrganizationComponent, SystemRoleComponent, SystemRoleShowComponent, SystemUserComponent, MenuComponent, PermissionComponent, PositionRelComponent], - imports: [ - CommonModule, - SystemRoutingModule, - NgZorroAntdModule, - FormsModule, - ReactiveFormsModule, - NgxNeditorModule, - RichtextModule, - BreadcrumbModule, - RegionSelectorModule - ] + imports: [ + CommonModule, + SystemRoutingModule, + NgZorroAntdModule, + FormsModule, + ReactiveFormsModule, + NgxNeditorModule, + RichtextModule, + BreadcrumbModule, + RegionSelectorModule, + AppCommonModule + ] }) export class SystemModule { } diff --git a/src/app/admin/user/user-list/user-list.component.html b/src/app/admin/user/user-list/user-list.component.html new file mode 100644 index 0000000..314710d --- /dev/null +++ b/src/app/admin/user/user-list/user-list.component.html @@ -0,0 +1,93 @@ + + + + + +
+
+
+
+ + 用户名称 + + + + +
+
+ + 电话 + + + + +
+
+ + 注册时间 + + + + +
+
+ +
+
+ + +
+
+
+
+ + +
+ 共计 {{total}} 条数据 + + + + 编号 + 用户名称 + 用户头像 + 用户电话 + 性别 + 金币数量 + 注册时间 + 状态 + 操作 + + + + + {{i+1}} + {{data.name}} + + + + {{data.phone}} + {{data.sex}} + {{data.gold}} + {{data.regTime | date: 'yyyy-MM-dd HH:mm'}} + {{data.status ===1 ? '正常' : '禁用'}} + + + + + + + + + +
diff --git a/src/app/admin/user/user-list/user-list.component.scss b/src/app/admin/user/user-list/user-list.component.scss new file mode 100644 index 0000000..8bee3fb --- /dev/null +++ b/src/app/admin/user/user-list/user-list.component.scss @@ -0,0 +1,4 @@ +.head_img { + height: 60px; + width: 60px; +} diff --git a/src/app/admin/user/user-list/user-list.component.ts b/src/app/admin/user/user-list/user-list.component.ts new file mode 100644 index 0000000..8008eb1 --- /dev/null +++ b/src/app/admin/user/user-list/user-list.component.ts @@ -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(); + } + +} diff --git a/src/app/admin/user/user-routing.module.ts b/src/app/admin/user/user-routing.module.ts new file mode 100644 index 0000000..7c8ac31 --- /dev/null +++ b/src/app/admin/user/user-routing.module.ts @@ -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 { } diff --git a/src/app/admin/user/user.module.ts b/src/app/admin/user/user.module.ts new file mode 100644 index 0000000..cee6b58 --- /dev/null +++ b/src/app/admin/user/user.module.ts @@ -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 { } diff --git a/src/app/app-common.module.ts b/src/app/app-common.module.ts index 6eeae18..7bc6111 100644 --- a/src/app/app-common.module.ts +++ b/src/app/app-common.module.ts @@ -10,6 +10,7 @@ import {NgxNeditorModule} from '@notadd/ngx-neditor'; // 管道 import {TimesPipe , TextareaPipe} from './pipes'; +import { SystemPipe } from './pipes/system.pipe'; @@ -17,6 +18,7 @@ import {TimesPipe , TextareaPipe} from './pipes'; const PIPES = [ TimesPipe, TextareaPipe, + SystemPipe, ]; diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 1ad61b2..4370925 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -21,6 +21,11 @@ const routes: Routes = [ loadChildren: () => import('./admin/index/index.module').then(m => m.IndexModule), canActivate: [InitGuardService] }, + { + path: 'user', + loadChildren: () => import('./admin/user/user.module').then(m => m.UserModule), + canActivate: [InitGuardService] + }, { path: 'system', loadChildren: () => import('./admin/system/system.module').then(m => m.SystemModule), diff --git a/src/app/pipes/index.ts b/src/app/pipes/index.ts index 7b4f8d0..138b16a 100644 --- a/src/app/pipes/index.ts +++ b/src/app/pipes/index.ts @@ -1,2 +1,3 @@ export * from './commons/times.pipe'; export * from './commons/textarea.pipe'; +export * from './system.pipe'; diff --git a/src/app/pipes/system.pipe.ts b/src/app/pipes/system.pipe.ts new file mode 100644 index 0000000..9249d55 --- /dev/null +++ b/src/app/pipes/system.pipe.ts @@ -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 '门店账号'; + } + } + +} diff --git a/src/app/services/icon.service.ts b/src/app/services/icon.service.ts index 6f5d7c1..0ee2b85 100644 --- a/src/app/services/icon.service.ts +++ b/src/app/services/icon.service.ts @@ -12,7 +12,7 @@ export class IconService { constructor(private iconService: NzIconService) { this.iconService.fetchFromIconfont({ - scriptUrl: 'https://at.alicdn.com/t/font_1696267_9oscf8i6pgt.js' + scriptUrl: 'https://at.alicdn.com/t/font_2413274_o08racrjdz.js' }); } } diff --git a/src/app/services/user.service.ts b/src/app/services/user.service.ts index 22f5f4f..4901d18 100644 --- a/src/app/services/user.service.ts +++ b/src/app/services/user.service.ts @@ -1,13 +1,17 @@ import { Injectable } from '@angular/core'; import {environment} from '../../environments/environment'; import {HttpClient} from '@angular/common/http'; +import {CommonsService} from './commons.service'; @Injectable({ providedIn: 'root' }) 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); + }); + } + } diff --git a/src/assets/admin/navigation/icon.png b/src/assets/admin/navigation/icon.png index 9cb95c1..ec155ed 100644 Binary files a/src/assets/admin/navigation/icon.png and b/src/assets/admin/navigation/icon.png differ diff --git a/src/assets/admin/navigation/icon1.png b/src/assets/admin/navigation/icon1.png deleted file mode 100644 index 6e5afb4..0000000 Binary files a/src/assets/admin/navigation/icon1.png and /dev/null differ diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 9f5fb23..9d7130b 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -11,11 +11,10 @@ export const environment = { // baseUrl: 'https://newtalent.shinwoten.cn/crest/', // baseUrl: 'https://192.168.3.5:8301/crest/', - // baseUrl: 'http://localhost:8301/crest/', // 测试环境服务器地址(请求数据地址) - baseUrl: 'https://newtalent.shinwoten.cn/crest/', + baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址) + // baseUrl: 'https://newtalent.shinwoten.cn/crest/', imageUrl: 'https://newtalent.shinwoten.cn/filesystem/', - }; /* diff --git a/src/favicon.ico b/src/favicon.ico index f5e760d..ba7c40e 100644 Binary files a/src/favicon.ico and b/src/favicon.ico differ diff --git a/src/styles.scss b/src/styles.scss index b7b1be2..17ddbc8 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -25,9 +25,18 @@ margin-bottom: 20px; margin-top: 20px; } +.right-btn { + float: right; +} .search-button{ text-align: center; } .search-button button{ margin-left: 10px; } +.operating-button { + float: right; +} +.operating-button button { + margin-bottom: 15px; +}