<template>
  <div id="transDetail">
    <admin-frame topType="2" @back="back" :rightArrow="false" :usePage="false" :useNav="false">
      <template v-slot:info>
        <info-1 :form="form"></info-1>
      </template>
    </admin-frame>
  </div>
</template>

<script>
import info1 from './parts/detail-2.vue';
import adminFrame from '@frame/src/components/mobile-frame/mobile-main.vue';
import { mapState, createNamespacedHelpers } from 'vuex';
const { mapActions: patenttrans } = createNamespacedHelpers('patenttrans');
export default {
  name: 'transDetail',
  props: {},
  components: {
    adminFrame,
    info1,
  },
  data: function () {
    return {
      form: {},
    };
  },
  created() {
    if (this.id) this.search();
  },
  methods: {
    ...patenttrans(['fetch']),
    async search() {
      let res = await this.fetch(this.id);
      if (this.$checkRes(res)) {
        this.$set(this, `form`, res.data);
      }
    },
    // 返回
    back() {
      window.history.go(-1);
    },
  },
  computed: {
    ...mapState(['user']),
    id() {
      return this.$route.query.id;
    },
  },
  metaInfo() {
    return { title: this.$route.meta.title };
  },
  watch: {
    test: {
      deep: true,
      immediate: true,
      handler(val) {},
    },
  },
};
</script>

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