1
|
<template>
|
1
|
<template>
|
2
|
- <div :style="styleObj" @click="closePressingDialog" ref="detailTable">
|
2
|
+ <div :style="styleObj" @mouseleave.stop="closePressingDialog" ref="detailTable">
|
3
|
<div class="detail-table-title title-flex-between">
|
3
|
<div class="detail-table-title title-flex-between">
|
4
|
<div class="title-left">{{tableStyle.tableName}}</div>
|
4
|
<div class="title-left">{{tableStyle.tableName}}</div>
|
5
|
<div class="title-right">
|
5
|
<div class="title-right">
|
6
|
<span class="title-link" @click="handlerDetailDataNoPage()">更多</span>
|
6
|
<span class="title-link" @click="handlerDetailDataNoPage()">更多</span>
|
7
|
- <span class="title-link">下载</span>
|
7
|
+ <span class="title-link" @click="downloadTableList">下载</span>
|
8
|
</div>
|
8
|
</div>
|
9
|
</div>
|
9
|
</div>
|
10
|
<superslide v-if="hackReset" :options="options" class="txtScroll-top" :style="borderStyle">
|
10
|
<superslide v-if="hackReset" :options="options" class="txtScroll-top" :style="borderStyle">
|
|
@@ -15,7 +15,7 @@ |
|
@@ -15,7 +15,7 @@ |
15
|
v-for="(item, index) in header"
|
15
|
v-for="(item, index) in header"
|
16
|
:style="[headerTableStlye,tableFiledWidth(index),tableRowHeight()]"
|
16
|
:style="[headerTableStlye,tableFiledWidth(index),tableRowHeight()]"
|
17
|
:key="index"
|
17
|
:key="index"
|
18
|
- :class="{'ascending':(sortBy==item.key && sortCaret=='ascending'),'descending':(sortBy==item.key && sortCaret=='descending')}"
|
18
|
+ :class="['padding-10',{'ascending':(sortBy==item.key && sortCaret=='ascending'),'descending':(sortBy==item.key && sortCaret=='descending')}]"
|
19
|
>
|
19
|
>
|
20
|
{{ item.name }}
|
20
|
{{ item.name }}
|
21
|
<!-- <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>-->
|
21
|
<!-- <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 @@ |
|
@@ -31,34 +31,31 @@ |
31
|
<li v-for="(item, index) in list" :key="index" :style="tableRowHeight()" @mouseenter="isHover=true" @mouseleave="isHover=false" >
|
31
|
<li v-for="(item, index) in list" :key="index" :style="tableRowHeight()" @mouseenter="isHover=true" @mouseleave="isHover=false" >
|
32
|
<div class="infoList-flex" :style="[bodyTableStyle, bodyTable(index),tableFiledWidth(index),tableRowHeight(),serialNumber]">
|
32
|
<div class="infoList-flex" :style="[bodyTableStyle, bodyTable(index),tableFiledWidth(index),tableRowHeight(),serialNumber]">
|
33
|
{{ index+1 }}</div>
|
33
|
{{ index+1 }}</div>
|
34
|
- <div class="infoList-flex"
|
34
|
+ <div class="infoList-flex text-overflow padding-10"
|
35
|
v-for="(itemChild, idx) in header"
|
35
|
v-for="(itemChild, idx) in header"
|
36
|
:key="idx"
|
36
|
:key="idx"
|
37
|
:style="[bodyTableStyle, bodyTable(index),tableFiledWidth(idx),tableRowHeight()]"
|
37
|
:style="[bodyTableStyle, bodyTable(index),tableFiledWidth(idx),tableRowHeight()]"
|
38
|
@mouseenter="pressingTimes(index,idx)"
|
38
|
@mouseenter="pressingTimes(index,idx)"
|
|
|
39
|
+ :ref="'headerRef'+index+'-'+idx"
|
|
|
40
|
+ :data-tip="tableFiledMaxWidth('isOverflow'+index+'-'+idx,index,idx)"
|
39
|
>
|
41
|
>
|
40
|
- <span @click="clickListName(item[itemChild.key])" :style="colorStyle(item[itemChild.key].kpiValue)"
|
|
|
41
|
- :class="['listName',{'listName-link':item[itemChild.key] && (item[itemChild.key].kpiIdent==1 || item[itemChild.key].isWarning==1)}]">
|
|
|
42
|
- {{ item[itemChild.key].kpiValue}} </span>
|
|
|
43
|
- <!-- <div class="basic-img" v-if="item[itemChild.key] && (item[itemChild.key].kpiIdent==1 || item[itemChild.key].isWarning==1)">
|
|
|
44
|
- <el-popover ref="popoverMenu" placement="right" trigger="click" :auto-close="200">
|
|
|
45
|
- <template #reference>
|
|
|
46
|
- <img class="info-img" src="@/assets/images/healthStatus/icon_row_menu.png" alt="" @click.stop="pressingTimes(index,idx)">
|
|
|
47
|
- </template>-->
|
|
|
48
|
- <!-- <div class="info-ul" v-if="pressingVisible==index+'-'+idx">-->
|
|
|
49
|
- <customMenuBox v-if="pressingVisible==index+'-'+idx && item[itemChild.key] && (item[itemChild.key].kpiIdent==1 || item[itemChild.key].isWarning==1)"
|
42
|
+ <el-tooltip v-if="!itemChild.componentName || itemChild.componentName==1" :disabled="isEllipsis[index+'-'+idx]" ref="elTooltip" trigger="hover" >
|
|
|
43
|
+ <template #content>
|
|
|
44
|
+ <span>{{ item[itemChild.key].kpiValue}}</span>
|
|
|
45
|
+ </template>
|
|
|
46
|
+ <span @mouseleave="" :ref="'isOverflow'+index+'-'+idx" :data-num="index+'-'+idx" @click="clickListName(item[itemChild.key])" :style="colorStyle(item[itemChild.key].kpiValue)"
|
|
|
47
|
+ :class="['listName','width-80','text-overflow',{'listName-link':item[itemChild.key] && (item[itemChild.key].kpiIdent==1 || item[itemChild.key].isWarning==1)}]">
|
|
|
48
|
+ {{ item[itemChild.key].kpiValue}}
|
|
|
49
|
+ </span>
|
|
|
50
|
+ </el-tooltip>
|
|
|
51
|
+ <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'" />
|
|
|
52
|
+
|
|
|
53
|
+ <customMenuBox ref="customMenu" v-if="pressingVisible==index+'-'+idx && item[itemChild.key] && (item[itemChild.key].kpiIdent==1 || item[itemChild.key].isWarning==1)"
|
50
|
:detailMenubox="calcDetailMenubox"
|
54
|
:detailMenubox="calcDetailMenubox"
|
51
|
:tableDataValue="item[itemChild.key].kpiValue" :flg="''" :trendSrc="trendSrc"
|
55
|
:tableDataValue="item[itemChild.key].kpiValue" :flg="''" :trendSrc="trendSrc"
|
52
|
:heightStyle="heightStyle" :marginStyle="marginStyle" :tableName="dialogNameStyle(item[itemChild.key])"
|
56
|
:heightStyle="heightStyle" :marginStyle="marginStyle" :tableName="dialogNameStyle(item[itemChild.key])"
|
53
|
|
57
|
|
54
|
></customMenuBox>
|
58
|
></customMenuBox>
|
55
|
-<!-- <div class="info-ul" style="width:140px;" >
|
|
|
56
|
- <div class="basic-pressing-times" @click="pressingDialog(itemMenu,item[itemChild.key].kpiValue,'')" v-for="itemMenu in calcDetailMenubox">
|
|
|
57
|
- <i class="el-icon-link icon-div"></i>{{itemMenu.name}}
|
|
|
58
|
- </div>
|
|
|
59
|
- </div>-->
|
|
|
60
|
-<!-- </el-popover>
|
|
|
61
|
- </div>-->
|
|
|
62
|
</div>
|
59
|
</div>
|
63
|
</li>
|
60
|
</li>
|
64
|
</ul>
|
61
|
</ul>
|
|
@@ -180,6 +177,8 @@ import VueSuperSlide from "vue-superslide"; |
|
@@ -180,6 +177,8 @@ import VueSuperSlide from "vue-superslide"; |
180
|
import {getDetailTableData,getDetailTableDataNoPage} from "@/api/platform";
|
177
|
import {getDetailTableData,getDetailTableDataNoPage} from "@/api/platform";
|
181
|
import customDialog from "../../designerComponents/customDialog";
|
178
|
import customDialog from "../../designerComponents/customDialog";
|
182
|
import customMenuBox from "../../designerComponents/customMenuBox";//下探组件
|
179
|
import customMenuBox from "../../designerComponents/customMenuBox";//下探组件
|
|
|
180
|
+import textToImage from "../../designerComponents/textToImage";//文字转图片
|
|
|
181
|
+import textToBg from "../../designerComponents/textToBg";//文字转背景
|
183
|
|
182
|
|
184
|
vue.use(VueSuperSlide);
|
183
|
vue.use(VueSuperSlide);
|
185
|
export default {
|
184
|
export default {
|
|
@@ -188,7 +187,7 @@ export default { |
|
@@ -188,7 +187,7 @@ export default { |
188
|
ispreview: Boolean
|
187
|
ispreview: Boolean
|
189
|
},
|
188
|
},
|
190
|
components:{
|
189
|
components:{
|
191
|
- customDialog,customMenuBox
|
190
|
+ customDialog,customMenuBox,textToImage,textToBg
|
192
|
},
|
191
|
},
|
193
|
data() {
|
192
|
data() {
|
194
|
return {
|
193
|
return {
|
|
@@ -261,11 +260,12 @@ export default { |
|
@@ -261,11 +260,12 @@ export default { |
261
|
sortVal:'bottom',//排序方式
|
260
|
sortVal:'bottom',//排序方式
|
262
|
sortBy:'',//排序参数
|
261
|
sortBy:'',//排序参数
|
263
|
sortCaret:'',//正序倒序
|
262
|
sortCaret:'',//正序倒序
|
|
|
263
|
+ isEllipsis:[],//是否文字超出
|
|
|
264
|
+ componentName:'',//组件名称
|
264
|
};
|
265
|
};
|
265
|
},
|
266
|
},
|
266
|
computed: {
|
267
|
computed: {
|
267
|
styleObj() {
|
268
|
styleObj() {
|
268
|
- // console.log(this.optionsSetUp);
|
|
|
269
|
const allStyle = this.optionsPosition;
|
269
|
const allStyle = this.optionsPosition;
|
270
|
return {
|
270
|
return {
|
271
|
position: this.ispreview ? "absolute" : "static",
|
271
|
position: this.ispreview ? "absolute" : "static",
|
|
@@ -469,7 +469,6 @@ export default { |
|
@@ -469,7 +469,6 @@ export default { |
469
|
this.marginStyle+="margin-top:"+(230)+'px;';
|
469
|
this.marginStyle+="margin-top:"+(230)+'px;';
|
470
|
|
470
|
|
471
|
}
|
471
|
}
|
472
|
- console.log("123",documentHeight,scroll)
|
|
|
473
|
}else{
|
472
|
}else{
|
474
|
//ajreport中弹框位置样式
|
473
|
//ajreport中弹框位置样式
|
475
|
this.heightStyle="height:"+(documentHeight+scroll)+'px;';
|
474
|
this.heightStyle="height:"+(documentHeight+scroll)+'px;';
|
|
@@ -652,6 +651,19 @@ export default { |
|
@@ -652,6 +651,19 @@ export default { |
652
|
}
|
651
|
}
|
653
|
return styleJson
|
652
|
return styleJson
|
654
|
},
|
653
|
},
|
|
|
654
|
+ //列最大宽
|
|
|
655
|
+ tableFiledMaxWidth(obj,index,idx){
|
|
|
656
|
+ let that=this;
|
|
|
657
|
+ this.$nextTick(() => {
|
|
|
658
|
+ let isOverflow=that.$refs[obj];
|
|
|
659
|
+ if(isOverflow && isOverflow[0]){
|
|
|
660
|
+ let cWidth = isOverflow[0].parentElement.scrollWidth;
|
|
|
661
|
+ let sWidth = isOverflow[0].scrollWidth;
|
|
|
662
|
+ that.isEllipsis[index+'-'+idx]=!((sWidth+10) > cWidth);
|
|
|
663
|
+ }
|
|
|
664
|
+
|
|
|
665
|
+ })
|
|
|
666
|
+ },
|
655
|
//列是否排序
|
667
|
//列是否排序
|
656
|
tableFiledSort(index){
|
668
|
tableFiledSort(index){
|
657
|
let isSort=false;
|
669
|
let isSort=false;
|
|
@@ -667,12 +679,16 @@ export default { |
|
@@ -667,12 +679,16 @@ export default { |
667
|
this.header.map(v=>{
|
679
|
this.header.map(v=>{
|
668
|
if(item.key==v.key){
|
680
|
if(item.key==v.key){
|
669
|
v.columnSort=item.columnSort;
|
681
|
v.columnSort=item.columnSort;
|
|
|
682
|
+ v.sort=item.sort?item.sort:false;
|
|
|
683
|
+ v.componentName=item.componentName?item.componentName:1;
|
670
|
}
|
684
|
}
|
671
|
})
|
685
|
})
|
672
|
if(this.headerAll && this.headerAll.length>0){
|
686
|
if(this.headerAll && this.headerAll.length>0){
|
673
|
this.headerAll.map(v=>{
|
687
|
this.headerAll.map(v=>{
|
674
|
if(item.key==v.key){
|
688
|
if(item.key==v.key){
|
675
|
v.columnSort=item.columnSort;
|
689
|
v.columnSort=item.columnSort;
|
|
|
690
|
+ v.sort=item.sort?item.sort:false;
|
|
|
691
|
+ v.componentName=item.componentName?item.componentName:1;
|
676
|
}
|
692
|
}
|
677
|
})
|
693
|
})
|
678
|
}
|
694
|
}
|
|
@@ -680,7 +696,6 @@ export default { |
|
@@ -680,7 +696,6 @@ export default { |
680
|
})
|
696
|
})
|
681
|
this.header.sort(this.compare('columnSort'))
|
697
|
this.header.sort(this.compare('columnSort'))
|
682
|
this.headerAll.sort(this.compare('columnSort'))
|
698
|
this.headerAll.sort(this.compare('columnSort'))
|
683
|
- console.log("&&&",this.header)
|
|
|
684
|
},
|
699
|
},
|
685
|
compare(property){
|
700
|
compare(property){
|
686
|
return function(a,b){
|
701
|
return function(a,b){
|
|
@@ -728,7 +743,7 @@ export default { |
|
@@ -728,7 +743,7 @@ export default { |
728
|
this.pressingVisible=index+'-'+idx;
|
743
|
this.pressingVisible=index+'-'+idx;
|
729
|
},
|
744
|
},
|
730
|
closePressingDialog(){
|
745
|
closePressingDialog(){
|
731
|
- this.pressingVisible=false;
|
746
|
+ // this.pressingVisible=false;
|
732
|
},
|
747
|
},
|
733
|
//弹框关闭确定
|
748
|
//弹框关闭确定
|
734
|
hideDialog(){
|
749
|
hideDialog(){
|
|
@@ -761,7 +776,6 @@ export default { |
|
@@ -761,7 +776,6 @@ export default { |
761
|
}else{
|
776
|
}else{
|
762
|
//不排序
|
777
|
//不排序
|
763
|
}
|
778
|
}
|
764
|
- console.log('sort',item.key)
|
|
|
765
|
// this.handlerDetailData('',item.key)
|
779
|
// this.handlerDetailData('',item.key)
|
766
|
// this.handlerDetailDataNoPage();
|
780
|
// this.handlerDetailDataNoPage();
|
767
|
},
|
781
|
},
|
|
@@ -769,7 +783,6 @@ export default { |
|
@@ -769,7 +783,6 @@ export default { |
769
|
handleSizeChange(val){
|
783
|
handleSizeChange(val){
|
770
|
// 切换页码重置初始页
|
784
|
// 切换页码重置初始页
|
771
|
this.currentPage = 1
|
785
|
this.currentPage = 1
|
772
|
- // console.log(`每页 ${val} 条`)
|
|
|
773
|
//props.pageSize = val;
|
786
|
//props.pageSize = val;
|
774
|
this.pageSize = val;
|
787
|
this.pageSize = val;
|
775
|
this.handlerDetailDataNoPage();
|
788
|
this.handlerDetailDataNoPage();
|
|
@@ -777,14 +790,12 @@ export default { |
|
@@ -777,14 +790,12 @@ export default { |
777
|
|
790
|
|
778
|
// 切换页码
|
791
|
// 切换页码
|
779
|
handleCurrentChange(val){
|
792
|
handleCurrentChange(val){
|
780
|
- // console.log(`当前页: ${val}`)
|
|
|
781
|
//props.currentPage = val;
|
793
|
//props.currentPage = val;
|
782
|
this.currentPage = val;
|
794
|
this.currentPage = val;
|
783
|
this.handlerDetailDataNoPage();
|
795
|
this.handlerDetailDataNoPage();
|
784
|
},
|
796
|
},
|
785
|
// 切换页码
|
797
|
// 切换页码
|
786
|
prePage(val) {
|
798
|
prePage(val) {
|
787
|
- // console.log(`当前页: ${val}`)
|
|
|
788
|
// props.currentPage = val - 1;
|
799
|
// props.currentPage = val - 1;
|
789
|
this.currentPage = val-1;
|
800
|
this.currentPage = val-1;
|
790
|
this.handlerDetailDataNoPage();
|
801
|
this.handlerDetailDataNoPage();
|
|
@@ -792,20 +803,43 @@ export default { |
|
@@ -792,20 +803,43 @@ export default { |
792
|
|
803
|
|
793
|
// 切换页码
|
804
|
// 切换页码
|
794
|
nextPage(val){
|
805
|
nextPage(val){
|
795
|
- // console.log(`当前页: ${val}`)
|
|
|
796
|
// props.currentPage = val + 1;
|
806
|
// props.currentPage = val + 1;
|
797
|
this.currentPage = val+1;
|
807
|
this.currentPage = val+1;
|
798
|
this.handlerDetailDataNoPage();
|
808
|
this.handlerDetailDataNoPage();
|
799
|
},
|
809
|
},
|
800
|
//计算弹框名称
|
810
|
//计算弹框名称
|
801
|
- dialogNameStyle(obj){
|
|
|
802
|
- const tableStyleSetup=this.optionsSetUp;
|
|
|
803
|
- let kpiName=obj.kpiName?'+'+obj.kpiName:'';
|
|
|
804
|
- let dialogName=tableStyleSetup.tableName+kpiName;
|
|
|
805
|
- this.dialogName=dialogName;
|
|
|
806
|
- return dialogName;
|
811
|
+ dialogNameStyle(obj) {
|
|
|
812
|
+ const tableStyleSetup = this.optionsSetUp;
|
|
|
813
|
+ let kpiName = obj.kpiName ? '+' + obj.kpiName : '';
|
|
|
814
|
+ let dialogName = tableStyleSetup.tableName + kpiName;
|
|
|
815
|
+ if (tableStyleSetup.nameDefault) {
|
|
|
816
|
+ dialogName = tableStyleSetup.tableName + kpiName;
|
807
|
|
817
|
|
|
|
818
|
+ } else {
|
|
|
819
|
+ let nameResType = tableStyleSetup.nameResType ? obj.resType ? obj.resType + '|' : '' : '';
|
|
|
820
|
+ let nameIPAddress = tableStyleSetup.nameIPAddress ? obj.ipAddr ? obj.ipAddr + '|' : '' : '';
|
|
|
821
|
+ let nameResName = tableStyleSetup.nameResName ? obj.resName ? obj.resName + '|' : '' : '';
|
|
|
822
|
+ let nameKpiName = tableStyleSetup.nameKpiName ? obj.kpiName ? obj.kpiName + '|' : '' : '';
|
|
|
823
|
+ let nameKpiFlg = tableStyleSetup.nameKpiFlg ? obj.flag ? obj.flag + '|' : '' : '';
|
|
|
824
|
+ let name = nameResType + nameIPAddress + nameIPAddress + nameResName + nameKpiName + nameKpiFlg;
|
|
|
825
|
+ dialogName = name.substring(0, name.length - 1);
|
|
|
826
|
+ }
|
|
|
827
|
+ this.dialogName = dialogName;
|
|
|
828
|
+ return dialogName;
|
808
|
},
|
829
|
},
|
|
|
830
|
+ //下载
|
|
|
831
|
+ downloadTableList(title, resId, kpiId, flagPrifix, sortBy, order){
|
|
|
832
|
+ let kpiIdArr=[];
|
|
|
833
|
+ let param={
|
|
|
834
|
+ sortBy:this.sortBy
|
|
|
835
|
+ }
|
|
|
836
|
+ this.header.map(item=>{
|
|
|
837
|
+ if(item.sort){
|
|
|
838
|
+ kpiIdArr.push(item.key)
|
|
|
839
|
+ }
|
|
|
840
|
+ })
|
|
|
841
|
+ console.log("kpiIdArr",kpiIdArr)
|
|
|
842
|
+ }
|
809
|
}
|
843
|
}
|
810
|
};
|
844
|
};
|
811
|
</script>
|
845
|
</script>
|
|
@@ -997,7 +1031,7 @@ export default { |
|
@@ -997,7 +1031,7 @@ export default { |
997
|
flex-direction: column;
|
1031
|
flex-direction: column;
|
998
|
align-items: center;
|
1032
|
align-items: center;
|
999
|
height: 14px;
|
1033
|
height: 14px;
|
1000
|
- width: 24px;
|
1034
|
+ width: 14px;
|
1001
|
vertical-align: middle;
|
1035
|
vertical-align: middle;
|
1002
|
cursor: pointer;
|
1036
|
cursor: pointer;
|
1003
|
overflow: initial;
|
1037
|
overflow: initial;
|
|
@@ -1008,7 +1042,7 @@ export default { |
|
@@ -1008,7 +1042,7 @@ export default { |
1008
|
height: 0;
|
1042
|
height: 0;
|
1009
|
border: solid 5px transparent;
|
1043
|
border: solid 5px transparent;
|
1010
|
position: absolute;
|
1044
|
position: absolute;
|
1011
|
- left: 7px;
|
1045
|
+ left: 1px;
|
1012
|
}
|
1046
|
}
|
1013
|
.title .sort-caret.ascending {
|
1047
|
.title .sort-caret.ascending {
|
1014
|
border-bottom-color: #c0c4cc;
|
1048
|
border-bottom-color: #c0c4cc;
|
|
@@ -1024,4 +1058,22 @@ export default { |
|
@@ -1024,4 +1058,22 @@ export default { |
1024
|
.title .descending .sort-caret.descending {
|
1058
|
.title .descending .sort-caret.descending {
|
1025
|
border-top-color: #409eff;
|
1059
|
border-top-color: #409eff;
|
1026
|
}
|
1060
|
}
|
|
|
1061
|
+.text-overflow{
|
|
|
1062
|
+ white-space:nowrap;
|
|
|
1063
|
+ overflow:hidden;
|
|
|
1064
|
+ text-overflow:ellipsis;
|
|
|
1065
|
+
|
|
|
1066
|
+ /*word-break: break-all;
|
|
|
1067
|
+ text-overflow: ellipsis;
|
|
|
1068
|
+ overflow: hidden;
|
|
|
1069
|
+ display: -webkit-box;
|
|
|
1070
|
+ -webkit-line-clamp: 2;
|
|
|
1071
|
+ -webkit-box-orient: vertical;*/
|
|
|
1072
|
+}
|
|
|
1073
|
+.width-80{
|
|
|
1074
|
+ max-width:80%;
|
|
|
1075
|
+}
|
|
|
1076
|
+.padding-10{
|
|
|
1077
|
+ padding:5px;
|
|
|
1078
|
+}
|
1027
|
</style> |
1079
|
</style> |