From feebd17d1ebbb9b9a474056a46208da27a464d04 Mon Sep 17 00:00:00 2001 From: Roc Date: Fri, 3 Jan 2025 14:55:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0=E4=BB=BB=E5=8A=A1=E7=BC=96=E5=8F=B7?= =?UTF-8?q?=20fix:=E4=BF=AE=E6=AD=A3Demo=E7=B1=BB=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin.xml | 3 ++- .../plugin/custom/component/DemoComponentProvider.java | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/plugin.xml b/plugin.xml index 9190080..8d6ba38 100644 --- a/plugin.xml +++ b/plugin.xml @@ -3,13 +3,14 @@ com.finebi.plugin.custom.chart.demo.v6 yes - 1.6.0 + 1.6.1 11.0~11.0 6.0~ 2023-05-16 fanruan diff --git a/src/main/java/com/finebi/plugin/custom/component/DemoComponentProvider.java b/src/main/java/com/finebi/plugin/custom/component/DemoComponentProvider.java index 1a4e70a..69a98c2 100644 --- a/src/main/java/com/finebi/plugin/custom/component/DemoComponentProvider.java +++ b/src/main/java/com/finebi/plugin/custom/component/DemoComponentProvider.java @@ -3,7 +3,8 @@ package com.finebi.plugin.custom.component; import com.finebi.common.context.OperationContext; import com.finebi.provider.api.component.AbstractCustomComponentProvider; import com.finebi.provider.api.component.CustomComponentContext; -import com.finebi.provider.api.component.DataModel; +import com.finebi.provider.api.component.data.DataModel; +import com.finebi.provider.api.component.data.Dimension; import com.fr.general.IOUtils; import com.fr.plugin.transform.ExecuteFunctionRecord; import com.fr.plugin.transform.FunctionRecorder; @@ -111,19 +112,19 @@ public class DemoComponentProvider extends AbstractCustomComponentProvider { */ @Override public List process(List dataModels, CustomComponentContext customComponentContext) { - return dataModels.stream().map(dataModel -> new DataModel() { @Override - public List getFields() { + public List getFields() { return dataModel.getFields(); } @Override public List> getColData() { List> colData = new ArrayList<>(dataModel.getFields().size()); - dataModel.getColData().forEach(d -> colData.add(Collections.singletonList(d.get(0)))); + dataModel.getColData().forEach(d -> colData.add(Collections.singletonList(d.get((int) (Math.random() * d.size()))))); return colData; } }).collect(Collectors.toList()); } + }