<template>
  <div class="monitor-center">
    <div class="page-header">
      <h1>监控中心</h1>
      <p>实时监控系统运行状态和业务数据</p>
    </div>
    
    <div class="monitor-content">
      <!-- 实时监控面板 -->
      <div class="monitor-panel">
        <RealTimeMonitor />
      </div>
      
      <!-- 数据统计图表 -->
      <div class="charts-section">
        <a-row :gutter="24">
          <a-col :span="12">
            <div class="chart-card">
              <CattleChart />
            </div>
          </a-col>
          <a-col :span="12">
            <div class="chart-card">
              <TradingChart />
            </div>
          </a-col>
        </a-row>
        
        <a-row :gutter="24" style="margin-top: 24px;">
          <a-col :span="24">
            <div class="chart-card">
              <EnvironmentChart />
            </div>
          </a-col>
        </a-row>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref, onMounted } from 'vue';
import RealTimeMonitor from '@/components/RealTimeMonitor.vue';
import CattleChart from '@/components/charts/CattleChart.vue';
import TradingChart from '@/components/charts/TradingChart.vue';
import EnvironmentChart from '@/components/charts/EnvironmentChart.vue';

const loading = ref(false);

onMounted(() => {
  // 页面初始化逻辑
  console.log('监控中心页面已加载');
});
</script>

<style scoped>
.monitor-center {
  padding: 24px;
  background: #f0f2f5;
  min-height: 100vh;
}

.page-header {
  margin-bottom: 24px;
  padding: 24px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.page-header h1 {
  margin: 0 0 8px 0;
  font-size: 24px;
  font-weight: 600;
  color: #262626;
}

.page-header p {
  margin: 0;
  color: #8c8c8c;
  font-size: 14px;
}

.monitor-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.monitor-panel {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.charts-section {
  background: white;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chart-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

:deep(.ant-card) {
  border: none;
  box-shadow: none;
}

:deep(.ant-card-head) {
  border-bottom: 1px solid #f0f0f0;
  background: #fafafa;
}

:deep(.ant-card-body) {
  padding: 20px;
}

@media (max-width: 1200px) {
  .monitor-center {
    padding: 16px;
  }
  
  .charts-section .ant-col {
    margin-bottom: 16px;
  }
}
</style>