index.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <template>
  2. <div id="index">
  3. <admin-frame @search="search" :limit="limit" :total="total" topType="3" @back="back" :useNav="false">
  4. <template v-slot:info>
  5. <list-1 :list="list" @detail="detail"></list-1>
  6. </template>
  7. </admin-frame>
  8. </div>
  9. </template>
  10. <script>
  11. import list1 from './parts/list-1.vue';
  12. import adminFrame from '@frame/src/components/mobile-frame/mobile-main.vue';
  13. import { mapState, createNamespacedHelpers } from 'vuex';
  14. const { mapActions: patenttechol } = createNamespacedHelpers('patenttechol');
  15. export default {
  16. name: 'index',
  17. props: {},
  18. components: {
  19. adminFrame,
  20. list1,
  21. },
  22. data: function () {
  23. return {
  24. list: [],
  25. limit: 5,
  26. total: 0,
  27. };
  28. },
  29. async created() {
  30. await this.search();
  31. },
  32. methods: {
  33. ...patenttechol(['query']),
  34. async search({ skip = 0, limit = this.limit, searchName, ...info } = {}) {
  35. if (searchName) info.order_num = searchName;
  36. let res = await this.query({ skip, limit, ...info });
  37. if (this.$checkRes(res)) {
  38. this.$set(this, `list`, res.data);
  39. this.$set(this, `total`, res.total);
  40. }
  41. },
  42. // 查看详情
  43. detail(data) {
  44. this.$router.push({ path: '/patent/admin/techol/techol_info', query: { id: data.id } });
  45. },
  46. // 返回
  47. back() {
  48. this.$router.push({ path: '/patent/index' });
  49. },
  50. },
  51. computed: {
  52. ...mapState(['user']),
  53. },
  54. metaInfo() {
  55. return { title: this.$route.meta.title };
  56. },
  57. watch: {
  58. test: {
  59. deep: true,
  60. immediate: true,
  61. handler(val) {},
  62. },
  63. },
  64. };
  65. </script>
  66. <style lang="less" scoped></style>