<template>
  <div id="company">
    <el-row v-loading="loading">
      <el-col :span="24" class="company">
        <el-col :span="24" class="newsTop">
          <el-col :span="18" class="text">
            {{ title }}
          </el-col>
          <el-col :span="6" class="link">
            <!-- <el-link :underline="false">MORE(todo)<i class="el-icon-circle-plus-outline" style="color:#f8b024;font-weight:bold;margin:0 5px;"></i> </el-link> -->
          </el-col>
        </el-col>
        <el-col :span="24" class="info">
          <el-col :span="12" class="list" v-for="(item, index) in companyList" :key="index">
            <el-col :span="24" class="title">
              <p class="textOver">{{ item.title }}({{ item.meta | getDate }})</p>
            </el-col>
          </el-col>
        </el-col>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import _ from 'lodash';
export default {
  name: 'company',
  props: {
    companyList: null,
  },
  components: {},
  data: () => ({
    loading: true,
    title: '招聘企业',
  }),
  watch: {
    companyList: {
      handler(val) {
        if (val) this.loading = false;
      },
    },
  },
  created() {},
  computed: {},
  methods: {},
  filters: {
    getDate(meta) {
      let createdAt = _.get(meta, `createdAt`);
      let date = new Date(createdAt)
        .toLocaleDateString()
        .replace('/', '-')
        .replace('/', '-');
      return date;
    },
  },
};
</script>

<style lang="less" scoped>
p {
  padding: 0;
  margin: 0;
}
.textOver {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.newsTop {
  height: 35px;
  line-height: 35px;
  border-bottom: 2px solid #0656d1;
}
.newsTop .text {
  font-size: 20px;
  color: #0874ee;
  font-weight: 600;
  padding: 0 10px;
}
.newsTop .link {
  text-align: right;
  padding: 0 5px;
}
.list {
  padding: 13px 0;
}
.list p {
  font-size: 14px;
  color: #222222;
}
</style>
