|
@@ -7,10 +7,19 @@
|
|
|
<el-tree
|
|
|
:data="treeData"
|
|
|
:props="defaultProps"
|
|
|
+ highlight-current
|
|
|
@node-click="handleNodeClick"
|
|
|
+ :default-checked-keys="[activeIndex]"
|
|
|
>
|
|
|
<div class="custom-tree-node" slot-scope="{ node }">
|
|
|
- <div>
|
|
|
+ <div
|
|
|
+ :class="[
|
|
|
+ activeIndex == node.data.id
|
|
|
+ ? 'tree_box_item_active'
|
|
|
+ : 'tree_box_item',
|
|
|
+ node.data.children ? 'tree_box_item_father' : '',
|
|
|
+ ]"
|
|
|
+ >
|
|
|
<span style="margin-right: 10px">{{ node.label }}</span>
|
|
|
</div>
|
|
|
</div></el-tree
|
|
@@ -128,6 +137,8 @@ export default {
|
|
|
defaultProps: {
|
|
|
children: "children",
|
|
|
label: "label",
|
|
|
+ nodeKey: "id",
|
|
|
+
|
|
|
isLeaf: (data, node) => {
|
|
|
if (data.is_leaf === "true") {
|
|
|
// 实体门店 叶子结点 不展示icon
|
|
@@ -135,6 +146,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
},
|
|
|
+ isPhone: false, // 是否是移动端打开
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
@@ -231,6 +243,9 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
created() {
|
|
|
+ const regExp = /Android|webOS|iPhone|BlackBerry|IEMobile|Opera Mini/i;
|
|
|
+ this.isPhone = regExp.test(navigator.userAgent);
|
|
|
+
|
|
|
this.getList();
|
|
|
console.log(this.bookId);
|
|
|
//this.$refs.tree.foldAllAfterMounted = true;
|
|
@@ -333,4 +348,35 @@ export default {
|
|
|
font-weight: normal !important;
|
|
|
}
|
|
|
}
|
|
|
+.he_tree_view {
|
|
|
+ .tree_box_item_active {
|
|
|
+ color: #ff9900;
|
|
|
+ }
|
|
|
+ .custom-tree-node {
|
|
|
+ color: #2c2c2c;
|
|
|
+ height: 44px;
|
|
|
+ display: block !important;
|
|
|
+ }
|
|
|
+ .el-tree--highlight-current
|
|
|
+ .el-tree-node.is-current
|
|
|
+ > .el-tree-node__content {
|
|
|
+ background: none;
|
|
|
+ }
|
|
|
+ .tree_box_item {
|
|
|
+ font-weight: 400;
|
|
|
+ -webkit-box-align: center;
|
|
|
+ -ms-flex-align: center;
|
|
|
+ align-items: center;
|
|
|
+ line-height: 44px;
|
|
|
+ overflow: hidden;
|
|
|
+ white-space: nowrap;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ &_father {
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .el-tree-node__content {
|
|
|
+ height: 44px;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|