告警管理接口联调,plc异常页面构建接口联调,实时视频流页面bug修复

merge-requests/1/head
张鑫 5 years ago
parent c12238ea68
commit 42db7e0a83

@ -9,6 +9,11 @@ export default {
url: "/realTime",
name: "获取实时监控列表"
},
getHistoryList: {
method: "POST",
url: "/order/list",
name: "获取历史监控列表"
},
realTimeLychee: {
method: "GET",
url: "/realTime/lychee",
@ -86,10 +91,15 @@ export default {
url: "/camera/io/toPtz",
name: "转至球机IO配置点"
},
queryList: {
url: '/order/list',
name: '查询',
warnList: {
url: '/warn/list',
name: 'plc未连接数量',
method: 'POST'
},
disPlcList: {
url: '/plc/disPlc',
name: 'plc未连接列表',
method: 'GET'
}
}

@ -62,7 +62,7 @@ export default {
parents = this.$router.options.routes[0].children.filter(ele => {
if (
this.userInfo.permissionList.some(item => {
return item.rights === ele.name && ele.name.indexOf("center") < 0 && item.rights === ele.name && ele.name.indexOf("ioTable") < 0 && item.rights === ele.name && ele.name.indexOf("realTimeMonitoringModel") < 0;
return item.rights === ele.name && ele.name.indexOf("center") < 0 && item.rights === ele.name && ele.name.indexOf("ioTable") < 0 && item.rights === ele.name && ele.name.indexOf("realTimeMonitoringModel") < 0 && item.rights === ele.name && ele.name.indexOf("plcStatus") < 0;
})
) {
return ele;
@ -83,7 +83,7 @@ export default {
recursionRoute(parents);
}else {
parents = this.$router.options.routes[0].children.filter(item => {
return !item.name.startsWith("center") && !item.name.startsWith("ioTable") && !item.name.startsWith("realTimeMonitoringModel");
return !item.name.startsWith("center") && !item.name.startsWith("ioTable") && !item.name.startsWith("realTimeMonitoringModel") && !item.name.startsWith("plcStatus");
});
}
this.routes = parents;

@ -98,7 +98,7 @@ export default {
.table{
background: #ffffff;
margin: 8px 20px;
height: calc(100vh - 190px);
min-height: calc(100vh - 190px);
padding: 20px;
}
}

@ -11,7 +11,7 @@
</div>
<div class="header-right">
<div class="header-top-right-circle" @click="visible = !visible"></div>
<a-badge :count="count">
<a-badge :count="count" @click="openPlc">
<a-icon type="bell" style="font-size:20px;cursor:pointer"/>
</a-badge>
<a-popover id="popover" v-model="visible" placement="bottom" trigger="click">
@ -93,6 +93,9 @@ export default {
}).catch(err => {
console.log(err)
})
},
openPlc() {
this.$router.push({name: 'plcStatus'})
}
}
};

@ -155,6 +155,14 @@ const routes = [{
name: '个人中心'
},
component: () => import('@/views/center')
},
{
path: 'plcStatus',
name: 'plcStatus',
meta: {
name: 'PLC状态'
},
component: () => import('@/views/plcStatus')
}
]
},

