From 6eb92655d89b8d45c18c68b3bfdd957f4193c1e4 Mon Sep 17 00:00:00 2001 From: Taric Xin Date: Wed, 12 Jan 2022 11:26:19 +0800 Subject: [PATCH] edit --- .../components/index/index.component.html | 6 ++ .../components/index/index.component.ts | 35 +++---- .../components/driver/driver.component.html | 10 +- .../components/driver/driver.component.less | 6 ++ .../components/driver/driver.component.ts | 6 ++ src/assets/mocks/platform/tms-obc-web.json | 91 +++++++++++-------- src/assets/mocks/platform/tms-smc-web.json | 2 +- 7 files changed, 96 insertions(+), 60 deletions(-) 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 46fe5229..fb195b06 100644 --- a/src/app/routes/menu-manager/components/index/index.component.html +++ b/src/app/routes/menu-manager/components/index/index.component.html @@ -5,4 +5,10 @@ + + \ No newline at end of file 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 9e0d587b..5f5efc8a 100644 --- a/src/app/routes/menu-manager/components/index/index.component.ts +++ b/src/app/routes/menu-manager/components/index/index.component.ts @@ -46,8 +46,6 @@ export class MenuManagerComponentsIndexComponent implements OnInit { loadMenus(appId: string) { this.service.request(this.service.$api_get_one, { appId }, 'POST', false).subscribe(res => { - console.log(res); - this.menus = res; }); } @@ -63,8 +61,6 @@ export class MenuManagerComponentsIndexComponent implements OnInit { } this.service.http.request('GET', `assets/mocks/platform/${this.selectedPlatform.enName}.json`).subscribe((res: any) => { - console.log(res); - this.addMenu(res.menu); }); } @@ -96,24 +92,23 @@ export class MenuManagerComponentsIndexComponent implements OnInit { addMenuRecursion() {} - delMenu(appId: string, menus: Array) { - if (!menus || menus.length === 0) { - return; - } - let notice = `确认删除菜单[${menus[0].text}]?`; - if (menus.length > 1) { - notice = `确认删除勾选的${menus.length}行菜单记录?`; - } - const ids = menus.map(r => r.id); + delMenu(type: number) { this.modal.confirm({ nzTitle: '删除确认', - nzContent: `${notice}
是否删除?`, - nzOnOk: () => - this.service.delMany(ids).subscribe(res => { - if (res === true) { - this.service.msgSrv.success('删除成功!'); - } - }) + nzContent: `是否确认删除?`, + nzOnOk: () => { + this.deleteMenuByAppID(type === 0 ? 'A48F72F0A304427F921794BAD86B3522' : this.envSrv.env.appId); + } + }); + } + + deleteMenuByAppID(appId: string) { + this.service.request(this.service.$api_get_one, { appId }, 'POST', false).subscribe(res => { + console.log(res); + + if (res) { + this.menus = res; + } }); } } diff --git a/src/app/routes/usercenter/components/driver/driver.component.html b/src/app/routes/usercenter/components/driver/driver.component.html index 4d83ded5..230034ae 100644 --- a/src/app/routes/usercenter/components/driver/driver.component.html +++ b/src/app/routes/usercenter/components/driver/driver.component.html @@ -18,10 +18,14 @@ - - - + + + + + + +