commit
d09d4760d7
@ -60,3 +60,12 @@ export function listItems(query) {
|
|||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 删除
|
||||||
|
export function deleteShopFace(data) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/pro/workorder/deleteShopFace',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
Binary file not shown.
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 12 KiB |
Binary file not shown.
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 22 KiB |
@ -30,7 +30,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="7">
|
<!-- <el-col :span="7">
|
||||||
<el-form-item label="所在车间" prop="workshopName">
|
<el-form-item label="所在车间" prop="workshopName">
|
||||||
<el-select v-model="queryParams.workshopId" placeholder="请选择车间">
|
<el-select v-model="queryParams.workshopId" placeholder="请选择车间">
|
||||||
<el-option
|
<el-option
|
||||||
@ -41,7 +41,7 @@
|
|||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col> -->
|
||||||
<el-col :span="3">
|
<el-col :span="3">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
@ -178,7 +178,7 @@ export default {
|
|||||||
workstationCode: null,
|
workstationCode: null,
|
||||||
workstationName: null,
|
workstationName: null,
|
||||||
workstationAddress: null,
|
workstationAddress: null,
|
||||||
workshopId: null,
|
workshopId: "214",
|
||||||
workshopCode: null,
|
workshopCode: null,
|
||||||
workshopName: null,
|
workshopName: null,
|
||||||
processId: null,
|
processId: null,
|
||||||
|
@ -315,15 +315,8 @@
|
|||||||
v-model="form.machineryTypeId"
|
v-model="form.machineryTypeId"
|
||||||
:options="machineryTypeOptions"
|
:options="machineryTypeOptions"
|
||||||
:normalizer="normalizer"
|
:normalizer="normalizer"
|
||||||
disabled
|
placeholder="请选择设备类型"
|
||||||
v-if="optType == 'view'"
|
@select="handleNode"
|
||||||
/>
|
|
||||||
<treeselect
|
|
||||||
v-model="form.machineryTypeId"
|
|
||||||
:options="machineryTypeOptions"
|
|
||||||
:normalizer="normalizer"
|
|
||||||
placeholder="请选择所属分类"
|
|
||||||
v-else
|
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -382,7 +375,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="所属车间" prop="workshopName">
|
<!-- <el-form-item label="所属车间" prop="workshopName">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="form.workshopName"
|
v-model="form.workshopName"
|
||||||
placeholder="请选择车间"
|
placeholder="请选择车间"
|
||||||
@ -397,7 +390,7 @@
|
|||||||
:value="item"
|
:value="item"
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item> -->
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
@ -587,7 +580,7 @@ export default {
|
|||||||
idList: "",
|
idList: "",
|
||||||
workshopCode: "",
|
workshopCode: "",
|
||||||
workshopName: "",
|
workshopName: "",
|
||||||
workshopId: "",
|
workshopId: "214",
|
||||||
},
|
},
|
||||||
defaultPropss: {
|
defaultPropss: {
|
||||||
children: "children",
|
children: "children",
|
||||||
@ -656,15 +649,15 @@ export default {
|
|||||||
machineryName: [
|
machineryName: [
|
||||||
{ required: true, message: "设备名称不能为空", trigger: "blur" },
|
{ required: true, message: "设备名称不能为空", trigger: "blur" },
|
||||||
],
|
],
|
||||||
workshopId: [
|
// workshopId: [
|
||||||
{ required: true, message: "车间不能为空", trigger: "blur" },
|
// { required: true, message: "车间不能为空", trigger: "blur" },
|
||||||
],
|
// ],
|
||||||
machineryTypeId: [
|
machineryTypeId: [
|
||||||
{ required: true, message: "设备分类不能为空", trigger: "blur" },
|
{ required: true, message: "设备分类不能为空", trigger: "blur" },
|
||||||
],
|
],
|
||||||
workshopName: [
|
// workshopName: [
|
||||||
{ required: true, message: "所属车间不能为空", trigger: "blur" },
|
// { required: true, message: "所属车间不能为空", trigger: "blur" },
|
||||||
],
|
// ],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@ -727,6 +720,12 @@ export default {
|
|||||||
this.queryParamsdata = data;
|
this.queryParamsdata = data;
|
||||||
this.handleQuery();
|
this.handleQuery();
|
||||||
},
|
},
|
||||||
|
// 节点单击事件
|
||||||
|
handleNode(data) {
|
||||||
|
console.log(data);
|
||||||
|
this.form.machineryTypeName = data.machineryTypeName;
|
||||||
|
this.form.machineryTypeCode = data.code;
|
||||||
|
},
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
cancel() {
|
cancel() {
|
||||||
this.open = false;
|
this.open = false;
|
||||||
@ -743,7 +742,7 @@ export default {
|
|||||||
machineryTypeId: null,
|
machineryTypeId: null,
|
||||||
machineryTypeCode: null,
|
machineryTypeCode: null,
|
||||||
machineryTypeName: null,
|
machineryTypeName: null,
|
||||||
workshopId: null,
|
workshopId: "214",
|
||||||
workshopCode: null,
|
workshopCode: null,
|
||||||
workshopName: null,
|
workshopName: null,
|
||||||
status: "STOP",
|
status: "STOP",
|
||||||
@ -809,7 +808,7 @@ export default {
|
|||||||
// this.$emit("getSelectList", this.selectList);
|
// this.$emit("getSelectList", this.selectList);
|
||||||
},
|
},
|
||||||
|
|
||||||
//选择关联的设备
|
//选择车间
|
||||||
handleAccompanyId(val) {
|
handleAccompanyId(val) {
|
||||||
this.form.workshopCode = val.workshopCode;
|
this.form.workshopCode = val.workshopCode;
|
||||||
this.form.workshopName = val.workshopName;
|
this.form.workshopName = val.workshopName;
|
||||||
|
@ -201,7 +201,7 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="所属车间" prop="workshopId">
|
<!-- <el-form-item label="所属车间" prop="workshopId">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="form.workshopId"
|
v-model="form.workshopId"
|
||||||
placeholder="请选择车间"
|
placeholder="请选择车间"
|
||||||
@ -215,7 +215,7 @@
|
|||||||
:value="item.workshopId"
|
:value="item.workshopId"
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item> -->
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="是否启用" prop="enableFlag">
|
<el-form-item label="是否启用" prop="enableFlag">
|
||||||
@ -346,7 +346,7 @@ export default {
|
|||||||
proAgvlineId: null,
|
proAgvlineId: null,
|
||||||
lineCode: null,
|
lineCode: null,
|
||||||
lineName: null,
|
lineName: null,
|
||||||
workshopId: null,
|
workshopId: "214",
|
||||||
enableFlag: "Y",
|
enableFlag: "Y",
|
||||||
remark: null,
|
remark: null,
|
||||||
};
|
};
|
||||||
|
@ -245,7 +245,7 @@
|
|||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<!-- <el-col :span="12">
|
||||||
<el-form-item label="所在车间" prop="workshopId">
|
<el-form-item label="所在车间" prop="workshopId">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="form.workshopId"
|
v-model="form.workshopId"
|
||||||
@ -260,7 +260,7 @@
|
|||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col> -->
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@ -564,7 +564,7 @@ export default {
|
|||||||
workstationCode: null,
|
workstationCode: null,
|
||||||
workstationName: null,
|
workstationName: null,
|
||||||
workstationAddress: null,
|
workstationAddress: null,
|
||||||
workshopId: null,
|
workshopId: "214",
|
||||||
workshopCode: null,
|
workshopCode: null,
|
||||||
workshopName: null,
|
workshopName: null,
|
||||||
processId: null,
|
processId: null,
|
||||||
@ -670,6 +670,7 @@ export default {
|
|||||||
this.$refs["form"].validate((valid) => {
|
this.$refs["form"].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.workstationId != null) {
|
if (this.form.workstationId != null) {
|
||||||
|
this.form.processId = this.form.processId.join(",");
|
||||||
updateWorkstation(this.form).then((response) => {
|
updateWorkstation(this.form).then((response) => {
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess("修改成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
|
91
src/views/mes/pro/production/components/lib/initPlugin.js
Normal file
91
src/views/mes/pro/production/components/lib/initPlugin.js
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
|
||||||
|
import { getPubKey, setEncrypt } from './pubKey'
|
||||||
|
var initCount = 0;
|
||||||
|
var oWebControl;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {*} id :组件容器id
|
||||||
|
* @param {*} iWidth :组件容器宽
|
||||||
|
* @param {*} iHeight :组件容器高
|
||||||
|
* @param {*}cbIntegrationCallBack:消息推送回调函数
|
||||||
|
* @param {*} argument:初始化api参数
|
||||||
|
* @param {*} completeCallBack:初始化成功回调函数
|
||||||
|
* @param {*} plugErrorCallBack:插件启动失败回调函数
|
||||||
|
*/
|
||||||
|
const initPlugin = (id, iWidth, iHeight, argument, cbIntegrationCallBack = () => { }, completeCallBack = () => { }, plugErrorCallBack = () => { }) => {
|
||||||
|
// eslint-disable-next-line no-undef
|
||||||
|
oWebControl = new WebControl({
|
||||||
|
szPluginContainer: id, // 指定容器id
|
||||||
|
iServicePortStart: 15900, // 指定起止端口号,建议使用该值
|
||||||
|
iServicePortEnd: 15909,
|
||||||
|
szClassId: "23BF3B0A-2C56-4D97-9C03-0CB103AA8F11", // 用于IE10使用ActiveX的clsid
|
||||||
|
cbConnectSuccess: function () { // 创建WebControl实例成功
|
||||||
|
oWebControl.JS_StartService("window", { // WebControl实例创建成功后需要启动服务
|
||||||
|
dllPath: "./VideoPluginConnect.dll" // 值"./VideoPluginConnect.dll"写死
|
||||||
|
}).then(function () { // 启动插件服务成功
|
||||||
|
oWebControl.JS_SetWindowControlCallback({ // 设置消息回调
|
||||||
|
cbIntegrationCallBack: cbIntegrationCallBack
|
||||||
|
});
|
||||||
|
|
||||||
|
oWebControl.JS_CreateWnd(id, iWidth, iHeight).then(function () { //JS_CreateWnd创建视频播放窗口,宽高可设定
|
||||||
|
init(argument, iWidth, iHeight,completeCallBack()); // 创建播放实例成功后初始化
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}, function () { // 启动插件服务失败
|
||||||
|
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
cbConnectError: function (e) { // 创建WebControl实例失败
|
||||||
|
oWebControl = null;
|
||||||
|
// eslint-disable-next-line no-undef
|
||||||
|
// $(id).html("插件未启动,正在尝试启动,请稍候...");
|
||||||
|
// eslint-disable-next-line no-undef
|
||||||
|
WebControl.JS_WakeUp("VideoWebPlugin://"); // 程序未启动时执行error函数,采用wakeup来启动程序
|
||||||
|
|
||||||
|
initCount++;
|
||||||
|
if (initCount < 2) {
|
||||||
|
setTimeout(function () {
|
||||||
|
initPlugin(id, iWidth, iHeight, argument, cbIntegrationCallBack,completeCallBack,plugErrorCallBack);
|
||||||
|
}, 1000)
|
||||||
|
} else {
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-undef
|
||||||
|
// $(id).html("插件启动失败,请检查插件是否安装!");
|
||||||
|
plugErrorCallBack()
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
cbConnectClose: function (bNormalClose) {
|
||||||
|
// 异常断开:bNormalClose = false
|
||||||
|
// JS_Disconnect正常断开:bNormalClose = true
|
||||||
|
console.log("cbConnectClose");
|
||||||
|
oWebControl = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return oWebControl
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//初始化
|
||||||
|
function init(argument, iWidth, iHeight,callback=()=>{}) {
|
||||||
|
getPubKey(oWebControl, function () {
|
||||||
|
|
||||||
|
oWebControl.JS_RequestInterface({
|
||||||
|
funcName: "init",
|
||||||
|
argument: JSON.stringify({
|
||||||
|
...argument,
|
||||||
|
secret: setEncrypt(argument.secret)
|
||||||
|
})
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
}).then(function (oData) {
|
||||||
|
callback()
|
||||||
|
//oWebControl.JS_Resize(iWidth, iHeight); // 初始化后resize一次,规避firefox下首次显示窗口后插件窗口未与DIV窗口重合问题
|
||||||
|
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export default initPlugin
|
24
src/views/mes/pro/production/components/lib/pubKey.js
Normal file
24
src/views/mes/pro/production/components/lib/pubKey.js
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
var pubKey;
|
||||||
|
//获取公钥
|
||||||
|
export function getPubKey(oWebControl,callback) {
|
||||||
|
// eslint-disable-next-line no-undef
|
||||||
|
oWebControl.JS_RequestInterface({
|
||||||
|
funcName: "getRSAPubKey",
|
||||||
|
argument: JSON.stringify({
|
||||||
|
keyLength: 1024
|
||||||
|
})
|
||||||
|
}).then(function (oData) {
|
||||||
|
if (oData.responseMsg.data) {
|
||||||
|
pubKey = oData.responseMsg.data;
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//RSA加密
|
||||||
|
export function setEncrypt(value) {
|
||||||
|
// eslint-disable-next-line no-undef
|
||||||
|
var encrypt = new JSEncrypt();
|
||||||
|
encrypt.setPublicKey(pubKey);
|
||||||
|
return encrypt.encrypt(value);
|
||||||
|
}
|
@ -1,296 +1,251 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="videoMain" ref="playWndBox">
|
<div class="hk-video-container" id="playWnd">
|
||||||
<div
|
<!-- 下载插件提示框 -->
|
||||||
id="playWnd"
|
<el-dialog
|
||||||
class="playWnd"
|
v-if="downloadDialog"
|
||||||
:style="{
|
title="提示"
|
||||||
height: playWndHeight + 'px',
|
:visible.sync="dialogVisible"
|
||||||
width: playWndWidth + 'px',
|
width="30%"
|
||||||
}"
|
>
|
||||||
></div>
|
<span
|
||||||
|
>{{downloadText}}</span
|
||||||
|
>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="handleDownloadExe">下载</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import initPlugin from "./lib/initPlugin";
|
||||||
export default {
|
export default {
|
||||||
name: "HikVideo",
|
name: "hkVideo",
|
||||||
|
props: {
|
||||||
|
width: {
|
||||||
|
type: Number,
|
||||||
|
default: 500,
|
||||||
|
},
|
||||||
|
height: {
|
||||||
|
type: Number,
|
||||||
|
default: 300,
|
||||||
|
},
|
||||||
|
//初始化参数,
|
||||||
|
// appkey: appkey, //API网关提供的appkey
|
||||||
|
// secret: secret, //API网关提供的secret
|
||||||
|
// ip: ip, //API网关IP地址
|
||||||
|
// playMode: playMode, //播放模式(决定显示预览还是回放界面)
|
||||||
|
// port: port, //端口
|
||||||
|
// snapDir: snapDir, //抓图存储路径
|
||||||
|
// videoDir: videoDir, //紧急录像或录像剪辑存储路径
|
||||||
|
// layout: layout, //布局
|
||||||
|
// enableHTTPS: enableHTTPS, //是否启用HTTPS协议
|
||||||
|
// encryptedFields: encryptedFields, //加密字段
|
||||||
|
// showToolbar: showToolbar, //是否显示工具栏
|
||||||
|
// showSmart: showSmart, //是否显示智能信息
|
||||||
|
// buttonIDs: buttonIDs //自定义工具条按钮
|
||||||
|
argument: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {},
|
||||||
|
},
|
||||||
|
//模式:0:预览,1回放
|
||||||
|
playMode: {
|
||||||
|
type: Number,
|
||||||
|
default: 0,
|
||||||
|
},
|
||||||
|
//浏览器窗口改变时候是否动态变化组件宽度,将按照初始化组件占浏览器可视区域比例缩放组件宽度
|
||||||
|
autoResize: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
|
//未安装插件时候是否显示插件下载对话框提示用户下载功能
|
||||||
|
downloadDialog: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
//海康插件下载url
|
||||||
|
downloadUrl: {
|
||||||
|
type: String,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
downloadText:{
|
||||||
|
type:String,
|
||||||
|
default:'插件启动失败,请检查插件是否安装,如果未安装请点击下载安装,安装后刷新页面'
|
||||||
|
}
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 视频盒子的高度
|
curWindIndex: 1, //当前选中窗口号,从1开始
|
||||||
playWndHeight: "",
|
oWebControl: null, //插件实例
|
||||||
// 视频盒子的宽度
|
iWidth: "", //组件宽
|
||||||
playWndWidth: "",
|
iHeight: "", //组件高
|
||||||
oWebControl: null,
|
options: {
|
||||||
initCount: 0,
|
appkey: "admin", //API网关提供的appkey
|
||||||
pubKey: "",
|
secret: "mygymygy.", //API网关提供的secret
|
||||||
cameraIndexCode: "", // 这里面是监控点编号
|
ip: "192.168.2.107", //API网关IP地址
|
||||||
objData: {
|
playMode: 0, //播放模式(决定显示预览还是回放界面)
|
||||||
appkey: "", //海康平台提供的appkey
|
port: 443, //端口
|
||||||
ip: "", //平台地址
|
snapDir: "D:\\SnapDir", //抓图存储路径
|
||||||
secret: "", //海康平台提供的secret
|
videoDir: "D:\\VideoDir", //紧急录像或录像剪辑存储路径
|
||||||
port: 443,
|
layout: "3x3", //布局
|
||||||
playMode: 0, // 0 预览 1回放
|
enableHTTPS: 1, //是否启用HTTPS协议
|
||||||
layout: "2x2", //页面展示的模块数【16】
|
encryptedFields: "secret", //加密字段
|
||||||
|
showToolbar: 1,
|
||||||
|
showSmart: 1,
|
||||||
|
buttonIDs:
|
||||||
|
"0,1,16,256,257,258,259,260,512,513,514,515,516,517,768,769,770", //自定义工具条按钮
|
||||||
},
|
},
|
||||||
|
rate: 0, //组件宽度与窗口宽度比例
|
||||||
|
isInitComolete: false, //第一次初始化是否完成
|
||||||
|
dialogVisible: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
width: {
|
||||||
|
handler(val) {
|
||||||
|
this.iWidth = val;
|
||||||
|
if (this.isInitComolete) {
|
||||||
|
this.setRate();
|
||||||
|
this.setResize(this.iWidth, this.iHeight);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
immediate: true,
|
||||||
|
},
|
||||||
|
height: {
|
||||||
|
handler(val) {
|
||||||
|
this.iHeight = val;
|
||||||
|
if (this.isInitComolete) {
|
||||||
|
this.setRate();
|
||||||
|
this.setResize(this.iWidth, this.iHeight);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
immediate: true,
|
||||||
|
},
|
||||||
|
playMode() {
|
||||||
|
this.reInit();
|
||||||
|
},
|
||||||
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// 首次加载时的到父容器的高度
|
this.init();
|
||||||
this.playWndHeight = this.$refs.playWndBox.clientHeight;
|
this.handleWindEvent();
|
||||||
// 首次加载时的到父容器的宽度
|
|
||||||
this.playWndWidth = this.$refs.playWndBox.clientWidth;
|
|
||||||
|
|
||||||
// 初始化播放器插件
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.initPlugin();
|
this.setRate();
|
||||||
});
|
|
||||||
|
|
||||||
// 监听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();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
destroyed() {
|
beforeDestroy() {
|
||||||
if (this.oWebControl != null) {
|
if (this.oWebControl != null) {
|
||||||
// 先让窗口隐藏,规避可能的插件窗口滞后于浏览器消失问题
|
this.oWebControl.JS_HideWnd(); // 先让窗口隐藏,规避可能的插件窗口滞后于浏览器消失问题
|
||||||
this.oWebControl.JS_HideWnd();
|
this.oWebControl.JS_Disconnect().then(
|
||||||
// 销毁当前播放的视频
|
function () {
|
||||||
this.oWebControl.JS_RequestInterface({ funcName: "destroyWnd" });
|
// 断开与插件服务连接成功
|
||||||
// 断开与插件服务连接
|
},
|
||||||
this.oWebControl.JS_Disconnect();
|
function () {
|
||||||
|
// 断开与插件服务连接失败
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 创建播放实例
|
//初始化插件
|
||||||
initPlugin() {
|
init() {
|
||||||
let that = this;
|
let argument = {
|
||||||
this.oWebControl = null;
|
...this.options,
|
||||||
that.oWebControl = new WebControl({
|
...this.argument,
|
||||||
szPluginContainer: "playWnd", // 指定容器id
|
};
|
||||||
iServicePortStart: 15900, // 指定起止端口号,建议使用该值
|
if (this.playMode > -1 && this.playMode < 2) {
|
||||||
iServicePortEnd: 15909,
|
argument.playMode = this.playMode;
|
||||||
szClassId: "23BF3B0A-2C56-4D97-9C03-0CB103AA8F11", // 用于IE10使用ActiveX的clsid
|
}
|
||||||
cbConnectSuccess: () => {
|
// eslint-disable-next-line no-undef
|
||||||
// 创建WebControl实例成功
|
this.iWidth = Math.min(this.iWidth, $(window).width());
|
||||||
that.oWebControl
|
this.oWebControl = initPlugin(
|
||||||
.JS_StartService("window", {
|
"playWnd",
|
||||||
// WebControl实例创建成功后需要启动服务
|
this.iWidth,
|
||||||
// 值"./VideoPluginConnect.dll"写死
|
this.iHeight,
|
||||||
dllPath: "./VideoPluginConnect.dll",
|
argument,
|
||||||
})
|
this.cbIntegrationCallBack,
|
||||||
.then(
|
() => {
|
||||||
function () {
|
this.setRate();
|
||||||
// 设置消息回调
|
this.setResize(this.iWidth, this.iHeight);
|
||||||
that.oWebControl.JS_SetWindowControlCallback({
|
this.isInitComolete = true;
|
||||||
cbIntegrationCallBack: that.cbIntegrationCallBack,
|
this.$emit("initFinish");
|
||||||
});
|
|
||||||
//JS_CreateWnd创建视频播放窗口,宽高可设定
|
|
||||||
that.oWebControl
|
|
||||||
.JS_CreateWnd("playWnd", 2040, 945, { bEmbed: true })
|
|
||||||
//注:2040,945这是我本人项目视频盒子的大小,你们要根据自己视频盒子的大小进行修改,不然初始化插件的时候会有空白闪烁。
|
|
||||||
.then(function () {
|
|
||||||
// 创建播放实例成功后初始化
|
|
||||||
that.init();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
function () {
|
|
||||||
// 启动插件服务失败
|
|
||||||
}
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
// 创建WebControl实例失败
|
() => {
|
||||||
cbConnectError: function () {
|
if (this.downloadDialog) {
|
||||||
that.oWebControl = null;
|
this.dialogVisible = true;
|
||||||
// alert('插件未启动,正在尝试启动,请稍候...')
|
|
||||||
// that.$message.warning("插件未启动,正在尝试启动,请稍候...");
|
|
||||||
// 程序未启动时执行error函数,采用wakeup来启动程序
|
|
||||||
window.WebControl.JS_WakeUp("VideoWebPlugin://");
|
|
||||||
that.initCount++;
|
|
||||||
if (that.initCount < 3) {
|
|
||||||
setTimeout(function () {
|
|
||||||
that.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.$emit("pluginError");
|
||||||
cbConnectClose: () => {
|
}
|
||||||
// 异常断开:bNormalClose = false
|
);
|
||||||
// JS_Disconnect正常断开:bNormalClose = true
|
|
||||||
// console.log("cbConnectClose");
|
|
||||||
that.oWebControl = null;
|
|
||||||
},
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
// 初始化
|
//重新初始化
|
||||||
init(callback) {
|
reInit() {
|
||||||
let that = this;
|
if (this.oWebControl) {
|
||||||
that.getPubKey(() => {
|
this.oWebControl
|
||||||
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
|
|
||||||
let snapDir = "D:\\SnapDir"; //抓图存储路径
|
|
||||||
let videoDir = "D:\\VideoDir"; //紧急录像或录像剪辑存储路径
|
|
||||||
let layout = that.objData.layout; //playMode指定模式的布局
|
|
||||||
let enableHTTPS = 1; //是否启用HTTPS协议与综合安防管理平台交互,这里总是填1
|
|
||||||
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({
|
.JS_RequestInterface({
|
||||||
funcName: "init",
|
funcName: "uninit",
|
||||||
argument: JSON.stringify({
|
|
||||||
appkey: appkey, //API网关提供的appkey
|
|
||||||
secret: secret, //API网关提供的secret
|
|
||||||
ip: ip, //API网关IP地址
|
|
||||||
playMode: playMode, //播放模式(决定显示预览还是回放界面)
|
|
||||||
port: port, //端口
|
|
||||||
snapDir: snapDir, //抓图存储路径
|
|
||||||
videoDir: videoDir, //紧急录像或录像剪辑存储路径
|
|
||||||
layout: layout, //布局
|
|
||||||
enableHTTPS: enableHTTPS, //是否启用HTTPS协议
|
|
||||||
encryptedFields: encryptedFields, //加密字段
|
|
||||||
showToolbar: showToolbar, //是否显示工具栏
|
|
||||||
showSmart: showSmart, //是否显示智能信息
|
|
||||||
buttonIDs, //自定义工具条按钮
|
|
||||||
}),
|
|
||||||
})
|
})
|
||||||
.then(function (oData) {
|
.then(() => {
|
||||||
that.oWebControl.JS_Resize(that.playWndWidth, that.playWndHeight); // 初始化后resize一次,规避firefox下首次显示窗口后插件窗口未与DIV窗口重合问题
|
this.init();
|
||||||
if (callback) {
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
// 隐藏
|
|
||||||
// that.oWebControl.JS_HideWnd()
|
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
},
|
},
|
||||||
// 获取公钥
|
setRate() {
|
||||||
getPubKey(callback) {
|
// eslint-disable-next-line no-undef
|
||||||
let that = this;
|
var iWidth = $(window).width();
|
||||||
this.oWebControl
|
this.rate = this.iWidth / iWidth;
|
||||||
.JS_RequestInterface({
|
},
|
||||||
funcName: "getRSAPubKey",
|
//窗口事件
|
||||||
argument: JSON.stringify({
|
handleWindEvent() {
|
||||||
keyLength: 1024,
|
// 监听resize事件,使插件窗口尺寸跟随DIV窗口变化
|
||||||
}),
|
// eslint-disable-next-line no-undef
|
||||||
})
|
if (this.autoResize) {
|
||||||
.then(function (oData) {
|
// eslint-disable-next-line no-undef
|
||||||
if (oData.responseMsg.data) {
|
$(window).resize(() => {
|
||||||
that.pubKey = oData.responseMsg.data;
|
if (this.oWebControl) {
|
||||||
callback();
|
// eslint-disable-next-line no-undef
|
||||||
|
var iWidth = $(window).width();
|
||||||
|
// eslint-disable-next-line no-undef
|
||||||
|
this.iWidth = iWidth * this.rate;
|
||||||
|
this.oWebControl.JS_Resize(this.iWidth, this.iHeight);
|
||||||
|
this.setWndCover();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
// 监听滚动条scroll事件,使插件窗口跟随浏览器滚动而移动
|
||||||
|
// eslint-disable-next-line no-undef
|
||||||
|
$(window).scroll(() => {
|
||||||
|
if (this.oWebControl) {
|
||||||
|
this.oWebControl.JS_Resize(this.iWidth, this.iHeight);
|
||||||
|
this.setWndCover();
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
// RSA 加密
|
//推送消息回调
|
||||||
setEncrypt(value) {
|
|
||||||
let that = this;
|
|
||||||
let encrypt = new window.JSEncrypt();
|
|
||||||
encrypt.setPublicKey(that.pubKey);
|
|
||||||
return encrypt.encrypt(value);
|
|
||||||
},
|
|
||||||
// 回调的消息
|
|
||||||
cbIntegrationCallBack(oData) {
|
cbIntegrationCallBack(oData) {
|
||||||
let { responseMsg: type } = oData;
|
if (oData?.responseMsg?.type) {
|
||||||
if (type === "error") {
|
let data = oData.responseMsg;
|
||||||
} else {
|
switch (data.type) {
|
||||||
}
|
//窗口号改变
|
||||||
},
|
case 1:
|
||||||
// 视频预览功能
|
if (this.curWindIndex !== data.msg.wndId) {
|
||||||
previewVideo(data) {
|
this.curWindIndex = data.msg.wndId;
|
||||||
let that = this;
|
this.$emit("windowChange", this.curWindIndex);
|
||||||
let cameraIndexCode = data; // 获取输入的监控点编号值,必填
|
}
|
||||||
let streamMode = 0; // 主子码流标识:0-主码流,1-子码流
|
break;
|
||||||
let transMode = 0; // 传输协议:0-UDP,1-TCP
|
//布局改变
|
||||||
let gpuMode = 0; // 是否启用GPU硬解,0-不启用,1-启用
|
case 6:
|
||||||
let wndId = -1; // 播放窗口序号(在2x2以上布局下可指定播放窗口)
|
this.$emit("layoutChange", data.msg);
|
||||||
// console.log(cameraIndexCode, "-------cameraIndexCode-");
|
break;
|
||||||
|
|
||||||
that.oWebControl.JS_RequestInterface({
|
|
||||||
funcName: "startPreview",
|
|
||||||
argument: JSON.stringify({
|
|
||||||
cameraIndexCode: cameraIndexCode.trim(), // 监控点编号
|
|
||||||
streamMode: streamMode, // 主子码流标识
|
|
||||||
transMode: transMode, // 传输协议
|
|
||||||
gpuMode: gpuMode, // 是否开启GPU硬解
|
|
||||||
wndId: wndId, // 可指定播放窗口
|
|
||||||
}),
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 停止全部预览
|
|
||||||
stopAllPreview() {
|
|
||||||
this.oWebControl.JS_RequestInterface({
|
|
||||||
funcName: "stopAllPreview",
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 格式化时间
|
|
||||||
dateFormat(oDate, fmt) {
|
|
||||||
let o = {
|
|
||||||
"M+": oDate.getMonth() + 1, //月份
|
|
||||||
"d+": oDate.getDate(), //日
|
|
||||||
"h+": oDate.getHours(), //小时
|
|
||||||
"m+": oDate.getMinutes(), //分
|
|
||||||
"s+": oDate.getSeconds(), //秒
|
|
||||||
"q+": Math.floor((oDate.getMonth() + 3) / 3), //季度
|
|
||||||
S: oDate.getMilliseconds(), //毫秒
|
|
||||||
};
|
|
||||||
if (/(y+)/.test(fmt)) {
|
|
||||||
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)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return fmt;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 设置窗口裁剪,当因滚动条滚动导致窗口需要被遮住的情况下需要JS_CuttingPartWindow部分窗口
|
// 设置窗口裁剪,当因滚动条滚动导致窗口需要被遮住的情况下需要JS_CuttingPartWindow部分窗口
|
||||||
setWndCover() {
|
setWndCover() {
|
||||||
|
// eslint-disable-next-line no-undef
|
||||||
var iWidth = $(window).width();
|
var iWidth = $(window).width();
|
||||||
|
// eslint-disable-next-line no-undef
|
||||||
var iHeight = $(window).height();
|
var iHeight = $(window).height();
|
||||||
|
// eslint-disable-next-line no-undef
|
||||||
var oDivRect = $("#playWnd").get(0).getBoundingClientRect();
|
var oDivRect = $("#playWnd").get(0).getBoundingClientRect();
|
||||||
|
|
||||||
var iCoverLeft = oDivRect.left < 0 ? Math.abs(oDivRect.left) : 0;
|
var iCoverLeft = oDivRect.left < 0 ? Math.abs(oDivRect.left) : 0;
|
||||||
@ -302,42 +257,239 @@ export default {
|
|||||||
? Math.round(oDivRect.bottom - iHeight)
|
? Math.round(oDivRect.bottom - iHeight)
|
||||||
: 0;
|
: 0;
|
||||||
|
|
||||||
iCoverLeft = iCoverLeft > 2041 ? 2041 : iCoverLeft;
|
iCoverLeft = iCoverLeft > this.iWidth ? this.iWidth : iCoverLeft;
|
||||||
iCoverTop = iCoverTop > 945 ? 945 : iCoverTop;
|
iCoverTop = iCoverTop > this.iHeight ? this.iHeight : iCoverTop;
|
||||||
iCoverRight = iCoverRight > 2041 ? 2041 : iCoverRight;
|
iCoverRight = iCoverRight > this.iWidth ? this.iWidth : iCoverRight;
|
||||||
iCoverBottom = iCoverBottom > 945 ? 945 : iCoverBottom;
|
iCoverBottom = iCoverBottom > this.iHeight ? this.iHeight : iCoverBottom;
|
||||||
|
|
||||||
this.oWebControl.JS_RepairPartWindow(0, 0, 2041, 946); // 多1个像素点防止还原后边界缺失一个像素条
|
this.oWebControl.JS_RepairPartWindow(
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
this.iWidth + 1,
|
||||||
|
this.iHeight + 1
|
||||||
|
); // 多1个像素点防止还原后边界缺失一个像素条
|
||||||
if (iCoverLeft != 0) {
|
if (iCoverLeft != 0) {
|
||||||
this.oWebControl.JS_CuttingPartWindow(0, 0, iCoverLeft, 946);
|
this.oWebControl.JS_CuttingPartWindow(0, 0, iCoverLeft, this.iHeight);
|
||||||
}
|
}
|
||||||
if (iCoverTop != 0) {
|
if (iCoverTop != 0) {
|
||||||
this.oWebControl.JS_CuttingPartWindow(0, 0, 2041, iCoverTop); // 多剪掉一个像素条,防止出现剪掉一部分窗口后出现一个像素条
|
this.oWebControl.JS_CuttingPartWindow(
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
this.iWidth + 1,
|
||||||
|
iCoverTop + 1
|
||||||
|
); // 多剪掉一个像素条,防止出现剪掉一部分窗口后出现一个像素条
|
||||||
}
|
}
|
||||||
if (iCoverRight != 0) {
|
if (iCoverRight != 0) {
|
||||||
this.oWebControl.JS_CuttingPartWindow(
|
this.oWebControl.JS_CuttingPartWindow(
|
||||||
2041 - iCoverRight,
|
this.iWidth - iCoverRight,
|
||||||
0,
|
0,
|
||||||
iCoverRight,
|
iCoverRight,
|
||||||
946
|
this.iHeight
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (iCoverBottom != 0) {
|
if (iCoverBottom != 0) {
|
||||||
this.oWebControl.JS_CuttingPartWindow(
|
this.oWebControl.JS_CuttingPartWindow(
|
||||||
0,
|
0,
|
||||||
946 - iCoverBottom,
|
this.iHeight - iCoverBottom,
|
||||||
2041,
|
this.iWidth,
|
||||||
iCoverBottom
|
iCoverBottom
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
/** 预览
|
||||||
|
* @param {*} cameraIndexCode :获取输入的监控点编号值,必填
|
||||||
|
* @param {*} argument:api参数,
|
||||||
|
* argument属性cameraIndexCode优先级高于函数参数cameraIndexCode
|
||||||
|
*/
|
||||||
|
startPreview(cameraIndexCode, argument = {}) {
|
||||||
|
if (this.oWebControl) {
|
||||||
|
let params = {
|
||||||
|
cameraIndexCode: cameraIndexCode, //监控点编号
|
||||||
|
streamMode: 0, //主子码流标识
|
||||||
|
transMode: 1, //传输协议
|
||||||
|
gpuMode: 1, //是否开启GPU硬解
|
||||||
|
wndId: -1,
|
||||||
|
};
|
||||||
|
this.oWebControl
|
||||||
|
.JS_RequestInterface({
|
||||||
|
funcName: "startPreview",
|
||||||
|
argument: JSON.stringify({
|
||||||
|
...params,
|
||||||
|
...argument,
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
.then(() => {});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//停止所有预览
|
||||||
|
stopAllPreview() {
|
||||||
|
this.oWebControl.JS_RequestInterface({
|
||||||
|
funcName: "stopAllPreview",
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
//批量(指定窗口)停止播放
|
||||||
|
/**
|
||||||
|
* idArr:播放窗口序号数组
|
||||||
|
*/
|
||||||
|
stopListPreview(idArr) {
|
||||||
|
let list = idArr.map((item) => {
|
||||||
|
return {
|
||||||
|
wndId: item,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
this.oWebControl.JS_RequestInterface({
|
||||||
|
funcName: "stopMultiPlay",
|
||||||
|
argument: {
|
||||||
|
list,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 根据监控点编号录像回放
|
||||||
|
* @param {*} cameraIndexCode :获取输入的监控点编号值,必填
|
||||||
|
* @param {*} startTime:开始时间
|
||||||
|
* @param {*} endTime:结束时间
|
||||||
|
* @param {*} recordLocation://录像存储位置:0-中心存储,1-设备存储
|
||||||
|
* @param {*} argument:api参数
|
||||||
|
* argument属性cameraIndexCode优先级高于函数参数cameraIndexCode
|
||||||
|
*/
|
||||||
|
startPlayBack(
|
||||||
|
cameraIndexCode,
|
||||||
|
startTime,
|
||||||
|
endTime,
|
||||||
|
recordLocation = 0,
|
||||||
|
argument = {}
|
||||||
|
) {
|
||||||
|
var startTimeStamp = new Date(
|
||||||
|
startTime.replace("-", "/").replace("-", "/")
|
||||||
|
).getTime(); //回放开始时间戳,必填
|
||||||
|
var endTimeStamp = new Date(
|
||||||
|
endTime.replace("-", "/").replace("-", "/")
|
||||||
|
).getTime(); //回放结束时间戳,必填
|
||||||
|
// var recordLocation = 0; //录像存储位置:0-中心存储,1-设备存储
|
||||||
|
var transMode = 1; //传输协议:0-UDP,1-TCP
|
||||||
|
var gpuMode = 0; //是否启用GPU硬解,0-不启用,1-启用
|
||||||
|
var wndId = -1; //播放窗口序号(在2x2以上布局下可指定播放窗口)
|
||||||
|
|
||||||
|
this.oWebControl.JS_RequestInterface({
|
||||||
|
funcName: "startPlayback",
|
||||||
|
argument: JSON.stringify({
|
||||||
|
cameraIndexCode: cameraIndexCode, //监控点编号
|
||||||
|
startTimeStamp: Math.floor(startTimeStamp / 1000).toString(), //录像查询开始时间戳,单位:秒
|
||||||
|
endTimeStamp: Math.floor(endTimeStamp / 1000).toString(), //录像结束开始时间戳,单位:秒
|
||||||
|
recordLocation: recordLocation, //录像存储类型:0-中心存储,1-设备存储
|
||||||
|
transMode: transMode, //传输协议:0-UDP,1-TCP
|
||||||
|
gpuMode: gpuMode, //是否启用GPU硬解,0-不启用,1-启用
|
||||||
|
wndId: wndId, //可指定播放窗口
|
||||||
|
...argument,
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//停止所有回放
|
||||||
|
stopAllPlayBack() {
|
||||||
|
this.oWebControl.JS_RequestInterface({
|
||||||
|
funcName: "stopAllPlayback",
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
//设置布局
|
||||||
|
//latyou布局:2x2
|
||||||
|
setLayout(layout) {
|
||||||
|
this.oWebControl.JS_RequestInterface({
|
||||||
|
funcName: " setLayout",
|
||||||
|
argument: {
|
||||||
|
layout,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 画面字符叠加
|
||||||
|
* @param {*} text :文字
|
||||||
|
* @param {*} x:相对播放窗口左上角的横坐标起点
|
||||||
|
* @param {*} y:相对播放窗口左上角的纵坐标起点
|
||||||
|
* @param {*} fontSize:字体大小
|
||||||
|
* @param {*} color:字体颜色,默认白色
|
||||||
|
* @param {*} argument:api参数
|
||||||
|
* argument属性cameraIndexCode优先级高于函数参数cameraIndexCode
|
||||||
|
*/
|
||||||
|
drawText(
|
||||||
|
text,
|
||||||
|
x = 5,
|
||||||
|
y = 5,
|
||||||
|
fontSize = 20,
|
||||||
|
color = 16777215,
|
||||||
|
argument = {}
|
||||||
|
) {
|
||||||
|
this.oWebControl.JS_RequestInterface({
|
||||||
|
funcName: "drawOSD",
|
||||||
|
argument: {
|
||||||
|
text,
|
||||||
|
x,
|
||||||
|
y,
|
||||||
|
fontSize,
|
||||||
|
color,
|
||||||
|
...argument,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//进入全屏
|
||||||
|
setFullScreen() {
|
||||||
|
this.oWebControl.JS_RequestInterface({
|
||||||
|
funcName: "setFullScreen",
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//退出全屏
|
||||||
|
exitFullScreen() {
|
||||||
|
this.oWebControl.JS_RequestInterface({
|
||||||
|
funcName: "exitFullScreen",
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//播放抓图
|
||||||
|
snapShot(argument = {}) {
|
||||||
|
this.oWebControl.JS_RequestInterface({
|
||||||
|
funcName: "snapShot",
|
||||||
|
argument,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//隐藏窗口
|
||||||
|
hideWindow() {
|
||||||
|
this.oWebControl.JS_HideWnd();
|
||||||
|
},
|
||||||
|
//显示窗口
|
||||||
|
showWindow() {
|
||||||
|
this.oWebControl.JS_ShowWnd();
|
||||||
|
},
|
||||||
|
//设置窗口尺寸
|
||||||
|
setResize(width, height) {
|
||||||
|
this.oWebControl.JS_Resize(width, height);
|
||||||
|
this.setWndCover();
|
||||||
|
},
|
||||||
|
//下载安装包
|
||||||
|
handleDownloadExe() {
|
||||||
|
this.dialogVisible = false;
|
||||||
|
if (this.downloadUrl) {
|
||||||
|
this.downloadFile(this.downloadUrl);
|
||||||
|
} else {
|
||||||
|
console.log("下载地址为空");
|
||||||
|
}
|
||||||
|
this.$emit("clickDownload");
|
||||||
|
},
|
||||||
|
//下载文件
|
||||||
|
downloadFile(url, fileName = "") {
|
||||||
|
const a = document.createElement("a");
|
||||||
|
a.style.display = "none";
|
||||||
|
if (fileName) {
|
||||||
|
a.setAttribute("download", fileName);
|
||||||
|
}
|
||||||
|
a.setAttribute("href", url);
|
||||||
|
document.body.appendChild(a);
|
||||||
|
a.click();
|
||||||
|
window.URL.revokeObjectURL(a.href);
|
||||||
|
document.body.removeChild(a);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
<style scoped>
|
||||||
<style lang="scss" scoped>
|
|
||||||
.videoMain {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
@ -146,11 +146,7 @@
|
|||||||
<defective :message="this.defectiveData" />
|
<defective :message="this.defectiveData" />
|
||||||
</div>
|
</div>
|
||||||
<div style="width: 30%; margin-top: 50px">
|
<div style="width: 30%; margin-top: 50px">
|
||||||
<hkVideo
|
<hkVideo :monitoringNumber="cameraIndexCode"></hkVideo>
|
||||||
:cameraIndexCode="cameraIndexCode"
|
|
||||||
:objData="objData"
|
|
||||||
ref="hikVideo"
|
|
||||||
></hkVideo>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="height: 50%; display: flex">
|
<div style="height: 50%; display: flex">
|
||||||
@ -251,6 +247,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import axios from "axios";
|
||||||
import { listWorkorder } from "@/api/mes/pro/workorder";
|
import { listWorkorder } from "@/api/mes/pro/workorder";
|
||||||
|
|
||||||
// import * as statisServer from "@/api/statistics";
|
// import * as statisServer from "@/api/statistics";
|
||||||
@ -265,7 +262,7 @@ export default {
|
|||||||
components: { defective, complete, ticket, hkVideo },
|
components: { defective, complete, ticket, hkVideo },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
cameraIndexCode: "", //wed插件监控点
|
cameraIndexCode: "1a033f81-a404-4a66-aabf-cb0ead6cc2be", //wed插件监控点
|
||||||
//海康wed插件初始化数据
|
//海康wed插件初始化数据
|
||||||
objData: {
|
objData: {
|
||||||
appkey: "", //综合安防管理平台提供的appkey,必填
|
appkey: "", //综合安防管理平台提供的appkey,必填
|
||||||
|
@ -381,7 +381,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col
|
<el-col
|
||||||
:span="12"
|
:span="12"
|
||||||
v-if="this.form.code == 'CNC' || this.form.code == 'ROBOT'"
|
v-if="this.form.code == 'CNC'"
|
||||||
>
|
>
|
||||||
<el-form-item label="安全门状态" prop="securityDoor">
|
<el-form-item label="安全门状态" prop="securityDoor">
|
||||||
<el-radio-group v-model="form.securityDoor">
|
<el-radio-group v-model="form.securityDoor">
|
||||||
@ -548,9 +548,6 @@ export default {
|
|||||||
nextProcessId: [
|
nextProcessId: [
|
||||||
{ required: true, message: "工序ID不能为空", trigger: "blur" },
|
{ required: true, message: "工序ID不能为空", trigger: "blur" },
|
||||||
],
|
],
|
||||||
machineryTypeId: [
|
|
||||||
{ required: true, message: "设备类型不能为空", trigger: "blur" },
|
|
||||||
],
|
|
||||||
keyFlag: [
|
keyFlag: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
|
@ -461,6 +461,7 @@ import {
|
|||||||
delWorkorder,
|
delWorkorder,
|
||||||
addWorkorder,
|
addWorkorder,
|
||||||
updateWorkorder,
|
updateWorkorder,
|
||||||
|
deleteShopFace,
|
||||||
} from "@/api/mes/pro/workorder";
|
} from "@/api/mes/pro/workorder";
|
||||||
import { listGanttTaskList } from "@/api/mes/pro/protask";
|
import { listGanttTaskList } from "@/api/mes/pro/protask";
|
||||||
import { listProductprocess } from "@/api/mes/pro/routeprocess";
|
import { listProductprocess } from "@/api/mes/pro/routeprocess";
|
||||||
@ -665,7 +666,8 @@ export default {
|
|||||||
handleproductione(row) {
|
handleproductione(row) {
|
||||||
const routeId = row.workorderId || this.ids;
|
const routeId = row.workorderId || this.ids;
|
||||||
axios
|
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)
|
// .get("http://127.0.0.1:8077/manage/task/execute?ids=" + routeId)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.data.code === 200) {
|
if (res.data.code === 200) {
|
||||||
@ -681,7 +683,8 @@ export default {
|
|||||||
Pendingproduction(row) {
|
Pendingproduction(row) {
|
||||||
const routeId = row.workorderId || this.ids;
|
const routeId = row.workorderId || this.ids;
|
||||||
axios
|
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)
|
// .get("http://127.0.0.1:8077/manage/task/suspension?id=" + routeId)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.data.code === 200) {
|
if (res.data.code === 200) {
|
||||||
@ -694,21 +697,21 @@ export default {
|
|||||||
},
|
},
|
||||||
// 删除
|
// 删除
|
||||||
handleSuspended(row) {
|
handleSuspended(row) {
|
||||||
// const workorderIds = row.workorderId || this.ids;
|
const workorderId = row.workorderId || this.ids;
|
||||||
// this.$modal
|
this.$modal
|
||||||
// .confirm("确认删除数据项?")
|
.confirm("确认删除数据项?")
|
||||||
// .then(function () {
|
.then(() => {
|
||||||
// return dofinish(workorderIds); //完成工单
|
deleteShopFace({workorderId:workorderId}).then((response) => {
|
||||||
// })
|
console.log(response);
|
||||||
// .then(() => {
|
if (response.code === 200) {
|
||||||
// if (res.data.code === 200) {
|
this.getList();
|
||||||
// this.getList();
|
this.$modal.msgSuccess("删除成功");
|
||||||
// this.$modal.msgSuccess("删除成功");
|
} else {
|
||||||
// } else {
|
this.$message.error(res.msg);
|
||||||
// this.$message.error(res.data.msg);
|
}
|
||||||
// }
|
});
|
||||||
// })
|
})
|
||||||
// .catch(() => {});
|
.catch(() => {});
|
||||||
},
|
},
|
||||||
|
|
||||||
selectable(row, index) {
|
selectable(row, index) {
|
||||||
|
@ -434,6 +434,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import axios from "axios";
|
||||||
import {
|
import {
|
||||||
listItemrecpt,
|
listItemrecpt,
|
||||||
getItemrecpt,
|
getItemrecpt,
|
||||||
@ -441,7 +442,6 @@ import {
|
|||||||
addItemrecpt,
|
addItemrecpt,
|
||||||
updateItemrecpt,
|
updateItemrecpt,
|
||||||
confirmItemrecpt,
|
confirmItemrecpt,
|
||||||
storage,
|
|
||||||
} from "@/api/mes/wm/itemrecpt";
|
} from "@/api/mes/wm/itemrecpt";
|
||||||
import { listItemrecptline } from "@/api/mes/wm/itemrecptline";
|
import { listItemrecptline } from "@/api/mes/wm/itemrecptline";
|
||||||
import { listMdItem } from "@/api/mes/md/pallet";
|
import { listMdItem } from "@/api/mes/md/pallet";
|
||||||
@ -693,8 +693,12 @@ export default {
|
|||||||
listItemrecptline({ recptId: row.recptId }).then((response) => {
|
listItemrecptline({ recptId: row.recptId }).then((response) => {
|
||||||
this.itemrecptlineList = response.rows;
|
this.itemrecptlineList = response.rows;
|
||||||
});
|
});
|
||||||
|
var queryParams = {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10000,
|
||||||
|
};
|
||||||
// 托盘查询
|
// 托盘查询
|
||||||
listMdItem(this.queryParams).then((response) => {
|
listMdItem(queryParams).then((response) => {
|
||||||
this.itemList = response.rows;
|
this.itemList = response.rows;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -707,7 +711,6 @@ export default {
|
|||||||
}
|
}
|
||||||
this.perform.itemCode = data.itemCode;
|
this.perform.itemCode = data.itemCode;
|
||||||
this.perform.lineId = data.lineId;
|
this.perform.lineId = data.lineId;
|
||||||
this.perform.itemId = data.itemId;
|
|
||||||
},
|
},
|
||||||
selectTray(data) {
|
selectTray(data) {
|
||||||
this.perform.palletId = data.proPalletId;
|
this.perform.palletId = data.proPalletId;
|
||||||
@ -715,12 +718,20 @@ export default {
|
|||||||
},
|
},
|
||||||
submitFileForm() {
|
submitFileForm() {
|
||||||
if (this.remainingquantity != 0) {
|
if (this.remainingquantity != 0) {
|
||||||
storage(this.perform).then((response) => {
|
axios
|
||||||
this.$modal.msgSuccess("入库成功");
|
.get("http://192.168.2.104:8077/manage/matter/storageItem", {
|
||||||
this.warehousing = false;
|
params: this.perform,
|
||||||
this.getList();
|
})
|
||||||
this.selectEncoding();
|
.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 {
|
} else {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: "当前入库数量为0",
|
message: "当前入库数量为0",
|
||||||
|
@ -35,14 +35,16 @@ module.exports = {
|
|||||||
proxy: {
|
proxy: {
|
||||||
// detail: https://cli.vuejs.org/config/#devserver-proxy
|
// detail: https://cli.vuejs.org/config/#devserver-proxy
|
||||||
"/prod-api": {
|
"/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,
|
changeOrigin: true,
|
||||||
// pathRewrite: {
|
// pathRewrite: {
|
||||||
// ['^' + process.env.VUE_APP_BASE_API]: ''
|
// ['^' + process.env.VUE_APP_BASE_API]: ''
|
||||||
// }
|
// }
|
||||||
},
|
},
|
||||||
"/ureport": {
|
"/ureport": {
|
||||||
target: `http://192.168.3.53:8063`,
|
target: `http://192.168.2.104:8063`,
|
||||||
|
// target: `http://192.168.3.53:8063`,
|
||||||
ws: false,
|
ws: false,
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
pathRewrite: {
|
pathRewrite: {
|
||||||
|
Loading…
Reference in New Issue
Block a user