|
|
<template>
|
|
|
<div :style="styleObj" @click="closePressingDialog" ref="detailTable">
|
|
|
<div :style="styleObj" @mouseleave.stop="closePressingDialog" ref="detailTable">
|
|
|
<div class="detail-table-title title-flex-between">
|
|
|
<div class="title-left">{{tableStyle.tableName}}</div>
|
|
|
<div class="title-right">
|
|
|
<span class="title-link" @click="handlerDetailDataNoPage()">更多</span>
|
|
|
<span class="title-link">下载</span>
|
|
|
<span class="title-link" @click="downloadTableList">下载</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
<superslide v-if="hackReset" :options="options" class="txtScroll-top" :style="borderStyle">
|
...
|
...
|
@@ -15,7 +15,7 @@ |
|
|
v-for="(item, index) in header"
|
|
|
:style="[headerTableStlye,tableFiledWidth(index),tableRowHeight()]"
|
|
|
:key="index"
|
|
|
:class="{'ascending':(sortBy==item.key && sortCaret=='ascending'),'descending':(sortBy==item.key && sortCaret=='descending')}"
|
|
|
:class="['padding-10',{'ascending':(sortBy==item.key && sortCaret=='ascending'),'descending':(sortBy==item.key && sortCaret=='descending')}]"
|
|
|
>
|
|
|
{{ item.name }}
|
|
|
<!-- <i v-if="tableFiledSort(index)" :class="['cursorClass',{'el-icon-caret-bottom':(sortBy==item.key && sortVal=='bottom'),'el-icon-caret-top':(sortBy==item.key && sortVal=='top')}]" @click="changeSort(item)"></i>-->
|
...
|
...
|
@@ -31,34 +31,31 @@ |
|
|
<li v-for="(item, index) in list" :key="index" :style="tableRowHeight()" @mouseenter="isHover=true" @mouseleave="isHover=false" >
|
|
|
<div class="infoList-flex" :style="[bodyTableStyle, bodyTable(index),tableFiledWidth(index),tableRowHeight(),serialNumber]">
|
|
|
{{ index+1 }}</div>
|
|
|
<div class="infoList-flex"
|
|
|
<div class="infoList-flex text-overflow padding-10"
|
|
|
v-for="(itemChild, idx) in header"
|
|
|
:key="idx"
|
|
|
:style="[bodyTableStyle, bodyTable(index),tableFiledWidth(idx),tableRowHeight()]"
|
|
|
@mouseenter="pressingTimes(index,idx)"
|
|
|
:ref="'headerRef'+index+'-'+idx"
|
|
|
:data-tip="tableFiledMaxWidth('isOverflow'+index+'-'+idx,index,idx)"
|
|
|
>
|
|
|
<span @click="clickListName(item[itemChild.key])" :style="colorStyle(item[itemChild.key].kpiValue)"
|
|
|
:class="['listName',{'listName-link':item[itemChild.key] && (item[itemChild.key].kpiIdent==1 || item[itemChild.key].isWarning==1)}]">
|
|
|
{{ item[itemChild.key].kpiValue}} </span>
|
|
|
<!-- <div class="basic-img" v-if="item[itemChild.key] && (item[itemChild.key].kpiIdent==1 || item[itemChild.key].isWarning==1)">
|
|
|
<el-popover ref="popoverMenu" placement="right" trigger="click" :auto-close="200">
|
|
|
<template #reference>
|
|
|
<img class="info-img" src="@/assets/images/healthStatus/icon_row_menu.png" alt="" @click.stop="pressingTimes(index,idx)">
|
|
|
</template>-->
|
|
|
<!-- <div class="info-ul" v-if="pressingVisible==index+'-'+idx">-->
|
|
|
<customMenuBox v-if="pressingVisible==index+'-'+idx && item[itemChild.key] && (item[itemChild.key].kpiIdent==1 || item[itemChild.key].isWarning==1)"
|
|
|
:detailMenubox="calcDetailMenubox"
|
|
|
:tableDataValue="item[itemChild.key].kpiValue" :flg="''" :trendSrc="trendSrc"
|
|
|
:heightStyle="heightStyle" :marginStyle="marginStyle" :tableName="dialogNameStyle(item[itemChild.key])"
|
|
|
<el-tooltip v-if="!itemChild.componentName || itemChild.componentName==1" :disabled="isEllipsis[index+'-'+idx]" ref="elTooltip" trigger="hover" >
|
|
|
<template #content>
|
|
|
<span>{{ item[itemChild.key].kpiValue}}</span>
|
|
|
</template>
|
|
|
<span @mouseleave="" :ref="'isOverflow'+index+'-'+idx" :data-num="index+'-'+idx" @click="clickListName(item[itemChild.key])" :style="colorStyle(item[itemChild.key].kpiValue)"
|
|
|
:class="['listName','width-80','text-overflow',{'listName-link':item[itemChild.key] && (item[itemChild.key].kpiIdent==1 || item[itemChild.key].isWarning==1)}]">
|
|
|
{{ item[itemChild.key].kpiValue}}
|
|
|
</span>
|
|
|
</el-tooltip>
|
|
|
<component v-if="itemChild.componentName && itemChild.componentName!=1" :is="itemChild.componentName" :alarmLevel="item[itemChild.key].alarmLevel?item[itemChild.key].alarmLevel:'2'" :way="item[itemChild.key].way?item[itemChild.key].way:'message'" />
|
|
|
|
|
|
></customMenuBox>
|
|
|
<!-- <div class="info-ul" style="width:140px;" >
|
|
|
<div class="basic-pressing-times" @click="pressingDialog(itemMenu,item[itemChild.key].kpiValue,'')" v-for="itemMenu in calcDetailMenubox">
|
|
|
<i class="el-icon-link icon-div"></i>{{itemMenu.name}}
|
|
|
</div>
|
|
|
</div>-->
|
|
|
<!-- </el-popover>
|
|
|
</div>-->
|
|
|
<customMenuBox ref="customMenu" v-if="pressingVisible==index+'-'+idx && item[itemChild.key] && (item[itemChild.key].kpiIdent==1 || item[itemChild.key].isWarning==1)"
|
|
|
:detailMenubox="calcDetailMenubox"
|
|
|
:tableDataValue="item[itemChild.key].kpiValue" :flg="''" :trendSrc="trendSrc"
|
|
|
:heightStyle="heightStyle" :marginStyle="marginStyle" :tableName="dialogNameStyle(item[itemChild.key])"
|
|
|
|
|
|
></customMenuBox>
|
|
|
</div>
|
|
|
</li>
|
|
|
</ul>
|
...
|
...
|
@@ -180,6 +177,8 @@ import VueSuperSlide from "vue-superslide"; |
|
|
import {getDetailTableData,getDetailTableDataNoPage} from "@/api/platform";
|
|
|
import customDialog from "../../designerComponents/customDialog";
|
|
|
import customMenuBox from "../../designerComponents/customMenuBox";//下探组件
|
|
|
import textToImage from "../../designerComponents/textToImage";//文字转图片
|
|
|
import textToBg from "../../designerComponents/textToBg";//文字转背景
|
|
|
|
|
|
vue.use(VueSuperSlide);
|
|
|
export default {
|
...
|
...
|
@@ -188,7 +187,7 @@ export default { |
|
|
ispreview: Boolean
|
|
|
},
|
|
|
components:{
|
|
|
customDialog,customMenuBox
|
|
|
customDialog,customMenuBox,textToImage,textToBg
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
...
|
...
|
@@ -261,11 +260,12 @@ export default { |
|
|
sortVal:'bottom',//排序方式
|
|
|
sortBy:'',//排序参数
|
|
|
sortCaret:'',//正序倒序
|
|
|
isEllipsis:[],//是否文字超出
|
|
|
componentName:'',//组件名称
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
styleObj() {
|
|
|
// console.log(this.optionsSetUp);
|
|
|
const allStyle = this.optionsPosition;
|
|
|
return {
|
|
|
position: this.ispreview ? "absolute" : "static",
|
...
|
...
|
@@ -469,7 +469,6 @@ export default { |
|
|
this.marginStyle+="margin-top:"+(230)+'px;';
|
|
|
|
|
|
}
|
|
|
console.log("123",documentHeight,scroll)
|
|
|
}else{
|
|
|
//ajreport中弹框位置样式
|
|
|
this.heightStyle="height:"+(documentHeight+scroll)+'px;';
|
...
|
...
|
@@ -652,6 +651,19 @@ export default { |
|
|
}
|
|
|
return styleJson
|
|
|
},
|
|
|
//列最大宽
|
|
|
tableFiledMaxWidth(obj,index,idx){
|
|
|
let that=this;
|
|
|
this.$nextTick(() => {
|
|
|
let isOverflow=that.$refs[obj];
|
|
|
if(isOverflow && isOverflow[0]){
|
|
|
let cWidth = isOverflow[0].parentElement.scrollWidth;
|
|
|
let sWidth = isOverflow[0].scrollWidth;
|
|
|
that.isEllipsis[index+'-'+idx]=!((sWidth+10) > cWidth);
|
|
|
}
|
|
|
|
|
|
})
|
|
|
},
|
|
|
//列是否排序
|
|
|
tableFiledSort(index){
|
|
|
let isSort=false;
|
...
|
...
|
@@ -667,12 +679,16 @@ export default { |
|
|
this.header.map(v=>{
|
|
|
if(item.key==v.key){
|
|
|
v.columnSort=item.columnSort;
|
|
|
v.sort=item.sort?item.sort:false;
|
|
|
v.componentName=item.componentName?item.componentName:1;
|
|
|
}
|
|
|
})
|
|
|
if(this.headerAll && this.headerAll.length>0){
|
|
|
this.headerAll.map(v=>{
|
|
|
if(item.key==v.key){
|
|
|
v.columnSort=item.columnSort;
|
|
|
v.sort=item.sort?item.sort:false;
|
|
|
v.componentName=item.componentName?item.componentName:1;
|
|
|
}
|
|
|
})
|
|
|
}
|
...
|
...
|
@@ -680,7 +696,6 @@ export default { |
|
|
})
|
|
|
this.header.sort(this.compare('columnSort'))
|
|
|
this.headerAll.sort(this.compare('columnSort'))
|
|
|
console.log("&&&",this.header)
|
|
|
},
|
|
|
compare(property){
|
|
|
return function(a,b){
|
...
|
...
|
@@ -728,7 +743,7 @@ export default { |
|
|
this.pressingVisible=index+'-'+idx;
|
|
|
},
|
|
|
closePressingDialog(){
|
|
|
this.pressingVisible=false;
|
|
|
// this.pressingVisible=false;
|
|
|
},
|
|
|
//弹框关闭确定
|
|
|
hideDialog(){
|
...
|
...
|
@@ -761,7 +776,6 @@ export default { |
|
|
}else{
|
|
|
//不排序
|
|
|
}
|
|
|
console.log('sort',item.key)
|
|
|
// this.handlerDetailData('',item.key)
|
|
|
// this.handlerDetailDataNoPage();
|
|
|
},
|
...
|
...
|
@@ -769,7 +783,6 @@ export default { |
|
|
handleSizeChange(val){
|
|
|
// 切换页码重置初始页
|
|
|
this.currentPage = 1
|
|
|
// console.log(`每页 ${val} 条`)
|
|
|
//props.pageSize = val;
|
|
|
this.pageSize = val;
|
|
|
this.handlerDetailDataNoPage();
|
...
|
...
|
@@ -777,14 +790,12 @@ export default { |
|
|
|
|
|
// 切换页码
|
|
|
handleCurrentChange(val){
|
|
|
// console.log(`当前页: ${val}`)
|
|
|
//props.currentPage = val;
|
|
|
this.currentPage = val;
|
|
|
this.handlerDetailDataNoPage();
|
|
|
},
|
|
|
// 切换页码
|
|
|
prePage(val) {
|
|
|
// console.log(`当前页: ${val}`)
|
|
|
// props.currentPage = val - 1;
|
|
|
this.currentPage = val-1;
|
|
|
this.handlerDetailDataNoPage();
|
...
|
...
|
@@ -792,20 +803,43 @@ export default { |
|
|
|
|
|
// 切换页码
|
|
|
nextPage(val){
|
|
|
// console.log(`当前页: ${val}`)
|
|
|
// props.currentPage = val + 1;
|
|
|
this.currentPage = val+1;
|
|
|
this.handlerDetailDataNoPage();
|
|
|
},
|
|
|
//计算弹框名称
|
|
|
dialogNameStyle(obj){
|
|
|
const tableStyleSetup=this.optionsSetUp;
|
|
|
let kpiName=obj.kpiName?'+'+obj.kpiName:'';
|
|
|
let dialogName=tableStyleSetup.tableName+kpiName;
|
|
|
this.dialogName=dialogName;
|
|
|
return dialogName;
|
|
|
dialogNameStyle(obj) {
|
|
|
const tableStyleSetup = this.optionsSetUp;
|
|
|
let kpiName = obj.kpiName ? '+' + obj.kpiName : '';
|
|
|
let dialogName = tableStyleSetup.tableName + kpiName;
|
|
|
if (tableStyleSetup.nameDefault) {
|
|
|
dialogName = tableStyleSetup.tableName + kpiName;
|
|
|
|
|
|
} else {
|
|
|
let nameResType = tableStyleSetup.nameResType ? obj.resType ? obj.resType + '|' : '' : '';
|
|
|
let nameIPAddress = tableStyleSetup.nameIPAddress ? obj.ipAddr ? obj.ipAddr + '|' : '' : '';
|
|
|
let nameResName = tableStyleSetup.nameResName ? obj.resName ? obj.resName + '|' : '' : '';
|
|
|
let nameKpiName = tableStyleSetup.nameKpiName ? obj.kpiName ? obj.kpiName + '|' : '' : '';
|
|
|
let nameKpiFlg = tableStyleSetup.nameKpiFlg ? obj.flag ? obj.flag + '|' : '' : '';
|
|
|
let name = nameResType + nameIPAddress + nameIPAddress + nameResName + nameKpiName + nameKpiFlg;
|
|
|
dialogName = name.substring(0, name.length - 1);
|
|
|
}
|
|
|
this.dialogName = dialogName;
|
|
|
return dialogName;
|
|
|
},
|
|
|
//下载
|
|
|
downloadTableList(title, resId, kpiId, flagPrifix, sortBy, order){
|
|
|
let kpiIdArr=[];
|
|
|
let param={
|
|
|
sortBy:this.sortBy
|
|
|
}
|
|
|
this.header.map(item=>{
|
|
|
if(item.sort){
|
|
|
kpiIdArr.push(item.key)
|
|
|
}
|
|
|
})
|
|
|
console.log("kpiIdArr",kpiIdArr)
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
</script>
|
...
|
...
|
@@ -997,7 +1031,7 @@ export default { |
|
|
flex-direction: column;
|
|
|
align-items: center;
|
|
|
height: 14px;
|
|
|
width: 24px;
|
|
|
width: 14px;
|
|
|
vertical-align: middle;
|
|
|
cursor: pointer;
|
|
|
overflow: initial;
|
...
|
...
|
@@ -1008,7 +1042,7 @@ export default { |
|
|
height: 0;
|
|
|
border: solid 5px transparent;
|
|
|
position: absolute;
|
|
|
left: 7px;
|
|
|
left: 1px;
|
|
|
}
|
|
|
.title .sort-caret.ascending {
|
|
|
border-bottom-color: #c0c4cc;
|
...
|
...
|
@@ -1024,4 +1058,22 @@ export default { |
|
|
.title .descending .sort-caret.descending {
|
|
|
border-top-color: #409eff;
|
|
|
}
|
|
|
.text-overflow{
|
|
|
white-space:nowrap;
|
|
|
overflow:hidden;
|
|
|
text-overflow:ellipsis;
|
|
|
|
|
|
/*word-break: break-all;
|
|
|
text-overflow: ellipsis;
|
|
|
overflow: hidden;
|
|
|
display: -webkit-box;
|
|
|
-webkit-line-clamp: 2;
|
|
|
-webkit-box-orient: vertical;*/
|
|
|
}
|
|
|
.width-80{
|
|
|
max-width:80%;
|
|
|
}
|
|
|
.padding-10{
|
|
|
padding:5px;
|
|
|
}
|
|
|
</style> |
...
|
...
|
|