<template>
  <div id="index">
    <admin-frame @search="search" :limit="limit" :total="total" :useNav="false">
      <template v-slot:info>
        <list-1 :list="list" @toView="toView"></list-1>
      </template>
    </admin-frame>
  </div>
</template>

<script>
import list1 from '@/layout/scientific/laboratory/list-1.vue';
import adminFrame from '@common/src/components/mobile-frame/mobile-main.vue';
import { mapState, createNamespacedHelpers } from 'vuex';
const { mapActions } = createNamespacedHelpers('usual');
export default {
  name: 'index',
  props: {},
  components: {
    adminFrame,
    list1,
  },
  data: function () {
    return {
      list: [],
      total: 0,
    };
  },
  created() {
    console.log('in function:');
    this.init();
  },
  methods: {
    ...mapActions(['query', 'fetch']),
    async init() {
      const res = await this.query({ table: 'BasicInformation', skip: 0, limit: 10 });
      if (this.$checkRes(res)) {
        this.$set(this, 'list', res.data);
        this.$set(this, 'total', res.total);
      }
    },
  },

  metaInfo() {
    return { title: this.$route.meta.title };
  },
};
</script>

<style lang="less" scoped>
.dialog {
  /deep/.van-dialog__content {
    max-height: 350px;
    overflow-y: auto;
  }
}
</style>
