<template>
  <div id="hairmess">
    <admin-frame @search="search" :limit="limit" :total="total" topType="2" @back="back" :rightArrow="false" :useNav="false">
      <template v-slot:info>
        <van-col span="24">
          <list-2 :list="list"></list-2>
        </van-col>
      </template>
    </admin-frame>
  </div>
</template>

<script>
import list2 from './hairmess/list-2.vue';
import adminFrame from '@frame/src/components/mobile-frame/mobile-main.vue';
import { mapState, createNamespacedHelpers } from 'vuex';
const { mapActions: cpcimporterror } = createNamespacedHelpers('cpcimporterror');
export default {
  name: 'hairmess',
  props: {},
  components: {
    adminFrame,
    list2,
  },
  data: function () {
    return {
      limit: 5,
      total: 0,
      list: [],
    };
  },
  async created() {
    this.search();
  },
  methods: {
    ...cpcimporterror(['query']),
    async search({ skip = 0, limit = this.limit, searchName, ...info } = {}) {
      let res = await this.query({ skip, limit, ...info });
      if (this.$checkRes(res)) {
        this.$set(this, `list`, res.data);
        this.$set(this, `total`, res.total);
      }
    },
    // 返回
    back() {
      this.$router.push({ path: '/patent/index' });
    },
  },
  computed: {
    ...mapState(['user']),
  },
  metaInfo() {
    return { title: this.$route.meta.title };
  },
  watch: {
    test: {
      deep: true,
      immediate: true,
      handler(val) {},
    },
  },
};
</script>

<style lang="less" scoped>
.btn {
  margin: 10px 0;
  text-align: center;
  .van-button {
    margin: 0 10px;
  }
}
</style>
