<template>
  <div class="common-box" style="margin-top: 20px">
    <TopTitle icon="daping" title="大屏入口" />
    <div class="sys-container">
      <div
        v-for="(item, index) in screenData"
        :key="index"
        class="sys-item"
        @click="gotoScreen(item.routeName)"
      >
        <img alt="" class="sys-item-img" />
        <h3 class="sys-item-title">{{ item.name }}</h3>
      </div>
    </div>
  </div>
</template>

<script lang="ts" setup>
import TopTitle from "@/components/TopTitle.vue";

const screenData = ref([
  { name: "综合大屏", routeName: "totalScreen" },
  {
    name: "综合大屏",
    routeName: "totalScreen",
  },
  { name: "综合大屏", routeName: "totalScreen" },
  { name: "综合大屏", routeName: "totalScreen" },
]);

const router = useRouter();
const gotoScreen = (routeName: string) => {
  router.push({ name: routeName });
};
</script>

<style lang="scss" scoped>
.sys-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.sys-item {
  min-width: 150px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;

  .sys-item-img {
    width: 120px;
    height: 100px;
  }

  .sys-item-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
  }
}

.sys-item:hover {
  background-color: #87cefa;
  cursor: pointer;
}
</style>
