<template>
  <div class="app-container home">
    <el-row :gutter="20">
      <el-col :sm="24" :lg="12" style="padding-left: 20px">
        <h2>水利工程运行管理系统</h2>
        <p>
          本系统实现对水库、堤防、水闸、泵站等水利工程的全面信息化管理，涵盖工程资料管理、运行监测、水功能区监管、工程进度跟踪等核心业务功能。系统提供GIS地图展示、实时监测预警、文档归档管理等综合服务，为水利工程安全运行和科学管理提供技术支撑。
        </p>
        <p>
          <b>当前版本:</b> <span>v{{ version }}</span>
        </p>
        <p>
          <el-tag type="success">水利工程 · 智慧管理</el-tag>
        </p>
        <p>
          <el-button type="primary" icon="DataAnalysis" plain @click="goTarget('/slgc/proj/gc')">进入工程资料</el-button>
          <el-button icon="Monitor" plain @click="goTarget('/slgc/monitor')">查看监测数据</el-button>
        </p>
      </el-col>

      <el-col :sm="24" :lg="12" style="padding-left: 50px">
        <el-row>
          <el-col :span="24">
            <h2>系统概览</h2>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <h4>核心功能</h4>
            <ul>
              <li>工程资料管理</li>
              <li>实时运行监测</li>
              <li>GIS地图展示</li>
              <li>预警信息管理</li>
              <li>文档法规归档</li>
              <li>工程进度监管</li>
            </ul>
          </el-col>
          <el-col :span="12">
            <h4>工程类型</h4>
            <ul>
              <li>水库工程</li>
              <li>堤防工程</li>
              <li>水闸工程</li>
              <li>泵站工程</li>
              <li>水功能区</li>
              <li>用水单位</li>
            </ul>
          </el-col>
        </el-row>
      </el-col>
    </el-row>
    <el-divider />
    <el-row :gutter="20">
      <el-col :xs="24" :sm="24" :md="12" :lg="8">
        <el-card class="update-log">
          <template v-slot:header>
            <div class="clearfix">
              <span>运行概览</span>
            </div>
          </template>
          <div class="body">
            <p><el-icon><DataAnalysis /></el-icon> 水库：128座</p>
            <p><el-icon><TrendCharts /></el-icon> 堤防：356条，总长856.5km</p>
            <p><el-icon><Switch /></el-icon> 水闸：89座</p>
            <p><el-icon><Setting /></el-icon> 泵站：45座</p>
            <p><el-icon><Warning /></el-icon> 预警信息：3条待处置</p>
            <p><el-icon><Monitor /></el-icon> 监测站点：618个</p>
          </div>
        </el-card>
      </el-col>
      <el-col :xs="24" :sm="24" :md="12" :lg="8">
        <el-card class="update-log">
          <template v-slot:header>
            <div class="clearfix">
              <span>快速入口</span>
            </div>
          </template>
          <el-row :gutter="8">
            <el-col :span="8" v-for="item in quickLinks" :key="item.name">
              <el-button text style="width:100%;margin-bottom:8px" @click="goTarget(item.path)">
                <el-icon><component :is="item.icon" /></el-icon>{{ item.name }}
              </el-button>
            </el-col>
          </el-row>
        </el-card>
      </el-col>
      <el-col :xs="24" :sm="24" :md="12" :lg="8">
        <el-card class="update-log">
          <template v-slot:header>
            <div class="clearfix">
              <span>系统信息</span>
            </div>
          </template>
          <div class="body">
            <p>系统名称：水利工程运行管理系统</p>
            <p>当前版本：v{{ version }}</p>
            <p>数据库：达梦 DM8</p>
            <p>运行环境：Java 17 + Spring Boot 4.0</p>
            <p>前端框架：Vue 3 + Element Plus</p>
          </div>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script setup name="Index">
import { DataAnalysis, TrendCharts, Switch, Setting, Warning, Monitor } from '@element-plus/icons-vue'
const version = ref('3.9.2')
const router = useRouter()
const quickLinks = [
  { name: '工程资料', path: '/slgc/proj/gc', icon: DataAnalysis },
  { name: '堤防管理', path: '/slgc/proj/dike', icon: TrendCharts },
  { name: '水库管理', path: '/slgc/proj/reservoir', icon: DataAnalysis },
  { name: '水闸管理', path: '/slgc/proj/pust', icon: Switch },
  { name: '泵站管理', path: '/slgc/proj/waga', icon: Setting },
  { name: '监测管理', path: '/slgc/monitor', icon: Monitor },
]

function goTarget(url) {
  if (url.startsWith('/')) {
    router.push(url)
  } else {
    window.open(url, '__blank')
  }
}
</script>

<style scoped lang="scss">
.home {
  blockquote { padding: 10px 20px; margin: 0 0 20px; font-size: 17.5px; border-left: 5px solid #eee; }
  hr { margin-top: 20px; margin-bottom: 20px; border: 0; border-top: 1px solid #eee; }
  .col-item { margin-bottom: 20px; }
  ul { padding: 0; margin: 0; }
  font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 13px; color: #676a6c; overflow-x: hidden;
  ul { list-style-type: none; }
  h4 { margin-top: 0px; }
  h2 { margin-top: 10px; font-size: 26px; font-weight: 100; }
  p { margin-top: 10px; b { font-weight: 700; } }
  .update-log { ol { display: block; list-style-type: decimal; margin-block-start: 1em; margin-block-end: 1em; margin-inline-start: 0; margin-inline-end: 0; padding-inline-start: 40px; } }
}
</style>
