index.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <template>
  2. <view class="content" v-if="list.length>0">
  3. <view class="info">
  4. <scroll-view scroll-y="true" class="scroll-view">
  5. <view class="list-scroll-view">
  6. <view class="list" v-for="(item, index) in list" :key="index">
  7. <view v-for="(i, indexs) in fields" :key="indexs">
  8. <view class="name textOver" v-if="i.is_name">{{item[i.model]||'暂无'}}</view>
  9. <view class="other" v-else>
  10. <view class="status textOne" v-if="i.is_status">
  11. <text>{{i.label}}:</text>{{item[i.model]||'暂无'}}
  12. </view>
  13. <view class="other_1 textOne" v-else>
  14. <text>{{i.label}}:</text>{{item[i.model]||'暂无'}}
  15. </view>
  16. </view>
  17. </view>
  18. <view class="button">
  19. <button class="primary" size="mini" type="primary" @tap.stop="toView(item)">查看</button>
  20. </view>
  21. </view>
  22. </view>
  23. </scroll-view>
  24. </view>
  25. <view class="total">
  26. <uni-pagination :current="page" :pageSize="pageSize" :total="total" @change="toPage" />
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. export default {
  32. props: {
  33. fields: {
  34. type: Array,
  35. },
  36. list: {
  37. type: Array,
  38. default: []
  39. },
  40. page: {
  41. type: Number,
  42. default: 1
  43. },
  44. total: {
  45. type: Number,
  46. default: 0
  47. },
  48. pageSize: {
  49. type: Number,
  50. default: 5
  51. }
  52. },
  53. data() {
  54. return {
  55. };
  56. },
  57. methods: {
  58. // 分页
  59. toPage(e) {
  60. const that = this;
  61. const page = e.current - 1;
  62. const skip = page * that.pageSize;
  63. that.$emit('toPage', {
  64. page: e.current,
  65. skip: skip
  66. })
  67. },
  68. // 文件预览
  69. toView(item) {
  70. const that = this;
  71. that.$emit('toView', item)
  72. }
  73. }
  74. }
  75. </script>
  76. <style lang="scss">
  77. .content {
  78. margin: 2vw 0 0 0;
  79. display: flex;
  80. flex-direction: column;
  81. box-sizing: border-box;
  82. width: 100vw;
  83. height: 90vh;
  84. .info {
  85. position: relative;
  86. flex-grow: 1;
  87. .list {
  88. background-color: var(--mainColor);
  89. border: 1px solid var(--f5Color);
  90. padding: 2vw;
  91. margin: 0 2vw 2vw 2vw;
  92. border-radius: 5px;
  93. .name {
  94. font-size: var(--font14Size);
  95. font-weight: bold;
  96. }
  97. .other {
  98. font-size: var(--font12Size);
  99. color: var(--f85Color);
  100. .other_1 {
  101. margin: 1vw 0 0 0;
  102. }
  103. }
  104. .status {
  105. margin: 1vw 0 0 0;
  106. font-size: var(--font12Size);
  107. color: var(--fF0Color);
  108. }
  109. .button {
  110. margin: 1vw 0 0 0;
  111. text-align: center;
  112. .primary {
  113. background: var(--f3CColor);
  114. }
  115. button {
  116. margin: 0 1vw 0 0;
  117. }
  118. }
  119. }
  120. }
  121. .total {
  122. overflow: hidden;
  123. background-color: var(--fffColor);
  124. padding: 2vw;
  125. border-top: 1px solid var(--f1Color);
  126. }
  127. }
  128. .scroll-view {
  129. position: absolute;
  130. top: 0;
  131. left: 0;
  132. right: 0;
  133. bottom: 0;
  134. .list-scroll-view {
  135. display: flex;
  136. flex-direction: column;
  137. }
  138. }
  139. </style>