index.vue 2.9 KB

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