diff --git a/src/assets/images/logo-b.png b/src/assets/images/logo-b.png index 34438bf..57ce112 100644 Binary files a/src/assets/images/logo-b.png and b/src/assets/images/logo-b.png differ diff --git a/src/assets/images/logo-small.png b/src/assets/images/logo-small.png index a2a8566..ab080eb 100644 Binary files a/src/assets/images/logo-small.png and b/src/assets/images/logo-small.png differ diff --git a/src/views/mes/dv/machinery/index.vue b/src/views/mes/dv/machinery/index.vue index def4376..4ee802d 100644 --- a/src/views/mes/dv/machinery/index.vue +++ b/src/views/mes/dv/machinery/index.vue @@ -316,7 +316,7 @@ :options="machineryTypeOptions" :normalizer="normalizer" placeholder="请选择设备类型" - @select="handleNodeClick" + @select="handleNode" /> @@ -721,7 +721,7 @@ export default { this.handleQuery(); }, // 节点单击事件 - handleNodeClick(data) { + handleNode(data) { console.log(data); this.form.machineryTypeName = data.machineryTypeName; this.form.machineryTypeCode = data.code; diff --git a/src/views/mes/pro/production/components/lib/initPlugin.js b/src/views/mes/pro/production/components/lib/initPlugin.js new file mode 100644 index 0000000..5eb9278 --- /dev/null +++ b/src/views/mes/pro/production/components/lib/initPlugin.js @@ -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 \ No newline at end of file diff --git a/src/views/mes/pro/production/components/lib/pubKey.js b/src/views/mes/pro/production/components/lib/pubKey.js new file mode 100644 index 0000000..32b9d8a --- /dev/null +++ b/src/views/mes/pro/production/components/lib/pubKey.js @@ -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); +} \ No newline at end of file diff --git a/src/views/mes/pro/production/components/video.vue b/src/views/mes/pro/production/components/video.vue index 11afdf5..0ae7bda 100644 --- a/src/views/mes/pro/production/components/video.vue +++ b/src/views/mes/pro/production/components/video.vue @@ -1,351 +1,495 @@ - + \ No newline at end of file diff --git a/src/views/mes/pro/production/index.vue b/src/views/mes/pro/production/index.vue index 8e62356..9e2d0a9 100644 --- a/src/views/mes/pro/production/index.vue +++ b/src/views/mes/pro/production/index.vue @@ -363,28 +363,6 @@ 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; // }); diff --git a/src/views/mes/pro/proroute/routeprocess.vue b/src/views/mes/pro/proroute/routeprocess.vue index 876b9c2..bec9b7a 100644 --- a/src/views/mes/pro/proroute/routeprocess.vue +++ b/src/views/mes/pro/proroute/routeprocess.vue @@ -381,7 +381,7 @@ @@ -548,9 +548,6 @@ export default { nextProcessId: [ { required: true, message: "工序ID不能为空", trigger: "blur" }, ], - machineryTypeId: [ - { required: true, message: "设备类型不能为空", trigger: "blur" }, - ], keyFlag: [ { required: true,