<template>
  <div class="quick-entry-container">
    <div class="section-title">
      <i class="el-icon-s-grid title-icon"></i>
      <span>快捷方式</span>
    </div>
    <el-row :gutter="12">
      <el-col :span="6">
        <div class="entry-card" @click="handleImportHistory">
          <div class="card-icon import-icon">
            <i class="el-icon-folder-opened"></i>
          </div>
          <div class="card-content">
            <div class="card-title">导入历史项目</div>
            <div class="card-desc">从历史项目中导入配置</div>
          </div>
        </div>
      </el-col>
      <el-col :span="6">
        <div class="entry-card" @click="handleCreateQuarterly">
          <div class="card-icon quarterly-icon">
            <i class="el-icon-date"></i>
          </div>
          <div class="card-content">
            <div class="card-title">创建季度初核</div>
            <div class="card-desc">预填本季度项目模板</div>
          </div>
        </div>
      </el-col>
      <el-col :span="6">
        <div class="entry-card" @click="handleCreateEmployee">
          <div class="card-icon employee-icon">
            <i class="el-icon-user"></i>
          </div>
          <div class="card-content">
            <div class="card-title">创建新员工排查</div>
            <div class="card-desc">预填本月排查模板</div>
          </div>
        </div>
      </el-col>
      <el-col :span="6">
        <div class="entry-card" @click="handleCreateHighRisk">
          <div class="card-icon highrisk-icon">
            <i class="el-icon-warning"></i>
          </div>
          <div class="card-content">
            <div class="card-title">创建高风险专项</div>
            <div class="card-desc">预填专项排查模板</div>
          </div>
        </div>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  name: 'QuickEntry',
  methods: {
    handleImportHistory() {
      this.$emit('import-history')
    },
    handleCreateQuarterly() {
      this.$emit('create-quarterly')
    },
    handleCreateEmployee() {
      this.$emit('create-employee')
    },
    handleCreateHighRisk() {
      this.$emit('create-highrisk')
    }
  }
}
</script>

<style lang="scss" scoped>
.quick-entry-container {
  margin-top: 12px;
}

.section-title {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ccdi-text-secondary);

  .title-icon {
    margin-right: 6px;
    color: var(--ccdi-primary);
    font-size: 16px;
  }
}

.entry-card {
  display: flex;
  align-items: center;
  padding: 16px;
  background: white;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--ccdi-shadow);
  border: 1px solid var(--ccdi-border);
  height: 100%;

  &:hover {
    transform: translateY(-1px);
    box-shadow: var(--ccdi-shadow-soft);
    border-color: #c6d7e6;

    .card-icon {
      transform: scale(1.05);
    }
  }

  &:active {
    transform: translateY(0);
  }
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  flex-shrink: 0;
  transition: all 0.2s ease;
  font-size: 20px;
  color: white;

  &.import-icon {
    background-color: #6c7a89;
  }

  &.quarterly-icon {
    background-color: #2f5d8a;
  }

  &.employee-icon {
    background-color: #587893;
  }

  &.highrisk-icon {
    background-color: #a56a2a;
  }
}

.card-content {
  flex: 1;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ccdi-text-primary);
  margin-bottom: 2px;
}

.card-desc {
  font-size: 12px;
  color: var(--ccdi-text-muted);
  line-height: 1.4;
}
</style>
