abnormalAlarmDetails.vue 7.7 KB

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