<template>
  <div id="index">
    <el-row>
      <el-col :span="24" class="style">
        <el-col :span="24" class="top">
          <top></top>
        </el-col>
        <el-col :span="24" class="menu">
          <div class="w_1200">
            <menus></menus>
          </div>
        </el-col>
        <el-col :span="24" class="main">
          <div class="w_1200">
            <el-col :span="5" class="left">
              <el-col :span="24" class="leftone">
                <seminar></seminar>
              </el-col>
              <el-col :span="24" class="lefttwo">
                <cooperation> </cooperation>
              </el-col>
            </el-col>
            <el-col :span="19" class="context">
              <el-col :span="18" class="right">
                <span v-if="displays == '0'">
                  <el-col :span="24" class="one">
                    <span></span>
                    <span>{{ columnName }}</span>
                  </el-col>
                  <el-col :span="24" class="list">
                    <softwareList :list="list" :total="total" @detailBtn="detailBtn"></softwareList>
                  </el-col>
                </span>
                <span v-else>
                  <softwareDetail :details="details"></softwareDetail>
                </span>
              </el-col>
            </el-col>
          </div>
        </el-col>
        <el-col :span="24" class="foot">
          <div class="w_1200">
            <foot></foot>
          </div>
        </el-col>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import top from '@/layout/common/top.vue';
import menus from '@/layout/common/menus.vue';
import foot from '@/layout/common/foot.vue';
import seminar from '@/layout/achievement/seminar.vue';
import softwareDetail from './parts/softwareDetail.vue';
import softwareList from './parts/softwareList.vue';
import cooperation from '@/layout/achievement/cooperation.vue';

export default {
  name: 'index',
  props: {},
  components: { top, menus, foot, seminar, softwareList, cooperation, softwareDetail },
  data: () => ({
    displays: '0',
    columnName: '',
    total: 1,
    details: {},
    list: [
      {
        title: '新标题',
        date: '2020-02-02',
      },
      {
        title: '16条数据',
        date: '2020-02-02',
      },
    ],
    details: {
      title: '新信息标题',
      source: '信息部',
      date: '2020-02-02',
      content: '信息内容',
    },
  }),
  created() {
    this.search();
  },
  computed: {
    name() {
      return this.$route.query.name;
    },
  },
  methods: {
    async detailBtn() {
      this.$set(this, `displays`, 1);
    },
    async search() {
      this.$set(this, `columnName`, this.name);
    },
  },
};
</script>

<style lang="less" scoped>
.w_1200 {
  width: 1200px;
  margin: 0 auto;
}
.main {
  min-height: 670px;
  overflow: hidden;
  margin: 10px 0;
  .left {
    margin: 0 10px 0 0;
    .leftone {
      background: #fff;
    }
    .lefttwo {
      background-color: #fff;
    }
  }

  .right {
    width: 100%;
    min-height: 600px;
    background: #fff;
    padding: 0 20px;
    .one {
      height: 35px;
      margin: 20px 0;
      border-bottom: 1px dashed #ccc;
      span:first-child {
        display: inline-block;
        width: 4px;
        height: 20px;
        background: #005293;
        margin: 0 10px -3px 0;
      }
      span:nth-child(2) {
        font-size: 20px;
        color: #005293;
        font-weight: bold;
      }
    }
  }

  .context {
    width: 78%;
    min-height: 670px;
    background: #fff;
  }
}
</style>
