diff --git a/README.md b/README.md
index 3051aea..6bca2f7 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,6 @@
# open-JSD-8496
-JSD-8496 开源任务材料
\ No newline at end of file
+JSD-8496 决策平台 simple主题 开源任务材料\
+免责说明:该源码为第三方爱好者提供,不保证源码和方案的可靠性,也不提供任何形式的源码教学指导和协助!\
+仅作为开发者学习参考使用!禁止用于任何商业用途!\
+为保护开发者隐私,开发者信息已隐去!若原开发者希望公开自己的信息,可联系hugh处理。
\ No newline at end of file
diff --git a/plugin.xml b/plugin.xml
new file mode 100644
index 0000000..6c21049
--- /dev/null
+++ b/plugin.xml
@@ -0,0 +1,22 @@
+
+
+ com.fr.plugin.decision.theme.zxl.simple
+
+ yes
+ 1.0.7.5
+ 10.0
+ 2018-10-10
+ fr.open
+ 2020-02025 开始开发
+ ]]>
+
+
+
+
+
+
+
+
diff --git a/src/main/java/com/fr/plugin/theme/simple/SimpleComponent.java b/src/main/java/com/fr/plugin/theme/simple/SimpleComponent.java
new file mode 100644
index 0000000..3226ba1
--- /dev/null
+++ b/src/main/java/com/fr/plugin/theme/simple/SimpleComponent.java
@@ -0,0 +1,84 @@
+package com.fr.plugin.theme.simple;
+
+import com.fr.decision.config.AppearanceConfig;
+import com.fr.web.struct.AssembleComponent;
+import com.fr.web.struct.Atom;
+import com.fr.web.struct.Component;
+import com.fr.web.struct.browser.RequestClient;
+import com.fr.web.struct.category.FileType;
+import com.fr.web.struct.category.ParserType;
+import com.fr.web.struct.category.ScriptPath;
+import com.fr.web.struct.category.StylePath;
+import com.fr.web.struct.Filter;
+
+
+public class SimpleComponent extends AssembleComponent {
+
+ public static final SimpleComponent KEY = new SimpleComponent();
+
+ public SimpleComponent() {
+ ThemeConfig.getInstance();//初始化配置
+ }
+
+ @Override
+ public Atom[] refer() {
+ return new Atom[]{
+ new Component() {
+ @Override
+ public ScriptPath script(RequestClient requestClient) {
+ return ScriptPath.build("com/fr/plugin/theme/simple/web/js/baseFun.js");
+ }
+ },
+ new Component() {
+ @Override
+ public ScriptPath script(RequestClient requestClient) {
+ return ScriptPath.build("com/fr/plugin/theme/simple/web/js/models.js");
+ }
+ },
+ new Component() {
+ @Override
+ public ScriptPath script(RequestClient requestClient) {
+ return ScriptPath.build("com/fr/plugin/theme/simple/web/js/panles.js");
+ }
+ },
+ new Component() {
+ @Override
+ public ScriptPath script(RequestClient requestClient) {
+ return ScriptPath.build("com/fr/plugin/theme/simple/web/js/customTree.js");
+ }
+ },
+ new Component() {
+ @Override
+ public ScriptPath script(RequestClient requestClient) {
+ return ScriptPath.build("com/fr/plugin/theme/simple/web/js/jquery.slimscroll.min.js");
+ }
+ },
+ new Component() {
+ @Override
+ public ScriptPath script(RequestClient requestClient) {
+ return ScriptPath.build("com/fr/plugin/theme/simple/web/js/jquery.nicescroll.min.js");
+ }
+ },
+ };
+ }
+
+ @Override
+ public ScriptPath script() {
+ return ScriptPath.build("com.fr.plugin.theme.simple.SimpleThemeJS", FileType.CLASS);
+ // return ScriptPath.build("com/fr/plugin/theme/simple/web/theme.js");
+ }
+
+ @Override
+ public StylePath style() {
+ return StylePath.build("com/fr/plugin/theme/simple/web/style.css", ParserType.DYNAMIC);
+ }
+
+ @Override
+ public Filter filter() {
+ return new Filter() {
+ public boolean accept() {
+ return "com.fr.plugin.decision.theme.zxl.simple".equals(AppearanceConfig.getInstance().getThemeId());
+ }
+ };
+ }
+}
diff --git a/src/main/java/com/fr/plugin/theme/simple/SimpleHttpHanders.java b/src/main/java/com/fr/plugin/theme/simple/SimpleHttpHanders.java
new file mode 100644
index 0000000..c4a6893
--- /dev/null
+++ b/src/main/java/com/fr/plugin/theme/simple/SimpleHttpHanders.java
@@ -0,0 +1,18 @@
+package com.fr.plugin.theme.simple;
+
+import com.fr.decision.fun.HttpHandler;
+import com.fr.decision.fun.impl.AbstractHttpHandlerProvider;
+import com.fr.stable.fun.Authorize;
+
+@Authorize(callSignKey = "com.fr.plugin.decision.theme.zxl.simple")
+public class SimpleHttpHanders extends AbstractHttpHandlerProvider {
+
+ private HttpHandler[] actions = new HttpHandler[]{
+
+ };
+
+ @Override
+ public HttpHandler[] registerHandlers() {
+ return actions;
+ }
+}
diff --git a/src/main/java/com/fr/plugin/theme/simple/SimpleTheme.java b/src/main/java/com/fr/plugin/theme/simple/SimpleTheme.java
new file mode 100644
index 0000000..4ddce12
--- /dev/null
+++ b/src/main/java/com/fr/plugin/theme/simple/SimpleTheme.java
@@ -0,0 +1,40 @@
+package com.fr.plugin.theme.simple;
+
+import com.fr.decision.fun.impl.AbstractThemeVariousProvider;
+import com.fr.decision.web.MainComponent;
+import com.fr.intelli.record.Focus;
+import com.fr.intelli.record.Original;
+import com.fr.record.analyzer.EnableMetrics;
+import com.fr.web.struct.Atom;
+
+@EnableMetrics
+public class SimpleTheme extends AbstractThemeVariousProvider {
+
+
+ @Override
+ public Atom attach() {
+ return MainComponent.KEY;
+ }
+
+ @Override
+ @Focus(id = "com.fr.plugin.decision.theme.zxl.simple", text = "Simple", source = Original.PLUGIN)
+ public Atom client() {
+ return SimpleComponent.KEY;
+ }
+
+ @Override
+ public String name() {
+ return "Simple主题";
+ }
+
+ @Override
+ public String text() {
+ return "Simple主题";
+ }
+
+ @Override
+ public String coverPath() {
+ return "com/fr/plugin/theme/simple/web/icon.png";
+ }
+
+}
diff --git a/src/main/java/com/fr/plugin/theme/simple/SimpleThemeJS.java b/src/main/java/com/fr/plugin/theme/simple/SimpleThemeJS.java
new file mode 100644
index 0000000..03dcf8d
--- /dev/null
+++ b/src/main/java/com/fr/plugin/theme/simple/SimpleThemeJS.java
@@ -0,0 +1,39 @@
+package com.fr.plugin.theme.simple;
+
+import com.fr.base.TemplateUtils;
+import com.fr.gen.TextGenerator;
+import com.fr.plugin.context.PluginContexts;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.HashMap;
+import java.util.Map;
+
+public class SimpleThemeJS implements TextGenerator {
+
+
+ public String text(HttpServletRequest req, HttpServletResponse res) throws Exception {
+ Map renderMap = new HashMap();
+ ThemeConfig instance = ThemeConfig.getInstance();
+ Integer fontSize = instance.getFontSize();
+ Integer zfontSize = instance.getzFontSize();
+ renderMap.put("fontSize", fontSize);
+ renderMap.put("zFontSize", zfontSize);
+// return TemplateUtils.renderTemplate(this.template(), renderMap);
+ if (PluginContexts.currentContext().isAvailable()) {
+ // 做认证通过的事情
+ return TemplateUtils.renderTemplate(this.template(), renderMap);
+ } else {
+ // 做认证未通过的事情
+ return "alert('未授权')";
+ }
+ }
+
+ public String mimeType() {
+ return "text/javascript";
+ }
+
+ public String template() {
+ return "/com/fr/plugin/theme/simple/web/theme.js";
+ }
+}
diff --git a/src/main/java/com/fr/plugin/theme/simple/ThemeConfig.java b/src/main/java/com/fr/plugin/theme/simple/ThemeConfig.java
new file mode 100644
index 0000000..d711ea5
--- /dev/null
+++ b/src/main/java/com/fr/plugin/theme/simple/ThemeConfig.java
@@ -0,0 +1,48 @@
+package com.fr.plugin.theme.simple;
+
+import com.fr.config.*;
+import com.fr.config.holder.Conf;
+import com.fr.config.holder.factory.Holders;
+
+@Visualization(category = "主题设置")
+public class ThemeConfig extends DefaultConfiguration {
+
+ private static volatile ThemeConfig config = null;
+
+ public static ThemeConfig getInstance() {
+ if (config == null) {
+ config = ConfigContext.getConfigInstance(ThemeConfig.class);
+ }
+ return config;
+ }
+
+ @Identifier(value = "fontSize", name = "字体大小(px)", description = "字体大小(px)", status = Status.SHOW)
+ private Conf fontSize = Holders.simple(16);
+ @Identifier(value = "zFontSize", name = "子菜单字体大小(px)", description = "子菜单字体大小(px)", status = Status.SHOW)
+ private Conf zFontSize = Holders.simple(14);
+
+ public Integer getzFontSize() {
+ return zFontSize.get();
+ }
+
+ public void setzFontSize(Integer zFontSize) {
+ this.zFontSize.set(zFontSize);
+ }
+
+ public Integer getFontSize() {
+ return fontSize.get();
+ }
+
+ public void setFontSize(Integer fontSize) {
+ this.fontSize.set(fontSize);
+ }
+
+ @Override
+ public Object clone() throws CloneNotSupportedException {
+ ThemeConfig cloned = (ThemeConfig) super.clone();
+ cloned.fontSize = (Conf) fontSize.clone();
+ cloned.zFontSize = (Conf) zFontSize.clone();
+ return cloned;
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/resources/com/fr/plugin/theme/simple/web/icon.png b/src/main/resources/com/fr/plugin/theme/simple/web/icon.png
new file mode 100644
index 0000000..f11e8cf
Binary files /dev/null and b/src/main/resources/com/fr/plugin/theme/simple/web/icon.png differ
diff --git a/src/main/resources/com/fr/plugin/theme/simple/web/images/ReportServer.jpg b/src/main/resources/com/fr/plugin/theme/simple/web/images/ReportServer.jpg
new file mode 100644
index 0000000..5d52ba9
Binary files /dev/null and b/src/main/resources/com/fr/plugin/theme/simple/web/images/ReportServer.jpg differ
diff --git a/src/main/resources/com/fr/plugin/theme/simple/web/images/backgroup.jpg b/src/main/resources/com/fr/plugin/theme/simple/web/images/backgroup.jpg
new file mode 100644
index 0000000..c2ba81a
Binary files /dev/null and b/src/main/resources/com/fr/plugin/theme/simple/web/images/backgroup.jpg differ
diff --git a/src/main/resources/com/fr/plugin/theme/simple/web/images/backgroup.png b/src/main/resources/com/fr/plugin/theme/simple/web/images/backgroup.png
new file mode 100644
index 0000000..f475cd4
Binary files /dev/null and b/src/main/resources/com/fr/plugin/theme/simple/web/images/backgroup.png differ
diff --git a/src/main/resources/com/fr/plugin/theme/simple/web/js/baseFun.js b/src/main/resources/com/fr/plugin/theme/simple/web/js/baseFun.js
new file mode 100644
index 0000000..f90ae09
--- /dev/null
+++ b/src/main/resources/com/fr/plugin/theme/simple/web/js/baseFun.js
@@ -0,0 +1,150 @@
+;
+
+function zxlresolvePath(path, isPublic) {
+ if (!path || path[0] !== '/') {
+ path = '/' + path;
+ }
+ return isPublic === true
+ ? '/plugin/public/com.fr.plugin.decision.theme.zxl.simple' + path
+ : '/plugin/private/com.fr.plugin.decision.theme.zxl.simple' + path;
+}
+
+function sortMenu(a, b) {
+ var value1 = a["sortIndex"];
+ var value2 = b["sortIndex"];
+ return value1 - value2;
+}
+
+function getImageUrl(name) {
+ return Dec.fineServletURL + "/resources?path=com/fr/plugin/theme/simple/web/images/" + name;
+}
+
+function showLayer(okCallBack, cancelCallBack) {
+ var id = BI.UUID();
+ var layer = BI.Layers.create(id, "body");
+ BI.createWidget({
+ type: "bi.absolute",
+ element: layer,
+ items: [
+ {
+ el: {
+ type: "bi.center_adapt",
+ items: [
+ {
+ type: "bi.center_adapt",
+ cls: "layer-backend",
+ width: 366,
+ height: 248,
+ items: [
+ {
+ type: "bi.vertical",
+ items: [
+ {
+ type: "bi.center_adapt",
+ items: [
+ {
+ type: "bi.img",
+ cls: "clear-fav-img",
+ src: getImageUrl("exclamationMark.jpg"),
+ width: 50,
+ height: 50
+ }
+ ]
+ },
+ {
+ type: "bi.label",
+ text: "确定清空全部收藏吗",
+ textAlign: "center",
+ cls: "layer-text"
+ },
+ {
+ type: "bi.vertical_adapt",
+ items: [
+ {
+ type: "bi.text_button",
+ cls: "layer-cancel-btn",
+ text: "取消",
+ handler: function () {
+ if (BI.isFunction(cancelCallBack)) {
+ cancelCallBack();
+ }
+ BI.Layers.hide(id)
+ }
+ },
+ {
+ type: "bi.text_button",
+ cls: "layer-ok-btn",
+ text: "确定",
+ handler: function () {
+ if (BI.isFunction(okCallBack)) {
+ okCallBack();
+ }
+ BI.Layers.hide(id)
+ }
+ }
+ ]
+ }
+ ]
+ }
+
+ ]
+ }
+ ],
+ ref: function (e) {
+ $(e.element).css("zIndex", 999999)
+ },
+ },
+ left: 0,
+ top: 0,
+ right: 0,
+ bottom: 0
+ },
+ {
+ el: {
+ type: "bi.center_adapt",
+ cls: "bi-z-index-mask",
+ width: "100%",
+ height: "100%",
+ }
+
+ }
+ ]
+ });
+ BI.Layers.show(id);
+}
+
+function openEntityCard(e) {
+ var t = "";
+ switch (e.entryType) {
+ case DecCst.Entries.Entry_Type.BI_REPORT:
+ t = Dec.fineServletURL + "/v10/entry/access/" + e.id + "?dashboardType=" + (BI.isNotNull(e.homePageType) ? "5" : "4");
+ break;
+ case DecCst.Entries.Entry_Type.SEARCH_SHARE:
+ t = Dec.fineServletURL + "/v5/design/report/" + e.id + "/view?entryType=6";
+ break;
+ case DecCst.Entries.Entry_Type.LINK_TYPE:
+ t = e.path || e.pcURL;
+ break;
+ default:
+ t = BI.isKey(e.id) ? Dec.fineServletURL + "/v10/entry/access/" + e.id + "?dashboardType=5" : "about:blank"
+ }
+ BI.Providers.getProvider("dec.provider.tab_pane").behaviour("addCardByName", e.id, {
+ text: e.text,
+ value: e.id,
+ entry: true,
+ cardType: {
+ src:t
+ }
+ })
+}
+
+function getMenuCoverUrl(id) {
+ if (id) {
+ if (id.indexOf("MapCache") !== -1) {
+ return Dec.fineServletURL + "/v10/attach/image/" + id
+ } else if (id.indexOf("entry_") !== -1) {
+ return Dec.fineServletURL + "/resources?path=/com/fr/web/resources/dist/resources/cover/" + id
+ }
+ }
+ return Dec.fineServletURL + "/resources?path=/com/fr/web/resources/dist/resources/cover/entry_cover1.png"
+}
diff --git a/src/main/resources/com/fr/plugin/theme/simple/web/js/customTree.js b/src/main/resources/com/fr/plugin/theme/simple/web/js/customTree.js
new file mode 100644
index 0000000..820e632
--- /dev/null
+++ b/src/main/resources/com/fr/plugin/theme/simple/web/js/customTree.js
@@ -0,0 +1,319 @@
+;
+
+/**
+ * menu item popup
+ */
+!(function () {
+ var Widget = BI.inherit(BI.Widget, {
+
+ props: {
+ baseCls: "zxl-sidle-popup",
+ width: 228,
+ height: "100%"
+ },
+ hasChild: function (menuId) {
+ return this.getChildMenu(menuId).length > 0
+ },
+ getChildMenu: function (menuId) {
+ var items = [];
+ BI.each(this.store.getAllMenu(), function (i, v) {
+ if (v.pId === menuId) {
+ items.push(v);
+ }
+ return true;
+ });
+ return items.sort(sortMenu);
+ },
+ _store: function () {
+ return BI.Models.getModel("dec.model.zxl.menus")
+ },
+ beforeInit: function (render) {
+ this.store.initMenu(render);
+ },
+ _getSystemMenu: function () {
+ var navs = BI.Constants.getConstant("dec.constant.management.navigation");
+ var temp = BI.filter(Dec.decisionModules, function (i, v) {
+ return v.id !== "decision-management-root" && v.id !== "decision-management-maintenance-bi-notification" && BI.find(navs, function (ii, vv) {
+ return v.id === vv.id;
+ })
+ });
+ var managementModules = BI.map(temp, function (i, v) {
+ return BI.find(navs, function (ii, vv) {
+ return v.id === vv.id;
+ })
+ });
+ return BI.map(managementModules, function (i, v) {
+ return {
+ text: v.text,
+ icon: v.cls,
+ id:v.id,
+ item:v,
+ cls: "header-item",
+ handler: function () {
+ var find = BI.find(Dec.decisionModules, function (i, vv) {
+ return v.id === vv.id
+ });
+ if (find) {
+ BI.Services.getService("dec.service.tabs").addItem(v.item);
+ } else {
+ openEntityCard(v);
+ }
+ }
+ }
+ });
+ },
+ render: function () {
+ var that = this;
+ var items = this.options.items;
+ var allMenu = this.store.getAllMenu();
+ var temps = BI.map(items, function (i, v) {
+ if (v.text === "管理系统") {
+ var tps = that._getSystemMenu();
+ return {
+ type: "zxl.tree.expander",
+ text: v.text,
+ icon: v.icon,
+ width: 233,
+ item: v,
+ items: tps
+ }
+ }
+ if (v.entryType === 3) {
+ return {
+ type: "zxl.tree.expander",
+ text: v.text,
+ item: v,
+ icon: v.icon ? v.icon : "dir-panel-folder-font",
+ width: 233,
+ allMenu: allMenu,
+ items: that.getChildMenu(v.id)
+ }
+ }
+ return {
+ type: "zxl.tree.node",
+ text: v.text,
+ item: v,
+ icon: v.icon ? v.icon : "dir-panel-template-font",
+ height: 48
+ }
+ });
+ return {
+ width: 228,
+ type: "bi.vertical",
+ height: "100%",
+ items: temps
+ };
+ }
+ });
+ BI.shortcut("zxl.header.menu.extItem.popup", Widget);
+}());
+!(function () {
+ var Node = BI.inherit(BI.BasicButton, {
+ props: {
+ baseCls: "zxl-tree",
+ items: [],
+ open: false,
+ height: "auto",
+ width: "100%"
+ },
+ getChildMenu: function (menuId) {
+ var items = [];
+ BI.each(this.options.allMenu, function (i, v) {
+ if (v.pId === menuId) {
+ items.push(v);
+ }
+ return true;
+ });
+ return items.sort(sortMenu);
+ },
+ render: function () {
+ var self = this, o = this.options, allMenu = this.options.allMenu;
+ var trigger = {
+ type: "zxl.tree.node",
+ text: o.text,
+ height: 42,
+ item: o.item,
+ open: o.open,
+ icon: o.icon,
+ listeners: [
+ {
+ eventName: "EVENT_EXPAND",
+ action: function () {
+ self.showView();
+ }
+ }, {
+ eventName: "EVENT_COLLAPSE",
+ action: function () {
+ self.popuop.setVisible(false);
+ }
+ }
+ ]
+ };
+
+ var items = BI.map(o.items, function (i, v) {
+ if (v.entryType === 3) {
+ return {
+ type: "zxl.tree.expander",
+ width: 233,
+ item: v,
+ text: v.text,
+ icon: v.icon ? v.icon : "dir-panel-folder-font",
+ allMenu: allMenu,
+ items: self.getChildMenu(v.id)
+ }
+ }
+ return {
+ type: "zxl.tree.node",
+ item: v,
+ text:v.text,
+ icon: v.icon ? v.icon : "dir-panel-template-font",
+ height: 48,
+ handler: function () {
+ var find = BI.find(Dec.decisionModules, function (i, vv) {
+ return v.id === vv.id
+ });
+ if (find) {
+ BI.Services.getService("dec.service.tabs").addItem(v.item);
+ } else {
+ openEntityCard(v);
+ }
+ }
+ }
+ });
+ return {
+ type: "bi.vertical",
+ items: [
+ {
+ el: trigger
+ }, {
+ el: {
+ type: "bi.button_group",
+ cls: "demo-sidebar-expander-popup",
+ layouts: [
+ {
+ type: "bi.vertical"
+ }
+ ],
+ ref: function (_ref) {
+ self.popuop = _ref;
+ },
+ invisible: !o.open,
+ items: items
+ }
+ }
+ ]
+
+ };
+ },
+ showView: function () {
+ var self = this, o = this.options;
+ if (BI.isEmptyArray(o.items)) {
+ Dec.Utils.getWorkbenchSubDirectoryById(o.id, function (res) {
+ o.items = BI.map(res.data, function (index, item) {
+ var temp = BI.extend({
+ type: "demo.sidebar.item",
+ }, item);
+ return {
+ type: "bi.center_adapt",
+ cls: "item-line",
+ items: [
+ temp
+ ]
+ }
+ });
+ self.popuop.populate(o.items);
+ self.popuop.setVisible(true);
+ });
+ } else {
+ self.popuop.setVisible(true);
+ }
+ }
+ });
+ BI.shortcut("zxl.tree.expander", Node);
+}());
+
+
+!(function () {
+ var Node = BI.inherit(BI.NodeButton, {
+
+ props: {
+ baseCls: "zxl-tree-node",
+ id: "",
+ pId: "",
+ open: false,
+ height: 50,
+ iconCls: "dir-panel-folder-font"
+ },
+
+ render: function () {
+
+ var self = this, o = this.options;
+ var text = this.options.text;
+ var icon = this.options.icon;
+ var items = [];
+
+ items.push({
+ el: {
+ type: "bi.icon_button",
+ cls: icon,
+ ref: function (e) {
+ self.iconBtn = e;
+ }
+ },
+ width: 30
+ });
+
+ items.push({
+ el: {
+ type: "bi.label",
+ textAlign: "left",
+ cls: "menu-text",
+ text: o.text,
+ title: o.text
+ },
+ height: o.height
+ });
+ var cls="zxl-tree-node";
+ if (o.item.entryType === 3 || o.item.text === "管理系统") {
+ cls="zxl-tree-menu";
+ items.push({
+ el: {
+ type: "bi.icon_button",
+ cls: "arraw-down-font",
+ ref: function (e) {
+ self.arraiconBtn = e;
+ }
+ },
+ width: 30
+ });
+ }
+
+ return {
+ type: "bi.htape",
+ cls:cls,
+ items: items
+ };
+ },
+
+ isOnce: function () {
+ return false;
+ },
+
+ getValue: function () {
+ return this.options.id;
+ },
+ setOpened: function (v) {
+ Node.superclass.setOpened.apply(this, arguments);
+ this.fireEvent(v ? "EVENT_EXPAND" : "EVENT_COLLAPSE");
+ if (this.arraiconBtn) {
+ if (v) {
+ $(this.arraiconBtn.element).addClass("arraw-up-font").removeClass("arraw-down-font")
+ } else {
+ $(this.arraiconBtn.element).addClass("arraw-down-font").removeClass("arraw-up-font")
+ }
+ }
+ }
+ });
+
+ BI.shortcut("zxl.tree.node", Node);
+}());
diff --git a/src/main/resources/com/fr/plugin/theme/simple/web/js/jquery.nicescroll.min.js b/src/main/resources/com/fr/plugin/theme/simple/web/js/jquery.nicescroll.min.js
new file mode 100644
index 0000000..5fc24bc
--- /dev/null
+++ b/src/main/resources/com/fr/plugin/theme/simple/web/js/jquery.nicescroll.min.js
@@ -0,0 +1,120 @@
+/* jquery.nicescroll 3.6.8 InuYaksa*2015 MIT http://nicescroll.areaaperta.com */(function(f){"function"===typeof define&&define.amd?define(["jquery"],f):"object"===typeof exports?module.exports=f(require("jquery")):f(jQuery)})(function(f){var B=!1,F=!1,O=0,P=2E3,A=0,J=["webkit","ms","moz","o"],v=window.requestAnimationFrame||!1,w=window.cancelAnimationFrame||!1;if(!v)for(var Q in J){var G=J[Q];if(v=window[G+"RequestAnimationFrame"]){w=window[G+"CancelAnimationFrame"]||window[G+"CancelRequestAnimationFrame"];break}}var x=window.MutationObserver||window.WebKitMutationObserver||
+!1,K={zindex:"auto",cursoropacitymin:0,cursoropacitymax:1,cursorcolor:"#424242",cursorwidth:"6px",cursorborder:"1px solid #fff",cursorborderradius:"5px",scrollspeed:60,mousescrollstep:24,touchbehavior:!1,hwacceleration:!0,usetransition:!0,boxzoom:!1,dblclickzoom:!0,gesturezoom:!0,grabcursorenabled:!0,autohidemode:!0,background:"",iframeautoresize:!0,cursorminheight:32,preservenativescrolling:!0,railoffset:!1,railhoffset:!1,bouncescroll:!0,spacebarenabled:!0,railpadding:{top:0,right:0,left:0,bottom:0},
+disableoutline:!0,horizrailenabled:!0,railalign:"right",railvalign:"bottom",enabletranslate3d:!0,enablemousewheel:!0,enablekeyboard:!0,smoothscroll:!0,sensitiverail:!0,enablemouselockapi:!0,cursorfixedheight:!1,directionlockdeadzone:6,hidecursordelay:400,nativeparentscrolling:!0,enablescrollonselection:!0,overflowx:!0,overflowy:!0,cursordragspeed:.3,rtlmode:"auto",cursordragontouch:!1,oneaxismousemode:"auto",scriptpath:function(){var f=document.getElementsByTagName("script"),f=f.length?f[f.length-
+1].src.split("?")[0]:"";return 0d?a.getScrollLeft()>=a.page.maxw:0>=a.getScrollLeft())&&(e=d,d=0));a.isrtlmode&&(d=-d);d&&(a.scrollmom&&a.scrollmom.stop(),a.lastdeltax+=d,a.debounced("mousewheelx",function(){var b=a.lastdeltax;a.lastdeltax=0;a.rail.drag||a.doScrollLeftBy(b)},15));if(e){if(a.opt.nativeparentscrolling&&c&&!a.ispage&&!a.zoomactive)if(0>e){if(a.getScrollTop()>=a.page.maxh)return!0}else if(0>=a.getScrollTop())return!0;a.scrollmom&&a.scrollmom.stop();a.lastdeltay+=e;
+a.synched("mousewheely",function(){var b=a.lastdeltay;a.lastdeltay=0;a.rail.drag||a.doScrollBy(b)},15)}b.stopImmediatePropagation();return b.preventDefault()}var a=this;this.version="3.6.8";this.name="nicescroll";this.me=c;this.opt={doc:f("body"),win:!1};f.extend(this.opt,K);this.opt.snapbackspeed=80;if(h)for(var r in a.opt)void 0!==h[r]&&(a.opt[r]=h[r]);a.opt.disablemutationobserver&&(x=!1);this.iddoc=(this.doc=a.opt.doc)&&this.doc[0]?this.doc[0].id||"":"";this.ispage=/^BODY|HTML/.test(a.opt.win?
+a.opt.win[0].nodeName:this.doc[0].nodeName);this.haswrapper=!1!==a.opt.win;this.win=a.opt.win||(this.ispage?f(window):this.doc);this.docscroll=this.ispage&&!this.haswrapper?f(window):this.win;this.body=f("body");this.iframe=this.isfixed=this.viewport=!1;this.isiframe="IFRAME"==this.doc[0].nodeName&&"IFRAME"==this.win[0].nodeName;this.istextarea="TEXTAREA"==this.win[0].nodeName;this.forcescreen=!1;this.canshowonmouseevent="scroll"!=a.opt.autohidemode;this.page=this.view=this.onzoomout=this.onzoomin=
+this.onscrollcancel=this.onscrollend=this.onscrollstart=this.onclick=this.ongesturezoom=this.onkeypress=this.onmousewheel=this.onmousemove=this.onmouseup=this.onmousedown=!1;this.scroll={x:0,y:0};this.scrollratio={x:0,y:0};this.cursorheight=20;this.scrollvaluemax=0;if("auto"==this.opt.rtlmode){r=this.win[0]==window?this.body:this.win;var p=r.css("writing-mode")||r.css("-webkit-writing-mode")||r.css("-ms-writing-mode")||r.css("-moz-writing-mode");"horizontal-tb"==p||"lr-tb"==p||""==p?(this.isrtlmode=
+"rtl"==r.css("direction"),this.isvertical=!1):(this.isrtlmode="vertical-rl"==p||"tb"==p||"tb-rl"==p||"rl-tb"==p,this.isvertical="vertical-rl"==p||"tb"==p||"tb-rl"==p)}else this.isrtlmode=!0===this.opt.rtlmode,this.isvertical=!1;this.observerbody=this.observerremover=this.observer=this.scrollmom=this.scrollrunning=!1;do this.id="ascrail"+P++;while(document.getElementById(this.id));this.hasmousefocus=this.hasfocus=this.zoomactive=this.zoom=this.selectiondrag=this.cursorfreezed=this.cursor=this.rail=
+!1;this.visibility=!0;this.hidden=this.locked=this.railslocked=!1;this.cursoractive=!0;this.wheelprevented=!1;this.overflowx=a.opt.overflowx;this.overflowy=a.opt.overflowy;this.nativescrollingarea=!1;this.checkarea=0;this.events=[];this.saved={};this.delaylist={};this.synclist={};this.lastdeltay=this.lastdeltax=0;this.detected=R();var e=f.extend({},this.detected);this.ishwscroll=(this.canhwscroll=e.hastransform&&a.opt.hwacceleration)&&a.haswrapper;this.hasreversehr=this.isrtlmode?this.isvertical?
+!(e.iswebkit||e.isie||e.isie11):!(e.iswebkit||e.isie&&!e.isie10&&!e.isie11):!1;this.istouchcapable=!1;e.cantouch||!e.hasw3ctouch&&!e.hasmstouch?!e.cantouch||e.isios||e.isandroid||!e.iswebkit&&!e.ismozilla||(this.istouchcapable=!0):this.istouchcapable=!0;a.opt.enablemouselockapi||(e.hasmousecapture=!1,e.haspointerlock=!1);this.debounced=function(b,g,c){a&&(a.delaylist[b]||(g.call(a),a.delaylist[b]={h:v(function(){a.delaylist[b].fn.call(a);a.delaylist[b]=!1},c)}),a.delaylist[b].fn=g)};var I=!1;this.synched=
+function(b,g){a.synclist[b]=g;(function(){I||(v(function(){if(a){I=!1;for(var b in a.synclist){var g=a.synclist[b];g&&g.call(a);a.synclist[b]=!1}}}),I=!0)})();return b};this.unsynched=function(b){a.synclist[b]&&(a.synclist[b]=!1)};this.css=function(b,g){for(var c in g)a.saved.css.push([b,c,b.css(c)]),b.css(c,g[c])};this.scrollTop=function(b){return void 0===b?a.getScrollTop():a.setScrollTop(b)};this.scrollLeft=function(b){return void 0===b?a.getScrollLeft():a.setScrollLeft(b)};var D=function(a,g,
+c,d,e,f,k){this.st=a;this.ed=g;this.spd=c;this.p1=d||0;this.p2=e||1;this.p3=f||0;this.p4=k||1;this.ts=(new Date).getTime();this.df=this.ed-this.st};D.prototype={B2:function(a){return 3*a*a*(1-a)},B3:function(a){return 3*a*(1-a)*(1-a)},B4:function(a){return(1-a)*(1-a)*(1-a)},getNow:function(){var a=1-((new Date).getTime()-this.ts)/this.spd,g=this.B2(a)+this.B3(a)+this.B4(a);return 0>a?this.ed:this.st+Math.round(this.df*g)},update:function(a,g){this.st=this.getNow();this.ed=a;this.spd=g;this.ts=(new Date).getTime();
+this.df=this.ed-this.st;return this}};if(this.ishwscroll){this.doc.translate={x:0,y:0,tx:"0px",ty:"0px"};e.hastranslate3d&&e.isios&&this.doc.css("-webkit-backface-visibility","hidden");this.getScrollTop=function(b){if(!b){if(b=k())return 16==b.length?-b[13]:-b[5];if(a.timerscroll&&a.timerscroll.bz)return a.timerscroll.bz.getNow()}return a.doc.translate.y};this.getScrollLeft=function(b){if(!b){if(b=k())return 16==b.length?-b[12]:-b[4];if(a.timerscroll&&a.timerscroll.bh)return a.timerscroll.bh.getNow()}return a.doc.translate.x};
+this.notifyScrollEvent=function(a){var g=document.createEvent("UIEvents");g.initUIEvent("scroll",!1,!0,window,1);g.niceevent=!0;a.dispatchEvent(g)};var y=this.isrtlmode?1:-1;e.hastranslate3d&&a.opt.enabletranslate3d?(this.setScrollTop=function(b,g){a.doc.translate.y=b;a.doc.translate.ty=-1*b+"px";a.doc.css(e.trstyle,"translate3d("+a.doc.translate.tx+","+a.doc.translate.ty+",0px)");g||a.notifyScrollEvent(a.win[0])},this.setScrollLeft=function(b,g){a.doc.translate.x=b;a.doc.translate.tx=b*y+"px";a.doc.css(e.trstyle,
+"translate3d("+a.doc.translate.tx+","+a.doc.translate.ty+",0px)");g||a.notifyScrollEvent(a.win[0])}):(this.setScrollTop=function(b,g){a.doc.translate.y=b;a.doc.translate.ty=-1*b+"px";a.doc.css(e.trstyle,"translate("+a.doc.translate.tx+","+a.doc.translate.ty+")");g||a.notifyScrollEvent(a.win[0])},this.setScrollLeft=function(b,g){a.doc.translate.x=b;a.doc.translate.tx=b*y+"px";a.doc.css(e.trstyle,"translate("+a.doc.translate.tx+","+a.doc.translate.ty+")");g||a.notifyScrollEvent(a.win[0])})}else this.getScrollTop=
+function(){return a.docscroll.scrollTop()},this.setScrollTop=function(b){return setTimeout(function(){a&&a.docscroll.scrollTop(b)},1)},this.getScrollLeft=function(){return a.hasreversehr?a.detected.ismozilla?a.page.maxw-Math.abs(a.docscroll.scrollLeft()):a.page.maxw-a.docscroll.scrollLeft():a.docscroll.scrollLeft()},this.setScrollLeft=function(b){return setTimeout(function(){if(a)return a.hasreversehr&&(b=a.detected.ismozilla?-(a.page.maxw-b):a.page.maxw-b),a.docscroll.scrollLeft(b)},1)};this.getTarget=
+function(a){return a?a.target?a.target:a.srcElement?a.srcElement:!1:!1};this.hasParent=function(a,g){if(!a)return!1;for(var c=a.target||a.srcElement||a||!1;c&&c.id!=g;)c=c.parentNode||!1;return!1!==c};var z={thin:1,medium:3,thick:5};this.getDocumentScrollOffset=function(){return{top:window.pageYOffset||document.documentElement.scrollTop,left:window.pageXOffset||document.documentElement.scrollLeft}};this.getOffset=function(){if(a.isfixed){var b=a.win.offset(),g=a.getDocumentScrollOffset();b.top-=g.top;
+b.left-=g.left;return b}b=a.win.offset();if(!a.viewport)return b;g=a.viewport.offset();return{top:b.top-g.top,left:b.left-g.left}};this.updateScrollBar=function(b){var g,c,e;if(a.ishwscroll)a.rail.css({height:a.win.innerHeight()-(a.opt.railpadding.top+a.opt.railpadding.bottom)}),a.railh&&a.railh.css({width:a.win.innerWidth()-(a.opt.railpadding.left+a.opt.railpadding.right)});else{var f=a.getOffset();g=f.top;c=f.left-(a.opt.railpadding.left+a.opt.railpadding.right);g+=d(a.win,"border-top-width",!0);
+c+=a.rail.align?a.win.outerWidth()-d(a.win,"border-right-width")-a.rail.width:d(a.win,"border-left-width");if(e=a.opt.railoffset)e.top&&(g+=e.top),e.left&&(c+=e.left);a.railslocked||a.rail.css({top:g,left:c,height:(b?b.h:a.win.innerHeight())-(a.opt.railpadding.top+a.opt.railpadding.bottom)});a.zoom&&a.zoom.css({top:g+1,left:1==a.rail.align?c-20:c+a.rail.width+4});if(a.railh&&!a.railslocked){g=f.top;c=f.left;if(e=a.opt.railhoffset)e.top&&(g+=e.top),e.left&&(c+=e.left);b=a.railh.align?g+d(a.win,"border-top-width",
+!0)+a.win.innerHeight()-a.railh.height:g+d(a.win,"border-top-width",!0);c+=d(a.win,"border-left-width");a.railh.css({top:b-(a.opt.railpadding.top+a.opt.railpadding.bottom),left:c,width:a.railh.width})}}};this.doRailClick=function(b,g,c){var d;a.railslocked||(a.cancelEvent(b),g?(g=c?a.doScrollLeft:a.doScrollTop,d=c?(b.pageX-a.railh.offset().left-a.cursorwidth/2)*a.scrollratio.x:(b.pageY-a.rail.offset().top-a.cursorheight/2)*a.scrollratio.y,g(d)):(g=c?a.doScrollLeftBy:a.doScrollBy,d=c?a.scroll.x:a.scroll.y,
+b=c?b.pageX-a.railh.offset().left:b.pageY-a.rail.offset().top,c=c?a.view.w:a.view.h,g(d>=b?c:-c)))};a.hasanimationframe=v;a.hascancelanimationframe=w;a.hasanimationframe?a.hascancelanimationframe||(w=function(){a.cancelAnimationFrame=!0}):(v=function(a){return setTimeout(a,15-Math.floor(+new Date/1E3)%16)},w=clearTimeout);this.init=function(){a.saved.css=[];if(e.isie7mobile||e.isoperamini)return!0;e.hasmstouch&&a.css(a.ispage?f("html"):a.win,{_touchaction:"none"});var b=e.ismodernie||e.isie10?{"-ms-overflow-style":"none"}:
+{"overflow-y":"hidden"};a.zindex="auto";a.zindex=a.ispage||"auto"!=a.opt.zindex?a.opt.zindex:l()||"auto";!a.ispage&&"auto"!=a.zindex&&a.zindex>A&&(A=a.zindex);a.isie&&0==a.zindex&&"auto"==a.opt.zindex&&(a.zindex="auto");if(!a.ispage||!e.cantouch&&!e.isieold&&!e.isie9mobile){var c=a.docscroll;a.ispage&&(c=a.haswrapper?a.win:a.doc);e.isie9mobile||a.css(c,b);a.ispage&&e.isie7&&("BODY"==a.doc[0].nodeName?a.css(f("html"),{"overflow-y":"hidden"}):"HTML"==a.doc[0].nodeName&&a.css(f("body"),b));!e.isios||
+a.ispage||a.haswrapper||a.css(f("body"),{"-webkit-overflow-scrolling":"touch"});var d=f(document.createElement("div"));d.css({position:"relative",top:0,"float":"right",width:a.opt.cursorwidth,height:0,"background-color":a.opt.cursorcolor,border:a.opt.cursorborder,"background-clip":"padding-box","-webkit-border-radius":a.opt.cursorborderradius,"-moz-border-radius":a.opt.cursorborderradius,"border-radius":a.opt.cursorborderradius});d.hborder=parseFloat(d.outerHeight()-d.innerHeight());d.addClass("nicescroll-cursors");
+a.cursor=d;var m=f(document.createElement("div"));m.attr("id",a.id);m.addClass("nicescroll-rails nicescroll-rails-vr");var k,h,p=["left","right","top","bottom"],L;for(L in p)h=p[L],(k=a.opt.railpadding[h])?m.css("padding-"+h,k+"px"):a.opt.railpadding[h]=0;m.append(d);m.width=Math.max(parseFloat(a.opt.cursorwidth),d.outerWidth());m.css({width:m.width+"px",zIndex:a.zindex,background:a.opt.background,cursor:"default"});m.visibility=!0;m.scrollable=!0;m.align="left"==a.opt.railalign?0:1;a.rail=m;d=a.rail.drag=
+!1;!a.opt.boxzoom||a.ispage||e.isieold||(d=document.createElement("div"),a.bind(d,"click",a.doZoom),a.bind(d,"mouseenter",function(){a.zoom.css("opacity",a.opt.cursoropacitymax)}),a.bind(d,"mouseleave",function(){a.zoom.css("opacity",a.opt.cursoropacitymin)}),a.zoom=f(d),a.zoom.css({cursor:"pointer",zIndex:a.zindex,backgroundImage:"url("+a.opt.scriptpath+"zoomico.png)",height:18,width:18,backgroundPosition:"0px 0px"}),a.opt.dblclickzoom&&a.bind(a.win,"dblclick",a.doZoom),e.cantouch&&a.opt.gesturezoom&&
+(a.ongesturezoom=function(b){1.5b.scale&&a.doZoomOut(b);return a.cancelEvent(b)},a.bind(a.win,"gestureend",a.ongesturezoom)));a.railh=!1;var n;a.opt.horizrailenabled&&(a.css(c,{overflowX:"hidden"}),d=f(document.createElement("div")),d.css({position:"absolute",top:0,height:a.opt.cursorwidth,width:0,backgroundColor:a.opt.cursorcolor,border:a.opt.cursorborder,backgroundClip:"padding-box","-webkit-border-radius":a.opt.cursorborderradius,"-moz-border-radius":a.opt.cursorborderradius,
+"border-radius":a.opt.cursorborderradius}),e.isieold&&d.css("overflow","hidden"),d.wborder=parseFloat(d.outerWidth()-d.innerWidth()),d.addClass("nicescroll-cursors"),a.cursorh=d,n=f(document.createElement("div")),n.attr("id",a.id+"-hr"),n.addClass("nicescroll-rails nicescroll-rails-hr"),n.height=Math.max(parseFloat(a.opt.cursorwidth),d.outerHeight()),n.css({height:n.height+"px",zIndex:a.zindex,background:a.opt.background}),n.append(d),n.visibility=!0,n.scrollable=!0,n.align="top"==a.opt.railvalign?
+0:1,a.railh=n,a.railh.drag=!1);a.ispage?(m.css({position:"fixed",top:0,height:"100%"}),m.align?m.css({right:0}):m.css({left:0}),a.body.append(m),a.railh&&(n.css({position:"fixed",left:0,width:"100%"}),n.align?n.css({bottom:0}):n.css({top:0}),a.body.append(n))):(a.ishwscroll?("static"==a.win.css("position")&&a.css(a.win,{position:"relative"}),c="HTML"==a.win[0].nodeName?a.body:a.win,f(c).scrollTop(0).scrollLeft(0),a.zoom&&(a.zoom.css({position:"absolute",top:1,right:0,"margin-right":m.width+4}),c.append(a.zoom)),
+m.css({position:"absolute",top:0}),m.align?m.css({right:0}):m.css({left:0}),c.append(m),n&&(n.css({position:"absolute",left:0,bottom:0}),n.align?n.css({bottom:0}):n.css({top:0}),c.append(n))):(a.isfixed="fixed"==a.win.css("position"),c=a.isfixed?"fixed":"absolute",a.isfixed||(a.viewport=a.getViewport(a.win[0])),a.viewport&&(a.body=a.viewport,0==/fixed|absolute/.test(a.viewport.css("position"))&&a.css(a.viewport,{position:"relative"})),m.css({position:c}),a.zoom&&a.zoom.css({position:c}),a.updateScrollBar(),
+a.body.append(m),a.zoom&&a.body.append(a.zoom),a.railh&&(n.css({position:c}),a.body.append(n))),e.isios&&a.css(a.win,{"-webkit-tap-highlight-color":"rgba(0,0,0,0)","-webkit-touch-callout":"none"}),e.isie&&a.opt.disableoutline&&a.win.attr("hideFocus","true"),e.iswebkit&&a.opt.disableoutline&&a.win.css("outline","none"));!1===a.opt.autohidemode?(a.autohidedom=!1,a.rail.css({opacity:a.opt.cursoropacitymax}),a.railh&&a.railh.css({opacity:a.opt.cursoropacitymax})):!0===a.opt.autohidemode||"leave"===a.opt.autohidemode?
+(a.autohidedom=f().add(a.rail),e.isie8&&(a.autohidedom=a.autohidedom.add(a.cursor)),a.railh&&(a.autohidedom=a.autohidedom.add(a.railh)),a.railh&&e.isie8&&(a.autohidedom=a.autohidedom.add(a.cursorh))):"scroll"==a.opt.autohidemode?(a.autohidedom=f().add(a.rail),a.railh&&(a.autohidedom=a.autohidedom.add(a.railh))):"cursor"==a.opt.autohidemode?(a.autohidedom=f().add(a.cursor),a.railh&&(a.autohidedom=a.autohidedom.add(a.cursorh))):"hidden"==a.opt.autohidemode&&(a.autohidedom=!1,a.hide(),a.railslocked=
+!1);if(e.isie9mobile)a.scrollmom=new M(a),a.onmangotouch=function(){var b=a.getScrollTop(),c=a.getScrollLeft();if(b==a.scrollmom.lastscrolly&&c==a.scrollmom.lastscrollx)return!0;var g=b-a.mangotouch.sy,d=c-a.mangotouch.sx;if(0!=Math.round(Math.sqrt(Math.pow(d,2)+Math.pow(g,2)))){var e=0>g?-1:1,f=0>d?-1:1,u=+new Date;a.mangotouch.lazy&&clearTimeout(a.mangotouch.lazy);80h?h=Math.round(h/2):h>a.page.maxh&&(h=a.page.maxh+Math.round((h-a.page.maxh)/2)):(0>h&&(u=h=0),h>a.page.maxh&&(h=a.page.maxh,u=0));var l;a.railh&&a.railh.scrollable&&(l=a.isrtlmode?k-a.rail.drag.sl:a.rail.drag.sl-k,a.ishwscroll&&a.opt.bouncescroll?0>l?l=Math.round(l/2):l>a.page.maxw&&(l=a.page.maxw+Math.round((l-a.page.maxw)/
+2)):(0>l&&(m=l=0),l>a.page.maxw&&(l=a.page.maxw,m=0)));g=!1;if(a.rail.drag.dl)g=!0,"v"==a.rail.drag.dl?l=a.rail.drag.sl:"h"==a.rail.drag.dl&&(h=a.rail.drag.st);else{d=Math.abs(d);var k=Math.abs(k),C=a.opt.directionlockdeadzone;if("v"==a.rail.drag.ck){if(d>C&&k<=.3*d)return a.rail.drag=!1,!0;k>C&&(a.rail.drag.dl="f",f("body").scrollTop(f("body").scrollTop()))}else if("h"==a.rail.drag.ck){if(k>C&&d<=.3*k)return a.rail.drag=!1,!0;d>C&&(a.rail.drag.dl="f",f("body").scrollLeft(f("body").scrollLeft()))}}a.synched("touchmove",
+function(){a.rail.drag&&2==a.rail.drag.pt&&(a.prepareTransition&&a.prepareTransition(0),a.rail.scrollable&&a.setScrollTop(h),a.scrollmom.update(m,u),a.railh&&a.railh.scrollable?(a.setScrollLeft(l),a.showCursor(h,l)):a.showCursor(h),e.isie10&&document.selection.clear())});e.ischrome&&a.istouchcapable&&(g=!1);if(g)return a.cancelEvent(b)}else if(1==a.rail.drag.pt)return a.onmousemove(b)}}a.onmousedown=function(b,c){if(!a.rail.drag||1==a.rail.drag.pt){if(a.railslocked)return a.cancelEvent(b);a.cancelScroll();
+a.rail.drag={x:b.clientX,y:b.clientY,sx:a.scroll.x,sy:a.scroll.y,pt:1,hr:!!c};var g=a.getTarget(b);!a.ispage&&e.hasmousecapture&&g.setCapture();a.isiframe&&!e.hasmousecapture&&(a.saved.csspointerevents=a.doc.css("pointer-events"),a.css(a.doc,{"pointer-events":"none"}));a.hasmoving=!1;return a.cancelEvent(b)}};a.onmouseup=function(b){if(a.rail.drag){if(1!=a.rail.drag.pt)return!0;e.hasmousecapture&&document.releaseCapture();a.isiframe&&!e.hasmousecapture&&a.doc.css("pointer-events",a.saved.csspointerevents);
+a.rail.drag=!1;a.hasmoving&&a.triggerScrollEnd();return a.cancelEvent(b)}};a.onmousemove=function(b){if(a.rail.drag){if(1==a.rail.drag.pt){if(e.ischrome&&0==b.which)return a.onmouseup(b);a.cursorfreezed=!0;a.hasmoving=!0;if(a.rail.drag.hr){a.scroll.x=a.rail.drag.sx+(b.clientX-a.rail.drag.x);0>a.scroll.x&&(a.scroll.x=0);var c=a.scrollvaluemaxw;a.scroll.x>c&&(a.scroll.x=c)}else a.scroll.y=a.rail.drag.sy+(b.clientY-a.rail.drag.y),0>a.scroll.y&&(a.scroll.y=0),c=a.scrollvaluemax,a.scroll.y>c&&(a.scroll.y=
+c);a.synched("mousemove",function(){a.rail.drag&&1==a.rail.drag.pt&&(a.showCursor(),a.rail.drag.hr?a.hasreversehr?a.doScrollLeft(a.scrollvaluemaxw-Math.round(a.scroll.x*a.scrollratio.x),a.opt.cursordragspeed):a.doScrollLeft(Math.round(a.scroll.x*a.scrollratio.x),a.opt.cursordragspeed):a.doScrollTop(Math.round(a.scroll.y*a.scrollratio.y),a.opt.cursordragspeed))});return a.cancelEvent(b)}}else a.checkarea=0};if(e.cantouch||a.opt.touchbehavior)a.onpreventclick=function(b){if(a.preventclick)return a.preventclick.tg.onclick=
+a.preventclick.click,a.preventclick=!1,a.cancelEvent(b)},a.bind(a.win,"mousedown",a.ontouchstart),a.onclick=e.isios?!1:function(b){return a.lastmouseup?(a.lastmouseup=!1,a.cancelEvent(b)):!0},a.opt.grabcursorenabled&&e.cursorgrabvalue&&(a.css(a.ispage?a.doc:a.win,{cursor:e.cursorgrabvalue}),a.css(a.rail,{cursor:e.cursorgrabvalue}));else{var r=function(b){if(a.selectiondrag){if(b){var c=a.win.outerHeight();b=b.pageY-a.selectiondrag.top;0=c&&(b-=c);a.selectiondrag.df=b}0!=a.selectiondrag.df&&
+(a.doScrollBy(2*-Math.floor(a.selectiondrag.df/6)),a.debounced("doselectionscroll",function(){r()},50))}};a.hasTextSelected="getSelection"in document?function(){return 0a.page.maxh?a.doScrollTop(a.page.maxh):(a.scroll.y=Math.round(a.getScrollTop()*
+(1/a.scrollratio.y)),a.scroll.x=Math.round(a.getScrollLeft()*(1/a.scrollratio.x)),a.cursoractive&&a.noticeCursor());a.scroll.y&&0==a.getScrollTop()&&a.doScrollTo(Math.floor(a.scroll.y*a.scrollratio.y));return a};this.resize=a.onResize;this.hlazyresize=0;this.lazyResize=function(b){a.haswrapper||a.hide();a.hlazyresize&&clearTimeout(a.hlazyresize);a.hlazyresize=setTimeout(function(){a&&a.show().resize()},240);return a};this.jqbind=function(b,c,d){a.events.push({e:b,n:c,f:d,q:!0});f(b).bind(c,d)};this.mousewheel=
+function(b,c,d){b="jquery"in b?b[0]:b;if("onwheel"in document.createElement("div"))a._bind(b,"wheel",c,d||!1);else{var e=void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll";q(b,e,c,d||!1);"DOMMouseScroll"==e&&q(b,"MozMousePixelScroll",c,d||!1)}};e.haseventlistener?(this.bind=function(b,c,d,e){a._bind("jquery"in b?b[0]:b,c,d,e||!1)},this._bind=function(b,c,d,e){a.events.push({e:b,n:c,f:d,b:e,q:!1});b.addEventListener(c,d,e||!1)},this.cancelEvent=function(a){if(!a)return!1;a=a.original?a.original:
+a;a.cancelable&&a.preventDefault();a.stopPropagation();a.preventManipulation&&a.preventManipulation();return!1},this.stopPropagation=function(a){if(!a)return!1;a=a.original?a.original:a;a.stopPropagation();return!1},this._unbind=function(a,c,d,e){a.removeEventListener(c,d,e)}):(this.bind=function(b,c,d,e){var f="jquery"in b?b[0]:b;a._bind(f,c,function(b){(b=b||window.event||!1)&&b.srcElement&&(b.target=b.srcElement);"pageY"in b||(b.pageX=b.clientX+document.documentElement.scrollLeft,b.pageY=b.clientY+
+document.documentElement.scrollTop);return!1===d.call(f,b)||!1===e?a.cancelEvent(b):!0})},this._bind=function(b,c,d,e){a.events.push({e:b,n:c,f:d,b:e,q:!1});b.attachEvent?b.attachEvent("on"+c,d):b["on"+c]=d},this.cancelEvent=function(a){a=window.event||!1;if(!a)return!1;a.cancelBubble=!0;a.cancel=!0;return a.returnValue=!1},this.stopPropagation=function(a){a=window.event||!1;if(!a)return!1;a.cancelBubble=!0;return!1},this._unbind=function(a,c,d,e){a.detachEvent?a.detachEvent("on"+c,d):a["on"+c]=!1});
+this.unbindAll=function(){for(var b=0;b(a.newscrolly-f)*(c-f)||0>(a.newscrollx-k)*(b-k))&&a.cancelScroll();0==a.opt.bouncescroll&&(0>c?c=0:c>a.page.maxh&&(c=a.page.maxh),0>b?b=0:b>a.page.maxw&&(b=a.page.maxw));if(a.scrollrunning&&b==a.newscrollx&&c==a.newscrolly)return!1;a.newscrolly=c;a.newscrollx=b;a.newscrollspeed=d||!1;if(a.timer)return!1;a.timer=setTimeout(function(){var d=a.getScrollTop(),f=a.getScrollLeft(),
+k=Math.round(Math.sqrt(Math.pow(b-f,2)+Math.pow(c-d,2))),k=a.newscrollspeed&&1=a.newscrollspeed&&(k*=a.newscrollspeed);a.prepareTransition(k,!0);a.timerscroll&&a.timerscroll.tm&&clearInterval(a.timerscroll.tm);0b?b=0:b>a.page.maxh&&(b=a.page.maxh);0>c?c=0:c>a.page.maxw&&(c=a.page.maxw);if(b!=a.newscrolly||c!=a.newscrollx)return a.doScrollPos(c,
+b,a.opt.snapbackspeed);a.onscrollend&&a.scrollrunning&&a.triggerScrollEnd();a.scrollrunning=!1}):(this.doScrollLeft=function(b,c){var d=a.scrollrunning?a.newscrolly:a.getScrollTop();a.doScrollPos(b,d,c)},this.doScrollTop=function(b,c){var d=a.scrollrunning?a.newscrollx:a.getScrollLeft();a.doScrollPos(d,b,c)},this.doScrollPos=function(b,c,d){function e(){if(a.cancelAnimationFrame)return!0;a.scrollrunning=!0;if(p=1-p)return a.timer=v(e)||1;var b=0,c,d,f=d=a.getScrollTop();if(a.dst.ay){f=a.bzscroll?
+a.dst.py+a.bzscroll.getNow()*a.dst.ay:a.newscrolly;c=f-d;if(0>c&&fa.newscrolly)f=a.newscrolly;a.setScrollTop(f);f==a.newscrolly&&(b=1)}else b=1;d=c=a.getScrollLeft();if(a.dst.ax){d=a.bzscroll?a.dst.px+a.bzscroll.getNow()*a.dst.ax:a.newscrollx;c=d-c;if(0>c&&da.newscrollx)d=a.newscrollx;a.setScrollLeft(d);d==a.newscrollx&&(b+=1)}else b+=1;2==b?(a.timer=0,a.cursorfreezed=!1,a.bzscroll=!1,a.scrollrunning=!1,0>f?f=0:f>a.page.maxh&&(f=Math.max(0,a.page.maxh)),
+0>d?d=0:d>a.page.maxw&&(d=a.page.maxw),d!=a.newscrollx||f!=a.newscrolly?a.doScrollPos(d,f):a.onscrollend&&a.triggerScrollEnd()):a.timer=v(e)||1}c=void 0===c||!1===c?a.getScrollTop(!0):c;if(a.timer&&a.newscrolly==c&&a.newscrollx==b)return!0;a.timer&&w(a.timer);a.timer=0;var f=a.getScrollTop(),k=a.getScrollLeft();(0>(a.newscrolly-f)*(c-f)||0>(a.newscrollx-k)*(b-k))&&a.cancelScroll();a.newscrolly=c;a.newscrollx=b;a.bouncescroll&&a.rail.visibility||(0>a.newscrolly?a.newscrolly=0:a.newscrolly>a.page.maxh&&
+(a.newscrolly=a.page.maxh));a.bouncescroll&&a.railh.visibility||(0>a.newscrollx?a.newscrollx=0:a.newscrollx>a.page.maxw&&(a.newscrollx=a.page.maxw));a.dst={};a.dst.x=b-k;a.dst.y=c-f;a.dst.px=k;a.dst.py=f;var h=Math.round(Math.sqrt(Math.pow(a.dst.x,2)+Math.pow(a.dst.y,2)));a.dst.ax=a.dst.x/h;a.dst.ay=a.dst.y/h;var l=0,n=h;0==a.dst.x?(l=f,n=c,a.dst.ay=1,a.dst.py=0):0==a.dst.y&&(l=k,n=b,a.dst.ax=1,a.dst.px=0);h=a.getTransitionSpeed(h);d&&1>=d&&(h*=d);a.bzscroll=0=a.page.maxh||k==a.page.maxw&&b>=a.page.maxw)&&a.checkContentSize();var p=1;a.cancelAnimationFrame=!1;a.timer=1;a.onscrollstart&&!a.scrollrunning&&a.onscrollstart.call(a,{type:"scrollstart",current:{x:k,y:f},request:{x:b,y:c},end:{x:a.newscrollx,y:a.newscrolly},speed:h});e();(f==a.page.maxh&&c>=f||k==a.page.maxw&&b>=k)&&a.checkContentSize();a.noticeCursor()}},this.cancelScroll=function(){a.timer&&w(a.timer);a.timer=0;a.bzscroll=!1;a.scrollrunning=
+!1;return a}):(this.doScrollLeft=function(b,c){var d=a.getScrollTop();a.doScrollPos(b,d,c)},this.doScrollTop=function(b,c){var d=a.getScrollLeft();a.doScrollPos(d,b,c)},this.doScrollPos=function(b,c,d){var e=b>a.page.maxw?a.page.maxw:b;0>e&&(e=0);var f=c>a.page.maxh?a.page.maxh:c;0>f&&(f=0);a.synched("scroll",function(){a.setScrollTop(f);a.setScrollLeft(e)})},this.cancelScroll=function(){});this.doScrollBy=function(b,c){var d=0,d=c?Math.floor((a.scroll.y-b)*a.scrollratio.y):(a.timer?a.newscrolly:
+a.getScrollTop(!0))-b;if(a.bouncescroll){var e=Math.round(a.view.h/2);d<-e?d=-e:d>a.page.maxh+e&&(d=a.page.maxh+e)}a.cursorfreezed=!1;e=a.getScrollTop(!0);if(0>d&&0>=e)return a.noticeCursor();if(d>a.page.maxh&&e>=a.page.maxh)return a.checkContentSize(),a.noticeCursor();a.doScrollTop(d)};this.doScrollLeftBy=function(b,c){var d=0,d=c?Math.floor((a.scroll.x-b)*a.scrollratio.x):(a.timer?a.newscrollx:a.getScrollLeft(!0))-b;if(a.bouncescroll){var e=Math.round(a.view.w/2);d<-e?d=-e:d>a.page.maxw+e&&(d=a.page.maxw+
+e)}a.cursorfreezed=!1;e=a.getScrollLeft(!0);if(0>d&&0>=e||d>a.page.maxw&&e>=a.page.maxw)return a.noticeCursor();a.doScrollLeft(d)};this.doScrollTo=function(b,c){a.cursorfreezed=!1;a.doScrollTop(b)};this.checkContentSize=function(){var b=a.getContentSize();b.h==a.page.h&&b.w==a.page.w||a.resize(!1,b)};a.onscroll=function(b){a.rail.drag||a.cursorfreezed||a.synched("scroll",function(){a.scroll.y=Math.round(a.getScrollTop()*(1/a.scrollratio.y));a.railh&&(a.scroll.x=Math.round(a.getScrollLeft()*(1/a.scrollratio.x)));
+a.noticeCursor()})};a.bind(a.docscroll,"scroll",a.onscroll);this.doZoomIn=function(b){if(!a.zoomactive){a.zoomactive=!0;a.zoomrestore={style:{}};var c="position top left zIndex backgroundColor marginTop marginBottom marginLeft marginRight".split(" "),d=a.win[0].style,k;for(k in c){var h=c[k];a.zoomrestore.style[h]=void 0!==d[h]?d[h]:""}a.zoomrestore.style.width=a.win.css("width");a.zoomrestore.style.height=a.win.css("height");a.zoomrestore.padding={w:a.win.outerWidth()-a.win.width(),h:a.win.outerHeight()-
+a.win.height()};e.isios4&&(a.zoomrestore.scrollTop=f(window).scrollTop(),f(window).scrollTop(0));a.win.css({position:e.isios4?"absolute":"fixed",top:0,left:0,zIndex:A+100,margin:0});c=a.win.css("backgroundColor");(""==c||/transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(c))&&a.win.css("backgroundColor","#fff");a.rail.css({zIndex:A+101});a.zoom.css({zIndex:A+102});a.zoom.css("backgroundPosition","0px -18px");a.resizeZoom();a.onzoomin&&a.onzoomin.call(a);return a.cancelEvent(b)}};this.doZoomOut=
+function(b){if(a.zoomactive)return a.zoomactive=!1,a.win.css("margin",""),a.win.css(a.zoomrestore.style),e.isios4&&f(window).scrollTop(a.zoomrestore.scrollTop),a.rail.css({"z-index":a.zindex}),a.zoom.css({"z-index":a.zindex}),a.zoomrestore=!1,a.zoom.css("backgroundPosition","0px 0px"),a.onResize(),a.onzoomout&&a.onzoomout.call(a),a.cancelEvent(b)};this.doZoom=function(b){return a.zoomactive?a.doZoomOut(b):a.doZoomIn(b)};this.resizeZoom=function(){if(a.zoomactive){var b=a.getScrollTop();a.win.css({width:f(window).width()-
+a.zoomrestore.padding.w+"px",height:f(window).height()-a.zoomrestore.padding.h+"px"});a.onResize();a.setScrollTop(Math.min(a.page.maxh,b))}};this.init();f.nicescroll.push(this)},M=function(f){var c=this;this.nc=f;this.steptime=this.lasttime=this.speedy=this.speedx=this.lasty=this.lastx=0;this.snapy=this.snapx=!1;this.demuly=this.demulx=0;this.lastscrolly=this.lastscrollx=-1;this.timer=this.chky=this.chkx=0;this.time=function(){return+new Date};this.reset=function(f,h){c.stop();var d=c.time();c.steptime=
+0;c.lasttime=d;c.speedx=0;c.speedy=0;c.lastx=f;c.lasty=h;c.lastscrollx=-1;c.lastscrolly=-1};this.update=function(f,h){var d=c.time();c.steptime=d-c.lasttime;c.lasttime=d;var d=h-c.lasty,q=f-c.lastx,t=c.nc.getScrollTop(),a=c.nc.getScrollLeft(),t=t+d,a=a+q;c.snapx=0>a||a>c.nc.page.maxw;c.snapy=0>t||t>c.nc.page.maxh;c.speedx=q;c.speedy=d;c.lastx=f;c.lasty=h};this.stop=function(){c.nc.unsynched("domomentum2d");c.timer&&clearTimeout(c.timer);c.timer=0;c.lastscrollx=-1;c.lastscrolly=-1};this.doSnapy=function(f,
+h){var d=!1;0>h?(h=0,d=!0):h>c.nc.page.maxh&&(h=c.nc.page.maxh,d=!0);0>f?(f=0,d=!0):f>c.nc.page.maxw&&(f=c.nc.page.maxw,d=!0);d?c.nc.doScrollPos(f,h,c.nc.opt.snapbackspeed):c.nc.triggerScrollEnd()};this.doMomentum=function(f){var h=c.time(),d=f?h+f:c.lasttime;f=c.nc.getScrollLeft();var q=c.nc.getScrollTop(),t=c.nc.page.maxh,a=c.nc.page.maxw;c.speedx=0=h-d;if(0>q||q>t||0>f||f>a)d=!1;f=c.speedx&&d?c.speedx:!1;if(c.speedy&&d&&c.speedy||
+f){var r=Math.max(16,c.steptime);50p||p>a)&&(d=.1);c.speedy&&(e=Math.floor(c.lastscrolly-c.speedy*(1-c.demulxy)),c.lastscrolly=e,0>e||e>t)&&(d=.1);c.demulxy=Math.min(1,c.demulxy+
+d);c.nc.synched("domomentum2d",function(){c.speedx&&(c.nc.getScrollLeft(),c.chkx=p,c.nc.setScrollLeft(p));c.speedy&&(c.nc.getScrollTop(),c.chky=e,c.nc.setScrollTop(e));c.timer||(c.nc.hideCursor(),c.doSnapy(p,e))});1>c.demulxy?c.timer=setTimeout(v,r):(c.stop(),c.nc.hideCursor(),c.doSnapy(p,e))};v()}else c.doSnapy(c.nc.getScrollLeft(),c.nc.getScrollTop())}},y=f.fn.scrollTop;f.cssHooks.pageYOffset={get:function(h,c,k){return(c=f.data(h,"__nicescroll")||!1)&&c.ishwscroll?c.getScrollTop():y.call(h)},set:function(h,
+c){var k=f.data(h,"__nicescroll")||!1;k&&k.ishwscroll?k.setScrollTop(parseInt(c)):y.call(h,c);return this}};f.fn.scrollTop=function(h){if(void 0===h){var c=this[0]?f.data(this[0],"__nicescroll")||!1:!1;return c&&c.ishwscroll?c.getScrollTop():y.call(this)}return this.each(function(){var c=f.data(this,"__nicescroll")||!1;c&&c.ishwscroll?c.setScrollTop(parseInt(h)):y.call(f(this),h)})};var z=f.fn.scrollLeft;f.cssHooks.pageXOffset={get:function(h,c,k){return(c=f.data(h,"__nicescroll")||!1)&&c.ishwscroll?
+c.getScrollLeft():z.call(h)},set:function(h,c){var k=f.data(h,"__nicescroll")||!1;k&&k.ishwscroll?k.setScrollLeft(parseInt(c)):z.call(h,c);return this}};f.fn.scrollLeft=function(h){if(void 0===h){var c=this[0]?f.data(this[0],"__nicescroll")||!1:!1;return c&&c.ishwscroll?c.getScrollLeft():z.call(this)}return this.each(function(){var c=f.data(this,"__nicescroll")||!1;c&&c.ishwscroll?c.setScrollLeft(parseInt(h)):z.call(f(this),h)})};var E=function(h){var c=this;this.length=0;this.name="nicescrollarray";
+this.each=function(d){f.each(c,d);return c};this.push=function(d){c[c.length]=d;c.length++};this.eq=function(d){return c[d]};if(h)for(var k=0;k 0) ? Math.ceil(delta) : Math.floor(delta);
+
+ // scroll the scrollbar
+ bar.css({ top: delta + 'px' });
+ }
+
+ // calculate actual scroll amount
+ percentScroll = parseInt(bar.css('top')) / (me.outerHeight() - bar.outerHeight());
+ delta = percentScroll * (me[0].scrollHeight - me.outerHeight());
+
+ if (isJump)
+ {
+ delta = y;
+ var offsetTop = delta / me[0].scrollHeight * me.outerHeight();
+ offsetTop = Math.min(Math.max(offsetTop, 0), maxTop);
+ bar.css({ top: offsetTop + 'px' });
+ }
+
+ // scroll content
+ me.scrollTop(delta);
+
+ // fire scrolling event
+ me.trigger('slimscrolling', ~~delta);
+
+ // ensure bar is visible
+ showBar();
+
+ // trigger hide when scroll is stopped
+ hideBar();
+ }
+
+ function attachWheel(target)
+ {
+ if (window.addEventListener)
+ {
+ target.addEventListener('DOMMouseScroll', _onWheel, false );
+ target.addEventListener('mousewheel', _onWheel, false );
+ }
+ else
+ {
+ document.attachEvent("onmousewheel", _onWheel)
+ }
+ }
+
+ function getBarHeight()
+ {
+ // calculate scrollbar height and make sure it is not too small
+ barHeight = Math.max((me.outerHeight() / me[0].scrollHeight) * me.outerHeight(), minBarHeight);
+ bar.css({ height: barHeight + 'px' });
+
+ // hide scrollbar if content is not long enough
+ var display = barHeight == me.outerHeight() ? 'none' : 'block';
+ bar.css({ display: display });
+ }
+
+ function showBar()
+ {
+ // recalculate bar height
+ getBarHeight();
+ clearTimeout(queueHide);
+
+ // when bar reached top or bottom
+ if (percentScroll == ~~percentScroll)
+ {
+ //release wheel
+ releaseScroll = o.allowPageScroll;
+
+ // publish approporiate event
+ if (lastScroll != percentScroll)
+ {
+ var msg = (~~percentScroll == 0) ? 'top' : 'bottom';
+ me.trigger('slimscroll', msg);
+ }
+ }
+ else
+ {
+ releaseScroll = false;
+ }
+ lastScroll = percentScroll;
+
+ // show only when required
+ if(barHeight >= me.outerHeight()) {
+ //allow window scroll
+ releaseScroll = true;
+ return;
+ }
+ bar.stop(true,true).fadeIn('fast');
+ if (o.railVisible) { rail.stop(true,true).fadeIn('fast'); }
+ }
+
+ function hideBar()
+ {
+ // only hide when options allow it
+ if (!o.alwaysVisible)
+ {
+ queueHide = setTimeout(function(){
+ if (!(o.disableFadeOut && isOverPanel) && !isOverBar && !isDragg)
+ {
+ bar.fadeOut('slow');
+ rail.fadeOut('slow');
+ }
+ }, 1000);
+ }
+ }
+
+ });
+
+ // maintain chainability
+ return this;
+ }
+ });
+
+ $.fn.extend({
+ slimscroll: $.fn.slimScroll
+ });
+
+})(jQuery);
\ No newline at end of file
diff --git a/src/main/resources/com/fr/plugin/theme/simple/web/js/models.js b/src/main/resources/com/fr/plugin/theme/simple/web/js/models.js
new file mode 100644
index 0000000..d69f7f6
--- /dev/null
+++ b/src/main/resources/com/fr/plugin/theme/simple/web/js/models.js
@@ -0,0 +1,265 @@
+;
+
+(function () {
+ var e = BI.inherit(Fix.Model, {
+ state: function () {
+ return {
+ items: [],
+ }
+ },
+ actions: {
+ initHistory: function (callBack) {
+ var self = this;
+ Dec.reqGet(zxlresolvePath("viewHistory", false), "", function (data) {
+ if (data.data) {
+ self.model.items = data.data;
+ }
+ callBack();
+ })
+ },
+ },
+ });
+ BI.model("dec.model.zxl.view.history", e)
+})();
+
+(function () {
+ var e = BI.inherit(Fix.Model, {
+ state: function () {
+ return {
+ items: {},
+ }
+ },
+ actions: {
+ initHistory: function (callBack) {
+ var self = this;
+ Dec.reqGet(zxlresolvePath("AllViewHistory", false), "", function (data) {
+ if (data.data) {
+ self.model.items = data.data;
+ }
+ callBack();
+ })
+ },
+ },
+ });
+ BI.model("dec.model.zxl.panle.history", e)
+})();
+(function () {
+ var e = BI.inherit(Fix.Model, {
+ state: function () {
+ return {
+ favorites: [],
+ entries: []
+ }
+ },
+ childContext: ["favorites", "entries"],
+ actions: {
+ initFavs: function (callBack) {
+ var self = this;
+ this.model.loading = true;
+ Dec.Utils.getFavoritesList(function (e) {
+ self.model.favorites = BI.Services.getService("dec.service.frame.entry").normalizeEntries(e.data, false);
+ callBack();
+ self.model.loading = false;
+ });
+ Dec.Utils.getCompleteDirectoryTree(function (e) {
+ self.model.entries = BI.Tree.transformToTreeFormat(BI.Services.getService("dec.service.frame.entry").normalizeEntries(e.data))
+ })
+ }
+ }
+ });
+ BI.model("dec.zxl.tabs", e)
+})();
+
+(function () {
+ var e = BI.inherit(Fix.Model, {
+ state: function () {
+ return {
+ items: [],
+ }
+ },
+ //定义子组件可以接收哪些数据
+ childContext: ["items"],
+ actions: {
+ initMenu: function (callBack) {
+ var self = this;
+ Dec.reqGet("/v10/entries/all", "", function (data) {
+ if (data.data) {
+ self.model.items = BI.filter(data.data, function (i, v) {
+ return (v.deviceType === 1 || v.deviceType === 3|| v.deviceType === 5 || v.deviceType === 7);
+ });
+ }
+ callBack();
+ })
+ },
+ getFirstLevel: function () {
+ var items = [];
+ BI.each(this.model.items, function (i, v) {
+ if (v.pId === "decision-directory-root") {
+ items.push(v);
+ }
+ return true;
+ });
+ if (Dec.decisionModules.length > 0) {
+ items.push({
+ text: "管理系统",
+ icon: "cl-font"
+ });
+ }
+ return items.sort(sortMenu);
+ },
+ getAllMenu: function () {
+ return this.model.items;
+ }
+ }
+ });
+ BI.model("dec.model.zxl.menus", e)
+})();
+(function () {
+ var e = BI.inherit(Fix.Model, {
+ state: function () {
+ return {
+ searchResult: []
+ }
+ },
+ actions: {
+ search: function (text) {
+ var self = this;
+ Dec.reqGet("/v10/entry/list?keyword=" + text, "", function (data) {
+ if (data.data) {
+ var temparr = [];
+ BI.each(data.data, function (i, v) {
+ if (v.entryType === 102) {
+ temparr.push(v);
+ }
+ });
+ self.model.searchResult = temparr;
+ } else {
+ self.model.searchResult = [];
+ }
+ })
+ },
+ },
+ });
+ BI.model("dec.model.zxl.menus.search", e)
+})();
+
+
+(function () {
+ var i = BI.inherit(BI.BasicButton, {
+ props: {
+ baseCls: "dec-frame-tab-pane-tabs-homepage-item",
+ $testId: "dec-frame-tab-pane-tabs-homepage-tab",
+ text: "",
+ value: "",
+ height: 36,
+ width: 60,
+ entry: !1
+ },
+ render: function () {
+ var t = this
+ , e = this.options;
+ return {
+ type: "bi.absolute",
+ items: [{
+ el: {
+ type: "bi.bubble_combo",
+ cls: "dec-workbench-tabs-bubble-combo",
+ trigger: "",
+ offsetStyle: "center",
+ isNeedAdjustWidth: this._isFirst = !1,
+ top: 9,
+ left: 13,
+ el: {
+ type: "bi.icon_button",
+ cls: " home-font zxl-home-btn",
+ // type: "bi.img",
+ // src: getImageUrl("home_black.jpg"),
+ height: 18,
+ width: 18,
+ hgap: 10,
+ top: 9,
+ left: 13,
+ value: e.value,
+ selected: e.selected,
+ ref: function (e) {
+ t.isSel = false;
+ t.tabButton = e
+ },
+ listeners: [{
+ eventName: BI.Controller.EVENT_CHANGE,
+ action: function () {
+ t.fireEvent(BI.Controller.EVENT_CHANGE, arguments)
+ }
+ }]
+ },
+ popup: {
+ el: {
+ type: "dec.frame.tab_pane.tabs.tab.tools",
+ value: e.value,
+ entry: e.entry,
+ isFavorite: e.isFavorite,
+ ref: function (e) {
+ t.popup = e
+ }
+ },
+ cls: "dec-frame-tab-pane-tabs-item-popup-view",
+ maxWidth: null,
+ minWidth: null,
+ minHeight: ""
+ },
+ ref: function (e) {
+ t.combo = e
+ },
+ listeners: [{
+ eventName: BI.BubbleCombo.EVENT_CHANGE,
+ action: function () {
+ }
+ }]
+ },
+ top: 0,
+ right: 1,
+ bottom: 0,
+ left: 0
+ }, {
+ el: {
+ type: "bi.layout",
+ cls: "dec-tab-button-gap-line",
+ width: 1
+ },
+ top: 0,
+ bottom: 0,
+ left: 0
+ }]
+ }
+ },
+ _isFirstClick: function () {
+ return this._isFirst
+ },
+ setSelected: function (e) {
+ var t = this;
+ t.isSel = e;
+ if (e) {
+ $(t.tabButton.element).attr("src", getImageUrl("home_active.jpg"));
+ } else {
+ $(t.tabButton.element).attr("src", getImageUrl("home_black.jpg"));
+ }
+ i.superclass.setSelected.apply(this, arguments),
+ e ? this.element.hover(function () {
+ t._isFirstClick() && t.combo.showView()
+ }, function () {
+ t.combo.hideView()
+ }) : (this.element.unbind("mouseenter").unbind("mouseleave"),
+ t._isFirst = !1),
+ BI.delay(function () {
+ t._isFirst = !0
+ }, 80)
+ },
+ isSelected: function () {
+ return this.isSel || false
+ },
+ getValue: function () {
+ return this.options.value
+ }
+ });
+ BI.shortcut("dec.frame.zxl.tab_pane.tabs.homepage_tab", i);
+}());
diff --git a/src/main/resources/com/fr/plugin/theme/simple/web/js/panles.js b/src/main/resources/com/fr/plugin/theme/simple/web/js/panles.js
new file mode 100644
index 0000000..63b8dcd
--- /dev/null
+++ b/src/main/resources/com/fr/plugin/theme/simple/web/js/panles.js
@@ -0,0 +1,344 @@
+;
+(function () {
+ // 系统菜单和用户管理包装
+ !(function () {
+ var Widget = BI.inherit(BI.Widget, {
+ render: function () {
+ var self = this;
+ return {
+ type: "zxl.header.history.and.fav.panle",
+ panle: "history"
+ }
+ }
+ });
+ BI.shortcut("zxl.header.history.wapper", Widget);
+ }());
+})();
+(function () {
+ // 系统菜单和用户管理包装
+ !(function () {
+ var Widget = BI.inherit(BI.Widget, {
+ render: function () {
+ var self = this;
+ return {
+ type: "zxl.header.history.and.fav.panle",
+ panle: "fav"
+ }
+ }
+ });
+ BI.shortcut("zxl.header.fav.wapper", Widget);
+ }());
+})();
+(function () {
+ // 系统菜单和用户管理
+ !(function () {
+ var Widget = BI.inherit(BI.Widget, {
+
+ props: {
+ // baseCls: "zxl-header-member-and-setting"
+ },
+ beforeInit: function (render) {
+ this.sysMenus = BI.filter(BI.Constants.getConstant("dec.constant.management.navigation"), function (index, item) {
+ return item.id !== "decision-management-maintenance";
+ });
+ render();
+ },
+ render: function () {
+ var self = this;
+ return {
+ type: "bi.button_group",
+ cls: "history-button-group",
+ layouts: [
+ {
+ type: "bi.vertical",
+ vgap: 5
+ }
+ ],
+ items: [
+ {
+ type: "bi.horizontal_adapt",
+ cls: "history-fav-tab-header",
+ columnSize: ["fill", 45],
+ items: [
+ {
+ type: "dec.line_segment",
+ cls: "history-fav-panle-tab",
+ height: 40,
+ items: BI.createItems([{
+ text: "浏览记录",
+ value: "history",
+ selected: this.options.panle === "history"
+ }, {
+ text: "收藏",
+ value: "fav",
+ selected: this.options.panle === "fav"
+ }], {
+ hgap: 15
+ }),
+ layouts: [
+ {
+ type: "bi.vertical_adapt"
+ }
+ ],
+ listeners: [
+ {
+ eventName: "EVENT_CHANGE",
+ action: function (value) {
+ self.tab.setSelect(value);
+ if (value === "fav") {
+ $(self.delBtn.element).show();
+ if(self.favP){
+ self.favP.populate();
+ }
+ } else {
+ $(self.delBtn.element).hide();
+ if(self.historyP){
+ self.historyP.populate();
+ }
+ }
+ }
+ }
+ ]
+ },
+ {
+ type: "bi.center",
+ cls: "btn-del-waper",
+ ref: function (e) {
+ self.delBtn = e;
+ if (self.options.panle === "fav") {
+ $(self.delBtn.element).show();
+ } else {
+ $(self.delBtn.element).hide();
+ }
+ },
+ items: [
+ {
+ type: "bi.img",
+ cls: "btn-del",
+ src: getImageUrl("delbtn.jpg"),
+ ref: function (e) {
+ $(e.element).click(function () {
+ showLayer(function () {
+ Dec.Utils.getFavoritesList(function (data) {
+ BI.each(data.data, function (i, vv) {
+ Dec.Utils.handlerCollect(vv.id, false);
+ });
+ var tab_pane = BI.Services.getService("dec.service.frame.tab_pane");
+ tab_pane.refreshTab(tab_pane.getShowingTab())
+ })
+ })
+ });
+ },
+ }
+ ]
+ }
+ ]
+ },
+ {
+ type: "bi.tab",
+ ref: function (_ref) {
+ self.tab = _ref;
+ },
+ height: 500,
+ showIndex: this.options.panle,
+ cardCreator: function (v) {
+ switch (v) {
+ case 'fav':
+ return BI.createWidget({
+ type: "zxl.hitory.fav.card",
+ text: "fav",
+ ref:function (e) {
+ self.favP=e;
+ }
+ });
+ case 'history':
+ return BI.createWidget({
+ type: "zxl.hitory.panle.card",
+ text: "history",
+ ref:function (e) {
+ self.historyP=e;
+ }
+ });
+ }
+ }
+ }
+ ]
+ };
+ }
+ });
+ BI.shortcut("zxl.header.history.and.fav.panle", Widget);
+ }());
+})();
+
+(function () {
+ var Widget = BI.inherit(BI.Widget, {
+ beforeInit: function (render) {
+ var self = this;
+ Dec.Utils.getFavoritesList(function (res) {
+ self.items = res.data;
+ render();
+ });
+ },
+ populate:function(){
+ var self=this;
+ Dec.Utils.getFavoritesList(function (res) {
+ var items = self._getItems( res.data);
+ self.popup.populate(items);
+ });
+ },
+ _getItems:function(items){
+ return BI.map(items, function (i, v) {
+ return {
+ type: "bi.vertical",
+ cls: "fav-panle-item cursor-pointer ",
+ ref: function (e) {
+ $(e.element).click(function () {
+ openEntityCard(v);
+ // BI.Services.getService("dec.service.frame.tab_pane").addItem(v);
+ })
+ },
+ items: [
+ {
+ type: "bi.img",
+ cls: "history-panle-img",
+ src: getMenuCoverUrl(v.cover)
+ },
+ {
+ type: "bi.label",
+ textAlign: "left",
+ text: v.text,
+ cls: "history-panle-text"
+ }
+ ]
+ };
+ });
+ },
+ render: function () {
+ var self = this;
+ var items = self._getItems(self.items);
+
+ return {
+ type: "bi.button_group",
+ cls: "history-button-group fav-card",
+ items:items,
+ layouts: [
+ {
+ type: "bi.left",
+ vgap: 5
+ }
+ ],
+ ref: function (_ref) {
+ self.popup = _ref;
+ },
+ }
+ },
+ });
+ BI.shortcut("zxl.hitory.fav.card", Widget);
+})();
+
+
+(function () {
+ var Widget = BI.inherit(BI.Widget, {
+ _store: function () {
+ return BI.Models.getModel("dec.model.zxl.panle.history")
+ },
+ beforeInit: function (render) {
+ this.store.initHistory(render)
+ },
+ populate:function(){
+ var self=this;
+ this.store.initHistory(function () {
+ var items = [];
+ BI.each(self.model.items, function (i, v) {
+ items.push(self._createLine(i, v));
+ });
+ if(self.popup){
+ self.popup.populate(items);
+ }
+ });
+ },
+ render: function () {
+ var self = this;
+ var items = [];
+ BI.each(this.model.items, function (i, v) {
+ items.push(self._createLine(i, v));
+ });
+ return {
+ type: "bi.button_group",
+ cls: "history-button-group",
+ items:items,
+ layouts: [
+ {
+ type: "bi.vertical",
+ vgap: 5
+ }
+ ],
+ ref: function (_ref) {
+ self.popup = _ref;
+ },
+ }
+ },
+ _createLine: function (name, items) {
+ var childs = BI.map(items, function (i, v) {
+ return {
+ type: "bi.vertical",
+ cls: "history-panle-item cursor-pointer ",
+ ref: function (e) {
+ $(e.element).click(function () {
+ openEntityCard(v);
+ // BI.Services.getService("dec.service.frame.tab_pane").addItem(v);
+ })
+ },
+ items: [
+ {
+ type: "bi.img",
+ cls: "history-panle-img",
+ src: getMenuCoverUrl(v.cover)
+ },
+ {
+ type: "bi.label",
+ textAlign: "left",
+ text: v.text,
+ cls: "history-panle-text"
+ }
+ ]
+ }
+ });
+ return {
+ type: "bi.vertical",
+
+ items: [
+ {
+ type: "bi.htape",
+ cls: "history-panle-line",
+ height: 14,
+ vgap: 10,
+ items: [
+ {
+ width: 32,
+ type: "bi.label",
+ cls: "history-panle-class-name",
+ text: name,
+ },
+ {
+ width: "fill",
+ height: 6,
+ type: "bi.default",
+ cls: " right-line bi-border-bottom"
+ }
+ ]
+ },
+ {
+ type: "bi.left",
+ items: childs,
+ hgap: 20
+ }
+
+ ]
+ }
+ },
+
+ });
+ BI.shortcut("zxl.hitory.panle.card", Widget);
+})();
+
diff --git a/src/main/resources/com/fr/plugin/theme/simple/web/style.css b/src/main/resources/com/fr/plugin/theme/simple/web/style.css
new file mode 100644
index 0000000..c2805a0
--- /dev/null
+++ b/src/main/resources/com/fr/plugin/theme/simple/web/style.css
@@ -0,0 +1,293 @@
+body{
+ background-image: url(${fineServletURL}/resources?path=/com/fr/plugin/theme/simple/web/images/backgroup.png);
+}
+.demo-header-menu-item>.header-menu-item-btn{
+ font-size: 16px;
+ color: #ffffff;
+}
+.demo-header-menu-item .bi-popup-view{
+ opacity: 0.9;
+}
+.forcedToHide {
+ display: none;
+}
+
+::-webkit-scrollbar {
+ display: none;
+}
+html {
+ /*隐藏滚动条,当IE下溢出,仍然可以滚动*/
+ -ms-overflow-style:none;
+ /*火狐下隐藏滚动条*/
+ overflow:-moz-scrollbars-none;
+}
+.fs-banner-title{
+ line-height: 30px;
+ display: block;
+ margin: 0 auto;
+ font-size: 16px;
+ max-width: 500px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ padding-left: 15px;
+ color: #ffffff;
+}
+.header-search-input input{
+ color: #ffffff;
+}
+.demo-header-menu-row{
+ color: #ffffff;
+ font-size: 16px;
+ overflow: auto!important;
+}
+.zxl-menus{
+ /*overflow: auto!important;*/
+}
+.demo-header-search-row-search{
+ border-radius: 20px;
+}
+.header-search-input{
+ border-radius: 20px;
+}
+.header-search-input.bi-combo-hover{
+ /* height: 27px; */
+ background-color: transparent;
+ transform: scale(1.15);
+ -webkit-transform: scale(1.15);
+ -moz-transform: scale(1.15);
+ -o-transform: scale(1.15);
+ z-index: 10000; /*这里在使用了scale后,要重新设置z-index*/
+}
+.header-search-input .search-font{
+ left: auto!important;
+ right: 10px;
+ color: rgba(255, 255, 255, 0.6);
+}
+.zxl-5start-font .b-font:before {
+ content: "\e644";
+ color: rgb(25,153,222);
+ font-size: 22px;
+}
+.cl-font .b-font:before {
+ content: "\e777";
+ color: inherit;
+ font-size: 22px;
+}
+.zxl-fav-font{
+ font-size: 15px;
+ width: 22px;
+ height: 22px;
+}
+.demo-header-search-row{
+ color: #ffffff;
+}
+ .dec-header-message{
+ margin-left: 16px;
+ }
+.dec-header-message .msg-font .b-font{
+ font-size: 22px;
+ width: 26px!important;
+ height: 26px!important;
+}
+.dec-header-account{
+ margin-right: 16px;
+}
+.dec-header-account .dec-frame-panel{
+ background-color:transparent!important;
+}
+.dec-header-account .account-arrow-trigger{
+ display: none;
+}
+.header-item{
+ color: #ffffff;
+ background: #017597;
+ text-align: center;
+ height: 40px;
+ width: 180px;
+ font-size: 14px;
+}
+.header-item::after{
+ display: block;
+ content: " ";
+ width: 1px;
+ height: 15px;
+ top: 12px;
+ left: 0;
+ background: #fff;
+ position: absolute;
+}
+.header-item:first-child::after{
+ display: block;
+ content: " ";
+ width: 1px;
+ height: 15px;
+ top: 12px;
+ left: 0;
+ background: transparent;
+ position: absolute;
+}
+.header-menu-row:first-child::before{
+ display: block;
+ content: " ";
+ width: 1px;
+ height: 280px;
+ top: 0;
+ left: 0;
+ background: transparent;
+ position: absolute;
+}
+
+.header-menu-row::before{
+ display: block;
+ content: " ";
+ width: 1px;
+ height: 280px;
+ top: 0;
+ left: 0;
+ background: #fff;
+ position: absolute;
+}
+.header-menu-row{
+ color: #ffffff;
+ width: 180px;
+ min-height: 280px;
+ text-align: center;
+}
+.third-row{
+ color: #ffffff;
+ padding: 15px 0;
+}
+.header-menu-item .bi-text{
+ /*font-size: 14px;*/
+ padding: 0 10px;
+}
+.header-menu-item{
+ color: #ffffff;
+ height: 28px;
+}
+.menu-button-zzl .b-font:before{
+
+}
+.menu-button-zzl .b-font:before{
+
+ color:#fff!important;
+}
+.foce-white{
+ color:#fff !important;
+}
+.header-menu-item:hover{
+ background: #006786;
+}
+
+.zxl-home-btn{
+ width: 49px!important;
+ height: 34px!important;
+ text-align: center;
+ line-height: 34px!important;
+}
+
+.zxl-menu-tiger{
+ text-align: center;
+}
+.zxl-menu-tiger>.bi-center-adapt-layout{
+ margin: 0 auto;
+}
+.menu-popup {
+ color: #ffffff;
+ opacity: 0.9;
+ filter: alpha(opacity=90);
+ background: #01addf;
+}
+.dec-frame-tab-pane-tabs-container .dec-tabs-button-group{
+ background-color: rgba(125,151,188,0.8);
+}
+.header-menu-row::-webkit-scrollbar-thumb {
+ border-radius:10px;
+ background: #ffffff;
+}
+/*.zxl-menu-tiger:hover{*/
+ /*color: #01ADDF;*/
+ /*border-bottom: 3px #01ADDF solid;*/
+/*}*/
+.zxl-menu-tiger:hover::after{
+ display: block;
+ content: " ";
+ width: 130px;
+ height: 3px;
+ bottom: 0;
+ left: 0;
+ background: #01ADDF;
+ position: absolute;
+}
+.three-point-font{
+ height: 100%;
+}
+.three-point-font .b-font:before {
+ content: "\e796";
+ color: #0ca1c9;
+ font-size: 45px;
+ font-weight: bold;
+}
+.arraw-up-font .b-font:before {
+ content: "\e70a";
+ color: inherit;
+}
+
+.arraw-down-font .b-font:before {
+ content: "\e70b";
+ color: inherit;
+}
+.zxl-tree:hover{
+}
+.zxl-tree>.zxl-tree-node{
+ margin-left: 0;
+}
+.zxl-tree{
+ padding-left:6px
+ /*margin-left: 6px;*/
+}
+.zxl-tree .item-line{
+ padding-left: 13px;
+}
+.zxl-tree:hover .item-line{
+ color: #bababa;
+ font-weight: normal;
+}
+.zxl-tree .item-line:hover{
+ background: #1999de;
+}
+.zxl-tree .item-line:hover .menu-text{
+ color: #ffffff;
+}
+.zxl-sidle-popup{
+ background-color: #01addf;
+ color: #ffffff;
+}
+.zxl-ext-item-popup>.bi-vertical-layout{
+ height: 100%;
+}
+.zxl-tree-node:hover{
+ background:rgb(0,102,135);
+ color:#fff;
+}
+.zxl-tree-node{
+ margin-left: 6px;
+}
+.zxl-tree-menu{
+ /*margin-left: 5px;*/
+}
+
+.dec-frame-tab-pane .dec-frame-tab-pane-tabs-normal-item{
+ background-color: rgba(125,151,188,0.8)!important;
+}
+.dec-frame-tab-pane .dec-frame-tab-pane-tabs-normal-item.active{
+ color: #3D4D66;
+ background-color: #FFFFFF!important;
+}
+.dec-frame-tab-pane .dec-frame-tab-pane-tabs-homepage-item{
+ background-color: rgba(125,151,188,0.8)!important;
+}
+.dec-frame-tab-pane .dec-frame-tab-pane-tabs-homepage-item.active{
+ background-color: #FFFFFF!important;
+}
\ No newline at end of file
diff --git a/src/main/resources/com/fr/plugin/theme/simple/web/theme.js b/src/main/resources/com/fr/plugin/theme/simple/web/theme.js
new file mode 100644
index 0000000..ddaebe0
--- /dev/null
+++ b/src/main/resources/com/fr/plugin/theme/simple/web/theme.js
@@ -0,0 +1,1622 @@
+!(function () {
+
+
+ BI.config("dec.header", function (config) {
+ config.type = "zxl.header";
+ return config;
+ });
+
+ function initHomepage() {
+ if (BI.isEmptyArray(Dec.tabPaneModel.openedTabs)) {
+ Dec.tabPaneModel.openedTabs.push(BI.extend({
+ width: 50,
+ // type: "dec.frame.tab_pane.tabs.homepage_tab",
+ type: "dec.frame.zxl.tab_pane.tabs.homepage_tab"
+ }, BI.Providers.getProvider("dec.provider.tab_pane").getHomepageParser(Dec.personal.homepage.homePageType)(Dec.personal.homepage))),
+ void (Dec.tabPaneModel.activeTab = DecCst.Web.Frame.Tab.PLATFORM_HOME_TAB_ID);
+ return
+ }
+
+ Dec.tabPaneModel.openedTabs.unshift(BI.extend({
+ width: 50,
+ type: "dec.frame.zxl.tab_pane.tabs.homepage_tab"
+ }, BI.Providers.getProvider("dec.provider.tab_pane").getHomepageParser(Dec.personal.homepage.homePageType)(Dec.personal.homepage)))
+ }
+
+ (function () {
+ var Widget = BI.inherit(BI.Widget, {
+
+ _store: function () {
+ return BI.Models.getModel("dec.zxl.tabs")
+ },
+ beforeInit: function (e) {
+ this.store.initFavs(e);
+ },
+ render: function () {
+ var self = this;
+ return {
+ type: "bi.absolute",
+ items: [{
+ el: BI.Providers.getProvider("dec.provider.tab_pane").getTabPaneComponent({
+ ref: function (e) {
+ initHomepage();
+ },
+ showTabBar: true,
+ cls: "bi-background-tab",
+ listeners: [{
+ eventName: "EVENT_SHOW",
+ action: function (e) {
+ Dec.activeCard(e);
+ console.info(e)
+ }
+ }, {
+ eventName: "EVENT_CLOSE",
+ action: function (e, t) {
+ console.info(e)
+ }
+ }]
+ }),
+ top: 0, bottom: 0, right: 0,
+ left: 0
+ }]
+ };
+
+
+ }
+ });
+ BI.shortcut("zxl.tabs", Widget);
+ })();
+
+ BI.config("dec.provider.layout", function (provider) {
+ provider.setConfig({
+ type: "bi.absolute",
+ cls: "demo-background",
+ items: [
+ {
+ el: {
+ type: "zxl.tabs",
+ },
+ top: 100, left: 0, right: 0, bottom: 0
+ }, {
+ el: {
+ type: "dec.header"
+ },
+ height: 100,
+ top: 0, left: 0, right: 0
+ },
+ ]
+ });
+ return provider;
+ });
+}());
+
+
+!(function () {
+ var Widget = BI.inherit(BI.Widget, {
+
+ props: {
+ baseCls: ""
+ },
+ _store: function () {
+ return BI.Models.getModel("dec.model.zxl.menus")
+ },
+ render: function () {
+ return {
+ type: "bi.left_right_vertical_adapt",
+ items: {
+ left: [
+ {
+ el: {
+ type: "bi.icon_button",
+ width: 30,
+ height: 30
+ }
+ }, {
+ el: {
+ type: "bi.label",
+ textAlign: "left",
+ cls: "title-text",
+ text: "ngx-admin"
+ }
+ }
+ ],
+ right: [
+ {
+ el: {
+ type: "bi.icon_button",
+ width: 30,
+ height: 30
+ }
+ }, {
+ el: {
+ type: "dec.header.message"
+ }
+ }, {
+ el: {
+ type: "dec.account"
+ }
+ }
+ ]
+ }
+ };
+ }
+ });
+
+ BI.shortcut("demo.head11er", Widget);
+}());
+
+/**
+ *@desc 自定义的header
+ *@author dailer
+ *@date 2018/12/25
+ */
+!(function () {
+ var Widget = BI.inherit(BI.Widget, {
+
+ props: {
+ baseCls: "demo-header"
+ },
+ _store: function () {
+ return BI.Models.getModel("dec.model.zxl.menus")
+ },
+ getLogo: function () {
+ if (BI.isEmpty(Dec.platformStyles.logoImgId)) {
+ if (Dec.BIEnable) {
+ return Dec.resourceURL + "resources/logo_BI.png"
+ } else {
+ return Dec.resourceURL + "resources/logo_FR.png"
+ }
+ } else {
+ return Dec.fineServletURL + "/v10/attach/image/" + Dec.platformStyles.logoImgId
+ }
+ },
+ render: function () {
+ return {
+ type: "bi.vertical",
+ items: [
+ {
+ type: "zxl.header.search.row",
+ height: 50
+ },
+ {
+ type: "zxl.header.menu.row",
+ height: 50
+ }
+ ]
+ };
+ }
+ });
+
+ BI.shortcut("zxl.header", Widget);
+}());
+/**
+ * 头部菜单行
+ */
+!(function () {
+ var Widget = BI.inherit(BI.Widget, {
+
+ props: {
+ baseCls: "demo-header-menu-row"
+ },
+ _store: function () {
+ return BI.Models.getModel("dec.model.zxl.menus")
+ },
+ beforeInit: function (render) {
+ this.store.initMenu(render);
+ },
+ mounted: function () {
+ // 在render方法里的子组件被渲染到页面之后的钩子函数
+ var self = this;
+ $(window).resize(function () {
+ self._resizeHandler()
+ });
+ self._resizeHandler()
+ },
+ _resizeHandler: function () {
+ //获取屏幕宽度,计算个数从新添加到menus_groups
+ console.info(document.body.clientWidth)
+ var count = Math.ceil(document.body.clientWidth / 138) - 1;
+ console.info("可以创建" + count + "个item");
+ var level1 = this.store.getFirstLevel();
+ var allMenu = this.store.getAllMenu();
+ var items = [];
+ if (count < level1.length) {
+ BI.each(level1, function (i, v) {
+ if (i < count) {
+ items.push({
+ type: "zxl.header.menu.item",
+ txt: BI.i18nText(v.text),
+ item: v,
+ level: 0,
+ allMenu: allMenu
+ })
+ }
+ })
+ var teeemp = BI.filter(level1, function (i, v) {
+ return i >= count
+ });
+ items.push({
+ type: "zxl.header.menu.extItem",
+ items: teeemp
+ })
+ } else {
+ items = BI.map(level1, function (i, v) {
+ return {
+ type: "zxl.header.menu.item",
+ txt: BI.i18nText(v.text),
+ item: v,
+ level: 0,
+ allMenu: allMenu
+ };
+ });
+ }
+
+ this.menus_groups.populate(items);
+ },
+ render: function () {
+ var level1 = this.store.getFirstLevel();
+ var allMenu = this.store.getAllMenu();
+ var self = this;
+ var items = BI.map(level1, function (i, v) {
+ return {
+ type: "zxl.header.menu.item",
+ txt: BI.i18nText(v.text),
+ item: v,
+ level: 0,
+ allMenu: allMenu
+ };
+ });
+ return {
+ type: "bi.button_group",
+ layouts: [
+ {
+ type: "bi.horizontal"
+ }
+ ],
+ ref: function (e) {
+ self.menus_groups = e;
+ },
+ height: 50,
+ items: items
+ };
+ }
+ });
+ BI.shortcut("zxl.header.menu.row", Widget);
+}());
+/**
+ * menu item
+ */
+!(function () {
+ Dec.itemStorage = [];
+ //激活当前元素上下的路径的元素,第一步先把所有的元素都unActive 再找出路径上的元素 active
+ Dec.unActive = function (otherItem) {
+ var items = BI.filter(Dec.itemStorage, function (i, v) {
+ return v.options.item.pId === "decision-directory-root" && v.options.item.id !== otherItem.options.item.id
+ });
+ BI.map(items, function (i, v) {
+ v.unActiveMe()
+ });
+ };
+ Dec.activeCard = function (id) {
+ var nowItem = BI.find(Dec.itemStorage, function (i, v) {
+ return v.options.item.id === id
+ });
+ Dec.activeParent(nowItem, false);
+ };
+ Dec.activeParent = function (item, active) {
+ Dec.unActive(item);
+ if (item.options.item.pId === "decision-directory-root") {
+ item.activeMe(active);
+ return
+ }
+ var top = Dec.findTop(Dec.itemStorage, item);
+ if (top) {
+ if (top.options.item.entryType !== 3) {
+ top.unActiveMe();
+ return;
+ }
+ top.activeMe(active);
+ }
+ };
+ Dec.findTop = function (items, item) {
+ var tempId = item.options.item.pId;
+ //向上找
+ var count = 0;
+ while (count < 30) {
+ var op = BI.find(items, function (idx, item) {
+ return item.options.item.id === tempId
+ });
+ if (op) {
+ tempId = op.options.item.pId;
+ if (tempId === "decision-directory-root") {
+ return op;
+ }
+ } else {
+ break
+ }
+ count++;
+ }
+ return null;
+ };
+ var Widget = BI.inherit(BI.Widget, {
+
+ props: {},
+ mounted: function () {
+ Dec.itemStorage.push(this);
+ },
+ showChild: function () {
+ this.pop.showView();
+ },
+ hasChild: function (menuId) {
+ return this.getChildMenu(menuId).length > 0
+ },
+ getChildMenu: function (menuId) {
+ var items = [];
+ BI.each(this.options.allMenu, function (i, v) {
+ if (v.pId === menuId) {
+ items.push(v);
+ }
+ return true;
+ });
+ return items.sort(sortMenu);
+ },
+ activeMe: function (showPop) {
+ this.handerEl.setSelected(true);
+ if (showPop) {
+ this.pop.showView();
+ this.popup.showFirst();
+ }
+ },
+ unActiveMe: function () {
+ this.handerEl.setSelected(false);
+ this.pop.hideView();
+ },
+ render: function () {
+ var that = this;
+ var text = this.options.txt;
+ var active = this.options.active || "";
+ var item = this.options.item;
+ var level = this.options.level;
+ var isFirst = this.options.isFirst;
+ var allMenu = this.options.allMenu;
+ var cfqCls = "header-menu-item-btn";
+ var baseCls = "demo-header-menu-item";
+ var notShow = "";
+ if (item.entryType === 3) {
+ //其他类型需要检查是否有子元素,如果没有就不显示
+ if (!this.hasChild(item.id)) {
+ notShow = " forcedToHide";
+ }
+ }
+ var entityIcon = item.icon;
+ if (item.entryType !== 3) {
+ entityIcon = ""
+ }
+ // var tiger = BI.createWidget({
+ // type: "bi.vertical_adapt",
+ // cls: "zxl-menu-tiger",
+ // // width: 130,
+ // // height: 50,
+ // items: [
+ // // {
+ // // type: "bi.center_adapt",
+ // // width:"auto",
+ // // height:40,
+ // // items:[
+ // // {
+ // // type: "bi.icon_button",
+ // // cls: entityIcon
+ // // },
+ // // {
+ // // type: "bi.text_button",
+ // // cls: cfqCls,
+ // // text: text,
+ // // whiteSpace: "normal",
+ // // ref: function (e) {
+ // // that.handerEl = e;
+ // // }
+ // // }
+ // // ]
+ // // }
+ // {
+ // type: "bi.button",
+ // cls: cfqCls,
+ // whiteSpace: "normal",
+ // level: "ignore",
+ // iconCls: entityIcon,
+ // text: text,
+ // ref: function (e) {
+ // that.handerEl = e;
+ // }
+ // }
+ // ]
+ // });
+ // var columnSize=[1,"fill"]
+ // if (entityIcon) {
+ // columnSize=[20,"fill"]
+ // }
+ // var tiger = BI.createWidget({
+ // type: "bi.center_adapt",
+ // cls: cfqCls + " zxl-menu-tiger" + " " + entityIcon,
+ // width: 130,
+ // // cls: "bi-high-light-background search-font",
+ // columnSize: columnSize,
+ // vgap: 10,
+ // title: text,
+ // ref: function (e) {
+ // // $(e.element).click(function () {
+ // // alert(1)
+ // // })
+ // },
+ // items: [{
+ // type: "bi.icon",
+ // lgap: 10,
+ // }, {
+ // type: "bi.label",
+ // text: text,
+ // whiteSpace: "normal",
+ // level: "common",
+ // rgap: 10
+ // }]
+ // });
+ var tmp = '${fontSize}';
+ var fontSize = 14;
+ if (!isNaN(parseInt(tmp))) {
+ fontSize = parseInt(tmp);
+ }
+ var tiger = BI.createWidget(
+ {
+ type: "bi.center_adapt",
+ cls: cfqCls + " zxl-menu-tiger" + " " + entityIcon,
+ width: 130,
+ hgap: 16,
+ css: {
+ color: "#fff",
+ fontSize: fontSize
+ },
+ items: [
+ {
+ type: "bi.button",
+ width: 130,
+ height: 50,
+ cls:"menu-button-zzl",
+ css: {
+ color: "#fff",
+ fontSize: fontSize
+ },
+ textWidth: 130,
+ textHeight: 50,
+ title: text,
+ whiteSpace: "normal",
+ level: "ignore",
+ block: true,
+ iconCls: entityIcon+" foce-white",
+ text: text,
+ ref: function (e) {
+ that.handerEl = e;
+ }
+ }
+ ]
+ }
+ );
+ return {
+ type: "bi.combo",
+ height: 50,
+ width: 130,
+ direction: "bottom",
+ toggle: true,
+ trigger: "hover",
+ cls: baseCls,
+ isNeedAdjustWidth: false,
+ ref: function (e) {
+ that.pop = e;
+ $(e.element).click(function () {
+ if (item.entryType !== 3) {
+ openEntityCard(item);
+ } else {
+ }
+ })
+ },
+ listeners: [
+ {
+ eventName: "EVENT_EXPAND",
+ action: function () {
+ }
+ }
+ ],
+ el: tiger,
+ //弹出层
+ popup: {
+ el: {
+ cls: notShow,
+ type: "zxl.header.menu.item.popup",
+ menuType: item.entryType,
+ width: "auto",
+ item: item,
+ allMenu: allMenu,
+ level: level,
+ ref: function (e) {
+ that.popup = e;
+ }
+ },
+ layouts: [{
+ type: "bi.flex_vertical_adapt"
+ }]
+ }
+ };
+ }
+ });
+ BI.shortcut("zxl.header.menu.item", Widget);
+}());
+
+!(function () {
+
+ var Widget = BI.inherit(BI.Widget, {
+
+ props: {},
+ mounted: function () {
+ },
+ render: function () {
+ var that = this;
+ var tiger = {
+ type: "bi.icon_button",
+ cls: "three-point-font"
+ };
+ return {
+ type: "bi.combo",
+ height: 50,
+ width: 130,
+ direction: "bottom",
+ toggle: true,
+ trigger: "click",
+ isNeedAdjustWidth: false,
+ ref: function (e) {
+ that.pop = e;
+ },
+ listeners: [
+ {
+ eventName: "EVENT_EXPAND",
+ action: function () {
+ }
+ }
+ ],
+ el: tiger,
+ //弹出层
+ popup: {
+ cls: "zxl-ext-item-popup",
+ el: {
+ type: "zxl.header.menu.extItem.popup",
+ items: that.options.items,
+ ref: function (e) {
+ that.popup = e;
+ },
+ width: 228
+ },
+ height: "100%",
+ layouts: [{
+ type: "bi.flex_vertical_adapt"
+ }]
+ }
+ };
+ }
+ });
+ BI.shortcut("zxl.header.menu.extItem", Widget);
+}());
+
+function sortMenu(a, b) {
+ var value1 = a["sortIndex"];
+ var value2 = b["sortIndex"];
+ return value1 - value2;
+}
+
+/**
+ * menu item popup
+ */
+!(function () {
+ var Widget = BI.inherit(BI.Widget, {
+
+ props: {
+ baseCls: "",
+ width: "auto"
+ },
+
+ render: function () {
+ var tmp = '${zFontSize}';
+ var fontSize = 14;
+ if (!isNaN(parseInt(tmp))) {
+ fontSize = parseInt(tmp);
+ }
+
+ var that = this;
+ var item = this.options.item;
+ var cls = "forcedToHide";
+ var headerItems = [];
+ var headerMenuItems = [];
+ if (item.text === "管理系统") {
+ cls = "menu-popup";
+ var navs = BI.Constants.getConstant("dec.constant.management.navigation");
+ var temp = BI.filter(Dec.decisionModules, function (i, v) {
+ return v.id !== "decision-management-root" && v.id !== "decision-management-maintenance-bi-notification" && BI.find(navs, function (ii, vv) {
+ return v.id === vv.id;
+ })
+ });
+ var managementModules = BI.map(temp, function (i, v) {
+ return BI.find(navs, function (ii, vv) {
+ return v.id === vv.id;
+ })
+ });
+
+ var tempItems = BI.map(managementModules, function (i, v) {
+ return {
+ type: "bi.text_button",
+ text: v.text,
+ title: v.text,
+ css: {
+ fontSize: fontSize
+ },
+ cls: "header-menu-item",
+ handler: function () {
+ //管理目录要用这个打开
+ BI.Services.getService("dec.service.tabs").addItem(v);
+ }
+ }
+ });
+ headerMenuItems = [
+ {
+ type: "bi.vertical",
+ cls: "header-menu-row",
+ items: tempItems
+ }
+ ]
+ } else {
+ if (item.entryType === 3) {
+ var itemMenus = this.getChildMenu(item.id, true);
+ cls = "menu-popup";
+ if (itemMenus.length > 0) {
+ headerItems = BI.map(itemMenus, function (i, v) {
+ return {
+ type: "bi.label",
+ text: v.text,
+ cls: "header-item"
+ }
+ });
+ headerMenuItems = BI.map(itemMenus, function (i, v) {
+ var its = that.getChildMenu(v.id, false);
+ var items = BI.map(its, function (i, v) {
+ return {
+ type: "bi.text_button",
+ text: v.text,
+ title: v.text,
+ css: {
+ fontSize: fontSize
+ },
+ cls: "header-menu-item",
+ handler: function () {
+ openEntityCard(v)
+ }
+ }
+ });
+ return {
+ type: "bi.vertical",
+ cls: "header-menu-row",
+ items: items
+ }
+ });
+ if (this.hasChild(item.id)) {
+ headerItems.push({
+ type: "bi.label",
+ text: "",
+ cls: "header-item"
+ });
+ var childs = this.getChildMenu(item.id, false);
+ var items = BI.map(childs, function (i, v) {
+ return {
+ type: "bi.text_button",
+ text: v.text,
+ title: v.text,
+ css: {
+ fontSize: fontSize
+ },
+ cls: "header-menu-item",
+ handler: function () {
+ openEntityCard(v)
+ }
+ }
+ });
+ headerMenuItems.push({
+ type: "bi.vertical",
+ cls: "header-menu-row",
+ items: items
+ })
+ }
+ } else {
+ var childs = this.getChildMenu(item.id, false);
+ var ttp = BI.map(childs, function (i, v) {
+ return {
+ type: "bi.text_button",
+ text: v.text,
+ title: v.text,
+ css: {
+ fontSize: fontSize
+ },
+ cls: "header-menu-item",
+ handler: function () {
+ openEntityCard(v);
+ //BI.Services.getService("dec.service.tabs").addItem(v);
+ }
+ }
+ });
+ headerMenuItems = [
+ {
+ type: "bi.vertical",
+ cls: "header-menu-row",
+ items: ttp
+ }
+ ]
+ }
+ }
+ }
+ this.singleLine = headerItems.length === 0;
+
+ return {
+ width: "auto",
+ cls: cls,
+ type: "bi.vertical",
+ scrollable: true,
+ height: 350,
+ scrolly: false,
+ items: [
+ {
+ height: !this.singleLine ? 40 : 0,
+ type: "bi.button_group",
+ layouts: [
+ {
+ type: "bi.horizontal",
+ }
+ ],
+ items: headerItems,
+ ref: function (e) {
+ that.headerList = e;
+ }
+ }, {
+ height: !this.singleLine ? 280 : 350,
+ type: "bi.button_group",
+ cls: !this.singleLine ? "third-row zxl-menus" : "zxl-menus",
+ layouts: [
+ {
+ type: "bi.horizontal",
+ }
+ ],
+ items: headerMenuItems,
+ ref: function (e) {
+ that.itemList = e;
+ }
+ }]
+ };
+ },
+ mounted: function () {
+ var list = $(this.itemList.element);
+ list.slimScroll({
+ // width: '200px',
+ height: !this.singleLine ? "320px" : "350px",
+ size: '10px',
+ position: 'right',
+ alwaysVisible: true,
+ railVisible: true,
+ color: '#fff',
+ railColor: '#0091bb',
+ opacity: 1
+ });
+ // 在render方法里的子组件被渲染到页面之后的钩子函数
+ },
+ hasChild: function (menuId) {
+ return this.getChildMenu(menuId, false).length > 0
+ },
+ getChildMenu: function (menuId, findMenu) {
+ var items = [];
+ BI.each(this.options.allMenu, function (i, v) {
+ if (v.pId === menuId) {
+ if (findMenu) {
+ if (v.entryType === 3) {
+ items.push(v);
+ }
+ } else {
+ if (v.entryType !== 3) {
+ items.push(v);
+ }
+ }
+ }
+ return true;
+ });
+ return items.sort(sortMenu);
+ }
+ });
+ BI.shortcut("zxl.header.menu.item.popup", Widget);
+}());
+
+/**
+ * 头部搜索行
+ */
+!(function () {
+ var Widget = BI.inherit(BI.Widget, {
+
+ props: {
+ baseCls: "demo-header-search-row"
+ },
+
+ getLogo: function () {
+ if (BI.isEmpty(Dec.platformStyles.logoImgId)) {
+ if (Dec.BIEnable) {
+ return Dec.resourceURL + "resources/logo_BI.png"
+ } else {
+ return Dec.resourceURL + "resources/logo_FR.png"
+ }
+ } else {
+ return Dec.fineServletURL + "/v10/attach/image/" + Dec.platformStyles.logoImgId
+ }
+ },
+ render: function () {
+ var that = this;
+ return {
+ type: "bi.left_right_vertical_adapt",
+ height: 50,
+ items: {
+ left: [
+ {
+ type: "bi.flex_vertical_adapt",
+ height: "100%",
+ items: [
+ {
+ lgap: 26,
+ type: "bi.img",
+ src: this.getLogo(),
+ width: 49,
+ height: 40
+ },
+ {
+ type: "bi.label",
+ ref: function (e) {
+ that.title = e
+ },
+ textAlign: "left",
+ height: 40,
+ lgap: 15,
+ cls: " fs-banner-title",
+ text: Dec.platformStyles.platformTitle
+ }
+ ]
+ }
+ ]
+ ,
+ right: [
+ {
+ type: "bi.flex_vertical_adapt",
+ height: "100%",
+ items: [
+ {
+ type: "zxl.header.search.tools"
+ },
+ {
+ type: "dec.header.message"
+ }, {
+ type: "dec.account"
+ }, {
+ type: "demo.favorite",
+ width: 35
+ }
+ ]
+ },
+ ]
+ }
+ }
+ }
+ });
+ BI.shortcut("zxl.header.search.row", Widget);
+}());
+
+!(function () {
+ var Widget = BI.inherit(BI.Widget, {
+
+ props: {
+ baseCls: "demo-favorite"
+ },
+
+ beforeInit: function (render) {
+ var self = this;
+ Dec.Utils.getFavoritesList(function (res) {
+ self.items = res.data;
+ render();
+ });
+ },
+
+ render: function () {
+ var self = this;
+
+ var trigger = {
+ type: "bi.label",
+ text: "♡",
+ cls: "zxl-fav-font",
+ handler: function () {
+
+ }
+ };
+
+ var popup = {
+ type: "bi.button_group",
+ layouts: [
+ {
+ type: "bi.vertical",
+ vgap: 5
+ }
+ ],
+ ref: function (_ref) {
+ self.popup = _ref;
+ },
+ items: this._createItems()
+ };
+
+ return {
+ type: "bi.combo",
+ trigger: "click-hover",
+ el: trigger,
+ popup: {
+ el: popup,
+ cls: "demo-background",
+ minWidth: 200
+ }
+ };
+ },
+
+ _createItems: function () {
+ var self = this;
+ return BI.map(this.items, function (index, item) {
+ return BI.extend(item, {
+ type: "dec.frame.classic.aside.favorite_list.item",
+ closeable: true,
+ onClose: function () {
+ self._unFavorite(item.id);
+ },
+ handler: function () {
+ self._openFavorite(item);
+ }
+ });
+ });
+ },
+
+ _openFavorite: function (item) {
+ BI.Services.getService("dec.service.tabs").addItem(item);
+ },
+
+ _unFavorite: function (id) {
+ this.items = BI.filter(this.items, function (index, fav) {
+ return fav.id !== id;
+ });
+ this.popup.populate(this._createItems());
+ Dec.Utils.handlerCollect(id, false, BI.emptyFn);
+ }
+ });
+
+ BI.shortcut("demo.favorite", Widget);
+}());
+
+// 搜索
+!(function () {
+ var Widget = BI.inherit(BI.Widget, {
+
+ props: {
+ baseCls: "demo-header-search-row-search"
+ },
+ _store: function () {
+ return BI.Models.getModel("dec.model.zxl.menus.search")
+ },
+ watch: {
+ searchResult: function (v) {
+ var self = this;
+ if (v.length > 0) {
+ this.pop.showView();
+ var items = BI.map(this.model.searchResult, function (i, v) {
+ return $.extend({}, v, {
+ type: "bi.label",
+ textAlign: "left",
+ ref: function (e) {
+ $(e.element).click(function () {
+ self.pop.hideView();
+ openEntityCard(v);
+ })
+ }
+ });
+ });
+ this.list.populate(items)
+ } else {
+ this.pop.hideView();
+ }
+ }
+ },
+ render: function () {
+ var self = this;
+ return {
+ type: "bi.combo",
+ width: 192,
+ height: 30,
+ direction: "bottom",
+ ref: function (e) {
+ self.pop = e;
+ },
+ el: {
+ type: "bi.search_editor",
+ cls: "header-search-input cursor-pointer ",
+ width: 192,
+ height: 26,
+ watermark: "输入文本以检索模板",
+ listeners: [
+ {
+ eventName: "EVENT_CHANGE",
+ action: function () {
+ self.store.search(this.getValue());
+ }
+ }
+ ]
+ },
+ popup: {
+ el: {
+ type: "bi.button_group",
+ chooseType: BI.Selection.Single,
+ items: [],
+ ref: function (e) {
+ self.list = e;
+ },
+ layouts: [{
+ type: "bi.vertical"
+ }]
+ },
+
+ }
+ };
+ }
+ });
+ BI.shortcut("zxl.header.search.tools", Widget);
+}());
+// 用户消息弹出部分
+!(function () {
+ var Widget = BI.inherit(BI.Widget, {
+
+ props: {
+ baseCls: "zxl-msg-popup1"
+ },
+ _store: function () {
+ return BI.Models.getModel("dec.model.header.message.popup")
+ },
+ watch: {
+ currentPageItems: function () {
+ this.buttons.populate(this._getMessageItem());
+ },
+ },
+ _getMessageItem: function () {
+ var self = this;
+ var url = getImageUrl("msg_icon_hover.jpg");
+ var temp = BI.map(this.model.currentPageItems, function (i, v) {
+ return {
+ type: "bi.horizontal",
+ height: 59,
+ cls: "msg-row cursor-pointer ",
+ ref: function (e) {
+ $(e.element).click(function () {
+ self.store.jump(v);
+ self.fireEvent("EVENT_CLOSE");
+ });
+ $(e.element).hover(function () {
+ $(this).find(".msg-img").attr("src", getImageUrl("msg_icon_hover.jpg"));
+ },
+ function () {
+ $(this).find(".msg-img").attr("src", getImageUrl("msg_icon_norml.jpg"));
+ })
+ },
+ items: [
+ {
+ type: "bi.img",
+ cls: "msg-img",
+ src: url,
+ width: 20,
+ height: 20
+ },
+ {
+ type: "bi.label",
+ text: v.message,
+ textAlign: "left",
+ cls: "msg-text"
+ }
+ ]
+ };
+ });
+ return [
+ {
+ el: {
+ type: "bi.button_group",
+ chooseType: BI.Selection.Single,
+ layouts: [
+ {
+ type: "bi.vertical",
+ vgap: 20
+ }
+ ],
+ items: temp
+ },
+ height: "fill",
+ },
+ {
+ el: {
+ type: "bi.label",
+ cls: "today-look-all cursor-pointer ",
+ text: "查看全部消息",
+ ref: function (e) {
+ $(e.element).click(function () {
+ BI.Services.getService("dec.service.frame.tab_pane").openCustomTab("我的消息", "dec.message.manage")
+ self.fireEvent("EVENT_CLOSE");
+ });
+ }
+ },
+ height: 34,
+ }
+ ]
+ },
+ render: function () {
+ var self = this;
+ var items = [];
+ var item = {};
+ if (this.model.currentPageItems.length > 0) {
+ item = this._getMessageItem();
+ } else {
+ //渲染空白卡片
+ item = [
+ {
+ height: "fill",
+ el: {
+ type: "bi.label",
+ text: " ",
+ }
+ }
+ ,
+ {
+ el: {
+ bottom: 0,
+ type: "bi.label",
+ cls: "today-look-all cursor-pointer ",
+ text: "查看全部消息",
+ ref: function (e) {
+ $(e.element).click(function () {
+ BI.Services.getService("dec.service.frame.tab_pane").openCustomTab("我的消息", "dec.message.manage")
+ self.fireEvent("EVENT_CLOSE");
+ });
+ }
+ },
+ top: "none",
+ height: 34,
+ }
+ ]
+ }
+ return {
+ type: "bi.button_group",
+ height: 200,
+ ref: function (e) {
+ self.buttons = e;
+ },
+ layouts: [
+ {
+ type: "bi.vtape",
+ vgap: 5
+ }
+ ],
+ items: item,
+ };
+ }
+ });
+ BI.shortcut("zxl.header.msg.popup", Widget);
+}());
+// 消息啊
+!(function () {
+ var Widget = BI.inherit(BI.Widget, {
+
+ props: {
+ baseCls: "zxl-history-fav"
+ },
+ _store: function () {
+ return BI.Models.getModel("dec.model.header.message.combo.trigger")
+ },
+ watch: {
+ allItemsCount: function (e) {
+ if (0 === e) {
+ $(this.imga.element).attr("src", getImageUrl("msg.png")).removeClass("header-msg").addClass("header-msg-empty");
+ } else {
+ $(this.imga.element).attr("src", getImageUrl("newMsg.png")).removeClass("header-msg-empty").addClass("header-msg");
+ }
+ }
+ },
+ render: function () {
+ var self = this;
+ var url = getImageUrl("msg.png");
+ var cls = "header-msg-empty cursor-pointer ";
+ if (self.model.allItemsCount > 0) {
+ url = getImageUrl("newMsg.png");
+ cls = "header-msg cursor-pointer ";
+ }
+ return {
+ type: "bi.combo",
+ height: 30,
+ direction: "bottom",
+ adjustLength: 15,
+ adjustXOffset: -126,
+ ref: function (e) {
+ self.pop = e;
+ },
+ el: {
+ cls: cls,
+ type: "bi.img",
+ ref: function (e) {
+ self.imga = e;
+ },
+ src: url,
+ },
+ popup: {
+ cls: "zxl-msg-popup",
+ el: {
+ type: "zxl.header.msg.popup",
+ listeners: [{
+ eventName: "EVENT_CLOSE",
+ action: function () {
+ self.pop.hideView()
+ }
+ }]
+ },
+
+ }
+ };
+ }
+ });
+ BI.shortcut("zxl.header.msg.tools", Widget);
+}());
+!(function () {
+ var Node = BI.inherit(BI.BasicButton, {
+
+ props: {
+ baseCls: "demo-sidebar-expander",
+ items: [],
+ open: false
+ },
+
+ render: function () {
+ var self = this, o = this.options;
+ var trigger = {
+ type: "demo.sidebar.node",
+ text: o.text,
+ height: 42,
+ open: o.open,
+ iconCls: o.nodeIcon,
+ listeners: [
+ {
+ eventName: "EVENT_EXPAND",
+ action: function () {
+ self.showView();
+ }
+ }, {
+ eventName: "EVENT_COLLAPSE",
+ action: function () {
+ self.popuop.setVisible(false);
+ }
+ }
+ ]
+ };
+
+ var items = BI.createItems(o.items, {
+ type: "demo.sidebar.item",
+ lgap: 30,
+ height: 36
+ });
+ return {
+ type: "bi.vertical",
+ items: [
+ {
+ el: trigger
+ }, {
+ el: {
+ type: "bi.button_group",
+ cls: "demo-sidebar-expander-popup",
+ layouts: [
+ {
+ type: "bi.vertical"
+ }
+ ],
+ ref: function (_ref) {
+ self.popuop = _ref;
+ },
+ invisible: !o.open,
+ items: items
+ }
+ }
+ ]
+
+ };
+ },
+
+ showView: function () {
+ var self = this, o = this.options;
+ if (BI.isEmptyArray(o.items)) {
+ Dec.Utils.getWorkbenchSubDirectoryById(o.id, function (res) {
+ o.items = BI.map(res.data, function (index, item) {
+ return BI.extend({
+ type: "demo.sidebar.item",
+ lgap: 30
+ }, item);
+ });
+ self.popuop.populate(o.items);
+ self.popuop.setVisible(true);
+ });
+ } else {
+ self.popuop.setVisible(true);
+ }
+ }
+ });
+
+ BI.shortcut("demo.sidebar.expander", Node);
+}());
+!(function () {
+ var itemStorage = {};
+
+ Dec.inactiveOthers = function (id) {
+ BI.each(itemStorage, function (key, widget) {
+ widget.options.id !== id && widget.setSelected(false);
+ });
+ };
+
+ var Node = BI.inherit(BI.BasicButton, {
+
+ props: {
+ baseCls: "demo-sidebar-item",
+ id: "",
+ pId: "",
+ open: false,
+ height: 35,
+ iconCls: "dir-panel-folder-font"
+ },
+
+ mounted: function () {
+ itemStorage[this.options.id] = this;
+ },
+
+ render: function () {
+
+ var self = this, o = this.options;
+
+ return {
+ type: "bi.vertical_adapt",
+ lgap: o.lgap,
+ items: [
+ {
+ type: "bi.label",
+ textAlign: "left",
+ text: o.text,
+ title: o.text
+ }
+ ]
+ };
+ },
+
+ isOnce: function () {
+ return true;
+ },
+
+ getValue: function () {
+ return this.options.id;
+ },
+
+ doClick: function () {
+ var self = this;
+ Dec.inactiveOthers(this.options.id);
+ var module = BI.find(BI.Constants.getConstant("dec.constant.management.navigation"), function (index, item) {
+ return item.value === self.options.id;
+ });
+ if (module) {
+ BI.Services.getService("dec.service.tabs").addItem(module);
+ } else {
+ BI.Services.getService("dec.service.tabs").addItem(BI.deepClone(this.options));
+ }
+ }
+ });
+
+ BI.shortcut("demo.sidebar.item", Node);
+}());
+/**
+ *@desc 自定义的sidebar
+ *@author dailer
+ *@date 2018/12/25
+ */
+!(function () {
+ var Widget = BI.inherit(BI.Widget, {
+
+ props: {
+ baseCls: "demo-sidebar"
+ },
+
+ /**
+ * 初始化目录根节点和管理系统节点
+ */
+ beforeInit: function (render) {
+ var self = this;
+ this._initManagementModules(BI.emptyFn);
+ this._initEntries(render);
+ },
+
+ render: function () {
+ var items = [];
+ items.push({
+ el: {
+ type: "demo.sidebar.item",
+ cardType: "dec.dashboard",
+ text: "仪表板",
+ lgap: 10
+ }
+ });
+ items.push({
+ el: {
+ type: "bi.label",
+ textAlign: "left",
+ lgap: 10,
+ height: 46,
+ text: "目录"
+ }
+ });
+ items = BI.concat(items, this.rootEntries);
+ if (Dec.decisionModules.length > 0) {
+ items.push({
+ type: "demo.sidebar.expander",
+ text: "管理系统",
+ open: true,
+ items: this.managementModules
+ });
+ }
+ return {
+ type: "bi.absolute",
+ items: [
+ {
+ el: {
+ type: "bi.vertical",
+ items: items
+ },
+ top: 10, left: 0, right: 0, bottom: 0
+ }
+ ]
+
+ };
+ },
+
+ _initEntries: function (cb) {
+ var self = this;
+ Dec.Utils.getWorkbenchSubDirectoryById(DecCst.DIRECTORY_TREE_ROOT_ID, function (res) {
+ self.rootEntries = BI.map(res.data, function (index, item) {
+ return BI.extend({
+ type: "demo.sidebar.expander",
+ items: item.children
+ }, item);
+ });
+ cb();
+ });
+ },
+
+ _initManagementModules: function (cb) {
+ this.managementModules = BI.filter(BI.Constants.getConstant("dec.constant.management.navigation"), function (index, item) {
+ return item.id !== "decision-management-maintenance";
+ });
+ cb();
+ }
+ });
+
+ BI.shortcut("demo.sidebar", Widget);
+}());
+!(function () {
+ var Node = BI.inherit(BI.NodeButton, {
+
+ props: {
+ baseCls: "demo-sidebar-node",
+ id: "",
+ pId: "",
+ open: false,
+ height: 42,
+ iconCls: "dir-panel-folder-font"
+ },
+
+ render: function () {
+
+ var self = this, o = this.options;
+
+ var arrow = {
+ type: "bi.center_adapt",
+ cls: "platform-node-arrow",
+ items: [
+ {
+ el: {
+ type: "bi.icon_change_button",
+ ref: function (_ref) {
+ self.arrow = _ref;
+ },
+ iconCls: o.open ? "triangle-expand-font" : "triangle-collapse-font",
+ height: 16,
+ width: 16
+ }
+ }
+ ]
+ };
+
+ var icon = {
+ type: "bi.center_adapt",
+ height: o.height,
+ cls: "platform-node-icon " + o.iconCls,
+ items: [
+ {
+ type: "bi.icon",
+ height: o.height,
+ width: o.height
+ }
+ ]
+ };
+
+ var text = {
+ type: "bi.htape",
+ height: o.height,
+ items: [
+ {
+ el: {
+ type: "bi.label",
+ height: o.height,
+ textAlign: "left",
+ text: o.text
+ },
+ lgap: 5
+ }
+ ]
+ };
+
+ var items = [];
+ items.push({
+ type: "bi.layout",
+ width: 10,
+ height: o.height
+ });
+
+ items.push({
+ el: icon,
+ height: o.height,
+ width: o.height
+ });
+
+ items.push({
+ el: text,
+ height: o.height
+ });
+ items.push({
+ el: arrow,
+ height: o.height,
+ width: 16,
+ rgap: 10
+ });
+
+ return {
+ type: "bi.htape",
+ items: items
+ };
+ },
+
+ isOnce: function () {
+ return false;
+ },
+
+ getValue: function () {
+ return this.options.id;
+ },
+ setOpened: function (v) {
+ Node.superclass.setOpened.apply(this, arguments);
+ this.arrow.setIcon(v ? "triangle-expand-font" : "triangle-collapse-font");
+ this.fireEvent(v ? "EVENT_EXPAND" : "EVENT_COLLAPSE");
+ }
+ });
+
+ BI.shortcut("demo.sidebar.node", Node);
+}());