abnormalContrastDetails.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534
  1. <template>
  2. <view>
  3. <u-select v-model="orderByShow" @confirm="orderconfirm" :default-value="[orderByIndex.value]"
  4. :list="orderByList"></u-select>
  5. <u-navbar title="三项电流情况" title-color="#101010"></u-navbar>
  6. <view class="main">
  7. <view class="item">
  8. <view class="title">
  9. 查询设备
  10. </view>
  11. <view class="value equipment">
  12. {{companyInfo.name}}-{{remoteMonitorMeter.name}}
  13. </view>
  14. </view>
  15. <view class="item">
  16. <view class="title">
  17. 地址
  18. </view>
  19. <view class="value ">
  20. {{remoteMonitorMeter.installationAddress}}
  21. </view>
  22. </view>
  23. <view class="item">
  24. <view class="title">
  25. 查询时间
  26. </view>
  27. <view class="value">
  28. {{createTime}}
  29. </view>
  30. </view>
  31. <view>
  32. <view class="item" @click="orderByShow=true">
  33. <view class="title">
  34. 三项电流详情(A)
  35. </view>
  36. <view>
  37. {{orderByIndex.label}}
  38. <u-icon name="arrow-down"></u-icon>
  39. </view>
  40. </view>
  41. <view class="item">
  42. <table class="border-table ">
  43. <tr>
  44. <td>设备名称</td>
  45. <td :class="{
  46. orderByIndex:(orderByIndex.value==0||orderByIndex.value==2)
  47. }">A相</td>
  48. <td :class="{
  49. orderByIndex:(orderByIndex.value==0||orderByIndex.value==1)
  50. }">B相</td>
  51. <td :class="{
  52. orderByIndex:(orderByIndex.value==1||orderByIndex.value==2)
  53. }">C相</td>
  54. </tr>
  55. <tr v-for="(item,i) in childDcMap" :key="i" :class="{
  56. childDcMap:i==0
  57. }">
  58. <td >{{item.meterName}}</td>
  59. <td :class="{
  60. orderByIndex:(orderByIndex.value==0||orderByIndex.value==2)
  61. }">{{item.dcAA}}</td>
  62. <td :class="{
  63. orderByIndex:(orderByIndex.value==0||orderByIndex.value==1)
  64. }">{{item.dcBa}}</td>
  65. <td :class="{
  66. orderByIndex:(orderByIndex.value==1||orderByIndex.value==2)
  67. }">{{item.dcCa}}</td>
  68. </tr>
  69. </table>
  70. </view>
  71. </view>
  72. <!-- 异常记录 -->
  73. <view class="record-chat" v-if="false">
  74. <view class="title">
  75. 异常记录
  76. </view>
  77. <view class="chat-box">
  78. <view class="date">
  79. 2月4日温度监控
  80. </view>
  81. <view class="chat">
  82. <view id="lineEcharts" style="min-height:400rpx;">
  83. </view>
  84. <!-- <image class="img" src="@/assets/img/recordChat.png" mode=""></image> -->
  85. </view>
  86. </view>
  87. </view>
  88. </view>
  89. <!-- 底部 -->
  90. <view class="bottom" v-if="false">
  91. <button class="close" @click="closeShow=true">关闭警报</button>
  92. <button class="create" @click="gotoUrl('/pages/workOrderManagement/faultReport')">创建工单</button>
  93. </view>
  94. <!-- 关闭原因 -->
  95. <u-popup v-model="closeShow" mode="bottom" closeable close-icon-size="24" close-icon-color="#101010"
  96. border-radius="24">
  97. <view class="close-reason">
  98. <view class="title">
  99. 请选择关闭原因:
  100. </view>
  101. <view class="reason-content">
  102. <view class="reason-item" v-for="(item,index) in reasonList" :key="index">
  103. <view class="item-title">
  104. {{item}}
  105. </view>
  106. <view class="item-value" @click="reasonClick(item,index)">
  107. <label class="radio">
  108. <radio name="reason" :checked="index === current" /><text></text>
  109. </label>
  110. </view>
  111. </view>
  112. </view>
  113. <view class="button-box">
  114. <button class="think" @click="closeShow=false">我在想想</button>
  115. <button class="confirm" @click="closeWorkOrder">确认关闭</button>
  116. </view>
  117. </view>
  118. </u-popup>
  119. </view>
  120. </template>
  121. <script>
  122. import * as echarts from 'echarts';
  123. import * as API from '@/apis/pagejs/index.js'
  124. export default {
  125. data() {
  126. return {
  127. companyInfo: {}, //企业
  128. remoteMonitorRecord: {}, //设备详细
  129. remoteMonitorMeter: {}, //设备
  130. alarmRecord: {}, //异常详细
  131. alarmConfig: {}, //异常详细
  132. id: '', //异常id
  133. closeShow: false,
  134. childDcMap: [],
  135. reasonList: ['错误告警', '设备已自动恢复', '不需要上门解决', '平台移桩,可忽视', '其他'],
  136. current: 0,
  137. myLineChart: null,
  138. orderByShow: false,
  139. orderByIndex: {},
  140. createTime: "",
  141. orderByList: [{
  142. value: "0",
  143. label: "按A与B的差值排序"
  144. }, {
  145. value: "1",
  146. label: "按B与C的差值排序"
  147. }, {
  148. value: "2",
  149. label: "按C与A的差值排序"
  150. }, ]
  151. }
  152. },
  153. onLoad(op) {
  154. if (op.id) {
  155. this.id = op.id;
  156. // this.getAlarmRecordDetails(this.id);
  157. this.getAlarmRecordTPUDetails()
  158. }
  159. this.createTime = new Date().toLocaleString()
  160. this.orderByIndex = this.orderByList[0]
  161. },
  162. onReady() {
  163. // this.getLineCharts();
  164. },
  165. methods: {
  166. childDcMapsort() {
  167. var value = this.orderByIndex.value
  168. var childDcMap = []
  169. var id = this.remoteMonitorMeter.id;
  170. if (it1.meterId == id) {
  171. return -1
  172. }
  173. if (it2.meterId == id) {
  174. return 1
  175. }
  176. this.childDcMap.sort((it1, it2) => {
  177. if (value == '0') {
  178. return it1.abDifference < it2.abDifference ? 1 : -1
  179. } else if (value == '1') {
  180. return it1.bcDifference < it2.bcDifference ? 1 : -1
  181. } else if (value == '2') {
  182. return it1.acDifference < it2.acDifference ? 1 : -1
  183. }
  184. })
  185. },
  186. orderconfirm(e) {
  187. console.log(e)
  188. this.orderByIndex = e[0]
  189. this.childDcMapsort()
  190. },
  191. getAlarmRecordTPUDetails(id, meterId) {
  192. uni.showLoading({
  193. title: "加载中",
  194. mask: true,
  195. })
  196. API.alarmRecordTPUDetails({
  197. meterId: this.id,
  198. // id:id,
  199. }).then((response) => {
  200. uni.hideLoading();
  201. this.childDcMap = response.data.childDcMap;
  202. this.companyInfo = response.data.companyInfo;
  203. this.remoteMonitorMeter = response.data.meter;
  204. this.childDcMapsort()
  205. }).catch(error => {
  206. uni.showToast({
  207. title: error,
  208. icon: "none"
  209. })
  210. })
  211. },
  212. getAlarmRecordDetails(id) {
  213. uni.showLoading({
  214. title: "加载中",
  215. mask: true,
  216. })
  217. API.alarmRecordDetails(id).then((response) => {
  218. uni.hideLoading();
  219. this.companyInfo = response.data.companyInfo;
  220. this.remoteMonitorMeter = response.data.meter;
  221. this.remoteMonitorRecord = response.data.remoteMonitorRecord;
  222. this.alarmRecord = response.data.alarmRecord;
  223. this.alarmConfig = response.data.alarmConfig;
  224. if (this.alarmConfig.code == 'TPU') {
  225. // this.childDcMap=response.data.childDcMap;
  226. this.getAlarmRecordTPUDetails(id, this.remoteMonitorMeter.id)
  227. }
  228. }).catch(error => {
  229. uni.showToast({
  230. title: error,
  231. icon: "none"
  232. })
  233. })
  234. },
  235. getLineCharts() {
  236. if (!this.myLineChart) {
  237. this.myLineChart = echarts.init(document.getElementById('lineEcharts'), null, {
  238. width: uni.upx2px(686),
  239. height: uni.upx2px(400)
  240. });
  241. }
  242. this.myLineChart.clear();
  243. var data1 = ['0-2点', '3-4点', '5-6点', '7-8点', '9-10点', '11-12点', '13-14点', '15-16点',
  244. '17-18点', '19-20点', '21-22点', '23-24点'
  245. ];
  246. var data2 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
  247. var option = {
  248. tooltip: {
  249. trigger: 'axis',
  250. axisPointer: {
  251. type: 'shadow'
  252. }
  253. },
  254. legend: {
  255. show: false
  256. },
  257. grid: {
  258. top: '6%',
  259. left: '3%',
  260. right: '8%',
  261. bottom: '8%',
  262. containLabel: true
  263. },
  264. xAxis: {
  265. type: 'category',
  266. data: data1,
  267. axisLabel: {
  268. rotate: 40,
  269. interval: 0,
  270. textStyle: {
  271. color: "#333"
  272. }
  273. },
  274. },
  275. yAxis: {
  276. type: 'value',
  277. axisLabel: {
  278. formatter: '{value} °C'
  279. }
  280. },
  281. series: [{
  282. name: '温度',
  283. type: 'line',
  284. data: data2,
  285. itemStyle: {
  286. color: '#F39423'
  287. }
  288. }]
  289. };
  290. this.myLineChart.setOption(option);
  291. },
  292. reasonClick(item, index) {
  293. this.current = index;
  294. },
  295. closeWorkOrder() {
  296. uni.navigateTo({
  297. url: '/pages/workOrderManagement/workOrderDetails'
  298. })
  299. this.closeShow = false;
  300. }
  301. }
  302. }
  303. </script>
  304. <style lang="scss" scoped>
  305. .main {
  306. background-color: #fff;
  307. .item {
  308. display: flex;
  309. align-items: center;
  310. justify-content: space-between;
  311. padding: 28rpx 32rpx;
  312. border-bottom: 1px solid rgba(242, 242, 242, 1);
  313. .title {
  314. color: rgba(51, 51, 51, 1);
  315. white-space: pre;
  316. padding-right: 20rpx;
  317. }
  318. .value {
  319. color: rgb(16, 16, 16);
  320. font-size: 32rpx;
  321. .reason {
  322. display: inline-block;
  323. padding: 0 20rpx;
  324. line-height: 48rpx;
  325. border-radius: 4px;
  326. color: rgba(255, 61, 0, 1);
  327. border: 1px solid rgba(255, 61, 0, 1);
  328. font-size: 24rpx;
  329. text-align: center;
  330. }
  331. }
  332. .equipment {
  333. font-weight: bold;
  334. }
  335. .warning {
  336. color: rgba(255, 61, 0, 1);
  337. }
  338. }
  339. // 异常记录
  340. .record-chat {
  341. padding: 40rpx 32rpx;
  342. .title {
  343. color: rgba(51, 51, 51, 1);
  344. font-size: 32rpx;
  345. }
  346. .chat-box {
  347. padding: 24rpx 0;
  348. margin-top: 24rpx;
  349. border-radius: 8px;
  350. background: linear-gradient(180deg, rgba(255, 243, 208, 1) 0%, rgba(208, 236, 236, 0) 100%);
  351. .date {
  352. padding: 0 40rpx;
  353. margin-bottom: 24rpx;
  354. color: rgba(16, 16, 16, 1);
  355. font-weight: bold;
  356. }
  357. .img {
  358. width: 100%;
  359. height: 400rpx;
  360. }
  361. }
  362. }
  363. }
  364. // 底部
  365. .bottom {
  366. background-color: #fff;
  367. position: fixed;
  368. bottom: 0;
  369. left: 0;
  370. right: 0;
  371. display: flex;
  372. padding: 20rpx 32rpx;
  373. justify-content: space-between;
  374. .close {
  375. width: 328rpx;
  376. line-height: 80rpx;
  377. border-radius: 4px;
  378. background-color: rgba(222, 225, 228, 1);
  379. color: rgba(51, 51, 51, 1);
  380. font-size: 32rpx;
  381. }
  382. .create {
  383. width: 328rpx;
  384. line-height: 80rpx;
  385. border-radius: 4px;
  386. background-color: rgba(22, 119, 255, 1);
  387. color: rgba(255, 255, 255, 1);
  388. font-size: 32rpx;
  389. }
  390. }
  391. //关闭原因
  392. .close-reason {
  393. padding: 32rpx;
  394. .title {
  395. color: rgba(16, 16, 16, 1);
  396. font-size: 36rpx;
  397. font-weight: bold;
  398. }
  399. .reason-content {
  400. margin-top: 60rpx;
  401. .reason-item {
  402. display: flex;
  403. align-items: center;
  404. justify-content: space-between;
  405. margin-bottom: 56rpx;
  406. .item-title {
  407. color: rgba(16, 16, 16, 1);
  408. font-size: 32rpx;
  409. }
  410. }
  411. }
  412. .button-box {
  413. display: flex;
  414. .think {
  415. width: 328rpx;
  416. line-height: 80rpx;
  417. font-size: 32rpx;
  418. border-radius: 4px;
  419. background-color: rgba(222, 225, 228, 1);
  420. color: rgba(51, 51, 51, 1);
  421. }
  422. .confirm {
  423. width: 328rpx;
  424. line-height: 80rpx;
  425. font-size: 32rpx;
  426. border-radius: 4px;
  427. background-color: rgba(255, 68, 68, 1);
  428. color: rgba(255, 255, 255, 1);
  429. }
  430. }
  431. }
  432. .table1,
  433. .border-table {
  434. margin: 8rpx 0;
  435. width: 100%;
  436. border-collapse: collapse;
  437. td {
  438. border: 1px solid #e7e7e7;
  439. text-align: end;
  440. padding: 16rpx 16rpx;
  441. }
  442. tr {
  443. background-color: #f5f5f6
  444. }
  445. tr {
  446. td:first-child {
  447. text-align: start;
  448. min-width: 20%;
  449. max-width: 30%;
  450. }
  451. td:last-child {
  452. white-space: pre;
  453. }
  454. }
  455. .tr1 {
  456. text-align: end;
  457. font-weight: bold;
  458. }
  459. tr:nth-child(even) {
  460. background-color: #fff;
  461. }
  462. }
  463. .orderByIndex {
  464. font-weight: bold;
  465. background-color: #CDDC39;
  466. }
  467. .childDcMap td {
  468. background-color: #1677FF !important;
  469. color: #fff !important;
  470. }
  471. </style>