From e8afcd5d63cb4941c10085dcf10278f17d0259b2 Mon Sep 17 00:00:00 2001 From: LuPing Zou <“zouluping@inspur.com”> Date: Tue, 12 Aug 2025 11:23:11 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=8F=8C=E5=87=BB?= =?UTF-8?q?=E9=9A=90=E8=97=8F=E5=8C=BA=E5=9F=9F=E7=BB=84=E4=BB=B6=E4=BA=A4?= =?UTF-8?q?=E4=BA=92=E9=9D=A2=E6=9D=BF=E4=B8=AD=E6=96=B9=E6=B3=95=E5=90=8E?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E8=B7=B3=E8=BD=AC=E5=88=B0ts=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=99=A8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../external-lookup.property-config.ts | 12 ++---------- .../src/property-config/modal.property-config.ts | 15 +++------------ 2 files changed, 5 insertions(+), 22 deletions(-) diff --git a/packages/ui-vue/components/lookup/src/property-config/external-lookup.property-config.ts b/packages/ui-vue/components/lookup/src/property-config/external-lookup.property-config.ts index 8247a36218d..2b8e0387783 100644 --- a/packages/ui-vue/components/lookup/src/property-config/external-lookup.property-config.ts +++ b/packages/ui-vue/components/lookup/src/property-config/external-lookup.property-config.ts @@ -76,16 +76,8 @@ export class ExternalLookupPropertyConfig extends BaseControlProperty { private getEventPropConfig(propertyData: any) { const self: any = this; const initialData = self.eventsEditorUtils['formProperties'](propertyData, self.viewModelId, this.events); - const properties = {}; - properties[self.viewModelId] = { - type: 'events-editor', - editor: { - initialData, - viewSourceHandle: (commandInfo: any) => { - self.eventsEditorUtils.jumpToMethod(commandInfo); - } - } - }; + const properties = self.createBaseEventProperty(initialData); + return { title: '事件', hideTitle: true, diff --git a/packages/ui-vue/components/modal/src/property-config/modal.property-config.ts b/packages/ui-vue/components/modal/src/property-config/modal.property-config.ts index 72a57b7d066..d4669ba1188 100644 --- a/packages/ui-vue/components/modal/src/property-config/modal.property-config.ts +++ b/packages/ui-vue/components/modal/src/property-config/modal.property-config.ts @@ -84,16 +84,8 @@ export class ModalProperty extends BaseControlProperty { const self: any = this; const events = ModalEvents; const initialData = self.eventsEditorUtils['formProperties'](propertyData, self.viewModelId, events); - const properties = {}; - properties[self.viewModelId] = { - type: 'events-editor', - editor: { - initialData, - viewSourceHandle: (commandInfo: any) => { - self.eventsEditorUtils.jumpToMethod(commandInfo); - } - } - }; + const properties = self.createBaseEventProperty(initialData); + return { title: '事件', hideTitle: true, @@ -110,8 +102,7 @@ export class ModalProperty extends BaseControlProperty { } events.forEach(event => { newPropertyData[event.label] = propertyData[event.label]; - }) - + }); } }; } -- Gitee From 511a5402ce5197142876ce798b094f63724a03e1 Mon Sep 17 00:00:00 2001 From: LuPing Zou <“zouluping@inspur.com”> Date: Tue, 12 Aug 2025 17:47:10 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=9A=90=E8=97=8F?= =?UTF-8?q?=E5=8C=BA=E5=9F=9F=E9=9D=A2=E6=9D=BF=E9=80=89=E6=8B=A9=E5=B8=AE?= =?UTF-8?q?=E5=8A=A9=E6=97=B6=E6=95=B0=E6=8D=AE=E9=87=8D=E5=A4=8D=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../external-component-selector.component.tsx | 2 +- .../lookup/lookup-schema.service.ts | 28 +++++++++++++++---- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/packages/designer/src/components/components/form-designer/components/external-component-panel/components/external-component-selector/external-component-selector.component.tsx b/packages/designer/src/components/components/form-designer/components/external-component-panel/components/external-component-selector/external-component-selector.component.tsx index d6ea25cf0ae..c5105f9eeb8 100644 --- a/packages/designer/src/components/components/form-designer/components/external-component-panel/components/external-component-selector/external-component-selector.component.tsx +++ b/packages/designer/src/components/components/form-designer/components/external-component-panel/components/external-component-selector/external-component-selector.component.tsx @@ -20,7 +20,7 @@ export default defineComponent({ const metadataService = new MetadataService(); const formBasicInfo = formSchemaUtils.getFormMetadataBasicInfo(); - const editorParams = { formBasicInfo }; + const editorParams = { formBasicInfo, enableGroup: false }; const viewOptions = [ { id: 'recommend', title: '推荐', type: 'Card', dataSource: 'Recommand', pagination: true }, { id: 'total', title: '全部', type: 'Card', dataSource: 'Total', pagination: true } diff --git a/packages/designer/src/components/composition/schema-repository/lookup/lookup-schema.service.ts b/packages/designer/src/components/composition/schema-repository/lookup/lookup-schema.service.ts index 66a64d3c5d6..09a9d4b8a7f 100644 --- a/packages/designer/src/components/composition/schema-repository/lookup/lookup-schema.service.ts +++ b/packages/designer/src/components/composition/schema-repository/lookup/lookup-schema.service.ts @@ -5,8 +5,7 @@ export class LookupSchemaService { private metadataType = '.hlp'; - constructor(private metadataService: MetadataService) { - } + constructor(private metadataService: MetadataService) { } private getLocalMetadata(metadataPath) { return this.metadataService?.getMetadataListInSu(metadataPath, this.metadataType); @@ -31,18 +30,37 @@ export class LookupSchemaService { }); } - getRecommandData = async (searchingText: string, pagination: SchemaRepositoryPagination, editorParams): Promise => { - const {relativePath} = editorParams.formBasicInfo; + private mergeAndDeduplicateById(...items: T[][]): T[] { + const idSet = new Set(); + const mergedItems: T[] = []; + + for (const array of items) { + for (const item of array) { + if (!idSet.has(item.id)) { + idSet.add(item.id); + mergedItems.push(item); + } + } + } + return mergedItems; + } + + getRecommandData = async (searchingText: string, pagination: SchemaRepositoryPagination, editorParams: any): Promise => { + const { relativePath } = editorParams.formBasicInfo; + const shouldDeduplicate = editorParams.enableGroup === false; const recentRequest = await this.getRecentMetadata(relativePath); const recentData = this.metadata2SchemaItem(recentRequest.data, 'recent'); const suMetadataRequest = await this.getLocalMetadata(relativePath); const localData = this.metadata2SchemaItem(suMetadataRequest.data, 'local'); + if (shouldDeduplicate) { + return this.mergeAndDeduplicateById(recentData, localData); + } return recentData.concat(localData); }; - getSchemaData = async (searchingText: string, pagination: SchemaRepositoryPagination, editorParams): Promise => { + getSchemaData = async (searchingText: string, pagination: SchemaRepositoryPagination, editorParams: any): Promise => { const { relativePath } = editorParams.formBasicInfo; const allMetadataRes = await this.metadataService?.getAllMetadataList(relativePath, this.metadataType); let items = allMetadataRes.data; -- Gitee