leaveline.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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. },
  78. onLoad(options) {
  79. this.id = options.id;
  80. this.baseURL = process.env.NODE_ENV === 'development' ? devUrl : prodUrl;
  81. this.getPage();
  82. },
  83. data() {
  84. return {
  85. title: '转移路线信息',
  86. pageSize: 10,
  87. pageCurrent: 1,
  88. total: 0,
  89. list: [],
  90. query: {},
  91. adNameVal: '',
  92. leaveLineNameVal: '',
  93. inputStyles: {
  94. color: '#808080',
  95. borderColor: '#d3d3d3'
  96. },
  97. }
  98. },
  99. computed: {
  100. },
  101. onShow() {
  102. },
  103. methods: {
  104. toBack() {
  105. uni.navigateBack({
  106. delta: 1
  107. })
  108. },
  109. adNameValInput(e) {
  110. if (e == null || e.length == 0) {
  111. this.adNameVal = '';
  112. }
  113. },
  114. leaveLineNameValInput(e) {
  115. if (e == null || e.length == 0) {
  116. this.leaveLineNameVal = '';
  117. }
  118. },
  119. search() {
  120. this.pageCurrent = 1;
  121. this.getPage();
  122. },
  123. toMap(item) {
  124. let url = '/pages/yjxt/dangerarealeaveline/leavelinemap?id=' + item.id;
  125. uni.navigateTo({
  126. url: url
  127. })
  128. },
  129. pageChange(e) {
  130. this.pageCurrent = e.current;
  131. this.getPage()
  132. },
  133. getPage(params = {}) {
  134. if (this.adNameVal.length > 0) {
  135. params['adnm'] = this.adNameVal;
  136. }
  137. if (this.leaveLineNameVal.length > 0) {
  138. params['leaveLineName'] = this.leaveLineNameVal;
  139. }
  140. console.log(JSON.stringify(params))
  141. const current = this.pageCurrent;
  142. const size = this.pageSize;
  143. let postData = Object.assign(params, this.query);
  144. let that = this;
  145. http.request({
  146. url: '/galaxy-business/map/leaveline/page',
  147. method: 'GET',
  148. params: {
  149. current,
  150. size,
  151. },
  152. data: postData,
  153. }).then(res => {
  154. if (res.data.records != null) {
  155. that.list = res.data.records;
  156. }
  157. this.total = res.data.total;
  158. }).catch(err => {
  159. console.log(err)
  160. })
  161. },
  162. }
  163. }
  164. </script>
  165. <style>
  166. /* page {
  167. background-color: rgb(240, 242, 244);
  168. } */
  169. .uni-body {
  170. font-size: 0.7rem;
  171. }
  172. </style>