abnormalContrastDetails.vue 11 KB

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