From 518061685687815e9039871b6205b6a247b79ce3 Mon Sep 17 00:00:00 2001 From: "Roger.Chen" Date: Wed, 26 Aug 2020 09:21:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=82=E8=BD=BD=E6=A8=A1=E6=9D=BF=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E7=B1=BB=E5=9E=8BDemo=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 0 plugin.xml | 22 ++++++++++ pom.xml | 42 +++++++++++++++++++ .../plugin/showtype/NewPreviewComponent.java | 20 +++++++++ .../fr/plugin/showtype/NewPreviewType.java | 28 +++++++++++++ .../showtype/NewPreviewTypeLocaleFinder.java | 15 +++++++ .../showtype/NewPreviewTypeProvider.java | 28 +++++++++++++ .../showtype/locale/newPreview.properties | 1 + .../locale/newPreview_en_US.properties | 1 + .../locale/newPreview_zh_CN.properties | 1 + .../com/fr/plugin/showtype/web/show_types.js | 16 +++++++ 11 files changed, 174 insertions(+) create mode 100644 README.md create mode 100644 plugin.xml create mode 100644 pom.xml create mode 100644 src/main/java/com/fr/plugin/showtype/NewPreviewComponent.java create mode 100644 src/main/java/com/fr/plugin/showtype/NewPreviewType.java create mode 100644 src/main/java/com/fr/plugin/showtype/NewPreviewTypeLocaleFinder.java create mode 100644 src/main/java/com/fr/plugin/showtype/NewPreviewTypeProvider.java create mode 100644 src/main/resources/com/fr/plugin/showtype/locale/newPreview.properties create mode 100644 src/main/resources/com/fr/plugin/showtype/locale/newPreview_en_US.properties create mode 100644 src/main/resources/com/fr/plugin/showtype/locale/newPreview_zh_CN.properties create mode 100644 src/main/resources/com/fr/plugin/showtype/web/show_types.js diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/plugin.xml b/plugin.xml new file mode 100644 index 0000000..28dd9f8 --- /dev/null +++ b/plugin.xml @@ -0,0 +1,22 @@ + + + com.fr.plugin.type.newPreview.v10 + + yes + 1.0 + 10.0 + 2020-08-26 + finereport.mata + + [2020-08-26]新预览显示类型

