Browse Source

日志管理-报警日志

master
x_ying 3 years ago
parent
commit
e0bcd68f9b
  1. 12
      src/api/system/logs.js
  2. 2
      src/views/archivesManage/archivesCheck/index.vue
  3. 101
      src/views/system/logManage/warnLog/index.vue

12
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 }

2
src/views/archivesManage/archivesCheck/index.vue

@ -187,8 +187,6 @@ export default {
} else { } else {
this.crud.query.orderNo = this.keyWord this.crud.query.orderNo = this.keyWord
} }
console.log(this.crud.query, '2')
this.crud.downloadLoading = false this.crud.downloadLoading = false
}, },
// //

101
src/views/system/logManage/warnLog/index.vue

@ -15,6 +15,7 @@
placeholder="请输入关键词" placeholder="请输入关键词"
style="width: 300px;margin-right:10px;padding-left:10px" style="width: 300px;margin-right:10px;padding-left:10px"
class="input-prepend filter-item" class="input-prepend filter-item"
@keyup.enter.native="crud.toQuery"
> >
<!-- <el-select slot="prepend" v-model="optionVal" style="width: 100px" @keyup.enter.native="crud.toQuery"> --> <!-- <el-select slot="prepend" v-model="optionVal" style="width: 100px" @keyup.enter.native="crud.toQuery"> -->
<el-select slot="prepend" v-model="optionVal" style="width: 80px"> <el-select slot="prepend" v-model="optionVal" style="width: 80px">
@ -34,18 +35,32 @@
:data="crud.data" :data="crud.data"
style="width: 100%;" style="width: 100%;"
height="calc(100vh - 356px)" height="calc(100vh - 356px)"
:cell-class-name="cell"
@row-click="clickRowHandler" @row-click="clickRowHandler"
@selection-change="selectionChangeHandler" @selection-change="selectionChangeHandler"
> >
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column type="index" label="序号" width="100" align="center" /> <el-table-column type="index" label="序号" width="100" align="center" />
<el-table-column prop="" label="状态" min-width="150" align="center" />
<el-table-column prop="" label="库房" align="center" min-width="150" />
<el-table-column prop="" label="设备" align="center" min-width="150" />
<el-table-column prop="" label="警情描述" align="center" min-width="180" />
<el-table-column prop="" label="说明" align="center" min-width="180" />
<el-table-column prop="" label="报警时间" align="center" min-width="180" />
<el-table-column prop="" label="处理时间" align="center" min-width="180" />
<el-table-column prop="state" label="状态" min-width="150" align="center">
<template slot-scope="scope">
<span v-if="scope.row.state" class="clear">已处理</span>
<span v-if="!scope.row.state" class="clear">未处理</span>
</template>
</el-table-column>
<el-table-column prop="storeroomName" label="库房" align="center" min-width="150" />
<el-table-column prop="deviceName" label="设备" align="center" min-width="150" />
<el-table-column prop="content" label="警情描述" align="center" min-width="180" />
<el-table-column prop="remark" label="说明" align="center" min-width="180" />
<el-table-column prop="create_time" label="报警时间" align="center" min-width="180">
<template slot-scope="scope">
<div>{{ scope.row.create_time | parseTime }}</div>
</template>
</el-table-column>
<el-table-column prop="update_time" label="处理时间" align="center" min-width="180">
<template slot-scope="scope">
<div>{{ scope.row.update_time | parseTime }}</div>
</template>
</el-table-column>
</el-table> </el-table>
<pagination /> <pagination />
<!-- 手动处理 --> <!-- 手动处理 -->
@ -59,7 +74,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleConfirm">确定</el-button>
<el-button type="primary" @click="handleSave">保存</el-button>
</div> </div>
</div> </div>
</el-dialog> </el-dialog>
@ -71,15 +86,15 @@ import rrOperation from '@crud/RR.operation'
import CRUD, { presenter, crud } from '@crud/crud' import CRUD, { presenter, crud } from '@crud/crud'
import DateRangePicker from '@/components/DateRangePicker' import DateRangePicker from '@/components/DateRangePicker'
import pagination from '@crud/Pagination' import pagination from '@crud/Pagination'
import { warnRemark } from '@/api/system/logs'
export default { export default {
name: 'LoginLog', name: 'LoginLog',
components: { rrOperation, DateRangePicker, pagination }, components: { rrOperation, DateRangePicker, pagination },
mixins: [presenter(), crud()], mixins: [presenter(), crud()],
cruds() { cruds() {
return CRUD({ return CRUD({
url: 'api/storage/initStorageLogList',
sort: ['update_time,desc'],
url: 'api/alarmlog/',
sort: ['createTime,desc'],
// crudMethod: caseCrudMethod, // crudMethod: caseCrudMethod,
optShow: { optShow: {
add: false, add: false,
@ -91,14 +106,15 @@ export default {
}, },
data() { data() {
return { return {
tableData: [],
handleVisible: false, handleVisible: false,
selections: [], selections: [],
keyWord: '', keyWord: '',
oprType: 0,
oprType: -1,
oprTypeOptions: [ oprTypeOptions: [
{ value: 0, label: '全部' },
{ value: -1, label: '全部' },
{ value: 1, label: '已处理' }, { value: 1, label: '已处理' },
{ value: 2, label: '未处理' }
{ value: 0, label: '未处理' }
], ],
optionVal: 1, optionVal: 1,
options: [ options: [
@ -111,12 +127,27 @@ export default {
}, },
rules: { rules: {
description: [ description: [
{ required: true, message: '请输入内容', trigger: 'blur' }
{ required: true, message: '说明不能为空', trigger: 'blur' }
] ]
} }
} }
}, },
methods: { 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() { handleDownload() {
@ -132,24 +163,56 @@ export default {
}, },
// //
handleHand() { handleHand() {
this.form.description = this.selections[0].remark
this.handleVisible = true 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) => { this.$refs.formDom.validate((valid) => {
if (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 { } else {
return false return false
} }
}) })
},
cell({ row, columnIndex }) {
if (row.state === true && columnIndex === 2) {
return 'have-clear'
} else if (row.state === false && columnIndex === 2) {
return 'fail-clear'
}
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '~@/assets/styles/lend-manage.scss';
@import "~@/assets/styles/archives-manage.scss"; @import "~@/assets/styles/archives-manage.scss";
textarea{ textarea{
background-color: #021941; background-color: #021941;

Loading…
Cancel
Save