This commit is contained in:
打豆豆
2024-03-26 19:48:34 +08:00
parent 73aeaa701b
commit 029d57ad8e
9 changed files with 416 additions and 374 deletions

View File

@@ -30,7 +30,7 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="7">
<!-- <el-col :span="7">
<el-form-item label="所在车间" prop="workshopName">
<el-select v-model="queryParams.workshopId" placeholder="请选择车间">
<el-option
@@ -41,7 +41,7 @@
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-col> -->
<el-col :span="3">
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
@@ -178,7 +178,7 @@ export default {
workstationCode: null,
workstationName: null,
workstationAddress: null,
workshopId: null,
workshopId: "214",
workshopCode: null,
workshopName: null,
processId: null,

View File

@@ -315,15 +315,8 @@
v-model="form.machineryTypeId"
:options="machineryTypeOptions"
:normalizer="normalizer"
disabled
v-if="optType == 'view'"
/>
<treeselect
v-model="form.machineryTypeId"
:options="machineryTypeOptions"
:normalizer="normalizer"
placeholder="请选择所属分类"
v-else
placeholder="请选择设备类型"
@select="handleNodeClick"
/>
</el-form-item>
</el-col>
@@ -382,7 +375,7 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="所属车间" prop="workshopName">
<!-- <el-form-item label="所属车间" prop="workshopName">
<el-select
v-model="form.workshopName"
placeholder="请选择车间"
@@ -397,7 +390,7 @@
:value="item"
></el-option>
</el-select>
</el-form-item>
</el-form-item> -->
</el-col>
</el-row>
<el-row>
@@ -587,7 +580,7 @@ export default {
idList: "",
workshopCode: "",
workshopName: "",
workshopId: "",
workshopId: "214",
},
defaultPropss: {
children: "children",
@@ -656,15 +649,15 @@ export default {
machineryName: [
{ required: true, message: "设备名称不能为空", trigger: "blur" },
],
workshopId: [
{ required: true, message: "车间不能为空", trigger: "blur" },
],
// workshopId: [
// { required: true, message: "车间不能为空", trigger: "blur" },
// ],
machineryTypeId: [
{ required: true, message: "设备分类不能为空", trigger: "blur" },
],
workshopName: [
{ required: true, message: "所属车间不能为空", trigger: "blur" },
],
// workshopName: [
// { required: true, message: "所属车间不能为空", trigger: "blur" },
// ],
},
};
},
@@ -727,6 +720,12 @@ export default {
this.queryParamsdata = data;
this.handleQuery();
},
// 节点单击事件
handleNodeClick(data) {
console.log(data);
this.form.machineryTypeName = data.machineryTypeName;
this.form.machineryTypeCode = data.code;
},
// 取消按钮
cancel() {
this.open = false;
@@ -743,7 +742,7 @@ export default {
machineryTypeId: null,
machineryTypeCode: null,
machineryTypeName: null,
workshopId: null,
workshopId: "214",
workshopCode: null,
workshopName: null,
status: "STOP",
@@ -809,7 +808,7 @@ export default {
// this.$emit("getSelectList", this.selectList);
},
//选择关联的设备
//选择车间
handleAccompanyId(val) {
this.form.workshopCode = val.workshopCode;
this.form.workshopName = val.workshopName;

View File

@@ -201,7 +201,7 @@
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="所属车间" prop="workshopId">
<!-- <el-form-item label="所属车间" prop="workshopId">
<el-select
v-model="form.workshopId"
placeholder="请选择车间"
@@ -215,7 +215,7 @@
:value="item.workshopId"
></el-option>
</el-select>
</el-form-item>
</el-form-item> -->
</el-col>
<el-col :span="12">
<el-form-item label="是否启用" prop="enableFlag">
@@ -346,7 +346,7 @@ export default {
proAgvlineId: null,
lineCode: null,
lineName: null,
workshopId: null,
workshopId: "214",
enableFlag: "Y",
remark: null,
};

View File

@@ -245,7 +245,7 @@
/>
</el-form-item>
</el-col>
<el-col :span="12">
<!-- <el-col :span="12">
<el-form-item label="所在车间" prop="workshopId">
<el-select
v-model="form.workshopId"
@@ -260,7 +260,7 @@
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-col> -->
</el-row>
<el-row>
<el-col :span="12">
@@ -564,7 +564,7 @@ export default {
workstationCode: null,
workstationName: null,
workstationAddress: null,
workshopId: null,
workshopId: "214",
workshopCode: null,
workshopName: null,
processId: null,
@@ -670,6 +670,7 @@ export default {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.workstationId != null) {
this.form.processId = this.form.processId.join(",");
updateWorkstation(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;

View File

@@ -1,177 +1,188 @@
<template>
<div class="videoMain" ref="playWndBox">
<div
id="playWnd"
class="playWnd"
:style="{
height: playWndHeight + 'px',
width: playWndWidth + 'px',
}"
></div>
<div>
<div>
<div id="playWnd" class="playWnd"></div>
<div v-show="lodingshow" style="margin: -17px 0">
<a-spin tip="Loading...">
<div class="spin-content">插件未启动正在尝试启动请稍候...</div>
</a-spin>
</div>
<div v-show="lodingres" class="example">
<p style="margin: 0; display: inline-block">
没有检测到插件请安装插件后重启浏览器
</p>
<a-button class="buttonDetails-class" @click="downloadFile()"
>下载</a-button
>
</div>
</div>
</div>
</template>
<script>
export default {
name: "HikVideo",
name: "monitor",
data() {
return {
// 视频盒子的高度
playWndHeight: "",
// 视频盒子的宽度
playWndWidth: "",
oWebControl: null,
initCount: 0,
pubKey: "",
cameraIndexCode: "", // 这里面是监控点编号
objData: {
appkey: "", //海康平台提供的appkey
ip: "", //平台地址
secret: "", //海康平台提供的secret
port: 443,
playMode: 0, // 0 预览 1回放
layout: "2x2", //页面展示的模块数【16】
},
// 控制窗口个数
camlength: "1x1",
// 插件没有启动的显示样式
lodingshow: false,
lodingres: false,
};
},
mounted() {
// 首次加载时的到父容器的高度
this.playWndHeight = this.$refs.playWndBox.clientHeight;
// 首次加载时的到父容器的宽度
this.playWndWidth = this.$refs.playWndBox.clientWidth;
// 初始化播放器插件
this.$nextTick(() => {
created() {
// 加载播放实例
this.initPlugin();
});
// 监听scroll事件使插件窗口尺寸跟随DIV窗口变化
window.addEventListener("scroll", () => {
if (this.oWebControl != null) {
this.oWebControl.JS_Resize(
this.$refs.playWndBox.clientWidth,
this.$refs.playWndBox.clientHeight
);
this.setWndCover();
}
});
// 监听resize事件使插件窗口尺寸跟随DIV窗口变化
window.addEventListener("resize", (e) => {
if (this.oWebControl != null) {
this.oWebControl.JS_Resize(
this.$refs.playWndBox.clientWidth,
this.$refs.playWndBox.clientHeight
);
this.setWndCover();
// vue 的onresize
$(window).resize(() => {
if (oWebControl != null) {
oWebControl.JS_Resize( $('.map').width(), $('.map').height() - 60);
}
});
},
// 页面结束的时候关闭显示窗口
destroyed() {
if (this.oWebControl != null) {
// 先让窗口隐藏,规避可能的插件窗口滞后于浏览器消失问题
this.oWebControl.JS_HideWnd();
// 销毁当前播放的视频
this.oWebControl.JS_RequestInterface({ funcName: "destroyWnd" });
// 断开与插件服务连接
this.oWebControl.JS_Disconnect();
if (oWebControl != null) {
oWebControl.JS_HideWnd(); // 先让窗口隐藏,规避可能的插件窗口滞后于浏览器消失问题
oWebControl.JS_Disconnect().then(() => { // 断开与插件服务连接成功
},
() => { // 断开与插件服务连接失败
});
}
},
methods: {
// 修改布局 展示画面
refusePlay() {
// 获取区域列表下的摄像机列表 进行布局展示
SubordinateCam({
pageNo: 1,
pageSize: 1000,
regionIndexCode: this.$route.params.id
}).then(res => {
if (res.data.code == 0) {
let shuliang = res.data.data.list.length;
if (shuliang == 1 || shuliang == 0) {
this.camlength = "1x1"
} else if (shuliang > 1 && shuliang <= 4) {
this.camlength = "2x2"
} else if (shuliang > 4 && shuliang <= 9) {
this.camlength = "3x3"
} else if (shuliang > 9 && shuliang <= 16) {
this.camlength = "4x4"
} else if (shuliang > 16 && shuliang <= 25) {
this.camlength = "5x5"
}
// 设置摄像头的布局
oWebControl.JS_RequestInterface({
funcName: "setLayout",
argument: {layout: this.camlength}
}).then(() => {
// 有监控点就进行播放
if (res.data.data.list.length > 0) {
this.$message.success('获取成功 监控点数量为' + res.data.data.list.length)
res.data.data.list.forEach((item, index) => {
oWebControl.JS_RequestInterface({
funcName: "startPreview",
argument: JSON.stringify({
cameraIndexCode: item.cameraIndexCode, //监控点编号
streamMode: 0, //主子码流标识
transMode: 1, //传输协议
gpuMode: 0, //是否开启GPU硬解
wndId: index + 1 //可指定播放窗口
})
})
})
} else {
this.$message.warning('当前区域无直属监控点区域')
// 停止全部的播放
let result = JSON.stringify({
"funcName": "stopAllPreview"
}, null, 2)
this.requestInterface(result);
}
})
} else {
this.$message.error('获取失败')
}
})
},
// $('.map').width(), $('.map').height() - 60)
// 创建播放实例
initPlugin() {
let that = this;
this.oWebControl = null;
that.oWebControl = new WebControl({
// eslint-disable-next-line no-undef
oWebControl = new WebControl({
szPluginContainer: "playWnd", // 指定容器id
iServicePortStart: 15900, // 指定起止端口号,建议使用该值
iServicePortEnd: 15909,
szClassId: "23BF3B0A-2C56-4D97-9C03-0CB103AA8F11", // 用于IE10使用ActiveX的clsid
cbConnectSuccess: () => {
// 创建WebControl实例成功
that.oWebControl
.JS_StartService("window", {
// WebControl实例创建成功后需要启动服务
// 值"./VideoPluginConnect.dll"写死
dllPath: "./VideoPluginConnect.dll",
})
.then(
function () {
// 设置消息回调
that.oWebControl.JS_SetWindowControlCallback({
cbIntegrationCallBack: that.cbIntegrationCallBack,
cbConnectSuccess: () => { // 创建WebControl实例成功
oWebControl.JS_StartService("window", { // WebControl实例创建成功后需要启动服务
dllPath: "./VideoPluginConnect.dll" // 值"./VideoPluginConnect.dll"写死
}).then(() => { // 启动插件服务成功
oWebControl.JS_SetWindowControlCallback({ // 设置消息回调
cbIntegrationCallBack: this.cbIntegrationCallBack
});
//JS_CreateWnd创建视频播放窗口宽高可设定
that.oWebControl
.JS_CreateWnd("playWnd", 2040, 945, { bEmbed: true })
//注2040,945这是我本人项目视频盒子的大小你们要根据自己视频盒子的大小进行修改不然初始化插件的时候会有空白闪烁。
.then(function () {
// 创建播放实例成功后初始化
that.init();
oWebControl.JS_CreateWnd("playWnd", $('.map').width(), $('.map').height() - 60).then(() => { //JS_CreateWnd创建视频播放窗口宽高可设定
this.init(); // 创建播放实例成功后初始化
});
}, () => { // 启动插件服务失败
});
},
function () {
// 启动插件服务失败
}
);
},
// 创建WebControl实例失败
cbConnectError: function () {
that.oWebControl = null;
// alert('插件未启动,正在尝试启动,请稍候...')
// that.$message.warning("插件未启动,正在尝试启动,请稍候...");
// 程序未启动时执行error函数采用wakeup来启动程序
window.WebControl.JS_WakeUp("VideoWebPlugin://");
that.initCount++;
if (that.initCount < 3) {
setTimeout(function () {
that.initPlugin();
}, 3000);
cbConnectError: () => { // 创建WebControl实例失败
oWebControl = null;
// $("#playWnd").html("插件未启动,正在尝试启动,请稍候...");
this.lodingshow = true;
// eslint-disable-next-line no-undef
WebControl.JS_WakeUp("VideoWebPlugin://"); // 程序未启动时执行error函数采用wakeup来启动程序
initCount++;
if (initCount < 3) {
setTimeout(() => {
this.initPlugin();
}, 3000)
} else {
// that.messageBox = true
// alert('插件启动失败,请安装插件并重新启动!')
// that.downloadHikVideo()
// setTimeout(function () {
// that.messageBox = false
// }, 5000)
// setTimeout(function () {
// alert('插件启动失败,请检查插件是否安装!')
// that.$message({
// message: '插件启动失败,请检查插件是否安装! \n 插件下载地址https://www.baidu.com',
// type: 'warning'
// });
// }, 5000)
this.lodingshow = false;
this.lodingres = true;
// $("#playWnd").html("插件启动失败,请检查插件是否安装!");
}
},
cbConnectClose: () => {
// 异常断开bNormalClose = false
// JS_Disconnect正常断开bNormalClose = true
// console.log("cbConnectClose");
that.oWebControl = null;
},
oWebControl = null;
}
});
},
//初始化
init(callback) {
let that = this;
that.getPubKey(() => {
let appkey = that.objData.appkey; //综合安防管理平台提供的appkey必填
let secret = that.setEncrypt(that.objData.secret); //综合安防管理平台提供的secret,必填
let ip = that.objData.ip; //综合安防管理平台IP地址必填
let playMode = that.objData.playMode; //初始播放模式0-预览1-回放
let port = that.objData.port; //综合安防管理平台端口若启用HTTPS协议默认443
init() {
// 获取公钥的方法
this.getPubKey(() => {
////////////////////////////////// 请自行修改以下变量值 ////////////////////////////////////
let appkey = admin; //综合安防管理平台提供的appkey,必填
// 进行相应的加密
let secret = "mygymygy."; //综合安防管理平台提供的secret必填
let ip = "192.168.2.107"; //综合安防管理平台IP地址必填
let port = "443"; //综合安防管理平台端口若启用HTTPS协议默认443
let playMode = 0; //初始播放模式0-预览1-回放
let snapDir = "D:\\SnapDir"; //抓图存储路径
let videoDir = "D:\\VideoDir"; //紧急录像或录像剪辑存储路径
let layout = that.objData.layout; //playMode指定模式的布局
let layout = "1x1"; //playMode指定模式的布局
let enableHTTPS = 1; //是否启用HTTPS协议与综合安防管理平台交互这里总是填1
let encryptedFields = "secret"; //加密字段默认加密领域为secret
let encryptedFields = 'secret'; //加密字段默认加密领域为secret
let showToolbar = 1; //是否显示工具栏0-不显示非0-显示
let showSmart = 1; //是否显示智能信息如配置移动侦测后画面上的线框0-不显示非0-显示
let buttonIDs =
"0,16,256,257,258,259,260,512,513,514,515,516,517,768,769"; //自定义工具条按钮
// var toolBarButtonIDs = "2049,2304" // 工具栏上自定义按钮
that.oWebControl
.JS_RequestInterface({
let buttonIDs = "0,16,256,257,258,259,260,512,513,514,515,516,768,769"; //自定义工具条按钮
let toolBarButtonIDs = "2048,2304,2305,2306,2307,2308,2309,4096,4097,4098,4099,4608,4609"
////////////////////////////////// 请自行修改以上变量值 ////////////////////////////////////
oWebControl.JS_RequestInterface({
funcName: "init",
argument: JSON.stringify({
appkey: appkey, //API网关提供的appkey
@@ -186,77 +197,123 @@ export default {
encryptedFields: encryptedFields, //加密字段
showToolbar: showToolbar, //是否显示工具栏
showSmart: showSmart, //是否显示智能信息
buttonIDs, //自定义工具条按钮
}),
buttonIDs: buttonIDs, //自定义工具条按钮
toolBarButtonIDs:toolBarButtonIDs //自定义最外层的工具条
})
.then(function (oData) {
that.oWebControl.JS_Resize(that.playWndWidth, that.playWndHeight); // 初始化后resize一次规避firefox下首次显示窗口后插件窗口未与DIV窗口重合问题
if (callback) {
callback();
}
// 隐藏
// that.oWebControl.JS_HideWnd()
}).then(() => {
oWebControl.JS_Resize( $('.map').width(), $('.map').height() - 60); // 初始化后resize一次规避firefox下首次显示窗口后插件窗口未与DIV窗口重合问题
// 加载完成后进行布局的修改 和 摄像头的展示
this.refusePlay();
});
});
},
//获取公钥
getPubKey(callback) {
let that = this;
this.oWebControl
.JS_RequestInterface({
oWebControl.JS_RequestInterface({
funcName: "getRSAPubKey",
argument: JSON.stringify({
keyLength: 1024,
}),
keyLength: 1024
})
.then(function (oData) {
}).then((oData) => {
console.log(oData);
if (oData.responseMsg.data) {
that.pubKey = oData.responseMsg.data;
callback();
pubKey = oData.responseMsg.data;
callback()
}
});
})
},
//RSA加密
setEncrypt(value) {
let that = this;
let encrypt = new window.JSEncrypt();
encrypt.setPublicKey(that.pubKey);
// eslint-disable-next-line no-undef
let encrypt = new JSEncrypt();
encrypt.setPublicKey(pubKey);
return encrypt.encrypt(value);
},
// 回调的消息
// 推送消息
cbIntegrationCallBack(oData) {
let { responseMsg: type } = oData;
if (type === "error") {
} else {
// if (oData.responseMsg.msg.cameraIndexCode != '') {
// this.$router.push({name: 'playbackDetails', params: {id: oData.responseMsg.msg.cameraIndexCode}})
// }
this.showCBInfo(JSON.stringify(oData.responseMsg));
},
// 设置窗口裁剪当因滚动条滚动导致窗口需要被遮住的情况下需要JS_CuttingPartWindow部分窗口
setWndCover() {
let iWidth = $('.map').width();
let iHeight = $('.map').height() - 60;
let oDivRect = $("#playWnd").get(0).getBoundingClientRect();
let iCoverLeft = (oDivRect.left < 0) ? Math.abs(oDivRect.left) : 0;
let iCoverTop = (oDivRect.top < 0) ? Math.abs(oDivRect.top) : 0;
let iCoverRight = (oDivRect.right - iWidth > 0) ? Math.round(oDivRect.right - iWidth) : 0;
let iCoverBottom = (oDivRect.bottom - iHeight > 0) ? Math.round(oDivRect.bottom - iHeight) : 0;
iCoverLeft = (iCoverLeft > 1200) ? 1200 : iCoverLeft;
iCoverTop = (iCoverTop > 600) ? 600 : iCoverTop;
iCoverRight = (iCoverRight > 1200) ? 1200 : iCoverRight;
iCoverBottom = (iCoverBottom > 600) ? 600 : iCoverBottom;
oWebControl.JS_RepairPartWindow(0, 0, $('.map').width(), $('.map').height() - 60); // 多1个像素点防止还原后边界缺失一个像素条
if (iCoverLeft != 0) {
oWebControl.JS_CuttingPartWindow(0, 0, iCoverLeft, 600);
}
if (iCoverTop != 0) {
oWebControl.JS_CuttingPartWindow(0, 0, $('.map').width(), iCoverTop); // 多剪掉一个像素条,防止出现剪掉一部分窗口后出现一个像素条
}
if (iCoverRight != 0) {
oWebControl.JS_CuttingPartWindow($('.map').width() - iCoverRight, 0, iCoverRight, 600);
}
if (iCoverBottom != 0) {
oWebControl.JS_CuttingPartWindow(0, 600 - iCoverBottom, $('.map').width(), iCoverBottom);
}
},
// 视频预览功能
previewVideo(data) {
let that = this;
let cameraIndexCode = data; // 获取输入的监控点编号值,必填
let streamMode = 0; // 主子码流标识0-主码流1-子码流
let transMode = 0; // 传输协议0-UDP1-TCP
let gpuMode = 0; // 是否启用GPU硬解0-不启用1-启用
let wndId = -1; // 播放窗口序号在2x2以上布局下可指定播放窗口
// console.log(cameraIndexCode, "-------cameraIndexCode-");
that.oWebControl.JS_RequestInterface({
funcName: "startPreview",
argument: JSON.stringify({
cameraIndexCode: cameraIndexCode.trim(), // 监控点编号
streamMode: streamMode, // 主子码流标识
transMode: transMode, // 传输协议
gpuMode: gpuMode, // 是否开启GPU硬解
wndId: wndId, // 可指定播放窗口
}),
// 执行字符串方法
// value为字符串JS_RequestInterface仅接收json格式的变量且需要先解析出argument并且将argument字段的内容转为字符串
requestInterface(value) {
this.isJSON(value);
let JsonParam = JSON.parse(value);
let JsonArgument = JsonParam.argument;
JsonParam.argument = JSON.stringify(JsonArgument);
oWebControl.JS_RequestInterface(JsonParam).then((oData) => {
this.showCBInfo(JSON.stringify(oData ? oData.responseMsg : ''));
});
},
// 停止全部预览
stopAllPreview() {
this.oWebControl.JS_RequestInterface({
funcName: "stopAllPreview",
});
// 显示接口返回的消息及插件回调信息
showCBInfo(szInfo, type) {
if (type === 'error') {
szInfo = "<div style='color: red;'>" + this.dateFormat(new Date(), "yyyy-MM-dd hh:mm:ss") + " " + szInfo + "</div>";
} else {
szInfo = "<div>" + this.dateFormat(new Date(), "yyyy-MM-dd hh:mm:ss") + " " + szInfo + "</div>";
}
$("#cbInfo").html(szInfo + $("#cbInfo").html());
},
// 判断字符串是否为json
isJSON(str) {
if (typeof str == 'string') {
try {
let obj = JSON.parse(str);
if (typeof obj == 'object' && obj) {
return true;
} else {
this.showCBInfo("param is not the correct JSON message");
return false;
}
} catch (e) {
this.showCBInfo("param is not the correct JSON message");
return false;
}
}
},
// 格式化时间
dateFormat(oDate, fmt) {
let o = {
@@ -266,78 +323,29 @@ export default {
"m+": oDate.getMinutes(), //分
"s+": oDate.getSeconds(), //秒
"q+": Math.floor((oDate.getMonth() + 3) / 3), //季度
S: oDate.getMilliseconds(), //毫秒
"S": oDate.getMilliseconds()//毫秒
};
if (/(y+)/.test(fmt)) {
fmt = fmt.replace(
RegExp.$1,
(oDate.getFullYear() + "").substr(4 - RegExp.$1.length)
);
fmt = fmt.replace(RegExp.$1, (oDate.getFullYear() + "").substr(4 - RegExp.$1.length));
}
for (let k in o) {
if (new RegExp("(" + k + ")").test(fmt)) {
fmt = fmt.replace(
RegExp.$1,
RegExp.$1.length == 1
? o[k]
: ("00" + o[k]).substr(("" + o[k]).length)
);
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
}
}
return fmt;
},
// 设置窗口裁剪当因滚动条滚动导致窗口需要被遮住的情况下需要JS_CuttingPartWindow部分窗口
setWndCover() {
var iWidth = $(window).width();
var iHeight = $(window).height();
var oDivRect = $("#playWnd").get(0).getBoundingClientRect();
var iCoverLeft = oDivRect.left < 0 ? Math.abs(oDivRect.left) : 0;
var iCoverTop = oDivRect.top < 0 ? Math.abs(oDivRect.top) : 0;
var iCoverRight =
oDivRect.right - iWidth > 0 ? Math.round(oDivRect.right - iWidth) : 0;
var iCoverBottom =
oDivRect.bottom - iHeight > 0
? Math.round(oDivRect.bottom - iHeight)
: 0;
iCoverLeft = iCoverLeft > 2041 ? 2041 : iCoverLeft;
iCoverTop = iCoverTop > 945 ? 945 : iCoverTop;
iCoverRight = iCoverRight > 2041 ? 2041 : iCoverRight;
iCoverBottom = iCoverBottom > 945 ? 945 : iCoverBottom;
this.oWebControl.JS_RepairPartWindow(0, 0, 2041, 946); // 多1个像素点防止还原后边界缺失一个像素条
if (iCoverLeft != 0) {
this.oWebControl.JS_CuttingPartWindow(0, 0, iCoverLeft, 946);
}
if (iCoverTop != 0) {
this.oWebControl.JS_CuttingPartWindow(0, 0, 2041, iCoverTop); // 多剪掉一个像素条,防止出现剪掉一部分窗口后出现一个像素条
}
if (iCoverRight != 0) {
this.oWebControl.JS_CuttingPartWindow(
2041 - iCoverRight,
0,
iCoverRight,
946
);
}
if (iCoverBottom != 0) {
this.oWebControl.JS_CuttingPartWindow(
0,
946 - iCoverBottom,
2041,
iCoverBottom
);
}
},
// 下载文件到本地
downloadFile() {
var a = document.createElement('a')
// var blob = new Blob([content])
// var url = window.URL.createObjectURL(blob)
a.href = '控件下载地址'
a.download = '视频插件'
a.click()
// window.URL.revokeObjectURL(url)
},
}
};
</script>
<style lang="scss" scoped>
.videoMain {
width: 100%;
height: 100%;
}
</style>

View File

@@ -146,11 +146,7 @@
<defective :message="this.defectiveData" />
</div>
<div style="width: 30%; margin-top: 50px">
<hkVideo
:cameraIndexCode="cameraIndexCode"
:objData="objData"
ref="hikVideo"
></hkVideo>
<hkVideo :monitoringNumber="cameraIndexCode"></hkVideo>
</div>
</div>
<div style="height: 50%; display: flex">
@@ -251,6 +247,7 @@
</template>
<script>
import axios from "axios";
import { listWorkorder } from "@/api/mes/pro/workorder";
// import * as statisServer from "@/api/statistics";
@@ -265,7 +262,7 @@ export default {
components: { defective, complete, ticket, hkVideo },
data() {
return {
cameraIndexCode: "", //wed插件监控点
cameraIndexCode: "1a033f81-a404-4a66-aabf-cb0ead6cc2be", //wed插件监控点
//海康wed插件初始化数据
objData: {
appkey: "", //综合安防管理平台提供的appkey必填
@@ -366,6 +363,28 @@ export default {
},
getList() {
var params = {
pageNo: 1,
pageSize: 9999,
};
axios({
url: "https://190.168.2.104:8077/artemis/api/resource/v1/cameras",
method: "post",
data: params, //将请求参数写入data;
headers: {
//单个请求设置请求头
"Content-Type": "application/json",
},
})
.then((res) => {
console.log(res);
})
.catch((error) => {
if (error) {
throw error;
}
});
// listWorkorder(this.queryParams).then((response) => {
// this.workorderList = response.data;
// });

View File

@@ -666,7 +666,8 @@ export default {
handleproductione(row) {
const routeId = row.workorderId || this.ids;
axios
.get("http://192.168.3.53:8077/manage/task/execute?ids=" + routeId)
.get("http://192.168.2.104:8077/manage/task/execute?ids=" + routeId)
// .get("http://192.168.3.53:8077/manage/task/execute?ids=" + routeId)
// .get("http://127.0.0.1:8077/manage/task/execute?ids=" + routeId)
.then((res) => {
if (res.data.code === 200) {
@@ -682,7 +683,8 @@ export default {
Pendingproduction(row) {
const routeId = row.workorderId || this.ids;
axios
.get("http://192.168.3.53:8077/manage/task/suspension?id=" + routeId)
.get("http://192.168.2.104:8077/manage/task/suspension?id=" + routeId)
// .get("http://192.168.3.53:8077/manage/task/suspension?id=" + routeId)
// .get("http://127.0.0.1:8077/manage/task/suspension?id=" + routeId)
.then((res) => {
if (res.data.code === 200) {

View File

@@ -434,6 +434,7 @@
</template>
<script>
import axios from "axios";
import {
listItemrecpt,
getItemrecpt,
@@ -441,7 +442,6 @@ import {
addItemrecpt,
updateItemrecpt,
confirmItemrecpt,
storage,
} from "@/api/mes/wm/itemrecpt";
import { listItemrecptline } from "@/api/mes/wm/itemrecptline";
import { listMdItem } from "@/api/mes/md/pallet";
@@ -693,8 +693,12 @@ export default {
listItemrecptline({ recptId: row.recptId }).then((response) => {
this.itemrecptlineList = response.rows;
});
var queryParams = {
pageNum: 1,
pageSize: 10000,
};
// 托盘查询
listMdItem(this.queryParams).then((response) => {
listMdItem(queryParams).then((response) => {
this.itemList = response.rows;
});
},
@@ -707,7 +711,6 @@ export default {
}
this.perform.itemCode = data.itemCode;
this.perform.lineId = data.lineId;
this.perform.itemId = data.itemId;
},
selectTray(data) {
this.perform.palletId = data.proPalletId;
@@ -715,11 +718,19 @@ export default {
},
submitFileForm() {
if (this.remainingquantity != 0) {
storage(this.perform).then((response) => {
axios
.get("http://192.168.2.104:8077/manage/matter/storageItem", {
params: this.perform,
})
.then((res) => {
if (res.data.code === 200) {
this.$modal.msgSuccess("入库成功");
this.warehousing = false;
this.getList();
this.selectEncoding();
} else {
this.$message.error(res.data.msg);
}
});
} else {
this.$message({

View File

@@ -35,14 +35,16 @@ module.exports = {
proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
"/prod-api": {
target: `http://192.168.3.53:8063`,
target: `http://192.168.2.104:8063`,
// target: `http://192.168.3.53:8063`,
changeOrigin: true,
// pathRewrite: {
// ['^' + process.env.VUE_APP_BASE_API]: ''
// }
},
"/ureport": {
target: `http://192.168.3.53:8063`,
target: `http://192.168.2.104:8063`,
// target: `http://192.168.3.53:8063`,
ws: false,
changeOrigin: true,
pathRewrite: {