Browse Source

update

pull/1/head
Dailer 6 years ago
parent
commit
f00fcaf200
  1. 4
      README.md
  2. 126
      build.xml
  3. BIN
      demo.png
  4. 16
      plugin.xml
  5. 42
      src/main/java/com/fr/plugin/BaiduOption.java
  6. 25
      src/main/java/com/fr/plugin/web/BaiduComponent.java
  7. 1
      src/main/resources/com/fr/plugin/web/resources/css/bundle.min.css
  8. 59
      src/main/resources/com/fr/plugin/web/resources/js/bundle.js

4
README.md

@ -1,3 +1,5 @@
# demo-system-management
拓展系统管理节点和侧栏节点
拓展系统管理节点和侧栏节点
![](demo.png)

126
build.xml

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project basedir="." default="jar" name="plugin">
<!-- JDK路径,根据自己机器上实际位置修改-->
<property name="jdk.home" value="D:/Java/jdk1.6.0_45"/>
<property name="libs" value="${basedir}/lib"/>
<property name="publicLibs" value=""/>
<property name="reportLibs" value="${basedir}/../../webroot/WEB-INF/lib"/>
<property name="destLoc" value="."/>
<property name="classes" value="classes"/>
<xmlproperty file="${basedir}/plugin.xml"/>
<property name="current-version" value="${plugin.version}"/>
<!-- 插件版本-->
<property name="plugin-version" value="${current-version}"/>
<!-- 插件名字-->
<property name="plugin-name" value="system-management"/>
<property name="plugin-jar" value="fr-plugin-${plugin-name}-${plugin-version}.jar"/>
<target name="prepare">
<delete dir="${classes}"/>
<delete dir="fr-plugin-${plugin-name}-${plugin-version}"/>
<xmlproperty file="${basedir}/plugin.xml"/>
<delete dir="${destLoc}/${plugin.name}"/>
</target>
<path id="compile.classpath">
<fileset dir="${libs}">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${publicLibs}">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${reportLibs}">
<include name="**/*.jar"/>
</fileset>
</path>
<patternset id="resources4Jar">
<exclude name="**/.settings/**"/>
<exclude name=".classpath"/>
<exclude name=".project"/>
<exclude name="**/*.java"/>
<exclude name="**/*.db"/>
<exclude name="**/*.g"/>
<exclude name="**/package.html"/>
</patternset>
<target name="copy_resources">
<echo message="从${resources_from}拷贝图片,JS,CSS等资源文件"/>
<delete dir="tmp"/>
<copy todir="tmp">
<fileset dir="${resources_from}/src/main/resources">
<patternset refid="resources4Jar"/>
</fileset>
</copy>
<copy todir="${classes}">
<fileset dir="tmp"/>
</copy>
<delete dir="tmp"/>
</target>
<target name="compile_javas">
<echo message="编译${compile_files}下的Java文件"/>
<javac destdir="${classes}" debug="false" optimize="on" source="${source_jdk_version}"
target="${target_jdk_version}"
fork="true" memoryMaximumSize="512m" listfiles="false" srcdir="${basedir}"
executable="${compile_jdk_version}/bin/javac">
<src path="${basedir}/src/main/java"/>
<exclude name="**/.svn/**"/>
<compilerarg line="-encoding UTF8 "/>
<classpath refid="compile.classpath"/>
</javac>
</target>
<target name="jar_classes">
<echo message="打Jar包:${jar_name}"/>
<delete file="${basedir}/${jar_name}"/>
<jar jarfile="${basedir}/${jar_name}">
<fileset dir="${classes}">
</fileset>
</jar>
</target>
<target name="super_jar" depends="prepare">
<antcall target="copy_resources">
<param name="resources_from" value="${basedir}"/>
</antcall>
<antcall target="compile_javas">
<param name="source_jdk_version" value="1.6"/>
<param name="target_jdk_version" value="1.6"/>
<param name="compile_jdk_version" value="${jdk.home}"/>
<param name="compile_files" value="${basedir}/src"/>
</antcall>
<echo message="compile plugin success!"/>
<antcall target="jar_classes">
<param name="jar_name" value="${plugin-jar}"/>
</antcall>
<delete dir="${classes}"/>
</target>
<target name="jar" depends="super_jar">
<antcall target="zip"/>
</target>
<target name="zip">
<property name="plugin-folder" value="fr-plugin-${plugin-name}-${plugin-version}"/>
<echo message="----------zip files----------"/>
<mkdir dir="${plugin-folder}"/>
<copy todir="${plugin-folder}">
<fileset dir=".">
<include name="${plugin-jar}"/>
<include name="plugin.xml"/>
</fileset>
<fileset dir="${libs}">
<include name="*.jar"/>
<include name="*.dll"/>
</fileset>
</copy>
<zip destfile="${basedir}/${plugin-folder}.zip" basedir=".">
<include name="${plugin-folder}/*.jar"/>
<include name="${plugin-folder}/*.dll"/>
<include name="${plugin-folder}/plugin.xml"/>
</zip>
<move file="${plugin-folder}.zip" todir="${destLoc}/${plugin.name}"/>
</target>
</project>

BIN
demo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

16
plugin.xml

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><plugin>
<id>com.fr.plugin.decision.baidu</id>
<name><![CDATA[system-management]]></name>
<active>yes</active>
<version>2.0</version>
<env-version>10.0</env-version>
<jartime>2018-11-11</jartime>
<vendor>dailer</vendor>
<description><![CDATA[]]></description>
<change-notes><![CDATA[]]></change-notes>
<extra-decision>
<SystemOptionProvider class="com.fr.plugin.BaiduOption"/>
</extra-decision>
<function-recorder class="com.fr.plugin.BaiduOption"/>
</plugin>

42
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;
}
}

25
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");
}
}

1
src/main/resources/com/fr/plugin/web/resources/css/bundle.min.css vendored

@ -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%}

59
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);
}());
Loading…
Cancel
Save