Merge pull request #9457 from liaozhiyang/master

@jeecg/online库导出了SuperQuery和JOnlineSearchSelect组件,正常注册相关组件
This commit is contained in:
JEECG 2026-03-20 13:45:16 +08:00 committed by GitHub
commit 105d5ee199
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 23 deletions

View File

@ -23,7 +23,7 @@
"husky:install": "husky install" "husky:install": "husky install"
}, },
"dependencies": { "dependencies": {
"@jeecg/online": "3.9.1-beta", "@jeecg/online": "3.9.1-RC",
"@jeecg/aiflow":"3.9.1-beta", "@jeecg/aiflow":"3.9.1-beta",
"@logicflow/core": "^2.0.10", "@logicflow/core": "^2.0.10",
"@logicflow/extension": "^2.0.14", "@logicflow/extension": "^2.0.14",

View File

@ -20,34 +20,15 @@ export function registerPackages(app: App) {
// app // app
appInstance = app; appInstance = app;
app.component( app.component(
'superQuery', 'SuperQuery',
createAsyncComponent(() => { createAsyncComponent(() => import('@jeecg/online').then(mod => mod.SuperQuery))
return import('@jeecg/online').then(mod => {
const str = mod.default.install.toString();
const importPaths = extractDynamicImportPaths(str);
return import(importPaths.find(path => path.includes('SuperQuery')) ?? importPaths[1])
});
})
); );
app.component( app.component(
'JOnlineSearchSelect', 'JOnlineSearchSelect',
createAsyncComponent(() => { createAsyncComponent(() => import('@jeecg/online').then(mod => mod.JOnlineSearchSelect))
return import('@jeecg/online').then(mod => {
const str = mod.default.install.toString();
const importPaths = extractDynamicImportPaths(str);
debugger
return import(importPaths.find(path => path.includes('JOnlineSearchSelect')) ?? importPaths[0])
});
})
); );
} }
function extractDynamicImportPaths(code: string): string[] {
// import("...") / import('...') query
const matches = code.matchAll(/import\(\s*(['"])(.*?)\1\s*\)/g);
return Array.from(matches, (m) => m[2]).filter(Boolean);
}
/** 已加载的包缓存 */ /** 已加载的包缓存 */
const loadedPackages = new Map<string, any>(); const loadedPackages = new Map<string, any>();
/** 正在加载的包 Promise 缓存(防止重复加载) */ /** 正在加载的包 Promise 缓存(防止重复加载) */