abnormalContrastDetails.vue 10 KB

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