yjwarnlist.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  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="wrap">
  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="line" @click="toWarnDetailView(item)">
  23. <view class="block">
  24. <uni-icons class="input-uni-icon" type="notification" size="18" color="red" />
  25. </view>
  26. <text class="title text-ellipsis text-underline"
  27. style="color: blue;">{{item.warnName}}</text>
  28. </view>
  29. <view class="line">
  30. <text class="text text-ellipsis" style="color: gray;">预警信息:{{item.warnInfo}}</text>
  31. </view>
  32. <view class="line">
  33. <text class="text text-ellipsis" style="color: gray;">预警时间:{{item.warnTime}}</text>
  34. </view>
  35. <view class="line">
  36. <text class="text text-ellipsis"
  37. style="color: gray;">应转移人员:{{item.totalTransferPerson}}</text>
  38. </view>
  39. <view class="line">
  40. <text class="text text-ellipsis"
  41. style="color: gray;">已转移:{{item.safetyTransferPerson}}</text>
  42. </view>
  43. <uni-row>
  44. <uni-col :span="8">
  45. <image style="height: 80px;" :src="toOss(item.warnQrUrl)" mode="heightFix"
  46. @click="toFullQrImage(item)"></image>
  47. </uni-col>
  48. <uni-col :span="16">
  49. <view class="item-button-group">
  50. <view class="item-button" @click="onDangerAreaCheckClick(item)">
  51. <view class="view-flex-inline-center">
  52. <uni-icons class="input-uni-icon" type="map-pin-ellipse" size="18"
  53. color="coral" />
  54. <text class="button-text">巡查</text>
  55. </view>
  56. </view>
  57. <view class="item-button" @click="onTransferRecordClick(item)">
  58. <view class="view-flex-inline-center">
  59. <uni-icons class="input-uni-icon" type="auth" size="18" color="coral" />
  60. <text class="button-text">转移登记</text>
  61. </view>
  62. </view>
  63. <view class="item-button" @click="onTransferResidentListClick(item)">
  64. <view class="view-flex-inline-center">
  65. <uni-icons class="input-uni-icon" type="staff" size="18"
  66. color="coral" />
  67. <text class="button-text">转移清单</text>
  68. </view>
  69. </view>
  70. </view>
  71. </uni-col>
  72. </uni-row>
  73. </view>
  74. </template>
  75. </uni-list-item>
  76. </uni-list>
  77. <uni-group>
  78. <view class="pagination-block">
  79. <uni-pagination show-icon :pageSize="pageSize" :current="pageCurrent" :total="total"
  80. @change="pageChange" />
  81. </view>
  82. </uni-group>
  83. </view>
  84. </view>
  85. </template>
  86. <script>
  87. import {
  88. role
  89. } from "@/api/role.js";
  90. import {
  91. oss
  92. } from '@/common/setting';
  93. import http from '@/http/api.js';
  94. export default {
  95. components: {},
  96. data() {
  97. return {
  98. title: '预警响应',
  99. pageSize: 10,
  100. pageCurrent: 1,
  101. baseOSS: '',
  102. total: 0,
  103. list: [],
  104. query: {},
  105. }
  106. },
  107. computed: {},
  108. onLoad(option) {
  109. this.baseOSS = oss;
  110. this.query = {};
  111. this.query['warnStatus'] = 5;
  112. this.getPage();
  113. },
  114. onShow() {},
  115. methods: {
  116. toOss(path) {
  117. return this.baseOSS + path;
  118. },
  119. //返回上一页
  120. toBack() {
  121. uni.navigateBack({
  122. delta: 1
  123. })
  124. },
  125. onBackPress() {
  126. // #ifdef APP-PLUS
  127. plus.key.hideSoftKeybord();
  128. // #endif
  129. },
  130. // 分页触发
  131. pageChange(e) {
  132. this.pageCurrent = e.current;
  133. this.getPage()
  134. },
  135. onDangerAreaCheckClick(item) {
  136. let url =
  137. '/pages/yjxt/check/dangerareacheck?type=2&id=' + item.warnId;
  138. uni.navigateTo({
  139. url: url
  140. })
  141. },
  142. onTransferRecordClick(item) {
  143. let url = '/pages/yjxt/transfer/residenttransferrecord?id=' + item.warnId;
  144. uni.navigateTo({
  145. url: url
  146. })
  147. },
  148. onTransferResidentListClick(item) {
  149. let url = '/pages/yjxt/transfer/transferresidentlist?id=' + item.warnId;
  150. uni.navigateTo({
  151. url: url
  152. })
  153. },
  154. toWarnDetailView(item) {
  155. uni.navigateTo({
  156. url: '/pages/yjxt/warn/yjwarndetail?id=' + item.id
  157. })
  158. },
  159. toFullQrImage(item) {
  160. uni.navigateTo({
  161. url: '/pages/yjxt/warn/yjwarnqr?id=' + item.id
  162. })
  163. },
  164. getPage(params = {}) {
  165. const current = this.pageCurrent;
  166. const size = this.pageSize;
  167. let postData = Object.assign(params, this.query);
  168. let that = this;
  169. http.request({
  170. url: '/galaxy-business/yj/warn/page',
  171. method: 'GET',
  172. params: {
  173. current,
  174. size,
  175. },
  176. data: postData,
  177. }).then(res => {
  178. if (res.data.records != null) {
  179. that.list = res.data.records;
  180. }
  181. this.total = res.data.total;
  182. }).catch(err => {
  183. console.log(err)
  184. })
  185. },
  186. }
  187. }
  188. </script>
  189. <style lang="scss" scoped>
  190. </style>