移动储能车V1版本
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.vue 10KB

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