abnormalAlarmDetails.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  1. <template>
  2. <view>
  3. <u-navbar title="异常报警详情" title-color="#101010"></u-navbar>
  4. <view class="main">
  5. <view class="item">
  6. <view class="title">
  7. 报警单号:A100001
  8. </view>
  9. <view class="value">
  10. <text class="reason">温度异常</text>
  11. </view>
  12. </view>
  13. <view class="item">
  14. <view class="title">
  15. 报警设备
  16. </view>
  17. <view class="value equipment">
  18. 荆鹏集团-荆鹏软件园01
  19. </view>
  20. </view>
  21. <view class="item">
  22. <view class="title">
  23. 报警内容
  24. </view>
  25. <view class="value warning">
  26. 温度过高 120°C
  27. </view>
  28. </view>
  29. <view class="item">
  30. <view class="title">
  31. 地址
  32. </view>
  33. <view class="value ">
  34. 沙市区江津东路附155号
  35. </view>
  36. </view>
  37. <view class="item">
  38. <view class="title">
  39. 报警内容
  40. </view>
  41. <view class="value">
  42. 2024-02-04 20:00:00
  43. </view>
  44. </view>
  45. <!-- 异常记录 -->
  46. <view class="record-chat">
  47. <view class="title">
  48. 异常记录
  49. </view>
  50. <view class="chat-box">
  51. <view class="date">
  52. 2月4日温度监控
  53. </view>
  54. <view class="chat">
  55. <view id="lineEcharts" style="min-height:400rpx;">
  56. </view>
  57. <!-- <image class="img" src="@/assets/img/recordChat.png" mode=""></image> -->
  58. </view>
  59. </view>
  60. </view>
  61. </view>
  62. <!-- 底部 -->
  63. <view class="bottom">
  64. <button class="close" @click="closeShow=true">关闭警报</button>
  65. <button class="create" @click="gotoUrl('/pages/workOrderManagement/faultReport')">创建工单</button>
  66. </view>
  67. <!-- 关闭原因 -->
  68. <u-popup v-model="closeShow" mode="bottom" closeable close-icon-size="24" close-icon-color="#101010"
  69. border-radius="24">
  70. <view class="close-reason">
  71. <view class="title">
  72. 请选择关闭原因:
  73. </view>
  74. <view class="reason-content">
  75. <view class="reason-item" v-for="(item,index) in reasonList" :key="index">
  76. <view class="item-title">
  77. {{item}}
  78. </view>
  79. <view class="item-value" @click="reasonClick(item,index)">
  80. <label class="radio">
  81. <radio name="reason" :checked="index === current" /><text></text>
  82. </label>
  83. </view>
  84. </view>
  85. </view>
  86. <view class="button-box">
  87. <button class="think" @click="closeShow=false">我在想想</button>
  88. <button class="confirm" @click="closeWorkOrder">确认关闭</button>
  89. </view>
  90. </view>
  91. </u-popup>
  92. </view>
  93. </template>
  94. <script>
  95. import * as echarts from 'echarts';
  96. export default {
  97. data() {
  98. return {
  99. closeShow: false,
  100. reasonList: ['错误告警','设备已自动恢复','不需要上门解决','平台移桩,可忽视','其他'],
  101. current: 0,
  102. myLineChart: null
  103. }
  104. },
  105. onReady() {
  106. this.getLineCharts();
  107. },
  108. methods: {
  109. getLineCharts() {
  110. if (!this.myLineChart) {
  111. this.myLineChart = echarts.init(document.getElementById('lineEcharts'), null, {
  112. width: uni.upx2px(686),
  113. height: uni.upx2px(400)
  114. });
  115. }
  116. this.myLineChart.clear();
  117. var data1 = ['0-2点', '3-4点', '5-6点', '7-8点', '9-10点', '11-12点', '13-14点', '15-16点',
  118. '17-18点', '19-20点', '21-22点', '23-24点'
  119. ];
  120. var data2 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
  121. var option = {
  122. tooltip: {
  123. trigger: 'axis',
  124. axisPointer: {
  125. type: 'shadow'
  126. }
  127. },
  128. legend: {
  129. show: false
  130. },
  131. grid: {
  132. top: '6%',
  133. left: '3%',
  134. right: '8%',
  135. bottom: '8%',
  136. containLabel: true
  137. },
  138. xAxis: {
  139. type: 'category',
  140. data: data1,
  141. axisLabel: {
  142. rotate: 40,
  143. interval: 0,
  144. textStyle: {
  145. color: "#333"
  146. }
  147. },
  148. },
  149. yAxis: {
  150. type: 'value',
  151. axisLabel: {
  152. formatter: '{value} °C'
  153. }
  154. },
  155. series: [{
  156. name: '温度',
  157. type: 'line',
  158. data: data2,
  159. itemStyle: {
  160. color: '#F39423'
  161. }
  162. }]
  163. };
  164. this.myLineChart.setOption(option);
  165. },
  166. reasonClick(item,index) {
  167. this.current = index;
  168. },
  169. closeWorkOrder() {
  170. uni.navigateTo({
  171. url: '/pages/workOrderManagement/workOrderDetails'
  172. })
  173. this.closeShow = false;
  174. }
  175. }
  176. }
  177. </script>
  178. <style lang="scss" scoped>
  179. .main {
  180. background-color: #fff;
  181. .item {
  182. display: flex;
  183. align-items: center;
  184. justify-content: space-between;
  185. padding: 28rpx 32rpx;
  186. border-bottom: 1px solid rgba(242, 242, 242, 1);
  187. .title {
  188. color: rgba(51, 51, 51, 1);
  189. }
  190. .value {
  191. color: rgb(16, 16, 16);
  192. font-size: 32rpx;
  193. .reason {
  194. display: inline-block;
  195. width: 128rpx;
  196. line-height: 48rpx;
  197. border-radius: 4px;
  198. color: rgba(255, 61, 0, 1);
  199. border: 1px solid rgba(255, 61, 0, 1);
  200. font-size: 24rpx;
  201. text-align: center;
  202. }
  203. }
  204. .equipment {
  205. font-weight: bold;
  206. }
  207. .warning {
  208. color: rgba(255, 61, 0, 1);
  209. }
  210. }
  211. // 异常记录
  212. .record-chat {
  213. padding: 40rpx 32rpx;
  214. .title {
  215. color: rgba(51, 51, 51, 1);
  216. font-size: 32rpx;
  217. }
  218. .chat-box {
  219. padding: 24rpx 0;
  220. margin-top: 24rpx;
  221. border-radius: 8px;
  222. background: linear-gradient(180deg, rgba(255, 243, 208, 1) 0%, rgba(208, 236, 236, 0) 100%);
  223. .date {
  224. padding: 0 40rpx;
  225. margin-bottom: 24rpx;
  226. color: rgba(16, 16, 16, 1);
  227. font-weight: bold;
  228. }
  229. .img {
  230. width: 100%;
  231. height: 400rpx;
  232. }
  233. }
  234. }
  235. }
  236. // 底部
  237. .bottom {
  238. background-color: #fff;
  239. position: fixed;
  240. bottom: 0;
  241. left: 0;
  242. right: 0;
  243. display: flex;
  244. padding: 20rpx 32rpx;
  245. justify-content: space-between;
  246. .close {
  247. width: 328rpx;
  248. line-height: 80rpx;
  249. border-radius: 4px;
  250. background-color: rgba(222, 225, 228, 1);
  251. color: rgba(51, 51, 51, 1);
  252. font-size: 32rpx;
  253. }
  254. .create {
  255. width: 328rpx;
  256. line-height: 80rpx;
  257. border-radius: 4px;
  258. background-color: rgba(22, 119, 255, 1);
  259. color: rgba(255, 255, 255, 1);
  260. font-size: 32rpx;
  261. }
  262. }
  263. //关闭原因
  264. .close-reason{
  265. padding: 32rpx;
  266. .title{
  267. color: rgba(16,16,16,1);
  268. font-size: 36rpx;
  269. font-weight: bold;
  270. }
  271. .reason-content{
  272. margin-top: 60rpx;
  273. .reason-item{
  274. display: flex;
  275. align-items: center;
  276. justify-content: space-between;
  277. margin-bottom: 56rpx;
  278. .item-title{
  279. color: rgba(16,16,16,1);
  280. font-size: 32rpx;
  281. }
  282. }
  283. }
  284. .button-box{
  285. display: flex;
  286. .think{
  287. width: 328rpx;
  288. line-height: 80rpx;
  289. font-size: 32rpx;
  290. border-radius: 4px;
  291. background-color: rgba(222,225,228,1);
  292. color: rgba(51,51,51,1);
  293. }
  294. .confirm{
  295. width: 328rpx;
  296. line-height: 80rpx;
  297. font-size: 32rpx;
  298. border-radius: 4px;
  299. background-color: rgba(255,68,68,1);
  300. color: rgba(255,255,255,1);
  301. }
  302. }
  303. }
  304. </style>