fix:overview table取消多个悬浮框
This commit is contained in:
@@ -508,6 +508,9 @@ const en = {
|
|||||||
requiredMibFile:'mib file is required',
|
requiredMibFile:'mib file is required',
|
||||||
vendor:'Vendor',
|
vendor:'Vendor',
|
||||||
type:'Type',
|
type:'Type',
|
||||||
|
},
|
||||||
|
system:{
|
||||||
|
system:'System',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
alert: {
|
alert: {
|
||||||
|
|||||||
@@ -326,7 +326,12 @@
|
|||||||
prop:'name',
|
prop:'name',
|
||||||
show:true,
|
show:true,
|
||||||
showPopover:true,
|
showPopover:true,
|
||||||
|
showOverflowTooltip:false,
|
||||||
popover:[
|
popover:[
|
||||||
|
{
|
||||||
|
label:this.$t('dashboard.overview.project.project'),
|
||||||
|
prop:'name'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label:this.$t('dashboard.overview.project.module'),
|
label:this.$t('dashboard.overview.project.module'),
|
||||||
prop:'moduleNum'
|
prop:'moduleNum'
|
||||||
@@ -442,7 +447,12 @@
|
|||||||
prop:'name',
|
prop:'name',
|
||||||
show:true,
|
show:true,
|
||||||
showPopover:true,
|
showPopover:true,
|
||||||
|
showOverflowTooltip:false,
|
||||||
popover:[
|
popover:[
|
||||||
|
{
|
||||||
|
label:this.$t('dashboard.overview.dataCenter.dataCenter'),
|
||||||
|
prop:'name'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label:this.$t('dashboard.overview.asset.pingUp'),
|
label:this.$t('dashboard.overview.asset.pingUp'),
|
||||||
prop:'endpointUp'
|
prop:'endpointUp'
|
||||||
|
|||||||
@@ -44,6 +44,7 @@
|
|||||||
class="overview-table"
|
class="overview-table"
|
||||||
:data="showData.table.tableData"
|
:data="showData.table.tableData"
|
||||||
v-scrollBar:el-table
|
v-scrollBar:el-table
|
||||||
|
tooltip-effect="light"
|
||||||
height="100%"
|
height="100%"
|
||||||
ref="dataTable"
|
ref="dataTable"
|
||||||
>
|
>
|
||||||
@@ -52,10 +53,11 @@
|
|||||||
v-for="(item, index) in showData.table.tableLabel"
|
v-for="(item, index) in showData.table.tableLabel"
|
||||||
v-if="item.show"
|
v-if="item.show"
|
||||||
:key="`col-${index}`"
|
:key="`col-${index}`"
|
||||||
|
:class-name="typeof item.showOverflowTooltip != 'undefined'&& item.showOverflowTooltip == false?'cell-tooltip':''"
|
||||||
:width="item.width"
|
:width="item.width"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
:render-header="item.renderHeader"
|
:render-header="item.renderHeader"
|
||||||
show-overflow-tooltip
|
:show-overflow-tooltip="typeof item.showOverflowTooltip != 'undefined'?item.showOverflowTooltip:true"
|
||||||
min-width="90"
|
min-width="90"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope" :column="item">
|
<template slot-scope="scope" :column="item">
|
||||||
@@ -128,9 +130,33 @@
|
|||||||
endLoading(){
|
endLoading(){
|
||||||
this.$refs.loading.endLoading();
|
this.$refs.loading.endLoading();
|
||||||
},
|
},
|
||||||
layoutTable:function(){
|
formatTableColumn:function(column,len=14){
|
||||||
this.$refs.dataTable.doLayout();
|
let length=this.getLength(column);
|
||||||
|
if(length<=15){
|
||||||
|
return column;
|
||||||
|
}else{
|
||||||
|
let tempStr=column.substr(0,len);
|
||||||
|
if(this.getLength(tempStr) <= 15){
|
||||||
|
return tempStr+'';
|
||||||
|
}else{
|
||||||
|
return this.formatTableColumn(tempStr,len-1)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getLength(val) {
|
||||||
|
var str = new String(val);
|
||||||
|
var bytesCount = 0;
|
||||||
|
for (var i = 0 ,n = str.length; i < n; i++) {
|
||||||
|
var c = str.charCodeAt(i);
|
||||||
|
if ((c >= 0x0001 && c <= 0x007e) || (0xff60<=c && c<=0xff9f)) {
|
||||||
|
bytesCount += 1;
|
||||||
|
} else {
|
||||||
|
bytesCount += 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return bytesCount;
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
},
|
},
|
||||||
@@ -154,4 +180,11 @@
|
|||||||
.overview-table th, .overview-table tr {
|
.overview-table th, .overview-table tr {
|
||||||
background-color: #FCFCFC !important;
|
background-color: #FCFCFC !important;
|
||||||
}
|
}
|
||||||
|
.cell-tooltip .cell{
|
||||||
|
white-space: nowrap;
|
||||||
|
min-width: 50px;
|
||||||
|
word-break: break-all;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user