index.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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/research/list-1.vue';
  15. import info1 from '@/layout/research/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. {
  30. createBy: '1',
  31. createTime: '2021-09-24 15:10:01',
  32. delFlag: '0',
  33. id: 'direction001',
  34. name: '开创视觉光刺激治疗癫痫研究',
  35. params: {},
  36. personId: 'person001',
  37. personName: '王江涛',
  38. persons: [
  39. {
  40. createBy: null,
  41. createTime: '2021-10-11 19:57:29',
  42. direction: 'direction001',
  43. id: '2896b42a57ec49b4aa2102d324fca81e',
  44. params: {},
  45. personId: 'person435',
  46. personName: '张洪波',
  47. remark: null,
  48. searchValue: null,
  49. updateBy: null,
  50. updateTime: null,
  51. },
  52. {
  53. createBy: null,
  54. createTime: '2021-10-11 19:57:29',
  55. direction: 'direction001',
  56. id: '39ec9611c3814f738cf8118522e00c7a',
  57. params: {},
  58. personId: 'person1119',
  59. personName: '李国亮',
  60. remark: null,
  61. searchValue: null,
  62. updateBy: null,
  63. updateTime: null,
  64. },
  65. {
  66. createBy: null,
  67. createTime: '2021-10-11 19:57:29',
  68. direction: 'direction001',
  69. id: '509af2c53cfa4a28aa58eab8c7491a19',
  70. params: {},
  71. personId: 'person579',
  72. personName: '张艳凤',
  73. remark: null,
  74. searchValue: null,
  75. updateBy: null,
  76. updateTime: null,
  77. },
  78. {
  79. createBy: null,
  80. createTime: '2021-10-11 19:57:29',
  81. direction: 'direction001',
  82. id: '9dfa64d3f9594e509880eded42cabbcf',
  83. params: {},
  84. personId: 'person986',
  85. personName: '杨诺',
  86. remark: null,
  87. searchValue: null,
  88. updateBy: null,
  89. updateTime: null,
  90. },
  91. {
  92. createBy: null,
  93. createTime: '2021-10-11 19:57:29',
  94. direction: 'direction001',
  95. id: 'bb3b9aa4c1104833940896349a2d9b05',
  96. params: {},
  97. personId: 'person004',
  98. personName: '张彤',
  99. remark: null,
  100. searchValue: null,
  101. updateBy: null,
  102. updateTime: null,
  103. },
  104. ],
  105. remark: null,
  106. searchValue: null,
  107. updateBy: '1',
  108. updateTime: '2021-10-11 19:57:28',
  109. },
  110. ],
  111. total: 0,
  112. limit: 5,
  113. // 弹框
  114. dialog: { show: false, title: '详细信息', type: '1' },
  115. // 详细信息
  116. info: {},
  117. };
  118. },
  119. async created() {
  120. await this.search();
  121. },
  122. methods: {
  123. async search({ skip = 0, limit = this.limit, searchName, ...info } = {}) {
  124. if (searchName) info.name = searchName;
  125. },
  126. // 查看信息
  127. async toView(data) {
  128. data.persons = JSON.stringify(data.persons.map((i) => i.personName));
  129. this.$set(this, `info`, data);
  130. this.dialog = { show: true, title: '详细信息', type: '1' };
  131. },
  132. },
  133. computed: {
  134. ...mapState(['user']),
  135. },
  136. metaInfo() {
  137. return { title: this.$route.meta.title };
  138. },
  139. watch: {
  140. test: {
  141. deep: true,
  142. immediate: true,
  143. handler(val) {},
  144. },
  145. },
  146. };
  147. </script>
  148. <style lang="less" scoped>
  149. .dialog {
  150. /deep/.van-dialog__content {
  151. max-height: 350px;
  152. overflow-y: auto;
  153. }
  154. }
  155. </style>