<template>
  <div id="adviserList">
    <enterprisejb-detail :info="info" :recruitData="recruitData" @onsave="onsaveClick" :liebiaoList="liebiaoList"></enterprisejb-detail>
    <!-- @detailcm="clickDetailcm" -->
  </div>
</template>

<script>
import enterprisejbDetail from '@/components/enterprise/enterprisejb.vue';
import { createNamespacedHelpers, mapGetters } from 'vuex';
const { mapActions: mapSite } = createNamespacedHelpers('site');
const { mapActions: mapRecruit } = createNamespacedHelpers('market');
export default {
  name: 'adviserList',
  props: {},
  components: {
    enterprisejbDetail,
  },
  data: () => ({
    info: {},
    liebiaoList: [{ name: '基本信息' }, { name: '消息管理' }, { name: '我的发布' }, { name: '我的订购' }, { name: '注销账号' }],
    columnName: '',
    recruitData: [],
  }),
  created() {
    this.searchSite();
    this.searchInfo();
  },
  computed: {},
  methods: {
    ...mapSite(['showInfo']),
    ...mapRecruit(['query', 'fetch']),

    // 查询站点信息
    async searchSite() {
      let res = await this.showInfo();
      let object = JSON.parse(JSON.stringify(res.data));
      if (object) {
        this.$set(this, `info`, res.data);
      } else {
        this.$message.error(res.errmsg ? res.errmsg : 'error');
      }
    },
    async searchInfo() {
      const res = await this.fetch('测试名称');
      console.log(res.data);
    },

    async onsaveClick({ id }) {
      console.log(id);
      if (id === '基本信息') {
        this.$router.push({ path: '/enterprise/enterprisejb' });
      } else if (id === '消息管理') {
        this.$router.push({ path: '/enterprise/enterprisexx' });
      } else if (id === '我的发布') {
        this.$router.push({ path: '/enterprise/enterprisefabu' });
      } else if (id === '我的订购') {
        this.$router.push({ path: '/enterprise/enterprisedg' });
      }
    },
  },
};
</script>

<style lang="less" scoped></style>
