diff --git a/README.md b/README.md index 165d20b..ec1cb3c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ # demo-system-management -拓展系统管理节点和侧栏节点 \ No newline at end of file +拓展系统管理节点和侧栏节点 + +![](demo.png) \ No newline at end of file diff --git a/build.xml b/build.xml new file mode 100644 index 0000000..4564989 --- /dev/null +++ b/build.xml @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/demo.png b/demo.png new file mode 100644 index 0000000..98c1f11 Binary files /dev/null and b/demo.png differ diff --git a/plugin.xml b/plugin.xml new file mode 100644 index 0000000..6940ddd --- /dev/null +++ b/plugin.xml @@ -0,0 +1,16 @@ + + com.fr.plugin.decision.baidu + + yes + 2.0 + 10.0 + 2018-11-11 + dailer + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/fr/plugin/BaiduOption.java b/src/main/java/com/fr/plugin/BaiduOption.java new file mode 100644 index 0000000..00aa2f1 --- /dev/null +++ b/src/main/java/com/fr/plugin/BaiduOption.java @@ -0,0 +1,42 @@ +package com.fr.plugin; + +import com.fr.decision.fun.SystemOptionProvider; +import com.fr.decision.fun.impl.AbstractSystemOptionProvider; +import com.fr.decision.web.MainComponent; +import com.fr.plugin.transform.ExecuteFunctionRecord; +import com.fr.plugin.transform.FunctionRecorder; +import com.fr.plugin.web.BaiduComponent; +import com.fr.stable.fun.mark.API; +import com.fr.web.struct.Atom; + + +@FunctionRecorder +@API(level = SystemOptionProvider.CURRENT_LEVEL) +public class BaiduOption extends AbstractSystemOptionProvider { + + @Override + @ExecuteFunctionRecord + public String id() { + return "baidu"; + } + + @Override + public String displayName() { + return "Dec_System_Option_baidu"; + } + + @Override + public int sortIndex() { + return 2; + } + + @Override + public Atom attach() { + return MainComponent.KEY; + } + + @Override + public Atom client() { + return BaiduComponent.KEY; + } +} \ No newline at end of file diff --git a/src/main/java/com/fr/plugin/web/BaiduComponent.java b/src/main/java/com/fr/plugin/web/BaiduComponent.java new file mode 100644 index 0000000..0c537e8 --- /dev/null +++ b/src/main/java/com/fr/plugin/web/BaiduComponent.java @@ -0,0 +1,25 @@ +package com.fr.plugin.web; + +import com.fr.web.struct.Component; +import com.fr.web.struct.category.ScriptPath; +import com.fr.web.struct.category.StylePath; + + +public class BaiduComponent extends Component { + + public static BaiduComponent KEY = new BaiduComponent(); + + private BaiduComponent(){ + + } + + @Override + public ScriptPath script() { + return ScriptPath.build("/com/fr/plugin/web/resources/js/bundle.js"); + } + + @Override + public StylePath style() { + return StylePath.build("/com/fr/plugin/web/resources/css/bundle.min.css"); + } +} \ No newline at end of file diff --git a/src/main/resources/com/fr/plugin/web/resources/css/bundle.min.css b/src/main/resources/com/fr/plugin/web/resources/css/bundle.min.css new file mode 100644 index 0000000..2fca2cf --- /dev/null +++ b/src/main/resources/com/fr/plugin/web/resources/css/bundle.min.css @@ -0,0 +1 @@ +.visualvm-font-weight-bold{font-weight:700}.visualvm-threads-table-header{background-color:rgba(54,133,242,.1)}.left-node{font-weight:700;color:#00c}.dump-normal{font-weight:400}.dump-computing{font-size:150%} \ No newline at end of file diff --git a/src/main/resources/com/fr/plugin/web/resources/js/bundle.js b/src/main/resources/com/fr/plugin/web/resources/js/bundle.js new file mode 100644 index 0000000..8efe35b --- /dev/null +++ b/src/main/resources/com/fr/plugin/web/resources/js/bundle.js @@ -0,0 +1,59 @@ +!(function () { + + BI.module("my.management", { + version: 1.0, + components: [], + constants: ["dec.constant.menu.items", "dec.constant.nav.items"], + services: [], + models: [] + }) + + + // 示例,向menus中加入百度搜索按钮. + BI.config("dec.constant.menu.items", function (items) { + items.push({ + value: "baidu", + text: BI.i18nText("百度一下"), + cardType: { + src: "http://baidu.com" + }, + cls: "analysis-menu-font" + }); + return items; + }); + + // 示例,向管理系统节点加入百度搜索节点 + BI.config("dec.constant.nav.items", function (items) { + items.push({ + value: "baidu", // 地址栏显示的hash值 + id: "decision-management-baidu", // id + text: BI.i18nText("百度一下"), // 文字 + cardType: "dec.management.baidu", // 组件的shortcut,适用于用fineui开发的页面. + cls: "management-directory-font" // 图标类名 + }); + return items; + }); + + + // 组件实现 + var Baidu = BI.inherit(BI.Widget, { + + props: { + baseCls: "dec-management-baidu" + }, + + render: function () { + return { + el: { + type: "bi.iframe", + src: "http://www.baidu.com" + }, + top: 0, + left: 0, + right: 0, + bottom: 0 + }; + } + }); + BI.shortcut("dec.management.baidu", Baidu); +}()); \ No newline at end of file