leaveline.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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-list>
  19. <uni-list-item v-for="item in list" :key="item.id">
  20. <template v-slot:body>
  21. <view class="list-item-block">
  22. <view class="items-line">
  23. <text class="item-title-rtu-name">{{item.dangerAreaName}}</text>
  24. </view>
  25. <view class="items-line">
  26. <uni-icons class="input-uni-icon" type="location" size="18" color="lightblue" />
  27. <text class="item-text-lable">行政区划:</text>
  28. <text class="item-text-content">{{item.adnm}}</text>
  29. </view>
  30. <view class="item-button-group">
  31. <view class="item-button" @click="toMap(item)">
  32. <view class="items-line">
  33. <uni-icons class="input-uni-icon" type="phone" size="18" color="coral" />
  34. <text class="button-text">查看地图</text>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. </template>
  40. </uni-list-item>
  41. </uni-list>
  42. <uni-group>
  43. <view class="pagination-block">
  44. <uni-pagination show-icon :pageSize="pageSize" :current="pageCurrent" :total="total"
  45. @change="pageChange" />
  46. </view>
  47. </uni-group>
  48. </view>
  49. </view>
  50. </template>
  51. <script>
  52. import http from '@/http/api.js';
  53. import {
  54. pathToBase64,
  55. base64ToPath
  56. } from '@/js_sdk/mmmm-image-tools/index.js';
  57. import {
  58. oss,
  59. devUrl,
  60. prodUrl
  61. } from '@/common/setting';
  62. export default {
  63. components: {
  64. },
  65. onLoad(options) {
  66. this.id = options.id;
  67. this.baseURL = process.env.NODE_ENV === 'development' ? devUrl : prodUrl;
  68. this.getPage();
  69. },
  70. data() {
  71. return {
  72. title: '地图测试',
  73. pageSize: 10,
  74. pageCurrent: 1,
  75. total: 0,
  76. list: [],
  77. query: {},
  78. }
  79. },
  80. computed: {
  81. },
  82. onShow() {
  83. },
  84. created() {
  85. },
  86. methods: {
  87. toBack() {
  88. uni.navigateBack({
  89. delta: 1
  90. })
  91. },
  92. toMap(item){
  93. let url = '/pages/home/leavelinemap?id=' + item.id;
  94. uni.navigateTo({
  95. url: url
  96. })
  97. },
  98. // 分页触发
  99. pageChange(e) {
  100. this.pageCurrent = e.current;
  101. this.getPage()
  102. },
  103. getPage(params = {}) {
  104. const current = this.pageCurrent;
  105. const size = this.pageSize;
  106. let postData = Object.assign(params, this.query);
  107. let that = this;
  108. http.request({
  109. url: '/galaxy-business/map/leaveline/page',
  110. method: 'GET',
  111. params: {
  112. current,
  113. size,
  114. },
  115. data: postData,
  116. }).then(res => {
  117. if (res.data.records != null) {
  118. that.list = res.data.records;
  119. }
  120. this.total = res.data.total;
  121. }).catch(err => {
  122. console.log(err)
  123. })
  124. },
  125. }
  126. }
  127. </script>
  128. <style>
  129. /* page {
  130. background-color: rgb(240, 242, 244);
  131. } */
  132. .uni-body {
  133. font-size: 0.7rem;
  134. }
  135. </style>