소스 검색

修改首页

chenbaoxin 4 달 전
부모
커밋
5647c90ee9
4개의 변경된 파일21개의 추가작업 그리고 11개의 파일을 삭제
  1. 2 2
      src/api/index.ts
  2. 5 4
      src/components/CalendarHeatmap/index.vue
  3. 12 3
      src/views/HealthStatusAnalysis/index.vue
  4. 2 2
      src/views/WarningSettings/index.vue

+ 2 - 2
src/api/index.ts

@@ -182,7 +182,7 @@ export function healthySetList(data:any) {
  * @returns 
  */
 export function warnSetUpdate(params:any) {
-  return put('/settings/updatExceptionWarningRepairStrategy',params);
+  return put('/settings/updateExceptionWarningRepairStrategy',params);
 }
 /**
  * @name  健康指标设置修改数据
@@ -190,7 +190,7 @@ export function warnSetUpdate(params:any) {
  * @returns 
  */
 export function healthySetUpdate(params:any) {
-  return put('/settings/updateHealthMetric',params);
+  return put('/settings/updateHealthMetrics',params);
 }
 
 // // 使用 http 方法获取特定的 HTTP 方法并调用

+ 5 - 4
src/components/CalendarHeatmap/index.vue

@@ -35,9 +35,9 @@ const hours = ref(['12a','1a','2a','3a','4a','5a','6a','7a','8a','9a','10a','11a
 const days = ["周日","周六", "周五", "周四", "周三", "周二", "周一"];
 
 const typeColorMap: { [key: string]: string } = {
-  d: "#FC3F3F", // 红色
-  w: "#FCAE3F", // 橙色
-  p: "#0982FE", // 蓝色
+  2: "#FC3F3F", // 红色
+  1: "#FCAE3F", // 橙色
+  0: "#0982FE", // 蓝色
   // 添加更多类型和颜色
 };
 
@@ -54,11 +54,12 @@ const initChart = () => {
             obj.value.map(val => `${obj.name}:${val.min} - ${val.max}`).join('<br/>')
           ).join('<br/>');
           return `
-            <div>
+            <div style="max-height: 100px; overflow-y: auto; padding-right: 10px;">
               ${valueDetails}
             </div>
           `;
         },
+       
       },
       grid: {
         // height: '50%',

+ 12 - 3
src/views/HealthStatusAnalysis/index.vue

@@ -491,9 +491,14 @@ const setLineparames = (
   selectData: Array<AnyObject>
 ) => {
   // 横坐标时间点
-  xAxisParamsData.value = dataAll.map((its) => moment(its.data._ts).format('HH:mm:ss') );
+  xAxisParamsData.value = dataAll.map((its) => moment(its.data._ts).format('HH:mm:ss') ).slice(-30);
   // 折线图数据
-  seriesParamsData.value = selectData;
+  seriesParamsData.value = selectData.map((its) => {
+  return {
+      ...its,
+    data:its.data.slice(-30)
+  }
+  });
   // 图例
   legendPramsData.value = selectData.map((its) => its.name);
 };
@@ -639,6 +644,10 @@ const runstatusMessage = (data: { label: string; state: 0 | 1 | 2 }) => {
 };
 const workMessage = (data: Object) => {
   // 获取工况数据 一小时来一次
+  data.forEach(element => {
+    element.type=Math.floor(Math.random() * 3)
+
+  });
   let currentValue=workParamsAllRef.value
   workParamsAllRef.value = currentValue.concat(data);
   workChange()
@@ -777,7 +786,7 @@ const healthyMessage = (data: Object) => {
 
   // 获取健康数据
   // let obj=determineHealthStatus(data.avg_num)
-  let obj=`${data.sha}(${data.avg_num*100}%)`
+  let obj=`${data.sha}(${data.avg_num}%)`
   healthyStatusText.value=obj
   xAxisData.value.push(moment(data.date).format('HH:mm:ss'));
   seriesData.value[0].data.push(data.avg_num)

+ 2 - 2
src/views/WarningSettings/index.vue

@@ -230,7 +230,7 @@ import { downloadFile } from "@/utils/utils";
 // 基础路由
 const router = useRouter();
 const route = useRoute(); // 获取当前路由对象
-import { fileList, warnSetUpdate } from "@/api/index";
+import { warnSetList, warnSetUpdate } from "@/api/index";
 const { proxy } = getCurrentInstance()!;
 // pages
 import {
@@ -249,7 +249,7 @@ const fetchDataFunction = async (
   pageSize: number
 ): Promise<PaginationResponse<DataItem>> => {
   proxy.$loading.start();
-  const response = await fileList({
+  const response = await warnSetList({
     current: page,
     size: 9,
     // ...queryParams.value,