From 74dd5ba289dbf6056dc02764b679b4ebe4fbd17f Mon Sep 17 00:00:00 2001 From: hans Date: Thu, 25 Jan 2024 15:54:32 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-112276=20=E5=85=AC=E5=85=B1=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=8F=96=E6=95=B0=E7=AE=80=E9=81=93=E4=BA=91=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=BF=9E=E6=8E=A5=E9=83=A8=E5=88=86=E9=80=82=E9=85=8D?= =?UTF-8?q?=20=E8=AE=BE=E8=AE=A1=E4=BC=98=E5=85=88=E7=BA=A7,=E4=BC=98?= =?UTF-8?q?=E5=85=88=E4=BD=BF=E7=94=A8=E5=B9=B3=E5=8F=B0=E5=86=85=E7=BD=AE?= =?UTF-8?q?=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/app.provider.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/modules/app.provider.ts b/src/modules/app.provider.ts index 4ed6284..18b2a4a 100644 --- a/src/modules/app.provider.ts +++ b/src/modules/app.provider.ts @@ -135,6 +135,16 @@ BI.provider('dec.connection.provider.datebase', function () { return false; } + function filterPluginDataTypeByPriority() { + const originTypes = [...BI.Constants.getConstant(CONSTANT_PLUGIN_TYPES)]; + const sortDataTypes = BI.sortBy(originTypes, (index, value: any) => { + return value.priority || 0; + }) + return BI.uniqWith(sortDataTypes, (current, other) => { + return current.text == other.text; + }); + } + this.registerDatabaseType = (config: any) => { if (coverBaseDatabase(config)) return; @@ -162,6 +172,6 @@ BI.provider('dec.connection.provider.datebase', function () { } return this.resolves[type] || jdbcResolve }, - customDatabaseType: BI.Constants.getConstant(CONSTANT_PLUGIN_TYPES), + customDatabaseType: filterPluginDataTypeByPriority(), }); });