This commit is contained in:
Taric Xin
2022-03-07 15:35:40 +08:00
parent 7b9de7fffc
commit 916e0f9c0f
6 changed files with 19 additions and 14 deletions

View File

@ -46,7 +46,7 @@ export class SettingRoleEditComponent implements OnInit {
roleDescription: { roleDescription: {
title: '角色描述', title: '角色描述',
type: 'string', type: 'string',
maxLength: 100, maxLength: 50,
default: this.roleInfoData.roleDescription, default: this.roleInfoData.roleDescription,
ui: { ui: {
autosize: { minRows: 3 }, autosize: { minRows: 3 },

View File

@ -20,6 +20,6 @@
<button nz-button nzType="primary" (click)="roleAction()" acl [acl-ability]="['SYSTEM-ROLE-add']">新建角色</button> <button nz-button nzType="primary" (click)="roleAction()" acl [acl-ability]="['SYSTEM-ROLE-add']">新建角色</button>
</div> </div>
</div> </div>
<st #st [data]="params.listUrl" [columns]="columns" [req]="{ process: beforeReq }" [loading]="service.http.loading" <st #st [data]="params.listUrl" [columns]="columns" [req]="{ process: beforeReq }" [loading]="service.http.loading" [page]="{}"
[scroll]="{ y: '370px' }"></st> [scroll]="{ y: '370px' }"></st>
</nz-card> </nz-card>

View File

@ -34,6 +34,7 @@ export class RoleManagementComponent implements OnInit {
{ title: '创建人手机号', index: 'telephone' }, { title: '创建人手机号', index: 'telephone' },
{ {
title: '创建时间', title: '创建时间',
width: 170,
index: 'createTime', index: 'createTime',
type: 'date', type: 'date',
className: 'text-left', className: 'text-left',

View File

@ -32,7 +32,7 @@
</nz-alert> </nz-alert>
</div> </div>
<st #st [data]="service.$api_get_enterprise_staff_page" [columns]="columns" <st #st [data]="service.$api_get_enterprise_staff_page" [columns]="columns" [page]="{}"
[req]="{ params: {nameOrPhone: this.sf.value?.nameOrPhone} }" [loading]="service.http.loading" [req]="{ params: {nameOrPhone: this.sf.value?.nameOrPhone} }" [loading]="service.http.loading"
[scroll]="{ y: '370px' }" (change)="stChange($event)"></st> [scroll]="{ y: '370px' }" (change)="stChange($event)"></st>
</nz-card> </nz-card>

View File

@ -1,6 +1,7 @@
import { Component, OnInit, ViewChild } from '@angular/core'; import { Component, OnInit, ViewChild } from '@angular/core';
import { STComponent, STColumn, STChange } from '@delon/abc/st'; import { STComponent, STColumn, STChange } from '@delon/abc/st';
import { SFComponent, SFSchema } from '@delon/form'; import { SFComponent, SFSchema } from '@delon/form';
import { SettingsService } from '@delon/theme';
import { NzModalService } from 'ng-zorro-antd/modal'; import { NzModalService } from 'ng-zorro-antd/modal';
import { SystemService } from '../../services/system.service'; import { SystemService } from '../../services/system.service';
import { SystemStaffStaffModalComponent } from './staff-modal/staff-modal.component'; import { SystemStaffStaffModalComponent } from './staff-modal/staff-modal.component';
@ -35,7 +36,8 @@ export class StaffManagementComponent implements OnInit {
{ {
title: '最后登录时间', title: '最后登录时间',
index: 'lastLoginDate', index: 'lastLoginDate',
type: 'date' type: 'date',
format: item => `${item.lastLoginDate || '-'}`
}, },
{ {
title: '成员状态', title: '成员状态',
@ -53,31 +55,31 @@ export class StaffManagementComponent implements OnInit {
{ {
text: '编辑', text: '编辑',
click: item => this.staffAction(item), click: item => this.staffAction(item),
acl: { ability: ['SYSTEM-STAFF-edit'] }, acl: { ability: ['SYSTEM-STAFF-edit'] }
}, },
{ {
text: '恢复', text: '恢复',
iif: item => item.stateLocked === 1, iif: item => item.stateLocked === 1 && item.telephone !== this.user.phone,
click: item => this.action(item, 2), click: item => this.action(item, 2),
acl: { ability: ['SYSTEM-STAFF-lock'] }, acl: { ability: ['SYSTEM-STAFF-lock'] }
}, },
{ {
text: '冻结', text: '冻结',
iif: item => item.stateLocked === 0 && item.roleCode.split(',').indexOf('Administrator') === -1, iif: item => item.stateLocked === 0 && item.roleCode.split(',').indexOf('Administrator') === -1 && item.telephone !== this.user.phone,
click: item => this.action(item, 1), click: item => this.action(item, 1),
acl: { ability: ['SYSTEM-STAFF-lock'] }, acl: { ability: ['SYSTEM-STAFF-lock'] }
}, },
{ {
text: '超管转授', text: '超管转授',
iif: item => item.stateLocked === 0 && item.roleCode.split(',').indexOf('Administrator') === -1, iif: item => item.stateLocked === 0 && item.roleCode.split(',').indexOf('Administrator') === -1,
click: item => this.transpowerAction(item), click: item => this.transpowerAction(item),
acl: { ability: ['SYSTEM-STAFF-shiftAdmin'] }, acl: { ability: ['SYSTEM-STAFF-shiftAdmin'] }
}, },
{ {
text: '删除', text: '删除',
iif: item => item.stateLocked === 0 && item.roleCode.split(',').indexOf('Administrator') === -1, iif: item => item.stateLocked === 0 && item.roleCode.split(',').indexOf('Administrator') === -1 && item.telephone !== this.user.phone,
click: item => this.action(item, 3), click: item => this.action(item, 3),
acl: { ability: ['SYSTEM-STAFF-delete'] }, acl: { ability: ['SYSTEM-STAFF-delete'] }
} }
] ]
} }
@ -90,7 +92,9 @@ export class StaffManagementComponent implements OnInit {
2: { title: '确认恢复?', text: '恢复后用户在本系统的权限将一并重新开启。' }, 2: { title: '确认恢复?', text: '恢复后用户在本系统的权限将一并重新开启。' },
3: { title: '确认删除?', text: '删除后该用户ID将在本系统中将无法登录使用并删除请谨慎操作' } 3: { title: '确认删除?', text: '删除后该用户ID将在本系统中将无法登录使用并删除请谨慎操作' }
}; };
constructor(public service: SystemService, private nzModalService: NzModalService) {}
user = this.setting.user;
constructor(public service: SystemService, private nzModalService: NzModalService, private setting: SettingsService) {}
ngOnInit(): void {} ngOnInit(): void {}

View File

@ -27,7 +27,7 @@ export class SystemStaffStaffModalComponent implements OnInit {
staffName: { staffName: {
title: '员工姓名', title: '员工姓名',
type: 'string', type: 'string',
maxLength: 11, maxLength: 10,
ui: { widget: staff?.appUserId ? 'text' : 'string', placeholder: '请输入员工姓名' }, ui: { widget: staff?.appUserId ? 'text' : 'string', placeholder: '请输入员工姓名' },
default: staff.name default: staff.name
}, },