Browse Source

更新demo

pull/1/head
Dailer 6 years ago
parent
commit
64060650ed
  1. 6
      plugin.xml
  2. 2
      pom.xml
  3. 10
      src/main/java/com/fr/plugin/FanruanOption.java
  4. 6
      src/main/java/com/fr/plugin/web/FanruanComponent.java
  5. 60
      src/main/resources/com/fr/plugin/web/resources/js/bundle.js

6
plugin.xml

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><plugin> <?xml version="1.0" encoding="UTF-8" standalone="no"?><plugin>
<id>com.fr.plugin.decision.baidu</id> <id>com.fr.plugin.decision.fanruan</id>
<name><![CDATA[系统管理菜单扩展示例]]></name> <name><![CDATA[系统管理菜单扩展示例]]></name>
<active>yes</active> <active>yes</active>
<version>2.0</version> <version>2.0</version>
@ -14,7 +14,7 @@
]]></change-notes> ]]></change-notes>
<extra-decision> <extra-decision>
<SystemOptionProvider class="com.fr.plugin.BaiduOption"/> <SystemOptionProvider class="com.fr.plugin.FanruanOption"/>
</extra-decision> </extra-decision>
<function-recorder class="com.fr.plugin.BaiduOption"/> <function-recorder class="com.fr.plugin.FanruanOption"/>
</plugin> </plugin>

2
pom.xml

@ -13,7 +13,7 @@
<artifactId>demo-system-management</artifactId> <artifactId>demo-system-management</artifactId>
<build> <build>
<!---如果要更改调试插件,改这里的配置就可以了--> <!---如果要更改调试插件,改这里的配置就可以了-->
<outputDirectory>${project.basedir}/../webroot/WEB-INF/plugins/plugin-com.fr.plugin.decision.baidu-1.0/classes</outputDirectory> <outputDirectory>${project.basedir}/../webroot/WEB-INF/plugins/plugin-com.fr.plugin.decision.fanruan-1.0/classes</outputDirectory>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>

10
src/main/java/com/fr/plugin/BaiduOption.java → src/main/java/com/fr/plugin/FanruanOption.java

@ -5,24 +5,24 @@ import com.fr.decision.fun.impl.AbstractSystemOptionProvider;
import com.fr.decision.web.MainComponent; import com.fr.decision.web.MainComponent;
import com.fr.plugin.transform.ExecuteFunctionRecord; import com.fr.plugin.transform.ExecuteFunctionRecord;
import com.fr.plugin.transform.FunctionRecorder; import com.fr.plugin.transform.FunctionRecorder;
import com.fr.plugin.web.BaiduComponent; import com.fr.plugin.web.FanruanComponent;
import com.fr.stable.fun.mark.API; import com.fr.stable.fun.mark.API;
import com.fr.web.struct.Atom; import com.fr.web.struct.Atom;
@FunctionRecorder @FunctionRecorder
@API(level = SystemOptionProvider.CURRENT_LEVEL) @API(level = SystemOptionProvider.CURRENT_LEVEL)
public class BaiduOption extends AbstractSystemOptionProvider { public class FanruanOption extends AbstractSystemOptionProvider {
@Override @Override
@ExecuteFunctionRecord @ExecuteFunctionRecord
public String id() { public String id() {
return "baidu"; return "decision-management-fanruan-help";
} }
@Override @Override
public String displayName() { public String displayName() {
return "Dec_System_Option_baidu"; return "Dec_System_Option_Fanruan_Help";
} }
@Override @Override
@ -37,6 +37,6 @@ public class BaiduOption extends AbstractSystemOptionProvider {
@Override @Override
public Atom client() { public Atom client() {
return BaiduComponent.KEY; return FanruanComponent.KEY;
} }
} }

6
src/main/java/com/fr/plugin/web/BaiduComponent.java → src/main/java/com/fr/plugin/web/FanruanComponent.java

@ -5,11 +5,11 @@ import com.fr.web.struct.category.ScriptPath;
import com.fr.web.struct.category.StylePath; import com.fr.web.struct.category.StylePath;
public class BaiduComponent extends Component { public class FanruanComponent extends Component {
public static BaiduComponent KEY = new BaiduComponent(); public static FanruanComponent KEY = new FanruanComponent();
private BaiduComponent(){ private FanruanComponent(){
} }

60
src/main/resources/com/fr/plugin/web/resources/js/bundle.js

@ -1,59 +1,55 @@
!(function () { !(function () {
BI.module("my.management", { // 示例,向menus中加入帆软官网.
version: 1.0,
components: [],
constants: ["dec.constant.menu.items", "dec.constant.nav.items"],
services: [],
models: []
})
// 示例,向menus中加入百度搜索按钮.
BI.config("dec.constant.menu.items", function (items) { BI.config("dec.constant.menu.items", function (items) {
items.push({ items.push({
value: "baidu", value: "fanruan",
text: BI.i18nText("百度一下"), text: BI.i18nText("帆软"),
cardType: { cardType: {
src: "http://baidu.com" src: "http://www.fanruan.com/"
}, },
cls: "analysis-menu-font" cls: "fr-logo-font"
}); });
return items; return items;
}); });
// 示例,向管理系统节点加入百度搜索节点 // 示例,向管理系统节点加入帆软帮助文档
BI.config("dec.constant.nav.items", function (items) { BI.config("dec.constant.management.navigation", function (items) {
items.push({ items.push({
value: "baidu", // 地址栏显示的hash值 value: "frhelp", // 地址栏显示的hash值
id: "decision-management-baidu", // id id: "decision-management-fanruan-help", // id
text: BI.i18nText("百度一下"), // 文字 text: BI.i18nText("帮助文档"), // 文字
cardType: "dec.management.baidu", // 组件的shortcut,适用于用fineui开发的页面. cardType: "dec.management.fanruan_help", // 组件的shortcut,适用于用fineui开发的页面.
cls: "management-directory-font" // 图标类名 cls: "fr-logo-font" // 图标类名
}); });
return items; return items;
}); });
// 组件实现 // 组件实现
var Baidu = BI.inherit(BI.Widget, { var Fanruan = BI.inherit(BI.Widget, {
props: { props: {
baseCls: "dec-management-baidu" baseCls: "dec-management-fanruan"
}, },
render: function () { render: function () {
return { return {
el: { type: "bi.absolute",
type: "bi.iframe", items: [
src: "http://www.baidu.com" {
}, el: {
top: 0, type: "bi.iframe",
left: 0, src: "http://help.finereport.com/"
right: 0, },
bottom: 0 top: 0,
left: 0,
right: 0,
bottom: 0
}
]
}; };
} }
}); });
BI.shortcut("dec.management.baidu", Baidu); BI.shortcut("dec.management.fanruan_help", Fanruan);
}()); }());
Loading…
Cancel
Save