Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

index.vue 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626
  1. <template>
  2. <view class="content">
  3. <view class="top">
  4. <image class="top_logo" :src="logo" mode="aspectFit"></image>
  5. <!-- <view class="tite">
  6. {{ $t('MainTitle') }}
  7. </view> -->
  8. <view class="time">
  9. <view class="time_top">
  10. {{formattedTime}}
  11. </view>
  12. <view class="time_bottom">
  13. <view>
  14. </view>
  15. <view class="time_bottom1">
  16. {{$t('status')}}
  17. <view class="time_state" v-if="status=='ok'">
  18. {{$t('online')}}
  19. </view>
  20. <view class="time_state1" v-else>
  21. {{$t('offline')}}
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. <view class="parameter">
  28. <view class="parameter_xian">
  29. <view class="parameter_xian1">
  30. {{$t('formNO')}}
  31. </view>
  32. <view class="parameter_xian2">
  33. {{$t('formUnit')}}
  34. </view>
  35. <view class="parameter_xian3">
  36. {{$t('formDescription')}}
  37. </view>
  38. <view class="parameter_xian4">
  39. {{$t('formFailure')}}
  40. </view>
  41. <!-- <view class="parameter_xian5">
  42. 发生时间
  43. </view> -->
  44. <view class="parameter_xian6" v-if="event!='事件'">
  45. {{$t('formRecover')}}
  46. </view>
  47. </view>
  48. <view class="parameter_box">
  49. <view v-for="(item,index) in faultsList" :class="item.RESETTIME==''&&event!='事件'?'parameter_divred':'parameter_div'"
  50. :key="index">
  51. <view class="parameter_xian1">
  52. {{item.ID}}
  53. </view>
  54. <!-- <view class="parameter_xian2">
  55. {{item.TYPE}}
  56. </view> -->
  57. <!-- <zb-tooltip @click.top="close" :content="item.DEVICE" placement="top" :ref="'tooltip'+index"> -->
  58. <view class="parameter_xian2" v-if="item.DEVICE=='亿能BMS-1'">
  59. BMS
  60. </view>
  61. <view class="parameter_xian2" v-if="item.DEVICE=='盛弘PCS'">
  62. PCS
  63. </view>
  64. <view class="parameter_xian2" v-if="item.DEVICE=='virtual'">
  65. MCS
  66. </view>
  67. <view class="parameter_xian2" v-if="item.DEVICE=='充电桩ccu-1-1'">
  68. CCU
  69. </view>
  70. <view class="parameter_xian2" v-if="item.DEVICE=='innerIO-1'">
  71. IO
  72. </view>
  73. <!-- </zb-tooltip> -->
  74. <zb-tooltip @click.top="closedevice" :content="item.CONTENT" placement="top" :ref="'device'+index">
  75. <view class="parameter_xian3">
  76. {{item.CONTENT}}
  77. </view>
  78. </zb-tooltip>
  79. <view class="parameter_xian4">
  80. {{item.FAULTTIME.substring(0, 19)}}
  81. </view>
  82. <view class="parameter_xian6" v-if="event!='事件'">
  83. {{item.RESETTIME.substring(0, 19)}}
  84. </view>
  85. </view>
  86. </view>
  87. <view class="parameter_bottom">
  88. <view style="display: flex;align-items: center;">
  89. <view class="parameter_bottom1" @click="onclick">
  90. <image src="../../static/home.png" mode=""></image><text class="parameter_bottom2">{{$t('ReturnModeSelection')}}</text>
  91. </view>
  92. <view class="parameter_bottom11" @click="onReturn">
  93. <image src="../../static/Return.png" mode=""></image><text class="parameter_bottom2">{{$t('Return')}}</text>
  94. </view>
  95. </view>
  96. <!-- <view class="parameter_bottom3">
  97. <view :class="faulttaps=='实时'?'parameter_bottom31':'parameter_bottom32'" @click="taps('实时')">
  98. 实时
  99. </view>
  100. <view v-if="event=='故障'" :class="faulttaps=='故障'?'parameter_bottom31':'parameter_bottom32'" @click="taps('故障')">
  101. 故障
  102. </view>
  103. <view v-if="event=='告警'" :class="faulttaps=='告警'?'parameter_bottom31':'parameter_bottom32'" @click="taps('告警')">
  104. 告警
  105. </view>
  106. <view v-if="event=='事件'" :class="faulttaps=='事件'?'parameter_bottom31':'parameter_bottom32'" @click="taps('事件')">
  107. 事件
  108. </view>
  109. </view> -->
  110. <view class="parameter_bottom4">
  111. <view class="eliminate" @click="onFaultclearing">
  112. {{$t('FaultClearing')}}
  113. </view>
  114. <uni-pagination :total="total" :current="current" title="标题文字" :show-icon="true" @change="change" />
  115. </view>
  116. </view>
  117. </view>
  118. </view>
  119. </template>
  120. <!-- table -->
  121. <script>
  122. import {
  123. getTime
  124. } from "../../utils/index.js"
  125. import {
  126. getfaultsList,
  127. control
  128. } from "../../api/api.js"
  129. import {
  130. mapState
  131. } from 'vuex';
  132. export default {
  133. data() {
  134. return {
  135. logo:'../../static/logo/logo31.png',
  136. current: 1,
  137. total: 0,
  138. pageSize: 10,
  139. faulttaps: '故障',
  140. faultsList: [],
  141. }
  142. },
  143. onLoad() {
  144. this.faulttaps = this.$store.state.event
  145. this.onfaultsList();
  146. },
  147. computed: {
  148. // 使用 mapState 映射多个状态到组件的计算属性
  149. ...mapState(['formattedTime', 'status',"event"]),
  150. },
  151. beforeUnmount() {},
  152. methods: {
  153. onfaultsList() {
  154. // let data1 =[
  155. // {
  156. // ID:1,
  157. // DEVICE:'亿能BMS-1',
  158. // CONTENT:'CONTENT',
  159. // FAULTTIME:'2024-10-30',
  160. // RESETTIME:'2024-10-30',
  161. // },{
  162. // ID:1,
  163. // DEVICE:'亿能BMS-1',
  164. // CONTENT:'CONTENT',
  165. // FAULTTIME:'2024-10-30',
  166. // RESETTIME:'',
  167. // }
  168. // ]
  169. // this.faultsList = data1
  170. // this.total =10
  171. // return
  172. let data = {
  173. page: this.current,
  174. rows: this.pageSize,
  175. device: '',
  176. starttime: '',
  177. endtime: '',
  178. rt:0,
  179. type:this.faulttaps
  180. }
  181. getfaultsList(data).then(res => {
  182. console.log(res);
  183. if (res.status == 'ok') {
  184. this.faultsList = res.data.list
  185. this.total = res.data.pagination.total
  186. } else {
  187. }
  188. });
  189. },
  190. onclick() {
  191. uni.redirectTo({
  192. url: '/pages/index/index'
  193. });
  194. },
  195. onReturn() {
  196. uni.redirectTo({
  197. url: '/pages/faultlist/index'
  198. });
  199. },
  200. change(e) {
  201. console.log(e);
  202. this.current = e.current
  203. this.onfaultsList()
  204. },
  205. // taps(e) {
  206. // this.faulttaps = e
  207. // this.current = 1
  208. // console.log(e);
  209. // this.onfaultsList()
  210. // },
  211. // 文字提示
  212. closedevice() {
  213. for (let i = 1; i < this.total; i++) {
  214. this.$refs[('device' + i)].close()
  215. }
  216. },
  217. onFaultclearing(){
  218. // 清除故障
  219. let data = {
  220. id: "b48fbf61-8e65-4383-a340-d64ae265b42d",
  221. issaveinitvalue: false,
  222. value: '1'
  223. }
  224. console.log(data);
  225. control(data).then(res => {
  226. console.log(res);
  227. if (res.status == 'ok') {
  228. setTimeout(() => {
  229. let info = {
  230. id: "b48fbf61-8e65-4383-a340-d64ae265b42d",
  231. issaveinitvalue: false,
  232. value: '0'
  233. }
  234. control(info).then(ress => {
  235. console.log(ress);
  236. if (ress.status == 'ok') {
  237. uni.showToast({
  238. title: this.$t('OperationSuccessful'),
  239. icon: 'none',
  240. duration: 2000, // 显示时长,单位为毫秒
  241. });
  242. } else {
  243. uni.showToast({
  244. title: this.$t('operationFailed'),
  245. icon: 'none', // 使用 'none' 图标来表示失败
  246. duration: 2000, // 显示时长,单位为毫秒
  247. });
  248. }
  249. });
  250. }, 1000); // 1秒后重新获取数据
  251. } else {
  252. uni.showToast({
  253. title: this.$t('operationFailed'),
  254. icon: 'none', // 使用 'none' 图标来表示失败
  255. duration: 2000, // 显示时长,单位为毫秒
  256. });
  257. }
  258. });
  259. }
  260. // close() {
  261. // for (let i = 1; i < this.total; i++) {
  262. // this.$refs[('tooltip' + i)].close()
  263. // }
  264. // }
  265. }
  266. }
  267. </script>
  268. <style lang="scss" scoped>
  269. .content {
  270. width: 100%;
  271. height: 100vh;
  272. opacity: 1;
  273. background: radial-gradient(40.46% 50% at 50.01912045889101% 50%, rgba(225, 238, 222, 1) 0%, rgba(196, 219, 193, 1) 100%);
  274. box-sizing: border-box;
  275. }
  276. .top {
  277. width: 100%;
  278. height: 100px;
  279. display: flex;
  280. align-items: center;
  281. justify-content: space-between;
  282. background-size: 100% 100%;
  283. background-repeat: no-repeat;
  284. background: rgba(225, 238, 222, 1);
  285. padding-right:46px;
  286. padding:0px 46px;
  287. box-sizing: border-box;
  288. }
  289. .top_logo{
  290. // width:327px;
  291. width:260px;
  292. // width:100px;
  293. // width:88px;
  294. // height: 56px;
  295. // height: 88px;
  296. }
  297. .tite{
  298. // width:166px;
  299. // height: 50px;
  300. // font-size: 34px;
  301. // font-weight: 800;
  302. // background-image: url("../../static/tite1.png.png");
  303. // background-size: 100% 100%;
  304. width:240px;
  305. height: 50px;
  306. font-size: 80rpx;
  307. font-weight: 600;
  308. margin-left:90px;
  309. }
  310. .time{
  311. width:277px;
  312. text-align: right;
  313. }
  314. .time_top {
  315. font-size: 17px;
  316. }
  317. .time_bottom {
  318. display: flex;
  319. font-size: 17px;
  320. justify-content: space-between;
  321. }
  322. .time_bottom1 {
  323. display: flex;
  324. }
  325. .time_state {
  326. font-size: 17px;
  327. font-weight: 600;
  328. color: rgba(22, 68, 144, 1);
  329. }
  330. .parameter {
  331. width: 100%;
  332. /* padding-bottom: 20px; */
  333. display: flex;
  334. padding: 0px 20px 20px 20px;
  335. display: flex;
  336. flex-direction: column;
  337. box-sizing: border-box;
  338. }
  339. .parameter_xian {
  340. width: 100%;
  341. height: 55px;
  342. // background: linear-gradient(180deg, rgba(30, 131, 189, 1) 0%, rgba(69, 168, 230, 0.92) 100%);
  343. background: linear-gradient(180deg, rgb(0, 115, 0) 0%, rgb(99, 212, 99) 100%);
  344. box-shadow: inset 0px 0px 9.79px rgba(0, 0, 0, 0.1);
  345. display: flex;
  346. align-items: center;
  347. color: #fff;
  348. // justify-content: space-around;1237
  349. justify-content: space-between;
  350. font-size: 28px;
  351. font-weight: 600;
  352. padding: 0px 20px;
  353. margin-top: 20rpx;
  354. box-sizing: border-box;
  355. .parameter_xian1 {
  356. width: 160px;
  357. }
  358. .parameter_xian2 {
  359. width: 160px;
  360. }
  361. .parameter_xian3 {
  362. width: 430px;
  363. }
  364. .parameter_xian4 {
  365. width: 220px;
  366. margin-right: 10px;
  367. white-space: nowrap;
  368. /* 禁止换行 */
  369. overflow: hidden;
  370. /* 超出部分隐藏 */
  371. text-overflow: ellipsis;
  372. /* 显示省略号 */
  373. }
  374. .parameter_xian5 {
  375. width: 240px;
  376. margin-right: 10px;
  377. }
  378. .parameter_xian6 {
  379. width: 240px;
  380. }
  381. }
  382. .parameter_box {
  383. width: 100%;
  384. overflow: auto;
  385. }
  386. .parameter_div {
  387. width: 100%;
  388. height: 46px;
  389. background: rgba(255, 255, 255, 1);
  390. box-shadow: inset 0px 0px 9.79px rgba(0, 0, 0, 0.1);
  391. margin-top: 10px;
  392. display: flex;
  393. align-items: center;
  394. // justify-content: space-around;
  395. justify-content: space-between;
  396. font-weight: 500;
  397. padding: 0px 20px;
  398. box-sizing: border-box;
  399. .parameter_xian1 {
  400. width: 160px;
  401. }
  402. .parameter_xian2 {
  403. width: 160px;
  404. }
  405. .parameter_xian3 {
  406. width: 430px;
  407. }
  408. .parameter_xian4 {
  409. width: 220px;
  410. white-space: nowrap;
  411. /* 禁止换行 */
  412. overflow: hidden;
  413. /* 超出部分隐藏 */
  414. text-overflow: ellipsis;
  415. /* 显示省略号 */
  416. margin-right: 10px;
  417. }
  418. .parameter_xian5 {
  419. width: 240px;
  420. margin-right: 10px;
  421. }
  422. .parameter_xian6 {
  423. width: 240px;
  424. }
  425. }
  426. .parameter_divred {
  427. width: 100%;
  428. height: 46px;
  429. background: rgba(245, 99, 83, 1);
  430. box-shadow: inset 0px 0px 9.79px rgba(0, 0, 0, 0.1);
  431. margin-bottom: 10px;
  432. display: flex;
  433. align-items: center;
  434. color: #fff;
  435. font-weight: 500;
  436. // justify-content: space-around;
  437. justify-content: space-between;
  438. padding: 0px 20px;
  439. box-sizing: border-box;
  440. .parameter_xian1 {
  441. width: 160px;
  442. }
  443. .parameter_xian2 {
  444. width: 160px;
  445. }
  446. .parameter_xian3 {
  447. width: 430px;
  448. }
  449. .parameter_xian4 {
  450. width: 220px;
  451. margin-right: 10px;
  452. white-space: nowrap;
  453. /* 禁止换行 */
  454. overflow: hidden;
  455. /* 超出部分隐藏 */
  456. text-overflow: ellipsis;
  457. /* 显示省略号 */
  458. }
  459. .parameter_xian5 {
  460. width: 240px;
  461. margin-right: 10px;
  462. }
  463. .parameter_xian6 {
  464. width: 240px;
  465. }
  466. }
  467. .parameter_bottom {
  468. display: flex;
  469. justify-content: space-between;
  470. margin-bottom: 10px;
  471. padding: 0px 16px;
  472. position: fixed;
  473. left: 10px;
  474. bottom: 10px;
  475. width: 100%;
  476. box-sizing: border-box;
  477. }
  478. .parameter_bottom1 {
  479. display: flex;
  480. align-items: center;
  481. image {
  482. width: 32px;
  483. height: 32px;
  484. display: flex;
  485. }
  486. }
  487. .parameter_bottom11 {
  488. display: flex;
  489. align-items: center;
  490. margin-left: 100px;
  491. image {
  492. width: 32px;
  493. height: 32px;
  494. display: flex;
  495. }
  496. }
  497. .parameter_bottom2 {
  498. font-size: 19.58px;
  499. font-weight: 400;
  500. color: rgba(0, 0, 0, 1);
  501. margin-left: 10px;
  502. }
  503. .parameter_bottom3 {
  504. display: flex;
  505. }
  506. .parameter_bottom31 {
  507. width: 48px;
  508. height: 48px;
  509. background: linear-gradient(180deg, rgba(74, 167, 224, 1) 0%, rgba(36, 134, 192, 1) 100%);
  510. border-radius: 100%;
  511. display: flex;
  512. align-items: center;
  513. justify-content: center;
  514. font-size: 19px;
  515. font-weight: 700;
  516. margin-right: 20px;
  517. color: rgba(255, 255, 255, 1);
  518. }
  519. .parameter_bottom32 {
  520. width: 48px;
  521. height: 48px;
  522. background: linear-gradient(180deg, rgba(224, 218, 218, 1) 0%, rgba(130, 121, 121, 1) 100%);
  523. border-radius: 100%;
  524. display: flex;
  525. align-items: center;
  526. justify-content: center;
  527. font-size: 19px;
  528. font-weight: 700;
  529. color: #222222;
  530. margin-right: 20px;
  531. }
  532. .parameter_bottom4 {
  533. display: flex;
  534. align-items: center;
  535. }
  536. .eliminate {
  537. width: 107.69px;
  538. height: 44.05px;
  539. opacity: 1;
  540. border-radius: 2.45px;
  541. // background: linear-gradient(180deg, rgba(119, 163, 230, 1) 0%, rgba(25, 85, 176, 1) 10.42%, rgba(6, 53, 94, 1) 88.89%, rgba(119, 163, 230, 1) 100%);
  542. background: linear-gradient(180deg, rgb(119, 163, 230) 0%, rgb(0, 115, 0) 10.42%, rgb(99, 212, 99) 88.89%, rgb(0, 115, 0) 100%);
  543. margin-right: 20px;
  544. display: flex;
  545. align-items: center;
  546. justify-content: center;
  547. font-size: 23.5px;
  548. font-weight: 400;
  549. color: rgba(255, 255, 255, 1);
  550. box-sizing: border-box;
  551. }
  552. .time_state1 {
  553. font-size: 17px;
  554. font-weight: 600;
  555. color: rgba(217, 22, 22, 1);
  556. }
  557. </style>