<template>
  <div class="flex">
    <partial-view v-ref:pv>
      <div class="span">
        <p class="bg-info text-center" style="padding: 8px;">报表类型</p>
        <div class="col-sm-4 auto" v-for="type in types" style="padding: 5px">
          <div class="thumbnail auto" style="margin-bottom: 0px; cursor: pointer;" @click="$dispatch('select-type', type)">
            <img :src="type.f_image_path" alt="图片加载失败" class="img-rounded" style="width: 60px;">
            <p class="flex-row" style="justify-content: space-around;margin: 0px;">
              {{type.f_report_name}}
            </p>
          </div>
        </div>
      </div>
    </partial-view>
  </div>
</template>

<script>
export default {
  title: '报表选项',
  data () {
    return {
      types: []
    }
  },
  ready (){
    console.log('----222', this.$login.f)
    // 获取所有报表类型
    this.$refs.pv.load('rs/sql/manageSingleTable', {data: {tablename: 't_report_type', condition: '1=1'}}).then((res) => {
      this.types = res.data
      // for (var i = 0; i < 30; i++) {
      //   this.types.push(res.data[0])
      // }
    }).catch((error) => {

    })
  }
}
</script>
