index.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <template>
  2. <view class="content">
  3. <view class="search_input_wrap">
  4. <uni-easyinput class="search_input" v-model="queryConditions.keywords" suffixIcon="search"
  5. placeholder="请输入风险点名称/关键字" />
  6. <button type="primary" size="mini" class="search_button" @click="getListS(queryConditions)">搜索</button>
  7. </view>
  8. <view class="page-body">
  9. <roll-load :total="queryConditions.total" :size="queryConditions.limit" @lower="lower"
  10. :topBt='top' ref="roll-load" styles="height:calc(100vh - 99rpx )">
  11. <template v-slot:cont>
  12. <block></block>
  13. <uni-list v-for="(item, index) in dataList" :key="item.riskPointId">
  14. <!-- 垂直排列,无略缩图,主标题+副标题显示 -->
  15. <view @click="riskPointInfo(item.riskPointId)">
  16. <uni-list-item direction="column">
  17. <template v-slot:header>
  18. <view class="uni-title">{{item.riskPointTitle}}</view>
  19. </template>
  20. <template v-slot:body>
  21. <view class="uni-list-box">
  22. <view class="uni-content">
  23. <view class="uni-title-sub uni-ellipsis-2">
  24. 部门:{{item.groupName}}
  25. </view>
  26. <view class="uni-note">等级:{{item.riskPointLevel}}</view>
  27. </view>
  28. </view>
  29. </template>
  30. </uni-list-item>
  31. </view>
  32. </uni-list>
  33. </template>
  34. </roll-load>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. import { getEntRiskPointInfo } from '@/api/entRiskPoint.js';
  40. import RollLoad from '@/components/RollLoad/index.vue';
  41. import { deepClone } from '@/libs'
  42. export default {
  43. components: {
  44. RollLoad
  45. },
  46. data() {
  47. return {
  48. scrollTop: 0,
  49. old: {
  50. scrollTop: 0
  51. },
  52. top: {
  53. show: true,
  54. style:"top:95%"
  55. },
  56. pageNumber: 1,
  57. items: [],
  58. dataList: [],
  59. queryConditions: {
  60. page: 1,
  61. limit: 10,
  62. total: 0,
  63. keywords: '',
  64. status: '',
  65. source: '',
  66. groupId: ''
  67. }
  68. }
  69. },
  70. onLoad(options) {
  71. this.getList(this.queryConditions);
  72. },
  73. methods: {
  74. //跳转风险点详情页面
  75. riskPointInfo(id) {
  76. uni.navigateTo({
  77. url: '/views/entRiskPoint/details/details?id=' + id,
  78. })
  79. },
  80. lower: function(e) {
  81. if (e.status) {
  82. this.queryConditions.page = e.pageNumber
  83. this.getList(this.queryConditions);
  84. }
  85. },
  86. scroll: function(e) {
  87. this.old.scrollTop = e.detail.scrollTop
  88. },
  89. goTop: function(e) {
  90. this.scrollTop = this.old.scrollTop
  91. this.$nextTick(() => {
  92. this.scrollTop = 0
  93. });
  94. uni.showToast({
  95. icon: "none",
  96. title: "已经到顶了!"
  97. })
  98. },
  99. //数据请求分页列表
  100. getList(query) {
  101. getEntRiskPointInfo(query).then((res) => {
  102. this.$set(query, 'total', res.total)
  103. let items = deepClone(this.dataList);
  104. this.dataList = items.concat(res.data);
  105. })
  106. },
  107. getListS(query) {
  108. this.dataList = [];
  109. this.queryConditions = query
  110. this.queryConditions.page = 1
  111. this.getList(this.queryConditions);
  112. }
  113. }
  114. }
  115. </script>
  116. <style lang="scss" scoped>
  117. .select {
  118. border: 1px solid #cfcfcf;
  119. border-radius: 20px;
  120. }
  121. .list {
  122. padding: 10upx 10upx;
  123. scroll-view {
  124. height: calc(100vh - 126px);
  125. }
  126. .item {
  127. border: 1px solid #ccc;
  128. margin-bottom: 10upx;
  129. padding: 5upx 5upx;
  130. border: 2px solid #dedede;
  131. border-radius: 15upx;
  132. box-shadow: 2px 2px 2px #aaaaaa;
  133. position: relative;
  134. .title {
  135. display: flex;
  136. justify-content: flex-start;
  137. padding-bottom: 10upx;
  138. .name {
  139. font-size: 30upx;
  140. padding-left: 10upx;
  141. }
  142. }
  143. .cont {
  144. color: #999999;
  145. }
  146. .more {
  147. height: 40upx;
  148. position: absolute;
  149. right: 10upx;
  150. top: 50%;
  151. transform: translateY(-50%);
  152. display: flex;
  153. justify-content: center;
  154. align-items: center;
  155. .icon {
  156. width: 20upx;
  157. height: 20upx;
  158. background-color: red;
  159. padding-right: 10aaupx;
  160. }
  161. }
  162. }
  163. }
  164. .search_input {
  165. width: 72%;
  166. margin: 10upx;
  167. border: 2px solid #00aaff;
  168. border-radius: 8px;
  169. }
  170. .search_button {
  171. width: 160upx;
  172. height: 80upx;
  173. text-align: center;
  174. line-height: 80upx;
  175. font-size: 17px;
  176. background-image: linear-gradient(#00aaff, #3384ff);
  177. margin-left: 10upx;
  178. padding: 0;
  179. }
  180. .search_input_wrap {
  181. height: 100upx;
  182. display:flex;
  183. justify-content: center;
  184. align-items: center;
  185. padding: 10upx;
  186. background-color: #fff;
  187. }
  188. </style>