abnormalContrastDetails.vue 10 KB

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