123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433 |
- <template>
- <view class="recharge_box">
- <view class="search_box box">
- <uni-forms :modelValue="queryParams" class="search_box_from">
- <uni-forms-item label="告警设备:" label-width="80px" label-align="right" name="equipment">
- <uni-easyinput type="text" v-model="queryParams.equipment" placeholder="请输入" />
- </uni-forms-item>
- <uni-forms-item label="告警信息:" label-width="80px" label-align="right" name="info">
- <uni-easyinput type="text" v-model="queryParams.info" placeholder="请输入" />
- </uni-forms-item>
- <!-- <uni-forms-item label="告警时间:" name="dateArr" label-width="80px" label-align="right" class="last_box">
- <uni-datetime-picker v-model="dateArr" type="daterange" rangeSeparator="至" />
- </uni-forms-item> -->
- <uni-forms-item label="告警类型:" name="type" label-width="80px" label-align="right" class="select_box">
- <uni-data-select v-model="queryParams.type" :localdata="range" style="width: 104px;"></uni-data-select>
- </uni-forms-item>
- </uni-forms>
- <view class="box_btn">
- <view class="cx_btn" @click="handleQuery">
- 查询
- </view>
- <view class="cz_btn" @click="resetForm">
- 重置
- </view>
- </view>
- </view>
- <view class="main_table">
- <!-- <FaultTable :loading="loading" :datalist="datalist"></FaultTable> -->
- <lyy-table @faultDrawer="faultDrawer" :headerFixed="true" :showLoadMore="showLoadMore" :loadMore="loadMore" :battery="0"
- :columnFixed=1 :contents="datalist" :headers="headers" @onPullup="pullup">
- </lyy-table>
- </view>
- <!-- 顶部公共提示信息 -->
- <uni-popup ref="Exchangepopup" type="message">
- <uni-popup-message :type="popupType" :message="popupMessage" :duration="2000"></uni-popup-message>
- </uni-popup>
- <!-- 顶部提示信息结束-->
- <!--右侧抽屉 -->
- <uni-drawer ref="AlarmDrawer" mode="right" :width="400" :mask-click="true">
- <scroll-view style="height: 100%;" scroll-y="true">
- <PublicDrawer :flag="true" title="消防告警处理" @closeDrawer="closeDrawer">
- <view class="drawer_main">
- <view class="drawer_main_title">
- 系统检测到【电池/架载机】发生了消防问题,确认需要抓取电池吗?
- </view>
- <view class="drawer_main_tip">
- <text>确认消防换仓:</text>机器人执行消防换仓动作。
- </view>
- <view class="drawer_main_tip">
- <text>忽略:</text>放弃消防换仓。
- </view>
- <view class="btn_box">
- <view class="btn_box_ok" @click="alarmDispose">
- 确认消防换仓
- </view>
- <view class="btn_box_off" @click="closeDrawer">
- 忽略
- </view>
- </view>
- </view>
- </PublicDrawer>
- </scroll-view>
- </uni-drawer>
- <!-- 右侧抽屉结束 -->
- </view>
- </template>
- <script>
- import FaultDrawer from "./FaultDrawer.vue"
- export default {
- components: {
- FaultDrawer
- },
- props: ['isSlecte', 'title'],
- name: 'Fault',
- mounted() {
- this.alarmList()
- },
- destroyed() {
- this.$storage.remove('gotoname');//清除本地存储
- },
- data() {
- return {
- popupMessage: '成功消息',
- popupType: 'success',
- alarmFrom: {
-
- },
- range: [{
- value: 1,
- text: "充电机告警"
- },
- {
- value: 2,
- text: "BMS告警"
- },
- {
- value: 3,
- text: "机器人告警"
- },{
- value: 4,
- text: "消防告警"
- },
- ],
- datalist: [],
- dateArr: [],
- queryParams: {
- page: 1, //当前页
- pageSize: 10, //每页条数
- equipment: undefined, //告警设备
- beginTime: undefined,
- endTime: undefined,
- info:undefined,
- orderByWays: 'desc' //排序方式
- },
- total: 0, //总条数,
- loading: false,
- headers: [{
- label: '告警设备',
- key: 'equipment',
- widtd: 150
- },{
- label: '告警类型',
- key: 'type',
- widtd: 200,
- },{
- label: '告警标识',
- key: 'code',
- widtd: 150,
- },{
- label: '告警信息',
- key: 'info',
- widtd: 330
- }, {
- label: '操作',
- key: 'id',
- widtd: 120,
- },
- // {
- // label: '告警开始时间',
- // key: 'beginTime',
- // widtd: 196,
- // },
- ],
- showLoadMore: false,
- loadMore: 'more',
- }
- },
- methods: {
- //顶部公共消息提示
- ExchangeMessage(type, message) {
- this.popupType = type
- this.popupMessage = message ? message : '后端接口404错误!'
- this.$refs.Exchangepopup.open()
- },
- //告警处理抽屉
- faultDrawer(row) {
- console.log(row,'row')
- this.alarmFrom = row
- this.$refs.AlarmDrawer.open();
- },
- //告警处理修改
- alarmDispose() {
- console.log(this.alarmFrom)
- //这里数据都拿到了 接口也写好了 就看后端需要传什么参数了 参数写好放开下面的注释就行
- const params = {
- targetCode: this.alarmFrom.chargerCode,
- // type: this.alarmFrom.type,
- // remark: this.alarmFrom.remark
- }
- // this.$http.FireChangestorage(params)
- // .then(res => {
- // this.$refs.AlarmDrawer.close();
- // this.ExchangeMessage(res.code === 0 ? 'success' : 'error', res.msg)
- // }).catch(err => {
- // console.error(err)
- // })
- },
- //关闭抽屉
- closeDrawer() {
- this.$refs.AlarmDrawer.close();
- },
- //触底加载数据
- pullup() {
- this.showLoadMore = true
- if (this.total == this.datalist.length) {
- this.loadMore = 'no-more'
- return
- } else {
- this.queryParams.page++
- this.alarmList()
- this.loadMore = 'loading'
- }
- },
- //消防告警记录列表,
- alarmList() { //getwarnList
- this.$http.getwarnList(this.queryParams).then(res => {
- // console.log(res.data.records)
- this.showLoadMore = false
- if (res.code === 0) {
- res.data.list.forEach(item=>{
- if(item.type == 1){
- item.type = '充电机告警'
- }else if(item.type == 2){
- item.type = 'BMS告警'
- }else if(item.type == 3){
- item.type = '机器人告警'
- }else if(item.type == 4){
- item.type = '消防告警'
- }
- })
- this.datalist.push(...res.data.list)
- this.total = res.data.total
- }
- });
- },
-
- //重置
- resetForm() {
- this.dateArr = []
- this.queryParams = {
- page: 1,
- pageSize: 10,
- equipment: undefined,
- info: undefined,
- beginTime: undefined,
- endTime: undefined,
- type: undefined,
- orderByWays:"desc"
- }
- this.alarmList()
- },
- //查询
- handleQuery() {
- if (this.dateArr.length > 0) {
- this.queryParams.beginTime = this.dateArr[0] +' ' +'00:00:00'
- this.queryParams.endTime = this.dateArr[1]+' ' +'23:59:59'
- }else{
- this.queryParams.beginTime = undefined
- this.queryParams.endTime = undefined
- }
- this.queryParams.page = 1
- this.datalist = []
- this.showLoadMore = false
- this.alarmList()
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .drawer_main {
- // padding-top: 20px;
- .drawer_main_title{
- font-size: 16px;
- }
- .drawer_main_tip{
- font-size: 14px;
- margin-top: 10px;
- text{
- font-size: 16px;
- }
- }
- .btn_box{
- display: flex;
- font-size: 14px;
- margin-top: 20px;
- justify-content: flex-end;
- .btn_box_ok{
- width: 100px;
- height: 32px;
- background: #91FDB9;
- border-radius: 2px 2px 2px 2px;
- text-align: center;
- line-height: 32px;
- color: black;
- margin-right: 20px;
-
- }
- .btn_box_off{
- width: 60px;
- height: 32px;
- border-radius: 2px 2px 2px 2px;
- color: #fff;
- border: 1px solid #263042;
- text-align: center;
- line-height: 32px;
- }
- }
- }
- ::v-deep .uni-popup-message__box{
- height: 20px;
- line-height: 11px;
- }
- .main_table {
- width: 1040px;
- height: 580px;
- background: #111827;
- box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);
- border-radius: 2px;
- border: 1px solid #192337;
- margin-top: 16px;
- box-sizing: border-box;
- padding: 16px 20px;
- display: flex;
- flex-direction: column;
- overflow: hidden;
- }
- .box {
- width: 1040px;
- height: 66px;
- background: #111827;
- box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);
- border-radius: 2px 2px 2px 2px;
- border: 1px solid #192337;
- // margin-top: 20px;
- }
- ::v-deep .search_box_from {
- padding-top: 15px;
- span {
- display: flex;
- }
- }
- .search_box {
- display: flex;
- justify-content: space-between;
- .box_btn {
- display: flex;
- margin-top: 16px;
- padding-right: 16px;
- .cx_btn {
- width: 60px;
- height: 34px;
- text-align: center;
- line-height: 34px;
- background: #91FDB9;
- border-radius: 2px 2px 2px 2px;
- color: black;
- font-size: 14px;
- margin-right: 10px;
- }
- .cz_btn {
- width: 60px;
- height: 34px;
- text-align: center;
- line-height: 34px;
- border-radius: 2px 2px 2px 2px;
- border: 1px solid #263042;
- color: #fff;
- font-size: 14px;
- }
- }
- }
- ::v-deep .uni-forms-item__content {
- background: rgba(255, 255, 255, 0);
- border-radius: 2px 2px 2px 2px;
- border: 1px solid #263042;
- .uni-easyinput__content {
- background: none !important;
- border: none !important;
- color: #fff;
- }
- .uni-select__selector-item {
- font-size: 14px;
- font-weight: 400;
- color: #A8ADC8;
- }
- }
- ::v-deep .uni-forms-item__label {
- font-size: 14px;
- color: white;
- }
- ::v-deep .uni-select__selector {
- background: #111827;
- border: 1px solid #263042;
- color: #606266;
- z-index: 9999999;
- }
- ::v-deep .uni-date-x {
- background: none;
- }
- ::v-deep .uni-date-x--border {
- border: none;
- }
- ::v-deep .uni-select {
- border: none;
- }
- ::v-deep .uni-forms-item {
- width: 200px;
- }
- ::v-deep .uni-popper__arrow::after {
- display: none;
- }
- ::v-deep .uni-popper__arrow {
- display: none;
- }
- ::v-deep .uni-select__input-text {
- color: #fff;
- }
- ::v-deep .uni-date-x {
- color: #fff;
- }
- .last_box {
- width: 320px;
- }
- .select_box {
- width: 160px;
- }
- </style>
|