移动储能车V1版本
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

index.vue 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608
  1. <template>
  2. <view class="content">
  3. <view class="top">
  4. <image class="top_logo" src="../../static/logo.png" mode=""></image>
  5. <image class="tite" :src="$t('MainTitle')" mode=""></image>
  6. <!-- <view class="tite">
  7. {{ $t('MainTitle') }}
  8. </view> -->
  9. <view class="time">
  10. <view class="time_top">
  11. {{formattedTime}}
  12. </view>
  13. <view class="time_bottom">
  14. <view>
  15. </view>
  16. <view class="time_bottom1">
  17. {{$t('status')}}
  18. <view class="time_state" v-if="status=='ok'">
  19. {{$t('online')}}
  20. </view>
  21. <view class="time_state1" v-else>
  22. {{$t('offline')}}
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="parameter">
  29. <view class="parameter_xian">
  30. <view class="parameter_xian1">
  31. {{$t('formNO')}}
  32. </view>
  33. <view class="parameter_xian2">
  34. {{$t('formUnit')}}
  35. </view>
  36. <view class="parameter_xian3">
  37. {{$t('formDescription')}}
  38. </view>
  39. <view class="parameter_xian4">
  40. {{$t('formFailure')}}
  41. </view>
  42. <!-- <view class="parameter_xian5">
  43. 发生时间
  44. </view> -->
  45. <view class="parameter_xian6" v-if="event!='事件'">
  46. {{$t('formRecover')}}
  47. </view>
  48. </view>
  49. <view class="parameter_box">
  50. <view v-for="(item,index) in faultsList" :class="item.RESETTIME==''&&event!='事件'?'parameter_divred':'parameter_div'"
  51. :key="index">
  52. <view class="parameter_xian1">
  53. {{item.ID}}
  54. </view>
  55. <!-- <view class="parameter_xian2">
  56. {{item.TYPE}}
  57. </view> -->
  58. <!-- <zb-tooltip @click.top="close" :content="item.DEVICE" placement="top" :ref="'tooltip'+index"> -->
  59. <view class="parameter_xian2" v-if="item.DEVICE=='亿能BMS-1'">
  60. BMS
  61. </view>
  62. <view class="parameter_xian2" v-if="item.DEVICE=='英博电气pcs-1'">
  63. PCS
  64. </view>
  65. <view class="parameter_xian2" v-if="item.DEVICE=='virtual'">
  66. MCS
  67. </view>
  68. <view class="parameter_xian2" v-if="item.DEVICE=='充电桩ccu-1-1'">
  69. CCU
  70. </view>
  71. <view class="parameter_xian2" v-if="item.DEVICE=='innerIO-1'">
  72. IO
  73. </view>
  74. <!-- </zb-tooltip> -->
  75. <zb-tooltip @click.top="closedevice" :content="item.CONTENT" placement="top" :ref="'device'+index">
  76. <view class="parameter_xian3">
  77. {{item.CONTENT}}
  78. </view>
  79. </zb-tooltip>
  80. <view class="parameter_xian4">
  81. {{item.FAULTTIME.substring(0, 19)}}
  82. </view>
  83. <view class="parameter_xian6" v-if="event!='事件'">
  84. {{item.RESETTIME.substring(0, 19)}}
  85. </view>
  86. </view>
  87. </view>
  88. <view class="parameter_bottom">
  89. <view style="display: flex;align-items: center;">
  90. <view class="parameter_bottom1" @click="onclick">
  91. <image src="../../static/home.png" mode=""></image><text class="parameter_bottom2">{{$t('ReturnModeSelection')}}</text>
  92. </view>
  93. <view class="parameter_bottom11" @click="onReturn">
  94. <image src="../../static/Return.png" mode=""></image><text class="parameter_bottom2">{{$t('Return')}}</text>
  95. </view>
  96. </view>
  97. <!-- <view class="parameter_bottom3">
  98. <view :class="faulttaps=='实时'?'parameter_bottom31':'parameter_bottom32'" @click="taps('实时')">
  99. 实时
  100. </view>
  101. <view v-if="event=='故障'" :class="faulttaps=='故障'?'parameter_bottom31':'parameter_bottom32'" @click="taps('故障')">
  102. 故障
  103. </view>
  104. <view v-if="event=='告警'" :class="faulttaps=='告警'?'parameter_bottom31':'parameter_bottom32'" @click="taps('告警')">
  105. 告警
  106. </view>
  107. <view v-if="event=='事件'" :class="faulttaps=='事件'?'parameter_bottom31':'parameter_bottom32'" @click="taps('事件')">
  108. 事件
  109. </view>
  110. </view> -->
  111. <view class="parameter_bottom4">
  112. <view class="eliminate" @click="onFaultclearing">
  113. {{$t('FaultClearing')}}
  114. </view>
  115. <uni-pagination :total="total" :current="current" title="标题文字" :show-icon="true" @change="change" />
  116. </view>
  117. </view>
  118. </view>
  119. </view>
  120. </template>
  121. <!-- -->
  122. <script>
  123. import {
  124. getTime
  125. } from "../../utils/index.js"
  126. import {
  127. getfaultsList,
  128. control
  129. } from "../../api/api.js"
  130. import {
  131. mapState
  132. } from 'vuex';
  133. export default {
  134. data() {
  135. return {
  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: "201c23d5-f460-44d5-8dde-8adb46cd00f7",
  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: "201c23d5-f460-44d5-8dde-8adb46cd00f7",
  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. <!-- -->
  269. <style lang="scss" scoped>
  270. .content {
  271. width: 100%;
  272. height: 100vh;
  273. opacity: 1;
  274. background: linear-gradient(180deg, rgba(215, 230, 245, 0) 0%, rgba(196, 229, 255, 1) 100%);
  275. box-sizing: border-box;
  276. }
  277. .top {
  278. width: 100%;
  279. height: 100px;
  280. display: flex;
  281. align-items: center;
  282. justify-content: space-between;
  283. background-size: 100% 100%;
  284. background-repeat: no-repeat;
  285. background-color: #fff;
  286. padding: 0px 46px;
  287. box-sizing: border-box;
  288. }
  289. .top_logo{
  290. width:327px;
  291. height: 56px;
  292. }
  293. .tite{
  294. width: 325px;
  295. height: 50px;
  296. }
  297. .time{
  298. width:277px;
  299. text-align: right;
  300. }
  301. .time_top {
  302. font-size: 17px;
  303. }
  304. .time_bottom {
  305. display: flex;
  306. font-size: 17px;
  307. justify-content: space-between;
  308. }
  309. .time_bottom1 {
  310. display: flex;
  311. }
  312. .time_state {
  313. font-size: 17px;
  314. font-weight: 600;
  315. color: rgba(22, 68, 144, 1);
  316. }
  317. .parameter {
  318. width: 100%;
  319. /* padding-bottom: 20px; */
  320. display: flex;
  321. padding: 0px 20px 20px 20px;
  322. display: flex;
  323. flex-direction: column;
  324. box-sizing: border-box;
  325. }
  326. .parameter_xian {
  327. width: 100%;
  328. height: 55px;
  329. background: linear-gradient(180deg, rgba(30, 131, 189, 1) 0%, rgba(69, 168, 230, 0.92) 100%);
  330. box-shadow: inset 0px 0px 9.79px rgba(0, 0, 0, 0.1);
  331. display: flex;
  332. align-items: center;
  333. color: #fff;
  334. // justify-content: space-around;1237
  335. justify-content: space-between;
  336. font-size: 28px;
  337. font-weight: 600;
  338. padding: 0px 20px;
  339. box-sizing: border-box;
  340. .parameter_xian1 {
  341. width: 160px;
  342. }
  343. .parameter_xian2 {
  344. width: 160px;
  345. }
  346. .parameter_xian3 {
  347. width: 430px;
  348. }
  349. .parameter_xian4 {
  350. width: 220px;
  351. margin-right: 10px;
  352. white-space: nowrap;
  353. /* 禁止换行 */
  354. overflow: hidden;
  355. /* 超出部分隐藏 */
  356. text-overflow: ellipsis;
  357. /* 显示省略号 */
  358. }
  359. .parameter_xian5 {
  360. width: 240px;
  361. margin-right: 10px;
  362. }
  363. .parameter_xian6 {
  364. width: 240px;
  365. }
  366. }
  367. .parameter_box {
  368. width: 100%;
  369. overflow: auto;
  370. }
  371. .parameter_div {
  372. width: 100%;
  373. height: 46px;
  374. background: rgba(255, 255, 255, 1);
  375. box-shadow: inset 0px 0px 9.79px rgba(0, 0, 0, 0.1);
  376. margin-top: 10px;
  377. display: flex;
  378. align-items: center;
  379. // justify-content: space-around;
  380. justify-content: space-between;
  381. font-weight: 500;
  382. padding: 0px 20px;
  383. box-sizing: border-box;
  384. .parameter_xian1 {
  385. width: 160px;
  386. }
  387. .parameter_xian2 {
  388. width: 160px;
  389. }
  390. .parameter_xian3 {
  391. width: 430px;
  392. }
  393. .parameter_xian4 {
  394. width: 220px;
  395. white-space: nowrap;
  396. /* 禁止换行 */
  397. overflow: hidden;
  398. /* 超出部分隐藏 */
  399. text-overflow: ellipsis;
  400. /* 显示省略号 */
  401. margin-right: 10px;
  402. }
  403. .parameter_xian5 {
  404. width: 240px;
  405. margin-right: 10px;
  406. }
  407. .parameter_xian6 {
  408. width: 240px;
  409. }
  410. }
  411. .parameter_divred {
  412. width: 100%;
  413. height: 46px;
  414. background: rgba(245, 99, 83, 1);
  415. box-shadow: inset 0px 0px 9.79px rgba(0, 0, 0, 0.1);
  416. margin-bottom: 10px;
  417. display: flex;
  418. align-items: center;
  419. color: #fff;
  420. font-weight: 500;
  421. // justify-content: space-around;
  422. justify-content: space-between;
  423. padding: 0px 20px;
  424. box-sizing: border-box;
  425. .parameter_xian1 {
  426. width: 160px;
  427. }
  428. .parameter_xian2 {
  429. width: 160px;
  430. }
  431. .parameter_xian3 {
  432. width: 430px;
  433. }
  434. .parameter_xian4 {
  435. width: 220px;
  436. margin-right: 10px;
  437. white-space: nowrap;
  438. /* 禁止换行 */
  439. overflow: hidden;
  440. /* 超出部分隐藏 */
  441. text-overflow: ellipsis;
  442. /* 显示省略号 */
  443. }
  444. .parameter_xian5 {
  445. width: 240px;
  446. margin-right: 10px;
  447. }
  448. .parameter_xian6 {
  449. width: 240px;
  450. }
  451. }
  452. .parameter_bottom {
  453. display: flex;
  454. justify-content: space-between;
  455. margin-bottom: 10px;
  456. padding: 0px 16px;
  457. position: fixed;
  458. left: 10px;
  459. bottom: 10px;
  460. width: 100%;
  461. box-sizing: border-box;
  462. }
  463. .parameter_bottom1 {
  464. display: flex;
  465. align-items: center;
  466. image {
  467. width: 32px;
  468. height: 32px;
  469. display: flex;
  470. }
  471. }
  472. .parameter_bottom11 {
  473. display: flex;
  474. align-items: center;
  475. margin-left: 100px;
  476. image {
  477. width: 32px;
  478. height: 32px;
  479. display: flex;
  480. }
  481. }
  482. .parameter_bottom2 {
  483. font-size: 19.58px;
  484. font-weight: 400;
  485. color: rgba(0, 0, 0, 1);
  486. margin-left: 10px;
  487. }
  488. .parameter_bottom3 {
  489. display: flex;
  490. }
  491. .parameter_bottom31 {
  492. width: 48px;
  493. height: 48px;
  494. background: linear-gradient(180deg, rgba(74, 167, 224, 1) 0%, rgba(36, 134, 192, 1) 100%);
  495. border-radius: 100%;
  496. display: flex;
  497. align-items: center;
  498. justify-content: center;
  499. font-size: 19px;
  500. font-weight: 700;
  501. margin-right: 20px;
  502. color: rgba(255, 255, 255, 1);
  503. }
  504. .parameter_bottom32 {
  505. width: 48px;
  506. height: 48px;
  507. background: linear-gradient(180deg, rgba(224, 218, 218, 1) 0%, rgba(130, 121, 121, 1) 100%);
  508. border-radius: 100%;
  509. display: flex;
  510. align-items: center;
  511. justify-content: center;
  512. font-size: 19px;
  513. font-weight: 700;
  514. color: #222222;
  515. margin-right: 20px;
  516. }
  517. .parameter_bottom4 {
  518. display: flex;
  519. align-items: center;
  520. }
  521. .eliminate {
  522. width: 107.69px;
  523. height: 44.05px;
  524. opacity: 1;
  525. border-radius: 2.45px;
  526. 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%);
  527. margin-right: 20px;
  528. display: flex;
  529. align-items: center;
  530. justify-content: center;
  531. font-size: 23.5px;
  532. font-weight: 400;
  533. color: rgba(255, 255, 255, 1);
  534. box-sizing: border-box;
  535. }
  536. .time_state1 {
  537. font-size: 17px;
  538. font-weight: 600;
  539. color: rgba(217, 22, 22, 1);
  540. }
  541. </style>