@ -0,0 +1,11 @@ |
|||||
|
|
||||
|
export const _formList = [ |
||||
|
{ |
||||
|
label: "设备名称:", |
||||
|
key: "deviceName", |
||||
|
type: "input", |
||||
|
options: { |
||||
|
placeholder: "", |
||||
|
} |
||||
|
}, |
||||
|
]; |
@ -0,0 +1,156 @@ |
|||||
|
<template> |
||||
|
<Dialog v-model="modelVisible" style="z-index: 2050;" title="设备异常" width="650px"> |
||||
|
<div class="dialogDeviceOffline" > |
||||
|
<!-- <Form ref="FormConfigRef" :formList="formList" :dFormData="info" label-width="110px" /> |
||||
|
{{info}} --> |
||||
|
<el-row style="width:90%;margin-top:15px;margin-right:10%;"> |
||||
|
<el-col :span="4" style="text-align:right;color:#00d1ff;">设备名称:</el-col> |
||||
|
<el-col :span="6">{{info.deviceName}}</el-col> |
||||
|
<el-col :span="3" style="text-align:right;color:#00d1ff;">设备类型:</el-col> |
||||
|
<el-col :span="6">{{info.deviceTypeName}}</el-col> |
||||
|
</el-row> |
||||
|
<el-row style="width:90%;margin-top:15px;margin-right:10%;"> |
||||
|
<el-col :span="4" style="text-align:right;color:#00d1ff;">方向:</el-col> |
||||
|
<el-col :span="6">{{info.directionName}}</el-col> |
||||
|
<el-col :span="3" style="text-align:right;color:#00d1ff;">桩号:</el-col> |
||||
|
<el-col :span="6">{{info.stakeMark}}</el-col> |
||||
|
</el-row> |
||||
|
<el-row style="width:90%;margin-top:15px;margin-right:10%;"> |
||||
|
<el-col :span="4" style="text-align:right;color:#00d1ff;">设备归属类型:</el-col> |
||||
|
<el-col :span="6">{{info.facilitiesTypeName}}</el-col> |
||||
|
<el-col :span="3" style="text-align:right;color:#00d1ff;">安装位置:</el-col> |
||||
|
<el-col :span="6">{{info.installationSite}}</el-col> |
||||
|
</el-row> |
||||
|
<el-row style="width:90%;margin-top:15px;margin-right:10%;"> |
||||
|
<el-col :span="4" style="text-align:right;color:#00d1ff;">时间:</el-col> |
||||
|
<el-col :span="6">{{info.warningTime}}</el-col> |
||||
|
<el-col :span="3" style="text-align:right;color:#00d1ff;">状态:</el-col> |
||||
|
<el-col :span="6">{{info.stateName}}</el-col> |
||||
|
</el-row> |
||||
|
</div> |
||||
|
<template #footer> |
||||
|
<Button :style="{ marginTop: '30px', backgroundColor: '#0e708b', padding: '0 24px' }" |
||||
|
@click.native="modelVisible = false">取消</Button> |
||||
|
<Button :loading="submitLoading" v-if="info.status==='0'" style="margin-top: 30px;padding: 0 24px" |
||||
|
@click.native="updateEvent">处置</Button> |
||||
|
|
||||
|
</template> |
||||
|
</Dialog> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import Dialog from "@screen/components/Dialog/index"; |
||||
|
import Form from "@screen/components/FormConfig"; |
||||
|
import Button from "@screen/components/Buttons/Button.vue"; |
||||
|
import request from "@/utils/request"; |
||||
|
var moment = require("moment"); |
||||
|
import { |
||||
|
deviceTypeOptions |
||||
|
} from "@screen/utils/enum.js"; |
||||
|
|
||||
|
export default { |
||||
|
name: "DialogDeviceOffline", |
||||
|
components: { |
||||
|
Dialog, |
||||
|
Form, |
||||
|
Button, |
||||
|
}, |
||||
|
model: { |
||||
|
prop: "visible", |
||||
|
event: "update:value", |
||||
|
}, |
||||
|
props: { |
||||
|
visible: Boolean, |
||||
|
activeId: String, |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
data() { |
||||
|
return { |
||||
|
info: {}, |
||||
|
source:{}, |
||||
|
submitLoading: false, |
||||
|
}; |
||||
|
}, |
||||
|
computed: { |
||||
|
modelVisible: { |
||||
|
get() { |
||||
|
if (this.visible) { |
||||
|
this.getInfo(this.activeId) |
||||
|
} |
||||
|
return this.visible; |
||||
|
}, |
||||
|
set(val) { |
||||
|
this.$emit("update:value", val); |
||||
|
}, |
||||
|
}, |
||||
|
}, |
||||
|
methods: { |
||||
|
getInfo(id) { |
||||
|
if(id && id !== ''){ |
||||
|
|
||||
|
request({ |
||||
|
url:`deviceOfflineRecord/${id}`, |
||||
|
method:'get', |
||||
|
}).then(res=>{ |
||||
|
this.source = res.data; |
||||
|
const e = _.cloneDeep(res.data); |
||||
|
const enum_facilitiesType = { |
||||
|
0: '默认', |
||||
|
1: '道路沿线', |
||||
|
2: '桥梁', |
||||
|
3: '隧道', |
||||
|
4: '收费广场', |
||||
|
5: '收费站', |
||||
|
6: '服务区' |
||||
|
} |
||||
|
e.deviceTypeName = _.find(deviceTypeOptions,{value:parseInt(e.deviceType)}).label |
||||
|
e.directionName = e.direction==='1'?'菏泽方向':'济南方向' |
||||
|
e.warningTime = moment(e.createTime).format('YYYY-MM-DD HH:mm:ss') |
||||
|
e.stateName = (e.status==='0'?'未处理':(e.status==='1'?'已处理':'自动处理')) |
||||
|
e.facilitiesTypeName = enum_facilitiesType[e.facilitiesType] |
||||
|
this.info = e; |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
updateEvent() { |
||||
|
this.submitLoading = true; |
||||
|
const self = this; |
||||
|
this.$confirm(`是否确认处理设备【${this.source['deviceName']}】异常?`, "异常处理", { |
||||
|
confirmButtonText: "处理", |
||||
|
cancelButtonText: "取消", |
||||
|
type: "warning" |
||||
|
}).then(function() { |
||||
|
request({ |
||||
|
url: `/deviceOfflineRecord`, |
||||
|
method: 'put', |
||||
|
data:{ |
||||
|
...self.source, |
||||
|
status:'1' |
||||
|
} |
||||
|
}).then(res=>{ |
||||
|
self.$message.success('操作成功') |
||||
|
self.submitLoading = false; |
||||
|
self.modelVisible = false; |
||||
|
}) |
||||
|
}).catch(function() {}); |
||||
|
|
||||
|
}, |
||||
|
}, |
||||
|
|
||||
|
}; |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.dialogDeviceOffline { |
||||
|
display: flex; |
||||
|
gap: 9px; |
||||
|
width: 905px; |
||||
|
// height: 768px; |
||||
|
flex-direction: column; |
||||
|
justify-content: center; |
||||
|
align-items: center; |
||||
|
font-size:18px; |
||||
|
} |
||||
|
</style> |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 131 KiB |
After Width: | Height: | Size: 128 KiB |
@ -0,0 +1,32 @@ |
|||||
|
// import * as PresetFormItems from "@screen/pages/control/event/event/FormEvent/PresetFormItems.js";
|
||||
|
import * as PresetFormItems from "@screen/common/PresetFormItems.js"; |
||||
|
// import { merge, cloneDeep } from "lodash";
|
||||
|
|
||||
|
import {directionOptions} from '@screen/utils/enum.js'; |
||||
|
export const searchFormList = [ |
||||
|
{ |
||||
|
label: "处理状态:", |
||||
|
key: "status", |
||||
|
type: "select", |
||||
|
options: { |
||||
|
clearable: true, |
||||
|
options: [ |
||||
|
{key:'0', label:'未处理'}, |
||||
|
{key:'1', label:'已处理'}, |
||||
|
{key:'2', label:'自动处理'} |
||||
|
], |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: "发生时间:", |
||||
|
key: "createTime", |
||||
|
required: false, |
||||
|
type: "datePicker", |
||||
|
options: { |
||||
|
type: "daterange", |
||||
|
format: "yyyy-MM-dd", |
||||
|
valueFormat: "yyyy-MM-dd", |
||||
|
}, |
||||
|
}, |
||||
|
|
||||
|
]; |
@ -0,0 +1,242 @@ |
|||||
|
<template> |
||||
|
<div class='board_record'> |
||||
|
<!-- 搜索栏 --> |
||||
|
<div class="filter"> |
||||
|
<div> |
||||
|
<ButtonGradient @click="onRefreshForm" class="refresh-btn"> |
||||
|
<template #prefix> |
||||
|
<img src="@screen/images/refresh.svg" /> |
||||
|
</template> |
||||
|
刷新 |
||||
|
</ButtonGradient> |
||||
|
</div> |
||||
|
|
||||
|
<InputSearch ref="searchComp" style="width: 400px" :formList="searchFormList" |
||||
|
:formConfigOptions="{ dFormData: { eventState: '0' } }" @handleSearch="handleSearch" /> |
||||
|
|
||||
|
</div> |
||||
|
<!-- 内容 --> |
||||
|
<div class="body"> |
||||
|
|
||||
|
<Table :data="tableData" height="75vh" > |
||||
|
<el-table-column label="序号" type="index" :index="indexMethod" width="100" align="center" |
||||
|
header-align="center" /> |
||||
|
<ElTableColumn label="设备名称" show-overflow-tooltip prop="deviceName" header-align="center" /> |
||||
|
<ElTableColumn label="设备类型" prop="deviceTypeName" /> |
||||
|
<ElTableColumn label="方向" prop="directionName" /> |
||||
|
<ElTableColumn label="安装位置" prop="installationSite" /> |
||||
|
<ElTableColumn label="设备归属类型" prop="facilitiesTypeName" /> |
||||
|
<ElTableColumn label="桩号" prop="stakeMark" /> |
||||
|
<ElTableColumn label="时间" prop="warningTime" /> |
||||
|
|
||||
|
<ElTableColumn label="状态" width="150" prop="stateName" /> |
||||
|
|
||||
|
<ElTableColumn label="操作" width="130" align="center"> |
||||
|
<template slot-scope="scope"> |
||||
|
<ElButton type="text" v-if="scope.row.status==='0'" style="color: #00D1FF;" @click="showDisposal(scope.row)">处理</ElButton> |
||||
|
</template> |
||||
|
</ElTableColumn> |
||||
|
</Table> |
||||
|
</div> |
||||
|
|
||||
|
<!-- 分页 --> |
||||
|
<div class="footer"> |
||||
|
<Pagination @current-change="initData" @size-change="onSizeChange" width="'100%'" |
||||
|
:page-sizes="[10, 20, 30, 40, 50]" :page-size="searchData.pageSize" :current-page.sync="searchData.pageNum" |
||||
|
layout="total, sizes, prev, pager, next" :total="total"> |
||||
|
</Pagination> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import ButtonGradient from '@screen/components/Buttons/ButtonGradient.vue'; |
||||
|
import Pagination from '@screen/components/Pagination.vue'; |
||||
|
import Table from '@screen/components/Table.vue'; |
||||
|
import request from '@/utils/request' |
||||
|
import BoardRecordPreview from '@screen/components/infoBoard/BoardRecordPreview.vue' |
||||
|
import InputSearch from "@screen/components/InputSearch/index.vue"; |
||||
|
import { searchFormList } from "./data"; |
||||
|
import { getToken } from "@/utils/auth"; |
||||
|
import { delay, exportFile, confirm } from "@screen/utils/common"; |
||||
|
import { Message } from "element-ui"; |
||||
|
import Button from "@screen/components/Buttons/Button.vue"; |
||||
|
import Form from "@screen/components/FormConfig"; |
||||
|
import {deviceTypeOptions} from '@screen/utils/enum.js'; |
||||
|
import DialogWarning from '@screen/components/HeaderMenu/dialogWarn/DialogWarning.vue' |
||||
|
|
||||
|
export default { |
||||
|
name: 'boardRecord', |
||||
|
components: { |
||||
|
ButtonGradient, |
||||
|
Pagination, |
||||
|
Table, |
||||
|
Button, |
||||
|
Form, |
||||
|
DialogWarning, |
||||
|
BoardRecordPreview, |
||||
|
InputSearch |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
WarningType:{ |
||||
|
1: '交通流预警', |
||||
|
2: '气象预警' |
||||
|
}, |
||||
|
tableData: [], |
||||
|
searchFormList, |
||||
|
total: 20, |
||||
|
searchData: { |
||||
|
pageSize: 20, |
||||
|
pageNum: 1 |
||||
|
}, |
||||
|
dialogWarningVisible: false, |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
this.initData(); |
||||
|
}, |
||||
|
mounted(){ |
||||
|
}, |
||||
|
methods: { |
||||
|
onRefreshForm(){ |
||||
|
this.searchData.pageNum = 1; |
||||
|
this.$refs.searchComp.handleResetForm(); |
||||
|
}, |
||||
|
handleSearch(data) { |
||||
|
let startTime = null; |
||||
|
let endTime = null; |
||||
|
if(data.warningTime && data.warningTime.length ===2){ |
||||
|
startTime = data.warningTime[0]+' 00:00:00' |
||||
|
endTime = data.warningTime[1]+' 23:59:59' |
||||
|
} |
||||
|
this.searchData = { |
||||
|
...this.searchData, |
||||
|
status: (data.status===undefined||data.status===''?null:data.status), |
||||
|
|
||||
|
}; |
||||
|
this.initData(); |
||||
|
}, |
||||
|
indexMethod(index) { |
||||
|
return this.searchData.pageSize*(this.searchData.pageNum-1) + index + 1; |
||||
|
}, |
||||
|
// |
||||
|
showDisposal(row){ |
||||
|
const self = this; |
||||
|
this.$confirm(`是否确认处理设备【${row['deviceName']}】异常?`, "异常处理", { |
||||
|
confirmButtonText: "处理", |
||||
|
cancelButtonText: "取消", |
||||
|
type: "warning" |
||||
|
}).then(function() { |
||||
|
request({ |
||||
|
url: `/deviceOfflineRecord`, |
||||
|
method: 'put', |
||||
|
data:{ |
||||
|
...row, |
||||
|
status:'1' |
||||
|
} |
||||
|
}).then(res=>{ |
||||
|
self.initData(); |
||||
|
self.$modal.msgSuccess("处理成功"); |
||||
|
}) |
||||
|
}).catch(function() {}); |
||||
|
}, |
||||
|
// |
||||
|
|
||||
|
initData() { |
||||
|
request({ |
||||
|
url: `/deviceOfflineRecord/list`, |
||||
|
method: "get", |
||||
|
params: this.searchData, |
||||
|
}).then((result) => { |
||||
|
if (result.code != 200) return Message.error(result?.msg); |
||||
|
console.log(result) |
||||
|
const enum_facilitiesType = { |
||||
|
0: '默认', |
||||
|
1: '道路沿线', |
||||
|
2: '桥梁', |
||||
|
3: '隧道', |
||||
|
4: '收费广场', |
||||
|
5: '收费站', |
||||
|
6: '服务区' |
||||
|
} |
||||
|
result.rows.forEach(e=>{ |
||||
|
e.deviceTypeName = _.find(deviceTypeOptions,{value:parseInt(e.deviceType)}).label |
||||
|
e.directionName = e.direction==='1'?'菏泽方向':'济南方向' |
||||
|
e.warningTime = moment(e.createTime).format('YYYY-MM-DD HH:mm:ss') |
||||
|
e.stateName = (e.status==='0'?'未处理':(e.status==='1'?'已处理':'自动处理')) |
||||
|
e.facilitiesTypeName = enum_facilitiesType[e.facilitiesType] |
||||
|
}) |
||||
|
this.tableData = result.rows; |
||||
|
this.total = result.total; |
||||
|
}); |
||||
|
}, |
||||
|
onSizeChange(pageSize) { |
||||
|
this.tableData = []; |
||||
|
this.searchData.pageSize = pageSize; |
||||
|
this.searchData.pageNum = 1; |
||||
|
this.initData(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang='scss' scoped> |
||||
|
.board_record { |
||||
|
padding: 0 14px 14px; |
||||
|
width:100%; |
||||
|
height: 100%; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
|
||||
|
.filter { |
||||
|
height: 60px; |
||||
|
display: flex; |
||||
|
justify-content: space-between; |
||||
|
align-items: center; |
||||
|
|
||||
|
>div { |
||||
|
display: flex; |
||||
|
gap: 6px; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.body { |
||||
|
flex: 1; |
||||
|
height: 0; |
||||
|
min-height: 0; |
||||
|
} |
||||
|
|
||||
|
.footer { |
||||
|
margin-top: 15px; |
||||
|
height: 36px; |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
justify-content: center; |
||||
|
} |
||||
|
|
||||
|
.board_shower{ |
||||
|
margin: 4px; |
||||
|
} |
||||
|
::v-deep .el-carousel__indicators--horizontal{ |
||||
|
line-height: 0; height: 16px; |
||||
|
.el-carousel__indicator--horizontal{ |
||||
|
padding: 7px 4px; |
||||
|
} |
||||
|
} |
||||
|
::v-deep .el-table__cell div.cell { |
||||
|
padding: 0 10px !important; |
||||
|
} |
||||
|
} |
||||
|
.upload-file{ |
||||
|
width: 100%; |
||||
|
margin: 20px 0px; |
||||
|
background-color: #104c66 !important; |
||||
|
border: 1px solid #359cbc !important; |
||||
|
border-radius: 5px; |
||||
|
text-align: center; |
||||
|
padding: 5px 0px; |
||||
|
font-size: 14px; |
||||
|
cursor: pointer; |
||||
|
} |
||||
|
</style> |