LAPTOP-SB56SG4Q\86185
2 years ago
8 changed files with 1069 additions and 1 deletions
Binary file not shown.
@ -1,3 +1,6 @@
|
||||
# open-JSD-9621 |
||||
|
||||
JSD-9621 顶部菜单主题 |
||||
JSD-9621 顶部菜单主题\ |
||||
免责说明:该源码为第三方爱好者提供,不保证源码和方案的可靠性,也不提供任何形式的源码教学指导和协助!\ |
||||
仅作为开发者学习参考使用!禁止用于任何商业用途!\ |
||||
为保护开发者隐私,开发者信息已隐去!若原开发者希望公开自己的信息,可联系hugh处理。 |
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?><plugin> |
||||
<id>com.eco.plugin.xxxx.theme.topMenu</id> |
||||
<name><![CDATA[菜单主题插件]]></name> |
||||
<active>yes</active> |
||||
<version>1.0.7</version> |
||||
<env-version>10.0</env-version> |
||||
<jartime>2018-07-31</jartime> |
||||
<vendor>fr.open</vendor> |
||||
<description><![CDATA[菜单主题插件]]></description> |
||||
<change-notes><![CDATA[ |
||||
]]></change-notes> |
||||
<main-package>com.fr.plugin.theme.topMenu</main-package> |
||||
|
||||
<extra-decision> |
||||
<ThemeVariousProvider class="com.fr.plugin.theme.topMenu.bean.Theme"/> |
||||
</extra-decision> |
||||
|
||||
<function-recorder class="com.fr.plugin.theme.topMenu.bean.Theme"/> |
||||
</plugin> |
@ -0,0 +1,36 @@
|
||||
package com.fr.plugin.theme.topMenu.bean; |
||||
|
||||
import com.fr.decision.fun.impl.AbstractThemeVariousProvider; |
||||
import com.fr.decision.web.MainComponent; |
||||
import com.fr.plugin.transform.FunctionRecorder; |
||||
import com.fr.stable.fun.Authorize; |
||||
import com.fr.web.struct.Atom; |
||||
|
||||
@Authorize(callSignKey = "com.eco.plugin.xxxx.theme.topMenu") |
||||
@FunctionRecorder |
||||
public class Theme extends AbstractThemeVariousProvider { |
||||
@Override |
||||
public String name() { |
||||
return "顶部菜单主题"; |
||||
} |
||||
|
||||
@Override |
||||
public String text() { |
||||
return "navigation"; |
||||
} |
||||
|
||||
@Override |
||||
public String coverPath() { |
||||
return "/com/fr/plugin/theme/topMenu/js/cover.png"; |
||||
} |
||||
|
||||
@Override |
||||
public Atom attach() { |
||||
return MainComponent.KEY; |
||||
} |
||||
|
||||
@Override |
||||
public Atom client() { |
||||
return ThemeAtom.KEY; |
||||
} |
||||
} |
@ -0,0 +1,42 @@
|
||||
package com.fr.plugin.theme.topMenu.bean; |
||||
|
||||
import com.fr.decision.config.AppearanceConfig; |
||||
import com.fr.plugin.context.PluginContexts; |
||||
import com.fr.web.struct.Component; |
||||
import com.fr.web.struct.Filter; |
||||
import com.fr.web.struct.browser.RequestClient; |
||||
import com.fr.web.struct.category.ScriptPath; |
||||
import com.fr.web.struct.category.StylePath; |
||||
|
||||
public class ThemeAtom extends Component { |
||||
public static final ThemeAtom KEY=new ThemeAtom(); |
||||
@Override |
||||
public ScriptPath script(RequestClient requestClient) { |
||||
if (PluginContexts.currentContext().isAvailable()) { |
||||
return ScriptPath.build("/com/fr/plugin/theme/topMenu/js/navigation.theme.js"); |
||||
} else { |
||||
return ScriptPath.EMPTY; |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public StylePath style(RequestClient requestClient) { |
||||
if (PluginContexts.currentContext().isAvailable()) { |
||||
return StylePath.build("/com/fr/plugin/theme/topMenu/js/navigation.theme.css"); |
||||
} else { |
||||
return StylePath.EMPTY; |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public Filter filter() { |
||||
return new Filter() { |
||||
@Override |
||||
public boolean accept() { |
||||
System.out.println(AppearanceConfig.getInstance().getThemeId()); |
||||
/*这边添加有一个过滤条件,只有切换使用了当前主题才引入这些js*/ |
||||
return "com.eco.plugin.xxxx.theme.topMenu".equals(AppearanceConfig.getInstance().getThemeId()); |
||||
} |
||||
}; |
||||
} |
||||
} |
After Width: | Height: | Size: 38 KiB |
@ -0,0 +1,73 @@
|
||||
.plugin-first-item-unselect |
||||
{ |
||||
z-index:99; |
||||
color:white |
||||
} |
||||
|
||||
div::-webkit-scrollbar{ |
||||
-webkit-appearance: none; |
||||
width: 10px; |
||||
height: 20px; |
||||
} |
||||
|
||||
#nav { |
||||
height:50px; |
||||
position:absolute; |
||||
overflow-x:auto; |
||||
z-index:99; |
||||
} |
||||
|
||||
#buttonlist{ |
||||
min-width:95%; |
||||
display:-webkit-flex; |
||||
display: flex; |
||||
flex-direction: row; |
||||
/*justify-content: space-around;*/ |
||||
overflow-x:auto; |
||||
} |
||||
|
||||
.buttion{ |
||||
height:40px; |
||||
width:100px; |
||||
background-color: rgb(44,61,89); |
||||
border:0 solid; |
||||
color:white; |
||||
overflow:hidden; |
||||
white-space: nowrap; |
||||
text-overflow: ellipsis; |
||||
} |
||||
|
||||
.buttion:hover{ |
||||
background-color: rgb(54,135,245) !important; |
||||
/*background-color: rgb(235,242,254) !important;*/ |
||||
} |
||||
|
||||
.menuli:hover{ |
||||
background-color: rgb(235,242,254) !important; |
||||
} |
||||
|
||||
.liDiv{ |
||||
width:150px; |
||||
/*background-color:rgb(50,150,245);*/ |
||||
background-color:rgb(245,247,254); |
||||
position:absolute; |
||||
z-index:99; |
||||
} |
||||
|
||||
.div1{ |
||||
width:150px; |
||||
height:30px; |
||||
cursor: pointer; |
||||
} |
||||
|
||||
.div1:hover{ |
||||
background-color: rgb(235,242,254) !important; |
||||
} |
||||
|
||||
|
||||
.menuli{ |
||||
font-size:15px; |
||||
margin-top:5px; |
||||
font-weight:bold; |
||||
} |
||||
|
@ -0,0 +1,895 @@
|
||||
var treeobj = {}; |
||||
var rootid = ""; |
||||
var menulist = []; |
||||
var classic = {}; |
||||
var bodya = {}; |
||||
var zdy = true; |
||||
//取消选中样式
|
||||
function cancelSelect(){ |
||||
$.each(menulist,function(index,item){ |
||||
this.element.css({"color":"white","font-weight":"normal","font-size":"13px"}); |
||||
}) |
||||
} |
||||
|
||||
//是否有管理菜单
|
||||
function hasManagement(){ |
||||
var array = BI.Constants.getConstant("dec.constant.menu.items"); |
||||
var hasManagement2 = false; |
||||
|
||||
$.each(array,function(index,item){ |
||||
if(item.value == "management"){ |
||||
hasManagement2 = true; |
||||
} |
||||
}) |
||||
|
||||
return hasManagement2; |
||||
} |
||||
|
||||
/** |
||||
* 打开第一个模板 |
||||
* @param rootid |
||||
*/ |
||||
function openFirstTmp(root){ |
||||
if(root.entryType == 5 || root.entryType == 102){ |
||||
openTemplate(root); |
||||
return true; |
||||
} |
||||
|
||||
var findTemp = false; |
||||
|
||||
var menuid = root.id; |
||||
var menus = getWorkbenchSubDirectoryByPId(menuid); |
||||
|
||||
if(menus != null && menus != undefined && menus.length > 0){ |
||||
for(var i=0;i<menus.length;i++){ |
||||
findTemp = openFirstTmp(menus[i]); |
||||
if(findTemp){ |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
|
||||
return findTemp; |
||||
} |
||||
|
||||
<!-- ------------------------------------dec.header--> |
||||
var e = BI.inherit(BI.Widget, { |
||||
props: { |
||||
baseCls: "bi-card dec-frame-header", |
||||
$testId: "dec-frame-header", |
||||
height: 40 |
||||
}, |
||||
_store: function () { |
||||
return BI.Models.getModel("dec.model.frame.header") |
||||
}, |
||||
watch: { |
||||
platformTitle: function (e) { |
||||
this.title.setText(e) |
||||
}, |
||||
headerType: function () { |
||||
this.logoContainer.populate(this._assertLogo()), |
||||
this._resizeWrapper() |
||||
}, |
||||
headerLogoAttachUrl: function (e) { |
||||
this.logoImg.setSrc(e) |
||||
} |
||||
}, |
||||
render: function () { |
||||
var t = this, |
||||
e = BI.Constants.getConstant("dec.constant.header.items"); |
||||
t.combo = []; |
||||
var rootMenue = getWorkbenchSubDirectoryByPId(DecCst.DIRECTORY_TREE_ROOT_ID); |
||||
var items2 = []; |
||||
var index = { |
||||
type: "bi.text_button", |
||||
text: "首页", |
||||
height: 30, |
||||
css:{"color":"white","font-size":"13px"}, |
||||
ref: function(_ref) { |
||||
menulist.push(_ref) ; |
||||
}, |
||||
handler: function () { |
||||
if(!zdy){ |
||||
zdy = true; |
||||
bodya.reset(); |
||||
} |
||||
|
||||
cancelSelect(); |
||||
this.element.css({"color":"white","font-weight":"900","font-size":"15px"}); |
||||
BI.Models.getModel("dec.model.menu").selectMenu("directory"); |
||||
window.parent.BI.Services.getService("dec.service.frame.tab_pane").showTab("dec-tabs-homapage"); |
||||
} |
||||
}; |
||||
|
||||
items2.push(index); |
||||
$.each(rootMenue,function(index,item){ |
||||
var text = item.text; |
||||
|
||||
var rootMenuObj ={ |
||||
type: "bi.text_button", |
||||
text: text, |
||||
height: 30, |
||||
css:{"color":"white"}, |
||||
ref: function(_ref) { |
||||
menulist.push(_ref) ; |
||||
}, |
||||
handler: function () { |
||||
if(zdy){ |
||||
zdy = false; |
||||
bodya.reset(); |
||||
} |
||||
|
||||
cancelSelect(); |
||||
this.element.css({"color":"white","font-weight":"900","font-size":"15px"}); |
||||
rootid = item.id; |
||||
BI.Models.getModel("dec.model.menu").selectMenu("directory"); |
||||
|
||||
if(typeof treeobj.reset == 'function'){ |
||||
treeobj.reset(); |
||||
} |
||||
|
||||
openFirstTmp(item); |
||||
} |
||||
} |
||||
|
||||
var isParent = item.isParent; |
||||
if(!isParent){ |
||||
rootMenuObj ={ |
||||
type: "bi.text_button", |
||||
text: text, |
||||
height: 30, |
||||
css:{"color":"white","font-size":"13px"}, |
||||
ref: function(_ref) { |
||||
menulist.push(_ref) ; |
||||
}, |
||||
handler: function () { |
||||
if(zdy){ |
||||
zdy = false; |
||||
bodya.reset(); |
||||
} |
||||
cancelSelect(); |
||||
this.element.css({"color":"white","font-weight":"900","font-size":"15px"}); |
||||
BI.Models.getModel("dec.model.menu").selectMenu("directory"); |
||||
openTemplate(item); |
||||
} |
||||
} |
||||
} |
||||
|
||||
items2.push(rootMenuObj) |
||||
}); |
||||
|
||||
if(hasManagement()){ |
||||
//管理系统
|
||||
var manageMentCombo ={ |
||||
type: "bi.text_button", |
||||
text: "系统管理", |
||||
height: 30, |
||||
css:{"color":"white","font-size":"13px"}, |
||||
ref: function(_ref) { |
||||
menulist.push(_ref) ; |
||||
}, |
||||
handler: function () { |
||||
if(zdy){ |
||||
zdy = false; |
||||
bodya.reset(); |
||||
} |
||||
cancelSelect(); |
||||
this.element.css({"color":"white","font-weight":"900","font-size":"15px"}); |
||||
BI.Models.getModel("dec.model.menu").selectMenu("management"); |
||||
} |
||||
} |
||||
|
||||
items2.push(manageMentCombo); |
||||
} |
||||
|
||||
|
||||
var menue ={ |
||||
type: "bi.vertical_adapt", |
||||
width:1200, |
||||
height:40, |
||||
scrollx:true, |
||||
lgap:40, |
||||
items: items2 |
||||
}; |
||||
|
||||
var label = { |
||||
type:"bi.label", |
||||
text:'111' |
||||
} |
||||
|
||||
//decision及图标
|
||||
var title = { |
||||
type: "bi.button_group", |
||||
items: this._assertLogo(), |
||||
layouts: [{ |
||||
type: "bi.vertical_adapt" |
||||
} |
||||
], |
||||
ref: function (e) { |
||||
t.logoContainer = e |
||||
} |
||||
}; |
||||
|
||||
//左边title+菜单
|
||||
var headerLeft = { |
||||
el:{ |
||||
type: "bi.vertical", |
||||
|
||||
items: [{ |
||||
type: "bi.vertical_adapt", |
||||
items: [title,menue] |
||||
}], |
||||
}, |
||||
top: 0, |
||||
bottom: 0, |
||||
left: 0 |
||||
} |
||||
|
||||
//用户信息
|
||||
var account ={ |
||||
el: { |
||||
type: "bi.right_vertical_adapt", |
||||
items: BI.createItems(e, {}, { |
||||
rgap: 15 |
||||
}) |
||||
}, |
||||
top: 100, |
||||
bottom: 0, |
||||
right: 0 |
||||
}; |
||||
|
||||
//获取屏幕宽度
|
||||
var width = document.documentElement.clientWidth || document.body.clientWidth; |
||||
|
||||
return { |
||||
type: "bi.absolute", |
||||
ref: function (e) { |
||||
t.headWrapper = e |
||||
}, |
||||
items:[{ |
||||
el:{ |
||||
type: "bi.horizontal_fill", |
||||
columnSize: ["fill", ""], |
||||
items:[headerLeft,account], |
||||
width:width, |
||||
}, |
||||
top: 0, |
||||
bottom: 0, |
||||
right: 0 |
||||
}] |
||||
} |
||||
}, |
||||
created: function () { |
||||
BI.Services.getService("dec.service.main").registerGlobalComponent("Header", this) |
||||
}, |
||||
_assertLogo: function () { |
||||
var t = this, |
||||
e = BI.Providers.getProvider("dec.provider.frame.header").getLogoConfig(), |
||||
e = this.model.headerType === DecCst.PlatformStyle.HeaderType.INTEGRATED ? { |
||||
el: { |
||||
type: "bi.img", |
||||
$testId: "dec-header-logo", |
||||
src: this.model.headerLogoAttachUrl, |
||||
height: e.imgHeight, |
||||
width: "auto", |
||||
ref: function (e) { |
||||
t.logoImg = e |
||||
} |
||||
}, |
||||
hgap: 25 |
||||
} |
||||
: BI.extend({ |
||||
type: "dec.logo.img.button", |
||||
cls: "dec-pane dec-frame-panel", |
||||
ref: function (e) { |
||||
t.logoImg = e |
||||
}, |
||||
src: this.model.headerLogoAttachUrl, |
||||
width: 70, |
||||
height: 40 |
||||
}, e); |
||||
return [e, { |
||||
type: "bi.label", |
||||
$testId: "dec-header-platform-title", |
||||
ref: function (e) { |
||||
t.title = e |
||||
}, |
||||
textAlign: "left", |
||||
height: 40, |
||||
lgap: this.model.headerType === DecCst.PlatformStyle.HeaderType.INTEGRATED ? 0 : 15, |
||||
cls: "dec-banner dec-frame-text", |
||||
text: this.model.platformTitle |
||||
} |
||||
] |
||||
}, |
||||
_resizeWrapper: function () { |
||||
this.headWrapper.attr("items")[1].left = 1 === this.model.headerType ? 70 : 50, |
||||
this.headWrapper.resize() |
||||
} |
||||
}); |
||||
BI.shortcut("dec.header", e); |
||||
|
||||
var e = BI.inherit(BI.Widget, { |
||||
props: { |
||||
baseCls: "" |
||||
}, |
||||
_store: function () { |
||||
return BI.Models.getModel("dec.model.frame.classic.aside.entry_tree_wink") |
||||
}, |
||||
watch: { |
||||
selectedId: function () { |
||||
this.tree.setValue(this.model.selectedId) |
||||
}, |
||||
entries: function () { |
||||
this.populate() |
||||
} |
||||
}, |
||||
beforeInit: function (e) { |
||||
this.store.initEntryTrees(e) |
||||
}, |
||||
render: function () { |
||||
var n = this; |
||||
this.options; |
||||
return { |
||||
type: "dec.common.scroll_view", |
||||
ref: function(_ref) { |
||||
treeobj = _ref; |
||||
}, |
||||
content: { |
||||
el: { |
||||
type: "bi.vertical", |
||||
items: [{ |
||||
type: "bi.custom_tree", |
||||
ref: function (e) { |
||||
n.tree = e |
||||
}, |
||||
expander: { |
||||
el: {}, |
||||
popup: { |
||||
type: "bi.custom_tree" |
||||
} |
||||
}, |
||||
items: this.model.items, |
||||
el: { |
||||
type: "bi.loader", |
||||
next: !1, |
||||
isDefaultInit: !0, |
||||
el: { |
||||
type: "bi.button_tree", |
||||
chooseType: 0, |
||||
layouts: [{ |
||||
type: "bi.vertical" |
||||
} |
||||
] |
||||
} |
||||
}, |
||||
itemsCreator: function (e, t) { |
||||
e.node ? n.store.getSubItemsByPId(e.node.id, e.node.layer + 1, function (e) { |
||||
t(e) |
||||
}) : n.store.initRootNodes(function (e) { |
||||
t(e) |
||||
}) |
||||
}, |
||||
listeners: [{ |
||||
eventName: BI.Controller.EVENT_CHANGE, |
||||
action: function (e, t, i) { |
||||
e === BI.Events.EXPAND && n.store.expandNode(i.getValue()), |
||||
e === BI.Events.COLLAPSE && n.store.collapseNode(i.getValue()), |
||||
e === BI.Events.CLICK && n.store.openTab(t) |
||||
} |
||||
} |
||||
] |
||||
} |
||||
] |
||||
} |
||||
} |
||||
} |
||||
}, |
||||
populate: function () { |
||||
this.tree.populate() |
||||
} |
||||
}); |
||||
BI.shortcut("dec.frame.classic.aside.entry_tree_wink", e); |
||||
|
||||
var e = BI.inherit(Fix.Model, { |
||||
init: function () { |
||||
this.openStateMap = {} |
||||
}, |
||||
state: function () { |
||||
return { |
||||
openRoot: null |
||||
} |
||||
}, |
||||
context: ["isPin", "favorites", "entries", "selectedId", "loading"], |
||||
computed: { |
||||
selectedMenu: function () { |
||||
return Dec.globleModel.selectedMenu |
||||
} |
||||
}, |
||||
watch: { |
||||
selectedMenu: function (e) { |
||||
"directory" === e && this.initEntryTrees(BI.emptyFn) |
||||
} |
||||
}, |
||||
actions: { |
||||
initEntryTrees: function (t) { |
||||
var i = this; |
||||
this.toggleLoading(!0), |
||||
Dec.Utils.getFavoritesList(function (e) { |
||||
i.model.favorites = BI.Services.getService("dec.service.frame.entry").normalizeEntries(e.data, !1) |
||||
}), |
||||
Dec.Utils.getCompleteDirectoryTree(function (e) { |
||||
i.model.entries = BI.Services.getService("dec.service.frame.entry").normalizeEntries(e.data), |
||||
i.toggleLoading(!1), |
||||
t() |
||||
}) |
||||
}, |
||||
openTab: function (i) { |
||||
var e = BI.find(this.model.entries, function (e, t) { |
||||
return t && t.id === i |
||||
}); |
||||
this.model.selectedId = i, |
||||
BI.Providers.getProvider("dec.provider.tab_pane").behaviour("addCardByName", e.id, { |
||||
text: e.text, |
||||
value: e.id, |
||||
entry: !0, |
||||
entryDetails: e, |
||||
cardType: { |
||||
src: e.iframeSrc |
||||
} |
||||
}) |
||||
}, |
||||
initRootNodes: function (e) { |
||||
if(rootid != ""){ |
||||
this.getSubItemsByPId(rootid, 0, e) |
||||
} |
||||
}, |
||||
getSubItemsByPId: function (e, t, i) { |
||||
e = this._getSubItemsByPId(e); |
||||
i(this._formatItems(e, t)) |
||||
}, |
||||
expandNode: function (e) { |
||||
this.openStateMap[e] = !0 |
||||
}, |
||||
collapseNode: function (e) { |
||||
this.openStateMap[e] = !1 |
||||
}, |
||||
toggleLoading: function (e) { |
||||
this.model.loading = e |
||||
} |
||||
}, |
||||
_formatItems: function (e, n) { |
||||
var o = this, |
||||
e = BI.deepClone(e); |
||||
return BI.each(e, function (e, t) { |
||||
var i = { |
||||
layer: n, |
||||
$value: n + "-" + t.text, |
||||
height: DecCst.Entry_Node_Size.HEIGHT |
||||
}; |
||||
BI.isNotNull(o.openStateMap[t.id]) && (i.open = !!o.openStateMap[t.id]), |
||||
!0 === t.isParent ? (i.type = "dec.common.img.icon_text_node", i.cls = "dec-frame-platform-list-item dec-font-size-14") : (i.type = "dec.common.img.icon_text_item", i.cls = "dec-frame-platform-list-item-active dec-font-size-14", t.selected = t.id === o.model.selectedId), |
||||
BI.extend(t, i) |
||||
}), |
||||
e |
||||
}, |
||||
_getSubItemsByPId: function (i) { |
||||
var e = BI.filter(this.model.entries, function (e, t) { |
||||
return t.pId === i |
||||
}); |
||||
return BI.sortBy(e, "sortIndex") |
||||
} |
||||
}); |
||||
BI.model("dec.model.frame.classic.aside.entry_tree_wink", e); |
||||
|
||||
BI.constant("dec.constant.workbench.panel.tabs", [{ |
||||
value: "directory", |
||||
title: BI.i18nText("Dec-Directory"), |
||||
cls: "directory-font", |
||||
cardType: "dec.frame.classic.aside.entry_tree_wink" |
||||
}, { |
||||
value: "favorite", |
||||
title: BI.i18nText("Dec-Basic_Favorite"), |
||||
cls: "favorite-font", |
||||
cardType: "dec.frame.classic.aside.favorite_list" |
||||
} |
||||
]) |
||||
|
||||
//获取树列表同步方式
|
||||
function getWorkbenchSubDirectoryByPId(pId) |
||||
{ |
||||
var result = []; |
||||
var token = getToken(); |
||||
|
||||
$.ajax({ |
||||
type:'GET', |
||||
async:false, |
||||
url:Dec.fineServletURL+"/v10/" + pId + "/entries", |
||||
beforeSend: function (XMLHttpRequest) { |
||||
XMLHttpRequest.setRequestHeader("Authorization","Bearer "+token ); |
||||
}, |
||||
success:function(data) |
||||
{ |
||||
if(data.data != null) |
||||
{ |
||||
result = data.data; |
||||
} |
||||
} |
||||
}) |
||||
|
||||
return result; |
||||
} |
||||
|
||||
//获取token
|
||||
function getToken(){ |
||||
var strcookie = document.cookie;//获取cookie字符串
|
||||
var arrcookie = strcookie.split("; ");//分割
|
||||
//遍历匹配
|
||||
for ( var i = 0; i < arrcookie.length; i++) { |
||||
var arr = arrcookie[i].split("="); |
||||
if (arr[0] == "fine_auth_token"){ |
||||
return arr[1]; |
||||
} |
||||
} |
||||
return ""; |
||||
} |
||||
|
||||
|
||||
|
||||
//模板打开方法
|
||||
function openTemplate(item){ |
||||
var src = Dec.fineServletURL+"/v10/entry/access/"+item.id; |
||||
|
||||
if(item.entryType == 5){ |
||||
src = item.path; |
||||
} |
||||
BI.Providers.getProvider("dec.provider.tab_pane").behaviour("addCardByName", item.id, { |
||||
text: item.text, |
||||
value: item.id, |
||||
entry: !0, |
||||
cardType: { |
||||
src: src |
||||
} |
||||
}) |
||||
|
||||
}; |
||||
|
||||
<!-- 隐藏左侧菜单 --> |
||||
BI.provider("dec.provider.layout", function () { |
||||
var i = function (e) { |
||||
return { |
||||
type: "bi.absolute", |
||||
items: [{ |
||||
el: { |
||||
type: "bi.absolute", |
||||
items: [{ |
||||
el: { |
||||
type: "dec.body" |
||||
}, |
||||
top: 0, |
||||
bottom: 0, |
||||
right: 0, |
||||
left: 0 |
||||
} |
||||
] |
||||
}, |
||||
top: e.north.invisible ? 0 : e.north.height, |
||||
left: 0, |
||||
right: 0, |
||||
bottom: 0 |
||||
}, { |
||||
el: { |
||||
type: "dec.header", |
||||
height: e.north.height, |
||||
invisible: e.north.invisible |
||||
}, |
||||
height: e.north.height, |
||||
top: 0, |
||||
left: 0, |
||||
right: 0 |
||||
} |
||||
] |
||||
} |
||||
}; |
||||
this.inject = function (t) { |
||||
(t = t || {}).layoutConfig && BI.config("dec.constant.config", function (e) { |
||||
return BI.extend(e.config4Frame, t.layoutConfig), |
||||
e |
||||
}), |
||||
t.layoutStrategy && (i = t.layoutStrategy) |
||||
}, |
||||
this.setConfig = function (e) { |
||||
i = function () { |
||||
return e |
||||
} |
||||
}, |
||||
this.$get = function () { |
||||
return function () { |
||||
this.getLayoutStrategy = function () { |
||||
var e = BI.Constants.getConstant("dec.constant.config").config4Frame; |
||||
return BI.isFunction(i) ? i(e) : i |
||||
}, |
||||
this.getLayoutConfig = function () { |
||||
return BI.Constants.getConstant("dec.constant.config") |
||||
} |
||||
} |
||||
} |
||||
}); |
||||
var inithome = false; |
||||
var e = BI.inherit(BI.Widget, { |
||||
props: { |
||||
baseCls: "dec-frame-classic dec-frame-popover", |
||||
$testId: "dec-frame-classic" |
||||
}, |
||||
_store: function () { |
||||
return BI.Models.getModel("dec.model.frame.classic") |
||||
}, |
||||
watch: { |
||||
isPin: function (e) { |
||||
this.resizer.setResizeable(e) |
||||
} |
||||
}, |
||||
created: function () { |
||||
BI.Providers.getProvider("dec.provider.frame.classic").registerEntryPaneInstance(this) |
||||
}, |
||||
mounted: function () { |
||||
if(!inithome){ |
||||
this.store.initHomepage() |
||||
inithome = true; |
||||
} |
||||
}, |
||||
render: function () { |
||||
var i = this, |
||||
e = BI.get(BI.Providers.getProvider("dec.provider.layout").getLayoutConfig(), "config4Frame.center"); |
||||
return { |
||||
type: "dec.common.drag_resize", |
||||
ref: function (e) { |
||||
// bodya = e;
|
||||
i.resizer = e |
||||
}, |
||||
resizeable: this.model.isPin, |
||||
open: this.model.isPin, |
||||
leftWidth: zdy ? 15 : (e.left.width || 240), |
||||
maxSize: e.left.maxSize, |
||||
minSize: e.left.minSize, |
||||
content: BI.Providers.getProvider("dec.provider.tab_pane").getTabPaneComponent({ |
||||
ref: function (e) { |
||||
i.container = e |
||||
}, |
||||
listeners: [{ |
||||
eventName: "EVENT_SHOW", |
||||
action: function (e) { |
||||
i.store.handleTabChange(e) |
||||
} |
||||
}, { |
||||
eventName: "EVENT_CLOSE", |
||||
action: function (e, t) { |
||||
i.store.handleTabClose(e, t) |
||||
} |
||||
} |
||||
] |
||||
}), |
||||
popup: { |
||||
type: "dec.frame.classic.aside", |
||||
pinedPane: this.model.isPin, |
||||
cls: this.model.isPin ? "pined" : "un-pined" |
||||
} |
||||
} |
||||
}, |
||||
keepalive: function () { |
||||
return !0 |
||||
} |
||||
}); |
||||
BI.shortcut("dec.frame.classic", e); |
||||
|
||||
var e = BI.inherit(BI.Widget, { |
||||
props: { |
||||
baseCls: "dec-frame-body" |
||||
}, |
||||
_store: function () { |
||||
return BI.Models.getModel("dec.model.body") |
||||
}, |
||||
watch: { |
||||
showCard: function (e) { |
||||
var t = BI.Providers.getProvider("dec.provider.router").checkHashAuthority(); |
||||
this.tab.setSelect(t ? e : "ERROR_TAB") |
||||
} |
||||
}, |
||||
render: function () { |
||||
var t = this; |
||||
return { |
||||
type: "bi.absolute", |
||||
ref: function (e) { |
||||
bodya = e; |
||||
t.tab = e; |
||||
}, |
||||
items: [{ |
||||
el: { |
||||
type: "bi.layout", |
||||
cls: "dec-frame-body-top-shadow", |
||||
height: 100, |
||||
invisible: BI.isIE() && BI.getIEVersion() < 11 |
||||
}, |
||||
top: 0, |
||||
left: 0, |
||||
right: 0 |
||||
}, { |
||||
el: { |
||||
type: "dec.component.tabs", |
||||
ref: function (e) { |
||||
t.tab = e |
||||
}, |
||||
layout: { |
||||
type: "bi.vertical", |
||||
scrolly: !1 |
||||
}, |
||||
single: !0, |
||||
showIndex: this.model.showCard, |
||||
cardCreator: BI.bind(this.store.createCard, this) |
||||
}, |
||||
top: 0, |
||||
left: 0, |
||||
right: 0, |
||||
bottom: 0 |
||||
} |
||||
] |
||||
} |
||||
}, |
||||
created: function () { |
||||
BI.Services.getService("dec.service.main").registerGlobalComponent("Body", this) |
||||
} |
||||
}); |
||||
BI.shortcut("dec.body", e); |
||||
|
||||
var e = BI.inherit(BI.Pane, { |
||||
props: { |
||||
baseCls: "dec-frame-classic-aside dec-frame-popover bi-border-right dec-frame-split-border", |
||||
$testId: "dec-frame-classic-aside", |
||||
pinedPane: !1 |
||||
}, |
||||
_store: function () { |
||||
return BI.Models.getModel("dec.model.frame.classic.aside") |
||||
}, |
||||
watch: { |
||||
activeNav: function (e) { |
||||
this.tab.setSelect(e) |
||||
}, |
||||
isSearching: function (e) { |
||||
this.searcher.setValue(""), |
||||
this.searcher.setVisible(e), |
||||
this.navs.setVisible(!e), |
||||
e && this.searcher.focus() |
||||
}, |
||||
isPin: function (e) { |
||||
this.pinIcon.setIcon(e ? "unpin-font" : "pin-font"), |
||||
e ? (this.element.addClass("pined").removeClass("un-pined"), this.element.addClass("bi-border-right")) : (this.element.removeClass("pined").addClass("un-pined"), this.element.removeClass("bi-border-right")) |
||||
}, |
||||
loading: function () { |
||||
this.model.loading ? this.loading() : this.loaded() |
||||
} |
||||
}, |
||||
mounted: function () { |
||||
BI.Services.getService("dec.service.style.configure").watchStyle(this) |
||||
}, |
||||
render: function () { |
||||
var i = this, |
||||
e = this.options, |
||||
t = BI.get(BI.Constants.getConstant("dec.constant.config"), "config4EntryPane.pinable"); |
||||
this.model.isPin ? this.element.addClass("bi-border-right") : this.element.removeClass("bi-border-right"); |
||||
var n = { |
||||
type: "dec.closeable.editor", |
||||
ref: function (e) { |
||||
i.searcher = e |
||||
}, |
||||
invisible: !0, |
||||
cls: "bi-border", |
||||
iconCls: "dec-frame-popover", |
||||
height: 22, |
||||
watermark: BI.i18nText("BI-Basic_Search"), |
||||
listeners: [{ |
||||
eventName: "EVENT_CHANGE", |
||||
action: function () { |
||||
i.store.doSearch(this.getValue()) |
||||
} |
||||
}, { |
||||
eventName: "EVENT_CLEAR", |
||||
action: function () { |
||||
i.store.stopSearch() |
||||
} |
||||
} |
||||
] |
||||
}; |
||||
return { |
||||
type: "bi.absolute", |
||||
scrollable: !1, |
||||
items: [{ |
||||
el: { |
||||
type: "bi.button_group", |
||||
ref: function (e) { |
||||
i.navs = e |
||||
}, |
||||
height: 30, |
||||
cls: "pane-tabs-button-wrapper dec-frame-classic-nav", |
||||
layouts: [{ |
||||
type: "bi.vertical_adapt" |
||||
} |
||||
], |
||||
items: this.model.tabs, |
||||
value: this.model.activeNav, |
||||
listeners: [{ |
||||
eventName: BI.Controller.EVENT_CHANGE, |
||||
action: function (e, t) { |
||||
i.store.selectNav(t) |
||||
} |
||||
} |
||||
] |
||||
}, |
||||
top: 15, |
||||
left: 15 |
||||
}, { |
||||
el: { |
||||
type: "bi.icon_change_button", |
||||
$testId: "dec-icon-change-btn", |
||||
$value: "pin", |
||||
ref: function (e) { |
||||
i.pinIcon = e |
||||
}, |
||||
width: 24, |
||||
height: 24, |
||||
invisible: !t, |
||||
iconCls: e.pinedPane ? "unpin-font" : "pin-font", |
||||
cls: "dec-frame-text", |
||||
title: function () { |
||||
return i.model.isPin ? BI.i18nText("Dec-Cancel_Pin_Panel") : BI.i18nText("Dec-Pin_Panel") |
||||
}, |
||||
handler: function () { |
||||
i.store.pinPane() |
||||
} |
||||
}, |
||||
top: 18, |
||||
right: 15 |
||||
}, { |
||||
el: { |
||||
type: "bi.icon_button", |
||||
$value: "search", |
||||
cls: "platform-search-font platform-slide-pane-icon dec-frame-text", |
||||
width: 24, |
||||
height: 24, |
||||
ref: function (e) { |
||||
i.searchBtn = e |
||||
}, |
||||
handler: function () { |
||||
i.store.startSearch() |
||||
} |
||||
}, |
||||
top: 18, |
||||
right: 45 |
||||
}, { |
||||
el: n, |
||||
top: 18, |
||||
left: 10, |
||||
right: 45 |
||||
}, { |
||||
el: { |
||||
type: "bi.tab", |
||||
ref: function () { |
||||
i.tab = this |
||||
}, |
||||
single: !1, |
||||
showIndex: this.model.activeNav, |
||||
cardCreator: BI.bind(this.store.createTab, this.store) |
||||
}, |
||||
top: 60, |
||||
bottom: 0, |
||||
left: 0, |
||||
right: 0 |
||||
} |
||||
] |
||||
} |
||||
}, |
||||
created: function () { |
||||
BI.Services.getService("dec.service.main").registerGlobalComponent("WorkbenchPanel", this) |
||||
} |
||||
}); |
||||
BI.shortcut("dec.frame.classic.aside", e); |
||||
|
Loading…
Reference in new issue