diff --git a/src/app/routes/financial-management/components/receipt-order/receipt-order-detail/receipt-order-detail.component.ts b/src/app/routes/financial-management/components/receipt-order/receipt-order-detail/receipt-order-detail.component.ts index 6e64c71c..971b4c0f 100644 --- a/src/app/routes/financial-management/components/receipt-order/receipt-order-detail/receipt-order-detail.component.ts +++ b/src/app/routes/financial-management/components/receipt-order/receipt-order-detail/receipt-order-detail.component.ts @@ -6,7 +6,7 @@ import { FreightAccountService } from '../../../services/freight-account.service @Component({ selector: 'app-receipt-order-detail', templateUrl: './receipt-order-detail.component.html', - styleUrls: ['./receipt-order-detail.component.less'] + styleUrls: ['./receipt-order-detail.component.less'], }) export class ReceiptOrderDetailComponent implements OnInit { @ViewChild('st', { static: true }) diff --git a/src/app/routes/menu-manager/components/index/index.component.html b/src/app/routes/menu-manager/components/index/index.component.html index fb195b06..e3d36265 100644 --- a/src/app/routes/menu-manager/components/index/index.component.html +++ b/src/app/routes/menu-manager/components/index/index.component.html @@ -1,14 +1,47 @@ - + - - 导入货主菜单 - - - 导入运营后台菜单 - - - 清空货主菜单 - - - 清空运营后台菜单 - \ No newline at end of file + + + + + + + 查询 + 重置 + + 导入货主菜单 + + + 导入运营后台菜单 + + + + + + + + + + + + + + + + 新增 + + + + + + \ No newline at end of file diff --git a/src/app/routes/menu-manager/components/index/index.component.spec.ts b/src/app/routes/menu-manager/components/index/index.component.spec.ts deleted file mode 100644 index b359c299..00000000 --- a/src/app/routes/menu-manager/components/index/index.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { MenuManagerComponentsIndexComponent } from './index.component'; - -describe('MenuManagerComponentsIndexComponent', () => { - let component: MenuManagerComponentsIndexComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [MenuManagerComponentsIndexComponent], - }).compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(MenuManagerComponentsIndexComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/routes/menu-manager/components/index/index.component.ts b/src/app/routes/menu-manager/components/index/index.component.ts index e11c6ef9..6efe00d2 100644 --- a/src/app/routes/menu-manager/components/index/index.component.ts +++ b/src/app/routes/menu-manager/components/index/index.component.ts @@ -1,13 +1,16 @@ import { Component, OnInit, ViewChild } from '@angular/core'; +import { STComponent, STColumn, STRequestOptions, STChange } from '@delon/abc/st'; +import { SFComponent, SFSchema } from '@delon/form'; import { Menu } from '@delon/theme'; import { EAEnvironmentService } from '@shared'; import { NzModalService } from 'ng-zorro-antd/modal'; +import { SettingRoleEditComponent } from 'src/app/routes/sys-setting/components/role-management/edit/edit.component'; import { MenuManagerService } from './../../services/menu-manager.service'; @Component({ selector: 'app-menu-manager-components-index', templateUrl: './index.component.html', - styleUrls: ['./index.component.less'] + styleUrls: ['./index.component.less', '../../../commom/less/box.less'] }) export class MenuManagerComponentsIndexComponent implements OnInit { selectedPlatform!: { name: string; appId: string; enName: string }; @@ -20,19 +23,61 @@ export class MenuManagerComponentsIndexComponent implements OnInit { dropNext: true, dropInner: true }; - constructor(private envSrv: EAEnvironmentService, public service: MenuManagerService, private modal: NzModalService) {} - ngOnInit(): void { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + + searchSchema: SFSchema = { + properties: { + roleName: { + type: 'string', + title: '角色名称', + ui: { placeholder: '请输入' } + } + } + }; + + columns: STColumn[] = [ + { title: '角色名称', index: 'roleName' }, + { title: '角色描述', index: 'roleDescription' }, + { title: '创建人手机号', index: 'telephone' }, + { + title: '创建时间', + index: 'createTime', + className: 'text-left', + type: 'date', + sort: true + }, + { + title: '操作', + buttons: [ + { + text: '编辑', + click: item => this.roleAction(item) + }, + { + text: '删除', + click: item => this.deleteAction(item) + } + ] + } + ]; + + selectedRows: any[] = []; + constructor(private envSrv: EAEnvironmentService, public service: MenuManagerService, private modal: NzModalService) { this.initData(); } + ngOnInit(): void {} + initData(): void { this.platforms = [ { name: '货主PC', appId: 'A48F72F0A304427F921794BAD86B3522', enName: 'tms-smc-web' }, { name: '运营后台', appId: this.envSrv.env.appId, enName: 'tms-obc-web' } ]; this.selectedPlatform = this.platforms[0]; - // this.platformChange(this.selectedPlatform); } platformChange(e: { name: string; appId: string }) { @@ -50,8 +95,7 @@ export class MenuManagerComponentsIndexComponent implements OnInit { }); } - editValueChange(event: any) { - } + editValueChange(event: any) {} menuImport(index: number) { this.selectedPlatform = this.platforms[index]; @@ -123,4 +167,57 @@ export class MenuManagerComponentsIndexComponent implements OnInit { }); this.service.request(this.service.$api_del_many, ids).subscribe(res => {}); } + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.sf) { + Object.assign(requestOptions.body, { ...this.sf.value }); + } + Object.assign(requestOptions.body, { appId: this.selectedPlatform.appId }); + return requestOptions; + }; + + stChange(e: STChange): void { + switch (e.type) { + case 'sort': + this.selectedRows = e.checkbox!; + break; + } + } + + changeMemu(key: string) {} + + roleAction(item?: any) { + const modal = this.modal.create({ + nzContent: SettingRoleEditComponent, + nzWidth: 900, + nzComponentParams: item ? { i: { ...item } } : { i: { id: 0 } }, + nzFooter: null + }); + modal.afterClose.subscribe(res => { + this.st.load(); + }); + } + + deleteAction(item: any) { + this.modal.error({ + nzTitle: '确认删除?', + nzClosable: false, + nzCancelText: '取消', + nzOnOk: () => { + // this.service.request(this.service.$api_dalete_role, [item.id]).subscribe(res => { + // if (res) { + // this.service.msgSrv.success('删除角色成功'); + // this.st.load(); + // } + // }); + } + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + } } diff --git a/src/app/routes/menu-manager/services/menu-manager.service.ts b/src/app/routes/menu-manager/services/menu-manager.service.ts index e1a9a85e..8bbb7605 100644 --- a/src/app/routes/menu-manager/services/menu-manager.service.ts +++ b/src/app/routes/menu-manager/services/menu-manager.service.ts @@ -9,7 +9,7 @@ export class MenuManagerService extends BaseService { $api_add_one = `/api/mdc/cuc/functionInfo/saveFunctionInfo`; // 根据应用ID获取所有菜单 - $api_get_all = `/scm/cuc/cuc/functionInfo/getAllFunctionInfoByAppId`; + $api_get_all = `/api/mdc/cuc/functionInfo/getAllFunctionInfoByAppId`; // 根据应用ID获取菜单 $api_get_one = `/api/mdc/cuc/functionInfo/getAllFunctionInfoByAppId?_allow_badcode=true`; diff --git a/src/app/routes/sys-setting/components/role-management/role-management.component.ts b/src/app/routes/sys-setting/components/role-management/role-management.component.ts index 9075aec0..8f86f246 100644 --- a/src/app/routes/sys-setting/components/role-management/role-management.component.ts +++ b/src/app/routes/sys-setting/components/role-management/role-management.component.ts @@ -16,8 +16,6 @@ export class RoleManagementComponent implements OnInit { @ViewChild('sf', { static: false }) sf!: SFComponent; - url = `/rule?_allow_anonymous=true`; - searchSchema: SFSchema = { properties: { roleName: { diff --git a/src/assets/mocks/menu-data.json b/src/assets/mocks/menu-data.json index a958c768..50ee786e 100644 --- a/src/assets/mocks/menu-data.json +++ b/src/assets/mocks/menu-data.json @@ -505,6 +505,10 @@ "text": "审核驳回理由配置", "link": "/system/audit-reason-config" }, + { + "text": "菜单管理", + "link": "/menu-management/index" + }, { "text": "系统配置", "link": "/system/system-config"