<template>
  <div class="mainView">
    <div class="institution">
      <h2>职能简介</h2>
      <div class="organizationBox">
        <div class="organization" v-for="item in institution" :key="item.id">
          <span class="title">{{ item.departmentName }}</span>
          <div class="details">
            <div class="infoBox">
              <!-- <div class="info" v-for="el in item.personnel" :key="el.phone"> -->
              <span class="job">{{ item.position }}:</span>
              <span class="name">{{ item.leaderName }}</span>
              <span class="phone">
                <!-- <el-icon><Phone /></el-icon>  -->
                {{ item.officeNumber }}
              </span>
              <!-- </div> -->
            </div>
            <div class="intro">
              <h4>职能简介</h4>
              <p v-html="item.functionIntroduction"></p>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script setup>
import api from "@/api/jggk.js";
import { onMounted, ref } from "vue";
const institution = ref([]);
onMounted(() => {
  getInstitution();
});

// 机构职能
function getInstitution() {
  api.institution({ size: 1000, current: 1 }).then((res) => {
    if (res.code == 200) {
      institution.value = res.data.records;
    }
  });
}
</script>
<style scoped lang="less">
.menuItem {
  overflow: hidden;

  .menuItem {
    float: left;
    color: #bd1a2d;
    display: block;
    font-size: 22px;
    padding-right: 30px;
    margin: 20px 0 10px 75px;
    border-right: 1px solid #cfcfcf;
  }
}

.institution {
  margin: 20px 30px;

  h2 {
    margin: 30px 0;
    text-align: center;
  }

  .organizationBox {
    padding: 15px;
    margin-bottom: 30px;

    .organization {
      .title {
        font-size: 20px;
        color: #027db4;
        font-size: 18px;
        font-weight: bold;
        display: block;
        margin-left: 10px;
        margin-bottom: 15px;
      }

      .details {
        padding: 20px 30px;
        margin-bottom: 30px;

        border: 1px solid #ebeef5;

        .infoBox {
          overflow: hidden;
          margin-bottom: 10px;
          .phone,
          .name {
            padding-left: 10px;
            .el-icon {
              vertical-align: middle;
            }
          }
          .info {
            float: left;
            margin: 30px 15px 30px 0;

            span {
              font-size: 14px;
              margin-right: 10px;
            }

            .job {
            }
          }
        }

        .intro {
          h4 {
            margin-bottom: 20px;
          }

          h4::before {
            width: 1px;
            content: " ";
            margin-right: 5px;
            border: 2px solid #409eff;
          }

          p {
            font-size: 16px;
          }
        }
      }
    }
  }
}
</style>
