移动储能车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 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522
  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="../../static/tite.png" mode=""></image>
  6. <view class="time">
  7. <view class="time_top">
  8. {{formattedTime}}
  9. </view>
  10. <view class="time_bottom">
  11. <view>
  12. </view>
  13. <view class="time_bottom1">
  14. 连接状态:
  15. <view class="time_state" v-if="status=='ok'">
  16. 在线
  17. </view>
  18. <view class="time_state1" v-else>
  19. 离线
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. <view class="parameter">
  26. <view class="parameter_xian">
  27. <view class="parameter_xian1">
  28. 序号
  29. </view>
  30. <view class="parameter_xian2">
  31. 类型
  32. </view>
  33. <view class="parameter_xian3">
  34. 设备
  35. </view>
  36. <view class="parameter_xian4">
  37. 内容
  38. </view>
  39. <view class="parameter_xian5">
  40. 发生时间
  41. </view>
  42. <view class="parameter_xian6">
  43. 恢复时间
  44. </view>
  45. </view>
  46. <view class="parameter_box">
  47. <view v-for="(item,index) in faultsList" :class="item.RESETTIME==''?'parameter_divred':'parameter_div'"
  48. :key="index">
  49. <view class="parameter_xian1">
  50. {{item.ID}}
  51. </view>
  52. <view class="parameter_xian2">
  53. {{item.TYPE}}
  54. </view>
  55. <zb-tooltip @click.top="closedevice" :content="item.DEVICE" placement="top" :ref="'device'+index">
  56. <view class="parameter_xian3">
  57. {{item.DEVICE}}
  58. </view>
  59. </zb-tooltip>
  60. <zb-tooltip @click.top="close" :content="item.CONTENT" placement="top" :ref="'tooltip'+index">
  61. <view class="parameter_xian4">
  62. {{item.CONTENT}}
  63. </view>
  64. </zb-tooltip>
  65. <view class="parameter_xian5">
  66. {{item.FAULTTIME.substring(0, 19)}}
  67. </view>
  68. <view class="parameter_xian6">
  69. {{item.RESETTIME.substring(0, 19)}}
  70. </view>
  71. </view>
  72. </view>
  73. <view class="parameter_bottom">
  74. <view class="parameter_bottom1" @click="onclick">
  75. <image src="../../static/home.png" mode=""></image><text class="parameter_bottom2">返回模式选择</text>
  76. </view>
  77. <view class="parameter_bottom3">
  78. <view :class="faulttaps=='实时'?'parameter_bottom31':'parameter_bottom32'" @click="taps('实时')">
  79. 实时
  80. </view>
  81. <!-- <view :class="faulttaps=='全部'?'parameter_bottom31':'parameter_bottom32'" @click="taps('全部')">
  82. 全部
  83. </view> -->
  84. <view :class="faulttaps=='故障'?'parameter_bottom31':'parameter_bottom32'" @click="taps('故障')">
  85. 故障
  86. </view>
  87. <view :class="faulttaps=='告警'?'parameter_bottom31':'parameter_bottom32'" @click="taps('告警')">
  88. 告警
  89. </view>
  90. <view :class="faulttaps=='事件'?'parameter_bottom31':'parameter_bottom32'" @click="taps('事件')">
  91. 事件
  92. </view>
  93. </view>
  94. <view class="parameter_bottom4">
  95. <view class="eliminate">
  96. 故障清除
  97. </view>
  98. <uni-pagination :total="total" title="标题文字" :show-icon="true" @change="change" />
  99. </view>
  100. </view>
  101. </view>
  102. </view>
  103. </template>
  104. <!--table -->
  105. <script>
  106. import {
  107. getTime
  108. } from "../../utils/index.js"
  109. import {
  110. getfaultsList
  111. } from "../../api/api.js"
  112. import {
  113. mapState
  114. } from 'vuex';
  115. export default {
  116. data() {
  117. return {
  118. current: 1,
  119. total: 0,
  120. pageSize: 10,
  121. faulttaps: '实时',
  122. faultsList: [],
  123. }
  124. },
  125. onLoad() {
  126. this.onfaultsList();
  127. },
  128. computed: {
  129. // 使用 mapState 映射多个状态到组件的计算属性
  130. ...mapState(['formattedTime', 'status']),
  131. },
  132. beforeUnmount() {},
  133. methods: {
  134. onfaultsList() {
  135. let data = {
  136. page: this.current,
  137. rows: this.pageSize,
  138. device: '',
  139. starttime: '',
  140. endtime: '',
  141. rt: this.faulttaps == '实时' ? 1 : 0,
  142. type: this.faulttaps == '实时' ? '' : this.faulttaps
  143. }
  144. getfaultsList(data).then(res => {
  145. console.log(res);
  146. if (res.status == 'ok') {
  147. this.faultsList = res.data.list
  148. this.total = res.data.pagination.total
  149. } else {
  150. }
  151. });
  152. },
  153. onclick() {
  154. uni.redirectTo({
  155. url: '/pages/index/index'
  156. });
  157. },
  158. change(e) {
  159. console.log(e);
  160. this.current = e.current
  161. this.onfaultsList()
  162. },
  163. taps(e) {
  164. this.faulttaps = e
  165. console.log(e);
  166. this.onfaultsList()
  167. },
  168. // 文字提示
  169. closedevice() {
  170. for (let i = 1; i < this.total; i++) {
  171. this.$refs[('device' + i)].close()
  172. }
  173. },
  174. close() {
  175. for (let i = 1; i < this.total; i++) {
  176. this.$refs[('tooltip' + i)].close()
  177. }
  178. }
  179. }
  180. }
  181. </script>
  182. <style lang="scss" scoped>
  183. .content {
  184. width: 100%;
  185. height: 100vh;
  186. opacity: 1;
  187. background: linear-gradient(180deg, rgba(215, 230, 245, 0) 0%, rgba(196, 229, 255, 1) 100%);
  188. box-sizing: border-box;
  189. }
  190. .top {
  191. width: 100%;
  192. height: 100px;
  193. display: flex;
  194. align-items: center;
  195. justify-content: space-between;
  196. background-size: 100% 100%;
  197. background-repeat: no-repeat;
  198. background-color: #fff;
  199. padding: 0px 46px;
  200. box-sizing: border-box;
  201. }
  202. .top_logo {
  203. width: 426px;
  204. height: 68px;
  205. }
  206. .tite {
  207. width: 277px;
  208. height: 48px;
  209. }
  210. .time {
  211. text-align: right;
  212. }
  213. .time_top {
  214. font-size: 17px;
  215. }
  216. .time_bottom {
  217. display: flex;
  218. font-size: 17px;
  219. justify-content: space-between;
  220. }
  221. .time_bottom1 {
  222. display: flex;
  223. }
  224. .time_state {
  225. font-size: 17px;
  226. font-weight: 600;
  227. color: rgba(22, 68, 144, 1);
  228. }
  229. .parameter {
  230. width: 100%;
  231. /* padding-bottom: 20px; */
  232. display: flex;
  233. padding: 0px 20px 20px 20px;
  234. display: flex;
  235. flex-direction: column;
  236. box-sizing: border-box;
  237. }
  238. .parameter_xian {
  239. width: 100%;
  240. height: 55px;
  241. background: linear-gradient(180deg, rgba(30, 131, 189, 1) 0%, rgba(69, 168, 230, 0.92) 100%);
  242. box-shadow: inset 0px 0px 9.79px rgba(0, 0, 0, 0.1);
  243. display: flex;
  244. align-items: center;
  245. /* justify-content: space-around; */
  246. font-size: 28px;
  247. font-weight: 600;
  248. padding: 0px 20px;
  249. box-sizing: border-box;
  250. .parameter_xian1 {
  251. width: 100px;
  252. }
  253. .parameter_xian2 {
  254. width: 100px;
  255. }
  256. .parameter_xian3 {
  257. width: 120px;
  258. }
  259. .parameter_xian4 {
  260. width: 400px;
  261. margin-right: 10px;
  262. white-space: nowrap;
  263. /* 禁止换行 */
  264. overflow: hidden;
  265. /* 超出部分隐藏 */
  266. text-overflow: ellipsis;
  267. /* 显示省略号 */
  268. }
  269. .parameter_xian5 {
  270. width: 220px;
  271. margin-right: 10px;
  272. }
  273. .parameter_xian6 {
  274. width: 220px;
  275. }
  276. }
  277. .parameter_box {
  278. width: 100%;
  279. overflow: auto;
  280. }
  281. .parameter_div {
  282. width: 100%;
  283. height: 46px;
  284. background: rgba(255, 255, 255, 1);
  285. box-shadow: inset 0px 0px 9.79px rgba(0, 0, 0, 0.1);
  286. margin-top: 10px;
  287. display: flex;
  288. align-items: center;
  289. /* justify-content: space-around; */
  290. font-weight: 500;
  291. padding: 0px 20px;
  292. box-sizing: border-box;
  293. .parameter_xian1 {
  294. font-size: 18px;
  295. width: 100px;
  296. }
  297. .parameter_xian2 {
  298. font-size: 18px;
  299. width: 100px;
  300. }
  301. .parameter_xian3 {
  302. font-size: 18px;
  303. width: 120px;
  304. white-space: nowrap;
  305. /* 禁止换行 */
  306. overflow: hidden;
  307. /* 超出部分隐藏 */
  308. text-overflow: ellipsis;
  309. /* 显示省略号 */
  310. margin-right: 10px;
  311. }
  312. .parameter_xian4 {
  313. font-size: 18px;
  314. width: 400px;
  315. margin-right: 10px;
  316. white-space: nowrap;
  317. /* 禁止换行 */
  318. overflow: hidden;
  319. /* 超出部分隐藏 */
  320. text-overflow: ellipsis;
  321. /* 显示省略号 */
  322. }
  323. .parameter_xian5 {
  324. font-size: 18px;
  325. width: 220px;
  326. margin-right: 10px;
  327. }
  328. .parameter_xian6 {
  329. font-size: 18px;
  330. width: 220px;
  331. }
  332. }
  333. .parameter_divred {
  334. width: 100%;
  335. height: 46px;
  336. background: rgba(245, 99, 83, 1);
  337. box-shadow: inset 0px 0px 9.79px rgba(0, 0, 0, 0.1);
  338. margin-bottom: 10px;
  339. display: flex;
  340. align-items: center;
  341. color: #fff;
  342. font-weight: 500;
  343. /* justify-content: space-around; */
  344. padding: 0px 16px;
  345. box-sizing: border-box;
  346. .parameter_xian1 {
  347. font-size: 18px;
  348. width: 100px;
  349. }
  350. .parameter_xian2 {
  351. font-size: 18px;
  352. width: 100px;
  353. }
  354. .parameter_xian3 {
  355. font-size: 18px;
  356. width: 120px;
  357. white-space: nowrap;
  358. /* 禁止换行 */
  359. overflow: hidden;
  360. /* 超出部分隐藏 */
  361. text-overflow: ellipsis;
  362. /* 显示省略号 */
  363. margin-right: 10px;
  364. }
  365. .parameter_xian4 {
  366. font-size: 18px;
  367. width: 400px;
  368. margin-right: 10px;
  369. white-space: nowrap;
  370. /* 禁止换行 */
  371. overflow: hidden;
  372. /* 超出部分隐藏 */
  373. text-overflow: ellipsis;
  374. /* 显示省略号 */
  375. }
  376. .parameter_xian5 {
  377. font-size: 18px;
  378. width: 220px;
  379. margin-right: 10px;
  380. }
  381. .parameter_xian6 {
  382. font-size: 18px;
  383. width: 220px;
  384. }
  385. }
  386. .parameter_bottom {
  387. display: flex;
  388. justify-content: space-between;
  389. margin-bottom: 10px;
  390. padding: 0px 16px;
  391. position: fixed;
  392. left: 0px;
  393. bottom: 16px;
  394. width: 100%;
  395. box-sizing: border-box;
  396. }
  397. .parameter_bottom1 {
  398. display: flex;
  399. align-items: center;
  400. image {
  401. width: 32px;
  402. height: 32px;
  403. display: flex;
  404. }
  405. }
  406. .parameter_bottom2 {
  407. font-size: 19.58px;
  408. font-weight: 400;
  409. color: rgba(0, 0, 0, 1);
  410. margin-left: 10px;
  411. }
  412. .parameter_bottom3 {
  413. display: flex;
  414. }
  415. .parameter_bottom31 {
  416. width: 48px;
  417. height: 48px;
  418. background: linear-gradient(180deg, rgba(74, 167, 224, 1) 0%, rgba(36, 134, 192, 1) 100%);
  419. border-radius: 100%;
  420. display: flex;
  421. align-items: center;
  422. justify-content: center;
  423. font-size: 19px;
  424. font-weight: 700;
  425. margin-right: 20px;
  426. color: rgba(255, 255, 255, 1);
  427. }
  428. .parameter_bottom32 {
  429. width: 48px;
  430. height: 48px;
  431. background: linear-gradient(180deg, rgba(224, 218, 218, 1) 0%, rgba(130, 121, 121, 1) 100%);
  432. border-radius: 100%;
  433. display: flex;
  434. align-items: center;
  435. justify-content: center;
  436. font-size: 19px;
  437. font-weight: 700;
  438. color: #222222;
  439. margin-right: 20px;
  440. }
  441. .parameter_bottom4 {
  442. display: flex;
  443. align-items: center;
  444. }
  445. .eliminate {
  446. width: 107.69px;
  447. height: 44.05px;
  448. opacity: 1;
  449. border-radius: 2.45px;
  450. 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%);
  451. margin-right: 20px;
  452. display: flex;
  453. align-items: center;
  454. justify-content: center;
  455. font-size: 23.5px;
  456. font-weight: 400;
  457. color: rgba(255, 255, 255, 1);
  458. box-sizing: border-box;
  459. }
  460. .time_state1 {
  461. font-size: 17px;
  462. font-weight: 600;
  463. color: rgba(217, 22, 22, 1);
  464. }
  465. </style>