feat: 接入 UserHome 前端业务代码(含真实 src/依赖,保留 projman 标准 CI)
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
import { IframePageParmas, LinkOpenTypeEnum, StateEnum } from "@/types";
|
||||
import mittBus from "@/utils/mitt";
|
||||
|
||||
interface LinkPageOptions {
|
||||
url: string;
|
||||
type?: number | LinkOpenTypeEnum;
|
||||
|
||||
id?: number;
|
||||
isTicket?: boolean;
|
||||
title?: string;
|
||||
isHeader?: boolean;
|
||||
|
||||
modalWidth?: number;
|
||||
modalHeight?: number;
|
||||
}
|
||||
|
||||
export function bschLinkPage(options: LinkPageOptions) {
|
||||
const { url, type = LinkOpenTypeEnum.Open, title } = options;
|
||||
const openType: LinkOpenTypeEnum = type as LinkOpenTypeEnum;
|
||||
if (openType === LinkOpenTypeEnum.Open) {
|
||||
window.open(url);
|
||||
} else if (openType === LinkOpenTypeEnum.Href) {
|
||||
window.location.href = url;
|
||||
} else if (openType === LinkOpenTypeEnum.IFrame) {
|
||||
const { isHeader = false } = options;
|
||||
const params: IframePageParmas = {
|
||||
url,
|
||||
appName: title ?? "",
|
||||
isHeader,
|
||||
};
|
||||
mittBus.emit("openBschIframePage", params);
|
||||
} else if (openType === LinkOpenTypeEnum.Modal) {
|
||||
const { modalWidth = 80, modalHeight = 70 } = options;
|
||||
mittBus.emit("showLightAppModal", { width: modalWidth, height: modalHeight, url, title: title ?? "轻应用" });
|
||||
// const { modalTitle = "新窗口", modalWidth = 80, modalHeight = 70 } = options;
|
||||
}
|
||||
}
|
||||
|
||||
export function isTickeRoterByName(name: string) {
|
||||
return ["BschAppDetails", "AppDetails"].includes(name);
|
||||
}
|
||||
Reference in New Issue
Block a user