service.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <div id="service">
  3. <admin-frame @search="search" :limit="limit" :total="total" topType="2" @back="back" :rightArrow="false" :useNav="false">
  4. <template v-slot:info>
  5. <list-1 :list="list"></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: patentchat } = createNamespacedHelpers('patentchat');
  15. export default {
  16. name: 'service',
  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. ...patentchat(['adminQuery']),
  34. async search({ skip = 0, limit = this.limit, ...info } = {}) {
  35. info.id = this.user._id;
  36. let res = await this.adminQuery({ 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. back() {
  44. this.$router.push({ path: '/service/patent/index' });
  45. },
  46. },
  47. computed: {
  48. ...mapState(['user']),
  49. },
  50. metaInfo() {
  51. return { title: this.$route.meta.title };
  52. },
  53. watch: {
  54. test: {
  55. deep: true,
  56. immediate: true,
  57. handler(val) {},
  58. },
  59. },
  60. };
  61. </script>
  62. <style lang="less" scoped></style>