list-1.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <template>
  2. <div id="list-1">
  3. <van-row>
  4. <van-col span="24" class="main">
  5. <van-col span="24" class="list" v-for="(item, index) in list" :key="index">
  6. <van-col span="24" class="title textOver">
  7. {{ item.name }}
  8. </van-col>
  9. <van-col span="24" class="other">
  10. <van-col span="24" class="otherInfo">
  11. 方向带头人:<span>{{ item.personName || '暂无' }}</span>
  12. </van-col>
  13. <van-col span="24" class="otherInfo">
  14. 核心成员:<span>{{ getData(item) || '暂无' }}</span>
  15. </van-col>
  16. </van-col>
  17. <van-col span="24" class="btn">
  18. <van-button type="info" size="small" @click="toView(item)">详细信息</van-button>
  19. </van-col>
  20. </van-col>
  21. </van-col>
  22. </van-row>
  23. </div>
  24. </template>
  25. <script>
  26. import { mapState, createNamespacedHelpers } from 'vuex';
  27. export default {
  28. name: 'list-1',
  29. props: {
  30. list: { type: Array },
  31. },
  32. components: {},
  33. data: function () {
  34. return {};
  35. },
  36. created() {},
  37. methods: {
  38. // 查看详情
  39. toView(data) {
  40. this.$emit('toView', data);
  41. },
  42. // 整理数据
  43. getData(data) {
  44. return JSON.stringify(data.persons.map((i) => i.personName));
  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>
  63. .main {
  64. .list {
  65. background-color: #fff;
  66. margin: 0 0 8px 0;
  67. padding: 8px;
  68. border-radius: 5px;
  69. .title {
  70. font-size: 16px;
  71. font-weight: bold;
  72. margin: 0 0 5px 0;
  73. }
  74. .other {
  75. margin: 0 0 5px 0;
  76. .otherInfo {
  77. font-size: 14px;
  78. color: #666;
  79. margin: 0 0 5px 0;
  80. span {
  81. color: #000;
  82. }
  83. }
  84. }
  85. .btn {
  86. text-align: center;
  87. .van-button {
  88. margin: 0 5px;
  89. }
  90. }
  91. }
  92. }
  93. </style>