From 8d2f239788fecf1d4c62748fce718f6d74355ddc Mon Sep 17 00:00:00 2001 From: jay <75509151@qq.com> Date: Sun, 26 Feb 2023 20:52:29 +0800 Subject: [PATCH 1/3] =?UTF-8?q?update=20vue=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 841a5f7..3f19cc5 100755 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "babel-eslint": "^10.1.0", "eslint": "^6.7.2", "eslint-plugin-vue": "^6.2.2", - "vue-template-compiler": "^2.6.11" + "vue-template-compiler": "2.6.14" }, "eslintConfig": { "root": true, -- Gitee From 2bb189d44a029c0a99507f921308dac3b2dab0d5 Mon Sep 17 00:00:00 2001 From: jay <75509151@qq.com> Date: Tue, 28 Feb 2023 10:43:58 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=BD=AC=E6=8D=A2?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/protocolApi.js | 2 +- src/views/protocol/Convertors.vue | 30 ++++++++++++++++++++++++------ 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/api/protocolApi.js b/src/api/protocolApi.js index 2ae0962..4d1204c 100755 --- a/src/api/protocolApi.js +++ b/src/api/protocolApi.js @@ -51,7 +51,7 @@ export const ConverterDelete = (id) => { }; // 保存转换脚本 export const ConverterScriptSave = (params) => { - return json("post", "/protocol/saveConverterScript/"+params.id, params.script) + return json("post", "/protocol/saveConverterScript/"+params.id, params) }; //获取组件脚本 export const ConverterScriptGet = (id) =>{ diff --git a/src/views/protocol/Convertors.vue b/src/views/protocol/Convertors.vue index 36ccbc7..628f972 100755 --- a/src/views/protocol/Convertors.vue +++ b/src/views/protocol/Convertors.vue @@ -114,12 +114,27 @@ width="80%" @click="closeDialog" > + + + 脚本语言: + + + + 转换脚本: -
new (function () {
- -
})()
+
+
new (function () {
+ +
})()
+
+
+ + + +
+
  @@ -262,15 +277,18 @@ export default { ConverterScriptGet(row.id).then((res) => { this.editScriptVisible = true; this.editScript.id = row.id; - if (!res) { - res = `this.decode = function (msg) { + if(!res.typ){ + res.typ = "js"; + } + if (!res.script) { + res.script = `this.decode = function (msg) { return null; }; this.encode = function (service,device) { return null; }`; } - this.editScript = { id: row.id, script: res }; + this.editScript = res; this.testDataScript.script = localStorage.getItem("testDataScript2_" + row.id) || "{}"; load.close(); -- Gitee From 3f0757bde32a33efc97624df0d09613a79537fa2 Mon Sep 17 00:00:00 2001 From: jay <75509151@qq.com> Date: Thu, 2 Mar 2023 15:38:00 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E7=BB=84=E4=BB=B6=E8=84=9A=E6=9C=AC-?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=84=9A=E6=9C=AC=E7=B1=BB=E5=9E=8Bjs,graalj?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/protocolApi.js | 2 +- src/views/protocol/Components.vue | 20 +++++++++++++++++--- src/views/protocol/Convertors.vue | 1 - 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/api/protocolApi.js b/src/api/protocolApi.js index 4d1204c..7e381f2 100755 --- a/src/api/protocolApi.js +++ b/src/api/protocolApi.js @@ -21,7 +21,7 @@ export const ComponentDelete = (id) => { }; // 保存组件脚本 export const ComponentScriptSave = (params) => { - return json("post", "/protocol/saveComponentScript/"+params.id, params.script) + return json("post", "/protocol/saveComponentScript/"+params.id, params) }; //获取组件脚本 export const ComponentScriptGet = (id) =>{ diff --git a/src/views/protocol/Components.vue b/src/views/protocol/Components.vue index afc56b0..dae135c 100755 --- a/src/views/protocol/Components.vue +++ b/src/views/protocol/Components.vue @@ -447,16 +447,27 @@ 通讯脚本:退出全屏 +
+ 脚本语言: + + +
new (function () {
})()
+ 通讯脚本:全屏 +
+ 脚本语言: + + +
new (function () {
@@ -673,12 +684,15 @@ export default { ComponentScriptGet(row.id).then((res) => { this.editScriptVisible = true; this.editScript.id = row.id; - if (!res) { - res = `this.onReceive = function (head,type,payload) { + if(!res.scriptTyp){ + res.scriptTyp = "js"; + } + if (!res.script) { + res.script = `this.onReceive = function (head,type,payload) { return null; };`; } - this.editScript = { id: row.id, script: res }; + this.editScript = { id: row.id, script: res.script , scriptTyp: res.scriptTyp}; this.testDataScript.script = localStorage.getItem("testDataScript_" + row.id) || "{}"; load.close(); diff --git a/src/views/protocol/Convertors.vue b/src/views/protocol/Convertors.vue index 628f972..a902ee5 100755 --- a/src/views/protocol/Convertors.vue +++ b/src/views/protocol/Convertors.vue @@ -119,7 +119,6 @@ 脚本语言: - -- Gitee