Merge branch 'develop' of https://gitlab.eascs.com/tms-ui/tms-obc-web into develop

This commit is contained in:
wangshiming
2022-02-25 10:34:32 +08:00
10 changed files with 296 additions and 74 deletions

View File

@ -3,14 +3,13 @@
<custom-element>
<ng-container [ngSwitch]="selectedTab?.configType">
<ng-container *ngSwitchCase="1">
权限配置
<app-enter-auth [enterpriseId]="businessId"> </app-enter-auth>
</ng-container>
<ng-container *ngSwitchCase="2">
</ng-container>
<ng-container *ngSwitchDefault>
<app-rate-change [businessId]="businessId" [configFullKey]="configFullKey"></app-rate-change>
</ng-container>
<ng-container *ngSwitchDefault>
</ng-container>
</ng-container>
</custom-element>
</app-dynamic-setting-h5>

View File

@ -20,7 +20,14 @@ import { SEModule } from '@delon/abc/se';
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { RateChangeComponent } from './rate-change/rate-change.component';
import { STModule } from '@delon/abc/st';
const COMPONENTS = [DynamicSettingH5Component, DynamicSettingModalComponent, FreightTableComponent, RateChangeComponent];
import { EnterAuthComponent } from './enter-auth/enter-auth.component';
const COMPONENTS = [
DynamicSettingH5Component,
DynamicSettingModalComponent,
FreightTableComponent,
RateChangeComponent,
EnterAuthComponent
];
@NgModule({
declarations: [...COMPONENTS],
imports: [CommonModule, FormsModule, SHARED_ZORRO_MODULES, SEModule, STModule],

View File

@ -0,0 +1,15 @@
<div nz-row nzGutter="8">
<div nz-col nzSpan="24" se-container [labelWidth]="120">
<se [col]="1" label="企业角色" required>
<nz-select nzPlaceHolder="请选择" [(ngModel)]="roleId" style="width: 150px;">
<nz-option [nzValue]="item.value" [nzLabel]="item.label" *ngFor="let item of roles"></nz-option>
</nz-select>
</se>
</div>
</div>
<div nz-row nzGutter="8">
<div nz-col nzSpan="24">
<button nz-button nzSize="large" nzType="primary" (click)="saveAction()" style="float: right;"
class="mt-md">保存</button>
</div>
</div>

View File

@ -0,0 +1,52 @@
import { Component, Input, OnInit } from '@angular/core';
import { NzModalRef } from 'ng-zorro-antd/modal';
import { ShipperBaseService } from 'src/app/shared/services/business/shipper-base.service';
@Component({
selector: 'app-enter-auth',
templateUrl: './enter-auth.component.html'
})
export class EnterAuthComponent implements OnInit {
@Input()
enterpriseId = '';
@Input()
roleId = '';
roles: any[] = [];
constructor(private service: ShipperBaseService, private modalHelp: NzModalRef) {
this.loadRoles();
}
ngOnInit(): void {
console.log(this.enterpriseId);
this.loadEnterRole();
}
loadEnterRole() {
this.service.request('/api/mdc/cuc/enterpriseInfo/operate/getRole', { enterpriseId: this.enterpriseId }).subscribe(res => {
if (res) {
this.roleId = res.roleId;
}
});
}
loadRoles() {
this.service.getRoles({ enterpriseId: 0, projectId: 0 }).subscribe(res => {
if (res) {
this.roles = res;
}
});
}
saveAction() {
this.service
.request('/api/mdc/cuc/enterpriseInfo/operate/updateRole', { enterpriseIdList: [this.enterpriseId], roleId: this.roleId })
.subscribe(res => {
if (res) {
this.service.msgSrv.success('修改成功');
this.modalHelp.destroy(true);
}
});
}
}