FireAlarm.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  1. <template>
  2. <view class="recharge_box">
  3. <view class="search_box box">
  4. <uni-forms :modelValue="queryParams" class="search_box_from">
  5. <uni-forms-item label="告警设备:" label-width="80px" label-align="right" name="equipment">
  6. <uni-easyinput type="text" v-model="queryParams.equipment" placeholder="请输入" />
  7. </uni-forms-item>
  8. <uni-forms-item label="告警信息:" label-width="80px" label-align="right" name="info">
  9. <uni-easyinput type="text" v-model="queryParams.info" placeholder="请输入" />
  10. </uni-forms-item>
  11. <!-- <uni-forms-item label="告警时间:" name="dateArr" label-width="80px" label-align="right" class="last_box">
  12. <uni-datetime-picker v-model="dateArr" type="daterange" rangeSeparator="至" />
  13. </uni-forms-item> -->
  14. <uni-forms-item label="告警类型:" name="type" label-width="80px" label-align="right" class="select_box">
  15. <uni-data-select v-model="queryParams.type" :localdata="range" style="width: 104px;"></uni-data-select>
  16. </uni-forms-item>
  17. </uni-forms>
  18. <view class="box_btn">
  19. <view class="cx_btn" @click="handleQuery">
  20. 查询
  21. </view>
  22. <view class="cz_btn" @click="resetForm">
  23. 重置
  24. </view>
  25. </view>
  26. </view>
  27. <view class="main_table">
  28. <!-- <FaultTable :loading="loading" :datalist="datalist"></FaultTable> -->
  29. <lyy-table @faultDrawer="faultDrawer" :headerFixed="true" :showLoadMore="showLoadMore" :loadMore="loadMore" :battery="0"
  30. :columnFixed=1 :contents="datalist" :headers="headers" @onPullup="pullup">
  31. </lyy-table>
  32. </view>
  33. <!-- 顶部公共提示信息 -->
  34. <uni-popup ref="Exchangepopup" type="message">
  35. <uni-popup-message :type="popupType" :message="popupMessage" :duration="2000"></uni-popup-message>
  36. </uni-popup>
  37. <!-- 顶部提示信息结束-->
  38. <!--右侧抽屉 -->
  39. <uni-drawer ref="AlarmDrawer" mode="right" :width="400" :mask-click="true">
  40. <scroll-view style="height: 100%;" scroll-y="true">
  41. <PublicDrawer :flag="true" title="消防告警处理" @closeDrawer="closeDrawer">
  42. <view class="drawer_main">
  43. <view class="drawer_main_title">
  44. 系统检测到【电池/架载机】发生了消防问题,确认需要抓取电池吗?
  45. </view>
  46. <view class="drawer_main_tip">
  47. <text>确认消防换仓:</text>机器人执行消防换仓动作。
  48. </view>
  49. <view class="drawer_main_tip">
  50. <text>忽略:</text>放弃消防换仓。
  51. </view>
  52. <view class="btn_box">
  53. <view class="btn_box_ok" @click="alarmDispose">
  54. 确认消防换仓
  55. </view>
  56. <view class="btn_box_off" @click="closeDrawer">
  57. 忽略
  58. </view>
  59. </view>
  60. </view>
  61. </PublicDrawer>
  62. </scroll-view>
  63. </uni-drawer>
  64. <!-- 右侧抽屉结束 -->
  65. </view>
  66. </template>
  67. <script>
  68. import FaultDrawer from "./FaultDrawer.vue"
  69. export default {
  70. components: {
  71. FaultDrawer
  72. },
  73. props: ['isSlecte', 'title'],
  74. name: 'Fault',
  75. mounted() {
  76. this.alarmList()
  77. },
  78. destroyed() {
  79. this.$storage.remove('gotoname');//清除本地存储
  80. },
  81. data() {
  82. return {
  83. popupMessage: '成功消息',
  84. popupType: 'success',
  85. alarmFrom: {
  86. },
  87. range: [{
  88. value: 1,
  89. text: "充电机告警"
  90. },
  91. {
  92. value: 2,
  93. text: "BMS告警"
  94. },
  95. {
  96. value: 3,
  97. text: "机器人告警"
  98. },{
  99. value: 4,
  100. text: "消防告警"
  101. },
  102. ],
  103. datalist: [],
  104. dateArr: [],
  105. queryParams: {
  106. page: 1, //当前页
  107. pageSize: 10, //每页条数
  108. equipment: undefined, //告警设备
  109. beginTime: undefined,
  110. endTime: undefined,
  111. info:undefined,
  112. orderByWays: 'desc' //排序方式
  113. },
  114. total: 0, //总条数,
  115. loading: false,
  116. headers: [{
  117. label: '告警设备',
  118. key: 'equipment',
  119. widtd: 150
  120. },{
  121. label: '告警类型',
  122. key: 'type',
  123. widtd: 200,
  124. },{
  125. label: '告警标识',
  126. key: 'code',
  127. widtd: 150,
  128. },{
  129. label: '告警信息',
  130. key: 'info',
  131. widtd: 330
  132. }, {
  133. label: '操作',
  134. key: 'id',
  135. widtd: 120,
  136. },
  137. // {
  138. // label: '告警开始时间',
  139. // key: 'beginTime',
  140. // widtd: 196,
  141. // },
  142. ],
  143. showLoadMore: false,
  144. loadMore: 'more',
  145. }
  146. },
  147. methods: {
  148. //顶部公共消息提示
  149. ExchangeMessage(type, message) {
  150. this.popupType = type
  151. this.popupMessage = message ? message : '后端接口404错误!'
  152. this.$refs.Exchangepopup.open()
  153. },
  154. //告警处理抽屉
  155. faultDrawer(row) {
  156. console.log(row,'row')
  157. this.alarmFrom = row
  158. this.$refs.AlarmDrawer.open();
  159. },
  160. //告警处理修改
  161. alarmDispose() {
  162. console.log(this.alarmFrom)
  163. //这里数据都拿到了 接口也写好了 就看后端需要传什么参数了 参数写好放开下面的注释就行
  164. const params = {
  165. targetCode: this.alarmFrom.chargerCode,
  166. // type: this.alarmFrom.type,
  167. // remark: this.alarmFrom.remark
  168. }
  169. // this.$http.FireChangestorage(params)
  170. // .then(res => {
  171. // this.$refs.AlarmDrawer.close();
  172. // this.ExchangeMessage(res.code === 0 ? 'success' : 'error', res.msg)
  173. // }).catch(err => {
  174. // console.error(err)
  175. // })
  176. },
  177. //关闭抽屉
  178. closeDrawer() {
  179. this.$refs.AlarmDrawer.close();
  180. },
  181. //触底加载数据
  182. pullup() {
  183. this.showLoadMore = true
  184. if (this.total == this.datalist.length) {
  185. this.loadMore = 'no-more'
  186. return
  187. } else {
  188. this.queryParams.page++
  189. this.alarmList()
  190. this.loadMore = 'loading'
  191. }
  192. },
  193. //消防告警记录列表,
  194. alarmList() { //getwarnList
  195. this.$http.getwarnList(this.queryParams).then(res => {
  196. // console.log(res.data.records)
  197. this.showLoadMore = false
  198. if (res.code === 0) {
  199. res.data.list.forEach(item=>{
  200. if(item.type == 1){
  201. item.type = '充电机告警'
  202. }else if(item.type == 2){
  203. item.type = 'BMS告警'
  204. }else if(item.type == 3){
  205. item.type = '机器人告警'
  206. }else if(item.type == 4){
  207. item.type = '消防告警'
  208. }
  209. })
  210. this.datalist.push(...res.data.list)
  211. this.total = res.data.total
  212. }
  213. });
  214. },
  215. //重置
  216. resetForm() {
  217. this.dateArr = []
  218. this.queryParams = {
  219. page: 1,
  220. pageSize: 10,
  221. equipment: undefined,
  222. info: undefined,
  223. beginTime: undefined,
  224. endTime: undefined,
  225. type: undefined,
  226. orderByWays:"desc"
  227. }
  228. this.alarmList()
  229. },
  230. //查询
  231. handleQuery() {
  232. if (this.dateArr.length > 0) {
  233. this.queryParams.beginTime = this.dateArr[0] +' ' +'00:00:00'
  234. this.queryParams.endTime = this.dateArr[1]+' ' +'23:59:59'
  235. }else{
  236. this.queryParams.beginTime = undefined
  237. this.queryParams.endTime = undefined
  238. }
  239. this.queryParams.page = 1
  240. this.datalist = []
  241. this.showLoadMore = false
  242. this.alarmList()
  243. }
  244. }
  245. }
  246. </script>
  247. <style lang="scss" scoped>
  248. .drawer_main {
  249. // padding-top: 20px;
  250. .drawer_main_title{
  251. font-size: 16px;
  252. }
  253. .drawer_main_tip{
  254. font-size: 14px;
  255. margin-top: 10px;
  256. text{
  257. font-size: 16px;
  258. }
  259. }
  260. .btn_box{
  261. display: flex;
  262. font-size: 14px;
  263. margin-top: 20px;
  264. justify-content: flex-end;
  265. .btn_box_ok{
  266. width: 100px;
  267. height: 32px;
  268. background: #91FDB9;
  269. border-radius: 2px 2px 2px 2px;
  270. text-align: center;
  271. line-height: 32px;
  272. color: black;
  273. margin-right: 20px;
  274. }
  275. .btn_box_off{
  276. width: 60px;
  277. height: 32px;
  278. border-radius: 2px 2px 2px 2px;
  279. color: #fff;
  280. border: 1px solid #263042;
  281. text-align: center;
  282. line-height: 32px;
  283. }
  284. }
  285. }
  286. ::v-deep .uni-popup-message__box{
  287. height: 20px;
  288. line-height: 11px;
  289. }
  290. .main_table {
  291. width: 1040px;
  292. height: 580px;
  293. background: #111827;
  294. box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);
  295. border-radius: 2px;
  296. border: 1px solid #192337;
  297. margin-top: 16px;
  298. box-sizing: border-box;
  299. padding: 16px 20px;
  300. display: flex;
  301. flex-direction: column;
  302. overflow: hidden;
  303. }
  304. .box {
  305. width: 1040px;
  306. height: 66px;
  307. background: #111827;
  308. box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);
  309. border-radius: 2px 2px 2px 2px;
  310. border: 1px solid #192337;
  311. // margin-top: 20px;
  312. }
  313. ::v-deep .search_box_from {
  314. padding-top: 15px;
  315. span {
  316. display: flex;
  317. }
  318. }
  319. .search_box {
  320. display: flex;
  321. justify-content: space-between;
  322. .box_btn {
  323. display: flex;
  324. margin-top: 16px;
  325. padding-right: 16px;
  326. .cx_btn {
  327. width: 60px;
  328. height: 34px;
  329. text-align: center;
  330. line-height: 34px;
  331. background: #91FDB9;
  332. border-radius: 2px 2px 2px 2px;
  333. color: black;
  334. font-size: 14px;
  335. margin-right: 10px;
  336. }
  337. .cz_btn {
  338. width: 60px;
  339. height: 34px;
  340. text-align: center;
  341. line-height: 34px;
  342. border-radius: 2px 2px 2px 2px;
  343. border: 1px solid #263042;
  344. color: #fff;
  345. font-size: 14px;
  346. }
  347. }
  348. }
  349. ::v-deep .uni-forms-item__content {
  350. background: rgba(255, 255, 255, 0);
  351. border-radius: 2px 2px 2px 2px;
  352. border: 1px solid #263042;
  353. .uni-easyinput__content {
  354. background: none !important;
  355. border: none !important;
  356. color: #fff;
  357. }
  358. .uni-select__selector-item {
  359. font-size: 14px;
  360. font-weight: 400;
  361. color: #A8ADC8;
  362. }
  363. }
  364. ::v-deep .uni-forms-item__label {
  365. font-size: 14px;
  366. color: white;
  367. }
  368. ::v-deep .uni-select__selector {
  369. background: #111827;
  370. border: 1px solid #263042;
  371. color: #606266;
  372. z-index: 9999999;
  373. }
  374. ::v-deep .uni-date-x {
  375. background: none;
  376. }
  377. ::v-deep .uni-date-x--border {
  378. border: none;
  379. }
  380. ::v-deep .uni-select {
  381. border: none;
  382. }
  383. ::v-deep .uni-forms-item {
  384. width: 200px;
  385. }
  386. ::v-deep .uni-popper__arrow::after {
  387. display: none;
  388. }
  389. ::v-deep .uni-popper__arrow {
  390. display: none;
  391. }
  392. ::v-deep .uni-select__input-text {
  393. color: #fff;
  394. }
  395. ::v-deep .uni-date-x {
  396. color: #fff;
  397. }
  398. .last_box {
  399. width: 320px;
  400. }
  401. .select_box {
  402. width: 160px;
  403. }
  404. </style>