调整前端

This commit is contained in:
2026-01-23 12:50:38 +08:00
parent 15b0fff86d
commit b032c621c8
4 changed files with 27 additions and 13 deletions

View File

@@ -281,15 +281,21 @@ async function fetchTableData() {
}
onMounted(() => {
// 初始化图表
nextTick(() => {
initCharts();
});
console.log('组件挂载完成');
// 从后端获取数据
fetchChartData();
fetchTableData();
// 初始化图表延迟一点时间确保DOM完全渲染
setTimeout(() => {
console.log('延迟初始化图表');
nextTick(() => {
console.log('nextTick后初始化图表');
initCharts();
});
}, 100);
// 监听窗口大小变化
window.addEventListener('resize', handleResize);
});
@@ -522,7 +528,6 @@ onUnmounted(() => {
<!-- 主体表格区域 -->
<div class="table-container">
<h3>数据表格</h3>
<div v-if="tableLoading" class="table-loading">
加载中...
</div>
@@ -563,14 +568,14 @@ onUnmounted(() => {
<div v-if="loading" class="chart-loading">
加载中...
</div>
<div v-else ref="chart1Ref" class="echart-container"></div>
<div v-else ref="chart1Ref" class="echart-container" style="width: 100%; height: 300px; border: 1px solid #ddd;"></div>
</div>
<div class="chart-container">
<div v-if="loading" class="chart-loading">
加载中...
</div>
<div v-else ref="chart2Ref" class="echart-container"></div>
<div v-else ref="chart2Ref" class="echart-container" style="width: 100%; height: 300px; border: 1px solid #ddd;"></div>
</div>
</div>
</div>
@@ -584,6 +589,7 @@ onUnmounted(() => {
min-height: 100vh;
padding: 20px;
box-sizing: border-box;
align-items: stretch;
}
.left-section {
@@ -595,7 +601,6 @@ onUnmounted(() => {
display: flex;
flex-direction: column;
gap: 20px;
height: 100%;
box-sizing: border-box;
}
@@ -772,6 +777,7 @@ onUnmounted(() => {
flex: 1;
overflow: auto;
min-height: 0;
max-height: 600px;
}
.right-section {
@@ -783,7 +789,6 @@ onUnmounted(() => {
display: flex;
flex-direction: column;
gap: 30px;
min-height: 700px;
box-sizing: border-box;
}
@@ -933,7 +938,7 @@ onUnmounted(() => {
.echart-container {
width: 100%;
height: 250px;
height: 100%;
border-radius: 4px;
overflow: hidden;
}

View File

@@ -88,7 +88,16 @@ public class ChartController {
item6.put("value", 270);
item6.put("status", "警告");
tableData.add(item6);
tableData.add(item6);
tableData.add(item6);
tableData.add(item6);
tableData.add(item6);
tableData.add(item6);
tableData.add(item6);
tableData.add(item6);
tableData.add(item6);
tableData.add(item6);
return tableData;
}
}

View File

@@ -13,7 +13,7 @@ import java.io.IOException;
import java.util.Date;
@RestController
@RequestMapping("/ocr")
@RequestMapping("api/ocr")
public class LoginCrawler {
private final LoginService loginService;

View File

@@ -9,7 +9,7 @@ import java.time.format.DateTimeFormatter;
public class BetSchedule {
// 从6:15分开始每隔5分钟投注一次6:15, 6:20, 6:25...23:25
@Scheduled(cron = "0 15/5 6-23 * * ?")
// @Scheduled(cron = "0 15/5 6-23 * * ?")
public void placeBet() {
LocalDateTime now = LocalDateTime.now();
int hour = now.getHour();