/** * 加载表达式所需依赖 * @author hjh */ (function () { //依赖检查 if (typeof jQuery === 'undefined') { console.error('错误:此组件需要jQuery,但是jQuery没有被加载。'); } /**判断当前页面是否是HRS运行界面 */ function IsRunningPage() { let win = window; do { if (win.HrsPage != null) { return true; } else { win = win.parent; } } while (win !== window.top); return false; } /** * 加载所需的依赖 * */ function LoadDependency(basePath) { //引入自身的依赖 Import(basePath + "css/ExpressEditor.css", true); if (!IsRunningPage() || (typeof g_needLoadzlExpressEditor != 'undefined' && g_needLoadzlExpressEditor == true)) { Import(basePath + "monaco-editor/min/vs/loader.min.js"); } Import(basePath + "js/EnvironmentHelper.js"); Import(basePath + "js/ExpressExecutor.js"); Import(basePath + "singleRowModel/SingleRowEditor.js"); } /** * 导入JS * @param {any} url */ function Import(url, isCss) { $.ajax({ type: "GET", url: url, async: false, success: (res) => { if (isCss) { let $style = $(``); $("head").append($style); } } }); } //加载依赖 LoadDependency("/lib/zlExpressEditor/"); })();