rtuwarninglist.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. <template>
  2. <view class="wrap">
  3. <uni-nav-bar dark :fixed="true" backgroundColor="#3F9EFF" statusBar="false" left-icon="left" left-text="返回"
  4. @clickLeft="toBack">
  5. <view style="width: 100%;display: flex;flex-direction: row;justify-content: center;align-items: center;">
  6. <text style="color: white;font-size: 1rem;">{{title}}</text>
  7. </view>
  8. </uni-nav-bar>
  9. <view class="container">
  10. <uni-list>
  11. <uni-list-item v-for="item in list" :key="item.id">
  12. <template v-slot:body>
  13. <view style="min-height: 110px;width: 100%;display: flex;flex-direction: column;">
  14. <view style="display: flex;flex-direction: row;align-items: center;">
  15. <image class="order-title-image" src="/static/images/icon_warning.png" mode="widthFix">
  16. </image>
  17. <text style="margin-left: 5px;font-size: 1rem;">{{item.rtuName}}</text>
  18. <text style="margin-left: 5px;font-size: 0.9rem;">[{{item.rtuCode}}]</text>
  19. </view>
  20. <view style="display: flex;flex-direction: row;align-items: center;">
  21. <view style="font-size: 0.7rem;">预警时间:</view>
  22. <view style="margin-left:10px;font-size: 0.7rem;">
  23. {{item.warningHappenTime}}
  24. </view>
  25. </view>
  26. <view style="display: flex;flex-direction: row;align-items: center;">
  27. <view style="font-size: 0.7rem;">恢复时间:</view>
  28. <view v-if="item.warningRecoveryTime!=null"
  29. style="margin-left:10px;font-size: 0.7rem;">{{item.warningRecoveryTime}}
  30. </view>
  31. </view>
  32. <view style="margin-top: 0px;display: flex;flex-direction: row;align-items: center;">
  33. <!-- <uIcons class="input-uni-icon" type="notification" size="18" color="#999" /> -->
  34. <text style="font-size: 0.7rem;">{{item.warningDesc}}</text>
  35. </view>
  36. <view style="margin-top:4px;display: flex;flex-direction: row;justify-content: flex-end;">
  37. <view
  38. style="display:flex;flex-direction: row;justify-content: center;width: 90px;height:28px;margin-right: 10px;border-radius:7px;background-color:lightblue"
  39. @click="toWarningPage(item.id)">
  40. <view style="display:flex;flex-direction: column;justify-content: center;">
  41. <uIcons class="input-uni-icon" type="info" size="18" color="coral" />
  42. </view>
  43. <view
  44. style="display:flex;flex-direction: column;justify-content: center;padding-left:5px;">
  45. <text style="color:black;font-size:0.6rem">预警详情</text>
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. </template>
  51. </uni-list-item>
  52. </uni-list>
  53. <uGroup>
  54. <view class="uni-pagination-box">
  55. <uPagination show-icon :page-size="pageSize" :current="pageCurrent" :total="total"
  56. @change="change" />
  57. </view>
  58. </uGroup>
  59. </view>
  60. <u-gap height="70"></u-gap>
  61. </view>
  62. </template>
  63. <script>
  64. // import pageNav from '@/components/page-nav/page-nav.vue';
  65. import http from '@/http/api.js';
  66. import uNavBar from '@/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-nav-bar.vue'
  67. import uDataPicker from '@/uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.vue'
  68. import uGroup from '@/uni_modules/uni-group/uni-group.vue'
  69. import uSection from '@/uni_modules/uni-section/uni-section.vue'
  70. import uPagination from '@/uni_modules/uni-pagination/components/uni-pagination/uni-pagination.vue'
  71. import uBreadcrumb from '@/uni_modules/uni-breadcrumb/components/uni-breadcrumb/uni-breadcrumb.vue'
  72. import uList from '@/uni_modules/uni-list/components/uni-list/uni-list.vue'
  73. import uListItem from '@/uni_modules/uni-list/components/uni-list-item/uni-list-item.vue'
  74. import uIcons from '@/uni_modules/uni-icons/components/uni-icons/uni-icons.vue'
  75. export default {
  76. name: '',
  77. components: {
  78. uNavBar,
  79. uList,
  80. uListItem,
  81. uIcons,
  82. uGroup,
  83. uPagination,
  84. uBreadcrumb
  85. },
  86. onLoad(option) {
  87. this.rtuCode = option.rtuCode;
  88. },
  89. data() {
  90. return {
  91. list: [],
  92. title: '测站预警信息',
  93. desc: '',
  94. rtuCode: '',
  95. pageSize: 10,
  96. // 当前页
  97. pageCurrent: 1,
  98. // 数据总量
  99. total: 0,
  100. }
  101. },
  102. computed: {
  103. getIcon() {
  104. return path => {
  105. return 'https://cdn.uviewui.com/uview/example/' + path + '.png';
  106. }
  107. },
  108. },
  109. onShow() {
  110. // uni.setNavigationBarTitle({
  111. // title: ""
  112. // });
  113. this.loadList();
  114. },
  115. created() {
  116. },
  117. methods: {
  118. toBack() {
  119. uni.navigateBack({
  120. delta: 1
  121. })
  122. },
  123. loadList() {
  124. var that = this;
  125. const current = this.pageCurrent;
  126. const size = this.pageSize;
  127. const isSubmit = '0';
  128. var formdata = {};
  129. formdata['rtuCode'] = this.rtuCode;
  130. http.request({
  131. url: '/galaxy-test/rtu/warning/page',
  132. method: 'GET',
  133. data: formdata,
  134. params: {
  135. current,
  136. size,
  137. isSubmit
  138. },
  139. }).then(res => {
  140. if (res.data.records != null) {
  141. that.list = res.data.records;
  142. }
  143. this.total = res.data.total;
  144. }).catch(err => {
  145. console.log(err)
  146. })
  147. },
  148. toWarningPage(id) {
  149. var url = '/pages/warning/warninginfodetail?id=' + id;
  150. uni.navigateTo({
  151. url: url
  152. })
  153. },
  154. }
  155. }
  156. </script>
  157. <style>
  158. /* page {
  159. background-color: rgb(240, 242, 244);
  160. } */
  161. </style>
  162. <style lang="scss" scoped>
  163. .u-cell-icon {
  164. width: 36rpx;
  165. height: 36rpx;
  166. margin-right: 8rpx;
  167. }
  168. .order-title-image {
  169. /* #ifndef APP-NVUE */
  170. display: block;
  171. /* #endif */
  172. // margin-right: 10px;
  173. width: 25px;
  174. height: 25px;
  175. border-radius: 50%;
  176. }
  177. .slot-box {
  178. /* #ifndef APP-NVUE */
  179. display: flex;
  180. /* #endif */
  181. flex-direction: row;
  182. align-items: center;
  183. }
  184. .slot-image {
  185. /* #ifndef APP-NVUE */
  186. display: block;
  187. /* #endif */
  188. margin-right: 10px;
  189. width: 30px;
  190. height: 30px;
  191. }
  192. .slot-text {
  193. flex: 1;
  194. font-size: 14px;
  195. color: #4cd964;
  196. margin-right: 10px;
  197. }
  198. .content-box {
  199. flex: 1;
  200. /* #ifdef APP-NVUE */
  201. justify-content: center;
  202. /* #endif */
  203. height: 100%;
  204. line-height: 44px;
  205. padding: 0 15px;
  206. position: relative;
  207. background-color: #fff;
  208. border-bottom-color: #f5f5f5;
  209. border-bottom-width: 1px;
  210. border-bottom-style: solid;
  211. }
  212. .content-text {
  213. font-size: 15px;
  214. }
  215. .example-body {
  216. /* #ifndef APP-NVUE */
  217. display: flex;
  218. /* #endif */
  219. flex-direction: row;
  220. justify-content: center;
  221. padding: 10px 0;
  222. background-color: #fff;
  223. }
  224. .button {
  225. border-color: #e5e5e5;
  226. border-style: solid;
  227. border-width: 1px;
  228. padding: 4px 8px;
  229. border-radius: 4px;
  230. }
  231. .button-text {
  232. font-size: 15px;
  233. }
  234. .slot-button {
  235. /* #ifndef APP-NVUE */
  236. display: flex;
  237. height: 100%;
  238. /* #endif */
  239. flex: 1;
  240. flex-direction: row;
  241. justify-content: center;
  242. align-items: center;
  243. padding: 0 20px;
  244. background-color: #ff5a5f;
  245. }
  246. .slot-button-text {
  247. color: #ffffff;
  248. font-size: 14px;
  249. }
  250. </style>