leaveline.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <!--
  2. * @Title:
  3. * @Description: 转移路线信息
  4. * @Author: swp
  5. * @Date: 2022-08-24 10:49:21
  6. * @LastEditors:
  7. * @LastEditTime: 2022-08-24 10:49:21
  8. -->
  9. <template>
  10. <view class="container">
  11. <uni-nav-bar dark :fixed="true" backgroundColor="#3F9EFF" statusBar="false" left-icon="left" left-text="返回"
  12. @clickLeft="toBack">
  13. <view class="nav-title">
  14. <text>{{title}}</text>
  15. </view>
  16. </uni-nav-bar>
  17. <view class="container">
  18. <uni-section title="查询" type="line">
  19. <view class="search-block">
  20. <view class="name">
  21. <uni-easyinput :styles="inputStyles" @input="adNameValInput" prefixIcon="search"
  22. v-model="adNameVal" placeholder="请输入行政区名称">
  23. </uni-easyinput>
  24. </view>
  25. <view class="name">
  26. <uni-easyinput :styles="inputStyles" @input="leaveLineNameValInput" prefixIcon="search"
  27. v-model="leaveLineNameVal" placeholder="请输入转移路线名称">
  28. </uni-easyinput>
  29. </view>
  30. <view class="submit-btn">
  31. <button type="default" @click="search">查 询</button>
  32. </view>
  33. </view>
  34. </uni-section>
  35. <uni-list>
  36. <uni-list-item v-for="item in list" :key="item.id">
  37. <template v-slot:body>
  38. <view class="list-item-block">
  39. <view class="line">
  40. <text class="title text-ellipsis">{{item.leaveLineName}}</text>
  41. </view>
  42. <view class="line">
  43. <uni-icons class="input-uni-icon" type="map-pin-ellipse" size="18" color="orangered" />
  44. <text class="lable">行政区划:</text>
  45. <text class="content">{{item.adnm}}</text>
  46. </view>
  47. <view class="item-button-group">
  48. <view class="item-button" @click="toMap(item)">
  49. <view class="items-line">
  50. <uni-icons class="input-uni-icon" type="location" size="18" color="coral" />
  51. <text class="button-text">地图查看</text>
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. </template>
  57. </uni-list-item>
  58. </uni-list>
  59. <uni-group>
  60. <view class="pagination-block">
  61. <uni-pagination show-icon :pageSize="pageSize" :current="pageCurrent" :total="total"
  62. @change="pageChange" />
  63. </view>
  64. </uni-group>
  65. </view>
  66. </view>
  67. </template>
  68. <script>
  69. import http from '@/http/api.js';
  70. import {
  71. oss,
  72. devUrl,
  73. prodUrl
  74. } from '@/common/setting';
  75. export default {
  76. components: {},
  77. data() {
  78. return {
  79. title: '转移路线信息',
  80. pageSize: 10,
  81. pageCurrent: 1,
  82. total: 0,
  83. list: [],
  84. query: {},
  85. adNameVal: '',
  86. leaveLineNameVal: '',
  87. inputStyles: {
  88. color: '#808080',
  89. borderColor: '#d3d3d3'
  90. },
  91. }
  92. },
  93. computed: {},
  94. onLoad(options) {
  95. this.id = options.id;
  96. this.baseURL = process.env.NODE_ENV === 'development' ? devUrl : prodUrl;
  97. this.getPage();
  98. },
  99. onShow() {},
  100. methods: {
  101. toBack() {
  102. uni.navigateBack({
  103. delta: 1
  104. })
  105. },
  106. adNameValInput(e) {
  107. if (e == null || e.length == 0) {
  108. this.adNameVal = '';
  109. }
  110. },
  111. leaveLineNameValInput(e) {
  112. if (e == null || e.length == 0) {
  113. this.leaveLineNameVal = '';
  114. }
  115. },
  116. search() {
  117. this.pageCurrent = 1;
  118. this.getPage();
  119. },
  120. toMap(item) {
  121. let url = '/pages/yjxt/dangerarealeaveline/leavelinemap?id=' + item.id;
  122. uni.navigateTo({
  123. url: url
  124. })
  125. },
  126. pageChange(e) {
  127. this.pageCurrent = e.current;
  128. this.getPage()
  129. },
  130. getPage(params = {}) {
  131. if (this.adNameVal.length > 0) {
  132. params['adnm'] = this.adNameVal;
  133. }
  134. if (this.leaveLineNameVal.length > 0) {
  135. params['leaveLineName'] = this.leaveLineNameVal;
  136. }
  137. console.log(JSON.stringify(params))
  138. const current = this.pageCurrent;
  139. const size = this.pageSize;
  140. let postData = Object.assign(params, this.query);
  141. let that = this;
  142. http.request({
  143. url: '/galaxy-business/map/leaveline/page',
  144. method: 'GET',
  145. params: {
  146. current,
  147. size,
  148. },
  149. data: postData,
  150. }).then(res => {
  151. if (res.data.records != null) {
  152. that.list = res.data.records;
  153. }
  154. this.total = res.data.total;
  155. }).catch(err => {
  156. console.log(err)
  157. })
  158. },
  159. }
  160. }
  161. </script>
  162. <style>
  163. .uni-body {
  164. font-size: 0.7rem;
  165. }
  166. </style>