<template>
  <div id="list">
    <el-row>
      <div class="w_1200">
        <el-col :span="24" class="main">
          <el-col :span="4" class="menu">
            <el-image :src="squareImage"></el-image>
            <span class="topMenu">Menu</span>
            <!-- <el-col class="menuList" :span="24" v-for="(item, index) in menuList" :key="index">
              <p @click="changeMenu(item.name, index)" :style="`color:${menuIndex == index ? menuColor : ''}`">{{ item.name }}</p>
            </el-col> -->
            <el-col :span="24">
              <el-collapse v-model="activeNames" accordion>
                <el-collapse-item name="1">
                  <template slot="title">本地服务</template>
                  <el-col class="menuList" :span="24" v-for="(item, index) in menuList" :key="index">
                    <p @click="changeMenu(item.name, index)" :style="`color:${menuIndex == index ? menuColor : ''}`">
                      <i :class="item.icon"></i>
                      <span :style="`color:${menuIndex == index ? menuColor : ''}`"> {{ item.name }}</span>
                    </p>
                  </el-col>
                </el-collapse-item>
                <el-collapse-item name="2">
                  <template slot="title">合作服务</template>
                  <el-col class="menuList" :span="24" v-for="(item, index) in menuLists" :key="index">
                    <p @click="changeMenus(item.name, index)" :style="`color:${menuIndexs == index ? menuColor : ''}`">
                      <i :class="item.icon"></i>
                      <span :style="`color:${menuIndexs == index ? menuColor : ''}`">{{ item.name }}</span>
                    </p>
                  </el-col>
                </el-collapse-item>
              </el-collapse>
            </el-col>
          </el-col>
          <el-col :span="19" class="info">
            <el-col :span="24" class="infoTop">
              <span>|</span> <span>{{ columnName }}</span>
            </el-col>
            <el-col :span="24" class="infoDown">
              <span v-if="columnName == '智慧推荐'">
                <wisdom></wisdom>
              </span>
              <span v-else-if="columnName == '展会管理'">
                <exhibition></exhibition>
              </span>
              <span v-else-if="columnName == '科技评估'">
                <assessment></assessment>
              </span>
              <span v-else-if="columnName == '合同在线'">
                <contract></contract>
              </span>
              <span v-else-if="columnName == '信用认证'">
                <credit></credit>
              </span>
              <span v-else-if="columnName == '绩效评价'">
                <achievements></achievements>
              </span>
            </el-col>
          </el-col>
        </el-col>
      </div>
    </el-row>
  </div>
</template>

<script>
import wisdom from './detail/wisdom.vue';
import exhibition from './detail/exhibition.vue';
import assessment from './detail/assessment.vue';
import contract from './detail/contract.vue';
import credit from './detail/credit.vue';
import achievements from './detail/achievements.vue';
export default {
  name: 'list',
  props: {},
  components: {
    wisdom, //智慧推荐
    exhibition, //展会管理
    assessment, //科技评估
    contract, //合同在线
    credit, //信用认证
    achievements, //绩效评价
  },
  data: () => ({
    squareImage: require('@/assets/live/square_big.png'),
    activeNames: ['1'],
    menuList: [
      { icon: 'el-icon-trophy-1', name: '智慧推荐' },
      { icon: 'el-icon-pie-chart', name: '展会管理' },
      { icon: 'el-icon-news', name: '科技评估' },
      { icon: 'el-icon-guide', name: '合同在线' },
      { icon: 'el-icon-notebook-2', name: '信用认证' },
      { icon: 'el-icon-files', name: '绩效评价' },
    ],
    menuLists: [
      { icon: 'el-icon-trophy-1', name: '知识产权' },
      { icon: 'el-icon-football', name: '科技文献' },
      { icon: 'el-icon-bangzhu', name: '项目申报' },
      { icon: 'el-icon-aim', name: '科技金融' },
      { icon: 'el-icon-odometer', name: '科技孵化' },
      { icon: 'el-icon-coin', name: '成果登记' },
      { icon: 'el-icon-notebook-1', name: '技术合同' },
      { icon: 'el-icon-office-building', name: '高企认证' },
    ],
    menuColor: 'rgb(254, 149, 14)',
    backColor: 'rgb(204,204,204)',
    menuIndex: '0',
    menuIndexs: '0',
    columnName: '',
  }),
  created() {
    this.searchInfo();
  },
  computed: {
    column_name() {
      return this.$route.query.column_name;
    },
  },
  methods: {
    searchInfo() {
      if (this.column_name == '智慧推荐') this.changeMenu(this.$route.query.column_name, 0);
      if (this.column_name == '展会管理') this.changeMenu(this.$route.query.column_name, 1);
      if (this.column_name == '科技评估') this.changeMenu(this.$route.query.column_name, 2);
      if (this.column_name == '合同在线') this.changeMenu(this.$route.query.column_name, 3);
      if (this.column_name == '信用认证') this.changeMenu(this.$route.query.column_name, 4);
      if (this.column_name == '绩效评价') this.changeMenu(this.$route.query.column_name, 5);
    },
    changeMenu(name, index) {
      // this.menuIndex = index;
      // this.columnName = name;
      // this.menuColor = 'rgb(254, 149, 14)';
      if (index == 1) {
        this.menuIndex = index;
        this.columnName = name;
        this.menuColor = 'rgb(254, 149, 14)';
      } else {
        this.$message({
          message: '功能开发中',
          type: 'warning',
        });
      }
    },
    changeMenus(name, index) {
      // this.menuIndexs = index;
      // this.columnName = name;
      // this.menuColor = 'rgb(254, 149, 14)';
      this.$message({
        message: '功能开发中',
        type: 'warning',
      });
    },
  },
};
</script>

<style lang="less" scoped>
.w_1200 {
  width: 80%;
  margin: 0 auto;
}
.main {
  min-height: 900px;
  margin: 20px 0;
}
.menu {
  float: left;
  min-height: 900px;
  background: no-repeat bottom right;
  background-image: url(/img/menu_back.81f4b7e7.jpg);
  padding: 10px 0 0 10px;
  box-sizing: border-box;
  box-shadow: 0 0 10px #bbbaba;
}
.menu .el-image {
  width: 30px;
  display: inline-table;
  margin: 10px 5px;
}
.menu .topMenu {
  font-size: 24px;
  color: #92959a;
  font-weight: 600;
  margin-left: 3px;
  position: relative;
  top: 10px;
}
.menuList {
  i {
    padding: 0 15px 0 0;
    font-size: 25px;
  }
  span {
    font-size: 20px;
  }
}
.menuList p {
  line-height: 50px;
  font-size: 16px;
  cursor: pointer;
  border-bottom: 1px solid #2d64b3;
  color: #044b79;
  font-weight: 600;
  padding: 0 0 0 15px;
}
.info {
  float: right;
  width: 82%;
  min-height: 900px;
  padding: 20px;
  box-shadow: 0 0 10px #2d64b3;
  .infoTop {
    font-size: 18px;
    height: 40px;
    line-height: 40px;
    border-bottom: 1px solid #e5e5e5;
    font-weight: bold;
    color: #22529a;
  }
  .infoDown {
    margin: 15px 0 0 0;
  }
}
/deep/.el-collapse-item__header {
  font-size: 18px;
  font-weight: bold;
}
</style>
