From e0bcd68f9b65a5f2bc96dfe7b45ae6e891a8fb12 Mon Sep 17 00:00:00 2001 From: x_ying <2438792676@qq.com> Date: Fri, 12 Aug 2022 17:33:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E5=BF=97=E7=AE=A1=E7=90=86-=E6=8A=A5?= =?UTF-8?q?=E8=AD=A6=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/logs.js | 12 +++ .../archivesManage/archivesCheck/index.vue | 2 - src/views/system/logManage/warnLog/index.vue | 101 ++++++++++++++---- 3 files changed, 94 insertions(+), 21 deletions(-) create mode 100644 src/api/system/logs.js diff --git a/src/api/system/logs.js b/src/api/system/logs.js new file mode 100644 index 0000000..32f75b9 --- /dev/null +++ b/src/api/system/logs.js @@ -0,0 +1,12 @@ +import request from '@/utils/request' + +// 报警日志 手动处理 +export function warnRemark(data) { + return request({ + url: 'api/alarmlog/remark', + method: 'post', + data + }) +} + +export default { warnRemark } diff --git a/src/views/archivesManage/archivesCheck/index.vue b/src/views/archivesManage/archivesCheck/index.vue index a3d6c8e..bfc24d6 100644 --- a/src/views/archivesManage/archivesCheck/index.vue +++ b/src/views/archivesManage/archivesCheck/index.vue @@ -187,8 +187,6 @@ export default { } else { this.crud.query.orderNo = this.keyWord } - console.log(this.crud.query, '2') - this.crud.downloadLoading = false }, // 删除 diff --git a/src/views/system/logManage/warnLog/index.vue b/src/views/system/logManage/warnLog/index.vue index 11daf77..8ceae55 100644 --- a/src/views/system/logManage/warnLog/index.vue +++ b/src/views/system/logManage/warnLog/index.vue @@ -15,6 +15,7 @@ placeholder="请输入关键词" style="width: 300px;margin-right:10px;padding-left:10px" class="input-prepend filter-item" + @keyup.enter.native="crud.toQuery" > @@ -34,18 +35,32 @@ :data="crud.data" style="width: 100%;" height="calc(100vh - 356px)" + :cell-class-name="cell" @row-click="clickRowHandler" @selection-change="selectionChangeHandler" > - - - - - - - + + + + + + + + + + + + + @@ -59,7 +74,7 @@ @@ -71,15 +86,15 @@ import rrOperation from '@crud/RR.operation' import CRUD, { presenter, crud } from '@crud/crud' import DateRangePicker from '@/components/DateRangePicker' import pagination from '@crud/Pagination' - +import { warnRemark } from '@/api/system/logs' export default { name: 'LoginLog', components: { rrOperation, DateRangePicker, pagination }, mixins: [presenter(), crud()], cruds() { return CRUD({ - url: 'api/storage/initStorageLogList', - sort: ['update_time,desc'], + url: 'api/alarmlog/', + sort: ['createTime,desc'], // crudMethod: caseCrudMethod, optShow: { add: false, @@ -91,14 +106,15 @@ export default { }, data() { return { + tableData: [], handleVisible: false, selections: [], keyWord: '', - oprType: 0, + oprType: -1, oprTypeOptions: [ - { value: 0, label: '全部' }, + { value: -1, label: '全部' }, { value: 1, label: '已处理' }, - { value: 2, label: '未处理' } + { value: 0, label: '未处理' } ], optionVal: 1, options: [ @@ -111,12 +127,27 @@ export default { }, rules: { description: [ - { required: true, message: '请输入内容', trigger: 'blur' } + { required: true, message: '说明不能为空', trigger: 'blur' } ] } } }, methods: { + // 获取数据前的处理 + [CRUD.HOOK.beforeRefresh]() { + this.crud.downloadLoading = true + this.crud.query.state = null + this.crud.query.blurry = this.keyWord + if (this.oprType > -1) { + this.crud.query.state = this.oprType + } + console.log(this.crud.query, '--') + this.crud.downloadLoading = false + }, + getData() { + const arr = this.crud.data + console.log(arr, 'arr') + }, // 导出 handleDownload() { @@ -132,24 +163,56 @@ export default { }, // 手动处理 handleHand() { + this.form.description = this.selections[0].remark this.handleVisible = true }, - handleConfirm() { + handleSave() { + const row = this.selections[0] + const params = { + 'id': row.id, + // 'storeroom_name': row.storeroomName, + 'state': true, + // 'device_id': row.deviceId, + // 'device_name': row.deviceName, + // 'content': row.content, + 'remark': this.form.description + } + console.log(params) this.$refs.formDom.validate((valid) => { if (valid) { - this.handleVisible = false - this.$refs.formDom.resetFields() - this.$refs.formDom.clearValidate() + warnRemark(params).then(res => { + console.log(res, '手动处理') + if (res === 'SUCCESS') { + this.crud.refresh() + this.$message({ + message: '处理成功', + type: 'success' + }) + this.handleVisible = false + this.$refs.formDom.resetFields() + this.$refs.formDom.clearValidate() + } else { + this.$message.error('处理失败') + } + }) } else { return false } }) + }, + cell({ row, columnIndex }) { + if (row.state === true && columnIndex === 2) { + return 'have-clear' + } else if (row.state === false && columnIndex === 2) { + return 'fail-clear' + } } } }