abnormalContrastDetails.vue 10 KB

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