<template>
  <div :class="$style.fixed"
    ><a-card :class="$style.card">
      <div :class="$style.anglist">
        <div v-for="(item, i) in list" :key="i" :class="$style.item" @click="onJm(item.key)">
          {{ item.name }}
        </div>
      </div>
    </a-card>
  </div>
</template>

<script>
import components from './_import-components/audit-fixed-list-import'
import auditModelService from '../model/audit-model-service'

export default {
  name: 'AuditFixedList',
  metaInfo: {
    title: '数据情况',
  },
  components,
  data() {
    return {
      list: [
        { name: '结构化数据同步情况', type: 1, key: 'e6e5d844-cb18-4e18-b26e-ec4a819ed711' },
        { name: '非结构化数据推送情况', type: 2, key: 'f859bda2-dfb1-4457-9e2b-633e241c5dff' },
      ],
    }
  },
  methods: {
    onJm(key) {
      // getFixedDashboard
      // 如果key是空的就停止
      if (!key) return
      auditModelService.getFixedDashboard(key).then((res) => {
        if (res.data) {
          window.open(res.data)
        }
      })
    },
  },
}
</script>

<style module lang="scss">
@use '@/common/design' as *;
.anglist {
  display: flex;
  flex-wrap: wrap;
  .item {
    width: 30%;
    min-height: 180px;
    margin: 20px;
    font-size: 24px;
    font-weight: 600;
    line-height: 180px;
    color: $link-color;
    text-align: center;
    // 字间距变大
    letter-spacing: 2px;
    // 字体可以换行
    word-break: break-all;
    cursor: pointer;
    background-color: $tree-node-selected-bg;
    border-radius: 10px;
  }
}
.fixed,
.card {
  height: 100%;
}
</style>
