parent
1df8b976c1
commit
7aa283ebdf
11 changed files with 513 additions and 153 deletions
@ -0,0 +1,214 @@ |
||||
<template> |
||||
<!-- 图纸分类管理 --> |
||||
<basic-container> |
||||
<div style="font-size: 28px;margin-bottom: 20px;">故障上报列表</div> |
||||
<el-row> |
||||
<el-col :span="24"> |
||||
<avue-crud :option="option" :table-loading="loading" :data="data" ref="crud" v-model="form" |
||||
:permission="permissionList" @search-change="searchChange" @search-reset="searchReset" |
||||
@current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" |
||||
@on-load="onLoad" :page.sync="page" @row-save="rowSave" @row-del="rowDel" @row-update="rowUpdate"> |
||||
<template slot-scope="scope" slot="ipSearch"> |
||||
<el-input v-model="ip" placeholder="故障上报IP" clearable /> |
||||
</template> |
||||
<template slot-scope="scope" slot="isDeplaySearch"> |
||||
<el-select v-model="isDeplay" placeholder="是否已处理"> |
||||
<el-option label="未处理" :value="1"></el-option> |
||||
<el-option label="已处理" :value="2"></el-option> |
||||
</el-select> |
||||
</template> |
||||
<template slot-scope="scope" slot="dateRangeSearch"> |
||||
<el-date-picker v-model="dateRange" type="daterange" placeholder="选择日期" |
||||
value-format="yyyy-MM-dd" format="yyyy-MM-dd" start-placeholder="开始日期" |
||||
end-placeholder="结束日期">> |
||||
</el-date-picker> |
||||
</template> |
||||
<template slot="status" slot-scope="scope"> |
||||
<el-tag v-if="scope.row.status == 2" type="success">已处理</el-tag> |
||||
<el-tag v-if="scope.row.status == 1" type="danger">未处理</el-tag> |
||||
</template> |
||||
<template slot-scope="{type,size,row}" slot="menu"> |
||||
<el-button :disabled="row.status == 2" :size="size" :type="type" @click="handleDispose(row)">处理</el-button> |
||||
</template> |
||||
</avue-crud> |
||||
</el-col> |
||||
</el-row> |
||||
</basic-container> |
||||
|
||||
</template> |
||||
|
||||
<script> |
||||
import {getAlarmList,disposeAlarm} from "@/api/alarm/alarm" |
||||
export default{ |
||||
data(){ |
||||
return { |
||||
area: "1", |
||||
equipName:'', |
||||
page: { |
||||
pageSize: 10, |
||||
currentPage: 1, |
||||
total: 0, |
||||
}, |
||||
ip:'', |
||||
isDeplay:'', |
||||
dateRange:[], |
||||
option: { |
||||
lazy: true, |
||||
tip: false, |
||||
searchLabelWidth: 80, |
||||
searchShow: true, |
||||
searchMenuSpan: 6, |
||||
tree: true, |
||||
border: true, |
||||
index: true, |
||||
dialogClickModal: false, |
||||
viewBtn: false, |
||||
addBtn:false, |
||||
editBtn:false, |
||||
delBtn:false, |
||||
menu: true, |
||||
column: [ |
||||
{ |
||||
label: "故障上报IP", |
||||
prop: "deviceId", |
||||
align: "center", |
||||
}, |
||||
{ |
||||
label: "故障上报IP", |
||||
prop: "ip", |
||||
searchLabelWidth:100, |
||||
align: "center", |
||||
search: true, |
||||
searchslot: true, |
||||
type: "select", |
||||
hide: true, |
||||
row: false, |
||||
display: false, |
||||
viewDisplay: false, |
||||
}, |
||||
{ |
||||
label: "故障详情", |
||||
prop: "content", |
||||
align: "center", |
||||
}, |
||||
{ |
||||
label: "是否已处理", |
||||
prop: "status", |
||||
align: "center", |
||||
rules: [{ |
||||
required: true, |
||||
message: "请输入分类名称", |
||||
trigger: "blur" |
||||
}] |
||||
}, |
||||
{ |
||||
label: "是否已处理", |
||||
searchLabelWidth:100, |
||||
prop: "isDeplay", |
||||
searchslot: true, |
||||
search: true, |
||||
type: "select", |
||||
hide: true, |
||||
row: false, |
||||
display: false, |
||||
viewDisplay: false, |
||||
}, |
||||
{ |
||||
label: "故障上报时间", |
||||
prop: "createTime", |
||||
align: "center", |
||||
addDisplay:false, |
||||
editDisplay:false |
||||
}, |
||||
{ |
||||
label: "日期范围", |
||||
prop: "dateRange", |
||||
type: 'datetimerange', |
||||
searchslot: true, |
||||
searchRange: true, |
||||
hide: true, |
||||
search: true, |
||||
row: false, |
||||
display: false, |
||||
viewDisplay: false, |
||||
}, |
||||
], |
||||
}, |
||||
data:[], |
||||
loading:false |
||||
} |
||||
}, |
||||
created(){}, |
||||
methods:{ |
||||
searchChange(params, done) { |
||||
this.page.currentPage = 1; |
||||
this.onLoad(); |
||||
done(); |
||||
}, |
||||
searchReset() { |
||||
this.ip = '' |
||||
this.isDeplay = '' |
||||
this.dateRange = [] |
||||
this.page.currentPage = 1; |
||||
this.onLoad(this.page); |
||||
}, |
||||
currentChange(currentPage) { |
||||
this.page.currentPage = currentPage; |
||||
}, |
||||
sizeChange(pageSize) { |
||||
this.page.pageSize = pageSize; |
||||
}, |
||||
refreshChange() { |
||||
this.onLoad(); |
||||
}, |
||||
onLoad() { |
||||
let params = {} |
||||
if(this.dateRange.length == 0){ |
||||
params = { |
||||
deviceId:this.ip ? this.ip : null, |
||||
status:this.isDeplay ? this.isDeplay : null, |
||||
current:this.page.currentPage, |
||||
size:this.page.pageSize, |
||||
type:5 |
||||
} |
||||
}else{ |
||||
params = { |
||||
deviceId:this.ip ? this.ip : null, |
||||
status:this.isDeplay ? this.isDeplay : null, |
||||
current:this.page.currentPage, |
||||
size:this.page.pageSize, |
||||
type:5, |
||||
startTime:this.dateRange[0] + ' 00:00:00', |
||||
endTime:this.dateRange[1] + ' 23:59:59' |
||||
} |
||||
} |
||||
this.loading = true; |
||||
getAlarmList(params).then(res =>{ |
||||
this.data = res.data.data.records; |
||||
this.page.total = res.data.data.total; |
||||
this.loading = false |
||||
}) |
||||
}, |
||||
handleDispose(val){ |
||||
console.log('val ====>',val) |
||||
this.$confirm('确定处理该故障?', '提示', { |
||||
confirmButtonText: '确定', |
||||
cancelButtonText: '取消', |
||||
type: 'warning' |
||||
}).then(() => { |
||||
let tmp = {id:val.id,status:2} |
||||
console.log(JSON.stringify(tmp)) |
||||
disposeAlarm(JSON.stringify(tmp)).then(res =>{ |
||||
console.log('res ====>',res) |
||||
if(res.data.code == 200){ |
||||
this.$message.success('处理成功') |
||||
this.onLoad() |
||||
} |
||||
}) |
||||
}) |
||||
}, |
||||
}, |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss" scoped></style> |
||||
Loading…
Reference in new issue