Browse Source

增加时间回显

chenbaoxin 3 months ago
parent
commit
e2f8ce1926
2 changed files with 20 additions and 2 deletions
  1. 7 0
      src/api/index.ts
  2. 13 2
      src/views/HealthStatusAnalysis/mock.vue

+ 7 - 0
src/api/index.ts

@@ -180,6 +180,13 @@ export function readDict(data:any) {
 export function healthStatusTip(params:any) {
   return get('/healthStatusAnalysis/healthStatusTip',{...params});
 }
+/**
+ * @name 获取回显
+ * @returns 
+ */
+export function queryDataRangeSpeed(params:any) {
+  return get('/healthStatusAnalysis/queryDataRangeSpeed',{...params});
+}
 /**
  * @name 警告信息与维修建议设置
  * @param data 包含

+ 13 - 2
src/views/HealthStatusAnalysis/mock.vue

@@ -564,7 +564,8 @@ import {
   devicesAndCategories,
   updateDataRangeSpeed,
   mockCacheData,
-  setConditionTime
+  setConditionTime,
+  queryDataRangeSpeed
 } from "@/api/index";
 const wsMockUrl = import.meta.env.VITE_WS_MOCK_URL as string;
 const wsMockClient = new WebSocketClient(wsMockUrl);
@@ -589,9 +590,19 @@ const getHStatus = async () => {
   gridData.value = result.data;
 };
 let lineParamsAllRef = ref([]);
-
+const getQueryDataRangeSpeed = async () => {
+  let result = await queryDataRangeSpeed({});
+   let valueObj = result.data;
+   queryParamsMock.value={
+    sDate:valueObj.start_time,
+    eDate:valueObj.end_time,
+    count:Number(valueObj.batch_size),
+    time:Number(valueObj.interval)
+   }
+};
 onMounted(async () => {
   getcateData();
+  getQueryDataRangeSpeed()
   await getPointData(btnBigIndex.value, "温度");
   getHStatus();
   if (!!sessionStorage.getItem("runStatus")) {