<template>
  <div id="question">
    <el-row>
      <el-col :span="24" class="style">
        <el-col :span="24" class="top">
          <top :topInfo="topInfo" @moreBtn="moreBtn"></top>
        </el-col>
        <el-col :span="24" class="down">
          <el-col :span="24" class="list" v-for="(item, index) in questionList" :key="index" @click.native="detailBtn(item)">
            <el-col :span="20" class="title textOver">
              {{ item.title }}
            </el-col>
            <el-col :span="4" class="date">
              {{ item.create_date || '暂无' }}
            </el-col>
            <el-col :span="24" class="orgin"> 信息来源：{{ item.origin || '暂无' }} </el-col>
          </el-col>
        </el-col>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import top from './parts/topColumn.vue';
import { mapState, createNamespacedHelpers } from 'vuex';
export default {
  metaInfo() {
    return { title: this.$route.meta.title };
  },
  name: 'question',
  props: {
    questionList: { type: Array },
  },
  components: {
    top,
  },
  data: function() {
    return {
      topInfo: {
        title: '调研调查',
        engTitle: 'question',
      },
    };
  },
  created() {},
  methods: {
    // 更多
    moreBtn() {
      this.$router.push({ path: '/techolchat/list', query: { index: 0 } });
    },
    // 详情
    detailBtn(data) {
      this.$router.push({ path: './list', query: { index: 0, id: data._id } });
    },
  },
  computed: {
    ...mapState(['user']),
  },
  watch: {},
};
</script>

<style lang="less" scoped>
.style {
  .top {
    height: 50px;
  }
  .down {
    height: 450px;
    position: relative;
    .list {
      border-bottom: 1px dashed #000;
      padding: 11px 0;
      .title {
        font-size: 16px;
        font-weight: bold;
      }
      .date {
        text-align: right;
        font-size: 16px;
      }
      .orgin {
        font-size: 16px;
        margin: 10px 0 0 0;
      }
    }
    .list:hover {
      cursor: pointer;
      .title {
        color: #409eff;
      }
    }
  }
}
</style>
