error.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <template>
  2. <view class="work-container">
  3. <view style="margin-top: 10px">
  4. <uni-card v-for="item in alertList" :title="item.deviceName" :extra="item.createTime">
  5. <view style="position: relative">
  6. <view>上报人:{{item.userName}}</view>
  7. <view>上报内容:{{item.desc}}</view>
  8. <view v-if="item.status == 3">状态:已处理</view>
  9. <view v-if="item.status != 3">状态:未处理</view>
  10. <view v-if="item.status == 3" style="width: 50px;position: absolute;right:-10px;bottom:0px"><u-button @click="watchResult(item)" type="primary" :plain="true" size="mini" text="查看结果"></u-button>
  11. </view>
  12. <!-- <view v-if="item.status != 3" style="width: 50px;position: absolute;right:-10px;bottom:0px"><u-button @click="handle(item)" type="error" :plain="true" size="mini" text="处理"></u-button>-->
  13. <!-- </view>-->
  14. </view>
  15. </uni-card>
  16. <uni-load-more @clickLoadMore="getMore" :contentText="contenText" :status="loadStatus"></uni-load-more>
  17. <u-modal :show="showErrDlg" title="处理结果" @confirm="close" >
  18. <view class="slot-content">
  19. <u--textarea style="width:500rpx" autoheight v-model="chooseItem.result" disabled="" ></u--textarea>
  20. </view>
  21. </u-modal>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. import {errorList} from '@/api/device/device';
  27. import UText from "../../uni_modules/uview-ui/components/u-text/u-text";
  28. export default {
  29. components: {UText},
  30. data() {
  31. return {
  32. show:true,
  33. alertList:[],
  34. search:{
  35. deptName:""
  36. },
  37. alertLevel:['提醒通知','轻微问题','严重警告'],
  38. pageNum:1,
  39. pageSize:10,
  40. chooseItem: {},
  41. contenText:{contentdown: "点击加载更多",contentrefresh: "正在加载...",contentnomore: "没有更多数据了"},
  42. loadStatus:"more",
  43. showErrDlg:false,
  44. }
  45. },
  46. onLoad(){
  47. this.getAlertList();
  48. },
  49. methods: {
  50. getMore(){
  51. this.pageNum ++;
  52. this.getAlertList();
  53. },
  54. open(item) {
  55. this.chooseItem = item;
  56. this.showErrDlg = true;
  57. },
  58. close() {
  59. this.chooseItem = {};
  60. this.showErrDlg = false;
  61. },
  62. confirm(text){
  63. if(!text){
  64. uni.showToast({
  65. icon:"error",
  66. title:"请输入内容"
  67. })
  68. return;
  69. }
  70. let item = this.chooseItem;
  71. item.remark = text;
  72. this.close();
  73. handleAlert(item).then(res=>{
  74. if(res.code == 200){
  75. item.status = 3;
  76. }
  77. })
  78. },
  79. searchDept(){
  80. this.getDeptList();
  81. },
  82. watchResult(item){
  83. this.open(item);
  84. },
  85. handle(item){
  86. this.open(item);
  87. },
  88. getAlertList(){
  89. this.loadStatus = "loading"
  90. errorList(this.pageNum,this.pageSize).then(res=>{
  91. if(res.total == this.alertList.length){
  92. uni.showToast({
  93. icon:"none",
  94. title:"没有更多了"
  95. })
  96. this.loadStatus = "noMore"
  97. return;
  98. }
  99. this.loadStatus = "more"
  100. this.alertList = this.alertList.concat(res.rows);
  101. });
  102. }
  103. }
  104. }
  105. </script>
  106. <style lang="scss">
  107. /* #ifndef APP-NVUE */
  108. .u-collapse-content{
  109. display: flex;
  110. flex-direction: column;
  111. }
  112. page {
  113. display: flex;
  114. flex-direction: column;
  115. box-sizing: border-box;
  116. background-color: #fff;
  117. min-height: 100%;
  118. height: auto;
  119. }
  120. view {
  121. font-size: 14px;
  122. line-height: inherit;
  123. }
  124. /* #endif */
  125. .text {
  126. text-align: center;
  127. font-size: 26rpx;
  128. margin-top: 10rpx;
  129. }
  130. .grid-item-box {
  131. flex: 1;
  132. /* #ifndef APP-NVUE */
  133. display: flex;
  134. /* #endif */
  135. flex-direction: column;
  136. align-items: center;
  137. justify-content: center;
  138. padding: 15px 0;
  139. }
  140. .uni-margin-wrap {
  141. width: 690rpx;
  142. width: 100%;
  143. ;
  144. }
  145. .swiper {
  146. height: 300rpx;
  147. }
  148. .swiper-box {
  149. height: 150px;
  150. }
  151. .swiper-item {
  152. /* #ifndef APP-NVUE */
  153. display: flex;
  154. /* #endif */
  155. flex-direction: column;
  156. justify-content: center;
  157. align-items: center;
  158. color: #fff;
  159. height: 300rpx;
  160. line-height: 300rpx;
  161. }
  162. @media screen and (min-width: 500px) {
  163. .uni-swiper-dot-box {
  164. width: 400px;
  165. /* #ifndef APP-NVUE */
  166. margin: 0 auto;
  167. /* #endif */
  168. margin-top: 8px;
  169. }
  170. .image {
  171. width: 100%;
  172. }
  173. }
  174. </style>