<template>
  <a-card
    title="实用工具"
    :bordered="false"
    class="task-card"
    :split="false"
    :body-style="{ padding: '5px' }"
  >
    <a-row :gutter="16">
      <a-col
        class="gutter-row"
        :span="12"
        v-for="(item, index) in list"
        :key="index"
      >
        <a-button
          :type="`link`"
          class="ele-text-secondary"
          @click="openNew(`${item.url}`)"
          >{{ item.name }}</a-button
        >
      </a-col>
    </a-row>
  </a-card>
</template>

<script lang="ts" setup>
  import { openNew } from '@/utils/common';
  import { ref } from 'vue';
  import type { Link } from '@/api/oa/link/model';
  import { pageLink } from '@/api/oa/link';

  const list = ref<Link[]>([]);

  pageLink({ linkType: '实用工具' }).then((res) => {
    list.value = res?.list || [];
  });
</script>

<style scoped lang="less"></style>
