|
|
@@ -1,7 +1,13 @@
|
|
|
<template>
|
|
|
- <div class="menu-side left_col scroll-view" :style="{width: width+ 'px'}">
|
|
|
+ <div
|
|
|
+ class="menu-side left_col scroll-view"
|
|
|
+ :style="{ width: width + 'px', backgroundColor: leftColor }"
|
|
|
+ >
|
|
|
<div class="navbar nav_title" style="border: 0">
|
|
|
- <a href="#/desktop/dashboard" class="site_title"><img style="width: 150px;" src="/static/assets/client-base-v4/image/template-logo_42.png" /></a>
|
|
|
+ <a href="#/desktop/dashboard" class="site_title"><img
|
|
|
+ :style="{ width: logoWidth + 'px'}"
|
|
|
+ :src="logoUrl"
|
|
|
+ /></a>
|
|
|
</div>
|
|
|
|
|
|
<div class="clearfix" />
|
|
|
@@ -15,6 +21,7 @@
|
|
|
type="text"
|
|
|
class="form-control menu-search"
|
|
|
:placeholder="$t('lang.menuWidget.searchMenu')"
|
|
|
+ :style="{ backgroundColor: searchColor }"
|
|
|
/>
|
|
|
</div>
|
|
|
|
|
|
@@ -36,9 +43,13 @@
|
|
|
class="nav menu-nav child_menu"
|
|
|
:class="{ active: rootNode.expand == true }"
|
|
|
>
|
|
|
- <template v-for="subMenuItem in rootNode.subMenus" :key="subMenuItem.uuid">
|
|
|
+ <template
|
|
|
+ v-for="subMenuItem in rootNode.subMenus"
|
|
|
+ :key="subMenuItem.uuid"
|
|
|
+ >
|
|
|
<MenuNode
|
|
|
-
|
|
|
+ :menu-color="menuColor"
|
|
|
+ :select-color="selectColor"
|
|
|
:model="subMenuItem"
|
|
|
@select-node="selectNode($event, rootNode.subMenus)"
|
|
|
/>
|
|
|
@@ -60,22 +71,42 @@ import MenuNode from './MenuNode.vue';
|
|
|
import { Uuid } from 'pc-component-v3';
|
|
|
|
|
|
export default {
|
|
|
-
|
|
|
components: {
|
|
|
MenuNode,
|
|
|
},
|
|
|
props: {
|
|
|
- width:{
|
|
|
- default:230,
|
|
|
- type:Number,
|
|
|
+ width: {
|
|
|
+ default: 230,
|
|
|
+ type: Number,
|
|
|
+ },
|
|
|
+ logoWidth: {
|
|
|
+ default: 152,
|
|
|
+ type: Number,
|
|
|
+ },
|
|
|
+ leftColor: {
|
|
|
+ default: '#2a3f54',
|
|
|
+ type: String,
|
|
|
+ },
|
|
|
+ menuColor: {
|
|
|
+ default: 'linear-gradient(#334556, #2c4257), #2a3f54',
|
|
|
+ type: String,
|
|
|
},
|
|
|
- },
|
|
|
+ searchColor: {
|
|
|
+ default: '#1c3e4b',
|
|
|
+ type: String,
|
|
|
+ },
|
|
|
+ selectColor: {
|
|
|
+ default: '#495d70',
|
|
|
+ type: String,
|
|
|
+ },
|
|
|
+ },
|
|
|
data: function () {
|
|
|
this.Language = Language;
|
|
|
return {
|
|
|
rootNodes: [],
|
|
|
selectedNode: {}, // 选择的节点
|
|
|
searchText: '',
|
|
|
+ logoUrl: '', // logo路径
|
|
|
};
|
|
|
},
|
|
|
|
|
|
@@ -88,6 +119,7 @@ export default {
|
|
|
mounted: function () {
|
|
|
var _self = this;
|
|
|
this.loadMenuData();
|
|
|
+ this.getLogoName();
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
@@ -111,10 +143,10 @@ export default {
|
|
|
Common.addTokenToRequest(request);
|
|
|
},
|
|
|
success: function (data1) {
|
|
|
- if(data1 != null){
|
|
|
+ if (data1 != null) {
|
|
|
console.log(data1);
|
|
|
_self.formateCollectionMenuData(data, data1);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
_self.formateMenuData(data);
|
|
|
}
|
|
|
},
|
|
|
@@ -157,11 +189,13 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
|
|
|
-
|
|
|
// 格式化菜单数据
|
|
|
formateCollectionMenuData: function (datas, collections) {
|
|
|
var _self = this;
|
|
|
- if ((datas == null || datas.length == 0) && (collections == null || collections.length == 0)) {
|
|
|
+ if (
|
|
|
+ (datas == null || datas.length == 0) &&
|
|
|
+ (collections == null || collections.length == 0)
|
|
|
+ ) {
|
|
|
return;
|
|
|
}
|
|
|
// 对菜单进行排序和设置expand
|
|
|
@@ -172,7 +206,7 @@ export default {
|
|
|
node.show = true;
|
|
|
node.uuid = Uuid.createUUID();
|
|
|
collectionDatas.forEach(collectionData => {
|
|
|
- if(node.no == collectionData.no){
|
|
|
+ if (node.no == collectionData.no) {
|
|
|
node.favorite = true;
|
|
|
}
|
|
|
});
|
|
|
@@ -183,7 +217,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- initNode(datas,collections);
|
|
|
+ initNode(datas, collections);
|
|
|
this.rootNodes = datas;
|
|
|
_self.$nextTick(function () {
|
|
|
_self.initView();
|
|
|
@@ -254,11 +288,11 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
- * 递归修改属性为可见的节点的父节点为可见
|
|
|
- * @param {Object} node
|
|
|
- */
|
|
|
+ * 递归修改属性为可见的节点的父节点为可见
|
|
|
+ * @param {Object} node
|
|
|
+ */
|
|
|
function parseParent(node, level) {
|
|
|
// 防止循环数据
|
|
|
if (level > 5) {
|
|
|
@@ -279,12 +313,10 @@ export default {
|
|
|
var _self = this;
|
|
|
_self.setNodeView();
|
|
|
if (inputText) {
|
|
|
-
|
|
|
//遍历所有根节点与传销内容无关的设置不可见
|
|
|
this.rootNodes.forEach(function (node) {
|
|
|
filterNode(node);
|
|
|
});
|
|
|
-
|
|
|
|
|
|
this.rootNodes.forEach(function (node) {
|
|
|
parseParent(node, 0);
|
|
|
@@ -316,11 +348,37 @@ export default {
|
|
|
}
|
|
|
initNode(_self.rootNodes);
|
|
|
},
|
|
|
+ // 查询系统logo
|
|
|
+ getLogoName: function () {
|
|
|
+ const _self = this;
|
|
|
+ $.ajax({
|
|
|
+ type: 'GET',
|
|
|
+ url: Common.getApiURL('clientLogoResource/selectByClientId'),
|
|
|
+ dataType: 'json',
|
|
|
+ beforeSend: function (request) {
|
|
|
+ Common.addTokenToRequest(request);
|
|
|
+ },
|
|
|
+ success: function (res) {
|
|
|
+ if (res.errorCode === 0) {
|
|
|
+ _self.logoUrl = `/Files/0/Images/com.leanwo.prodog.system.model.ClientLogo/${res.data.imageName}`;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error: function (XMLHttpRequest, textStatus, errorThrown) {
|
|
|
+ Common.processException(XMLHttpRequest, textStatus, errorThrown);
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
+.menu-side {
|
|
|
+ background: var(--leftColor);
|
|
|
+}
|
|
|
+.menu-search {
|
|
|
+ background: var(--searchColor);
|
|
|
+}
|
|
|
.menu-div {
|
|
|
padding-left: 10px;
|
|
|
padding-right: 10px;
|
|
|
@@ -379,7 +437,8 @@ export default {
|
|
|
}
|
|
|
.main_menu .nav.side-menu > li > a,
|
|
|
.main_menu .nav.child_menu > li > a {
|
|
|
- color: #e7e7e7;
|
|
|
+ /* color: #e7e7e7; */
|
|
|
+ color: #fff;
|
|
|
font-weight: 500;
|
|
|
}
|
|
|
.main_menu .nav.side-menu > li.current-page,
|
|
|
@@ -433,7 +492,7 @@ export default {
|
|
|
}
|
|
|
.main_menu .nav.child_menu li li:hover,
|
|
|
.main_menu .nav.child_menu li li.active {
|
|
|
- background-color: #495d70;
|
|
|
+ background-color: v-bind(selectColor);
|
|
|
}
|
|
|
.main_menu .nav.child_menu li li a:hover,
|
|
|
.main_menu .nav.child_menu li li a.active {
|
|
|
@@ -473,7 +532,7 @@ export default {
|
|
|
background-color: transparent !important;
|
|
|
}
|
|
|
.main_menu .menu-search {
|
|
|
- background-color: #1c3e4b;
|
|
|
+ /* background-color: #1c3e4b; */
|
|
|
color: #fff;
|
|
|
}
|
|
|
</style>
|