From e18c07455c61c4fdd5efeb213b2582ce68db9c02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B4=AA=E6=B4=AA?= <2498601771@qq.com> Date: Thu, 27 Apr 2023 15:30:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B7=BB=E5=8A=A0entity=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E9=A1=B5=E6=8A=98=E7=BA=BF=E5=9B=BE=E7=9A=84=E6=A8=A1?= =?UTF-8?q?=E6=8B=9F=E6=95=B0=E6=8D=AE=E5=AF=B9=E6=97=B6=E9=97=B4=E8=8C=83?= =?UTF-8?q?=E5=9B=B4=E7=9A=84=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mock/entity.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mock/entity.js b/src/mock/entity.js index ea79d623..66e9818e 100644 --- a/src/mock/entity.js +++ b/src/mock/entity.js @@ -6,10 +6,13 @@ if (openMock) { const titleList = ['totalBitsRate', 'inboundBitsRate', 'outboundBitsRate', 'internalBitsRate', 'throughBitsRate', 'other'] const arr = [{ type: 'Bits/s' }, { type: 'Packets/s' }, { type: 'Sessions/s' }] + const endTime = JSON.parse(getQuery(requestObj.url).endTime) + let step = 0 for (let i = 0; i < arr.length; i++) { for (const j in titleList) { - // 目前模拟数据仅支持1小时的时间选择范围 let startTime = JSON.parse(getQuery(requestObj.url).startTime) + step = (endTime - startTime) / 100 // 每条数据的时间间隔 + const values = [] let max = 2975 let min = 0 @@ -20,7 +23,7 @@ if (openMock) { for (let i = 0; i < 101; i++) { const random = Math.floor(Math.random() * (max - min) + min) values.push([startTime, random]) - startTime += 36 + startTime += step } const newValues = JSON.parse(JSON.stringify(values))