index.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <template>
  2. <view class="content">
  3. <view class="cont-box">
  4. <view class="page">
  5. <view :class="current===item.current?'isSelect':'select'" class="dataName" v-for="item in pageList"
  6. :key="item.current" @click="handelChange(item.current)">
  7. {{item.name}}
  8. </view>
  9. </view>
  10. <!-- 报表查询 -->
  11. <reportQuery v-if="current===0" :reportList="reportList" :queryParams="queryParams" @reset="reset"
  12. @handelDate="handelDate" :key="key" />
  13. <!-- 点位查询 -->
  14. <dataItem v-else />
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. import reportQuery from './report-query.vue'
  20. import dataItem from './data-item.vue'
  21. export default {
  22. components: {
  23. reportQuery,
  24. dataItem
  25. },
  26. data() {
  27. return {
  28. // 查询参数
  29. queryParams: {
  30. page: 1,
  31. limit: 20,
  32. reportTableName: null
  33. },
  34. // 列表数据
  35. reportList: [],
  36. // 分页器
  37. pageList: [{
  38. name: '报表查询',
  39. current: 0
  40. },
  41. {
  42. name: '点位查询',
  43. current: 1
  44. }
  45. ],
  46. current: 0,
  47. key: 0
  48. };
  49. },
  50. onShow() {
  51. this.key++
  52. this.queryParams.limit = 20
  53. uni.pageScrollTo({
  54. scrollTop: 0,
  55. duration: 0
  56. })
  57. },
  58. onPullDownRefresh() {
  59. this.queryParams.limit = 20
  60. uni.stopPullDownRefresh()
  61. },
  62. onReachBottom() {
  63. this.queryParams.limit += 10
  64. },
  65. methods: {
  66. // 切换数据项查询
  67. handelChange(current) {
  68. this.current = current
  69. console.log(this.current)
  70. },
  71. //重置查询条件
  72. reset() {
  73. this.queryParams = {
  74. page: 1,
  75. limit: 20,
  76. reportName: null
  77. }
  78. },
  79. //选中时间
  80. handelDate(val) {
  81. // this.queryParams.range = val
  82. }
  83. }
  84. }
  85. </script>
  86. <style lang="scss" scoped>
  87. ::v-deep .uni-list-item__container {
  88. padding: 40rpx 60rpx;
  89. }
  90. ::v-deep .uni-list-item__content-title {
  91. font-size: 34rpx;
  92. }
  93. ::v-deep .uniui-arrowright {
  94. font-size: 40rpx !important;
  95. padding-right: 54rpx !important;
  96. }
  97. ::v-deep .uni-list-item__icon-img {
  98. width: 86rpx;
  99. height: 86rpx;
  100. }
  101. ::v-deep .uniui-calendar {
  102. display: none;
  103. }
  104. ::v-deep .uni-date-x--border {
  105. border: none;
  106. }
  107. ::v-deep .uni-date__x-input {
  108. background: #ECECEC;
  109. }
  110. ::v-deep .uni-date-x .range-separator {
  111. height: 36px !important;
  112. padding: 0 15px !important;
  113. line-height: 34px !important;
  114. transform: scale(2.5);
  115. color: #ECECEC;
  116. }
  117. .cont-box {
  118. margin-top: 20rpx;
  119. .page {
  120. display: flex;
  121. justify-content: space-around;
  122. align-items: center;
  123. border-bottom: 2rpx solid #EEEEEE;
  124. font-weight: bold;
  125. .select {
  126. color: #5A5A5A;
  127. border-bottom: none;
  128. }
  129. .isSelect {
  130. border-bottom: 8rpx solid #2F9BFD;
  131. color: #2F9BFD;
  132. }
  133. .dataName {
  134. padding: 20rpx 0;
  135. }
  136. }
  137. }
  138. .empty {
  139. width: 400rpx;
  140. height: 400rpx;
  141. position: absolute;
  142. top: 50%;
  143. left: 50%;
  144. margin-top: -280rpx !important;
  145. margin-left: -200rpx;
  146. }
  147. .line {
  148. height: 10rpx;
  149. width: 100%;
  150. background: #EEEDF2;
  151. }
  152. </style>