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. 46
      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>
<id>com.fr.plugin.decision.baidu</id>
<id>com.fr.plugin.decision.fanruan</id>
<name><![CDATA[系统管理菜单扩展示例]]></name>
<active>yes</active>
<version>2.0</version>
@ -14,7 +14,7 @@
]]></change-notes>
<extra-decision>
<SystemOptionProvider class="com.fr.plugin.BaiduOption"/>
<SystemOptionProvider class="com.fr.plugin.FanruanOption"/>
</extra-decision>
<function-recorder class="com.fr.plugin.BaiduOption"/>
<function-recorder class="com.fr.plugin.FanruanOption"/>
</plugin>

2
pom.xml

@ -13,7 +13,7 @@
<artifactId>demo-system-management</artifactId>
<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>
<plugin>
<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.plugin.transform.ExecuteFunctionRecord;
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.web.struct.Atom;
@FunctionRecorder
@API(level = SystemOptionProvider.CURRENT_LEVEL)
public class BaiduOption extends AbstractSystemOptionProvider {
public class FanruanOption extends AbstractSystemOptionProvider {
@Override
@ExecuteFunctionRecord
public String id() {
return "baidu";
return "decision-management-fanruan-help";
}
@Override
public String displayName() {
return "Dec_System_Option_baidu";
return "Dec_System_Option_Fanruan_Help";
}
@Override
@ -37,6 +37,6 @@ public class BaiduOption extends AbstractSystemOptionProvider {
@Override
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;
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(){
}

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

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