Compare commits

..

10 Commits

Author SHA1 Message Date
LAPTOP-S9HJSOEB\昊天 960ca2c322 使用zlm作为新的流服务器 3 years ago
yiming 7c8cb04802 库区设置 4 years ago
yiming 06d7eb0bff 巷道球机选择 4 years ago
yiming 2550475eb0 md修改 图片 4 years ago
yiming 46dba190f2 基础版修正 4 years ago
yiming a2e5281780 盘点图片 4 years ago
yiming 1de3950a23 盘点管理去掉货架号 4 years ago
yiming c0f69dde93 去掉货架号 4 years ago
wang.yiming 65d123c406 Merge branch 'liuzhou-yancao' into 'master'
Liuzhou yancao

See merge request duoji/duoji-frontend!3
4 years ago
yiming f2791d53db 删除货物条码 5 years ago

@ -28,7 +28,7 @@ See [Configuration Reference](https://cli.vuejs.org/config/).
#### 1、项目git地址:https://gitlab.hzleaper.com:81/duoji/duoji-frontend.git
#### 2、简介:
垛机监控系统是一款TOB的项目,由哲合科技有限公司承担研发,主要为甲方在仓储方面的出入库过程中,提供拍照取证,实时录像,盘点管理等功能。项目主要涵盖实时视频流、历史数据、盘点管理、巷道管理、球机管理、个人中心等。基于vue-cli3.x + Ant Design Vue搭建,rtsp视频流采用VLC插件结合Firefox火狐浏览器运行的方式播放,因VLC支持性问题需回退Firefox火狐浏览器版本至51版之前,详情请见 [VLC开发文档](https://wiki.videolan.org/Documentation:WebPlugin/#Introduction:_Building_Web_pages_with_Video)
出入库过程中,提供拍照取证,实时录像,盘点管理等功能。项目主要涵盖实时视频流、历史数据、盘点管理、巷道管理、球机管理、个人中心等。基于vue-cli3.x + Ant Design Vue搭建,rtsp视频流采用VLC插件结合Firefox火狐浏览器运行的方式播放,因VLC支持性问题需回退Firefox火狐浏览器版本至51版之前,详情请见 [VLC开发文档](https://wiki.videolan.org/Documentation:WebPlugin/#Introduction:_Building_Web_pages_with_Video)
#### 3、测试环境地址:

Binary file not shown.

@ -10,12 +10,13 @@
<!-- <script src="/video_play_plugins/video.js"></script> -->
<script src="/video_play_plugins/webrtcplayer.js"></script>
<title>昆船垛机视觉系统</title>
<script src="webrtc/ZLMRTCClient.js"></script>
<title>堆垛机视觉系统</title>
</head>
<body>
<noscript>
<strong>We're sorry but 昆船垛机视觉系统 doesn't work properly without JavaScript enabled. Please enable it to
<strong>We're sorry but 堆垛机视觉系统 doesn't work properly without JavaScript enabled. Please enable it to
continue.</strong>
</noscript>

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

@ -0,0 +1,336 @@
<html>
<meta charset="utf-8">
<head>
<title>ZLM RTC demo</title>
<script src="./ZLMRTCClient.js"></script>
</head>
<body>
<div style="text-align: center;">
<div>
<video id='video' controls autoplay style="text-align:left;">
Your browser is too old which doesn't support HTML5 video.
</video>
<video id='selfVideo' controls autoplay style="text-align:right;">
Your browser is too old which doesn't support HTML5 video.
</video>
</div>
<div style="float: left; width:30%;">
<span>已存在的流列表,点击自动播放:</span>
<ol id="olstreamlist">
<li>初始演示</li>
<li>每秒自动刷新</li>
</ol>
</div>
<div style="float: right; width: 70%">
<p>
<label for="streamUrl">url:</label>
<input type="text" style="co; width:70%" id='streamUrl' value="http://192.168.1.101/index/api/webrtc?app=live&stream=xiong&type=play">
</p>
<p>
<label for="simulcast">simulcast:</label>
<input type="checkbox" id='simulcast'>
</p>
<p>
<label for="useCamera">useCamera:</label>
<input type="checkbox" id='useCamera' checked="checked">
</p>
<p>
<label for="audioEnable">audioEnable:</label>
<input type="checkbox" id='audioEnable' checked="checked">
</p>
<p>
<label for="videoEnable">videoEnable:</label>
<input type="checkbox" id='videoEnable' checked="checked">
</p>
<p>
<label for="method">method(play or push or echo):</label>
<input type="radio" name="method" value="echo" >echo
<input type="radio" name="method" value="push" >push
<input type="radio" name="method" value="play" checked = true>play
</p>
<p>
<label for="resolution">resolution:</label>
<select id="resolution">
</select>
</p>
<p>
<label for="datachannel">datachannel:</label>
<input id='datachannel' name="datachannel" type="checkbox" value="0">
</p>
<button onclick="start()">开始(start)</button>
<button onclick="stop()">停止(stop)</button>
<p>
<label for="msgsend">msgsend:</label>
<input type="text" id='msgsend' value="hello word !">
</p>
<p>
<label for="msgrecv">msgrecv:</label>
<input type="text" id='msgrecv' disabled>
</p>
<button onclick="send()">发送(send by datachannel)</button>
<button onclick="close()">关闭(close datachannel)</button>
</div>
</div>
<script>
var player = null;
var recvOnly = true;
var resArr = [];
var ishttps = 'https:' == document.location.protocol ? true : false;
var isLocal = "file:" == document.location.protocol ? true : false;
const searchParams = new URL(document.location.href).searchParams;
let type = searchParams.get('type');
if (!['echo','push','play'].includes(type)) {
type = 'play';
}
recvOnly = type === 'play';
const apiPath = `/index/api/webrtc?app=${searchParams.get('app') ?? 'live'}&stream=${searchParams.get('stream') ?? 'test'}&type=${type}`;
if(!ishttps && !isLocal){
alert('本demo需要在https的网站访问 ,如果你要推流的话(this demo must access in site of https if you want push stream)');
}
const apiHost = isLocal ? "http://127.0.0.1" : `${document.location.protocol}//${window.location.host}`;
var url = apiHost + apiPath;
document.getElementById('streamUrl').value = url;
document.getElementsByName("method").forEach((el,idx) => {
el.checked = el.value === type;
el.onclick = function(e) {
let url = new URL(document.getElementById('streamUrl').value);
url.searchParams.set("type",el.value);
document.getElementById('streamUrl').value = url.toString();
if(el.value == "play"){
recvOnly = true;
}else if(el.value == "echo"){
recvOnly = false;
}else{
recvOnly = false;
}
};
});
ZLMRTCClient.GetAllScanResolution().forEach((r,i) => {
opt = document.createElement('option');
opt.text = `${r.label}(${r.width}x${r.height})`;
opt.value = r;
if (1080*720 <= r.width * r.height && r.width * r.height <= 1280*720) {
opt.selected = true;
}
document.getElementById("resolution").add(opt,null);
});
function start_play(){
let elr = document.getElementById("resolution");
let res = elr.options[elr.selectedIndex].text.match(/\d+/g);
let h = parseInt(res.pop());
let w = parseInt(res.pop());
player = new ZLMRTCClient.Endpoint(
{
element: document.getElementById('video'),// video 标签
debug: true,// 是否打印日志
zlmsdpUrl:document.getElementById('streamUrl').value,//流地址
simulcast:document.getElementById('simulcast').checked,
useCamera:document.getElementById('useCamera').checked,
audioEnable:document.getElementById('audioEnable').checked,
videoEnable:document.getElementById('videoEnable').checked,
recvOnly:recvOnly,
resolution:{w:w,h:h},
usedatachannel:document.getElementById('datachannel').checked,
}
);
player.on(ZLMRTCClient.Events.WEBRTC_ICE_CANDIDATE_ERROR,function(e)
{// ICE 协商出错
console.log('ICE 协商出错');
});
player.on(ZLMRTCClient.Events.WEBRTC_ON_REMOTE_STREAMS,function(e)
{//获取到了远端流,可以播放
console.log('播放成功',e.streams);
});
player.on(ZLMRTCClient.Events.WEBRTC_OFFER_ANWSER_EXCHANGE_FAILED,function(e)
{// offer anwser 交换失败
console.log('offer anwser 交换失败',e);
stop();
});
player.on(ZLMRTCClient.Events.WEBRTC_ON_LOCAL_STREAM,function(s)
{// 获取到了本地流
document.getElementById('selfVideo').srcObject=s;
document.getElementById('selfVideo').muted = true;
//console.log('offer anwser 交换失败',e)
});
player.on(ZLMRTCClient.Events.CAPTURE_STREAM_FAILED,function(s)
{// 获取本地流失败
console.log('获取本地流失败');
});
player.on(ZLMRTCClient.Events.WEBRTC_ON_CONNECTION_STATE_CHANGE,function(state)
{// RTC 状态变化 ,详情参考 https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/connectionState
console.log('当前状态==>',state);
});
player.on(ZLMRTCClient.Events.WEBRTC_ON_DATA_CHANNEL_OPEN,function(event)
{
console.log('rtc datachannel 打开 :',event);
});
player.on(ZLMRTCClient.Events.WEBRTC_ON_DATA_CHANNEL_MSG,function(event)
{
console.log('rtc datachannel 消息 :',event.data);
document.getElementById('msgrecv').value = event.data;
});
player.on(ZLMRTCClient.Events.WEBRTC_ON_DATA_CHANNEL_ERR,function(event)
{
console.log('rtc datachannel 错误 :',event);
});
player.on(ZLMRTCClient.Events.WEBRTC_ON_DATA_CHANNEL_CLOSE,function(event)
{
console.log('rtc datachannel 关闭 :',event);
});
}
function start()
{
stop();
let elr = document.getElementById("resolution");
let res = elr.options[elr.selectedIndex].text.match(/\d+/g);
let h = parseInt(res.pop());
let w = parseInt(res.pop());
if(document.getElementById('useCamera').checked && !recvOnly)
{
ZLMRTCClient.isSupportResolution(w,h).then(e=>{
start_play();
}).catch(e=>{
alert("not support resolution");
});
}else{
start_play();
}
}
function stop()
{
if(player)
{
player.close();
player = null;
var remote = document.getElementById('video');
if(remote)
{
remote.srcObject = null;
remote.load();
}
var local = document.getElementById('selfVideo');
local.srcObject = null;
local.load();
}
}
function send(){
if(player){
//send msg refernece https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/send
player.sendMsg(document.getElementById('msgsend').value);
}
}
function close(){
if(player){
player.closeDataChannel();
}
}
function on_click_to_play(app, stream) {
console.log(`on_click_to_play: ${app}/${stream}`);
var url = `${document.location.protocol}//${window.location.host}/index/api/webrtc?app=${app}&stream=${stream}&type=play`;
document.getElementById('streamUrl').value = url;
start();
}
function clearStreamList() {
let content = document.getElementById("olstreamlist");
while (content.hasChildNodes()) {
content.removeChild(content.firstChild);
}
}
function fillStreamList(json) {
clearStreamList();
if (json.code != 0 || !json.data) {
return;
}
let ss = {};
for (let o of json.data) {
if (ss[o.app]) {
ss[o.app].add(o.stream);
} else {
let set = new Set();
set.add(o.stream);
ss[o.app] = set;
}
}
for (let o in ss) {
let app = o;
for (let s of ss[o]) {
if (s) {
//console.log(app, s);
let content = document.getElementById("olstreamlist");
let child = `<li app="${app}" stream="${s}" onmouseover="this.style.color='blue';" onclick="on_click_to_play('${app}', '${s}')">${app}/${s}</li>`;
content.insertAdjacentHTML("beforeend", child);
}
}
}
}
async function getData(url) {
const response = await fetch(url, {
method: 'GET'
});
const data = await response.json();
//console.log(data);
return data;
}
function get_media_list() {
let url = document.location.protocol+"//"+window.location.host+"/index/api/getMediaList?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc";
let json = getData(url);
json.then((json)=> fillStreamList(json));
}
setInterval(() => {
// get_media_list();
}, 5000);
</script>
</body>
<script>
</script>
</html>

@ -0,0 +1,2 @@
感谢[big panda](<2381267071@qq.com>) 开发并贡献此webrtc js测试客户端,
其开源项目地址为:https://gitee.com/xiongguangjie/zlmrtcclient.js

@ -0,0 +1,138 @@
<template>
<!-- webrtc播放器 -->
<video :id="videoId"
ref="jswebrtc"
:controls="controls"
style="width: 100%; height: 100%;margin: 5px;"
muted></video>
</template>
<script>
export default {
name: 'webrtcPlayer',
props: {
videoId: {
type: String,
default: 'jswebrtc'
},
videoSrc: {
type: String,
default: ''
},
controls: {
type: Boolean,
default: true
}
},
data () {
return {
player: null
}
},
mounted () {
this.$watch('videoSrc', () => {
//console.log('videoSrc', this.videoSrc)
if (this.videoSrc) {
this.initVideo(this.videoSrc);
} else {
this.stop()
}
}, { immediate: true, deep: true })
},
methods: {
initVideo (url) {
// console.log('播放器', this.player)
//关闭流
if (this.player) {
this.player.pc.close()
this.player = null;
}
let videoDom = document.getElementById(this.videoId);
this.player = new ZLMRTCClient.Endpoint({
element: videoDom, // video 标签
debug: true, // 是否打印日志
zlmsdpUrl: url, //流地址
simulcast: true,
useCamera: true,
audioEnable: true,
videoEnable: true,
recvOnly: true,
resolution: {
w: 600,
h: 340
},
usedatachannel: true,
});
this.player.on(ZLMRTCClient.Events.WEBRTC_ICE_CANDIDATE_ERROR, function (e) { // ICE 协商出错
console.log('ICE 协商出错')
});
this.player.on(ZLMRTCClient.Events.WEBRTC_ON_REMOTE_STREAMS, function (e) { //获取到了远端流,可以播放
console.log('播放成功', e.streams)
videoDom.addEventListener('canplay', function (e) {
videoDom.play();
})
});
this.player.on(ZLMRTCClient.Events.WEBRTC_OFFER_ANWSER_EXCHANGE_FAILED, function (e) { // offer anwser 交换失败
console.log('offer anwser 交换失败', e)
// this.player.destroy();
// this.player = null;
});
this.player.on(ZLMRTCClient.Events.WEBRTC_ON_LOCAL_STREAM, function (s) { // 获取到了本地流
console.log('offer anwser 交换失败', e)
});
this.player.on(ZLMRTCClient.Events.CAPTURE_STREAM_FAILED, function (s) { // 获取本地流失败
console.log('获取本地流失败')
});
this.player.on(ZLMRTCClient.Events.WEBRTC_ON_CONNECTION_STATE_CHANGE, function (
state
) { // RTC 状态变化 ,详情参考 https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/connectionState
console.log('当前状态==>', state)
});
this.player.on(ZLMRTCClient.Events.WEBRTC_ON_DATA_CHANNEL_OPEN, function (event) {
console.log('rtc datachannel 打开 :', event)
});
this.player.on(ZLMRTCClient.Events.WEBRTC_ON_DATA_CHANNEL_MSG, function (event) {
console.log('rtc datachannel 消息 :', event.data)
});
this.player.on(ZLMRTCClient.Events.WEBRTC_ON_DATA_CHANNEL_ERR, function (event) {
console.log('rtc datachannel 错误 :', event)
});
this.player.on(ZLMRTCClient.Events.WEBRTC_ON_DATA_CHANNEL_CLOSE, function (event) {
console.log('rtc datachannel 关闭 :', event)
});
},
stop () {
let videoDom = document.getElementById(this.videoId);
videoDom.pause()
//关闭流
this.player.pc.close()
this.player = null
}
},
beforeDestroy () {
if (this.player) {
//关闭流
this.player.pc.close()
this.player = null;
}
}
}
</script>
<style>
</style>

@ -25,6 +25,11 @@ export default {
url: "/street/list",
name: "获取全部巷道列表"
},
cameraRecord: {
method: "POST",
url: "/cameraRecord/record",
name: "球机回放信息"
},
addStreet: {
method: "POST",
url: "/street",
@ -66,6 +71,16 @@ export default {
url: "/realTime/allCameras",
name: "获取全部球机"
},
allCamerasByArea:{
method: "GET",
url: "/realTime/allCamerasByArea",
name: "根据库区查询球机"
},
getAllAreas:{
method: "GET",
url: "/realTime/allAreas",
name: "获取全部库区"
},
getWallStyle:{
method: "GET",
url: "/realTime/wallStyle",

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

@ -15,21 +15,10 @@
<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">
<a href="javascript:;" style="margin:0 10px">
{{
userInfo.name ? userInfo.name : "userName"
}}
</a>
<div class="flex flex-column" :style="{ 'min-width': '78px' }" slot="content">
<a
class="block mb16"
href="javascript:;"
@click="visible = false;$router.push({name: 'center'})"
>个人中心</a>
<a href="javascript:;" @click="logout">退出登录</a>
</div>
</a-popover>
<div style="width:20px"/>
<div >
<img width="120" :src="logo" alt/>
</div>
</div>
</div>
</template>
@ -56,7 +45,8 @@ export default {
visible: false,
collapsed: false,
count: 0,
title: ""
title: "",
logo:require('@/assets/indexlogo.png'),
};
},
mounted() {

@ -94,22 +94,31 @@ const routes = [{
component: () => import('@/views/historyCheck/index'),
},
{
path: 'stockHistory',
name: 'stockHistory',
path: 'videoPlayback',
name: 'videoPlayback',
meta: {
icon: 'file-excel',
name: '库位历史',
},
component: () => import('@/views/stockLog/index'),
},
{
path: 'stockLogDetail',
name: 'stockLogDetail',
meta: {
name: '库位历史详情',
},
component: () => import('@/views/stockLog/logPage'),
},
icon: 'tag',
name: '记录回放',
},
component: () => import('@/views/videoPlayback/index'),
},
// {
// path: 'stockHistory',
// name: 'stockHistory',
// meta: {
// icon: 'file-excel',
// name: '库位历史',
// },
// component: () => import('@/views/stockLog/index'),
// },
// {
// path: 'stockLogDetail',
// name: 'stockLogDetail',
// meta: {
// name: '库位历史详情',
// },
// component: () => import('@/views/stockLog/logPage'),
// },
{
path: 'roadwayManage',
name: 'roadwayManage',
@ -136,24 +145,24 @@ const routes = [{
},
component: () => import('@/views/cameraManage/model')
},
{
path: 'productSpecManage',
name: 'productSpecManage',
meta: {
icon: 'pushpin',
name: '品规管理'
},
component: () => import('@/views/productSpecManage/index')
},
{
path: 'repertoryManage',
name: 'repertoryManage',
meta: {
icon: 'wallet',
name: '库存管理'
},
component: () => import('@/views/repertoryManage/index')
},
// {
// path: 'productSpecManage',
// name: 'productSpecManage',
// meta: {
// icon: 'pushpin',
// name: '品规管理'
// },
// component: () => import('@/views/productSpecManage/index')
// },
// {
// path: 'repertoryManage',
// name: 'repertoryManage',
// meta: {
// icon: 'wallet',
// name: '库存管理'
// },
// component: () => import('@/views/repertoryManage/index')
// },
{
path: 'cameraManage/ioTable',

@ -102,11 +102,18 @@
:centered="true"
class="config-model"
>
<video width="900"
<WebrtcPlayer
autoplay class="video-window"
:videoSrc="'http://127.0.0.1/index/api/webrtc?app=live&stream='+id+'&type=play'"
:videoId="'videoId'+colIndex+'-'+rowIndex"
ref="videoWindow"
:key="colIndex+'-'+rowIndex"
muted :style="{ width:'900px'}">
</WebrtcPlayer>
<!-- <video width="900"
height="600"
:id="`config-camera${id}`"
autoplay muted ></video>
autoplay muted ></video> -->
<div class="operation-list">
<div class="operation-item">
<img :src="zoomSubUrl" alt="" @mousedown="zoomDecStart"
@ -202,9 +209,12 @@ const columns = [
scopedSlots: { customRender: 'position' }
}
];
import WebRtcPlayer from "../../../public/static/webrtcplayer"
import WebrtcPlayer from '../../../public/webrtc/webrtcPlayer.vue'
//import WebRtcPlayer from "../../../public/static/webrtcplayer"
export default {
props:[ 'visible', 'modelType', 'modelData'],
components: {WebrtcPlayer},
watch: {
//监听并接收父组件的visible并赋值给isShow(子组件接收父组件props传过来的值时不能起一样的类名,会报重复定义的错)
visible: function(newVal){
@ -857,7 +867,7 @@ export default {
}
.config-table {
width: 800px;
height: 600px;
height: 500px;
overflow: hidden;
h2 {

@ -28,7 +28,7 @@
<!--渲染默认巷道框架规格 定位浮在 已有巷道上做对应-->
<span
class="default"
:id="`${shelveId}-${random.row[0] + random.row[1] - rowIndex - 1}-${column}`"
:id="`${direction}-${side}-${random.row[0] + random.row[1] - rowIndex - 1}-${column}`"
@click="tocheckPage(random.row[0] + random.row[1] - rowIndex - 1,column)">
{{ random.row[0] + random.row[1] - rowIndex - 1}}-{{column}}
</span>
@ -90,37 +90,33 @@ export default {
}
}
},
shelveId: {
type: String,
default: () => {
return {}
}
},
streetId: {
direction: {
type: Number,
default: () => {
return {}
}
},
streetName: {
type: String,
side: {
type: Number,
default: () => {
return {}
}
},
type: {
type: String,
streetId: {
type: Number,
default: () => {
return {}
}
},
inOut: {
streetName: {
type: String,
default: () => {
return {}
}
},
},
computed: {
// 应有的格子数
@ -138,15 +134,20 @@ export default {
column: this.getRandomColumn(this.select.column),
}
},
watchShelveIdInfo(){
return this.shelveId;
},
watchDirection(){
return this.direction;
},
watchSide(){
return this.side;
},
},
watch: {
watchShelveIdInfo() {
watchDirection() {
this.getStatus();
},
watchSide() {
this.getStatus();
},
immediate: true,
},
@ -215,25 +216,13 @@ export default {
},
getStatusBg(row,column,status) {
var dom = document.getElementById(this.shelveId+"-"+row+'-'+column);
var dom = document.getElementById(this.direction+"-"+this.side+"-"+row+'-'+column);
var color = status == 1 ?'#d81e06': (status == 2|| status == 3) ? '#1afa29': '#bfbfbf';
dom.style.background = color
},
getStatusTab(tab,status,rowColumn){
var dom = document.getElementById(this.shelveId+'-'+rowColumn+'-'+tab);
console.log(dom)
console.log(this.shelveId+'-'+rowColumn+'-'+tab)
dom.style.type ="close-circle"
var color = status == 1 ?'#d81e06': status == 2 ? '#1afa29': '#bfbfbf';
dom.style.color = color
console.log(dom)
},
getStatus(){
if(JSON.stringify(this.shelveId) == "{}"){
return;
}
var columnTab = []
for(let c = 1; c <= this.latticeColumn ;c++){
let tab = this.getRandom(c,this.latticeColumn,this.nums.column,this.total.column)
@ -250,7 +239,9 @@ export default {
columnEnd: this.random.column[1],
rowStart: this.random.row[0],
rowEnd: this.random.row[1],
shelveId: this.shelveId,
streetId: this.streetId,
direction: this.direction,
side: this.side,
rowTabs: rowTab,
columnTabs: columnTab
}
@ -287,7 +278,7 @@ export default {
tocheckPage(row,column){
this.$router.push({
name: 'checkOperation',
query: {row: row, column: column, shelveId: this.shelveId, id: this.streetId, name:this.streetName, type: this.type, type2: this.inOut}
query: {row: row, column: column, direction: this.direction,side:this.side, streetId: this.streetId, name:this.streetName}
})
}
}

@ -6,6 +6,11 @@
<div class="carousel-page-content">
<div class="img-box">
<ul>
<li>
<span >
{{streetName}}-{{this.direction == 1?"左":"右"}}-{{this.side == 1?"浅":"深"}}-{{row}}层-{{column}}列
</span>
</li>
<li>
<span class="img-box-title">
核对状态:
@ -66,16 +71,16 @@
type="primary"
style="background:#29c12b;border-color:#29c12b;"
@click="checkSure(checkObj.row,checkObj.column,checkObj.shelveId,index)"
>核对
>核对正确
</a-button>
</div>
<!-- <div class="bottom-btn"
>
<a-button class="btn" @click="prev()"><上一个</a-button>
<p>{{checkObj.row}}行{{checkObj.column}}列</p>
<a-button class="btn" @click="next()">下一个>
<a-button class="btn"
type="primary"
style="background:#ff0000;border-color:#ff0000;"
@click="checkfalse(checkObj.row,checkObj.column,checkObj.shelveId,index)"
>核对错误
</a-button>
</div> -->
</div>
</div>
@ -94,23 +99,11 @@ import {imgUrl} from "@/api/importExcel";
export default {
data() {
return {
listData: [],
scanAndCheck: {},
checkObj: {},
streetDetail: {},
checkList: {},
id: 0,
row: 1,
column: 1,
//当前货架行列总数
rowCount: 0,
columnCount: 0,
selectName: '',
shelveId: '',
// 方向 左右
selectType: 'left',
// 内外货架
selectType2: '',
streetName: '',
visible: false,
category: '',
count: 0,
@ -122,23 +115,13 @@ export default {
label:'盘点批次号',
key: 'lotnum'
},
{
label:'随行工单号',
key: 'orderNum'
},
{
label:'盘点任务号',
key: 'checkNum'
},
{
label:'托盘系统条码号',
key: 'wmsTrayCode'
},
{
label:'托盘扫描条码号',
key: 'trayCode'
},
{
label:'盘点时间',
key: 'exportTime'
@ -161,17 +144,18 @@ export default {
},
created() {
this.imgUrl = imgUrl
console.log(this.$route.query.id)
this.getStreetList();
if (this.$route.query.row && this.$route.query.column && this.$route.query.shelveId && this.$route.query.id && this.$route.query.name) {
//this.getStreetList();
if (this.$route.query.row && this.$route.query.column && this.$route.query.direction && this.$route.query.side && this.$route.query.streetId) {
this.id = this.$route.query.id
this.row = this.$route.query.row
this.column = this.$route.query.column
this.shelveId = this.$route.query.shelveId
this.selectName = this.$route.query.name
this.selectType = this.$route.query.type
this.selectType2 = this.$route.query.type2
this.getStockInfo(this.row, this.column, this.shelveId);
this.direction = this.$route.query.direction
this.side = this.$route.query.side
this.streetId = this.$route.query.streetId
this.streetName = this.$route.query.name
this.getStockInfo(this.row, this.column);
}
},
mounted() {
@ -184,48 +168,16 @@ export default {
Model
},
methods: {
//获取巷道列表
getStreetList() {
this.$api.httpApi.getStreetList({
data: {
pageNum: 1,
pageSize: 50,
}
}).then(res => {
this.listData = res.data.list;
this.select = this.id
this.getStreetDetail(this.id)
//this.getStockInfo(this.row,this.column,this.id)
//this.getStockList(this.id)
}).catch(err => {
console.error(err);
});
},
//获取巷道详情
getStreetDetail(id) {
this.$axios.get('/street/' + id, {
data: {}
}).then(res => {
this.streetDetail = res.data
this.getRowColumnCounts()
}).catch(err => {
})
},
//获取总行列数
getRowColumnCounts(){
this.updateShleveAndRowColumnCount(this.selectType)
if(this.streetDetail){}
},
//获取复核页面的核对信息
getStockInfo(row, column, shelveId) {
getStockInfo(row, column) {
this.$api.httpApi.getStockInfo({
data: {
row: Number(row),
column: Number(column),
shelveId: shelveId,
direction: this.direction,
side: this.side,
streetId: this.streetId,
}
}).then(res => {
if (res.data) {
@ -243,156 +195,43 @@ export default {
this.id = value
this.row = 1
this.column = 1
this.getStreetList()
for (var i = 0; i < this.listData.length; i++) {
if (this.listData[i].id == value) {
if (this.listData[i].leftShelveId) {
this.shelveId = this.listData[i].leftShelveId
this.selectType = 'left'
this.selectType2 = 'none'
this.rowCount = this.listData[i].leftRow
this.columnCount = this.listData[i].leftColumn
} else if (this.listData[i].leftInsideShelveId) {
this.shelveId = this.listData[i].leftInsideShelveId
this.selectType = 'left'
this.selectType2 = 'inside'
this.rowCount = this.listData[i].leftRow
this.columnCount = this.listData[i].leftColumn
} else if (this.listData[i].leftOutsideShelveId) {
this.shelveId = this.listData[i].leftOutsideShelveId
this.selectType = 'left'
this.selectType2 = 'out'
this.rowCount = this.listData[i].leftRow
this.columnCount = this.listData[i].leftColumn
}
}
}
this.getStockInfo(1, 1, this.shelveId)
},
// 左右货架切换 需要更新行列数
handleTypeChange(value) {
this.selectType = value
this.updateShleveAndRowColumnCount(value)
this.row = 1
this.column = 1
this.getStockInfo(this.row, this.column, this.shelveId)
this.getStockInfo(1, 1)
},
//根据streetDetail更新货架及该货架的总行列数
//direction : left right
updateShleveAndRowColumnCount(direction){
if (direction == 'left') {
this.rowCount = this.streetDetail.leftRow
this.columnCount = this.streetDetail.leftColumn
if(this.streetDetail.leftType == 0){
this.shelveId = this.streetDetail.leftShelveId
this.selectType2 = ''
}else{
if(this.selectType2 == 'inside'){
this.shelveId = this.streetDetail.leftInsideShelveId
}else if(this.selectType2 == 'outside'){
this.shelveId = this.streetDetail.leftOutsideShelveId
}else{
this.selectType2 = 'inside'
this.shelveId = this.streetDetail.leftInsideShelveId
}
checkSure(row, column, shelveId, index) {
this.$api.httpApi.stockCheckCorrect({
data: {
row: Number(row),
column: Number(column),
side: Number(this.side),
streetId: Number(this.streetId),
direction: Number(this.direction),
ok: 1
}
} else if (direction == 'right') {
this.rowCount = this.streetDetail.rightRow
this.columnCount = this.streetDetail.rightColumn
if(this.streetDetail.rightType == 0){
this.shelveId = this.streetDetail.rightShelveId
this.selectType2 = ''
}else{
if(this.selectType2 == 'inside'){
this.shelveId = this.streetDetail.rightInsideShelveId
}else if(this.selectType2 == 'outside'){
this.shelveId = this.streetDetail.rightOutsideShelveId
}else{
this.selectType2 = 'inside'
this.shelveId = this.streetDetail.rightInsideShelveId
}
}).then(res => {
if (res.code == 200) {
this.$message.success('操作成功');
this.getStockInfo(this.row,this.column)
}
}
},
//内外货架切换
sideStreetChange(value) {
this.selectType2 = value
if (this.selectType == 'left' && value == 'none') {
this.shelveId = this.streetDetail.leftShelveId
this.rowCount = this.streetDetail.leftRow
this.columnCount = this.streetDetail.leftColumn
} else if (this.selectType == 'right' && value == 'none') {
this.rowCount = this.streetDetail.rightRow
this.columnCount = this.streetDetail.rightColumn
this.shelveId = this.streetDetail.rightShelveId
} else if (this.selectType == 'left' && value == 'inside') {
this.rowCount = this.streetDetail.leftRow
this.columnCount = this.streetDetail.leftColumn
this.shelveId = this.streetDetail.leftInsideShelveId
} else if (this.selectType == 'left' && value == 'out') {
this.rowCount = this.streetDetail.leftRow
this.columnCount = this.streetDetail.leftColumn
this.shelveId = this.streetDetail.leftOutsideShelveId
} else if (this.selectType == 'right' && value == 'inside') {
this.rowCount = this.streetDetail.rightRow
this.columnCount = this.streetDetail.rightColumn
this.shelveId = this.streetDetail.rightInsideShelveId
} else if (this.selectType == 'right' && value == 'out') {
this.rowCount = this.streetDetail.rightRow
this.columnCount = this.streetDetail.rightColumn
this.shelveId = this.streetDetail.rightOutsideShelveId
}
this.getStockInfo(this.row, this.column, this.shelveId)
}).catch(err => {
});
},
prev() {
if(this.column > 1){
this.column = this.column - 1
}else{
if(this.row > 1){
this.row = this.row - 1
this.column = this.columnCount
}else{
this.row = this.rowCount
this.column = this.columnCount
}
}
this.getStockInfo(this.row,this.column,this.shelveId)
},
next() {
if(this.column < this.columnCount){
this.column = this.column + 1
}else{
//最大列了 row+1
if(this.row < this.rowCount){
this.row = this.row + 1
this.column = 1
}else{
this.row = 1
this.column = 1
}
}
this.getStockInfo(this.row,this.column,this.shelveId)
},
checkSure(row, column, shelveId, index) {
checkfalse(row, column, shelveId, index) {
this.$api.httpApi.stockCheckCorrect({
data: {
row: Number(row),
column: Number(column),
shelveId: shelveId,
side: Number(this.side),
streetId: Number(this.streetId),
direction: Number(this.direction),
ok: 0
}
}).then(res => {
if (res.code == 200) {
this.$message.success('操作成功');
this.getStockInfo(this.row,this.column,this.shelveId)
this.getStockInfo(this.row,this.column)
}
}).catch(err => {

@ -36,23 +36,24 @@
<!--左货架DOM-->
<div class="center-box">
<span class="shelf-number">
左货架号: {{leftShelveId.shelveId}}
左侧货架
</span>
<a-radio-group v-model="size" style="margin:10px 0" @change="getStockRowColumn"
v-if="streetDetail.leftInsideShelveId && streetDetail.leftOutsideShelveId">
<a-radio-button value="leftOutsideShelveId">
外
<a-radio-group v-model="leftSide" style="margin:10px 0"
v-if="streetDetail.leftType == 1">
<a-radio-button :value=1>
浅侧货架
</a-radio-button>
<a-radio-button value="leftInsideShelveId">
内
<a-radio-button :value=2>
深侧货架
</a-radio-button>
</a-radio-group>
</div>
<div class="check-content" v-for="item in data" :key="item.id">
<subsection v-if="item.id == select" :total="{row: item.leftRow, column: item.leftColumn}" :shelveId="leftShelveId.shelveId" :streetId="item.id" :streetName="item.name" type="left" :inOut="leftShelveId.shelveType" >
<subsection v-if="item.id == select" :total="{row: item.leftRow, column: item.leftColumn}" :side="leftSide" :direction=1 :streetId="item.id" :streetName="item.name">
</subsection>
</div>
@ -60,24 +61,26 @@
<!--单伸类型右货架DOM-->
<div class="center-box">
<span class="shelf-number">
右货架号: {{rightShelveId.shelveId}}
右侧货架
</span>
<a-radio-group v-model="size2" style="margin:10px 0" @change="getStockRowColumn"
v-if="streetDetail.rightInsideShelveId && streetDetail.rightOutsideShelveId">
<a-radio-button value="rightOutsideShelveId">
外
<a-radio-group v-model="rightSide" style="margin:10px 0"
v-if="streetDetail.rightType == 1">
<a-radio-button :value=1>
浅侧货架
</a-radio-button>
<a-radio-button value="rightInsideShelveId">
内
<a-radio-button :value=2>
深测货架
</a-radio-button>
</a-radio-group>
</div>
<div class="check-content" v-for="item in data" :key="item.name">
<subsection v-if="item.id == select" :total="{row:item.rightRow, column: item.rightColumn}" :shelveId="rightShelveId.shelveId" :streetId="item.id" :streetName="item.name" type="right" :inOut="rightShelveId.shelveType">
<subsection v-if="item.id == select" :total="{row:item.rightRow, column: item.rightColumn}" :side="rightSide" :direction=2 :streetId="item.id" :streetName="item.name">
</subsection>
</div>
</div>
@ -88,20 +91,12 @@ export default {
name:'checkManage',
data() {
return {
size: 'leftOutsideShelveId',
size2: 'rightOutsideShelveId',
leftSide: 1,
rightSide: 1,
data: [],
select: '',
streetId: 0,
streetDetail: {},
checkList: [],
stockInfo: {
left: {},
right: {}
},
leftShelveId:{},
rightShelveId:{}
}
},
computed: {
@ -143,58 +138,14 @@ export default {
});
},
// 获取盘点状态
async getStockRowColumn() {
this.rightShelveChange();
this.leftShelveChange();
},
rightShelveChange() {
let shelveId;
let shelveType = 'none';
if(this.streetDetail.rightShelveId) {
shelveId = this.streetDetail.rightShelveId;
}else if(this.streetDetail.rightInsideShelveId && this.size2 =='rightInsideShelveId'){
shelveId = this.streetDetail.rightInsideShelveId;
shelveType = 'inside';
}else if(this.streetDetail.rightOutsideShelveId && this.size2 == 'rightOutsideShelveId'){
shelveId = this.streetDetail.rightOutsideShelveId;
shelveType = 'out';
};
this.rightShelveId.shelveId = shelveId;
this.rightShelveId.shelveType = shelveType;
},
leftShelveChange() {
let shelveId;
let shelveType = 'none';
if(this.streetDetail.leftShelveId) {
shelveId = this.streetDetail.leftShelveId;
}else if(this.streetDetail.leftInsideShelveId && this.size =='leftInsideShelveId'){
shelveId = this.streetDetail.leftInsideShelveId;
shelveType = 'inside';
}else if(this.streetDetail.leftOutsideShelveId && this.size== 'leftOutsideShelveId'){
shelveId = this.streetDetail.leftOutsideShelveId;
shelveType = 'out';
};
this.leftShelveId.shelveId = shelveId;
this.leftShelveId.shelveType = shelveType;
},
getStatus(data, rowCol) {
return (data[rowCol] || {}).status;
},
// 获取状态对应的颜色
getStatusBg(data, rowCol) {
let status = this.getStatus(data, rowCol);
return status == 1 ?'#d81e06': status == 2 ? '#1afa29': '#bfbfbf';
},
//获取巷道详情
getStreetDetail(id) {
this.$axios.get('/street/' + id, {
data: {}
}).then(res => {
this.streetDetail = res.data
this.getStockRowColumn()
//this.getStockRowColumn()
}).catch(err => {
})
@ -203,15 +154,8 @@ export default {
handleChange(value) {
this.select = value
console.log("1654asdfasf"+value);
this.getStreetDetail(value)
this.leftShelveChange();
this.rightShelveChange();
},
tocheckOperation(checkObj, item) {
console.log(checkObj)
console.log(item)
this.$router.push({name: 'checkOperation', query: {checkObj: checkObj, item: item}})
},
exportStock() {

@ -5,7 +5,7 @@
<a-row :gutter="24">
<a-col :span="4">
<a-form-item label="巷道">
<a-select @change="handleChange" :value="select" style="width:250px">
<a-select @change="handleChange" v-model="select" style="width:100px">
<a-select-option v-for="i in listData" :key="i.name" :value="i.id">
{{i.name}}
</a-select-option>
@ -14,15 +14,15 @@
</a-col>
<a-col :span="2">
<a-form-item label="左右货架">
<a-select @change="leftRightChange" style="width: 80px" v-model="queryParam.leftRight">
<a-select-option value="0">
<a-form-item label="左右">
<a-select v-model="queryParam.leftRight" @change="leftRightChange" >
<a-select-option :value=0>
未选择
</a-select-option>
<a-select-option value="1">
<a-select-option :value=1>
左侧
</a-select-option>
<a-select-option value="2">
<a-select-option :value=2>
右侧
</a-select-option>
</a-select>
@ -30,36 +30,33 @@
</a-col>
<a-col :span="2">
<a-form-item label="内外货架" v-if="queryParam.side >= 0">
<a-select style="width: 80px" :key="queryParam.side" >
<a-select-option key="0">
<a-form-item label="深浅" v-if="queryParam.side >= 0">
<a-select style="width: 50px" :key="queryParam.side" >
<a-select-option :key=0>
未选择
</a-select-option>
<a-select-option key="1">
内
<a-select-option :key=1>
浅
</a-select-option>
<a-select-option key="2">
外
<a-select-option :key=2>
深
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="2" style="text-align: left">
<a-form-item label="行号">
<a-input v-model="queryParam.row" placeholder="请输入" style="width:70px;" type="number"/>
<a-input v-model="queryParam.row" placeholder="请输入" style="width:50px;" type="number"/>
</a-form-item>
</a-col>
<a-col :span="2" style="text-align: left">
<a-form-item label="列号">
<a-input v-model="queryParam.column" placeholder="请输入" style="width:70px;" type="number"/>
<a-input v-model="queryParam.column" placeholder="请输入" style="width:50px;" type="number"/>
</a-form-item>
</a-col>
<a-col :span="4" style="text-align: left">
<a-form-item label="盘点号">
<a-input v-model="queryParam.lotnum" placeholder="请输入" style="width:270px;"/>
<a-input v-model="queryParam.lotnum" placeholder="请输入" />
</a-form-item>
</a-col>
<a-col :span="4">
@ -71,8 +68,7 @@
:show-time="{
defaultValue: [moment('00:00', 'HH:mm'), moment('23:59', 'HH:mm')],
//defaultValue: [moment('00:00', 'YYYY-MM-DD HH:mm'), moment('23:59', 'YYYY-MM-DD HH:mm')],
}"
>
}">
<a-icon slot="suffixIcon" type="calendar"/>
</a-range-picker>
</a-form-item>
@ -96,7 +92,7 @@
{{ text }}
</span>
<span slot="goodsLocation" slot-scope="text">
{{ text.shelveId}}-{{ text.row}}-{{ text.column}}
{{ text.direction == 1 ?"左":"右"}}-{{ text.side == 1 ?"浅":"深"}}-{{ text.row}}-{{ text.column}}
</span>
<span slot="status" slot-scope="text">
{{ statusMap[text.status] }}
@ -127,16 +123,15 @@ export default {
statusMap: {0:"未盘点",1:"盘点异常",2:"核对正确",3:"人工核对正确"},
queryParam: {
lotnum: '',
shelveId:'',
side : "-1",
leftRight : "0"
side : '',
leftRight : ''
},
listData:[],
time:[],
pageNum: 1,
pageSize: 10,
data: [],
shelveId: '',
select: '',
pagination:{
total: 0,
@ -153,18 +148,14 @@ export default {
dataIndex: "lotnum",
},
{
title: "货位({货架}-{行}-{列})",
// dataIndex: "goodsLocation",
scopedSlots: {customRender: 'goodsLocation'},
},
{
title: "系统托盘条码号",
dataIndex: "wmsTrayCode",
title: "巷道名称",
dataIndex: "streetName",
},
{
title: "扫描托盘条码号",
dataIndex: "trayCode",
title: "货位({左右}-{深浅}-{行}-{列})",
scopedSlots: {customRender: 'goodsLocation'},
},
{
title: "盘点状态",
scopedSlots: {customRender: 'status'},
@ -175,7 +166,7 @@ export default {
width:320,
},
{
title: "时间",
title: "更新时间",
dataIndex: "createTime",
},
@ -211,8 +202,8 @@ export default {
},
handleChange(value) {
this.getStreetDetail(value)
this.queryParam.leftRight = "0"
this.queryParam.side = "-1"
this.queryParam.leftRight = ''
this.queryParam.side = ''
},
// 左右货架切换
@ -220,25 +211,21 @@ export default {
if (value == 1) {
//单伸
if(this.streetDetail.leftType == 0){
this.queryParam.side = -1
this.queryParam.side = ''
}else{
this.queryParam.side = 0
}
} else if (value == 2) {
if(this.streetDetail.rightType == 0){
this.queryParam.side = -1
this.queryParam.side = ''
}else{
this.queryParam.side = 0
}
} else{
this.queryParam.side = -1
this.queryParam.side = ''
}
},
// 里外切换
sideStreetChange(value) {
this.queryParam.side = value
},
handleSearch() {
console.log(this.queryParam)
this.pageNum = 1
@ -291,10 +278,9 @@ export default {
this.queryParam.startTimestamp = ""
this.queryParam.endTimestamp = ""
this.queryParam.lotnum = ""
this.queryParam.side = "-1"
this.queryParam.leftRight = "0"
this.queryParam.side = ''
this.queryParam.leftRight = ''
this.queryParam.streetId = 0
this.select = null;
this.time = []
this.pageNum = 1
@ -329,4 +315,4 @@ export default {
height:auto;
margin: 5px;
}
</style>
</style>

@ -3,6 +3,16 @@
<div class="ant-advanced-search-form">
<a-form layout="inline" :form="queryParam">
<a-row :gutter="24">
<a-col :span="4">
<a-form-item label="巷道">
<a-select @change="handleChange" style="width:150px" v-model="streetName">
<a-select-option v-for="i in listData" :key="i.name" :value="i.id">
{{i.name}}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="6" style="text-align: left">
<a-form-item label="工单号">
<a-input v-model="queryParam.orderNum" placeholder="请输入" style="width:270px;"/>
@ -23,7 +33,7 @@
</a-range-picker>
</a-form-item>
</a-col>
<a-col :span="10" style="text-align: right">
<a-col :span="5" style="text-align: right">
<a-button type="primary" @click="handleSearch">搜索</a-button>
<a-button style="margin-left: 15px" @click="reset">重置</a-button>
</a-col>
@ -95,9 +105,12 @@ export default {
data() {
return {
queryParam: {
streetId: '',
orderNum: ''
},
streetName: '',
time:[],
listData:[],
pageNum: 1,
pageSize: 10,
data: [],
@ -163,6 +176,8 @@ export default {
}
},
mounted() {
this.getStreetList();
this.handleGetHistoryList()
console.log(this.imgUrl)
if (this.$route.params.orderNum) {
@ -172,6 +187,23 @@ export default {
},
methods: {
moment,
//获取巷道列表
getStreetList() {
this.$api.httpApi.getAllStreet({
}).then(res => {
this.listData = res.data;
}).catch(err => {
console.error(err);
});
},
handleChange(value) {
this.queryParam.streetId = value
this.streetName = value
this.getStreetDetail(value)
},
range(start, end) {
const result = [];
for (let i = start; i < end; i++) {

@ -114,5 +114,7 @@ export default {
.ant-table td {
white-space: nowrap;
}
}
</style>

@ -1,66 +1,75 @@
<template>
<div class="realTime bg-white">
<a-tabs default-active-key="1" slot="headerContent" v-model="tabKey" @change="tabsChange" padding:10px>
<a-tab-pane :key="item.streetId.toString()" :tab="item.streetName" v-for="item in realTimeListData"></a-tab-pane>
<div class="realTime bg-white" style="width: 81.5VW">
<a-tabs default-active-key="1" slot="headerContent" v-model="tabKey"
@change="tabsChange" padding:10px>
<a-tab-pane :key="item.streetId.toString()" :tab="item.streetName" v-for="item in realTimeListData">
</a-tab-pane>
</a-tabs>
<!-- {{cameras.length}} {{ selectTab.videoStyleRow }} * {{ selectTab.videoStyleColumn }}-->
<a-row :gutter="20">
<a-col
v-for="(item, index) in cameras.slice(0, selectTab.videoStyleRow * selectTab.videoStyleColumn)"
:span="24 / selectTab.videoStyleColumn"
:key="index"
:style="{
height: videoHeight,
<a-col
v-for="(item, index) in cameras.slice(0, selectTab.videoStyleRow * selectTab.videoStyleColumn)"
:span="24 / selectTab.videoStyleColumn"
:key="index"
:style="{
height: videoHeight,
marginBottom: ((selectTab.videoStyleRow * selectTab.videoStyleColumn - index - 1) >= selectTab.videoStyleColumn) ? '20px': 0
}"
>
<div style="position: relative;width: 100%;">
<WebrtcPlayer
autoplay class="video-window"
:videoSrc="'http://127.0.0.1/index/api/webrtc?app=live&stream='+item.id+'&type=play'"
:videoId="'videoId'+colIndex+'-'+rowIndex"
ref="videoWindow"
:key="colIndex+'-'+rowIndex"
muted :style="{ height: videoHeight,}">
</WebrtcPlayer>
<!-- <video :style="{ height: videoHeight,}" :id="`camera${item.id}`" autoplay muted controls>
</video> -->
<div class="operation-list">
<div class="operation-item">
<img :src="zoomSubUrl" alt="" @mousedown=zoomDecStart($event,item.id) @mouseleave=zoomDecStop($event,item.id)
>
<span>变倍</span>
<img :src="zoomAddUrl" alt="" @mousedown=zoomAddStart($event,item.id) @mouseleave=zoomAddStop($event,item.id)
>
</div>
<div class="operation-item">
<img :src="focusSubUrl" alt="" @mousedown=focusDecStart($event,item.id) @mouseleave=focusDecStop($event,item.id)
@mouseup=focusDecStop($event,item.id)>
<span>变焦</span>
<img :src="focusAddUrl" alt="" @mousedown=focusAddStart($event,item.id) @mouseleave=focusAddStop($event,item.id)
@mouseup=focusAddStop($event,item.id)>
</div>
<div class="operation-item">
<img :src="irisSubUrl" alt="" @mousedown=irisDecStart($event,item.id) @mouseup=irisDecStop($event,item.id) @mouseleave=irisDecStop($event,item.id)>
<span>光圈</span>
<img :src="irisAddUrl" alt="" @mousedown=irisAddStart($event,item.id) @mouseup=irisAddStop($event,item.id) @mouseleave=irisAddStop($event,item.id)>
</div>
</div>
<div class="direction-list">
<div class="direction-item">
<img :src="leftUpUrl" alt="" @mousedown=leftUpStart($event,item.id) @mouseup=leftUpStop($event,item.id) @mouseleave=leftUpStop($event,item.id)>
<img :src="upUrl" alt="" @mousedown=upStart($event,item.id) @mouseup=upStop($event,item.id) @mouseleave=upStop($event,item.id) >
<img :src="rightUpUrl" alt="" @mousedown=rightUpStart($event,item.id) @mouseup=rightUpStop($event,item.id) @mouseleave=rightUpStop($event,item.id) >
</div>
<div class="direction-item">
<img :src="leftUrl" alt="" @mousedown=leftStart($event,item.id) @mouseup=leftStop($event,item.id) @mouseleave=leftStop($event,item.id)>
<img :src="rightUrl" alt="" @mousedown=rightStart($event,item.id) @mouseup=rightStop($event,item.id) @mouseleave=rightStop($event,item.id)>
</div>
<div class="direction-item">
<img :src="leftDownUrl" alt="" @mousedown=leftDownStart($event,item.id)
@mouseup=leftDownStop($event,item.id) @mouseleave=leftDownStop($event,item.id)>
<img :src="downUrl" alt="" @mousedown=downStart($event,item.id) @mouseup=downStop($event,item.id) @mouseleave=downStop($event,item.id)>
<img :src="rightDownUrl" alt="" @mousedown=rightDownStart($event,item.id)
@mouseup=rightDownStop($event,item.id) @mouseleave=rightDownStop($event,item.id)>
</div>
</div>
</div>
marginBottom: ((selectTab.videoStyleRow * selectTab.videoStyleColumn - index - 1) >= selectTab.videoStyleColumn) ? '20px': 0
}"
>
<div style="position: relative;width: 100%;">
<video :style="{ height: videoHeight,}" :id="`camera${item.id}`" autoplay muted controls>
</video>
<div class="operation-list">
<div class="operation-item">
<img :src="zoomSubUrl" alt="" @mousedown=zoomDecStart($event,item.id) @mouseleave=zoomDecStop($event,item.id)
>
<span>变倍</span>
<img :src="zoomAddUrl" alt="" @mousedown=zoomAddStart($event,item.id) @mouseleave=zoomAddStop($event,item.id)
>
</div>
<div class="operation-item">
<img :src="focusSubUrl" alt="" @mousedown=focusDecStart($event,item.id) @mouseleave=focusDecStop($event,item.id)
@mouseup=focusDecStop($event,item.id)>
<span>变焦</span>
<img :src="focusAddUrl" alt="" @mousedown=focusAddStart($event,item.id) @mouseleave=focusAddStop($event,item.id)
@mouseup=focusAddStop($event,item.id)>
</div>
<div class="operation-item">
<img :src="irisSubUrl" alt="" @mousedown=irisDecStart($event,item.id) @mouseup=irisDecStop($event,item.id) @mouseleave=irisDecStop($event,item.id)>
<span>光圈</span>
<img :src="irisAddUrl" alt="" @mousedown=irisAddStart($event,item.id) @mouseup=irisAddStop($event,item.id) @mouseleave=irisAddStop($event,item.id)>
</div>
</div>
<div class="direction-list">
<div class="direction-item">
<img :src="leftUpUrl" alt="" @mousedown=leftUpStart($event,item.id) @mouseup=leftUpStop($event,item.id) @mouseleave=leftUpStop($event,item.id)>
<img :src="upUrl" alt="" @mousedown=upStart($event,item.id) @mouseup=upStop($event,item.id) @mouseleave=upStop($event,item.id) >
<img :src="rightUpUrl" alt="" @mousedown=rightUpStart($event,item.id) @mouseup=rightUpStop($event,item.id) @mouseleave=rightUpStop($event,item.id) >
</div>
<div class="direction-item">
<img :src="leftUrl" alt="" @mousedown=leftStart($event,item.id) @mouseup=leftStop($event,item.id) @mouseleave=leftStop($event,item.id)>
<img :src="rightUrl" alt="" @mousedown=rightStart($event,item.id) @mouseup=rightStop($event,item.id) @mouseleave=rightStop($event,item.id)>
</div>
<div class="direction-item">
<img :src="leftDownUrl" alt="" @mousedown=leftDownStart($event,item.id)
@mouseup=leftDownStop($event,item.id) @mouseleave=leftDownStop($event,item.id)>
<img :src="downUrl" alt="" @mousedown=downStart($event,item.id) @mouseup=downStop($event,item.id) @mouseleave=downStop($event,item.id)>
<img :src="rightDownUrl" alt="" @mousedown=rightDownStart($event,item.id)
@mouseup=rightDownStop($event,item.id) @mouseleave=rightDownStop($event,item.id)>
</div>
</div>
</div>
</a-col>
</a-col>
</a-row>
</div>
@ -68,12 +77,12 @@
<script>
import WebRtcPlayer from "../../../public/static/webrtcplayer"
//import WebRtcPlayer from "../../../public/static/webrtcplayer"
import WebrtcPlayer from '../../../public/webrtc/webrtcPlayer.vue'
export default {
name: "realTimeMonitoring",
components: {
//VideoPlayer
},
components: {WebrtcPlayer},
data() {
return {
realTimeListData: [],
@ -107,6 +116,7 @@ export default {
return (this.realTimeListData.filter(item=> item.streetId == this.tabKey)[0] || {})
},
cameras() {
console.log("cameras" +this.selectTab);
return this.selectTab.cameras || [];
},
videoHeight() {

@ -98,6 +98,10 @@ const columns = [
title: '巷道标识',
dataIndex: 'plcId',
},
{
title: '库区',
dataIndex: 'area',
},
{
title: '光源IP',
scopedSlots: { customRender: 'lightSourceIp' }

@ -25,6 +25,15 @@
v-decorator="['plcId', { rules: [{ required: true, message: '请输入巷道标识!' }] }]"
/>
</a-form-item>
</div>
<div class="across-layout">
<a-form-item label="库区" :label-col="formItemAcrossLayout.labelCol">
<a-input
v-decorator="['area']"
/>
</a-form-item>
</div>
<div class="across-layout">
<a-form-item label="PLC IP" :label-col="formItemAcrossLayout.labelCol">
@ -99,25 +108,6 @@
</a-form-item>
</div>
<div class="across-layout" v-if="leftType =='0'">
<a-form-item label="货架号" :label-col="formItemAcrossLayout.labelCol">
<a-input
v-decorator="['leftShelveId', { rules: [{ required: true, message: '请输入货架号!' }] }]"
/>
</a-form-item>
</div>
<div class="across-layout" v-if="leftType =='1'">
<a-form-item label="浅货架号" :label-col="formItemAcrossLayout.labelCol">
<a-input
v-decorator="['leftInsideShelveId', { rules: [{ required: true, message: '请输入内货架号!' }] }]"
/>
</a-form-item>
<a-form-item label="深货架号" :label-col="formItemAcrossLayout.labelCol">
<a-input
v-decorator="['leftOutsideShelveId', { rules: [{ required: true, message: '请输入外货架号!' }] }]"
/>
</a-form-item>
</div>
<div class="across-layout">
<a-form-item label="扫码枪IP" :label-col="formItemAcrossLayout.labelCol">
<a-input
@ -166,25 +156,6 @@
/>
</a-form-item>
</div>
<div class="across-layout" v-if="rightType =='0'">
<a-form-item label="货架号" :label-col="formItemAcrossLayout.labelCol">
<a-input
v-decorator="['rightShelveId', { rules: [{ required: true, message: '请输入货架号!' }] }]"
/>
</a-form-item>
</div>
<div class="across-layout" v-if="rightType =='1'">
<a-form-item label="浅货架号" :label-col="formItemAcrossLayout.labelCol">
<a-input
v-decorator="['rightInsideShelveId', { rules: [{ required: true, message: '请输入内货架号!' }] }]"
/>
</a-form-item>
<a-form-item label="深货架号" :label-col="formItemAcrossLayout.labelCol">
<a-input
v-decorator="['rightOutsideShelveId', { rules: [{ required: true, message: '请输入外货架号!' }] }]"
/>
</a-form-item>
</div>
<div class="across-layout">
<a-form-item label="扫码枪IP" :label-col="formItemAcrossLayout.labelCol">
<a-input
@ -200,7 +171,7 @@
<a-divider></a-divider>
</div>
<div v-if="cameraList.length>0">
<a-form-item label="球机1" :label-col="formItemVerticalLayout.labelCol">
<a-form-item label="左侧球机" :label-col="formItemVerticalLayout.labelCol">
<a-select
v-decorator="[
'camera1Id',
@ -213,7 +184,7 @@
</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="球机2" :label-col="formItemVerticalLayout.labelCol">
<a-form-item label="右侧球机" :label-col="formItemVerticalLayout.labelCol">
<a-select
v-decorator="[
'camera2Id',
@ -227,7 +198,7 @@
</a-form-item>
</div>
<div v-else>
<a-form-item label="球机1" :label-col="formItemVerticalLayout.labelCol">
<a-form-item label="左侧球机" :label-col="formItemVerticalLayout.labelCol">
<a-select
v-decorator="[
'camera1Name',
@ -240,7 +211,7 @@
</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="球机2" :label-col="formItemVerticalLayout.labelCol">
<a-form-item label="右侧球机" :label-col="formItemVerticalLayout.labelCol">
<a-select
v-decorator="[
'camera2Name',
@ -315,7 +286,8 @@ export default {
camera1Id:newVal.camera1Id,
camera2Id:newVal.camera2Id,
camera1Name:newVal.camera1Name,
camera2Name:newVal.camera2Name
camera2Name:newVal.camera2Name,
area:newVal.area
})
})
}
@ -430,13 +402,10 @@ export default {
this.rightType = value //判断渲染右货架单伸或者双伸的时会用到,在这里赋值给data实例
},
handleSelectCamera(){
this.$api.httpApi.getCameraList({
data: {
pageNum:0,
pageSize:0,
}
this.$api.httpApi.getAllCameras({
}).then(res => {
this.cameraList = res.data.list;
this.cameraList = res.data;
}).catch(err => {
});

@ -25,7 +25,7 @@
<!--渲染默认巷道框架规格 定位浮在 已有巷道上做对应-->
<span style="background:#bfbfbf;"
class="default"
:id="`${shelveId}-${random.row[0] + random.row[1] - rowIndex - 1}-${column}`"
:id="`${direction}-${side}-${random.row[0] + random.row[1] - rowIndex - 1}-${column}`"
@click="toStockPage(random.row[0] + random.row[1] - rowIndex - 1,column)">
{{ random.row[0] + random.row[1] - rowIndex - 1}}-{{column}}
</span>
@ -83,31 +83,27 @@ export default {
}
}
},
shelveId: {
type: String,
default: () => {
return {}
}
},
streetId: {
//左右
direction:{
type: Number,
default: () => {
return {}
}
},
streetName: {
type: String,
//深浅
side:{
type: Number,
default: () => {
return {}
}
},
type: {
type: String,
streetId: {
type: Number,
default: () => {
return {}
}
},
inOut: {
streetName: {
type: String,
default: () => {
return {}
@ -187,7 +183,7 @@ export default {
toStockPage(row,column){
this.$router.push({
name: 'stockLogDetail',
query: {row: row, column: column, shelveId: this.shelveId}
query: {row: row, column: column, direction: this.direction,side:this.side,streetId:this.streetId}
})
}
}

@ -13,23 +13,24 @@
<!--左货架DOM-->
<div class="center-box">
<span class="shelf-number">
右货架
左侧货架
</span>
<a-radio-group v-model="size" style="margin:10px 0" @change="getStockRowColumn"
v-if="streetDetail.leftInsideShelveId && streetDetail.leftOutsideShelveId">
<a-radio-button value="leftOutsideShelveId">
外
<a-radio-group v-model="leftSide" style="margin:10px 0"
v-if="streetDetail.leftType==1">
<a-radio-button :value=1>
浅货架
</a-radio-button>
<a-radio-button value="leftInsideShelveId">
内
<a-radio-button :value=2>
深货架
</a-radio-button>
</a-radio-group>
</div>
<div class="check-content" v-for="item in data" :key="item.id">
<subsection v-if="item.id == select" :total="{row: item.leftRow, column: item.leftColumn}" :shelveId="leftShelveId.shelveId" :streetId="item.id" :streetName="item.name" type="left" :inOut="leftShelveId.shelveType" >
<subsection v-if="item.id == select" :total="{row: item.leftRow, column: item.leftColumn}" :direction=1 :side="leftSide" :streetId="item.id" :streetName="item.name">
</subsection>
</div>
@ -37,24 +38,25 @@
<!--单伸类型右货架DOM-->
<div class="center-box">
<span class="shelf-number">
左货架
右侧货架
</span>
<a-radio-group v-model="size2" style="margin:10px 0" @change="getStockRowColumn"
v-if="streetDetail.rightInsideShelveId && streetDetail.rightOutsideShelveId">
<a-radio-button value="rightOutsideShelveId">
外
<a-radio-group v-model="rightSide" style="margin:10px 0"
v-if="streetDetail.rightType==1">
<a-radio-button :value=1>
浅货架
</a-radio-button>
<a-radio-button value="rightInsideShelveId">
内
<a-radio-button :value=2>
深货架
</a-radio-button>
</a-radio-group>
</div>
<div class="check-content" v-for="item in data" :key="item.name">
<subsection v-if="item.id == select" :total="{row:item.rightRow, column: item.rightColumn}" :shelveId="rightShelveId.shelveId" :streetId="item.id" :streetName="item.name" type="right" :inOut="rightShelveId.shelveType">
<subsection v-if="item.id == select" :total="{row:item.rightRow, column: item.rightColumn}" :direction=2 :side="rightSide" :streetId="item.id" :streetName="item.name" >
</subsection>
</div>
</div>
@ -65,20 +67,12 @@ export default {
name:'checkManage',
data() {
return {
size: 'leftOutsideShelveId',
size2: 'rightOutsideShelveId',
leftSide: 1,
rightSide: 1,
data: [],
select: '',
streetId: 0,
streetDetail: {},
checkList: [],
stockInfo: {
left: {},
right: {}
},
leftShelveId:{},
rightShelveId:{}
}
},
computed: {
@ -119,51 +113,13 @@ export default {
});
},
// 获取盘点状态
async getStockRowColumn() {
this.rightShelveChange();
this.leftShelveChange();
},
rightShelveChange() {
let shelveId;
let shelveType = 'none';
if(this.streetDetail.rightShelveId) {
shelveId = this.streetDetail.rightShelveId;
}else if(this.streetDetail.rightInsideShelveId && this.size2 =='rightInsideShelveId'){
shelveId = this.streetDetail.rightInsideShelveId;
shelveType = 'inside';
}else if(this.streetDetail.rightOutsideShelveId && this.size2 == 'rightOutsideShelveId'){
shelveId = this.streetDetail.rightOutsideShelveId;
shelveType = 'out';
};
this.rightShelveId.shelveId = shelveId;
this.rightShelveId.shelveType = shelveType;
},
leftShelveChange() {
let shelveId;
let shelveType = 'none';
if(this.streetDetail.leftShelveId) {
shelveId = this.streetDetail.leftShelveId;
}else if(this.streetDetail.leftInsideShelveId && this.size =='leftInsideShelveId'){
shelveId = this.streetDetail.leftInsideShelveId;
shelveType = 'inside';
}else if(this.streetDetail.leftOutsideShelveId && this.size== 'leftOutsideShelveId'){
shelveId = this.streetDetail.leftOutsideShelveId;
shelveType = 'out';
};
this.leftShelveId.shelveId = shelveId;
this.leftShelveId.shelveType = shelveType;
},
//获取巷道详情
getStreetDetail(id) {
this.$axios.get('/street/' + id, {
data: {}
}).then(res => {
this.streetDetail = res.data
this.getStockRowColumn()
}).catch(err => {
})
@ -174,8 +130,6 @@ export default {
this.select = value
this.getStreetDetail(value)
this.leftShelveChange();
this.rightShelveChange();
},
},

@ -75,7 +75,8 @@ export default {
},
row: 0,
column: 0,
shelveId: '',
direction:0,
side:0,
columns,
statusMap: {0:"未知",1:"取货到位",2:"取货完成",3:"放货到位",4:"放货完成"},
@ -93,11 +94,13 @@ export default {
},
created() {
this.imgUrl = imgUrl
if (this.$route.query.row && this.$route.query.column && this.$route.query.shelveId ) {
if (this.$route.query.row && this.$route.query.column && this.$route.query.side && this.$route.query.direction && this.$route.query.streetId) {
this.row = this.$route.query.row
this.column = this.$route.query.column
this.shelveId = this.$route.query.shelveId
this.side = this.$route.query.side
this.direction = this.$route.query.direction
this.streetId = this.$route.query.streetId
}
},
mounted() {
@ -125,7 +128,9 @@ export default {
pageSize:this.pageSize,
row:this.row,
column:this.column,
shelveId:this.shelveId
side:this.side,
direction:this.direction,
streetId:this.streetId
}
}).then(res => {
const pagination = { ...this.pagination };

@ -0,0 +1,409 @@
<template>
<a-row type="flex" :gutter="30">
<a-col :flex="1">
时间:<a-date-picker v-model="date" format="YYYY-MM-DD" placeholder="请选择时间" @change="cameraRecord"/>
<section style="height: 80vh;overflow: hidden;
overflow-y: scroll;">
<a-tree
:tree-data="treeData"
:check-strictly="true"
@select="handleCheck">
</a-tree>
</section>
</a-col>
<a-col :flex="13">
<div>
<div class="time-display">
<!-- 视频 -->
<video ref="videoPlayer" muted style=" display: flex;" width="100%" >
<source :src="currentVideoUrl" type="video/mp4" />
</video>
</div>
<!-- 滑动轴 -->
<div class="zoom-buttons" width="100%" >
<a-button-group>
<a-button icon="arrows-alt" :disabled="zoom" @click="handleZoomIn"></a-button>
<a-button icon="shrink" :disabled="shrink" @click="handleZoomOut"></a-button>
</a-button-group>
</div>
<a-slider
ref="slider"
:marks="marks"
class="progress-bar"
:max="totalDuration"
:tip-formatter="formatter"
:value="currentTime"
:disabled="Object.keys(urls).length === 0"
@change="onSliderChange"
/>
<div class="time-display">
<a-button-group>
<a-button icon="step-backward" :disabled="Object.keys(urls).length === 0" @click="moveForward(-5)" />
<a-button v-if="isPlaying" :disabled="Object.keys(urls).length === 0" icon="pause" @click="pauseVideo" />
<a-button v-else icon="play-circle" :disabled="Object.keys(urls).length === 0" @click="playVideo" />
<a-button icon="step-forward" :disabled="Object.keys(urls).length === 0" @click="moveForward(5)" />
</a-button-group>
</div>
</div>
</a-col>
</a-row>
</template>
<script>
import { Slider, Button, ButtonGroup } from 'ant-design-vue';
import moment from 'moment'
import { message } from 'ant-design-vue';
export default {
components: {
ASlider: Slider,
AButton: Button,
AButtonGroup: ButtonGroup,
},
data() {
return {
totalDuration: 24*60*60, // 假设视频总时长为60s
//数据轴上的数值
currentTime: 0,
//数据轴上的开始时间
startTimeLong: 0,
//数据轴上的结束时间
endTimeLong: 24*60*60,
//当天记录的结束的时间绝对值
maxTimeLong:24*60*60,
//当天记录的开始的时间绝对值
minTimeLong: 0*60*60,
date: this.getYesterday() ,
currentVideoUrl: '', // 当前视频的 URL
value1: '2023-10-11',
urls:{
},
URLStartTime: 0,
isPlaying: false, // 视频是否正在播放
marks:{},
zoom:false,
shrink:true,
treeData: [],
cameraId:'',
};
},
mounted() {
const video = this.$refs.videoPlayer;
video.addEventListener('timeupdate', this.onVideoTimeUpdate);
video.addEventListener('ended', this.playNextVideo);
console.log(this.getTimeMap());
this.totalDuration = this.endTimeLong -this.startTimeLong;
this.marks = this.getTimeMap();
console.log(this.date);
this.getTree()
this.cameraRecord()
},
beforeDestroy() {
const video = this.$refs.videoPlayer;
video.removeEventListener('timeupdate', this.onVideoTimeUpdate);
video.removeEventListener('ended', this.playNextVideo);
},
methods: {
getYesterday(){
const now = moment();
return now.subtract(1, 'days')
},
scaleTime(rate) {
const middle = this.startTimeLong +this.currentTime;
// 计算开始时间到中间时间的毫秒数
const startToMiddleMs = middle - this.startTimeLong;
// 计算结束时间到中间时间的毫秒数
const endToMiddleMs = this.endTimeLong - middle;
// 缩小或放大开始时间
const scaledStart = middle -Math.floor( startToMiddleMs * rate);
console.log("开始缩小时间"+ scaledStart);
// 缩小或放大结束时间
const scaledEnd =middle +Math.floor( endToMiddleMs * rate);
console.log("结束缩小时间"+ scaledEnd);
// 检查是否超出当天时间的范围并赋值
this.startTimeLong = this.minTimeLong>scaledStart?this.minTimeLong : scaledStart;
this.endTimeLong = this.maxTimeLong<scaledEnd?this.maxTimeLong : scaledEnd;
//时间修改
if(this.minTimeLong<scaledStart || this.maxTimeLong>scaledEnd){
this.shrink=false;
}else{
this.shrink=true;
}
console.log("zhou"+middle);
this.updateslider(middle)
},
formatTime(seconds) {
seconds = seconds%(60*60*24);
const hour = Math.floor(seconds / 3600);
const minute = Math.floor((seconds % 3600) / 60);
const second = seconds % 60;
return `${hour.toString().padStart(2, '0')}:${minute.toString().padStart(2, '0')}:${second.toString().padStart(2, '0')}`;
},
// 点击放大按钮触发的方法
handleZoomIn() {
this.scaleTime(0.5)
},
// 点击缩小按钮触发的方法
handleZoomOut() {
this.scaleTime(2)
},
//根据开始时间修改时间轴(轴位置不变,请在外部修改)
updateslider(middle){
this.totalDuration = this.endTimeLong - this.startTimeLong;
console.log("轴上数值为:"+(middle-this.startTimeLong));
this.currentTime = (middle-this.startTimeLong);
this.marks = this.getTimeMap();
},
getTree(){
this.$api.httpApi.getAllStreet({
}).then(res => {
console.log("update data")
for(let i = 0;i<res.data.length;i++){
// 创建空对象
const obj = {};
// 添加属性和值
obj["title"] = res.data[i].name;
obj["key"] = res.data[i].id;
obj["type"] = 0
obj["children"] =[];
if( res.data[i].camera1Id !=""){
const obj1 = {};
obj1["title"] = res.data[i].camera1Name
obj1["key"] = res.data[i].camera1Id
obj1["type"] = 1
obj["children"].push(obj1)
}
if( res.data[i].camera2Id !=""){
const obj1 = {};
obj1["title"] = res.data[i].camera2Name
obj1["key"] = res.data[i].camera2Id
obj1["type"] = 1
obj["children"].push(obj1)
}
this.treeData.push(obj)
}
console.log(this.treeData);
}).catch(err => {
});
},
getTimeMap() {
const diff = this.endTimeLong - this.startTimeLong; // 计算时间差,单位为秒
console.log(diff + " qqq");
const map = {};
if (diff >= 60 * 60 * 3) {
this.TimeMapErgodic(60*60,map);
} else if (diff >= 60 * 60) {
// 如果大于等于1小时小于3小时每15分钟一个标识
this.TimeMapErgodic(15*60,map);
} else if (diff >= 60*20) {
this.zoom = false;
// 如果大于等于20分钟小于1小时每5分钟一个标识
this.TimeMapErgodic(5*60,map);
} else if (diff >= 5* 60) {
this.zoom = false;
// 如果大于等于5分钟小于20分钟每分钟一个标识
this.TimeMapErgodic(60,map);
} else if (diff >= 30) {
this.zoom = false;
// 如果小于5分钟大于1m每30s一个标识
console.log("如果小于5分钟大于1m每30s一个标识");
console.log(startTime +" "+endTime)
this.TimeMapErgodic(30,map);
} else if (diff >= 10) {
this.zoom = true;
// 如果小于1m大于10s 5s标识
this.TimeMapErgodic(5,map);
} else {
this.zoom = true;
// 如果小于10s 1s标识
this.TimeMapErgodic(1,map);
}
return map;
},
//遍历获取time映射
TimeMapErgodic(interval,map){
const startTime =Math.ceil(this.startTimeLong/(interval)) *interval;
const endTime =Math.floor(this.endTimeLong/(interval))*interval;
for (let i = startTime ; i<= endTime; i+=interval) {
const minuteDiff = (i - this.startTimeLong) ;
map[minuteDiff] = `${String(Math.floor(i/(60*60))).padStart(2, '0')}:${String(Math.floor((i%(60*60))/(60))).padStart(2, '0')}:${String((i%(60))).padStart(2, '0')}`;
}
return map;
},
//将秒数转为 时分秒
formatter(value) {
const i = this.startTimeLong + value
// 格式化输出新的时间
const hours = String(Math.floor(i/(60*60))).padStart(2, '0');
const minutes = String(Math.floor((i%(60*60))/(60))).padStart(2, '0');
const seconds = String(Math.floor((i%(60)))).padStart(2, '0');
return `${hours}:${minutes}:${seconds}`;
},
//二分法
binarySearchMax(arr, target) {
let left = 0;
let right = arr.length - 1;
let max = -Infinity;
console.log(arr);
while (left <= right) {
const mid = Math.floor((left + right) / 2);
if (arr[mid] <= target) {
max = Math.max(max, arr[mid]);
left = mid + 1;
} else {
right = mid - 1;
}
}
return max;
},
//横轴改变
onSliderChange(value) {
console.log(value);
this.URLStartTime = this.binarySearchMax(Object.keys(this.urls),value+this.minTimeLong);
this.currentVideoUrl = this.urls[this.URLStartTime]
this.currentTime = value;
const video = this.$refs.videoPlayer;
video.currentTime = value +this.startTimeLong-this.URLStartTime ;
},
//视频时间改变
onVideoTimeUpdate() {
const video = this.$refs.videoPlayer;
console.log("视频时间"+(this.URLStartTime + video.currentTime));
this.currentTime =this.URLStartTime + video.currentTime-this.startTimeLong;
},
//向后
moveForward(duration) {
console.log("111");
const newTime = this.currentTime + duration;
if (newTime >= 0 ||newTime <= this.totalDuration) {
this.currentTime = newTime;
const video = this.$refs.videoPlayer;
video.currentTime = newTime;
}
},
playVideo() {
const video = this.$refs.videoPlayer;
this.isPlaying = true;
console.log( this.currentTime +this.startTimeLong - this.URLStartTime);
video.currentTime = this.currentTime +this.startTimeLong - this.URLStartTime
video.play();
},
pauseVideo() {
const video = this.$refs.videoPlayer;
this.isPlaying = false;
video.pause();
},
playNextVideo() {
let nextKey =this.URLStartTime;
const keys = Object.keys(this.urls);
// 找到当前键的索引
const currentIndex = keys.indexOf(this.URLStartTime.toString());
console.log(keys);
if (currentIndex !== -1 && currentIndex < keys.length - 1) {
nextKey = Number(keys[currentIndex + 1]);
const video = this.$refs.videoPlayer;
this.URLStartTime = nextKey;
this.currentVideoUrl = this.urls[nextKey] ;
this.currentTime =this.URLStartTime;
video.currentTime =0;
video.play();
}
},
handleCheck(selectedKeys, e){
if(e.selectedNodes[0].data.props.type == 1){
this.cameraId = e.selectedNodes[0].data.key;
console.log(e.selectedNodes[0].data);
this.cameraRecord()
}
console.log(e.selectedNodes[0].data.props);
},
cameraRecord(){
this.$api.httpApi.cameraRecord({
data: {
date: this.date._d.getFullYear() + '-' + (this.date._d.getMonth() + 1) + '-' + this.date._d.getDate(),
cameraId: this.cameraId,
}
}).then(res => {
console.log("update data")
if( (res.data.startTimeLong !== null && res.data.startTimeLong !== undefined && res.data.startTimeLong !== "")
||( res.data.endTimeLong !== null && res.data.endTimeLong!== undefined &&res.data.endTimeLong !== '')){
}
if(res.data.urls !== null && res.data.urls !== undefined && Object.keys(res.data.urls).length >0){
this.startTimeLong = res.data.startTimeLong
this.endTimeLong = res.data.endTimeLong
this.minTimeLong = res.data.startTimeLong
this.maxTimeLong = res.data.endTimeLong
this.currentTime = 0
this.totalDuration = res.data.endTimeLong - res.data.startTimeLong
this.currentVideoUrl = res.data.urls[0].url
const video = this.$refs.videoPlayer;
video.currentTime = 0 ;
const map = {};
for(let i = 0;i<res.data.urls.length;i++){
map[res.data.urls[i].startTimeLong] = res.data.urls[i].url
}
this.urls = map
this.marks = this.getTimeMap();
}else{
if(this.cameraId !== null && this.cameraId !== undefined && this.cameraId !== ""){
message.info('此摄像头该日期未录像');
}
}
}).catch(err => {
console.log(err);
});
}
},
};
</script>
<style>
.progress-bar .ant-slider-rail {
background-color: lightgray;
}
.progress-bar .ant-slider-track {
background-color: dodgerblue;
}
.time-display {
margin-top: 10px;
display: flex;
justify-content: center;
align-items: center;
}
.zoom-buttons {
text-align: right;
margin-bottom: 16px;
}
</style>

@ -1,11 +1,64 @@
<template>
<div id="videos">
<a-tree-select
v-model="value"
show-search
style="width: 80%"
:dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
placeholder="Please select"
allow-clear
multiple
tree-default-expand-all
>
<a-tree-node key="0-1" value="parent 1" title="parent 1">
<a-tree-node key="0-1-1" :selectable="false" value="parent 1-0" title="parent 1-0">
<a-tree-node key="random" value="leaf1" title="my leaf" />
<a-tree-node key="random1" value="leaf2" title="your leaf" />
</a-tree-node>
<a-tree-node key="random2" value="parent 1-1" title="parent 1-1">
<a-tree-node key="random3" value="sss">
<b slot="title" style="color: #08c">sss</b>
</a-tree-node>
</a-tree-node>
</a-tree-node>
<a-tree-node key="random2" value="leaqf1" title="my 1leaf" />
<a-tree-node key="random13" value="leawf2" title="your2 leaf" />
<a-tree-node key="random4" value="leaef1" title="my l3eaf" />
<a-tree-node key="random15" value="learf2" title="your4 leaf" />
<a-tree-node key="random6" value="leatf1" title="my 6leaf" />
<a-tree-node key="random17" value="leayuf2" title="you5r leaf" />
<a-tree-node key="random8" value="leauf1" title="my 7leaf" />
<a-tree-node key="random19" value="loeaf2" title="yousr leaf" />
<a-tree-node key="random0" value="lieaf1" title="myf leaf" />
<a-tree-node key="randoma1" value="lexaf2" title="yodur leaf" />
<a-tree-node key="randoms" value="leacf1" title="my cleaf" />
<a-tree-node key="randoms1" value="leavf2" title="yobur leaf" />
<a-tree-node key="randomd" value="lnaf1" title="mvy leaf" />
<a-tree-node key="random1f" value="lebaf2" title="y our leaf" />
<a-tree-node key="randomg" value="leamf1" title="myx leaf" />
<a-tree-node key="random1h" value="leaff2" title="your leaf" />
<a-tree-node key="randomz" value="wleaf2" title="your leaf" />
<a-tree-node key="randomc" value="wleaf1" title="my cleaf" />
<a-tree-node key="random1v" value="eleaf2" title="your levaf" />
</a-tree-select>
<a-button type="primary" @click="full" v-if="!isFullscreen"> 全屏<a-icon type="right" /> </a-button>
<a-button type="primary" @click="full" v-if="isFullscreen"><a-icon type="left" /> 退出全屏 </a-button>
<!-- @change="tabsChange" v-model="tabKey"-->
<a-row v-for='rowIndex in row' :key='rowIndex'>
<a-col v-for='colIndex in column' :key='colIndex' :span="24/column" :style="{height: videoHeight}" >
<video class="camera" :id="rowIndex+'-'+colIndex" autoplay muted :style="{'height': '100%',width:'100%','object-fit':'fill'}" ></video>
<WebrtcPlayer
v-if=" webrtcPlayers[rowIndex-1] !==undefined && webrtcPlayers[rowIndex-1] != null && webrtcPlayers[rowIndex-1].length > 0 && webrtcPlayers[rowIndex-1][colIndex-1] !==undefined && webrtcPlayers[rowIndex-1][colIndex-1] != null "
autoplay class="video-window"
:videoSrc="'http://127.0.0.1/index/api/webrtc?app=live&stream='+webrtcPlayers[rowIndex-1][colIndex-1].id+'&type=play'"
:videoId="'videoId'+colIndex+'-'+rowIndex"
ref="videoWindow"
:key="colIndex+'-'+rowIndex"
muted
:style="{'height': '100%',width:'100%','object-fit':'fill'}">
</WebrtcPlayer>
<!-- <video class="camera" :id="rowIndex+'-'+colIndex" autoplay muted :style="{'height': '100%',width:'100%','object-fit':'fill'}" ></video> -->
</a-col>
</a-row>
@ -13,10 +66,17 @@
</template>
<script>
import WebRtcPlayer from "../../../public/static/webrtcplayer"
//import ATreeSelect from "../../../public/static/webrtcplayer"
import { TreeSelect } from 'ant-design-vue';
import { defineComponent, ref, watch } from 'vue';
import WebrtcPlayer from '../../../public/webrtc/webrtcPlayer.vue'
export default {
name: 'top',
components: {},
components: {
WebrtcPlayer,
ATreeSelect: TreeSelect
},
props: {
id: {
type: String,
@ -29,13 +89,18 @@ export default {
return {
row : 0,
column : 0,
value: undefined,
treeExpandedKeys: [],
a: 0,
clientHeight: 0,
videoH: 0,
isFullscreen: false,
originHeight: 0,
fullHeight: 0,
players: []
players: [],
areas:[],
webrtcPlayers: [],
activeKey: ''
}
},
//watch: {},
@ -51,6 +116,7 @@ export default {
this.getWallStyle();
this.$nextTick(() => {
this.getAllCameras()
});
let isFullscreen =
@ -103,6 +169,7 @@ export default {
}).then(res => {
if(res.code == 200) {
let cameras = res.data;
this.webrtcPlayers = Array.from({ length: this.row }, () => []);
for(let i = 1;i<=cameras.length;i++){
let rowIndex = Math.floor((i-1) / this.column) + 1;
if(rowIndex > this.row){
@ -112,12 +179,32 @@ export default {
if(columnIndex == 0){
columnIndex = this.column;
}
this.webrtcPlayers[rowIndex-1].push(cameras[i-1]);
let idName = rowIndex + "-" + columnIndex;
console.log("idName:"+idName);
let server = cameras[i-1].rtcServer+":"+ cameras[i-1].rtcServerPort
let video = document.getElementById(idName);
let player = new WebRtcPlayer(server,video,"camera"+cameras[i-1].id);
this.players.push(player);
//console.log(this.webrtcPlayers);
//let server = cameras[i-1].rtcServer+":"+ cameras[i-1].rtcServerPort
//let video = document.getElementById(idName);
//let player = new WebRtcPlayer(server,video,"camera"+cameras[i-1].id);
//this.players.push(player);
}
}
}).catch(err => {
console.log(err)
})
},
getAllAreas(){
this.$api.httpApi.getAllAreas({
data: {}
}).then(res => {
if(res.code == 200) {
this.areas = res.data;
if(this.areas.length == 0){
this.getAllCameras()
}else{
this.activeKey = this.areas[0]
this.tabChange();
}
}
}).catch(err => {
@ -129,8 +216,39 @@ export default {
console.log("stop")
player.destroy()
}
this.players = []
},
tabChange(){
this.destory();
this.$api.httpApi.allCamerasByArea({
params:{
area:this.activeKey
}
}).then(res => {
if(res.code == 200) {
let cameras = res.data;
for(let i = 1;i<=cameras.length;i++){
let rowIndex = Math.floor((i-1) / this.column) + 1;
if(rowIndex > this.row){
return
}
let columnIndex = i % this.column;
if(columnIndex == 0){
columnIndex = this.column;
}
let idName = rowIndex + "-" + columnIndex;
console.log("idName:"+idName);
let server = cameras[i-1].rtcServer+":"+ cameras[i-1].rtcServerPort
let video = document.getElementById(idName);
let player = new WebRtcPlayer(server,video,"camera"+cameras[i-1].id);
this.players.push(player);
}
}
}).catch(err => {
console.log(err)
})
},
full () {
if(this.isFullscreen){
this.exitfullscreen()

@ -46,7 +46,7 @@ module.exports = {
}
},
'/api': {
target: 'http://192.168.77.91:8099',
target: 'http://127.0.0.1:8099',
// target: 'http://115.236.65.98:13001/monitor',
// target: 'http://127.0.0.1:9007',
logLevel:'debug', //控制台终端打印代理前的真实地址

Loading…
Cancel
Save