<template>
  <div class="CardItem">
    <div  >
      <div class="Card-top">
        <span class="title">{{ CardItemList.name }}</span>
        <span class="take" @click="poicefileitemclick"> 查看详情 </span>
      </div>

      <div class="card-btom">
        <div class="pushdata">
          <span >发布日期：</span><span>{{ datanew }}</span>
        </div>
        <div>
          <span>文件类型：</span><span>{{ CardItemList.type }}</span>
        </div>
        <div>
          <span>文号：</span><span>{{ CardItemList.fileNo }}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "CardItem",
  props: {
    // poicefilelist: {
    //   type: Array,
    //   default() {
    //     return [];
    //   },
    // },


    CardItemList:{
      tyepe:Array,
      default(){
        return[];
      }
    },

  },
  data() {
    return {
      datatime:"",
    };
  },
  created() {

  },
  mounted(){
    // 时间格式转换

  },
  computed: {
        // 发布日期转换
    datanew(){
      return this.CardItemList.publishOn.slice(0,10)
    }
    
  },
  methods: {


    // 点击跳转
    poicefileitemclick() {
      if (this.$route.path.indexOf("articles") !== 1) {
        this.$router.push("/articles/" + this.CardItemList.fileID);
        console.log("跳转");
        console.log(this.CardItemList.fileID);
      } else {
        return false;
      }
    },
  },
};
</script>

<style scoped>
.CardItem {
  display: grid;
  background-color: #fff;
  border-radius: 2vw;
  height: auto;
  padding-top: 3vw;
  padding-bottom: 3vw;
  margin-top: 3vw;
}
.title {
  font-size: 18px;
}
.Card-top {
  /* display: flex;
  justify-content: space-between; */
  line-height: 7vw;
  padding-left: 5vw;
  padding-right: 5vw;
}
.card-btom {
  display: grid;
  padding-left: 5vw;
}
.card-btom span {
  line-height: 8vw;
}
.take {
  color: #1677ff;
  float: right;
}
</style>