<template>
  <el-row>
    <el-col v-for="(system, index) in systemList" :key="system.id" :span="4" :offset="index > 0 ? 1 : 0">
      <el-card :body-style="{ padding: '0px' }">
        <img :src=" baseApi + '/file/' + system.storage.type + '/' + system.storage.realName" class="image">
        <div class="content">
          <span>{{ system.systemName }}</span>
          <el-button type="danger" round>进入</el-button>
        </div>
      </el-card>
    </el-col>
  </el-row>
</template>

<script>
import { mapGetters } from 'vuex'
import crudDmSystem from '@/api/dm/system/dmSystem'
export default {
  data() {
    return {
      systemList: []
    }
  },
  computed: {
    ...mapGetters([
      'user',
      'baseApi'
    ])
  },
  mounted() {
    this.queryByUserId(this.user.id)
  },
  methods: {
    queryByUserId(userId) {
      crudDmSystem.queryByUserId(userId).then(res => {
        console.log('res', res)
        this.systemList = res
      })
    }
  }
}
</script>

<style lang="scss" scoped>
  >>> .el-col:nth-child(5n + 1) {
    margin-left: 0;
  }
  >>> .el-col:nth-child(n + 6) {
    margin-top: 20px;
  }

  .content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;

    span {
      font-size: 16px;
      font-weight: 600;
      margin-bottom: 15px;
    }
    ::v-deep .el-button {
      width: 60%;
    }
  }

  .time {
    font-size: 13px;
    color: #999;
  }

  .bottom {
    margin-top: 13px;
    line-height: 12px;
  }

  .button {
    padding: 0;
    float: right;
  }

  .image {
    width: 100%;
    display: block;
  }

  .clearfix:before,
  .clearfix:after {
    display: table;
    content: "";
  }

  .clearfix:after {
    clear: both
  }
</style>
