Authored by 王涛

Merge branch 'master-500-dev-lushangqing' into 'master-500-dev'

树结构高亮显示样式修改



See merge request !96
@@ -101,3 +101,15 @@ input:-webkit-autofill { @@ -101,3 +101,15 @@ input:-webkit-autofill {
101 -webkit-line-clamp: 1; 101 -webkit-line-clamp: 1;
102 -webkit-box-orient: vertical; 102 -webkit-box-orient: vertical;
103 } 103 }
  104 +.tree-div .el-tree-node.is-current>.el-tree-node__content{
  105 + color:#fff;
  106 + background-color: #1e9fff;
  107 +}
  108 +.tree-div .el-tree-node__content:hover{
  109 + color:#fff;
  110 + background-color: #1e9fff;
  111 +}
  112 +.el-tabs__item.is-active{
  113 + background-color: #1e9fff;
  114 + color: #ffffff;
  115 +}
1 <template> 1 <template>
2 <div :style="styleObj" class="treeContainer"> 2 <div :style="styleObj" class="treeContainer">
3 <div class="tree-left" :style="treeLeftStyle"> 3 <div class="tree-left" :style="treeLeftStyle">
4 - <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" v-if="optionsSetup.isType" stretch> 4 + <el-tabs v-model="activeName" class="demo-tabs" type="card" @tab-click="handleClick" v-if="optionsSetup.isType" stretch>
5 <el-tab-pane label="业务系统" name="bos"></el-tab-pane> 5 <el-tab-pane label="业务系统" name="bos"></el-tab-pane>
6 <el-tab-pane label="资源类型" name="res"></el-tab-pane> 6 <el-tab-pane label="资源类型" name="res"></el-tab-pane>
7 </el-tabs> 7 </el-tabs>
8 <el-tree :style="textStyle" class="tree-div" ref="roleTree" :data="treeData" :props="defaultProps" @node-click="handleNodeClick" 8 <el-tree :style="textStyle" class="tree-div" ref="roleTree" :data="treeData" :props="defaultProps" @node-click="handleNodeClick"
9 node-key="id" :default-checked-keys="checkedKeys" 9 node-key="id" :default-checked-keys="checkedKeys"
10 - /> 10 + >
  11 + <el-tooltip :disabled ="showTitle" effect="dark" :content="tooltipTitle" placement="top" slot-scope="{ node, data }" >
  12 + <span class="span-ellipsis" @mouseover="onShowNameTipsMouseenter">{{node.label}}</span>
  13 + </el-tooltip>
  14 + </el-tree>
11 </div> 15 </div>
12 <div class="tree-content" v-if="optionsSetup.isFrame"> 16 <div class="tree-content" v-if="optionsSetup.isFrame">
13 <iframe :src="iframeSrc" style="width:100%;height:100%;" frameborder="0"></iframe> 17 <iframe :src="iframeSrc" style="width:100%;height:100%;" frameborder="0"></iframe>
@@ -25,6 +29,8 @@ export default { @@ -25,6 +29,8 @@ export default {
25 }, 29 },
26 data() { 30 data() {
27 return { 31 return {
  32 + showTitle:false,//提示
  33 + tooltipTitle:'',//提示文本
28 iframeSrc:'', 34 iframeSrc:'',
29 activeName:'bos', 35 activeName:'bos',
30 /* defaultProps : { 36 /* defaultProps : {
@@ -117,6 +123,17 @@ export default { @@ -117,6 +123,17 @@ export default {
117 123
118 }, 124 },
119 methods: { 125 methods: {
  126 + onShowNameTipsMouseenter(e) {
  127 + var target = e.target;
  128 + let textLength = target.clientWidth;
  129 + let containerLength = target.scrollWidth;
  130 + if (textLength < containerLength) {
  131 + this.tooltipTitle = e.target.innerText;
  132 + this.showTitle = false;
  133 + } else {
  134 + this.showTitle = true;
  135 + }
  136 + },
120 handleClick(tab,event){ 137 handleClick(tab,event){
121 //切换类型获取树结构数据 138 //切换类型获取树结构数据
122 if (this.optionsData.dataType == "dynamicData" && this.optionsSetup.isType) { 139 if (this.optionsData.dataType == "dynamicData" && this.optionsSetup.isType) {
@@ -301,5 +318,13 @@ export default { @@ -301,5 +318,13 @@ export default {
301 width:50%!important; 318 width:50%!important;
302 margin:0 auto!important; 319 margin:0 auto!important;
303 } 320 }
  321 +.span-ellipsis {
  322 + width: 100%;
  323 + text-align: left;
  324 + overflow: hidden;
  325 + white-space: nowrap;
  326 + text-overflow: ellipsis;
  327 + margin-right: 20px;
  328 +}
304 329
305 </style> 330 </style>