WarningPileList.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <template>
  2. <view>
  3. <image src="https://cczdsz.cn/app/images//background-from.png" mode="" class="background"></image>
  4. <view>
  5. <view class="sousuo">
  6. <u-search placeholder="请输入阀井名称" @click="showName=true" v-model="valveWellName" :show-action="false"@search="getProjectList()" ></u-search>
  7. <!-- <u-select v-model="showName" :list="workList" label-name="name" value-name="id" @confirm="worker()" @cancel="cancelWorker()"></u-select>
  8. <u-search placeholder="请输入巡检柱名称" v-model="name" :show-action="false" :action-style="{'font-size':'40rpx'}"
  9. @search="getProjectList()"></u-search> -->
  10. <u-search placeholder="请输入阀井位置" @click="showName=true" v-model="position" :show-action="false" @search="getProjectList()"></u-search>
  11. </view>
  12. <view v-for="(item,index) in list" :key="index">
  13. <view class="project-content houseList" @click="gotoindex(item)">
  14. <view class="font-forty-eight houseList_in">
  15. <span>{{item.valveWellName}}<span style="font-size: 20rpx;">({{item.position}})</span></span>
  16. <u-icon name="arrow-right"></u-icon>
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. import service from '@/api/index.js'
  25. export default {
  26. data() {
  27. return {
  28. params: {
  29. year: true,
  30. month: true,
  31. day: true,
  32. hour: true,
  33. minute: false,
  34. pageNum: 1, // 初始化页码为1
  35. totalPage: null, // 总共有多少页数据
  36. isLoadingMore: false, // 标记正在加载更多数据
  37. second: false
  38. },
  39. showName:false,
  40. showTime: false,
  41. list: [],
  42. workList: [],
  43. value: '',
  44. nameValue: '',
  45. name:'',
  46. valveWellName:'',
  47. civilPower: '',
  48. form:{},
  49. position:'',
  50. userId:''
  51. }
  52. },
  53. onLoad() {
  54. this.getUserName();
  55. //this.getWorker();
  56. uni.setNavigationBarColor({
  57. frontColor: '#ffffff',
  58. backgroundColor: '#2d95f4',
  59. })
  60. },
  61. methods: {
  62. getWorker()
  63. {
  64. service.getWorker({type:'1',name:''}).then(res => {
  65. this.workList=res
  66. })
  67. },
  68. worker(e)
  69. {
  70. this.valveWellName=e[0].label
  71. this.position=e[0].value
  72. this.getProjectList()
  73. },
  74. cancelWorker()
  75. {
  76. this.valveWellName=''
  77. this.position=''
  78. },
  79. time(e)
  80. {
  81. this.form.time=e
  82. },
  83. gotoindex(item) {
  84. console.log(item)
  85. uni.navigateTo({
  86. url:`/pages/noLogin/valveWellInspection/valveWellInspection?valveWellName=${item.valveWellName}&position=${item.position}&id=${item.id}&managementOfficeId=${item.id}&type=2`
  87. })
  88. },
  89. topage(url) {
  90. uni.navigateTo({
  91. url
  92. })
  93. },
  94. onReachBottom() {
  95. if(this.params.pageNum * 10 < this.params.totalPage){
  96. this.isLoadingMore = true; // 开始加载状态
  97. setTimeout(()=>{
  98. this.params.pageNum++; // 每次加载完成后自增页码
  99. this.getProjectList(); // 再次请求数据
  100. },100); // 模拟异步操作需要等待一段时间才能返回数据
  101. }
  102. },
  103. getProjectList() {
  104. service.getvalveWellPositionlist({remark:this.userId,valveWellName:this.valveWellName,position:this.position,pageNum: this.params.pageNum , pageSize: 10}).then(res => {
  105. console.log(res)
  106. if (res.total == 0) {
  107. this.$UTILS.showPrompt('暂无项目!')
  108. }
  109. if(this.params.pageNum === 1){
  110. this.params.totalPage = res.total; // 设置总页数
  111. this.list = []; // 清空之前的数据
  112. }
  113. const newData = res.rows || [];
  114. this.list = [...this.list, ...newData]; // 将新数据添加到已有数据的尾部
  115. this.isLoadingMore = false;
  116. })
  117. },
  118. getUserName() {
  119. service.getUserName().then(res => {
  120. this.userId=res.id
  121. this.civilPower = res.civilPower;
  122. this.getProjectList();
  123. })
  124. },
  125. },
  126. }
  127. </script>
  128. <style lang="scss" scoped>
  129. .background {
  130. z-index: -1;
  131. position: fixed;
  132. width: 100%;
  133. height: 100%;
  134. background-size: 100% 100%;
  135. }
  136. .project {
  137. border-radius: 72rpx;
  138. padding: 25rpx 0;
  139. text-align: center;
  140. margin: 170rpx 55rpx 0;
  141. }
  142. .project-content {
  143. width: 90%;
  144. margin: 40rpx auto;
  145. padding: 30rpx 20rpx;
  146. border-radius: 20rpx;
  147. background: #edf5ff;
  148. box-shadow: 0rpx 6rpx 8rpx #d3e6ff;
  149. }
  150. .houseList_in{
  151. display: flex;
  152. justify-content:space-between;
  153. align-items:center;
  154. color: #cbcbcb;
  155. font-size: 38rpx;
  156. }
  157. .houseList_in span{
  158. font-size: 36rpx;
  159. color: #333;
  160. }
  161. .sousuo{
  162. display: flex;
  163. justify-content:space-between;
  164. align-items:center;
  165. }
  166. .position {
  167. position: absolute;
  168. bottom: 100rpx;
  169. right: 50rpx;
  170. .arrow {
  171. width: 152rpx;
  172. height: 152rpx;
  173. border-radius: 50%;
  174. padding: 25rpx;
  175. margin-left: 20rpx;
  176. }
  177. }
  178. </style>