告警日志页面接口联调及其他一些页面布局优化

merge-requests/1/head
张鑫 5 years ago
parent 1031fc086c
commit e6639fea14

@ -0,0 +1,5 @@
.alarm{
.ant-form-item-label{
text-align:left;
}
}

@ -70,7 +70,7 @@ const routes = [{
path: 'alarmLog', path: 'alarmLog',
name: 'alarmLog', name: 'alarmLog',
meta: { meta: {
icon: 'alert', icon: 'exception',
name: '告警日志' name: '告警日志'
}, },
component: () => import('@/views/alarmVideos/alarmLog') component: () => import('@/views/alarmVideos/alarmLog')

@ -0,0 +1,256 @@
<template>
<div class="history bg-white">
<div class="ant-advanced-search-form">
<a-form layout="inline" :form="queryParam">
<a-row :gutter="24">
<a-col :span="4" style="text-align: left">
<a-select :default-value="0" style="width: 180px" @change="handleChange">
<a-select-option :value="0">
全部
</a-select-option>
<a-select-option v-for="(item,index) in streetList" :key="index" :value="item.id">
{{item.name}}
</a-select-option>
</a-select>
</a-col>
<a-col :span="10">
<a-form-item class="ageInput" label="告警时间">
<a-range-picker @change="onTimeChange" v-model="time">
<a-icon slot="suffixIcon" type="calendar"/>
</a-range-picker>
</a-form-item>
</a-col>
<a-col :span="10" style="text-align: right">
<a-button type="primary" @click="handleSearch"></a-button>
<a-button style="margin-left: 8px" @click="reset"></a-button>
</a-col>
</a-row>
</a-form>
</div>
<a-table
:columns="columns"
:row-key="record => record.id"
:data-source="data"
:pagination="pagination"
@change="handleGetalarmLog"
>
<span slot="streetType" slot-scope="text">
{{ text === null ? '-' : text === 0 ? '单伸' : '双伸' }}
</span>
<span slot="pics" slot-scope="text" style="width:auto">
<template>
<span v-if="text.pics" style="height:100%;">
<happy-scroll color="rgba(100,100,100,0.5)" size="8" class="scroll-box" style="width:320px;height:90px;">
<viewer :images="text.pics">
<img class="historyImg" v-for="(src,index) in text.pics" :src="imgUrl+src"
:key="index"/>
</viewer>
</happy-scroll>
</span>
<span v-else>
暂无图片
</span>
</template>
</span>
<span slot="status" slot-scope="text">
<span :style="text.status == 1 ?' color:red': ''">
{{ text.status == null ? ' ' : text.status == 0 ? '正常' : '告警' }}
</span>
</span>
<span slot="videoPath1" slot-scope="text">
<a-button type="link" v-if="text.videoPath1" @click="showModel(text.videoPath1)">
查看视频
</a-button>
<span v-else>
</span>
</span>
<span slot="videoPath2" slot-scope="text">
<a-button type="link" v-if="text.videoPath2" @click="showModel(text.videoPath2)">
查看视频
</a-button>
<span v-else>
</span>
</span>
</a-table>
<Model
:visible.sync="visible"
:vid.sync="vid"
@close="closeModel"
/>
</div>
</template>
<script>
import {imgUrl, videoUrl} from "@/api/importExcel";
import Model from "./model.vue"
export default {
name: "alarmLog",
data() {
return {
queryParam: {},
time:[],
pageNum: 1,
pageSize: 10,
data: [],
pagination: {
total: 0,
defaultPageSize: 10, //
current:1,
showTotal: total => `${total} 条数据`, //
showSizeChanger: true, //
pageSizeOptions: ['10', '20', '30'],
onShowSizeChange: (current, pageSize) => this.pageSize = pageSize //
},
loading: false,
imgUrl: imgUrl,
columns: [
{
title: '序号',
// dataIndex: 'id',
customRender: (text, record, index) => {
return (
(record.pageNumber - 1) * 10 + index + 1
)
}
},
{
title: "告警信号",
dataIndex: "signal",
},
{
title: "告警时间",
dataIndex: "startTime",
},
{
title: "复位时间",
dataIndex: "endTime",
},
{
title: "巷道",
dataIndex: "streetName",
},
{
title: "涉及货位",
dataIndex: "location",
}
],
visible: false,
vid: '',
streetList:[]
}
},
mounted() {
this.getStreetList()
this.handleGetalarmLog()
console.log(this.imgUrl)
},
methods: {
getStreetList(){
this.$api.httpApi.getStreetList({
data: {
pageNum:0,
pageSize:0,
}
}).then(res => {
this.streetList = res.data.list;
}).catch(err => {
});
},
handleChange(value) {
console.log(`selected ${value}`);
this.queryParam.streetId=value
},
handleSearch() {
console.log(this.queryParam)
this.handleGetalarmLog()
},
handleGetalarmLog(pagination) {
console.log(pagination)
if(pagination){
this.pagination.current = pagination.current;
this.pagination.pageSize = pagination.pageSize;
this.pageNum = pagination.current;
this.pageSize = pagination.pageSize;
}
this.request();
},
request() {
this.$api.httpApi.warnList({
data: {
pageNum: this.pageNum,
pageSize: this.pageSize,
...this.queryParam
}
}).then(res => {
const pagination = { ...this.pagination };
pagination.total = res.data.total;
this.data = res.data.list;
this.pagination = pagination;
res.data.list.forEach((value,index) => {
value.pageNumber = this.pagination.current
});
}).catch(err => {
});
},
onTimeChange(date, dateString) {
this.handleReset()
console.log(date)
console.log(date[0].format('YYYY-MM-DD HH:mm:ss'))
this.queryParam.startTime = date[0].format('YYYY-MM-DD HH:mm:ss')
this.queryParam.endTime = date[1].format('YYYY-MM-DD HH:mm:ss')
},
handleReset() {
this.queryParam.startTime = ""
this.queryParam.endTime = ""
},
reset() {
this.queryParam.startTime = ""
this.queryParam.endTime = ""
this.time = ""
this.handleGetalarmLog()
},
showModel(data) {
this.visible = true
this.vid = videoUrl + data
},
closeModel(visible, data) {
this.visible = visible
this.vid = data
},
},
components: {
Model
}
};
</script>
<style lang="scss" scoped>
.history {
padding: 24px;
}
.ant-drawer-content-wrapper {
height: auto !important;
}
.ant-drawer-body {
text-align: center;
}
.ant-advanced-search-form .ant-form-item {
display: flex;
width: 100%;
}
.historyImg {
width: 80px;
height:auto;
margin: 5px;
}
</style>

@ -2,16 +2,16 @@
<div class="alarm bg-white"> <div class="alarm bg-white">
<div class="ant-advanced-search-form"> <div class="ant-advanced-search-form">
<a-form layout="inline" :label-col="labelCol" :wrapper-col="wrapperCol" :form="queryParam"> <a-form layout="inline" :label-col="labelCol" :wrapper-col="wrapperCol" :form="queryParam">
<a-row :gutter="12"> <a-row :gutter="24">
<a-col :span="8"> <a-col :span="5" style="text-align: left">
<a-form-item class="ageInput" label="时间"> <a-form-item label="时间">
<a-range-picker @change="onTimeChange" v-model="queryParam.time" <a-range-picker @change="onTimeChange" v-model="time"
format="YYYY-MM-DD HH:mm"> format="YYYY-MM-DD HH:mm">
<a-icon slot="suffixIcon" type="calendar"/> <a-icon slot="suffixIcon" type="calendar"/>
</a-range-picker> </a-range-picker>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="16" style="text-align: right"> <a-col :span="19" style="text-align: right">
<a-button type="primary" @click="handleSearch"></a-button> <a-button type="primary" @click="handleSearch"></a-button>
<!-- <a-button style="margin-left: 8px" @click="reset"></a-button>--> <!-- <a-button style="margin-left: 8px" @click="reset"></a-button>-->
</a-col> </a-col>
@ -23,14 +23,14 @@
:row-key="record => record.id" :row-key="record => record.id"
:data-source="data" :data-source="data"
:pagination="pagination" :pagination="pagination"
@change="handleGetHistoryList" @change="handleGetalarmList"
> >
<span slot="videoPath1" slot-scope="text"> <span slot="videoPath1" slot-scope="text">
<a-button type="link" v-if="text.videoPath1" @click="showModel(text.videoPath1)"> <a-button type="link" v-if="text.videoPath1" @click="showModel(text.videoPath1)">
查看视频 查看视频
</a-button> </a-button>
<span v-else> <span v-else>
--
</span> </span>
</span> </span>
<span slot="videoPath2" slot-scope="text"> <span slot="videoPath2" slot-scope="text">
@ -38,7 +38,7 @@
查看视频 查看视频
</a-button> </a-button>
<span v-else> <span v-else>
--
</span> </span>
</span> </span>
</a-table> </a-table>
@ -52,6 +52,7 @@
<script> <script>
import Model from "./model.vue" import Model from "./model.vue"
import {videoUrl} from "@/api/importExcel";
export default { export default {
name: "historyMonitoring", name: "historyMonitoring",
components: { components: {
@ -63,6 +64,7 @@ export default {
labelCol: { span: 6 }, labelCol: { span: 6 },
wrapperCol: { span: 18 }, wrapperCol: { span: 18 },
queryParam: {}, queryParam: {},
time:[],
pageNum:1, pageNum:1,
pageSize:10, pageSize:10,
data: [], data: [],
@ -104,14 +106,14 @@ export default {
}; };
}, },
mounted() { mounted() {
this.handleGetHistoryList() this.handleGetalarmList()
}, },
methods: { methods: {
handleSearch(){ handleSearch(){
console.log(this.queryParam) console.log(this.queryParam)
this.handleGetHistoryList() this.handleGetalarmList()
}, },
handleGetHistoryList(pagination) { handleGetalarmList(pagination) {
console.log(pagination) console.log(pagination)
if(pagination){ if(pagination){
this.pagination.current = pagination.current; this.pagination.current = pagination.current;
@ -129,7 +131,9 @@ export default {
...this.queryParam ...this.queryParam
} }
}).then(res => { }).then(res => {
console.log(res) const pagination = {...this.pagination};
pagination.total = res.data.total;
this.pagination = pagination;
this.data = res.data.list this.data = res.data.list
}).catch(err => { }).catch(err => {
@ -145,7 +149,6 @@ export default {
handleReset() { handleReset() {
this.queryParam.startTime = "" this.queryParam.startTime = ""
this.queryParam.endTime = "" this.queryParam.endTime = ""
this.time = ""
}, },
showModel(data) { showModel(data) {
this.visible = true this.visible = true

@ -26,7 +26,7 @@
@change="handleTypeChange2" @change="handleTypeChange2"
style="width: 160px" style="width: 160px"
:value="selectType2" :value="selectType2"
v-if="selectType2 !== 'none'" v-if="selectType2 !== 'none' && selectType2 !== '' "
> >
<a-select-option value="out"> <a-select-option value="out">
@ -44,7 +44,7 @@
<div v-for="(columnItem,index) in key" :key="index"> <div v-for="(columnItem,index) in key" :key="index">
<div class="carousel-page" <div class="carousel-page"
v-if="columnItem.row == checkObj.row && columnItem.column == checkObj.column"> v-if="columnItem.row == checkObj.row && columnItem.column == checkObj.column">
<p class="carousel-page-title">工单号{{checkObj.orderNum}}</p> <p class="carousel-page-title" @click="goHistory">{{checkObj.orderNum}}</p>
<div class="carousel-page-content"> <div class="carousel-page-content">
<div class="img-box"> <div class="img-box">
<img <img
@ -246,6 +246,7 @@ export default {
this.selectType = 'right' this.selectType = 'right'
} }
} }
console.log(this.selectType2)
}, },
components: { components: {
Model Model
@ -374,28 +375,6 @@ export default {
} }
} }
}, },
prev1(index) {
console.log(index)
for (let x in this.checkList) {
if (this.shelveId == this.checkList[x][index].shelveId) {
console.log(this.checkList[x][index].row)
console.log(this.checkList[x][index].column)
console.log(this.checkList[x][index].shelveId)
this.getStockInfo(this.checkList[x][index].row, this.checkList[x][index].column, this.checkList[x][index].shelveId)
}
}
},
next1(index) {
console.log(index)
for (let x in this.checkList) {
if (this.shelveId == this.checkList[x][index].shelveId) {
console.log(this.checkList[x][index].row)
console.log(this.checkList[x][index].column)
console.log(this.checkList[x][index].shelveId)
this.getStockInfo(this.checkList[x][index].row, this.checkList[x][index].column, this.checkList[x][index].shelveId)
}
}
},
checkSure(row, column, shelveId, index) { checkSure(row, column, shelveId, index) {
this.$api.httpApi.stockCheckCorrect({ this.$api.httpApi.stockCheckCorrect({
data: { data: {
@ -423,6 +402,12 @@ export default {
this.visible = visible this.visible = visible
this.modelData = data this.modelData = data
}, },
goHistory(){
const href = this.$router.resolve({
name: 'historyMonitoring'
});
window.open(href.href, '_blank');
},
} }
} }
</script> </script>

@ -3,15 +3,15 @@
<div class="title-info"> <div class="title-info">
<span class="explain">颜色说明</span> <span class="explain">颜色说明</span>
<span class="info-text"> <span class="info-text">
<a-tag color="#d81e06" style="width:30px;height:20px"></a-tag> <a-tag color="#d81e06" style="width:30px;height:20px;margin-right:6px"></a-tag>
盘点错误 盘点错误
</span> </span>
<span class="info-text"> <span class="info-text">
<a-tag color="#1afa29" style="width:30px;height:20px"></a-tag> <a-tag color="#1afa29" style="width:30px;height:20px;margin-right:6px"></a-tag>
盘点正确 盘点正确
</span> </span>
<span class="info-text"> <span class="info-text">
<a-tag color="#bfbfbf" style="width:30px;height:20px"></a-tag> <a-tag color="#bfbfbf" style="width:30px;height:20px;margin-right:6px"></a-tag>
未盘点 未盘点
</span> </span>
</div> </div>

@ -2,20 +2,20 @@
<div class="history bg-white"> <div class="history bg-white">
<div class="ant-advanced-search-form"> <div class="ant-advanced-search-form">
<a-form layout="inline" :form="queryParam"> <a-form layout="inline" :form="queryParam">
<a-row :gutter="12"> <a-row :gutter="24">
<a-col :span="8" style="text-align: left"> <a-col :span="6" style="text-align: left">
<a-form-item label="工单号"> <a-form-item label="工单号">
<a-input v-model="queryParam.orderNum" placeholder="请输入"/> <a-input v-model="queryParam.orderNum" placeholder="请输入" style="width:270px;"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-form-item class="ageInput" label="时间"> <a-form-item class="ageInput" label="时间">
<a-range-picker @change="onTimeChange" v-model="queryParam.time"> <a-range-picker @change="onTimeChange" v-model="time">
<a-icon slot="suffixIcon" type="calendar"/> <a-icon slot="suffixIcon" type="calendar"/>
</a-range-picker> </a-range-picker>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="8" style="text-align: right"> <a-col :span="10" style="text-align: right">
<a-button type="primary" @click="handleSearch"></a-button> <a-button type="primary" @click="handleSearch"></a-button>
<!-- <a-button style="margin-left: 8px" @click="reset"></a-button>--> <!-- <a-button style="margin-left: 8px" @click="reset"></a-button>-->
</a-col> </a-col>
@ -60,7 +60,7 @@
查看视频 查看视频
</a-button> </a-button>
<span v-else> <span v-else>
--
</span> </span>
</span> </span>
<span slot="videoPath2" slot-scope="text"> <span slot="videoPath2" slot-scope="text">
@ -68,7 +68,7 @@
查看视频 查看视频
</a-button> </a-button>
<span v-else> <span v-else>
--
</span> </span>
</span> </span>
</a-table> </a-table>
@ -87,6 +87,7 @@ export default {
data() { data() {
return { return {
queryParam: {}, queryParam: {},
time:[],
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
data: [], data: [],
@ -137,7 +138,7 @@ export default {
}, },
{ {
title: "视频时长", title: "视频时长",
dataIndex: "mediaTime", dataIndex: "timeLength",
}, },
{ {
title: "球机1", title: "球机1",
@ -182,15 +183,6 @@ export default {
...this.queryParam ...this.queryParam
} }
}).then(res => { }).then(res => {
// let pics =new Array()
// res.data.list.map(function (item) {
// console.log(item)
// console.log('000')
// var pic = [
// item.putPath, item.goodsPath, item.outputPath
// ]
// item.pics = pic
// })
console.log(res.data) console.log(res.data)
const pagination = {...this.pagination}; const pagination = {...this.pagination};
pagination.total = res.data.total; pagination.total = res.data.total;
@ -210,7 +202,6 @@ export default {
handleReset() { handleReset() {
this.queryParam.startTimestamp = "" this.queryParam.startTimestamp = ""
this.queryParam.endTimestamp = "" this.queryParam.endTimestamp = ""
this.time = ""
}, },
showModel(data) { showModel(data) {
this.visible = true this.visible = true

Loading…
Cancel
Save