index.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <template>
  2. <div id="index">
  3. <admin-frame @search="search" :limit="limit" :total="total" :useNav="false">
  4. <template v-slot:info>
  5. <list-1 :list="list" @toView="toView"></list-1>
  6. </template>
  7. </admin-frame>
  8. <van-dialog class="dialog" v-model="dialog.show" :title="dialog.title" :show-confirm-button="false" show-cancel-button cancel-button-text="返回">
  9. <info-1 :info="info" v-if="dialog.type == '1'"></info-1>
  10. </van-dialog>
  11. </div>
  12. </template>
  13. <script>
  14. import list1 from '@/layout/infoview/laboratory/list-1.vue';
  15. import info1 from '@/layout/infoview/laboratory/info-1.vue';
  16. import adminFrame from '@common/src/components/mobile-frame/mobile-main.vue';
  17. import { mapState, createNamespacedHelpers } from 'vuex';
  18. export default {
  19. name: 'index',
  20. props: {},
  21. components: {
  22. adminFrame,
  23. list1,
  24. info1,
  25. },
  26. data: function () {
  27. return {
  28. list: [],
  29. total: 0,
  30. limit: 5,
  31. // 弹框
  32. dialog: { show: false, title: '详细信息', type: '1' },
  33. // 详细信息
  34. info: {},
  35. };
  36. },
  37. async created() {
  38. await this.search();
  39. },
  40. methods: {
  41. async search({ skip = 0, limit = this.limit, searchName, ...info } = {}) {
  42. if (searchName) info.name = searchName;
  43. let data = [
  44. {
  45. buildTime: null,
  46. chiefName: '梁建民',
  47. createBy: '1',
  48. createTime: '2021-09-16 00:00:00',
  49. delFlag: '0',
  50. englishName: '',
  51. id: '1',
  52. labAcreage: '',
  53. labAddress: '',
  54. labEmail: 'jackyliangjm@163.com',
  55. labPerson: '梁建民',
  56. labPhone: '13578652528',
  57. name: '儿科神经吉林省重点实验室',
  58. numb: '0',
  59. params: {},
  60. remark: null,
  61. searchValue: null,
  62. unitName: '吉林大学白求恩第一医院',
  63. unitPerson: '孙宇飞 ',
  64. unitPhone: '13944843792',
  65. updateBy: 'userid001',
  66. updateTime: '2021-09-30 14:09:43',
  67. },
  68. ];
  69. this.$set(this, `list`, data);
  70. },
  71. // 查看信息
  72. async toView(data) {
  73. this.$set(this, `info`, data);
  74. this.dialog = { show: true, title: '详细信息', type: '1' };
  75. },
  76. },
  77. computed: {
  78. ...mapState(['user']),
  79. },
  80. metaInfo() {
  81. return { title: this.$route.meta.title };
  82. },
  83. watch: {
  84. test: {
  85. deep: true,
  86. immediate: true,
  87. handler(val) {},
  88. },
  89. },
  90. };
  91. </script>
  92. <style lang="less" scoped>
  93. .dialog {
  94. /deep/.van-dialog__content {
  95. max-height: 350px;
  96. overflow-y: auto;
  97. }
  98. }
  99. </style>