Explorar el Código

增加时间回显

chenbaoxin hace 3 meses
padre
commit
e2f8ce1926
Se han modificado 2 ficheros con 20 adiciones y 2 borrados
  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")) {