|
@ -10,11 +10,13 @@ import { |
|
|
Renderer2, |
|
|
Renderer2, |
|
|
} from "@angular/core"; |
|
|
} from "@angular/core"; |
|
|
import { |
|
|
import { |
|
|
DigiMiddlewareAuthApp, |
|
|
|
|
|
DigiMiddlewareAuthUser, |
|
|
|
|
|
|
|
|
DigiMiddlewareAuthApp |
|
|
} from "app/config/app-auth-token"; |
|
|
} from "app/config/app-auth-token"; |
|
|
import { CommonService } from "../service/common.service"; |
|
|
import { CommonService } from "../service/common.service"; |
|
|
import { NzPopconfirmComponent } from 'ng-zorro-antd/popconfirm'; |
|
|
|
|
|
|
|
|
import { NzMessageService } from "ng-zorro-antd/message"; |
|
|
|
|
|
import { tr } from "date-fns/locale"; |
|
|
|
|
|
import { NzModalService } from "ng-zorro-antd/modal"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
@Component({ |
|
|
selector: "app-layout", |
|
|
selector: "app-layout", |
|
@ -27,10 +29,14 @@ export class LayoutComponent implements OnInit, AfterViewInit { |
|
|
queryDisplayList = []; |
|
|
queryDisplayList = []; |
|
|
USER_ID = ""; |
|
|
USER_ID = ""; |
|
|
|
|
|
|
|
|
|
|
|
USER_TOKEN = ""; |
|
|
|
|
|
|
|
|
dragEnable: boolean = false; |
|
|
dragEnable: boolean = false; |
|
|
|
|
|
|
|
|
isDragging: boolean = false; |
|
|
isDragging: boolean = false; |
|
|
|
|
|
|
|
|
|
|
|
isDownloadVisible: boolean = false; |
|
|
|
|
|
|
|
|
layoutUsers = [ |
|
|
layoutUsers = [ |
|
|
"digiwin0001", |
|
|
"digiwin0001", |
|
|
"digiwin0002", |
|
|
"digiwin0002", |
|
@ -64,7 +70,9 @@ export class LayoutComponent implements OnInit, AfterViewInit { |
|
|
constructor( |
|
|
constructor( |
|
|
private commonService: CommonService, |
|
|
private commonService: CommonService, |
|
|
private el: ElementRef, |
|
|
private el: ElementRef, |
|
|
private renderer: Renderer2 |
|
|
|
|
|
|
|
|
private renderer: Renderer2, |
|
|
|
|
|
private message: NzMessageService, |
|
|
|
|
|
private modalService: NzModalService |
|
|
) { } |
|
|
) { } |
|
|
ngOnInit(): void { |
|
|
ngOnInit(): void { |
|
|
this.systemMaps = systemList; |
|
|
this.systemMaps = systemList; |
|
@ -80,44 +88,45 @@ export class LayoutComponent implements OnInit, AfterViewInit { |
|
|
*/ |
|
|
*/ |
|
|
initSystemBySemcSSO() { |
|
|
initSystemBySemcSSO() { |
|
|
const DwUserInfo = JSON.parse(sessionStorage.getItem("DwUserInfo")); |
|
|
const DwUserInfo = JSON.parse(sessionStorage.getItem("DwUserInfo")); |
|
|
|
|
|
|
|
|
|
|
|
this.USER_TOKEN = DwUserInfo.token; |
|
|
this.USER_ID = DwUserInfo.userId; |
|
|
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); |
|
|
console.log(this.dragEnable); |
|
|
|
|
|
|
|
|
const headers = { |
|
|
const headers = { |
|
|
"Digi-Middleware-Auth-App": DigiMiddlewareAuthApp, |
|
|
"Digi-Middleware-Auth-App": DigiMiddlewareAuthApp, |
|
|
"Digi-Middleware-Auth-User": DigiMiddlewareAuthUser, |
|
|
|
|
|
|
|
|
"Digi-Middleware-Auth-User": this.USER_TOKEN, |
|
|
}; |
|
|
}; |
|
|
const url = |
|
|
const url = |
|
|
this.commonService.semcUrl + "/tenant/semc/applink/queryDisplayList"; |
|
|
this.commonService.semcUrl + "/tenant/semc/applink/queryDisplayList"; |
|
|
this.commonService |
|
|
this.commonService |
|
|
.getRequestWithHeaders(url, headers) |
|
|
.getRequestWithHeaders(url, headers) |
|
|
.then((res) => { |
|
|
.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(); |
|
|
this.initSysLayout(); |
|
@ -142,7 +151,7 @@ export class LayoutComponent implements OnInit, AfterViewInit { |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
"Digi-Middleware-Auth-App": DigiMiddlewareAuthApp, |
|
|
"Digi-Middleware-Auth-App": DigiMiddlewareAuthApp, |
|
|
"Digi-Middleware-Auth-User": DigiMiddlewareAuthUser, |
|
|
|
|
|
|
|
|
"Digi-Middleware-Auth-User": this.USER_TOKEN, |
|
|
} |
|
|
} |
|
|
) |
|
|
) |
|
|
.then((res) => { |
|
|
.then((res) => { |
|
@ -159,7 +168,7 @@ export class LayoutComponent implements OnInit, AfterViewInit { |
|
|
this.renderer.setStyle(sysEL, "left", item.leftPercent); |
|
|
this.renderer.setStyle(sysEL, "left", item.leftPercent); |
|
|
this.renderer.setStyle(sysEL, "width", item.widthPercent); |
|
|
this.renderer.setStyle(sysEL, "width", item.widthPercent); |
|
|
this.renderer.setStyle(sysEL, "height", item.heightPercent); |
|
|
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'); |
|
|
this.renderer.setStyle(sysEL, "display", 'block'); |
|
|
} |
|
|
} |
|
@ -178,7 +187,13 @@ export class LayoutComponent implements OnInit, AfterViewInit { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (key === 'download') { |
|
|
|
|
|
this.isDownloadVisible = true; |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (this.systemMaps[key] == null) { |
|
|
if (this.systemMaps[key] == null) { |
|
|
|
|
|
this.message.error(`${key} 未集成`); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -192,7 +207,7 @@ export class LayoutComponent implements OnInit, AfterViewInit { |
|
|
|
|
|
|
|
|
const headers = { |
|
|
const headers = { |
|
|
"Digi-Middleware-Auth-App": DigiMiddlewareAuthApp, |
|
|
"Digi-Middleware-Auth-App": DigiMiddlewareAuthApp, |
|
|
"Digi-Middleware-Auth-User": DigiMiddlewareAuthUser, |
|
|
|
|
|
|
|
|
"Digi-Middleware-Auth-User": this.USER_TOKEN, |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
// 单点登录
|
|
|
// 单点登录
|
|
@ -352,7 +367,7 @@ export class LayoutComponent implements OnInit, AfterViewInit { |
|
|
this.divContent, |
|
|
this.divContent, |
|
|
{ |
|
|
{ |
|
|
"Digi-Middleware-Auth-App": DigiMiddlewareAuthApp, |
|
|
"Digi-Middleware-Auth-App": DigiMiddlewareAuthApp, |
|
|
"Digi-Middleware-Auth-User": DigiMiddlewareAuthUser, |
|
|
|
|
|
|
|
|
"Digi-Middleware-Auth-User": this.USER_TOKEN, |
|
|
} |
|
|
} |
|
|
) |
|
|
) |
|
|
.then((res) => { |
|
|
.then((res) => { |
|
@ -362,4 +377,8 @@ export class LayoutComponent implements OnInit, AfterViewInit { |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
handleModelCancel() { |
|
|
|
|
|
this.isDownloadVisible = false; |
|
|
|
|
|
} |
|
|
} |
|
|
} |