You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
79 lines
1.4 KiB
79 lines
1.4 KiB
|
|
|
|
/** |
|
* 模式类型 |
|
*/ |
|
export enum ModeType { |
|
|
|
Look = "Look",//查看模式 |
|
Edit = "Edit",//编辑模式 |
|
} |
|
|
|
/** |
|
* 模式管理器 |
|
*/ |
|
export class ModeManager { |
|
|
|
/** |
|
* 当前模式的类型 |
|
*/ |
|
private static s_currentMode: ModeType = ModeType.Edit; |
|
|
|
/** |
|
* 调试模式 |
|
*/ |
|
public static isDebug = true; |
|
|
|
|
|
//#region 演示单单位 |
|
|
|
//未指定演示单位,正常打开 |
|
static readonly c_demoKey_null = null; |
|
|
|
// 上海国际会议中心 测试 |
|
static readonly c_demoKey_shanghai = "shanghai"; |
|
|
|
//测试 |
|
static readonly c_demoKey_test = "test"; |
|
|
|
/** |
|
* 演示单位的key |
|
*/ |
|
public static institutionDemoKey = ModeManager.c_demoKey_null; |
|
|
|
//#endregion |
|
|
|
/** |
|
* 获取当前模式的类型 |
|
*/ |
|
static get currentMode(): ModeType { |
|
return ModeManager.s_currentMode; |
|
} |
|
|
|
/** |
|
* 改变模式类型 |
|
*/ |
|
static set currentMode(modeType: ModeType) { |
|
ModeManager.s_currentMode = modeType; |
|
ModeManager.log("currentMode" + modeType); |
|
} |
|
|
|
//封装打印 |
|
static log(data: any, ...optionalParams: any[]) { |
|
if (ModeManager.isDebug) { |
|
console.log(data, optionalParams); |
|
} |
|
} |
|
|
|
/** |
|
* 封装的打印堆栈 |
|
*/ |
|
static trace(message?: any, ...optionalParams: any[]) { |
|
if (ModeManager.isDebug) { |
|
console.trace(message, optionalParams); |
|
} |
|
} |
|
|
|
|
|
} |
|
|
|
|