+ ]]> +
+ + + + + + + +
\ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..2cca384 --- /dev/null +++ b/pom.xml @@ -0,0 +1,42 @@ + + + 4.0.0 + + + com.fr.plugin + starter + 10.0 + + + demo-show-type + + + com.fr.core + fine-core + 10.0-RELEASE-SNAPSHOT + + + + + ${basedir}/src/main/java + + + + ${project.basedir}/../webroot/WEB-INF/plugins/plugin-com.fr.plugin.type.newPreview.v10-1.0/classes + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 8 + 8 + + + + + + \ No newline at end of file diff --git a/src/main/java/com/fr/plugin/showtype/NewPreviewComponent.java b/src/main/java/com/fr/plugin/showtype/NewPreviewComponent.java new file mode 100644 index 0000000..445097f --- /dev/null +++ b/src/main/java/com/fr/plugin/showtype/NewPreviewComponent.java @@ -0,0 +1,20 @@ +package com.fr.plugin.showtype; + +import com.fr.web.struct.Component; +import com.fr.web.struct.browser.RequestClient; +import com.fr.web.struct.category.ScriptPath; + +/** + * @Author Roger + * @Date 2020/8/18 19:46 + * @Version 10.0 + */ +public class NewPreviewComponent extends Component { + + public static final NewPreviewComponent KEY = new NewPreviewComponent(); + + @Override + public ScriptPath script(RequestClient requestClient) { + return ScriptPath.build("com/fr/plugin/showtype/web/show_types.js"); + } +} diff --git a/src/main/java/com/fr/plugin/showtype/NewPreviewType.java b/src/main/java/com/fr/plugin/showtype/NewPreviewType.java new file mode 100644 index 0000000..293236f --- /dev/null +++ b/src/main/java/com/fr/plugin/showtype/NewPreviewType.java @@ -0,0 +1,28 @@ +package com.fr.plugin.showtype; + +import com.fr.decision.authority.base.constant.type.show.ShowType; +import com.fr.intelli.record.Focus; +import com.fr.intelli.record.Original; +import com.fr.record.analyzer.EnableMetrics; + +/** + * @Author Roger + * @Date 2020/8/18 18:18 + * @Version 10.0 + */ +@EnableMetrics +public class NewPreviewType extends ShowType { + + public static final NewPreviewType KEY = new NewPreviewType(); + + @Override + @Focus(id = "com.fr.plugin.showtype.v10", text = "Fine-Plugin_New_Preview_Type", source = Original.PLUGIN) + protected int getTypeValue() { + return 8; + } + + @Override + public String getTypeName() { + return "newPreview"; + } +} diff --git a/src/main/java/com/fr/plugin/showtype/NewPreviewTypeLocaleFinder.java b/src/main/java/com/fr/plugin/showtype/NewPreviewTypeLocaleFinder.java new file mode 100644 index 0000000..ef1d050 --- /dev/null +++ b/src/main/java/com/fr/plugin/showtype/NewPreviewTypeLocaleFinder.java @@ -0,0 +1,15 @@ +package com.fr.plugin.showtype; + +import com.fr.stable.fun.impl.AbstractLocaleFinder; + +/** + * @Author Roger + * @Date 2020/8/18 18:24 + * @Version 10.0 + */ +public class NewPreviewTypeLocaleFinder extends AbstractLocaleFinder { + @Override + public String find() { + return "com/fr/plugin/showtype/locale/newPreview"; + } +} diff --git a/src/main/java/com/fr/plugin/showtype/NewPreviewTypeProvider.java b/src/main/java/com/fr/plugin/showtype/NewPreviewTypeProvider.java new file mode 100644 index 0000000..35c38d5 --- /dev/null +++ b/src/main/java/com/fr/plugin/showtype/NewPreviewTypeProvider.java @@ -0,0 +1,28 @@ +package com.fr.plugin.showtype; + +import com.fr.decision.authority.base.constant.type.show.ShowType; +import com.fr.decision.fun.impl.AbstractTemplateShowTypeProvider; +import com.fr.web.struct.Atom; + +/** + * @Author Roger + * @Date 2020/8/18 17:42 + * @Version 10.0 + */ +public class NewPreviewTypeProvider extends AbstractTemplateShowTypeProvider { + + @Override + public String nameForShowType() { + return "newPreview"; + } + + @Override + public ShowType registerShowType() { + return NewPreviewType.KEY; + } + + @Override + public Atom client() { + return NewPreviewComponent.KEY; + } +} diff --git a/src/main/resources/com/fr/plugin/showtype/locale/newPreview.properties b/src/main/resources/com/fr/plugin/showtype/locale/newPreview.properties new file mode 100644 index 0000000..c4bd0d2 --- /dev/null +++ b/src/main/resources/com/fr/plugin/showtype/locale/newPreview.properties @@ -0,0 +1 @@ +Fine-Plugin_New_Preview_Type=New_Preview_Type \ No newline at end of file diff --git a/src/main/resources/com/fr/plugin/showtype/locale/newPreview_en_US.properties b/src/main/resources/com/fr/plugin/showtype/locale/newPreview_en_US.properties new file mode 100644 index 0000000..c4bd0d2 --- /dev/null +++ b/src/main/resources/com/fr/plugin/showtype/locale/newPreview_en_US.properties @@ -0,0 +1 @@ +Fine-Plugin_New_Preview_Type=New_Preview_Type \ No newline at end of file diff --git a/src/main/resources/com/fr/plugin/showtype/locale/newPreview_zh_CN.properties b/src/main/resources/com/fr/plugin/showtype/locale/newPreview_zh_CN.properties new file mode 100644 index 0000000..5c3089f --- /dev/null +++ b/src/main/resources/com/fr/plugin/showtype/locale/newPreview_zh_CN.properties @@ -0,0 +1 @@ +Fine-Plugin_New_Preview_Type=\u65b0\u9884\u89c8 \ No newline at end of file diff --git a/src/main/resources/com/fr/plugin/showtype/web/show_types.js b/src/main/resources/com/fr/plugin/showtype/web/show_types.js new file mode 100644 index 0000000..4a313c9 --- /dev/null +++ b/src/main/resources/com/fr/plugin/showtype/web/show_types.js @@ -0,0 +1,16 @@ +!(function () { + BI.config("dec.provider.report.template.show_types", function (provider) { + provider.inject({ + showTypes: { + suffix: "frm", + types: [ + { + text: BI.i18nText("新预览"), + defaultValue: true, + value: 8, + }, + ], + }, + }); + }); +}())