<template>
  <div id="followStockDetail">
    <el-row>
      <el-col :span="24" class="debt">
        <el-col :span="24" class="top">
          <topInfo :topTitle="topTitle" :display="display"></topInfo>
        </el-col>
        <el-col :span="24" class="main">
          <el-col :span="24" class="back">
            <detailTop @goBack="goBack"></detailTop>
          </el-col>
          <el-col :span="24" class="info">
            <followStockForm :ruleForm="followStockFormNew"></followStockForm>
          </el-col>
        </el-col>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import topInfo from '@/layout/common/topInfo.vue';
import detailTop from '@/layout/common/detailTop.vue';
import followStockForm from '@/layout/follow/followStockForm.vue';
import { createNamespacedHelpers, mapGetters } from 'vuex';
const { mapActions: stockneed } = createNamespacedHelpers('stockneed');
export default {
  name: 'followStockDetail',
  props: {},
  components: {
    topInfo, //头部导航
    detailTop, //头部返回
    followStockForm, //股权需求详情
  },
  data: () => ({
    display: 'none',
    topTitle: '股权信息详情',
    followStockFormNew: {},
    charList: {
      name: '10',
    },
  }),
  created() {
    this.searchInfo();
  },
  computed: {
    id() {
      return this.$route.query.id;
    },
  },
  methods: {
    ...stockneed(['followstock', 'one']),
    async searchInfo() {
      if (this.id) {
        const res = await this.one({ id: this.id });
        this.$set(this, `followStockFormNew`, res.data);
      }
    },
    // 返回
    goBack() {
      this.$router.go(-1);
    },
  },
};
</script>

<style lang="less" scoped>
.debt {
  padding: 20px;
}
.top {
  border-bottom: 1px solid #ccc;
}
.main {
  border-radius: 10px;
  margin: 20px 0 0 0;
  box-shadow: 0 0 3px #666;
}
.main .back {
  padding: 10px 0 10px 15px;
}
</style>
