Authored by 王涛

Merge branch 'master-500-dev' of http://192.168.1.136:82/monitor_v3/anji-plus-re…

…port into master-500-dev
Showing 26 changed files with 859 additions and 410 deletions
... ... @@ -152,24 +152,61 @@ export default {
let xAxisList = [];
let series = [];
let kpiUnit='';
if(data && data[0]){
if(data[0].data.names && data[0].data.names.length>0){
xAxisList=data[0].data.names;
}else{
xAxisList=['00:00', '01:00', '02:00', '03:00', '04:00', '05:00', '06:00', '07:00', '08:00', '09:00', '10:00', '11:00', '12:00']
}
if(data[0].data.kpiUnit){
kpiUnit=data[0].data.kpiUnit;
}
if(data[0].data.series && data[0].data.series.length>0){
series = data[0].data.series;
if(data && data[0] ){
if(data[0].data){
if(data[0].data.names && data[0].data.names.length>0){
xAxisList=data[0].data.names;
}else{
xAxisList=['00:00', '01:00', '02:00', '03:00', '04:00', '05:00', '06:00', '07:00', '08:00', '09:00', '10:00', '11:00', '12:00']
}
if(data[0].data.kpiUnit){
kpiUnit=data[0].data.kpiUnit;
}
if(data[0].data.series && data[0].data.series.length>0){
series = data[0].data.series;
}else{
series = [{
name: "",
data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
}];
}
}else{
series = [{
name: "",
datas: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
}];
//容量分析柱线图数据结构
let seriesCapacityData=[];//容量
let seriesUsageRateData=[];//使用率
let seriesUsageValueData=[];//使用量
data.map(item=>{
xAxisList.push(item.periodVal);
seriesCapacityData.push(item.capacityValue)
seriesUsageRateData.push(item.usageRate)
seriesUsageValueData.push(item.usageValue)
})
series.push({
type:'bar',
name:'使用量',
data:seriesUsageValueData
})
series.push({
type:'line',
name:'容量',
data:seriesCapacityData
})
series.push({
type:'line',
name:'使用率',
data:seriesUsageRateData
})
}
}else{
xAxisList=['00:00', '01:00', '02:00', '03:00', '04:00', '05:00', '06:00', '07:00', '08:00', '09:00', '10:00', '11:00', '12:00']
series = [{
name: "",
type:'bar',
data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
}];
}
ananysicData["xAxis"] = xAxisList;
ananysicData["series"] = series;
... ...
... ... @@ -21,7 +21,6 @@
size="small"
>编辑</el-button
>-->
{{scope.row.isDisplay}}
<el-switch active-value="1" inactive-value="2" size="mini" @change="switchChange" v-model.trim="scope.row.isDisplay" />
</div>
... ... @@ -188,7 +187,7 @@ export default {
value:'textToBg'
}
],//关联组件
formDataNew:this.formData,//表头数据
formDataNew:'',//表头数据
};
},
computed:{
... ...
... ... @@ -157,6 +157,14 @@ export const monitorBasicInformationTwo = {
name:'表格标题设置',
list:[
{
type: 'el-switch',
label: '是否显示标题',
name: 'isTableTitle',
required: false,
placeholder: '',
value: true
},
{
type: 'el-input-number',
label: '文字大小',
name: 'tableTitleFontSize',
... ... @@ -368,6 +376,14 @@ export const monitorBasicInformationTwo = {
value: 'staticData',
},
{
type: 'el-switch',
label: '是否刷新',
name: 'isRefresh',
relactiveDom: 'dataType',
relactiveDomValue: 'dynamicData',
value: true
},
{
type: 'el-input-number',
label: '刷新时间(毫秒)',
name: 'refreshTime',
... ... @@ -387,31 +403,31 @@ export const monitorBasicInformationTwo = {
{
name:'vmware-80.12.89.77',
value : 'vmware-80.12.89.77',
code : 'vmware',
nameCode : 'vmware',
state: "2"
},
{
name:'IP地址',
value:'80.12.89.77',
code:'ipAddress',
nameCode:'ipAddress',
state: "2"
},
{
name:'资源池',
value:'3',
code:'resPool',
nameCode:'resPool',
state: "2"
},
{
name:'宿主机',
value:'2',
code:'host',
nameCode:'host',
state: "2"
},
{
name:'虚拟机',
value:'10',
code:'vMachine',
nameCode:'vMachine',
state: "2"
},
],
... ...
... ... @@ -184,6 +184,18 @@ export const monitorCustomBarLineChart = {
value: 'left'
},
{
type: 'el-select',
label: '标题垂直位置',
name: 'textAlignVertical',
required: false,
placeholder: '',
selectOptions: [
{code: 'top', name: '靠上'},
{code: 'bottom', name: '靠下'},
],
value: 'top'
},
{
type: 'el-input-text',
label: '副标题',
name: 'subText',
... ...
... ... @@ -170,6 +170,18 @@ export const monitorCustomLineTrend = {
value: 'left'
},
{
type: 'el-select',
label: '标题垂直位置',
name: 'textAlignVertical',
required: false,
placeholder: '',
selectOptions: [
{code: 'top', name: '靠上'},
{code: 'bottom', name: '靠下'},
],
value: 'top'
},
{
type: 'el-input-text',
label: '副标题',
name: 'subText',
... ...
... ... @@ -358,7 +358,7 @@ export const monitorCustomLiquidFillChart = {
required: false,
placeholder: '',
relactiveDom: 'dataType',
chartType: 'widget-piechart',
chartType: 'widget-table',
dictKey: 'TEXT_PROPERTIES',
relactiveDomValue: 'dynamicData',
value: '',
... ...
... ... @@ -30,18 +30,18 @@ export const monitorCustomPiePercentageCard = {
placeholder: '',
value: ''
},
{
type: 'el-select',
label: '显示',
name: 'flexFlow',
required: false,
placeholder: '',
selectOptions: [
{code: 'row', name: '横排'},
{code: 'column', name: '竖排'},
],
value: 'row'
},
// {
// type: 'el-select',
// label: '显示',
// name: 'flexFlow',
// required: false,
// placeholder: '',
// selectOptions: [
// {code: 'row', name: '横排'},
// {code: 'column', name: '竖排'},
// ],
// value: 'row'
// },
{
type: 'custom-upload',
label: '标题图标',
... ... @@ -68,6 +68,43 @@ export const monitorCustomPiePercentageCard = {
},
[
{
name: '卡片设置',
list: [
{
type: 'vue-color',
label: '卡片背景颜色',
name: 'backgroundItem',
required: false,
placeholder: '',
value: 'rgb(244, 245, 250)'
},
{
type: 'el-input-number',
label: '边框圆角',
name: 'radiusCard',
required: false,
placeholder: '',
value: 3,
},
{
type: 'el-input-number',
label: '宽度',
name: 'widthCard',
required: false,
placeholder: '',
value: 450,
},
{
type: 'el-input-number',
label: '高度',
name: 'heightCard',
required: false,
placeholder: '',
value: 200,
},
]
},
{
name: '标题设置',
list: [
{
... ... @@ -425,9 +462,71 @@ export const monitorCustomPiePercentageCard = {
placeholder: '',
relactiveDom: 'dataType',
relactiveDomValue: 'staticData',
value: [
value:/* [
{"num":50,"name":'cpu容量'},{"num":70,"name":'内存容量'},{"num":90,"name":'存储容量'}
],
],*/
[
{
"memorySetRate": 15,
"resType": "VIRTUALIZATION_VMWARE",
"ip": "95.12.88.119",
"memoryUsed": 1612,
"resId": "053C8EBFE71BB5B47C707416CCCD0F6D",
"lastColTime": "2022-03-11 09:45:54",
"adminName": "胡颖洁",
"linkState": "连接成功",
"resName": "互联网区VMWARE CENTER119",
"cpuSetRate": 13,
"memorySize": 4606,
"storageUsed": 27,
"adminPhone": "13897202913",
"storageSize": 53,
"resCode": "hlwqvmwarecenter119",
"healthDesc": "优",
"state": "monitor",
"storageSetRate": 12
},
{
"memorySetRate": 49,
"resType": "VIRTUALIZATION_VMWARE",
"ip": "1.1.0.55",
"memoryUsed": 1515,
"resId": "85dd20ecf6f545a98973333aef88697e",
"lastColTime": "2022-03-11 09:48:15",
"adminName": "杨岩冬",
"linkState": "连接成功",
"resName": "互联网虚拟化55",
"cpuSetRate": 10,
"memorySize": 3070,
"storageUsed": 24,
"adminPhone": "18997480119",
"storageSize": 32,
"resCode": "hlwxnh55",
"healthDesc": "优",
"state": "monitor",
"storageSetRate": 75
},
{
"memorySetRate": 40,
"resType": "VIRTUALIZATION_VMWARE",
"ip": "95.12.89.120",
"memoryUsed": 7017,
"resId": "B3BE67C74F6C1EA5ABA5197B01BCA70F",
"lastColTime": "2022-03-11 09:46:06",
"adminName": "杨岩冬",
"linkState": "连接成功",
"resName": "内网VMWARE VCENTER 120",
"cpuSetRate": 3,
"memorySize": 17398,
"storageUsed": 165,
"adminPhone": "18997480119",
"storageSize": 351,
"resCode": "nwvmvcenter110",
"healthDesc": "优",
"state": "monitor",
"storageSetRate": 47
}
]
},
{
type: 'dycustComponents',
... ... @@ -436,7 +535,7 @@ export const monitorCustomPiePercentageCard = {
required: false,
placeholder: '',
relactiveDom: 'dataType',
chartType: 'widget-piechart',
chartType: 'widget-table',
dictKey: 'TEXT_PROPERTIES',
relactiveDomValue: 'dynamicData',
value: '',
... ... @@ -466,7 +565,7 @@ export const monitorCustomPiePercentageCard = {
name: 'width',
required: false,
placeholder: '该容器在1920px大屏中的宽度',
value: 450,
value: 1800,
},
{
type: 'el-input-number',
... ... @@ -474,7 +573,7 @@ export const monitorCustomPiePercentageCard = {
name: 'height',
required: false,
placeholder: '该容器在1080px大屏中的高度',
value: 180,
value: 240,
},
],
}
... ...
... ... @@ -325,7 +325,7 @@ export const monitorProgressInformation = {
required: false,
placeholder: '',
relactiveDom: 'dataType',
chartType: 'widget-piechart',
chartType: 'widget-table',
dictKey: 'TEXT_PROPERTIES',
relactiveDomValue: 'dynamicData',
value: '',
... ...
... ... @@ -222,11 +222,11 @@ export const monitorSystemInformation = {
relactiveDom: 'dataType',
relactiveDomValue: 'staticData',
value: [
{"num":4,'name':'资源总量','code':'resources-total'},
{"num":6,'name':'小型机分区','code':'mini-partition'},
{"num":9,'name':'PC服务器','code':'PC-server'},
{"num":10,'name':'虚拟机','code':'virtual-machine'},
{"num":11,'name':'Oracle','code':'oracle'},
{"total":4,'resTypeName':'资源总量','resType':'resources-total'},
{"total":6,'naresTypeNameme':'小型机分区','resType':'mini-partition'},
{"total":9,'resTypeName':'PC服务器','resType':'PC-server'},
{"total":10,'resTypeName':'虚拟机','resType':'virtual-machine'},
{"total":11,'resTypeName':'Oracle','resType':'oracle'},
],
},
{
... ... @@ -236,7 +236,7 @@ export const monitorSystemInformation = {
required: false,
placeholder: '',
relactiveDom: 'dataType',
chartType: 'widget-piechart',
chartType: 'widget-table',
dictKey: 'TEXT_PROPERTIES',
relactiveDomValue: 'dynamicData',
value: '',
... ...
... ... @@ -32,6 +32,14 @@ export const monitorTreeShape = {
},
{
type: 'el-switch',
label: '右边内容',
name: 'isFrame',
required: false,
placeholder: '',
value: true
},
{
type: 'el-switch',
label: '加边框',
name: 'isBorder',
required: false,
... ... @@ -63,6 +71,14 @@ export const monitorTreeShape = {
// value: '18'
// },
{
type: 'el-switch',
label: '分类型',
name: 'isType',
required: false,
placeholder: '',
value: true
},
{
type: 'vue-color',
label: '字体颜色',
name: 'titleColor',
... ...
... ... @@ -12,26 +12,50 @@
</div>
<!-- <dynamicTableComponents :formData="dtInformationData"></dynamicTableComponents>-->
<div class="basic-ul-right" :style="borderStyleF" >
<div @mouseenter="mouseFun" @mouseleave="leaveFun" v-if="informationData[0].isDisplay=='1'">
<el-row class="backColor">
<el-col class="padding-10" :style="[borderStlye,tableTitleStyle]" aria-colspan="2">
<a class="link-type" :style="tableTitleStyle" :href="jkAddress.jkUrl" target="_blank">{{informationData[0].name}}</a>
<i class="el-icon-info" v-if="visible" @click="resTopo"/>
</el-col>
</el-row>
</div>
<div v-if="optionsSetUp.isTableTitle" >
<el-row class="backColor" :style="bodyTitleStyle">
<el-col class="padding-10" :style="[tableTitleStyle]" aria-colspan="2">
<span v-if="!titleName" class="link-type" :style="tableTitleStyle" @click="goTrend(informationDataAll[0])">{{informationDataAll[0].name}}</span>
<span v-if="titleName" class="link-type" :style="tableTitleStyle" @click="goTrend({resId:resId,resType:resType})">{{titleName}}</span>
<el-tooltip v-model="visible" :manual="true" placement="right-start">
<template #content>
<div class="basic-tbody-all basic-border-nowrap" :style="wrapStyle">
<el-row class="basic-item" v-if="item.isDisplay=='1' && (titleName?index>=0:index>0)" v-for="(item,index) in informationDataAll" :key="index">
<el-col :style="[lineHeightStyle]" v-if="(titleName?index>=0:index>0)" class="basic-border basic-item-title basic-flex" :span="10">
{{ item.name }}
</el-col>
<el-col :style="[lineHeightStyle]" v-if="(titleName?index>=0:index>0) " class="basic-border basic-flex basic-item-content" :span="14"><span>{{ item.value }}</span>
</el-col>
</el-row>
</div>
</template>
<i class="el-icon-info"@mouseenter="visible = true"/>
</el-tooltip>
<el-tooltip
class="box-item"
effect="dark"
content="查看拓扑图"
placement="top"
>
<i class="el-icon-orange" @click="resTopo({resId:resId,resType:resType})" ></i>
</el-tooltip>
</el-col>
</el-row>
</div>
<div class="basic-tbody basic-border-wrap" :style="wrapStyle">
<el-row class="basic-item" :style="itemStyle" v-if="item.isDisplay=='1' && index>0" v-for="(item,index) in informationData" :key="index">
<!-- <el-col :style="headStyle" v-if="attrKey.attrKeyVal.indexOf(item.code)>0 && index>0" class="basic-border basic-item-title basic-flex backColor" :span="10">-->
<el-col :style="[headStyle,borderStlye,lineHeightStyle]" v-if="index>0" class="basic-border basic-item-title basic-flex backColor" :span="10">
<el-row class="basic-item" :style="itemStyle" v-if="item.isDisplay=='1' && (titleName?index>=0:index>0)" v-for="(item,index) in informationData" :key="index">
<!-- <el-col :style="headStyle" v-if="attrKey.attrKeyVal.indexOf(item.nameCode)>0 && index>0" class="basic-border basic-item-title basic-flex backColor" :span="10">-->
<el-col :style="[headStyle,borderStlye,lineHeightStyle]" v-if="(titleName?index>=0:index>0)" class="basic-border basic-item-title basic-flex backColor" :span="10">
{{ item.name }}
</el-col>
<!-- <el-col :style="bodyStyle" v-if="attrKey.attrKeyVal.indexOf(item.code)>0 && index>0 " class="basic-border basic-flex basic-item-content" :span="14"><span>{{ item.value }}</span>-->
<el-col :style="[bodyStyle,borderStlye,lineHeightStyle,borderStyleRight(index)]" v-if="index>0 " class="basic-border basic-flex basic-item-content" :span="14"><span>{{ item.value }}</span>
<!-- <el-col :style="bodyStyle" v-if="attrKey.attrKeyVal.indexOf(item.nameCode)>0 && index>0 " class="basic-border basic-flex basic-item-content" :span="14"><span>{{ item.value }}</span>-->
<el-col :style="[bodyStyle,borderStlye,lineHeightStyle,borderStyleRight(index)]" v-if="(titleName?index>=0:index>0) " class="basic-border basic-flex basic-item-content" :span="14">
<span :class="{'link-type':item.nameCode=='resName'}" @click="goTrend({resId:resId,resType:resType})">{{ item.value }}</span>
</el-col>
<!-- && attrKey.attrKeyVal.includes(item.code)-->
<!-- && attrKey.attrKeyVal.includes(item.nameCode)-->
</el-row>
<el-row class="basic-item 111" :style="[itemStyle,borderStlyeLast]" v-if="informationData.length%2==0">
<el-row class="basic-item 111" :style="[itemStyle,borderStlyeLast]" v-if="optionsSetUp.isTowColumn && informationData.length%2==0">
<el-col class="basic-border basic-item-title basic-flex" :span="10">
</el-col>
<el-col class="basic-border basic-flex basic-item-content" :span="14"><span></span>
... ... @@ -59,18 +83,22 @@
<script>
// import customMenuBox from "../../designerComponents/customMenuBox";//下探组件
import customDialog from "../../designerComponents/customDialog";
import {mapGetters} from "_vuex@3.0.1@vuex";
// import dynamicTableComponents from "../../designerComponents/dynamicTableComponents";
export default {
name: "basicInformationTwo",
data() {
return {
titleName:'',//路由传递的名称
resType:'',//路由传递的资源类型
resId:'',//路由传递的资源id
options: {},
optionsSetUp: {},
optionsPosition: {},
optionsData: {},
informationData: [{name:'',code:''}],
informationDataAll: [],
informationData: [{name:'',nameCode:''}],
informationDataAll: [{display:1}],
dataLength:0,
tableDate: [],
pressingVisible: false,
... ... @@ -79,14 +107,14 @@
hackReset: true,
tableDataValue: {kpiId: ''},
tableDataValueHead: {},
resType: '',
marginStyle: '',//弹框距离顶部距离
heightStyle: '',//弹框遮罩层高度
widthStyle: ';',//弹框宽度样式
topoSrc: '',
resUrl: 'http://www.baidu.com', //跳转详情页面
topoVisible: false, //资源topo弹框
dialogName: "" //弹框标题
dialogName: "" ,//弹框标题
addTableData:[],//传递的表头设置的内容
}
},
components: {customDialog},//customMenuBox
... ... @@ -95,7 +123,8 @@
ispreview: Boolean,
},
computed: {
transStyle() {
...mapGetters(['tableHeadInfos']),
transStyle() {
return this.objToOne(this.options);
},
styleObj() {
... ... @@ -169,6 +198,18 @@
"border-top-color": headStyle.borderColor,
};
},
//信息表格内容标题样式
bodyTitleStyle(){
const headStyle = this.optionsSetUp;
return{
"border-bottom-style": headStyle.isLine ? "solid" : "none",
"border-bottom-width": headStyle.borderWidth + "px",
"border-bottom-color":headStyle.borderColor,
"border-right-style": headStyle.isLine ? "solid" : "none",
"border-right-width": headStyle.borderWidth + "px",
"border-right-color":headStyle.borderColor,
}
},
//表格标题样式
tableTitleStyle(){
return{
... ... @@ -229,7 +270,7 @@
imgSizeStyle() {
return {
"width": this.transStyle.pictureSize + "px",
"height" : $(".basic-ul-right").height()
// "height" : $(".basic-ul-right").height()
}
},
//监控地址
... ... @@ -266,11 +307,12 @@
this.optionsPosition = this.value.position;
this.optionsData = this.value.data;
this.handlerData();
this.getTitleName();
},
methods: {
//右侧最后一个元素边框样式
borderStyleRight(index){
let border='none';
/* let border='none';
if(index+1==this.informationData.length){
border='none'
}else{
... ... @@ -278,43 +320,46 @@
}
return{
'border-right':border
}
}*/
},
handlerData() {
const resData = this.optionsData;
resData.dataType == "staticData"
? this.handlerStaticData(resData.staticData)
: this.handlerDynamicData(resData.dynamicData, resData.refreshTime);
: this.handlerDynamicData(resData.dynamicData, resData.refreshTime,resData.isRefresh);
},
handlerStaticData(data) {
this.informationDataAll = data;
if (this.informationDataAll && this.informationDataAll.length > 0) {
this.informationDataAll.map(item => {
if (typeof (item.value) != 'string') {
item.value = item.value[0].state;
}
item.isDisplay='1';
if(this.tableHeadInfos.length==0) {
item.isDisplay = '1';
}
})
}
let addTableData=[];
this.addTableData=[];
this.informationDataAll.map((item,index)=>{
addTableData.push({
key:item.code,
this.addTableData.push({
key:item.nameCode,
name:item.name,
width:"50%",
// isDisplay:item.isDisplay,
isDisplay:item.isDisplay,
state:item.state,
value:item.value
})
})
this.setDisplay();
this.$store.commit('CHANGW_HEAD_INFO', this.addTableData);
this.setDisplay();
this.$store.commit('CHANGW_HEAD_INFO', addTableData);
},
handlerDynamicData(data, refreshTime) {
handlerDynamicData(data, refreshTime,isRefresh) {
if (!data) return;
if (this.ispreview) {
if (this.ispreview && isRefresh) {
this.getEchartData(data);
this.flagInter = setInterval(() => {
this.getEchartData(data);
... ... @@ -326,33 +371,40 @@
getEchartData(val) {
const data = this.queryEchartsData(val);
data.then(res => {
if (res && res[0].code == 0)
this.informationDataAll = res[0].data;
if (this.informationDataAll && this.informationDataAll.length > 0) {
this.informationDataAll.map(item => {
if (typeof (item.value) != 'string') {
item.value = item.value[0].state;
}
item.isDisplay='1';
})
}
if (res && res[0].code == 0){
this.informationDataAll = res[0].data;
}else if(res && res.length>0){
this.informationDataAll=res;
}
if (this.informationDataAll && this.informationDataAll.length > 0) {
this.informationDataAll.map(item => {
if (item.value && typeof (item.value) != 'string' && item.value[0]) {
item.value =item.value[0].state;
}
if(this.tableHeadInfos.length==0) {
item.isDisplay = '1';
}
})
}
this.setDisplay();
if (this.imgStyle.dataNum) {
this.informationData = this.informationDataAll.slice(0, this.imgStyle.dataNum);
}
let addTableData=[];
this.informationDataAll.map((item,index)=>{
addTableData.push({
key:item.code,
name:item.name,
width:"50%",
isDisplay:item.isDisplay
})
let addTableData=[];
this.informationDataAll.map((item,index)=>{
addTableData.push({
key:item.nameCode,
name:item.name,
width:"50%",
isDisplay:item.isDisplay,
state:item.state,
value:item.value
})
this.$store.commit('CHANGW_HEAD_INFO', addTableData);
})
this.$store.commit('CHANGW_HEAD_INFO', addTableData);
this.hackResetFun();
this.hackResetFun();
});
},
// vue hack 之强制刷新组件
... ... @@ -365,35 +417,14 @@
//设置信息列表数据每一行是否显示
setDisplay() {
let head=this.optionsSetUp.dynamicAddTable;
let arr=[];
head.map(hv=>{
arr.push({
code:hv.key,
name:hv.name,
isDisplay:hv.isDisplay,
state:hv.state,
value:hv.value
})
})
/*this.informationDataAll.map(item=>{
console.log("&&&&&&",item)
arr.map(hv=>{
if(item.code==hv.code){
console.log("***")
item.isDisplay=hv.isDisplay;
}
})
})*/
this.informationDataAll=arr;
/* for(let i=0;i<arr.length;i++){
if(arr[i].code==this.informationDataAll[i].code){
this.informationDataAll[i].isDisplay=arr[i].isDisplay;
for(let i=0;i<head.length;i++){
if(this.informationDataAll[i] && head[i].key==this.informationDataAll[i].nameCode){
this.informationDataAll[i].isDisplay=head[i].isDisplay;
}
}*/
}
if (this.imgStyle.dataNum) {
this.informationData = this.informationDataAll.slice(0, this.imgStyle.dataNum);
}
console.log(" this.informationData",head,arr,this.informationDataAll, this.informationData)
},
pressingTimes() {
this.pressingVisible = true;
... ... @@ -415,9 +446,18 @@
this.visible = false;
},
//
resTopo() {
this.topoSrc = this.topoAddress.topoUrl;
this.topoVisible = true;
resTopo(item) {
// this.topoSrc = this.topoAddress.topoUrl;
// this.topoVisible = true;
let param = {
type:'topology',
data:{
resId: item.resId,
resType: item.resType
}
}
window.parent.postMessage(param, '*')
},
//弹框关闭确定
hideDialog() {
... ... @@ -425,7 +465,35 @@
},
okFunc() {
this.topoVisible = false;
},
//打开详情页
goTrend(item) {
let param = {
type:'detail',
data:{
resId: item.resId,
resType: item.resType
}
}
window.parent.postMessage(param, '*')
},
//获取路由传过来的名称
getTitleName(){
this.titleName=this.$route.query.titleName;
this.resId=this.$route.query.resId;
this.resType=this.$route.query.resType;
if(this.resId){
this.handleInfoData();
}
},
//根据resId获取信息详情
handleInfoData() {
let optionsData = this.optionsData;
if (this.optionsData.dataType == "dynamicData") {
this.optionsData.dynamicData.contextData.resId = this.resId;
}
},
},
}
... ... @@ -478,8 +546,16 @@
.link-type {
white-space: nowrap;
color: #0d82e9;
cursor: pointer;
margin-right:5px;
}
.box-item{
margin-left:5px;
cursor: pointer;
}
.el-icon-info{
cursor: pointer;
}
.title-name {
color: rgb(30, 159, 255);
font-size: 16px;
... ... @@ -506,7 +582,7 @@
}
.basic-ul-all {
.basic-tbody-all {
.basic-item:nth-child(even) {
background-color: #262323 !important;
}
... ... @@ -530,7 +606,11 @@
//flex-flow: column;
flex-wrap: wrap;
}
.basic-border-nowrap{
display: flex;
flex-flow: column;
min-width: 300px;
}
.basic-img {
width: 16px;
... ... @@ -549,7 +629,7 @@
display: inline-block;
}
}*/
.basic-ul-all {
.basic-tbody-all {
.basic-item-content {
text-align: center;
}
... ...
... ... @@ -16,6 +16,7 @@ export default {
},
data() {
return {
kpiUnit:'',
options: {
color: [],
grid: {},
... ... @@ -26,8 +27,8 @@ export default {
}
},
tooltip: {
trigger: "item",
formatter: "{a} <br/>{b} : {c}%"
trigger: "axis",
formatter: "{a} <br/>{b} : {c} '%'"
},
legend: {
textStyle: {
... ... @@ -89,6 +90,13 @@ export default {
yAxisIndex: 1,
data: [],
itemStyle: {}
},
{
name: "",
type: "line",
yAxisIndex: 1,
data: [],
itemStyle: {}
}
]
},
... ... @@ -133,8 +141,8 @@ export default {
let optionsData=this.optionsData;
if(this.optionsData.dataType=="dynamicData"){
//改变参数值-月季度年,重新加载动态数据--待测
this.optionsData.dynamicData.contextData.btnCode=val;
this.editorOptions();
this.optionsData.dynamicData.contextData.time=val;
// this.editorOptions();
}
}
... ... @@ -181,7 +189,11 @@ export default {
fontWeight: optionsSetup.subTextFontWeight,
fontSize: optionsSetup.subTextFontSize
};
title.top='8px';
if(optionsSetup.textAlignVertical=='bottom'){
title.bottom='0';
}else{
title.top='8px';
}
this.options.title = title;
},
// X轴设置
... ... @@ -217,7 +229,8 @@ export default {
lineStyle: {
color: optionsSetup.splitLineColorX
}
}
},
boundaryGap:['1','2']//坐标轴两边留白,为false则从0开始
};
this.options.xAxis = xAxis;
},
... ... @@ -341,12 +354,43 @@ export default {
// tooltip 设置
setOptionsTooltip() {
const optionsSetup = this.optionsSetup;
let that=this;
const tooltip = {
trigger: "item",
trigger: "axis",
show: true,
textStyle: {
color: optionsSetup.lineColor,
fontSize: optionsSetup.tipFontSize
},
formatter:function (param) {
let kpiName=optionsSetup.titleText;
// 鼠标悬浮线上提示
// 顶部提示
let tips = '<table>';
if (param.length == 1) {
tips += "<tr><td style='text-align:left;' colspan='4'>" + param[0].name + "</td></tr>";
} else {
tips += "<tr><td style='text-align:left;' colspan='4'>" + kpiName + " " + param[0].name + "</td></tr>";
}
// 每一条提示
$.each(param, function (i, v) {
let kpiUnit='';
tips += "<tr><td>" + v.marker + "</td>";
tips += '<td style="text-align: left;">';
if (v.seriesName.indexOf('率') != -1) {
kpiUnit='%';
}else{
kpiUnit=that.kpiUnit
}
tips += (v.seriesName + ' ');
// tips += (v.seriesName && v.seriesName != '1' && !/series[0-9]+/.test(v.seriesName)) ? v.seriesName : '';
tips += '</td>'
tips += "<td>:&nbsp;</td><td>" + v.value;
tips += kpiUnit + "</td></tr>";
});
tips += '</table>'
return tips;
}
};
this.options.tooltip = tooltip;
... ... @@ -453,7 +497,7 @@ export default {
renderingFn(val) {
this.options.xAxis.data = val.xAxis;
// series 模拟数据
val.series.push({
/*val.series.push({
type:'line',
name:'使用率',
data:['5.66','6.99','7.99','8.99','5.66','6.99','7.99','8.99','5.66','6.99','7.99','8.99','5.66','6.99','7.99','8.99']
... ... @@ -462,18 +506,28 @@ export default {
type:'line',
name:'容量',
data:['9.66','7.99','6.99','5.99','5.66','9.66','7.99','6.99','5.99','6.99','9.66','7.99','6.99','5.99','8.99']
})
})*/
///////
const series = val.series;
if(series && series.length>0){
series.map((item,index)=>{
if(index%2==0){
item.yAxisIndex= 1;
}
if(item.name.indexOf('率')!=-1){
item.yAxisIndex= 1;
}else{
item.yAxisIndex=0;
}
// if(index%2==0){
// item.yAxisIndex= 1;
// }else{
// item.yAxisIndex=0;
// }
if(item.type=='bar'){
item.itemStyle= {
barBorderRadius: null
}
item.barMinHeight=2;
}else if(item.type=='line'){
item.itemStyle= {
borderRadius: null
... ...
... ... @@ -452,7 +452,6 @@ export default {
echartsClick(){
let that=this;
this.$refs.myEchart.chart.on('click',function (params){
console.log("()()()()()",params.name,params.data,params)
that.$set(that.tableDataValue,'name',params.name)
that.$set(that.tableDataValue,'data',params.data)
that.goTrend();
... ...
... ... @@ -97,8 +97,8 @@ export default {
let optionsData=this.optionsData;
if(this.optionsData.dataType=="dynamicData"){
//改变参数值-月季度年,重新加载动态数据--待测
this.optionsData.dynamicData.contextData.btnCode=val;
this.editorOptions();
this.optionsData.dynamicData.contextData.dataScope=val;
// this.editorOptions();
}
}
... ... @@ -142,7 +142,11 @@ export default {
fontWeight: optionsSetup.subTextFontWeight,
fontSize: optionsSetup.subTextFontSize
};
title.top='8px';
if(optionsSetup.textAlignVertical=='bottom'){
title.bottom='0';
}else{
title.top='8px';
}
this.options.title = title;
},
// X轴设置
... ... @@ -185,14 +189,15 @@ export default {
color: optionsSetup.splitLineColorX
}
},
boundaryGap: ['10%', '10%'],
// boundaryGap: ['10%', '10%'],
boundaryGap:false,
splitArea: {
show: optionsSetup.splitArea,
areaStyle: {
color: [optionsSetup.splitAreaColor, 'transparent'
]
}
}
},
};
this.options.xAxis = xAxis;
},
... ...
... ... @@ -14,7 +14,8 @@
</div>
</div>
</div>
<div class="wave-title" :style="subTitleStyle">当前使用率</div>
<div class="wave-title" :style="subTitleStyle" v-if="index==0">当前使用率</div>
<div class="wave-title" :style="subTitleStyle" v-if="index==1">使用增长率</div>
</div>
</div>
... ... @@ -36,9 +37,9 @@ export default {
return {
// topStyle:'',//水波纹的大小
fillData:[],//数据
topNum:0,//水波纹的大小
nums:0,
options: {
// topNum:0,//水波纹的大小
// nums:0,
/* options: {
title: {
text: '{nums|' + per + '}{percent|%}',
x: 'center',
... ... @@ -112,7 +113,7 @@ export default {
}
}
],
},
},*/
optionsStyle: {}, // 样式
optionsData: {}, // 数据
optionsCollapse: {}, // 图标属性
... ... @@ -161,7 +162,7 @@ export default {
return {
/* width: width + "px",
height: width + "px",*/
margin:this.optionsSetup.flexFlow=='column'?'5px 10px':'10px'
margin:this.optionsSetup.flexFlow=='column'?'5px 10px':'10px 15px'
}
},
//波纹样式
... ... @@ -253,13 +254,13 @@ export default {
);
},
staticDataFn(val) {
const title = this.options.title;
const num = val[0]['num'];
// const title = this.options.title;
// const num = val[0]['num'];
if(val && val.length>0) {
this.fillData=val;
}
this.nums = num ;
this.topNum=100-num;
// this.nums = num ;
// this.topNum=100-num;
},
topStyle(val){
... ... @@ -282,12 +283,20 @@ export default {
getEchartData(val) {
const data = this.queryEchartsData(val);
data.then(res => {
if(res && res.object) {
if(typeof res.object=='object'){
let arr=[];
for(let key in res.object){
arr.push({num:res.object})
}
this.fillData=arr;
}else{
this.fillData=[res.object];
this.nums = res[0].value ;
if(res && res.length>0){
this.fillData=res;
}
}
this.topNum=100-this.nums;
});
},
}
... ... @@ -307,9 +316,13 @@ export default {
justify-content: space-around;
}
.fill-item{
width:100%;height:100%;
//width:100%;
height:100%;
//flex: 1;
margin:10px;
align-items: start;
display: flex;
flex-flow: column;
}
.circle{
background-image: linear-gradient(20deg, #5a8ef5 , #aeedf1);
... ... @@ -358,9 +371,11 @@ export default {
font-size: 20px;
}
.wave-title{
padding:10px;
padding:10px 0;
margin-top:10px;
}
.fillContainer-title{
padding:15px;
margin-bottom:15px;
}
</style>
... ...
<template>
<div :style="styleObj" class="flex-div" @click="goJump">
<div class="percent-title" :style="titleStyle">
<img :src="imgStyle.imageAdress" alt="" class="icon-title">
{{ optionsSetup.titleName }}
</div>
<div class="percentContainer" :style="flexStyle">
<v-chart :options="options" autoresize/>
<div class="percent-label-item">
<div class="chart-title" v-for="(item,index) in percentData" :key="index">
<span :style="numStyle(item)">{{ item.num }}</span>
<span :style="pieStyle(item)">%</span>
</div>
<div :style="styleObj" class="flex-div-content" >
<div :style="styleObjItem" class="flex-div" @click="goJump(item)" v-for="(item,index) in percentData" :key="index">
<div class="percent-title" :style="titleStyle">
<img :src="imgStyle.imageAdress" alt="" class="icon-title">
<!-- {{ optionsSetup.titleName }}-->
{{item.resName}}
</div>
<div class="percent-item" >
<div class="chart-title" :style="subTitleStyle" v-for="(item,index) in percentData" :key="index">{{ item.name }}</div>
<div class="percentContainer" :style="flexStyle">
<v-chart :options="options[index]" autoresize/>
<div class="percent-label-item">
<div class="chart-title" v-for="(itemChild,index) in item.percentData" :key="index">
<span :style="numStyle(itemChild)">{{ itemChild.num }}</span>
<span :style="pieStyle(itemChild)">%</span>
</div>
</div>
<div class="percent-item" >
<div class="chart-title" :style="subTitleStyle" v-for="(itemChild,index) in item.percentData" :key="index">{{ itemChild.name }}</div>
</div>
</div>
</div>
<div :style="styleObjItemSup" class="flex-div" v-for="(item,index) in 3"></div>
</div>
</template>
... ... @@ -33,100 +38,25 @@ export default {
return {
percentData:'',//数据
angle: 0,
options: {
/*title: {
text: '{nums|' + per + '}{percent|%}',
// x: 'center',
// y: 'center',
textStyle: {
rich: {
nums: {
fontSize: 60,
color: '#29EEF3',
},
percent: {
fontSize: 30,
color: '#29EEF3',
},
},
},
},*/
legend: {
type: 'plain',
orient: 'vertical',
right: 0,
top: '10%',
align: 'auto',
textStyle: {
color: 'white',
fontSize: 16,
padding: [10, 1, 10, 0],
},
selectedMode: false,
},
bottom:10,
series:[],
/*series: [
{
//name: '圆环',
type: 'pie',
radius: ['58%', '45%'],
silent: true,
clockwise: false,//圆环旋转方向,逆时针/顺时针
startAngle: 90,
z: 0,
zlevel: 0,
label: {
normal: {
position: 'center',
},
},
itemStyle:{
borderColor:'#00ff00',
borderWidth:[0,0,0,3],
borderType :'solid',
},
data: [
{
value: per,
name: '',
itemStyle: {
normal: {
color: {
// 完成的圆环的颜色
colorStops: [
{
offset: 0,
color: '#4FADFD', // 0% 处的颜色
},
{
offset: 1,
color: '#28E8FA', // 100% 处的颜色
},
],
},
},
},
},
{
value: 100 - per,
name: '',
label: {
normal: {
show: false,
},
},
//剩余圆环颜色
itemStyle: {
normal: {
color: '#173164',
},
},
},
],
},
],*/
},
options: [
{
legend: {
type: 'plain',
orient: 'vertical',
right: 0,
top: '10%',
align: 'auto',
textStyle: {
color: 'white',
fontSize: 16,
padding: [10, 1, 10, 0],
},
selectedMode: false,
},
bottom:10,
series:[],
},
],
optionsStyle: {}, // 样式
optionsData: {}, // 数据
optionsCollapse: {}, // 图标属性
... ... @@ -142,12 +72,28 @@ export default {
left: this.optionsStyle.left + "px",
top: this.optionsStyle.top + "px",
background: this.optionsSetup.background,
cursor:this.optionsSetup.isNextPage?'pointer':''
};
},
styleObjItem(){
return{
width: this.optionsSetup.widthCard + "px",
height: this.optionsSetup.heightCard + "px",
cursor:this.optionsSetup.isNextPage?'pointer':'',
background: this.optionsSetup.backgroundItem,
'border-radius':this.optionsSetup.radiusCard+'px'
}
},
//补充空div
styleObjItemSup(){
return{
width: this.optionsSetup.widthCard + "px",
height: this.optionsSetup.heightCard + "px",
}
},
flexStyle(){
return{
'flex-flow':this.optionsSetup.flexFlow
// 'flex-flow':this.optionsSetup.flexFlow
}
},
//标题样式设置
... ... @@ -236,11 +182,11 @@ export default {
this.setOptionSurplusColor();
this.setOptionsData();
},
//设置环形图中心点
/*//设置环形图中心点
setSeriesCenter(){
if(this.percentData.series){
let width=this.optionsStyle.width;
let height=this.optionsStyle.height;
let width=this.optionsSetup.widthCard;
let height=this.optionsSetup.heightCard;
let width1=width/this.percentData.length;
let height1=height/2;
this.percentData.series.map((item,index)=> {
... ... @@ -248,66 +194,72 @@ export default {
item.center=center;
})
}
},
setOptionsTitle() {
const optionsSetup = this.optionsSetup;
if(this.percentData && this.percentData.length>0){
this.percentData.map(item=>{
const title = item.options.title;
title.x = "center";
title.y = "center";
const rich = {
nums: {
fontSize: optionsSetup.textNumFontSize,
color: optionsSetup.isCircleColor?item.num<60?optionsSetup.color0Start:item.num<90?optionsSetup.color0Start90:optionsSetup.color0Start100: optionsSetup.textNumColor,
fontWeight: optionsSetup.textNumFontWeight
},
percent: {
fontSize: optionsSetup.textPerFontSize,
color: optionsSetup.isCircleColor?item.num<60?optionsSetup.color0Start:item.num<90?optionsSetup.color0Start90:optionsSetup.color0Start100:optionsSetup.textPerColor,
fontWeight: optionsSetup.textPerFontWeight
}
};
title.textStyle['rich'] = rich;
item.options.title = title;
})
}
},
},*/
/* setOptionsTitle() {
const optionsSetup = this.optionsSetup;
if(this.percentData && this.percentData.length>0){
this.percentData.map(item=>{
const title = item.options.title;
title.x = "center";
title.y = "center";
const rich = {
nums: {
fontSize: optionsSetup.textNumFontSize,
color: optionsSetup.isCircleColor?item.num<60?optionsSetup.color0Start:item.num<90?optionsSetup.color0Start90:optionsSetup.color0Start100: optionsSetup.textNumColor,
fontWeight: optionsSetup.textNumFontWeight
},
percent: {
fontSize: optionsSetup.textPerFontSize,
color: optionsSetup.isCircleColor?item.num<60?optionsSetup.color0Start:item.num<90?optionsSetup.color0Start90:optionsSetup.color0Start100:optionsSetup.textPerColor,
fontWeight: optionsSetup.textPerFontWeight
}
};
title.textStyle['rich'] = rich;
item.options.title = title;
})
}
},*/
//圆环0-100%颜色
setOptionsColor() {
const optionsSetup = this.optionsSetup;
if(this.options.series && this.options.series.length>0){
this.options.series.map(item=>{
const itemStyle = item['data'][0]['itemStyle']
const normal = {
color: {
// 完成的圆环的颜色
colorStops: [
{
offset: 0,
color: item['data'][0].value<60?optionsSetup.color0Start:item['data'][0].value<90?optionsSetup.color0Start90:optionsSetup.color0Start100, // 0% 处的颜色
},
{
offset: 1,
color: item['data'][0].value<60?optionsSetup.color100End:item['data'][0].value<90?optionsSetup.color100End90:optionsSetup.color100End100, // 100% 处的颜色
},
],
},
};
itemStyle['normal'] = normal
})
}
this.options.map(itemAll=>{
if(itemAll.series && itemAll.series.length>0){
itemAll.series.map(item=>{
const itemStyle = item['data'][0]['itemStyle']
const normal = {
color: {
// 完成的圆环的颜色
colorStops: [
{
offset: 0,
color: item['data'][0].value<60?optionsSetup.color0Start:item['data'][0].value<90?optionsSetup.color0Start90:optionsSetup.color0Start100, // 0% 处的颜色
},
{
offset: 1,
color: item['data'][0].value<60?optionsSetup.color100End:item['data'][0].value<90?optionsSetup.color100End90:optionsSetup.color100End100, // 100% 处的颜色
},
],
},
};
itemStyle['normal'] = normal
})
}
})
},
setOptionSurplusColor() {
if(this.options.series && this.options.series.length>0){
this.options.series.map(item=>{
const itemStyle = item['data'][1]['itemStyle']
const normal = {
color: this.optionsSetup.colorsurplus,
};
itemStyle['normal'] = normal
})
}
this.options.map(itemAll=>{
if(itemAll.series && itemAll.series.length>0){
itemAll.series.map(item=>{
const itemStyle = item['data'][1]['itemStyle']
const normal = {
color: this.optionsSetup.colorsurplus,
};
itemStyle['normal'] = normal
})
}
})
},
// 数据解析
setOptionsData() {
... ... @@ -320,22 +272,94 @@ export default {
);
},
staticDataFn(val) {
this.percentData=val;
this.setPercentData();
this.setData(val)
},
//处理数据
setData(val){
let dataArr=val;
let arrCpu=[];
let arrmemory=[];
let arrstorage=[];
let optionArr=[]
dataArr.map(item=>{
if(item.cpuSetRate){
arrCpu=[{
num:item.cpuSetRate,
name:'cpu容量'
}]
}
if(item.storageSetRate){
arrmemory=[{
num:item.storageSetRate,
name:'存储容量'
}]
}
if(item.memorySetRate){
arrstorage=[{
num:item.memorySetRate,
name:'内存容量'
}]
}
if(arrCpu.length>0 && arrmemory.length>0 && arrstorage.length>0){
item.percentData=arrCpu.concat(arrmemory).concat(arrstorage);
}else if(arrCpu.length==0 && arrmemory.length>0 && arrstorage.length>0){
item.percentData=arrmemory.concat(arrstorage);
}else if(arrCpu.length>0 && arrmemory.length==0 && arrstorage.length>0){
item.percentData=arrCpu.concat(arrstorage);
}else if(arrCpu.length>0 && arrmemory.length>0 && arrstorage.length==0){
item.percentData=arrCpu.concat(arrmemory);
}else if(arrCpu.length==0 && arrmemory.length==0 && arrstorage.length>0){
item.percentData=arrstorage;
}else if(arrCpu.length==0 && arrmemory.length>0 && arrstorage.length==0){
item.percentData=arrmemory;
}else if(arrCpu.length>0 && arrmemory.length==0 && arrstorage.length==0){
item.percentData=arrCpu;
}
optionArr.push({
legend: {
type: 'plain',
orient: 'vertical',
right: 0,
top: '10%',
align: 'auto',
textStyle: {
color: 'white',
fontSize: 16,
padding: [10, 1, 10, 0],
},
selectedMode: false,
},
bottom:10,
series:[],
},)
})
this.options=optionArr;
this.percentData=dataArr;
this.percentData.map((item,index)=>{
this.setPercentData(index);
})
},
//设置数据
setPercentData(){
setPercentData(index){
let seriesArr=[];
let width=this.optionsStyle.width;
let height=this.optionsStyle.height;
let width1=width/this.percentData.length;
let height1=height/2;
this.percentData.map((item,index)=>{
let width=this.optionsSetup.widthCard;
let height=this.optionsSetup.heightCard;
let width1=width/this.percentData[0].percentData.length;
let height1=height/2-15;
let percentDataArr=this.percentData[index];
percentDataArr.percentData.map((item,index)=>{
let series={
//name: '圆环',
type: 'pie',
radius: ['70%', '60%'],
center:[(width1*index+width1/2),height1],
// center:[30,60],
silent: true,
clockwise: false,//圆环旋转方向,逆时针/顺时针
startAngle: 90,
... ... @@ -394,7 +418,7 @@ export default {
}
seriesArr.push(series)
})
this.options.series=seriesArr;
this.options[index].series=seriesArr;
},
dynamicDataFn(val, refreshTime) {
if (!val) return;
... ... @@ -410,11 +434,10 @@ export default {
getEchartData(val) {
const data = this.queryEchartsData(val);
data.then(res => {
this.percentData=res;
this.setPercentData()
this.setData(res)
});
},
goJump(){
goJump(item){
let locationUrl=this.$route.query;
if(this.optionsSetup.isNextPage){
let nextRouter=this.optionsSetup.nextRouter;
... ... @@ -424,7 +447,7 @@ export default {
if(nextRouter){
this.$router.push({
path: `/bigscreen/viewer`,
query: { reportCode: nextRouter },
query: { reportCode: nextRouter,titleName:item.resName ,resId:item.resId,resType: item.resType},
})
}
... ... @@ -441,18 +464,24 @@ export default {
height: 100%;
overflow: hidden;
}
.flex-div-content{
display: flex;
justify-content: space-between;
flex-wrap: wrap;
}
.flex-div{
display: flex;
flex-flow: column;
margin-bottom: 20px;
}
.percentContainer{
box-sizing: content-box;
/*display: flex;
align-items: center;
display: flex;
/*align-items: center;
justify-content: space-around;*/
flex:1;
position: relative;
flex-flow: column;
}
.percent-label-item{
... ... @@ -472,6 +501,7 @@ export default {
display: flex;
align-items: center;
justify-content: space-around;
padding:10px;
}
.chart-title{
/* position: absolute;
... ...
... ... @@ -614,8 +614,6 @@ export default {
const { success,data } = await getDetailTableDataNoPage(param,this.getUrlToken);
if(success){
let headTable =data;
console.log("alalalal",data)
this.handleHeadContent(headTable[0],'all');
this.widthStyle='';
// this.setDialog('table');
... ... @@ -917,8 +915,6 @@ export default {
this.sortCaret=flg;
this.sortBy=item.key;
}
console.log(" this.optionsData", this.optionsData)
console.log("iiiiiiii",item)
if(this.sortCaret=='ascending'){
//正序
this.order='ASC';
... ... @@ -1035,7 +1031,6 @@ export default {
resId:this.getUrlToken.resId
}
const { success,data } = await getBResourcePage(params,this.getUrlToken);
console.log("success",success,data)
if(success){
let ResourceData=data[0];
let resTypeName=ResourceData.resTypeName;
... ... @@ -1043,7 +1038,6 @@ export default {
// let timeName=new Date().format("yyyyMMddhhmmss",24);
let timeName=this.formatFunction(new Date(), 'yyyyMMddhhmmss')
let title =resTypeName+'-'+resName+'-'+titleName+'-'+timeName;
console.log("title",title)
let kpiIdArr=[];
let kpiIds='';
this.header.map(item=>{
... ...
... ... @@ -218,7 +218,6 @@ export default {
},*/
handlerData() {
const resData = this.optionsData;
console.log("resdata",resData)
resData.dataType == "staticData"
? this.handlerStaticData(resData.staticData)
: this.handlerDynamicData(resData.dynamicData, resData.refreshTime);
... ...
<template>
<div :style="styleObj" class="progressContainer">
<div class="progress-item" :style="itemStyle" v-for="(item,index) in progressData" :key="index">
<div class="progress-title" :style="titleStyle">{{ item.name }}</div>
<div class="progress-title" :style="titleStyle">{{ item.name }}容量信息</div>
<div class="progress-title-proposal" :style="titleProposalStyle">{{item.proposal}}</div>
<div class="progress-content" :style="progressStyle">
<div class="content-all">
<span class="content-total">总空间:383GHZ</span>
<span class="content-total">总空间:{{ item.total }}{{item.unit}}</span>
</div>
<div class="progress-ele">
<el-progress :percentage="item.num" :show-text="showTextStyle" :text-inside="textInsideStyle" :stroke-width="progressWidthStyle" :color="customColorMethod" />
<el-progress :percentage="item.rate" :show-text="showTextStyle" :text-inside="textInsideStyle" :stroke-width="progressWidthStyle" :color="customColorMethod" />
</div>
<div class="content-all">
<span class="content-use" :style="textColor(item.num)">已用:220GHZ</span>
<span class="content-use">剩余:234GHZ</span>
<span class="content-use" :style="textColor(item.rate)">已用:{{ item.used }}{{item.unit}}</span>
<span class="content-use">剩余:{{ item.remain }}{{item.unit}}</span>
</div>
</div>
... ...
... ... @@ -9,10 +9,10 @@
<img :src="imgStyle.infoImageAdress" alt="">
</div>
<div class="system-item" :style="itemStyle" v-for="(item,index) in systemData" :key="index">
<div class="system-img"><img :src="'/src/assets/images/monitor/capacityAnalysis/'+item.code+'.png'" alt=""></div>
<div class="system-img"><img :src="'/src/assets/images/monitor/capacityAnalysis/'+item.resType+'.png'" alt=""></div>
<div class="system-info" :style="titleProposalStyle">
<span>{{item.name}}:</span>
<span>{{item.num}}</span>
<span>{{item.resTypeName}}:</span>
<span>{{item.total}}</span>
</div>
</div>
</div>
... ...
... ... @@ -35,7 +35,7 @@
<span v-if="itemChild.key=='alarmLevel' && item[itemChild.key]=='1'" :class="['table-level-normal',{'table-level-worse':item[itemChild.key]=='2','table-level-worst':item[itemChild.key]=='3'}]" >一般</span>
<span v-else-if="itemChild.key=='alarmLevel' && item[itemChild.key]=='2'" :class="['table-level-normal',{'table-level-worse':item[itemChild.key]=='2','table-level-worst':item[itemChild.key]=='3'}]" >重要</span>
<span v-else-if="itemChild.key=='alarmLevel' && item[itemChild.key]=='3'" :class="['table-level-normal',{'table-level-worse':item[itemChild.key]=='2','table-level-worst':item[itemChild.key]=='3'}]" >严重</span>
<span v-else :class="{'spanLink':itemChild.key=='resTypeName'}" @click="goTrend(item,itemChild.key)">{{ item[itemChild.key] }}</span>
<span v-else :class="{'spanLink':itemChild.key=='resTypeName' || itemChild.key=='resName'}" @click="goTrend(item,itemChild.key)">{{ item[itemChild.key] }}</span>
</el-tooltip>
</div>
... ... @@ -75,7 +75,7 @@
</div>
</div>
<!--数据-->
<div class="bd" v-loading="loadingAll">
<div class="bd1" v-loading="loadingAll">
<ul class="infoList">
<li v-for="(item, index) in listAll" :key="index" :style="tableRowHeight()" >
<div
... ... @@ -91,7 +91,7 @@
<span v-if="itemChild.key=='alarmLevel' && item[itemChild.key]=='1'" :class="['table-level-normal',{'table-level-worse':item[itemChild.key]=='2','table-level-worst':item[itemChild.key]=='3'}]" >一般</span>
<span v-else-if="itemChild.key=='alarmLevel' && item[itemChild.key]=='2'" :class="['table-level-normal',{'table-level-worse':item[itemChild.key]=='2','table-level-worst':item[itemChild.key]=='3'}]" >重要</span>
<span v-else-if="itemChild.key=='alarmLevel' && item[itemChild.key]=='3'" :class="['table-level-normal',{'table-level-worse':item[itemChild.key]=='2','table-level-worst':item[itemChild.key]=='3'}]" >严重</span>
<span v-else :class="{'spanLink':itemChild.key=='resTypeName'}" @click="goTrend(item,itemChild.key)">{{ item[itemChild.key] }}</span>
<span v-else :class="{'spanLink':itemChild.key=='resTypeName' || itemChild.key=='resName'}" @click="goTrend(item,itemChild.key)">{{ item[itemChild.key] }}</span>
</el-tooltip>
</div>
... ... @@ -102,14 +102,14 @@
<!-- 分页 -->
<div class="pageClass" v-if="optionsSetUp.isPage && !optionsSetUp.isRoll" style='text-align: left;background-color: white'>
<el-pagination
v-if="currentPage"
@size-change="handleSizeChange"
@prev-click="prePage"
@next-click="nextPage"
@current-change="handleCurrentChange"
:current-page="currentPage"
v-if="currentPageAll"
@size-change="handleSizeChangeMore"
@prev-click="prePageMore"
@next-click="nextPageMore"
@current-change="handleCurrentChangeMore"
:current-page="currentPageAll"
:page-sizes="pageSizes"
:page-size="pageSize"
:page-size="pageSizeAll"
:total="totalAll">
</el-pagination>
</div>
... ... @@ -144,6 +144,8 @@ export default {
currentPage:1,
pageSize:10,
pageSizes:[10,50,100, 200, 300, 400],
currentPageAll:1,
pageSizeAll:10,
total:0,
totalAll:0,
hackReset: true,
... ... @@ -269,8 +271,12 @@ export default {
},
visConfig() {
this.options.vis = this.optionsSetUp.vis;
this.pageSize = this.options.vis;
this.handleTableData();
if(this.optionsData.dynamicData && this.optionsData.dynamicData.contextData.isMore==true){
this.pageSizeAll=30;
}else{
this.pageSize = this.options.vis;
this.handleTableData();
}
},
handlerRollFn() {
... ... @@ -298,6 +304,7 @@ export default {
this.list = data;
this.listAll=data;
this.loading = false;
this.loadingAll = false;
},
handlerDynamicData(data, refreshTime) {
if (!data) return;
... ... @@ -313,24 +320,23 @@ export default {
getEchartData(val) {
const data = this.queryEchartsData(val);
data.then(res => {
// if(this.optionsData.dynamicData.contextData.isMore){
// console.log("all")
// this.listAll=res;
// this.loadingAll = false;
// this.loading = false;
// if (this.listAll && this.listAll.length > 0) {
// this.totalAll = this.listAll[0].lineCount;
// }
// }else{
console.log("111")
console.log("&&&&&&&",this.optionsData.dynamicData.contextData.isMore)
if(this.optionsData.dynamicData.contextData.isMore==true){
console.log("all")
this.listAll=res;
this.loadingAll = false;
this.loading = false;
if (this.listAll && this.listAll.length > 0) {
this.totalAll = this.listAll[0].lineCount;
}
}else{
this.list = res;
this.loading = false;
this.loadingAll = false;
if (this.list && this.list.length > 0) {
this.total = this.list[0].lineCount;
}
// }
}
this.hackResetFun();
... ... @@ -427,7 +433,7 @@ export default {
this.selectNum = 1;
}
let scrollHeight=e.target.documentElement.scrollTop;
let scrollHeight=e.target.documentElement?e.target.documentElement.scrollTop:0;
if (self != top) {
//嵌入到监控系统iframe中弹框位置样式
... ... @@ -449,7 +455,7 @@ export default {
},
//打开详情页
goTrend(item, itemChildKey) {
if (itemChildKey == 'resTypeName') {
if (itemChildKey == 'resTypeName' || itemChildKey == 'resName') {
let param = {
type:'detail',
data:{
... ... @@ -461,27 +467,59 @@ export default {
window.parent.postMessage(param, '*')
}
},
// 每页展示多少条
handleSizeChangeMore(val) {
// 切换页码重置初始页
this.currentPageAll = 1
//props.pageSize = val;
this.pageSizeAll = val;
this.handlerDetailDataMore();
},
// 切换页码
handleCurrentChangeMore(val) {
this.currentPageAll = val;
this.handlerDetailDataMore();
},
// 切换页码
prePageMore(val) {
this.currentPageAll = val;
this.handlerDetailDataMore();
},
// 切换页码
nextPageMore(val) {
this.currentPageAll = val;
this.handlerDetailDataMore();
},
//更多
handlerDetailDataNoPage(){
this.widthStyle='';
this.tableVisible=true;
let optionsData = this.optionsData;
if (this.optionsData.dataType == "dynamicData" ) {
this.loadingAll= true;
let limit = 30;
let page = parseInt(this.currentPage - 1) * limit;
//改变参数值-月季度年,重新加载动态数据--待测
this.optionsData.dynamicData.contextData.page = page;
this.optionsData.dynamicData.contextData.limit = 30;
this.optionsData.dynamicData.contextData.isMore = true;
// this.handlerData();
this.currentPageAll=1;
this.handlerDetailDataMore();
}
},
handlerDetailDataMore(){
this.loadingAll= true;
let limit = 30;
let page = parseInt(this.currentPageAll - 1) * limit;
//改变参数值-月季度年,重新加载动态数据--待测
this.optionsData.dynamicData.contextData.page = page;
this.optionsData.dynamicData.contextData.limit = 30;
this.optionsData.dynamicData.contextData.isMore = true;
},
//更多弹框关闭确定
hideDialogTable(){
this.tableVisible=false;
this.loading=false;
// this.loading=false;
this.loadingAll=false;
this.currentPageAll=1;
/* if (this.optionsData.dataType == "dynamicData" ) {
this.optionsData.dynamicData.contextData.isMore = false;
}*/
},
okFuncTable(){
this.tableVisible=false;
... ...
<template>
<div :style="styleObj" class="treeContainer">
<el-tree :style="textStyle" class="tree-div" ref="roleTree" :data="treeData" :props="defaultProps" @node-click="handleNodeClick"
node-key="id" :default-checked-keys="checkedKeys"
/>
<div class="tree-left" :style="treeLeftStyle">
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" v-if="optionsSetup.isType">
<el-tab-pane label="业务" name="first"></el-tab-pane>
<el-tab-pane label="资源" name="second"></el-tab-pane>
</el-tabs>
<el-tree :style="textStyle" class="tree-div" ref="roleTree" :data="treeData" :props="defaultProps" @node-click="handleNodeClick"
node-key="id" :default-checked-keys="checkedKeys"
/>
</div>
<div class="tree-content" v-if="optionsSetup.isFrame">
<iframe :src="iframeSrc" style="width:100%;height:100%;" frameborder="0"></iframe>
</div>
</div>
</template>
<script>
var per = 60;
export default {
name: "progressInformation",
components: {},
... ... @@ -17,6 +25,8 @@ export default {
},
data() {
return {
iframeSrc:'',
activeName:'first',
defaultProps : {
children: 'children',
label: 'label',
... ... @@ -39,9 +49,14 @@ export default {
left: this.optionsStyle.left + "px",
top: this.optionsStyle.top + "px",
background: this.optionsSetup.background,
};
},
treeLeftStyle(){
return{
'border':this.optionsSetup.isBorder?'0.5px solid '+this.optionsSetup.borderColor:'none',
'box-shadow':this.optionsSetup.isShadow?'0px 3px 12px '+this.optionsSetup.borderColor:'none'
};
}
},
//文字样式设置
textStyle(){
... ... @@ -71,19 +86,40 @@ export default {
this.optionsCollapse = this.value.collapse;
this.optionsSetup = this.value.setup;
this.editorOptions();
this.setSrc({id:1})
},
mounted() {
},
methods: {
handleClick(tab,event){
this.handleTableData();
},
handleNodeClick(data){
console.log(data);
this.setSrc(data);
this.$store.commit('CHANGE_TREE',data)
},
setSrc(data){
let origin=window.location.origin;//当前域名
let srcName=origin+'/#/bigscreen/viewer?reportCode=';
if(data.id==1){
srcName+='service_capacity_analysis';
}else{
srcName+='capacity_analysis_second';
}
this.iframeSrc=srcName;
},
editorOptions() {
this.setOptionsData();
},
//切换类型获取树结构数据
handleTableData() {
if (this.optionsData.dataType == "dynamicData" && this.optionsSetUp.isType) {
//改变参数值-类型
this.optionsData.dynamicData.contextData.type = this.activeName;
}
},
// 数据解析
setOptionsData() {
const optionsData = this.optionsData; // 数据类型 静态 or 动态
... ... @@ -126,6 +162,14 @@ export default {
<style scoped lang="scss">
.treeContainer{
padding:10px;
display: flex;
}
.tree-left{
width:20%;
padding:10px;
}
.tree-content{
flex:1;
}
.tree-div{
height:100%;
... ...