From 615446ac9d8ae4c177fa5976f15ab253b23463c0 Mon Sep 17 00:00:00 2001 From: x_ying <2438792676@qq.com> Date: Tue, 16 Aug 2022 10:20:15 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=A8=E7=A6=81=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/logManage/doorLog/index.vue | 76 +++++++++++++++----- 1 file changed, 60 insertions(+), 16 deletions(-) diff --git a/src/views/system/logManage/doorLog/index.vue b/src/views/system/logManage/doorLog/index.vue index 1e533ff..a496e44 100644 --- a/src/views/system/logManage/doorLog/index.vue +++ b/src/views/system/logManage/doorLog/index.vue @@ -11,6 +11,7 @@ placeholder="请输入关键词" style="width: 300px;margin-right:10px;padding-left:10px" class="input-prepend filter-item" + @keyup.enter.native="crud.toQuery" > @@ -30,24 +31,38 @@ :data="crud.data" style="width: 100%;" height="calc(100vh - 356px)" + :cell-class-name="cell" @row-click="clickRowHandler" @selection-change="selectionChangeHandler" > - - - - + + + + + - - - + + + + + 查看监控 - - + + + + @@ -61,15 +76,16 @@ import CRUD, { presenter, crud } from '@crud/crud' import DateRangePicker from '@/components/DateRangePicker' import pagination from '@crud/Pagination' import Listen from '../module/listen.vue' - +import { exportFile } from '@/utils/index' +import { mapGetters } from 'vuex' export default { name: 'DoorLog', components: { rrOperation, DateRangePicker, pagination, Listen }, mixins: [presenter(), crud()], cruds() { return CRUD({ - url: 'api/storage/initStorageLogList', - sort: ['update_time,desc'], + url: 'api/securitydoor/initSecurityDoorLog', + // sort: ['createTime,desc'], // crudMethod: caseCrudMethod, optShow: { add: false, @@ -83,18 +99,38 @@ export default { return { selections: [], keyWord: '', - optionVal: 1, + optionVal: 'deviceName', options: [ - { value: 1, label: '设备' }, - { value: 2, label: '库房' } + { value: 'deviceName', label: '设备' }, + { value: 'roomName', label: '库房' } ], queryTime: null } }, + computed: { + ...mapGetters([ + 'baseApi' + ]) + }, methods: { + [CRUD.HOOK.beforeRefresh]() { + this.crud.query.roomName = null + this.crud.query.deviceName = null + this.crud.query.startTime = null + this.crud.query.endTime = null + if (this.optionVal === 'deviceName') { + this.crud.query.deviceName = this.keyWord + } else if (this.optionVal === 'roomName') { + this.crud.query.roomName = this.keyWord + } + this.crud.query.startTime = this.queryTime[0] + this.crud.query.endTime = this.queryTime[1] + }, // 导出 handleDownload() { - + this.crud.downloadLoading = true + exportFile(this.baseApi + '/api/securitydoor/exportSecurityDoorLogList') + this.crud.downloadLoading = false }, test() { console.log(this.crud, 'crud') @@ -108,12 +144,20 @@ export default { // 查看监控 handleListen() { this.$refs.listenDom.dialogVisible = true + }, + cell({ row, columnIndex }) { + if (row.alarmLevel === 1 && columnIndex === 2) { + return 'have-clear' + } else if (row.alarmLevel === 0 && columnIndex === 2) { + return 'fail-clear' + } } } }