|
|
@ -15,6 +15,7 @@ |
|
|
|
placeholder="请输入关键词" |
|
|
|
style="width: 300px;margin-right:10px;padding-left:10px" |
|
|
|
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: 80px"> |
|
|
@ -34,18 +35,32 @@ |
|
|
|
:data="crud.data" |
|
|
|
style="width: 100%;" |
|
|
|
height="calc(100vh - 356px)" |
|
|
|
:cell-class-name="cell" |
|
|
|
@row-click="clickRowHandler" |
|
|
|
@selection-change="selectionChangeHandler" |
|
|
|
> |
|
|
|
<el-table-column type="selection" width="55" 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> |
|
|
|
<pagination /> |
|
|
|
<!-- 手动处理 --> |
|
|
@ -59,7 +74,7 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button type="primary" @click="handleConfirm">确定</el-button> |
|
|
|
<el-button type="primary" @click="handleSave">保存</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
@ -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' |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|
@import '~@/assets/styles/lend-manage.scss'; |
|
|
|
@import "~@/assets/styles/archives-manage.scss"; |
|
|
|
textarea{ |
|
|
|
background-color: #021941; |
|
|
|