@ecip/permission
Version:
700 lines (690 loc) • 31.7 kB
JavaScript
import { RouterModule } from '@angular/router';
import '@delon/abc';
import { _HttpClient, ModalHelper } from '@delon/theme';
import { CacheService } from '@delon/cache';
import { TreeService, SharedModule } from '@ecip/shared';
import { Component, ViewChild, NgModule } from '@angular/core';
import { NzModalRef, NzMessageService } from 'ng-zorro-antd';
import { FormBuilder, Validators } from '@angular/forms';
import { Observable } from 'rxjs';
import { UserService, AppsService, RoleService, ResourceService } from '@ecip/service';
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class PermissionRoleEditComponent {
/**
* @param {?} modal
* @param {?} msgSrv
* @param {?} appsService
* @param {?} roleService
* @param {?} userService
* @param {?} http
* @param {?} fb
* @param {?} cacheService
*/
constructor(modal, msgSrv, appsService, roleService, userService, http, fb, cacheService) {
this.modal = modal;
this.msgSrv = msgSrv;
this.appsService = appsService;
this.roleService = roleService;
this.userService = userService;
this.http = http;
this.fb = fb;
this.cacheService = cacheService;
this.record = {};
this.optionList = [];
this.loading = false;
this.stateList = this.cacheService.get(`api/dict/type/enableState`);
this.codeAsyncValidator = (/**
* @param {?} control
* @return {?}
*/
(control) => Observable.create((/**
* @param {?} observer
* @return {?}
*/
(observer) => {
if (!control.value) {
observer.next(null);
observer.complete();
return;
}
this.roleService.checkCode({ code: control.value, id: this.record.id }).subscribe((/**
* @param {?} res
* @return {?}
*/
(res) => {
if (res.valid === true) {
observer.next(null);
}
else {
observer.next({ error: true, duplicated: true });
}
observer.complete();
}));
})));
}
/**
* @return {?}
*/
ngOnInit() {
this.form = this.fb.group({
appId: [this.appId, []],
roleName: [null, []],
code: [null, [Validators.required], [this.codeAsyncValidator]],
status: [1, [Validators.required]],
sortNum: [0, [Validators.required]],
remark: [null, []],
createTime: [null, []]
});
this.loading = true;
/*this.appsService.getList().subscribe(appList => {
this.optionList = appList;
});*/
if (!this.record.id) {
return;
}
this.roleService.getById(this.record.id).subscribe((/**
* @param {?} res
* @return {?}
*/
res => {
this.form.patchValue(res);
this.i = res;
}));
}
/**
* @param {?} c1
* @param {?} c2
* @return {?}
*/
compareNumStr(c1, c2) {
return c1 == c2;
}
/**
* @return {?}
*/
submit() {
for (const i in this.form.controls) {
this.form.controls[i].markAsDirty();
this.form.controls[i].updateValueAndValidity();
}
if (this.form.invalid)
return;
if (!this.record.id) {
//新增
this.roleService.post(this.form.value).subscribe((/**
* @param {?} res
* @return {?}
*/
res => {
this.msgSrv.success('保存成功');
this.modal.close(true);
}));
return;
}
//修改
this.roleService.put(this.record.id, this.form.value).subscribe((/**
* @param {?} res
* @return {?}
*/
res => {
this.msgSrv.success('保存成功');
this.modal.close(true);
}));
}
/**
* @return {?}
*/
close() {
this.modal.destroy();
}
}
PermissionRoleEditComponent.decorators = [
{ type: Component, args: [{
selector: 'app-permission-role-edit',
template: "<div class=\"modal-header\">\r\n <div *ngIf=\"!record.id\" class=\"modal-title\">\u65B0\u589E\u4FE1\u606F</div>\r\n <div *ngIf=\"record.id\" class=\"modal-title\">\u7F16\u8F91 {{ record.account }} \u4FE1\u606F</div>\r\n</div>\r\n<nz-spin *ngIf=\"!i && record.id\" class=\"modal-spin\"></nz-spin>\r\n<form *ngIf=\"!record.id || record.id && i\" nz-form [formGroup]=\"form\" (ngSubmit)=\"submit()\">\r\n <!--<nz-form-item>\r\n <nz-form-label nzXs=\"24\" nzSm=\"7\" nzRequired nzFor=\"appId\">\u7CFB\u7EDF</nz-form-label>\r\n <nz-form-control nzXs=\"24\" nzSm=\"12\" nzMd=\"10\" nzHasFeedback>\r\n <nz-select [compareWith]=\"compareNumStr\" nzShowSearch nzAllowClear formControlName=\"appId\">\r\n <nz-option *ngFor=\"let option of optionList\" [nzLabel]=\"option.appName\"\r\n [nzValue]=\"option.appId\"></nz-option>\r\n </nz-select>\r\n </nz-form-control>\r\n </nz-form-item>-->\r\n\r\n <nz-form-item>\r\n <nz-form-label nzXs=\"24\" nzSm=\"7\" nzRequired nzFor=\"roleName\">\u89D2\u8272\u540D\u79F0</nz-form-label>\r\n <nz-form-control nzXs=\"24\" nzSm=\"12\" nzMd=\"10\" nzHasFeedback>\r\n <input nz-input formControlName=\"roleName\">\r\n <nz-form-explain *ngIf=\"form.get('roleName').dirty && form.get('roleName').errors\">\u8BF7\u8F93\u5165\u89D2\u8272\u540D\u79F0</nz-form-explain>\r\n </nz-form-control>\r\n </nz-form-item>\r\n\r\n <nz-form-item>\r\n <nz-form-label nzXs=\"24\" nzSm=\"7\" nzRequired nzFor=\"code\">\u7F16\u7801</nz-form-label>\r\n <nz-form-control nzXs=\"24\" nzSm=\"12\" nzMd=\"10\" nzHasFeedback>\r\n <input nz-input formControlName=\"code\">\r\n <nz-form-explain *ngIf=\"form.get('code').dirty && form.get('code').errors || form.get('code').pending \">\r\n <ng-container *ngIf=\"form.get('code').hasError('required')\">\r\n \u8BF7\u8F93\u5165\u7F16\u7801\r\n </ng-container>\r\n <ng-container *ngIf=\"form.get('code').hasError('duplicated')\">\r\n \u7F16\u7801\u5DF2\u5B58\u5728\r\n </ng-container>\r\n <ng-container *ngIf=\"form.get('code').pending\">\r\n \u6821\u9A8C\u4E2D...\r\n </ng-container>\r\n </nz-form-explain>\r\n </nz-form-control>\r\n </nz-form-item>\r\n\r\n <nz-form-item>\r\n <nz-form-label nzXs=\"24\" nzSm=\"7\" nzRequired nzFor=\"status\">\u542F\u7528\u72B6\u6001</nz-form-label>\r\n <nz-form-control nzXs=\"24\" nzSm=\"12\" nzMd=\"10\">\r\n <nz-radio-group formControlName=\"status\">\r\n <!--<label nz-radio [nzValue]=\"1\">\u542F\u7528</label>-->\r\n <!--<label nz-radio [nzValue]=\"0\">\u672A\u542F\u7528</label>-->\r\n <label nz-radio *ngFor=\"let state of stateList | async\" [nzValue]=\"state.value\">{{state.label}}</label>\r\n </nz-radio-group>\r\n <nz-form-explain *ngIf=\"form.get('status').dirty && form.get('status').errors\">\r\n \u8BF7\u9009\u62E9\u542F\u7528\u72B6\u6001\r\n </nz-form-explain>\r\n </nz-form-control>\r\n </nz-form-item>\r\n\r\n <nz-form-item>\r\n <nz-form-label nzXs=\"24\" nzSm=\"7\" nzRequired nzFor=\"sortNum\">\u6392\u5E8F</nz-form-label>\r\n <nz-form-control nzXs=\"24\" nzSm=\"12\" nzMd=\"10\" nzHasFeedback>\r\n <input nz-input formControlName=\"sortNum\">\r\n <nz-form-explain *ngIf=\"form.get('sortNum').dirty && form.get('sortNum').errors\">\r\n \u8BF7\u8F93\u5165\u6392\u5E8F\r\n </nz-form-explain>\r\n </nz-form-control>\r\n </nz-form-item>\r\n\r\n <div class=\"modal-footer\">\r\n <button nz-button type=\"button\" (click)=\"close()\">\u5173\u95ED</button>\r\n <button nz-button type=\"submit\" [disabled]=\"!form.valid\" nzType=\"primary\" [nzLoading]=\"http.loading\">\u4FDD\u5B58</button>\r\n </div>\r\n</form>\r\n"
}] }
];
/** @nocollapse */
PermissionRoleEditComponent.ctorParameters = () => [
{ type: NzModalRef },
{ type: NzMessageService },
{ type: AppsService },
{ type: RoleService },
{ type: UserService },
{ type: _HttpClient },
{ type: FormBuilder },
{ type: CacheService }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class PermissionRoleViewComponent {
/**
* @param {?} modal
* @param {?} msgSrv
* @param {?} roleService
*/
constructor(modal, msgSrv, roleService) {
this.modal = modal;
this.msgSrv = msgSrv;
this.roleService = roleService;
this.record = {};
}
/**
* @return {?}
*/
ngOnInit() {
this.roleService.getById(this.record.id).subscribe((/**
* @param {?} res
* @return {?}
*/
res => this.i = res));
}
/**
* @return {?}
*/
close() {
this.modal.destroy();
}
}
PermissionRoleViewComponent.decorators = [
{ type: Component, args: [{
selector: 'app-permission-role-view',
template: "<div class=\"modal-header\">\r\n <div class=\"modal-title\">\u67E5\u770B {{ record.id }} \u4FE1\u606F</div>\r\n</div>\r\n<nz-spin *ngIf=\"!i\" class=\"modal-spin\"></nz-spin>\r\n<sv-container *ngIf=\"i\">\r\n <sv label=\"\u5E94\u7528\u7CFB\u7EDF\">{{i.appId}}</sv>\r\n <sv label=\"\u89D2\u8272\u540D\u79F0\">{{i.roleName}}</sv>\r\n <sv label=\"\u7F16\u7801\">{{i.code}}</sv>\r\n <sv label=\"\u89D2\u8272\u72B6\u6001\">{{i.statusText}}</sv>\r\n <sv label=\"\u6392\u5E8F\">{{i.sortNum}}</sv>\r\n <sv label=\"\u521B\u5EFA\u65F6\u95F4\">{{i.createTime}}</sv>\r\n</sv-container>\r\n<div class=\"modal-footer\">\r\n <button nz-button type=\"button\" (click)=\"close()\">\u5173\u95ED</button>\r\n</div>"
}] }
];
/** @nocollapse */
PermissionRoleViewComponent.ctorParameters = () => [
{ type: NzModalRef },
{ type: NzMessageService },
{ type: RoleService }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class PermissionRoleUserComponent {
/**
* @param {?} modal
* @param {?} msgSrv
* @param {?} roleService
* @param {?} userService
* @param {?} fb
*/
constructor(modal, msgSrv, roleService, userService, fb) {
this.modal = modal;
this.msgSrv = msgSrv;
this.roleService = roleService;
this.userService = userService;
this.fb = fb;
this.record = {};
this.userList = [];
this.loading = false;
}
/**
* @return {?}
*/
ngOnInit() {
this.form = this.fb.group({
userIds: [null, []]
});
this.loading = true;
Observable.forkJoin([this.userService.getList(),
this.roleService.findUser(this.record.id)]).subscribe((/**
* @param {?} __0
* @return {?}
*/
([userList, userIds]) => {
this.userList = userList;
this.form.get('userIds').setValue(userIds);
this.loading = false;
}));
}
/**
* @return {?}
*/
submit() {
for (const i in this.form.controls) {
this.form.controls[i].markAsDirty();
this.form.controls[i].updateValueAndValidity();
}
if (this.form.invalid)
return;
//修改
this.roleService.saveUser(this.record.id, this.form.get('userIds').value).subscribe((/**
* @param {?} res
* @return {?}
*/
res => {
this.msgSrv.success('保存成功');
this.modal.close(true);
}));
}
/**
* @return {?}
*/
close() {
this.modal.destroy();
}
}
PermissionRoleUserComponent.decorators = [
{ type: Component, args: [{
selector: 'app-permission-role-user',
template: "<div class=\"modal-header\">\r\n <div class=\"modal-title\">{{ record.roleName }}-\u4EBA\u5458\u7BA1\u7406</div>\r\n</div>\r\n<nz-spin *ngIf=\"loading\" class=\"modal-spin\"></nz-spin>\r\n<form *ngIf=\"!loading\" nz-form [formGroup]=\"form\" (ngSubmit)=\"submit()\">\r\n <nz-form-item>\r\n <nz-form-label nzXs=\"24\" nzSm=\"7\" nzFor=\"userIds\">\u4EBA\u5458</nz-form-label>\r\n <nz-form-control nzXs=\"24\" nzSm=\"12\" nzMd=\"10\" >\r\n <nz-select nzShowSearch nzAllowClear\r\n nzMode=\"multiple\"\r\n nzPlaceHolder=\"\u9009\u62E9\u4EBA\u5458\" formControlName=\"userIds\">\r\n <nz-option *ngFor=\"let user of userList\" [nzLabel]=\"user.realName\"\r\n [nzValue]=\"user.id\"></nz-option>\r\n </nz-select>\r\n </nz-form-control>\r\n </nz-form-item>\r\n \r\n <div class=\"modal-footer\">\r\n <button nz-button type=\"button\" (click)=\"close()\">\u5173\u95ED</button>\r\n <button nz-button type=\"submit\" [disabled]=\"!form.valid\" nzType=\"primary\" [nzLoading]=\"loading\">\u4FDD\u5B58</button>\r\n </div>\r\n</form>\r\n"
}] }
];
/** @nocollapse */
PermissionRoleUserComponent.ctorParameters = () => [
{ type: NzModalRef },
{ type: NzMessageService },
{ type: RoleService },
{ type: UserService },
{ type: FormBuilder }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class PermissionRoleComponent {
/**
* @param {?} modal
* @param {?} msgSrv
* @param {?} roleService
* @param {?} resourceService
* @param {?} treeService
* @param {?} appsService
*/
constructor(modal, msgSrv, roleService, resourceService, treeService, appsService) {
this.modal = modal;
this.msgSrv = msgSrv;
this.roleService = roleService;
this.resourceService = resourceService;
this.treeService = treeService;
this.appsService = appsService;
this.url = `api/v1/sysrRole/list`;
this.searchSchema = {
properties: {
id: {
type: 'string',
title: '编号'
}
}
};
this.columns = [
// { title: '编号', index: 'id' },
{ title: '', index: 'id', type: 'radio' },
// { title: '应用系统', index: 'appId' },
{ title: '角色名称', index: 'roleName' },
{ title: '编码', index: 'code' },
{ title: '角色状态', index: 'statusText' },
// { title: '排序', index: 'sortNum' },
// { title: '创建时间', type: 'date', index: 'createTime' },
{
title: '操作',
width: '100px',
buttons: [
{ text: '删除', type: 'del', click: (/**
* @param {?} item
* @return {?}
*/
(item) => {
//删除
this.roleService.deleteById(item.id).subscribe((/**
* @param {?} res
* @return {?}
*/
res => {
this.msgSrv.success('删除成功');
this.st.reload();
}));
}),
acl: { ability: ['permission:remove'] }
},
{
text: '',
children: [
{ text: '查看', type: 'static', component: PermissionRoleViewComponent, click: 'reload', acl: { ability: ['role:view'] } },
{ text: '编辑', type: 'none',
click: (/**
* @param {?} record
* @return {?}
*/
(record) => {
this.modal
.createStatic(PermissionRoleEditComponent, { appId: this.appId, record: record })
.subscribe((/**
* @return {?}
*/
() => this.st.reload()));
}),
acl: { ability: ['role:edit'] }
},
{ text: '人员', type: 'static', component: PermissionRoleUserComponent, click: 'reload', acl: { ability: ['member:choose'] } }
],
},
]
}
];
this.appId = -1;
this.data = [];
this.dataList = []; //所有节点数组
//所有节点数组
this.expandDataCache = {};
this.allChecked = false;
this.indeterminate = false;
this.listOfSelection = [
{
text: '全选',
onSelect: (/**
* @return {?}
*/
() => {
this.checkAll(true);
})
},
{
text: '全不选',
onSelect: (/**
* @return {?}
*/
() => {
this.checkAll(false);
})
}
];
}
/**
* @param {?=} $event
* @return {?}
*/
refreshStatus($event) {
if (!this.selectedRole) {
this.msgSrv.warning('请选择角色');
return;
}
/** @type {?} */
const allChecked = this.dataList.every((/**
* @param {?} value
* @return {?}
*/
value => value.checked === true));
/** @type {?} */
const allUnChecked = this.dataList.every((/**
* @param {?} value
* @return {?}
*/
value => !value.checked));
this.allChecked = allChecked;
this.indeterminate = (!allChecked) && (!allUnChecked);
}
/**
* @param {?} value
* @return {?}
*/
checkAll(value) {
if (!this.selectedRole) {
this.msgSrv.warning('请选择要授权的角色');
return;
}
this.dataList.forEach((/**
* @param {?} data
* @return {?}
*/
data => {
if (!data.disabled) {
data.checked = value;
}
}));
this.refreshStatus();
}
/**
* @param {?} value
* @return {?}
*/
expandAll(value) {
this.dataList.forEach((/**
* @param {?} data
* @return {?}
*/
data => {
data.expand = value;
}));
}
/**
* @return {?}
*/
ngOnInit() {
this.st.req.params = { appId: this.appId };
this.appsService.getList().subscribe((/**
* @param {?} appList
* @return {?}
*/
appList => {
this.appList = appList;
}));
this.appChange();
}
/**
* @return {?}
*/
appChange() {
this.selectedRole = null;
this.st.reload({ appId: this.appId });
this.resourceService.findTree({ appId: this.appId }).subscribe((/**
* @param {?} res
* @return {?}
*/
(res) => {
this.data = res;
this.data.forEach((/**
* @param {?} item
* @return {?}
*/
item => {
this.expandDataCache[item.id] = TreeService.convertTreeToList(item);
this.dataList = [...this.dataList, ...this.expandDataCache[item.id]];
}));
}));
}
/**
* @return {?}
*/
add() {
this.modal
.createStatic(PermissionRoleEditComponent, { appId: this.appId })
.subscribe((/**
* @return {?}
*/
() => this.st.reload({ appId: this.appId })));
}
/**
* @param {?} item
* @return {?}
*/
radioChange(item) {
if (!item.radio) {
return;
}
item = item.radio;
this.selectedRole = item;
this.roleService.findResource(item.id).subscribe((/**
* @param {?} res
* @return {?}
*/
(res) => {
this.dataList.forEach((/**
* @param {?} _item
* @return {?}
*/
_item => {
if (res.includes(_item.id)) {
_item.assign = '已授权';
}
else {
_item.assign = '未授权';
}
}));
}));
}
/**
* @return {?}
*/
assign() {
if (!this.selectedRole) {
this.msgSrv.warning('请选择要授权的角色');
return;
}
console.log('assign');
/** @type {?} */
let resourceIds = this.getCheckIds();
if (resourceIds.length == 0) {
this.msgSrv.warning('请选择要授权的资源');
return;
}
this.roleService.saveResource(this.selectedRole.id, resourceIds).subscribe((/**
* @param {?} res
* @return {?}
*/
res => {
this.msgSrv.success('授权成功');
// this.dataList.filter(item => item.).checked = true;
this.dataList.forEach((/**
* @param {?} item
* @return {?}
*/
item => {
if (item.checked === true) {
item.assign = '已授权';
}
}));
}));
}
/**
* @return {?}
*/
cancel() {
if (!this.selectedRole) {
this.msgSrv.warning('请选择要取消授权的角色');
return;
}
console.log('cancel');
/** @type {?} */
let resourceIds = this.getCheckIds();
if (resourceIds.length == 0) {
this.msgSrv.warning('请选择要取消授权的资源');
return;
}
this.roleService.deleteResource(this.selectedRole.id, resourceIds).subscribe((/**
* @param {?} res
* @return {?}
*/
res => {
this.msgSrv.success('取消授权成功');
// this.dataList.filter(item => item.).checked = true;
this.dataList.forEach((/**
* @param {?} item
* @return {?}
*/
item => {
if (item.checked === true) {
item.assign = '未授权';
}
}));
}));
}
/**
* @return {?}
*/
getCheckIds() {
/** @type {?} */
let checkIds = [];
this.dataList.forEach((/**
* @param {?} item
* @return {?}
*/
item => {
if (item.checked === true) {
checkIds.push(item.id);
}
}));
return checkIds;
}
}
PermissionRoleComponent.decorators = [
{ type: Component, args: [{
selector: 'app-permission-role',
template: "<page-header [action]=\"phPhAction\">\r\n <ng-template #phPhAction>\r\n <button acl [acl-ability]=\"'role:add'\" (click)=\"add()\" nz-button nzType=\"primary\">\u65B0\u5EFA</button>\r\n </ng-template>\r\n</page-header>\r\n<nz-card>\r\n <div nz-row>\r\n <div nz-col nzSpan=\"12\">\r\n <!--<sf mode=\"search\" [schema]=\"searchSchema\" (formSubmit)=\"st.reset($event)\" (formReset)=\"st.reset($event)\"></sf>-->\r\n <nz-affix [nzOffsetTop]=\"80\">\r\n <form nz-form [nzLayout]=\"'inline'\">\r\n <!--<nz-form-item> <nz-col class=\"ant-form-item-control-wrapper\"> <div class=\"ant-form-item-control\"> <button nz-popconfirm nzTitle=\"\u786E\u8BA4\u6388\u6743\u5417?\" (nzOnConfirm)=\"assign()\" nz-button nzType=\"primary\">\u6388\u6743</button> <button nz-popconfirm nzTitle=\"\u786E\u8BA4\u53D6\u6D88\u6388\u6743\u5417?\" (nzOnConfirm)=\"cancel()\" nz-button nzType=\"warning\">\u53D6\u6D88\u6388\u6743</button> </div> </nz-col> </nz-form-item>-->\r\n <nz-form-item>\r\n <nz-form-label>\u7CFB\u7EDF</nz-form-label>\r\n <nz-col class=\"ant-form-item-control-wrapper\">\r\n <div class=\"ant-form-item-control\">\r\n <nz-select style=\"width: 240px\" name=\"appId\" nzShowSearch [(ngModel)]=\"appId\" (ngModelChange)=\"appChange()\">\r\n <nz-option *ngFor=\"let option of appList\" [nzLabel]=\"option.appName\" [nzValue]=\"option.appId\"></nz-option>\r\n </nz-select>\r\n </div>\r\n </nz-col>\r\n </nz-form-item>\r\n </form>\r\n </nz-affix>\r\n <st #st [data]=\"url\" [columns]=\"columns\" (change)=\"radioChange($event)\"></st>\r\n </div>\r\n <div nz-col nzSpan=\"11\" nzOffset=\"1\">\r\n <nz-affix [nzOffsetTop]=\"80\">\r\n <form nz-form [nzLayout]=\"'inline'\">\r\n <nz-form-item>\r\n <nz-col class=\"ant-form-item-control-wrapper\">\r\n <div class=\"ant-form-item-control\">\r\n <button acl [acl-ability]=\"'permission:add'\" nz-popconfirm nzTitle=\"\u786E\u8BA4\u6388\u6743\u5417?\" (nzOnConfirm)=\"assign()\" nz-button nzType=\"primary\">\u6388\u6743</button>\r\n <button acl [acl-ability]=\"'permission:remove'\" nz-popconfirm nzTitle=\"\u786E\u8BA4\u53D6\u6D88\u6388\u6743\u5417?\" (nzOnConfirm)=\"cancel()\" nz-button nzType=\"warning\">\u53D6\u6D88\u6388\u6743</button>\r\n </div>\r\n </nz-col>\r\n </nz-form-item>\r\n <nz-form-item>\r\n <nz-col class=\"ant-form-item-control-wrapper\">\r\n <div class=\"ant-form-item-control\">\r\n <nz-dropdown>\r\n <button nz-button nz-dropdown>\r\n \u64CD\u4F5C\r\n <i class=\"anticon anticon-down\"></i>\r\n </button>\r\n <ul nz-menu>\r\n <li (click)=\"expandAll(true)\" nz-menu-item>\r\n <a>\u5C55\u5F00\u6240\u6709</a>\r\n </li>\r\n <li (click)=\"expandAll(false)\" nz-menu-item>\r\n <a>\u6536\u8D77\u6240\u6709</a>\r\n </li>\r\n </ul>\r\n </nz-dropdown>\r\n </div>\r\n </nz-col>\r\n </nz-form-item>\r\n </form>\r\n </nz-affix>\r\n <nz-table #nzTable [nzData]=\"data\" [nzShowPagination]=\"false\" [nzFrontPagination]=\"false\" [nzBordered]=\"true\">\r\n <thead>\r\n <tr>\r\n <th nzShowCheckbox [(nzChecked)]=\"allChecked\" [nzIndeterminate]=\"indeterminate\" nzShowRowSelection [nzSelections]=\"listOfSelection\" (nzCheckedChange)=\"checkAll($event)\"></th>\r\n <th>\u8D44\u6E90\u540D\u79F0</th>\r\n <!--<th nzWidth=\"30%\">\u6743\u9650\u6807\u5FD7</th>-->\r\n <th>\u542F\u7528\u72B6\u6001</th>\r\n <th>\u6388\u6743\u72B6\u6001</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <ng-template ngFor let-data [ngForOf]=\"nzTable.data\">\r\n <ng-template ngFor let-item [ngForOf]=\"expandDataCache[data.id]\">\r\n <tr *ngIf=\"(item.parent&&item.parent.expand)||!(item.parent)\">\r\n <td nzShowCheckbox [(nzChecked)]=\"item.checked\" (nzCheckedChange)=\"refreshStatus($event)\"></td>\r\n <td [nzIndentSize]=\"item.level*20\" [nzShowExpand]=\"!!item.children\" [(nzExpand)]=\"item.expand\" (nzExpandChange)=\"treeService.collapse(expandDataCache[data.id],item,$event)\">{{item.rsrcName}}</td>\r\n <!--<td>{{item.permission}}</td>-->\r\n <td>{{item.rsrcStatusText}}</td>\r\n <td>{{item.assign}}</td>\r\n </tr>\r\n </ng-template>\r\n </ng-template>\r\n </tbody>\r\n </nz-table>\r\n </div>\r\n </div>\r\n</nz-card>",
styles: [":host ::ng-deep .ant-table-wrapper{margin-top:16px}"]
}] }
];
/** @nocollapse */
PermissionRoleComponent.ctorParameters = () => [
{ type: ModalHelper },
{ type: NzMessageService },
{ type: RoleService },
{ type: ResourceService },
{ type: TreeService },
{ type: AppsService }
];
PermissionRoleComponent.propDecorators = {
st: [{ type: ViewChild, args: ['st',] }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const routes = [
{ path: 'role', component: PermissionRoleComponent }
];
class PermissionRoutingModule {
}
PermissionRoutingModule.decorators = [
{ type: NgModule, args: [{
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const COMPONENTS = [
PermissionRoleComponent
];
/** @type {?} */
const COMPONENTS_NOROUNT = [
PermissionRoleEditComponent,
PermissionRoleViewComponent,
PermissionRoleUserComponent
];
class PermissionModule {
}
PermissionModule.decorators = [
{ type: NgModule, args: [{
imports: [
SharedModule,
PermissionRoutingModule
],
declarations: [
...COMPONENTS,
...COMPONENTS_NOROUNT,
],
entryComponents: COMPONENTS_NOROUNT
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
export { PermissionModule, PermissionRoutingModule, PermissionRoleComponent, PermissionRoleEditComponent, PermissionRoleViewComponent, PermissionRoleUserComponent };
//# sourceMappingURL=permission.js.map