FireAlarm.vue 9.7 KB

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