Showing
12 changed files
with
64 additions
and
18 deletions
@@ -728,6 +728,14 @@ export const monitorCustomBarLineChart = { | @@ -728,6 +728,14 @@ export const monitorCustomBarLineChart = { | ||
728 | value: 'staticData', | 728 | value: 'staticData', |
729 | }, | 729 | }, |
730 | { | 730 | { |
731 | + type: 'el-switch', | ||
732 | + label: '是否刷新', | ||
733 | + name: 'isRefresh', | ||
734 | + relactiveDom: 'dataType', | ||
735 | + relactiveDomValue: 'dynamicData', | ||
736 | + value: false | ||
737 | + }, | ||
738 | + { | ||
731 | type: 'el-input-number', | 739 | type: 'el-input-number', |
732 | label: '刷新时间(毫秒)', | 740 | label: '刷新时间(毫秒)', |
733 | name: 'refreshTime', | 741 | name: 'refreshTime', |
@@ -646,6 +646,14 @@ export const monitorCustomLineTrend = { | @@ -646,6 +646,14 @@ export const monitorCustomLineTrend = { | ||
646 | value: 'staticData', | 646 | value: 'staticData', |
647 | }, | 647 | }, |
648 | { | 648 | { |
649 | + type: 'el-switch', | ||
650 | + label: '是否刷新', | ||
651 | + name: 'isRefresh', | ||
652 | + relactiveDom: 'dataType', | ||
653 | + relactiveDomValue: 'dynamicData', | ||
654 | + value: false | ||
655 | + }, | ||
656 | + { | ||
649 | type: 'el-input-number', | 657 | type: 'el-input-number', |
650 | label: '刷新时间(毫秒)', | 658 | label: '刷新时间(毫秒)', |
651 | name: 'refreshTime', | 659 | name: 'refreshTime', |
@@ -332,6 +332,14 @@ export const monitorCustomLiquidFillChart = { | @@ -332,6 +332,14 @@ export const monitorCustomLiquidFillChart = { | ||
332 | value: 'staticData', | 332 | value: 'staticData', |
333 | }, | 333 | }, |
334 | { | 334 | { |
335 | + type: 'el-switch', | ||
336 | + label: '是否刷新', | ||
337 | + name: 'isRefresh', | ||
338 | + relactiveDom: 'dataType', | ||
339 | + relactiveDomValue: 'dynamicData', | ||
340 | + value: false | ||
341 | + }, | ||
342 | + { | ||
335 | type: 'el-input-number', | 343 | type: 'el-input-number', |
336 | label: '刷新时间(毫秒)', | 344 | label: '刷新时间(毫秒)', |
337 | name: 'refreshTime', | 345 | name: 'refreshTime', |
@@ -206,6 +206,14 @@ export const monitorSystemInformation = { | @@ -206,6 +206,14 @@ export const monitorSystemInformation = { | ||
206 | value: 'staticData', | 206 | value: 'staticData', |
207 | }, | 207 | }, |
208 | { | 208 | { |
209 | + type: 'el-switch', | ||
210 | + label: '是否刷新', | ||
211 | + name: 'isRefresh', | ||
212 | + relactiveDom: 'dataType', | ||
213 | + relactiveDomValue: 'dynamicData', | ||
214 | + value: false | ||
215 | + }, | ||
216 | + { | ||
209 | type: 'el-input-number', | 217 | type: 'el-input-number', |
210 | label: '刷新时间(毫秒)', | 218 | label: '刷新时间(毫秒)', |
211 | name: 'refreshTime', | 219 | name: 'refreshTime', |
@@ -291,6 +291,14 @@ export const monitorTablePage = { | @@ -291,6 +291,14 @@ export const monitorTablePage = { | ||
291 | value: 'staticData', | 291 | value: 'staticData', |
292 | }, | 292 | }, |
293 | { | 293 | { |
294 | + type: 'el-switch', | ||
295 | + label: '是否刷新', | ||
296 | + name: 'isRefresh', | ||
297 | + relactiveDom: 'dataType', | ||
298 | + relactiveDomValue: 'dynamicData', | ||
299 | + value: false | ||
300 | + }, | ||
301 | + { | ||
294 | type: 'el-input-number', | 302 | type: 'el-input-number', |
295 | label: '刷新时间(毫秒)', | 303 | label: '刷新时间(毫秒)', |
296 | name: 'refreshTime', | 304 | name: 'refreshTime', |
@@ -482,7 +482,7 @@ export default { | @@ -482,7 +482,7 @@ export default { | ||
482 | const optionsData = this.optionsData; // 数据类型 静态 or 动态 | 482 | const optionsData = this.optionsData; // 数据类型 静态 or 动态 |
483 | optionsData.dataType == "staticData" | 483 | optionsData.dataType == "staticData" |
484 | ? this.staticDataFn(optionsData.staticData) | 484 | ? this.staticDataFn(optionsData.staticData) |
485 | - : this.dynamicDataFn(optionsData.dynamicData, optionsData.refreshTime); | 485 | + : this.dynamicDataFn(optionsData.dynamicData, optionsData.refreshTime,optionsData.isRefresh); |
486 | }, | 486 | }, |
487 | staticDataFn(val) { | 487 | staticDataFn(val) { |
488 | const series = this.options.series; | 488 | const series = this.options.series; |
@@ -505,9 +505,9 @@ export default { | @@ -505,9 +505,9 @@ export default { | ||
505 | } | 505 | } |
506 | } | 506 | } |
507 | }, | 507 | }, |
508 | - dynamicDataFn(val, refreshTime) { | 508 | + dynamicDataFn(val, refreshTime,isRefresh) { |
509 | if (!val) return; | 509 | if (!val) return; |
510 | - if (this.ispreview) { | 510 | + if (this.ispreview && isRefresh) { |
511 | this.getEchartData(val); | 511 | this.getEchartData(val); |
512 | this.flagInter = setInterval(() => { | 512 | this.flagInter = setInterval(() => { |
513 | this.getEchartData(val); | 513 | this.getEchartData(val); |
@@ -348,7 +348,8 @@ export default { | @@ -348,7 +348,8 @@ export default { | ||
348 | : this.dynamicDataFn( | 348 | : this.dynamicDataFn( |
349 | optionsData.dynamicData, | 349 | optionsData.dynamicData, |
350 | optionsData.refreshTime, | 350 | optionsData.refreshTime, |
351 | - optionsSetup | 351 | + optionsSetup, |
352 | + optionsData.isRefresh | ||
352 | ); | 353 | ); |
353 | }, | 354 | }, |
354 | //去重 | 355 | //去重 |
@@ -468,9 +469,9 @@ export default { | @@ -468,9 +469,9 @@ export default { | ||
468 | 469 | ||
469 | }, | 470 | }, |
470 | // 动态数据 | 471 | // 动态数据 |
471 | - dynamicDataFn(val, refreshTime, optionsSetup) { | 472 | + dynamicDataFn(val, refreshTime, optionsSetup,isRefresh) { |
472 | if (!val) return; | 473 | if (!val) return; |
473 | - if (this.ispreview) { | 474 | + if (this.ispreview && isRefresh) { |
474 | this.getEchartData(val, optionsSetup); | 475 | this.getEchartData(val, optionsSetup); |
475 | this.flagInter = setInterval(() => { | 476 | this.flagInter = setInterval(() => { |
476 | this.getEchartData(val, optionsSetup); | 477 | this.getEchartData(val, optionsSetup); |
@@ -250,7 +250,8 @@ export default { | @@ -250,7 +250,8 @@ export default { | ||
250 | ? this.staticDataFn(optionsData.staticData) | 250 | ? this.staticDataFn(optionsData.staticData) |
251 | : this.dynamicDataFn( | 251 | : this.dynamicDataFn( |
252 | optionsData.dynamicData, | 252 | optionsData.dynamicData, |
253 | - optionsData.refreshTime | 253 | + optionsData.refreshTime, |
254 | + optionsData.isRefresh | ||
254 | ); | 255 | ); |
255 | }, | 256 | }, |
256 | staticDataFn(val) { | 257 | staticDataFn(val) { |
@@ -269,9 +270,9 @@ export default { | @@ -269,9 +270,9 @@ export default { | ||
269 | 'top':num+'%' | 270 | 'top':num+'%' |
270 | }; | 271 | }; |
271 | }, | 272 | }, |
272 | - dynamicDataFn(val, refreshTime) { | 273 | + dynamicDataFn(val, refreshTime,isRefresh) { |
273 | if (!val) return; | 274 | if (!val) return; |
274 | - if (this.ispreview) { | 275 | + if (this.ispreview && isRefresh) { |
275 | this.getEchartData(val); | 276 | this.getEchartData(val); |
276 | this.flagInter = setInterval(() => { | 277 | this.flagInter = setInterval(() => { |
277 | this.getEchartData(val); | 278 | this.getEchartData(val); |
@@ -282,24 +282,26 @@ export default { | @@ -282,24 +282,26 @@ export default { | ||
282 | let arrstorage=[]; | 282 | let arrstorage=[]; |
283 | let optionArr=[] | 283 | let optionArr=[] |
284 | dataArr.map(item=>{ | 284 | dataArr.map(item=>{ |
285 | - if(item.cpuSetRate){ | 285 | + if(item.cpuSetRate || item.cpuSetRate==0){ |
286 | arrCpu=[{ | 286 | arrCpu=[{ |
287 | num:item.cpuSetRate, | 287 | num:item.cpuSetRate, |
288 | name:'cpu容量' | 288 | name:'cpu容量' |
289 | }] | 289 | }] |
290 | } | 290 | } |
291 | - if(item.storageSetRate){ | 291 | + if(item.storageSetRate || item.storageSetRate==0){ |
292 | arrmemory=[{ | 292 | arrmemory=[{ |
293 | num:item.storageSetRate, | 293 | num:item.storageSetRate, |
294 | name:'存储容量' | 294 | name:'存储容量' |
295 | }] | 295 | }] |
296 | } | 296 | } |
297 | - if(item.memorySetRate){ | 297 | + if(item.memorySetRate || item.memorySetRate==0){ |
298 | arrstorage=[{ | 298 | arrstorage=[{ |
299 | num:item.memorySetRate, | 299 | num:item.memorySetRate, |
300 | name:'内存容量' | 300 | name:'内存容量' |
301 | }] | 301 | }] |
302 | } | 302 | } |
303 | + console.log("####",arrCpu,arrmemory,arrstorage) | ||
304 | + | ||
303 | if(arrCpu.length>0 && arrmemory.length>0 && arrstorage.length>0){ | 305 | if(arrCpu.length>0 && arrmemory.length>0 && arrstorage.length>0){ |
304 | item.percentData=arrCpu.concat(arrmemory).concat(arrstorage); | 306 | item.percentData=arrCpu.concat(arrmemory).concat(arrstorage); |
305 | 307 |
@@ -70,6 +70,7 @@ export default { | @@ -70,6 +70,7 @@ export default { | ||
70 | return{ | 70 | return{ |
71 | width:this.optionsSetup.flexFlow=='column'?'100%':'auto', | 71 | width:this.optionsSetup.flexFlow=='column'?'100%':'auto', |
72 | height:this.optionsSetup.itemHeight+'px', | 72 | height:this.optionsSetup.itemHeight+'px', |
73 | + flex:this.optionsSetup.flexFlow!='column'?'1':'', | ||
73 | // 'border':this.optionsSetup.isBorder?'0.5px solid '+this.optionsSetup.borderColor:'none', | 74 | // 'border':this.optionsSetup.isBorder?'0.5px solid '+this.optionsSetup.borderColor:'none', |
74 | // 'box-shadow':this.optionsSetup.isShadow?'0px 3px 12px '+this.optionsSetup.borderColor:'none', | 75 | // 'box-shadow':this.optionsSetup.isShadow?'0px 3px 12px '+this.optionsSetup.borderColor:'none', |
75 | 'background':this.optionsSetup.itemBackground | 76 | 'background':this.optionsSetup.itemBackground |
@@ -166,7 +166,8 @@ export default { | @@ -166,7 +166,8 @@ export default { | ||
166 | ? this.staticDataFn(optionsData.staticData) | 166 | ? this.staticDataFn(optionsData.staticData) |
167 | : this.dynamicDataFn( | 167 | : this.dynamicDataFn( |
168 | optionsData.dynamicData, | 168 | optionsData.dynamicData, |
169 | - optionsData.refreshTime | 169 | + optionsData.refreshTime, |
170 | + optionsData.isRefresh | ||
170 | ); | 171 | ); |
171 | }, | 172 | }, |
172 | staticDataFn(val) { | 173 | staticDataFn(val) { |
@@ -175,9 +176,9 @@ export default { | @@ -175,9 +176,9 @@ export default { | ||
175 | } | 176 | } |
176 | 177 | ||
177 | }, | 178 | }, |
178 | - dynamicDataFn(val, refreshTime) { | 179 | + dynamicDataFn(val, refreshTime,isRefresh) { |
179 | if (!val) return; | 180 | if (!val) return; |
180 | - if (this.ispreview) { | 181 | + if (this.ispreview && isRefresh) { |
181 | this.getEchartData(val); | 182 | this.getEchartData(val); |
182 | this.flagInter = setInterval(() => { | 183 | this.flagInter = setInterval(() => { |
183 | this.getEchartData(val); | 184 | this.getEchartData(val); |
@@ -298,7 +298,7 @@ export default { | @@ -298,7 +298,7 @@ export default { | ||
298 | const tableData = this.optionsData; | 298 | const tableData = this.optionsData; |
299 | tableData.dataType == "staticData" | 299 | tableData.dataType == "staticData" |
300 | ? this.handlerStaticData(tableData.staticData) | 300 | ? this.handlerStaticData(tableData.staticData) |
301 | - : this.handlerDynamicData(tableData.dynamicData, tableData.refreshTime); | 301 | + : this.handlerDynamicData(tableData.dynamicData, tableData.refreshTime,tableData.isRefresh); |
302 | }, | 302 | }, |
303 | handlerStaticData(data) { | 303 | handlerStaticData(data) { |
304 | this.list = data; | 304 | this.list = data; |
@@ -306,9 +306,9 @@ export default { | @@ -306,9 +306,9 @@ export default { | ||
306 | this.loading = false; | 306 | this.loading = false; |
307 | this.loadingAll = false; | 307 | this.loadingAll = false; |
308 | }, | 308 | }, |
309 | - handlerDynamicData(data, refreshTime) { | 309 | + handlerDynamicData(data, refreshTime,isRefresh) { |
310 | if (!data) return; | 310 | if (!data) return; |
311 | - if (this.ispreview) { | 311 | + if (this.ispreview && isRefresh) { |
312 | this.getEchartData(data); | 312 | this.getEchartData(data); |
313 | this.flagInter = setInterval(() => { | 313 | this.flagInter = setInterval(() => { |
314 | this.getEchartData(data); | 314 | this.getEchartData(data); |
-
Please register or login to post a comment