@ -5,7 +5,8 @@
<a-row :gutter="12">
<a-col :span="8">
<a-form-item class="ageInput" label="时间">
<a-range-picker @change="onTimeChange" v-model="queryParam.time">
<a-range-picker @change="onTimeChange" v-model="queryParam.time"
format="YYYY-MM-DD HH:mm">
<a-icon slot="suffixIcon" type="calendar"/>
</a-range-picker>
</a-form-item>
@ -24,11 +25,33 @@
:pagination="pagination"
@change="handleGetHistoryList"
>
<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 Model from "./model.vue"
export default {
name: "historyMonitoring",
components: {
@ -54,25 +77,29 @@ export default {
columns: [
{
title: "时间",
dataIndex: "time",
dataIndex: "startTime",
},
{
title: "球机所属巷道 ",
dataIndex: "pic",
dataIndex: "streetName",
},
{
title: "视频时长",
dataIndex: "mediaTime",
dataIndex: "timeLength",
},
{
title: "球机1",
dataIndex: "camera1",
// dataIndex: "videoPath1",
scopedSlots: {customRender: 'videoPath1'}
},
{
title: "球机2",
dataIndex: "camera2",
// dataIndex: "videoPath2",
scopedSlots: {customRender: 'videoPath2'}
},
],
visible: false,
vid: ''
};
},
mounted() {
@ -80,13 +107,8 @@ export default {
},
methods: {
handleSearch(){
delete this.queryParam.time
console.log(this.queryParam)
if(this.queryParam.con_code || this.queryParam.start_time && this.queryParam.end_time ){
this.handleGetHistoryList()
}else{
this.$message.error('请输入搜索条件')
}
},
handleGetHistoryList(pagination) {
console.log(pagination)
@ -99,23 +121,38 @@ export default {
this.request();
},
request() {
// this.$api.httpApi.queryList({
// data: {
// pageNum:this.pageNum,
// pageSize:this.pageSize,
// ...this.queryParam
// }
// }).then(res => {
// console.log(res)
// }).catch(err => {
//
// });
this.$api.httpApi.warnList({
data: {
pageNum: this.pageNum,
pageSize: this.pageSize,
...this.queryParam
}
}).then(res => {
console.log(res)
this.data = res.data.list
}).catch(err => {
});
},
onTimeChange(date, dateString) {
this.handleReset()
console.log(date)
console.log(date[0].format('X'))
this.queryParam.start_time = date[0].format('X')
this.queryParam.end_time = date[1].format('X')
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 = ""
this.time = ""
},
showModel(data) {
this.visible = true
this.vid = videoUrl + data
},
closeModel(visible, data) {
this.visible = visible
this.vid = data
},
},
};

@ -0,0 +1,102 @@
<template>
<div v-if="isShow">
<a-modal
v-model="isShow"
@cancel="handleCancel"
:footer="null"
:maskClosable="false"
:bodyStyle="{padding:0}"
:centered="true"
class="video-model"
>
<div slot="closeIcon">
<div class="video-close">
</div>
</div>
<div class="test_two_box">
<video
id="myVideo"
class="video-js"
:autoplay="true"
controls
>
<source
:src="video"
type="video/mp4"
>
</video>
</div>
</a-modal>
</div>
</template>
<style lang="scss" scoped>
.video-model {
.across-layout {
display: flex;
}
}
.ant-btn {
white-space: inherit;
text-align: left;
}
.video-js {
width: 100%;
height: 300px;
}
.video-close {
position: absolute;
right: 10px;
top: 10px;
color: #ffffff;
font-size: 18px;
width: 24px;
height: 24px;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
z-index: 10;
}
</style>
<script>
export default {
props: ['visible', 'vid'],
watch: {
//visibleisShowprops
visible: function (newVal) {
this.isShow = newVal; //newValvisible
// newVal && this.showConfirm(); //newValshowConfirm
},
vid: function (newVal) {
console.log(newVal)
console.log(1111111)
this.video = newVal
this.$nextTick(() => { //this.$nextTick
})
},
},
data() {
return {
isShow: false,
confirmLoading: false,
video: '',
};
},
mounted() {
console.log('mounted执行了')
},
methods: {
handleCancel() {
this.$emit('close', false, '')
},
},
};
</script>

@ -15,7 +15,12 @@
:form="form"
:wrapper-col="formItemAcrossLayout.wrapperCol"
>
<a-form-item label="名称" :label-col="formItemVerticalLayout.labelCol">
<a-form-item label="指令编码" :label-col="formItemVerticalLayout.labelCol">
<a-input
v-decorator="['code', { rules: [{ required: true, message: '请输入指令编码!' }] }]"
/>
</a-form-item>
<a-form-item label="指令名称" :label-col="formItemVerticalLayout.labelCol">
<a-input
v-decorator="['name', { rules: [{ required: true, message: '请输入指令名称!' }] }]"
/>
@ -55,6 +60,7 @@ export default {
this.$nextTick(()=>{ //this.$nextTick
this.form.setFieldsValue({ //setFieldsValue form
name: newVal.name,
code: newVal.code,
ip: newVal.ip,
rtsp: newVal.rtsp
})

@ -67,7 +67,11 @@ const columns = [
}
},
{
title: 'IO指令',
title: '指令编码',
dataIndex: 'code',
},
{
title: '指令名称',
dataIndex: 'name',
},
{

@ -1,77 +1,78 @@
<template>
<div class="check-page">
<div class="title-info">
<span class="explain">颜色说明</span>
<span class="info-text">
<a-tag color="#d81e06" style="width:30px;height:20px"></a-tag>
盘点错误
</span>
<span class="info-text">
<a-tag color="#1afa29" style="width:30px;height:20px"></a-tag>
盘点正确
</span>
<span class="info-text">
<a-tag color="#bfbfbf" style="width:30px;height:20px"></a-tag>
未盘点
</span>
</div>
<!-- <div class="title-info">-->
<!-- <span class="explain">颜色说明</span>-->
<!-- <span class="info-text">-->
<!-- <a-tag color="#d81e06" style="width:30px;height:20px"></a-tag>-->
<!-- 盘点错误-->
<!-- </span>-->
<!-- <span class="info-text">-->
<!-- <a-tag color="#1afa29" style="width:30px;height:20px"></a-tag>-->
<!-- 盘点正确-->
<!-- </span>-->
<!-- <span class="info-text">-->
<!-- <a-tag color="#bfbfbf" style="width:30px;height:20px"></a-tag>-->
<!-- 未盘点-->
<!-- </span>-->
<!-- </div>-->
<div class="check-content">
<div class="roadway-top">
<happy-scroll color="rgba(100,100,100,0.5)" size="8" class="scroll-box">
<div class="roadway-box">
<div class="line" v-for="item in 20" :key="item">
<div
class="ele"
:style="{background:i+'-'+item == '4-14'|| i+'-'+item=='8-18'?'#d81e06':'#bfbfbf'}"
v-for="i in 60"
:key="i">{{i}}-{{item}}
</div>
</div>
</div>
</happy-scroll>
<a-radio-group v-model="size" style="margin:10px 0">
<a-radio-button value="small">
</a-radio-button>
<a-radio-button value="default">
</a-radio-button>
</a-radio-group>
</div>
<a-select default-value="jack" style="width: 180px">
<a-select-option value="jack">
1号巷道
</a-select-option>
<a-select-option value="lucy">
2号巷道
</a-select-option>
<a-select-option value="disabled">
3号巷道
</a-select-option>
</a-select>
<div class="roadway-buttom">
<happy-scroll color="rgba(100,100,100,0.5)" size="8" class="scroll-box">
<div class="roadway-box">
<div class="line" v-for="item in 20" :key="item">
<div class="ele"
:style="{background:i+'-'+item == '5-16'|| i+'-'+item=='9-17'||i+'-'+item=='11-15'?'#1afa29':'#bfbfbf'}"
v-for="i in 60"
:key="i">{{i}}-{{item}}
</div>
</div>
</div>
</happy-scroll>
<a-radio-group v-model="size2" style="margin:10px 0">
<a-radio-button value="small">
</a-radio-button>
<a-radio-button value="default">
</a-radio-button>
</a-radio-group>
</div>
</div>
<!-- <div class="check-content">-->
<!-- <div class="roadway-top">-->
<!-- <happy-scroll color="rgba(100,100,100,0.5)" size="8" class="scroll-box">-->
<!-- <div class="roadway-box">-->
<!-- <div class="line" v-for="item in 20" :key="item">-->
<!-- <div-->
<!-- class="ele"-->
<!-- :style="{background:i+'-'+item == '4-14'|| i+'-'+item=='8-18'?'#d81e06':'#bfbfbf'}"-->
<!-- v-for="i in 60"-->
<!-- :key="i">{{i}}-{{item}}-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </happy-scroll>-->
<!-- <a-radio-group v-model="size" style="margin:10px 0">-->
<!-- <a-radio-button value="small">-->
<!-- -->
<!-- </a-radio-button>-->
<!-- <a-radio-button value="default">-->
<!-- -->
<!-- </a-radio-button>-->
<!-- </a-radio-group>-->
<!-- </div>-->
<!-- <a-select default-value="jack" style="width: 180px">-->
<!-- <a-select-option value="jack">-->
<!-- 1号巷道-->
<!-- </a-select-option>-->
<!-- <a-select-option value="lucy">-->
<!-- 2号巷道-->
<!-- </a-select-option>-->
<!-- <a-select-option value="disabled">-->
<!-- 3号巷道-->
<!-- </a-select-option>-->
<!-- </a-select>-->
<!-- <div class="roadway-buttom">-->
<!-- <happy-scroll color="rgba(100,100,100,0.5)" size="8" class="scroll-box">-->
<!-- <div class="roadway-box">-->
<!-- <div class="line" v-for="item in 20" :key="item">-->
<!-- <div class="ele"-->
<!-- :style="{background:i+'-'+item == '5-16'|| i+'-'+item=='9-17'||i+'-'+item=='11-15'?'#1afa29':'#bfbfbf'}"-->
<!-- v-for="i in 60"-->
<!-- :key="i">{{i}}-{{item}}-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </happy-scroll>-->
<!-- <a-radio-group v-model="size2" style="margin:10px 0">-->
<!-- <a-radio-button value="small">-->
<!-- -->
<!-- </a-radio-button>-->
<!-- <a-radio-button value="default">-->
<!-- -->
<!-- </a-radio-button>-->
<!-- </a-radio-group>-->
<!-- </div>-->
<!-- </div>-->
<div>功能暂未开发</div>
</div>
</template>
<script>

@ -29,9 +29,12 @@
:pagination="pagination"
@change="handleGetHistoryList"
>
<span slot="streetType" slot-scope="text">
{{ text === null ? '-' : text === 0 ? '单伸' : '双伸' }}
</span>
<span slot="pics" slot-scope="text">
<template>
<span v-if="text.putPath || text.goodsPath ||text.outputPath">
<span v-if="text.pics">
<viewer :images="text.pics">
<img class="historyImg" v-for="(src,index) in text.pics" :src="imgUrl+src"
:key="index"/>
@ -44,7 +47,7 @@
</span>
<span slot="status" slot-scope="text">
<span :style="text.status == 1 ?' color:red': ''">
{{ text.status == null ? '-' : text.status == 0 ? '正常' : '告警' }}
{{ text.status == null ? ' ' : text.status == 0 ? '正常' : '告警' }}
</span>
</span>
<span slot="videoPath1" slot-scope="text">
@ -99,16 +102,17 @@ export default {
},
{
title: "巷道",
dataIndex: "str",
dataIndex: "streetName",
width: 90
},
{
title: "货架类型",
dataIndex: "type",
dataIndex: "streetType",
scopedSlots: {customRender: 'streetType'}
},
{
title: "货位",
dataIndex: "address",
dataIndex: "goodsLocation",
},
{
title: "时间",
@ -117,12 +121,14 @@ export default {
{
title: "照片(入库 货位 出库)",
// dataIndex: "pic",
scopedSlots: {customRender: 'pics'}
scopedSlots: {customRender: 'pics'},
width: 300
},
{
title: "视频状态",
// dataIndex: "status",
scopedSlots: {customRender: 'status'}
scopedSlots: {customRender: 'status'},
width: 90
},
{
title: "视频时长",
@ -145,16 +151,13 @@ export default {
},
mounted() {
this.handleGetHistoryList()
console.log(this.imgUrl)
},
methods: {
handleSearch() {
delete this.queryParam.time
console.log(this.queryParam)
if(this.queryParam.con_code || this.queryParam.start_time && this.queryParam.end_time ){
this.handleGetHistoryList()
}else{
this.$message.error('请输入搜索条件')
}
},
handleGetHistoryList(pagination) {
console.log(pagination)
@ -167,7 +170,7 @@ export default {
this.request();
},
request() {
this.$api.httpApi.queryList({
this.$api.httpApi.getHistoryList({
data: {
pageNum: this.pageNum,
pageSize: this.pageSize,
@ -175,16 +178,16 @@ export default {
}
}).then(res => {
// let pics =new Array()
res.data.map(function (item) {
console.log(item)
console.log('000')
var pic = [
item.putPath, item.goodsPath, item.outputPath
]
item.pics = pic
})
// 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)
this.data = res.data
this.data = res.data.list
}).catch(err => {
});
@ -192,9 +195,9 @@ export default {
onTimeChange(date, dateString) {
this.handleReset()
console.log(date)
console.log(date[0].format('X'))
this.queryParam.startTimestamp = date[0].format('X')
this.queryParam.endTimestamp = date[1].format('X')
console.log(date[0].format('YYYY-MM-DD HH:mm:ss'))
this.queryParam.startTimestamp = date[0].format('YYYY-MM-DD HH:mm:ss')
this.queryParam.endTimestamp = date[1].format('YYYY-MM-DD HH:mm:ss')
},
handleReset() {
this.queryParam.startTimestamp = ""

@ -0,0 +1,139 @@
<template>
<div>
<a-table
:columns="columns"
:row-key="record => record.id"
:data-source="data"
:pagination="pagination"
@change="handleGetCameraIoList"
>
<span slot="status" slot-scope="text">
{{text == false ? text ='连接异常':text ='没有PLC连接异常'}}
</span>
<span slot="action" slot-scope="text, record">
<a @click="reconnection(record)"></a>
</span>
</a-table>
</div>
</template>
<script>
const columns = [
{
title: '序号',
// dataIndex: 'id',
customRender: (text, record, index) => {
return (
(1 - 1) * 10 + index + 1
)
}
},
{
title: 'PLCID',
dataIndex: 'plcId',
},
{
title: '状态',
dataIndex: 'status',
scopedSlots: {customRender: 'status'}
},
{
title: '异常时间',
dataIndex: 'time',
},
{
title: '操作',
dataIndex: 'action',
scopedSlots: {customRender: 'action'}
},
];
export default {
data() {
return {
pageNum: 1,
pageSize: 10,
data: [],
pagination: {
total: 0,
current: 1,
defaultPageSize: 10, //
showTotal: total => `${total} 条数据`, //
showSizeChanger: true, //
pageSizeOptions: ['10', '20', '30'],
onShowSizeChange: (current, pageSize) => this.pageSize = pageSize //
},
loading: false,
columns,
visible: false,
modelType: '',
modelData: [],
};
},
computed: {},
mounted() {
this.handleGetCameraIoList()
},
methods: {
handleGetCameraIoList(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.disPlcList({
data: {
page: this.pageNum,
size: this.pageSize,
}
}).then(res => {
const pagination = {...this.pagination};
pagination.total = res.data.total;
this.data = res.data;
this.pagination = pagination;
res.data.list.forEach((value, index) => {
value.pageNumber = this.pagination.current
});
}).catch(err => {
});
},
reconnection(data) {
console.log(data.streetId)
var id = data.streetId
this.$axios.get('/plc/tcp', {
params: {id: id}
}).then(res => {
if (res.code == 200) {
this.$message.success('连接成功');
this.handleGetStreetList()
} else {
this.$message.error('连接失败');
}
}).catch(err => {
})
}
},
components: {}
};
</script>
<style lang="scss" scoped>
.button-box {
position: absolute;
top: 0;
right: 20px;
display: flex;
align-items: center;
justify-content: center;
.add {
margin-right: 20px;
}
}
</style>

@ -67,7 +67,7 @@ export default {
},
beforeRouteLeave(to,form,next) {
if (this.vlcz) {
if (this.vlcz.playlist) {
this.vlcz.playlist.stop();
next(true)
} else {

@ -76,6 +76,8 @@ export default {
},
mounted() {
this.mdata = this.$route.query.modelData
this.id = this.$route.query.modelData.id
console.log(this.id)
this.getHdVideos(this.$route.query.modelData.rtsp)
},
beforeRouteLeave(to, form, next) {
@ -88,7 +90,7 @@ export default {
},
methods: {
handleCancel() {
this.$router.go(-1);
this.$router.push({name: 'realTimeMonitoring'});
},
getHdVideos(rtsp) {
this.$nextTick(() => {

@ -22,7 +22,19 @@
</a-form-item>
<a-form-item label="PLC-ID" :label-col="formItemAcrossLayout.labelCol">
<a-input
v-decorator="['plcId', { rules: [{ required: true, message: '请输入PLC-ID!' }] }]"
v-decorator="['plcPort', { rules: [{ required: true, message: '请输入PLC-ID!' }] }]"
/>
</a-form-item>
</div>
<div class="across-layout">
<a-form-item label="PLC IP地址" :label-col="formItemAcrossLayout.labelCol">
<a-input
v-decorator="['plcIp', { rules: [{ required: true, message: '请输入PLC IP地址!' }] }]"
/>
</a-form-item>
<a-form-item label="端口" :label-col="formItemAcrossLayout.labelCol">
<a-input
v-decorator="['plcId', { rules: [{ required: true, message: '请输入端口!' }] }]"
/>
</a-form-item>
</div>
@ -228,6 +240,8 @@ export default {
this.form.setFieldsValue({ //setFieldsValue form
name: newVal.name,
plcId: newVal.plcId,
plcIp: newVal.plcIp,
plcPort: newVal.plcPort,
leftType: newVal.leftType === null ? '' : newVal.leftType === 0 ? '单伸' : '双伸',
leftRow: newVal.leftRow,
leftColumn: newVal.leftColumn,

Loading…
Cancel
Save