|
|
@ -14,6 +14,8 @@ import { |
|
|
|
} from "app/config/app-auth-token"; |
|
|
|
import { CommonService } from "../service/common.service"; |
|
|
|
import { NzMessageService } from "ng-zorro-antd/message"; |
|
|
|
import { tr } from "date-fns/locale"; |
|
|
|
import { NzModalService } from "ng-zorro-antd/modal"; |
|
|
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
@ -33,6 +35,8 @@ export class LayoutComponent implements OnInit, AfterViewInit { |
|
|
|
|
|
|
|
isDragging: boolean = false; |
|
|
|
|
|
|
|
isDownloadVisible: boolean = false; |
|
|
|
|
|
|
|
layoutUsers = [ |
|
|
|
"digiwin0001", |
|
|
|
"digiwin0002", |
|
|
@ -67,7 +71,8 @@ export class LayoutComponent implements OnInit, AfterViewInit { |
|
|
|
private commonService: CommonService, |
|
|
|
private el: ElementRef, |
|
|
|
private renderer: Renderer2, |
|
|
|
private message: NzMessageService |
|
|
|
private message: NzMessageService, |
|
|
|
private modalService: NzModalService |
|
|
|
) { } |
|
|
|
ngOnInit(): void { |
|
|
|
this.systemMaps = systemList; |
|
|
@ -85,8 +90,7 @@ export class LayoutComponent implements OnInit, AfterViewInit { |
|
|
|
const DwUserInfo = JSON.parse(sessionStorage.getItem("DwUserInfo")); |
|
|
|
this.USER_TOKEN = DwUserInfo.token; |
|
|
|
this.USER_ID = DwUserInfo.userId; |
|
|
|
this.dragEnable = |
|
|
|
this.USER_ID === "dongsk@digiwin.com" || this.USER_ID === "M00020"; |
|
|
|
this.dragEnable = this.USER_ID === "dongsk@digiwin.com" || this.USER_ID === "M00020"; |
|
|
|
|
|
|
|
console.log(this.dragEnable); |
|
|
|
|
|
|
@ -99,28 +103,30 @@ export class LayoutComponent implements OnInit, AfterViewInit { |
|
|
|
this.commonService |
|
|
|
.getRequestWithHeaders(url, headers) |
|
|
|
.then((res) => { |
|
|
|
this.queryDisplayList = res.response; |
|
|
|
this.queryDisplayList.forEach((item) => { |
|
|
|
this.systemMaps["SSO_" + item.id] = { |
|
|
|
key: item.id, |
|
|
|
id: item.id, |
|
|
|
title: item.name, |
|
|
|
mockLogin: false, |
|
|
|
ssoLogin: true, |
|
|
|
callBackUrl: item.callBackUrl, |
|
|
|
url: item.cloudwebsite, |
|
|
|
applicationAppId: item.applicationAppId, |
|
|
|
}; |
|
|
|
|
|
|
|
// 非管理员加载
|
|
|
|
this.divContent.userId = this.USER_ID; |
|
|
|
if ( |
|
|
|
this.USER_ID === "dongsk@digiwin.com" || |
|
|
|
this.USER_ID === "M00020" |
|
|
|
) { |
|
|
|
this.divContent.userId = "default"; |
|
|
|
} |
|
|
|
}); |
|
|
|
if (res && res.response) { |
|
|
|
this.queryDisplayList = res.response; |
|
|
|
this.queryDisplayList.forEach((item) => { |
|
|
|
this.systemMaps["SSO_" + item.id] = { |
|
|
|
key: item.id, |
|
|
|
id: item.id, |
|
|
|
title: item.name, |
|
|
|
mockLogin: false, |
|
|
|
ssoLogin: true, |
|
|
|
callBackUrl: item.callBackUrl, |
|
|
|
url: item.cloudwebsite, |
|
|
|
applicationAppId: item.applicationAppId, |
|
|
|
}; |
|
|
|
|
|
|
|
// 非管理员加载
|
|
|
|
this.divContent.userId = this.USER_ID; |
|
|
|
if ( |
|
|
|
this.USER_ID === "dongsk@digiwin.com" || |
|
|
|
this.USER_ID === "M00020" |
|
|
|
) { |
|
|
|
this.divContent.userId = "default"; |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
// 初始化布局
|
|
|
|
this.initSysLayout(); |
|
|
@ -162,7 +168,7 @@ export class LayoutComponent implements OnInit, AfterViewInit { |
|
|
|
this.renderer.setStyle(sysEL, "left", item.leftPercent); |
|
|
|
this.renderer.setStyle(sysEL, "width", item.widthPercent); |
|
|
|
this.renderer.setStyle(sysEL, "height", item.heightPercent); |
|
|
|
this.renderer.setStyle(sysEL, "background-color", 'wheat'); |
|
|
|
// this.renderer.setStyle(sysEL, "background-color", 'wheat');
|
|
|
|
|
|
|
|
this.renderer.setStyle(sysEL, "display", 'block'); |
|
|
|
} |
|
|
@ -181,6 +187,11 @@ export class LayoutComponent implements OnInit, AfterViewInit { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (key === 'download') { |
|
|
|
this.isDownloadVisible = true; |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (this.systemMaps[key] == null) { |
|
|
|
this.message.error(`${key} 未集成`); |
|
|
|
return; |
|
|
@ -356,7 +367,7 @@ export class LayoutComponent implements OnInit, AfterViewInit { |
|
|
|
this.divContent, |
|
|
|
{ |
|
|
|
"Digi-Middleware-Auth-App": DigiMiddlewareAuthApp, |
|
|
|
"Digi-Middleware-Auth-User": this.USER_TOKEN |
|
|
|
"Digi-Middleware-Auth-User": this.USER_TOKEN, |
|
|
|
} |
|
|
|
) |
|
|
|
.then((res) => { |
|
|
@ -366,4 +377,8 @@ export class LayoutComponent implements OnInit, AfterViewInit { |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
handleModelCancel() { |
|
|
|
this.isDownloadVisible = false; |
|
|
|
} |
|
|
|
} |