From 077248470c98d9df3adcb31cc1e7f018540df107 Mon Sep 17 00:00:00 2001 From: lll Date: Thu, 9 Nov 2023 20:47:24 +0800 Subject: [PATCH] 11 --- src/components/AddPolicy.vue | 96 +- src/components/CloneView.vue | 186 +- src/components/GatewayConfiguration.vue | 4 +- src/components/GatewayMaintenance.vue | 4 +- src/components/IpConfiguration.vue | 26 +- src/components/NetworkConfiguration.vue | 6 +- src/components/NetworkManagement.vue | 8 +- src/components/ObjectManagement.vue | 12 +- src/components/PolicyManagement.vue | 10 +- src/components/PortConfiguration.vue | 4 +- src/components/SerialPort.vue | 2207 +++++++++++++---------- src/components/Wireles.vue | 5 +- src/components/netConfiguration.vue | 4 +- 13 files changed, 1488 insertions(+), 1084 deletions(-) diff --git a/src/components/AddPolicy.vue b/src/components/AddPolicy.vue index b209435..7f16d3c 100644 --- a/src/components/AddPolicy.vue +++ b/src/components/AddPolicy.vue @@ -935,8 +935,8 @@ export default { //拿缓存数据 var json = JSON.parse(sessionStorage.getItem("GYWZ_yx")); let { data } = await SaveUserAnswer({ - mark: "GYWZ_yx", - user_id: "USER202307301114011710", + mark: `${this.$store.state.type}`, + user_id: `${this.$route.query.id}`, mark_value: JSON.stringify({ ...json, ...obj }), }); if (data.state) { @@ -951,48 +951,50 @@ export default { //获取缓存数据 async GetUserAnswer() { let { data } = await GetUserAnswer({ - mark: "GYWZ_yx", - user_id: "USER202307301114011710", + mark: `${this.$store.state.type}`, + user_id: `${this.$route.query.id}`, }); - let res = JSON.parse(data.data.mark_value); - if (res.clgl_ckip) { - this.ruleForm1.clgl_ckip1 = res.clgl_ckip.split(".")[0]; - this.ruleForm1.clgl_ckip2 = res.clgl_ckip.split(".")[1]; - this.ruleForm1.clgl_ckip3 = res.clgl_ckip.split(".")[2]; - this.ruleForm1.clgl_ckip4 = res.clgl_rkip.split(".")[3]; - this.ruleForm1.clgl_rkip1 = res.clgl_rkip.split(".")[0]; - this.ruleForm1.clgl_rkip2 = res.clgl_rkip.split(".")[1]; - this.ruleForm1.clgl_rkip3 = res.clgl_rkip.split(".")[2]; - this.ruleForm1.clgl_rkip4 = res.clgl_rkip.split(".")[3]; - this.ruleForm1.clgl_rkwg1 = res.clgl_rkwg.split(".")[0]; - this.ruleForm1.clgl_rkwg2 = res.clgl_rkwg.split(".")[1]; - this.ruleForm1.clgl_rkwg3 = res.clgl_rkwg.split(".")[2]; - this.ruleForm1.clgl_rkwg4 = res.clgl_rkwg.split(".")[3]; - this.ruleForm1.clgl_ckwg1 = res.clgl_ckwg.split(".")[0]; - this.ruleForm1.clgl_ckwg2 = res.clgl_ckwg.split(".")[1]; - this.ruleForm1.clgl_ckwg3 = res.clgl_ckwg.split(".")[2]; - this.ruleForm1.clgl_ckwg4 = res.clgl_ckwg.split(".")[3]; - this.ruleForm1.clgl_name = res.clgl_name; - this.ruleForm1.clgl_xy = res.clgl_xy; - this.ruleForm1.clgl_gzms = res.clgl_gzms; - this.ruleForm1.clgl_mddk = res.clgl_mddk; - this.ruleForm1.clgl_ydx = res.clgl_ydx; - this.ruleForm1.clgl_ydk = res.clgl_ydk; - this.ruleForm1.clgl_mddk = res.clgl_mddk; - this.ruleForm1.clgl_dldk = res.clgl_dldk; - this.ruleForm1.clgl_rkwk = res.clgl_rkwk; - this.ruleForm1.clgl_wdyml = res.clgl_wdyml; - this.ruleForm1.clgl_ckwk = res.clgl_ckwk; - this.tableData1 = [ - { - cmdlist_ml: res.cmdlist_ml, - cmdlist_sbid: res.cmdlist_sbid, - cmdlist_qsdz: res.cmdlist_qsdz, - cmdlist_dzcd: res.cmdlist_dzcd, - cmdlist_ms: res.cmdlist_ms, - cmdlist_dz: res.cmdlist_dz, - }, - ]; + if (data.data && data.state) { + let res = JSON.parse(data.data.mark_value); + if (res.clgl_ckip) { + this.ruleForm1.clgl_ckip1 = res.clgl_ckip.split(".")[0]; + this.ruleForm1.clgl_ckip2 = res.clgl_ckip.split(".")[1]; + this.ruleForm1.clgl_ckip3 = res.clgl_ckip.split(".")[2]; + this.ruleForm1.clgl_ckip4 = res.clgl_rkip.split(".")[3]; + this.ruleForm1.clgl_rkip1 = res.clgl_rkip.split(".")[0]; + this.ruleForm1.clgl_rkip2 = res.clgl_rkip.split(".")[1]; + this.ruleForm1.clgl_rkip3 = res.clgl_rkip.split(".")[2]; + this.ruleForm1.clgl_rkip4 = res.clgl_rkip.split(".")[3]; + this.ruleForm1.clgl_rkwg1 = res.clgl_rkwg.split(".")[0]; + this.ruleForm1.clgl_rkwg2 = res.clgl_rkwg.split(".")[1]; + this.ruleForm1.clgl_rkwg3 = res.clgl_rkwg.split(".")[2]; + this.ruleForm1.clgl_rkwg4 = res.clgl_rkwg.split(".")[3]; + this.ruleForm1.clgl_ckwg1 = res.clgl_ckwg.split(".")[0]; + this.ruleForm1.clgl_ckwg2 = res.clgl_ckwg.split(".")[1]; + this.ruleForm1.clgl_ckwg3 = res.clgl_ckwg.split(".")[2]; + this.ruleForm1.clgl_ckwg4 = res.clgl_ckwg.split(".")[3]; + this.ruleForm1.clgl_name = res.clgl_name; + this.ruleForm1.clgl_xy = res.clgl_xy; + this.ruleForm1.clgl_gzms = res.clgl_gzms; + this.ruleForm1.clgl_mddk = res.clgl_mddk; + this.ruleForm1.clgl_ydx = res.clgl_ydx; + this.ruleForm1.clgl_ydk = res.clgl_ydk; + this.ruleForm1.clgl_mddk = res.clgl_mddk; + this.ruleForm1.clgl_dldk = res.clgl_dldk; + this.ruleForm1.clgl_rkwk = res.clgl_rkwk; + this.ruleForm1.clgl_wdyml = res.clgl_wdyml; + this.ruleForm1.clgl_ckwk = res.clgl_ckwk; + this.tableData1 = [ + { + cmdlist_ml: res.cmdlist_ml, + cmdlist_sbid: res.cmdlist_sbid, + cmdlist_qsdz: res.cmdlist_qsdz, + cmdlist_dzcd: res.cmdlist_dzcd, + cmdlist_ms: res.cmdlist_ms, + cmdlist_dz: res.cmdlist_dz, + }, + ]; + } } }, //新增命令-保存 @@ -1018,8 +1020,8 @@ export default { //拿缓存数据 var json = JSON.parse(sessionStorage.getItem("GYWZ_yx")); let { data } = await SaveUserAnswer({ - mark: "GYWZ_yx", - user_id: "USER202307301114011710", + mark: `${this.$store.state.type}`, + user_id: `${this.$route.query.id}`, mark_value: JSON.stringify({ ...json, ...obj }), }); if (data.state) { @@ -1044,8 +1046,8 @@ export default { obj.cmdlist_dz = ""; localStorage.setItem("GYWZ_yx", JSON.stringify(obj)); let { data } = await SaveUserAnswer({ - mark: "GYWZ_yx", - user_id: "USER202307301114011710", + mark: `${this.$store.state.type}`, + user_id: `${this.$route.query.id}`, mark_value: JSON.stringify(obj), }); if (data.state) { diff --git a/src/components/CloneView.vue b/src/components/CloneView.vue index 4ade20c..8b174ed 100644 --- a/src/components/CloneView.vue +++ b/src/components/CloneView.vue @@ -4,15 +4,30 @@
- + @@ -28,7 +43,12 @@ MQTT Client - + @@ -38,30 +58,50 @@ - + - + . - + . - + . - + @@ -70,29 +110,63 @@ - - + + - - + + - + - + - - + + @@ -107,19 +181,39 @@ - - + + - - + + - + @@ -148,16 +242,24 @@ @@ -168,8 +270,14 @@
- + 保 存 @@ -492,6 +600,9 @@ export default { this.getTree(); let that = this; window.getParameter = that.getParameter; + this.loading = true; + this.GetUserAnswer(); + this.loading = false; }, methods: { //编辑 @@ -623,16 +734,16 @@ export default { user_id: "USER202307301114011710", data: JSON.stringify(this.trees), type: "1", - }) + }); console.log(result); }, async getTree() { - console.log("12341") - let res = await GetTree({ user_id: "USER202307301114011710", type: "1", }) + console.log("12341"); + let res = await GetTree({ user_id: "USER202307301114011710", type: "1" }); console.log(res); console.log(JSON.parse(res.data.data.data)); this.trees = JSON.parse(res.data.data.data); - } + }, }, directives: { "click-outside": { @@ -660,11 +771,6 @@ export default { }, }, }, - created() { - this.loading = true; - this.GetUserAnswer(); - this.loading = false; - }, }; diff --git a/src/components/GatewayConfiguration.vue b/src/components/GatewayConfiguration.vue index 5b13f3e..c360aef 100644 --- a/src/components/GatewayConfiguration.vue +++ b/src/components/GatewayConfiguration.vue @@ -252,7 +252,7 @@ export default { async GetUserAnswer() { let { data } = await GetUserAnswer({ mark: "YDPZYM_wgpz", - user_id: "USER202307301114011710", + user_id: `${this.user_id}`, }); console.log(data.data); if (data.data && data.state) { @@ -263,7 +263,7 @@ export default { async SaveUserAnswer() { let { data } = await SaveUserAnswer({ mark: "YDPZYM_wgpz", - user_id: "USER202307301114011710", + user_id: `${this.user_id}`, mark_value: JSON.stringify(this.wgpz), }); if (data.state) { diff --git a/src/components/GatewayMaintenance.vue b/src/components/GatewayMaintenance.vue index 8958efb..0437f03 100644 --- a/src/components/GatewayMaintenance.vue +++ b/src/components/GatewayMaintenance.vue @@ -266,7 +266,7 @@ export default { async GetUserAnswer() { let { data } = await GetUserAnswer({ mark: "YDPZYM_wgwh", - user_id: "USER202307301114011710", + user_id: `${this.user_id}`, }); console.log(data); if (data.data && data.state) { @@ -329,7 +329,7 @@ export default { async SaveUserAnswer() { let { data } = await SaveUserAnswer({ mark: "YDPZYM_wgwh", - user_id: "USER202307301114011710", + user_id: `${this.user_id}`, mark_value: JSON.stringify(this.tableData), }); if (data.state) { diff --git a/src/components/IpConfiguration.vue b/src/components/IpConfiguration.vue index e9768f2..833c173 100644 --- a/src/components/IpConfiguration.vue +++ b/src/components/IpConfiguration.vue @@ -1,11 +1,22 @@