abnormalContrastDetails.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510
  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. // id:id,
  178. queryNum:this.queryNum
  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. this.keySz=[]
  186. for(var i in sz){
  187. var obj=sz[i].split(',')
  188. this.keySz.push({
  189. name:obj[0],
  190. value:obj[1]
  191. })
  192. }
  193. this.childDcMapsort()
  194. }).catch(error => {
  195. uni.showToast({
  196. title: error,
  197. icon: "none"
  198. })
  199. })
  200. },
  201. getAlarmRecordDetails(id) {
  202. },
  203. getLineCharts() {
  204. if (!this.myLineChart) {
  205. this.myLineChart = echarts.init(document.getElementById('lineEcharts'), null, {
  206. width: uni.upx2px(686),
  207. height: uni.upx2px(400)
  208. });
  209. }
  210. this.myLineChart.clear();
  211. var data1 = ['0-2点', '3-4点', '5-6点', '7-8点', '9-10点', '11-12点', '13-14点', '15-16点',
  212. '17-18点', '19-20点', '21-22点', '23-24点'
  213. ];
  214. var data2 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
  215. var option = {
  216. tooltip: {
  217. trigger: 'axis',
  218. axisPointer: {
  219. type: 'shadow'
  220. }
  221. },
  222. legend: {
  223. show: false
  224. },
  225. grid: {
  226. top: '6%',
  227. left: '3%',
  228. right: '8%',
  229. bottom: '8%',
  230. containLabel: true
  231. },
  232. xAxis: {
  233. type: 'category',
  234. data: data1,
  235. axisLabel: {
  236. rotate: 40,
  237. interval: 0,
  238. textStyle: {
  239. color: "#333"
  240. }
  241. },
  242. },
  243. yAxis: {
  244. type: 'value',
  245. axisLabel: {
  246. formatter: '{value} °C'
  247. }
  248. },
  249. series: [{
  250. name: '温度',
  251. type: 'line',
  252. data: data2,
  253. itemStyle: {
  254. color: '#F39423'
  255. }
  256. }]
  257. };
  258. this.myLineChart.setOption(option);
  259. },
  260. reasonClick(item, index) {
  261. this.current = index;
  262. },
  263. closeWorkOrder() {
  264. uni.navigateTo({
  265. url: '/pages/workOrderManagement/workOrderDetails'
  266. })
  267. this.closeShow = false;
  268. }
  269. }
  270. }
  271. </script>
  272. <style lang="scss" scoped>
  273. .main {
  274. background-color: #fff;
  275. .item {
  276. display: flex;
  277. align-items: center;
  278. justify-content: space-between;
  279. padding: 28rpx 32rpx;
  280. border-bottom: 1px solid rgba(242, 242, 242, 1);
  281. .title {
  282. color: rgba(51, 51, 51, 1);
  283. white-space: pre;
  284. padding-right: 20rpx;
  285. }
  286. .value {
  287. color: rgb(16, 16, 16);
  288. font-size: 32rpx;
  289. .reason {
  290. display: inline-block;
  291. padding: 0 20rpx;
  292. line-height: 48rpx;
  293. border-radius: 4px;
  294. color: rgba(255, 61, 0, 1);
  295. border: 1px solid rgba(255, 61, 0, 1);
  296. font-size: 24rpx;
  297. text-align: center;
  298. }
  299. }
  300. .equipment {
  301. font-weight: bold;
  302. }
  303. .warning {
  304. color: rgba(255, 61, 0, 1);
  305. }
  306. }
  307. // 异常记录
  308. .record-chat {
  309. padding: 40rpx 32rpx;
  310. .title {
  311. color: rgba(51, 51, 51, 1);
  312. font-size: 32rpx;
  313. }
  314. .chat-box {
  315. padding: 24rpx 0;
  316. margin-top: 24rpx;
  317. border-radius: 8px;
  318. background: linear-gradient(180deg, rgba(255, 243, 208, 1) 0%, rgba(208, 236, 236, 0) 100%);
  319. .date {
  320. padding: 0 40rpx;
  321. margin-bottom: 24rpx;
  322. color: rgba(16, 16, 16, 1);
  323. font-weight: bold;
  324. }
  325. .img {
  326. width: 100%;
  327. height: 400rpx;
  328. }
  329. }
  330. }
  331. }
  332. // 底部
  333. .bottom {
  334. background-color: #fff;
  335. position: fixed;
  336. bottom: 0;
  337. left: 0;
  338. right: 0;
  339. display: flex;
  340. padding: 20rpx 32rpx;
  341. justify-content: space-between;
  342. .close {
  343. width: 328rpx;
  344. line-height: 80rpx;
  345. border-radius: 4px;
  346. background-color: rgba(222, 225, 228, 1);
  347. color: rgba(51, 51, 51, 1);
  348. font-size: 32rpx;
  349. }
  350. .create {
  351. width: 328rpx;
  352. line-height: 80rpx;
  353. border-radius: 4px;
  354. background-color: rgba(22, 119, 255, 1);
  355. color: rgba(255, 255, 255, 1);
  356. font-size: 32rpx;
  357. }
  358. }
  359. //关闭原因
  360. .close-reason {
  361. padding: 32rpx;
  362. .title {
  363. color: rgba(16, 16, 16, 1);
  364. font-size: 36rpx;
  365. font-weight: bold;
  366. }
  367. .reason-content {
  368. margin-top: 60rpx;
  369. .reason-item {
  370. display: flex;
  371. align-items: center;
  372. justify-content: space-between;
  373. margin-bottom: 56rpx;
  374. .item-title {
  375. color: rgba(16, 16, 16, 1);
  376. font-size: 32rpx;
  377. }
  378. }
  379. }
  380. .button-box {
  381. display: flex;
  382. .think {
  383. width: 328rpx;
  384. line-height: 80rpx;
  385. font-size: 32rpx;
  386. border-radius: 4px;
  387. background-color: rgba(222, 225, 228, 1);
  388. color: rgba(51, 51, 51, 1);
  389. }
  390. .confirm {
  391. width: 328rpx;
  392. line-height: 80rpx;
  393. font-size: 32rpx;
  394. border-radius: 4px;
  395. background-color: rgba(255, 68, 68, 1);
  396. color: rgba(255, 255, 255, 1);
  397. }
  398. }
  399. }
  400. .table1,
  401. .border-table {
  402. margin: 8rpx 0;
  403. width: 100%;
  404. border-collapse: collapse;
  405. td {
  406. border: 1px solid #e7e7e7;
  407. text-align: end;
  408. padding: 16rpx 16rpx;
  409. }
  410. tr {
  411. background-color: #f5f5f6
  412. }
  413. tr {
  414. td:first-child {
  415. text-align: start;
  416. min-width: 20%;
  417. max-width: 30%;
  418. }
  419. td:last-child {
  420. white-space: pre;
  421. }
  422. }
  423. .tr1 {
  424. text-align: end;
  425. font-weight: bold;
  426. }
  427. tr:nth-child(even) {
  428. background-color: #fff;
  429. }
  430. }
  431. .keySz0,.keySz1{
  432. font-weight: bold;
  433. background-color: #f8f0a6;
  434. }
  435. .childDcMap td{
  436. background-color: #1677FF !important ;
  437. color:#fff !important ;
  438. }
  439. .queryNum{
  440. border: 1px solid #9E9E9E;
  441. padding: 4rpx 16rpx;
  442. margin: 8rpx ;
  443. }
  444. .queryNumIndex{
  445. color: #fff;
  446. background: #1677FF;
  447. }
  448. </style>