From af5847927931d3f491d7be5e0178cff3c37ac6f9 Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com>
Date: 星期四, 06 十一月 2025 17:20:44 +0800
Subject: [PATCH] 1
---
项目代码/WMS/WIDESEA_WMSClient/src/views/Home.vue | 43 ++++++++++++++++++++++++++-----------------
1 files changed, 26 insertions(+), 17 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/views/Home.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/views/Home.vue"
index 46d57fd..17c134c 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/views/Home.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/views/Home.vue"
@@ -1,12 +1,24 @@
<template>
- <div class="chart_left">
+ <div class="chart_left" style="margin-left: 20px;">
<div class="titles">
<el-icon class="icons" :size="24" color="#409EFF">
<Checked />
</el-icon>
浠诲姟杩涜涓�
</div>
- <div style="margin-top: 60px;"></div>
+ <div style="margin-top: 20px;"></div>
+ <div class="item_center">
+ <Task-List :data="chartData" :options="chartOptions" />
+ </div>
+ </div>
+ <div class="chart_left" style="margin-left: 20px;">
+ <div class="titles">
+ <el-icon class="icons" :size="24" color="#409EFF">
+ <Checked />
+ </el-icon>
+ 浠诲姟杩涜涓�
+ </div>
+ <div style="margin-top: 20px;"></div>
<div class="item_center">
<Task-List :data="chartData" :options="chartOptions" />
</div>
@@ -16,33 +28,33 @@
import TaskList from '../components/index/TaskList.vue';
import http from '../api/http.js';
import { ref, onMounted, onUnmounted, watch } from 'vue';
-
+const taskListRef = ref(null);
// 绀轰緥鏁版嵁
const chartData = ref([
- { value: 103, name: '宸插彇娑�', itemStyle: { color: '#FF6B6B' } },
- { value: 735, name: '宸插畬鎴�', itemStyle: { color: '#4ECDC4' } },
+ // { value: 103, name: '宸插彇娑�', itemStyle: { color: '#FF6B6B' } },
+ // { value: 735, name: '宸插畬鎴�', itemStyle: { color: '#4ECDC4' } },
]);
const fetchData = async () => {
try {
const response = await http.post("api/Task/GetTaskData", {});
+ chartData.value = response.data;
- console.log(response);
- chartData.value = response.data; // 鏇存柊鍝嶅簲寮忔暟鎹�
- console.log('鏁版嵁鏇存柊鎴愬姛:', chartData.value);
+ if (taskListRef.value) taskListRef.value.initChart();
} catch (error) {
console.error('API璇锋眰澶辫触:', error);
}
};
+const intervalId = ref(null)
const startPolling = () => {
fetchData(); // 鍒濆鍔犺浇
- intervalId = setInterval(fetchData, 5 * 60 * 1000); // 5鍒嗛挓
+ intervalId.value = setInterval(fetchData, 5 * 60 * 1000); // 5鍒嗛挓
};
// 娓呯悊瀹氭椂鍣�
const stopPolling = () => {
- if (intervalId) {
- clearInterval(intervalId);
+ if (intervalId.value) {
+ clearInterval(intervalId.value);
console.log('宸插仠姝㈡暟鎹疆璇�');
}
};
@@ -82,9 +94,7 @@
padding-top: 3vh;
}
-.chart_left,
-.chart_center,
-.chart_right {
+.chart_left {
position: relative;
border-radius: 10px;
background-color: white;
@@ -98,10 +108,9 @@
}
.indexModel .item_center {
- height: 68vh;
+ height: 90vh;
width: 98%;
- margin: 0vh 1%;
-
+ margin: 0vh 20%;
}
.titles {
--
Gitblit v1.9.3