Authored by 鲁尚清

是否刷新功能

... ... @@ -728,6 +728,14 @@ export const monitorCustomBarLineChart = {
value: 'staticData',
},
{
type: 'el-switch',
label: '是否刷新',
name: 'isRefresh',
relactiveDom: 'dataType',
relactiveDomValue: 'dynamicData',
value: false
},
{
type: 'el-input-number',
label: '刷新时间(毫秒)',
name: 'refreshTime',
... ...
... ... @@ -646,6 +646,14 @@ export const monitorCustomLineTrend = {
value: 'staticData',
},
{
type: 'el-switch',
label: '是否刷新',
name: 'isRefresh',
relactiveDom: 'dataType',
relactiveDomValue: 'dynamicData',
value: false
},
{
type: 'el-input-number',
label: '刷新时间(毫秒)',
name: 'refreshTime',
... ...
... ... @@ -332,6 +332,14 @@ export const monitorCustomLiquidFillChart = {
value: 'staticData',
},
{
type: 'el-switch',
label: '是否刷新',
name: 'isRefresh',
relactiveDom: 'dataType',
relactiveDomValue: 'dynamicData',
value: false
},
{
type: 'el-input-number',
label: '刷新时间(毫秒)',
name: 'refreshTime',
... ...
... ... @@ -206,6 +206,14 @@ export const monitorSystemInformation = {
value: 'staticData',
},
{
type: 'el-switch',
label: '是否刷新',
name: 'isRefresh',
relactiveDom: 'dataType',
relactiveDomValue: 'dynamicData',
value: false
},
{
type: 'el-input-number',
label: '刷新时间(毫秒)',
name: 'refreshTime',
... ...
... ... @@ -291,6 +291,14 @@ export const monitorTablePage = {
value: 'staticData',
},
{
type: 'el-switch',
label: '是否刷新',
name: 'isRefresh',
relactiveDom: 'dataType',
relactiveDomValue: 'dynamicData',
value: false
},
{
type: 'el-input-number',
label: '刷新时间(毫秒)',
name: 'refreshTime',
... ...
... ... @@ -482,7 +482,7 @@ export default {
const optionsData = this.optionsData; // 数据类型 静态 or 动态
optionsData.dataType == "staticData"
? this.staticDataFn(optionsData.staticData)
: this.dynamicDataFn(optionsData.dynamicData, optionsData.refreshTime);
: this.dynamicDataFn(optionsData.dynamicData, optionsData.refreshTime,optionsData.isRefresh);
},
staticDataFn(val) {
const series = this.options.series;
... ... @@ -505,9 +505,9 @@ export default {
}
}
},
dynamicDataFn(val, refreshTime) {
dynamicDataFn(val, refreshTime,isRefresh) {
if (!val) return;
if (this.ispreview) {
if (this.ispreview && isRefresh) {
this.getEchartData(val);
this.flagInter = setInterval(() => {
this.getEchartData(val);
... ...
... ... @@ -348,7 +348,8 @@ export default {
: this.dynamicDataFn(
optionsData.dynamicData,
optionsData.refreshTime,
optionsSetup
optionsSetup,
optionsData.isRefresh
);
},
//去重
... ... @@ -468,9 +469,9 @@ export default {
},
// 动态数据
dynamicDataFn(val, refreshTime, optionsSetup) {
dynamicDataFn(val, refreshTime, optionsSetup,isRefresh) {
if (!val) return;
if (this.ispreview) {
if (this.ispreview && isRefresh) {
this.getEchartData(val, optionsSetup);
this.flagInter = setInterval(() => {
this.getEchartData(val, optionsSetup);
... ...
... ... @@ -250,7 +250,8 @@ export default {
? this.staticDataFn(optionsData.staticData)
: this.dynamicDataFn(
optionsData.dynamicData,
optionsData.refreshTime
optionsData.refreshTime,
optionsData.isRefresh
);
},
staticDataFn(val) {
... ... @@ -269,9 +270,9 @@ export default {
'top':num+'%'
};
},
dynamicDataFn(val, refreshTime) {
dynamicDataFn(val, refreshTime,isRefresh) {
if (!val) return;
if (this.ispreview) {
if (this.ispreview && isRefresh) {
this.getEchartData(val);
this.flagInter = setInterval(() => {
this.getEchartData(val);
... ...
... ... @@ -282,24 +282,26 @@ export default {
let arrstorage=[];
let optionArr=[]
dataArr.map(item=>{
if(item.cpuSetRate){
if(item.cpuSetRate || item.cpuSetRate==0){
arrCpu=[{
num:item.cpuSetRate,
name:'cpu容量'
}]
}
if(item.storageSetRate){
if(item.storageSetRate || item.storageSetRate==0){
arrmemory=[{
num:item.storageSetRate,
name:'存储容量'
}]
}
if(item.memorySetRate){
if(item.memorySetRate || item.memorySetRate==0){
arrstorage=[{
num:item.memorySetRate,
name:'内存容量'
}]
}
console.log("####",arrCpu,arrmemory,arrstorage)
if(arrCpu.length>0 && arrmemory.length>0 && arrstorage.length>0){
item.percentData=arrCpu.concat(arrmemory).concat(arrstorage);
... ...
... ... @@ -70,6 +70,7 @@ export default {
return{
width:this.optionsSetup.flexFlow=='column'?'100%':'auto',
height:this.optionsSetup.itemHeight+'px',
flex:this.optionsSetup.flexFlow!='column'?'1':'',
// 'border':this.optionsSetup.isBorder?'0.5px solid '+this.optionsSetup.borderColor:'none',
// 'box-shadow':this.optionsSetup.isShadow?'0px 3px 12px '+this.optionsSetup.borderColor:'none',
'background':this.optionsSetup.itemBackground
... ...
... ... @@ -166,7 +166,8 @@ export default {
? this.staticDataFn(optionsData.staticData)
: this.dynamicDataFn(
optionsData.dynamicData,
optionsData.refreshTime
optionsData.refreshTime,
optionsData.isRefresh
);
},
staticDataFn(val) {
... ... @@ -175,9 +176,9 @@ export default {
}
},
dynamicDataFn(val, refreshTime) {
dynamicDataFn(val, refreshTime,isRefresh) {
if (!val) return;
if (this.ispreview) {
if (this.ispreview && isRefresh) {
this.getEchartData(val);
this.flagInter = setInterval(() => {
this.getEchartData(val);
... ...
... ... @@ -298,7 +298,7 @@ export default {
const tableData = this.optionsData;
tableData.dataType == "staticData"
? this.handlerStaticData(tableData.staticData)
: this.handlerDynamicData(tableData.dynamicData, tableData.refreshTime);
: this.handlerDynamicData(tableData.dynamicData, tableData.refreshTime,tableData.isRefresh);
},
handlerStaticData(data) {
this.list = data;
... ... @@ -306,9 +306,9 @@ export default {
this.loading = false;
this.loadingAll = false;
},
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);
... ...