...
|
...
|
@@ -17,9 +17,8 @@ |
|
|
:key="index"
|
|
|
: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>-->
|
|
|
<span v-if="tableFiledSort(index)" class="caret-wrapper">
|
|
|
{{ item.name }}
|
|
|
<span v-if="tableFiledSort(index)" class="caret-wrapper">
|
|
|
<i class="sort-caret ascending" @click="changeSort(item,'ascending')"></i>
|
|
|
<i class="sort-caret descending" @click="changeSort(item,'descending')"></i>
|
|
|
</span>
|
...
|
...
|
@@ -36,14 +35,13 @@ |
|
|
: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)"
|
|
|
:data-tip="tableFiledMaxWidth('isOverflow'+index+'-'+idx,index,idx,'')"
|
|
|
>
|
|
|
<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)"
|
|
|
<span @mouseleave="" :ref="'isOverflow'+index+'-'+idx" :data-num="index+'-'+idx" @click="clickListName(item[itemChild.key],itemChild)" :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>
|
...
|
...
|
@@ -52,9 +50,10 @@ |
|
|
|
|
|
<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"
|
|
|
:tableDataValue="item[itemChild.key]" :flg="''"
|
|
|
:tableDataValueHead="itemChild"
|
|
|
:heightStyle="heightStyle" :marginStyle="marginStyle" :tableName="dialogNameStyle(item[itemChild.key])"
|
|
|
|
|
|
:resType="resType"
|
|
|
></customMenuBox>
|
|
|
</div>
|
|
|
</li>
|
...
|
...
|
@@ -74,10 +73,9 @@ |
|
|
v-for="(item, index) in headerAll"
|
|
|
: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':sortVal=='bottom','el-icon-caret-top':sortVal=='top'}]" @click="changeSort(item)"></i>-->
|
|
|
<span v-if="tableFiledSort(index)" class="caret-wrapper">
|
|
|
<i class="sort-caret ascending" @click="changeSort(item,'ascending')"></i>
|
|
|
<i class="sort-caret descending" @click="changeSort(item,'descending')"></i>
|
...
|
...
|
@@ -90,20 +88,37 @@ |
|
|
<li v-for="(item, index) in listAll" :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 headerAll"
|
|
|
:key="idx"
|
|
|
:style="[bodyTableStyle, bodyTable(index),tableFiledWidth(idx),tableRowHeight()]"
|
|
|
@mouseenter="pressingTimes(index,idx)"
|
|
|
:data-tip="tableFiledMaxWidth('isOverflow1'+index+'-'+idx,index,idx,'more')"
|
|
|
>
|
|
|
<span @click="clickListName(item[itemChild.key])" :style="colorStyle(item[itemChild.key].kpiValue)"
|
|
|
<el-tooltip v-if="!itemChild.componentName || itemChild.componentName==1" :disabled="isEllipsisMore[index+'-'+idx]" ref="elTooltip" trigger="hover" >
|
|
|
<template #content>
|
|
|
<span>{{ item[itemChild.key].kpiValue}}</span>
|
|
|
</template>
|
|
|
<span @mouseleave="" :ref="'isOverflow1'+index+'-'+idx" :data-num="index+'-'+idx" @click="clickListName(item[itemChild.key],itemChild)" :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'" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <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]?item[itemChild.key].kpiValue:'' }}</span>
|
|
|
{{ item[itemChild.key]?item[itemChild.key].kpiValue:'' }}</span>-->
|
|
|
<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"
|
|
|
:tableDataValue="item[itemChild.key]" :flg="''"
|
|
|
:tableDataValueHead="itemChild"
|
|
|
:heightStyle="heightStyle" :marginStyle="marginStyle" :tableName="dialogNameStyle(item[itemChild.key])"
|
|
|
|
|
|
:resType="resType"
|
|
|
></customMenuBox>
|
|
|
</div>
|
|
|
</li>
|
...
|
...
|
@@ -132,49 +147,17 @@ |
|
|
>
|
|
|
<template v-slot>
|
|
|
<div class="txtScroll-top">
|
|
|
性能趋势{{pressingValue}}
|
|
|
<iframe :src="trendSrc" class="layadmin-iframe" style="height: 99.5%!important;width: 100%;"/>
|
|
|
</div>
|
|
|
</template>
|
|
|
</customDialog>
|
|
|
<!-- <div class="dialog-div" v-if="tableVisible" :style="heightStyle">
|
|
|
<div class="dialog-div-content" :style="marginStyle" >
|
|
|
<div class="dialog-div-title title-flex-between"><span>{{tableStyle.tableName}}</span> <span class="dialog-close" @click="tableVisible = false">X</span></div>
|
|
|
|
|
|
</div>
|
|
|
</div>-->
|
|
|
<!-- <customDialog :dialogVisible="dialogVisible" :heightStyle="heightStyle" :marginStyle="marginStyle" :widthStyle="widthStyle" :title-name="tableStyle.tableName"
|
|
|
:showFooter="true" :showCancelBtn="true" :showOkBtn="true" @hideDialog="hideDialog" @okFunc="okFunc"
|
|
|
>
|
|
|
<template v-slot>
|
|
|
<div v-if="dialogName=='alarm_setting'" class="txtScroll-top">
|
|
|
告警设置{{pressingValue}}
|
|
|
</div>
|
|
|
<div v-if="dialogName=='filter_sheet_indicator'" class="txtScroll-top">
|
|
|
过滤单指标{{pressingValue}}
|
|
|
</div>
|
|
|
<div v-if="dialogName=='filter_multiple_indicators'" class="txtScroll-top">
|
|
|
过滤多指标{{pressingValue}}
|
|
|
</div>
|
|
|
<div v-if="dialogName=='performance_trends'" class="txtScroll-top">
|
|
|
性能趋势{{pressingValue}}
|
|
|
<iframe :src="trendSrc" class="layadmin-iframe" style="height: 99.5%!important;width: 100%;"/>
|
|
|
</div>
|
|
|
<div v-if="dialogName=='pressing_times'" class="txtScroll-top">
|
|
|
压制次数{{pressingValue}}
|
|
|
</div>
|
|
|
<div v-if="dialogName=='include_capacity_forecast'" class="txtScroll-top">
|
|
|
纳入容量预测{{pressingValue}}
|
|
|
</div>
|
|
|
</template>
|
|
|
</customDialog>-->
|
|
|
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
import vue from "vue";
|
|
|
import VueSuperSlide from "vue-superslide";
|
|
|
import {getDetailTableData,getDetailTableDataNoPage} from "@/api/platform";
|
|
|
import {getDetailTableData,getDetailTableDataNoPage,getResType,getTrendBaseUrl} from "@/api/platform";
|
|
|
import customDialog from "../../designerComponents/customDialog";
|
|
|
import customMenuBox from "../../designerComponents/customMenuBox";//下探组件
|
|
|
import textToImage from "../../designerComponents/textToImage";//文字转图片
|
...
|
...
|
@@ -219,38 +202,6 @@ export default { |
|
|
optionsData: {},
|
|
|
pressingVisible:'',
|
|
|
isHover:false,
|
|
|
/*detailMenubox:[
|
|
|
{
|
|
|
name:'告警设置',
|
|
|
type:'alarm_setting',
|
|
|
isDisplay:true
|
|
|
},
|
|
|
{
|
|
|
name:'过滤单指标',
|
|
|
type:'filter_sheet_indicator',
|
|
|
isDisplay:true
|
|
|
},
|
|
|
{
|
|
|
name:'过滤多指标',
|
|
|
type:'filter_multiple_indicators',
|
|
|
isDisplay:true
|
|
|
},
|
|
|
{
|
|
|
name:'性能趋势',
|
|
|
type:'performance_trends',
|
|
|
isDisplay:true
|
|
|
},
|
|
|
{
|
|
|
name:'压制次数',
|
|
|
type:'pressing_times',
|
|
|
isDisplay:true
|
|
|
},
|
|
|
{
|
|
|
name:'纳入容量预测',
|
|
|
type:'include_capacity_forecast',
|
|
|
isDisplay:true
|
|
|
}
|
|
|
],*/
|
|
|
dialogName:'',//表格名称
|
|
|
pressingValue:'',//表格下探值
|
|
|
trendSrc:'',//性能走势图地址
|
...
|
...
|
@@ -261,7 +212,9 @@ export default { |
|
|
sortBy:'',//排序参数
|
|
|
sortCaret:'',//正序倒序
|
|
|
isEllipsis:[],//是否文字超出
|
|
|
isEllipsisMore:[],//是否文字超出
|
|
|
componentName:'',//组件名称
|
|
|
resType:'',//资源类型
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
...
|
...
|
@@ -367,6 +320,17 @@ export default { |
|
|
})
|
|
|
}
|
|
|
return detailMenuBox;
|
|
|
},
|
|
|
//获取url地址中的token
|
|
|
getUrlToken(){
|
|
|
let locationUrl=this.$route.query;
|
|
|
let resId=locationUrl.resId;
|
|
|
let token=locationUrl.access_token;
|
|
|
let urlObj={
|
|
|
resId:resId,
|
|
|
token:token
|
|
|
}
|
|
|
return urlObj;
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
...
|
...
|
@@ -376,15 +340,18 @@ export default { |
|
|
this.optionsPosition = val.position;
|
|
|
this.optionsData = val.data;
|
|
|
this.initData();
|
|
|
this.getResTypeData();
|
|
|
},
|
|
|
deep: true
|
|
|
}
|
|
|
},
|
|
|
|
|
|
mounted() {
|
|
|
this.optionsSetUp = this.value.setup;
|
|
|
this.optionsPosition = this.value.position;
|
|
|
this.optionsData = this.value.data;
|
|
|
this.initData();
|
|
|
this.getResTypeData();
|
|
|
},
|
|
|
methods: {
|
|
|
initData() {
|
...
|
...
|
@@ -557,28 +524,27 @@ export default { |
|
|
// this.setDialog('table');
|
|
|
this.tableVisible=true;
|
|
|
},
|
|
|
/*//打开弹框
|
|
|
setDialog(name,flg){
|
|
|
|
|
|
this.dialogVisible=true;
|
|
|
|
|
|
this.dialogName=name;
|
|
|
},*/
|
|
|
//点击表格内容名称事件
|
|
|
clickListName(obj){
|
|
|
clickListName(obj,tableDataValueHead){
|
|
|
if(obj.kpiIdent==1 || obj.isWarning==1){
|
|
|
let trendsParams=obj;
|
|
|
// this.trendSrc='http://127.0.0.1:8088/vue3/index.html#/vue3/pieDetailLine?resId=08586dba3a5b4a01ad88e8878eed6d53&kpiId=KPI7054BC34&flag=cpu&ident=1&trend=1&name=CPU%E4%BD%BF%E7%94%A8%E7%8E%87x&access_token=6e14ca48-4d05-42cf-b232-97981035824f'
|
|
|
this.trendSrc='https://192.168.0.69:8088/#/user/login/redirect=%2F';
|
|
|
this.widthStyle='';
|
|
|
// this.setDialog('performance_trends')
|
|
|
this.pressingValue=obj.kpiValue;
|
|
|
this.pressingValue=obj;
|
|
|
this.dialogNameStyle(obj)
|
|
|
|
|
|
this.setTrend(tableDataValueHead)
|
|
|
this.trendVisible=true;
|
|
|
}
|
|
|
|
|
|
},
|
|
|
//设置性能趋势图
|
|
|
setTrend(tableDataValueHead){
|
|
|
let urlParams='resId='+this.getUrlToken.resId+'&kpiId='+this.pressingValue.kpiId+'&flag='+this.pressingValue.flag+'&warning='+this.pressingValue.isWarning
|
|
|
+'&ident='+this.pressingValue.kpiIdent
|
|
|
+'&trend='+this.pressingValue.isTrend
|
|
|
+'&unit='+tableDataValueHead.unit
|
|
|
+'&name='+this.pressingValue.kpiName + " " + tableDataValueHead.name;
|
|
|
let baseUrl=getTrendBaseUrl();
|
|
|
this.trendSrc=baseUrl+'/vue3/index.html#/vue3/pieDetailLine?'+urlParams;
|
|
|
},
|
|
|
//End LSQ 2022/1/20 10:23 TODO
|
|
|
handlerHead() {
|
|
|
const head = this.optionsSetUp.dynamicAddTable;
|
...
|
...
|
@@ -652,14 +618,20 @@ export default { |
|
|
return styleJson
|
|
|
},
|
|
|
//列最大宽
|
|
|
tableFiledMaxWidth(obj,index,idx){
|
|
|
tableFiledMaxWidth(obj,index,idx,flg){
|
|
|
let that=this;
|
|
|
this.$nextTick(() => {
|
|
|
let isOverflow=that.$refs[obj];
|
|
|
if(isOverflow && isOverflow[0]){
|
|
|
if(isOverflow && isOverflow[0]){
|
|
|
let cWidth = isOverflow[0].parentElement.scrollWidth;
|
|
|
let sWidth = isOverflow[0].scrollWidth;
|
|
|
that.isEllipsis[index+'-'+idx]=!((sWidth+10) > cWidth);
|
|
|
if(flg=='more'){
|
|
|
that.isEllipsisMore[index+'-'+idx]=!((sWidth+10) > cWidth);
|
|
|
|
|
|
}else {
|
|
|
that.isEllipsis[index+'-'+idx]=!((sWidth+10) > cWidth);
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
|
|
})
|
...
|
...
|
@@ -704,41 +676,7 @@ export default { |
|
|
return value1 - value2;
|
|
|
}
|
|
|
},
|
|
|
/* //表格下探
|
|
|
pressingDialog(itemMenu,value,flg){
|
|
|
this.pressingValue=value;
|
|
|
let styleStr='width: 300px;height: 200px;min-height: 200px;overflow: hidden;'
|
|
|
if(itemMenu.type=='alarm_setting'){
|
|
|
this.widthStyle='width:70%;';
|
|
|
|
|
|
}else if(itemMenu.type=='filter_sheet_indicator'){
|
|
|
this.widthStyle=styleStr;
|
|
|
|
|
|
}else if(itemMenu.type=='filter_multiple_indicators'){
|
|
|
this.widthStyle=styleStr;
|
|
|
|
|
|
}else if(itemMenu.type=='performance_trends'){
|
|
|
this.widthStyle='';
|
|
|
|
|
|
}else if(itemMenu.type=='pressing_times'){
|
|
|
this.widthStyle=styleStr;
|
|
|
|
|
|
}else if(itemMenu.type=='include_capacity_forecast'){
|
|
|
this.widthStyle=styleStr;
|
|
|
|
|
|
}
|
|
|
|
|
|
this.setDialog(itemMenu.type,flg);
|
|
|
|
|
|
let key=this.$refs.popoverMenu;
|
|
|
if(key && key.length>0){
|
|
|
key.map(item=>{
|
|
|
item.showPopper=false
|
|
|
})
|
|
|
}
|
|
|
// this.$refs.popoverMenu.showPopper = false;
|
|
|
|
|
|
},*/
|
|
|
pressingTimes(index,idx){
|
|
|
this.pressingVisible=index+'-'+idx;
|
|
|
},
|
...
|
...
|
@@ -816,7 +754,7 @@ export default { |
|
|
dialogName = tableStyleSetup.tableName + kpiName;
|
|
|
|
|
|
} else {
|
|
|
let nameResType = tableStyleSetup.nameResType ? obj.resType ? obj.resType + '|' : '' : '';
|
|
|
let nameResType = tableStyleSetup.nameResType ? this.resType ? this.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 + '|' : '' : '';
|
...
|
...
|
@@ -838,8 +776,19 @@ export default { |
|
|
kpiIdArr.push(item.key)
|
|
|
}
|
|
|
})
|
|
|
console.log("kpiIdArr",kpiIdArr)
|
|
|
}
|
|
|
},
|
|
|
//获取资源类型
|
|
|
async getResTypeData(){
|
|
|
let params= {
|
|
|
resId: this.getUrlToken.resId,
|
|
|
}
|
|
|
const { success,obj } = await getResType(params,this.getUrlToken);
|
|
|
if (success && obj && obj.bean && obj.bean.resType){
|
|
|
this.resType=obj.bean.resType;
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
}
|
|
|
};
|
|
|
</script>
|
...
|
...
|
|