<template>
  <div class="app-container">
    <div class="box-container">
      <div class="contain-title">企业产品</div>
      <div class="contian-operate" v-if="companyId">
        <el-button type="primary" @click="queryProductInfo">发布产品</el-button>
      </div>
    </div>
    <div class="content-container">
      <div class="select-box" v-if="!companyId">
        <p>请选择需要查看的企业</p>
        <el-select
          v-model="value9"
          filterable
          remote
          reserve-keyword
          maxlength="50"
          placeholder="请输入关键词"
          :remote-method="remoteMethod"
          :loading="loading"
          suffix-icon="el-icon-search">
          <el-option
            v-for="item in options4"
            :key="item.value"
            :label="item.label"
            :value="item.value">
          </el-option>
        </el-select>
      </div>
      <div v-else>
        <div class="lit-tit">显示企业名称</div>
        <complex-table :tableData="tableData" :tableItem="tableItem"></complex-table>
      </div>
    </div>
  </div>
</template>

<script>
  import complexTable from '@/components/complexTable'
  export default {
    data() {
      return {
        companyId: '253',
        searchText: '',
        selectMode: '',
        tableData: [
          {
            date: '2018/08/25 16:32',
            name: '关于征集企业技术创新需求的通知',
            class: '通知公告',
            owner: '张贝贝',
            num: '4552'
          }, {
            date: '2018/08/25 16:32',
            name: '关于征集企业技术创新需求的通知',
            class: '通知公告',
            owner: '张贝贝',
            num: '4552'
          }, {
            date: '2018/08/25 16:32',
            name: '关于征集企业技术创新需求的通知',
            class: '通知公告',
            owner: '张贝贝',
            num: '4552'
          }, {
            date: '2018/08/25 16:32',
            name: '关于征集企业技术创新需求的通知',
            class: '通知公告',
            owner: '张贝贝',
            num: '4552'
          }
        ],
        tableItem: [
          {
            prop: 'name',
            tit: '标题'
          },
          {
            prop: 'class',
            tit: '栏目分类',
            width: '160'
          },
          {
            prop: 'owner',
            tit: '发布人',
            width: '160'
          },
          {
            prop: 'date',
            tit: '发布时间',
            width: '160'
          },
          {
            prop: 'num',
            tit: '浏览数量',
            width: '160'
          },
          {
            operate: 'edit',
            width: '200'
          }
        ]
      }
    },
    components: {
      complexTable
    },
    methods: {
      queryProductInfo() {
        this.$router.replace({ name: 'productInfo' })
      }
    }
  }
</script>

<style rel="stylesheet/scss" lang="scss">
  .select-box{
    width:350px;
    margin: 15% auto 22%;
    p{
      font-size: 20px;
      font-weight: bold;
      line-height: 40px;
      text-align: center;
    }
  }
  .lit-tit{
    font-size: 17px;
    line-height: 30px;
    margin-bottom: 10px;
  }
</style>
