From 9be279ae805b36eccd988806985c58776f88f9e6 Mon Sep 17 00:00:00 2001 From: unknown <1535852499@qq.com> Date: Mon, 13 Nov 2023 16:12:53 +0800 Subject: [PATCH] zyh --- src/components/CeCe.vue | 218 -------------------------- src/components/ChiDevice.vue | 3 +- src/components/ChiDevicewifi.vue | 2 +- src/components/ChiGateway.vue | 30 ++-- src/components/ChiGatewifi.vue | 22 +-- src/components/CloneView.vue | 117 ++++++++++---- src/components/CollectionView.vue | 236 ++++++++++++++++++++--------- src/components/CollectionWifi.vue | 1 + src/components/DataAcquisition.vue | 119 +++++++++++++-- src/components/DeviceVIew.vue | 137 ++++++++++++++--- src/components/DeviceWirle.vue | 1 + src/components/GateWay.vue | 115 +++++++++++--- src/components/TreeView.vue | 138 ++++++++++++----- src/store/index.js | 8 + src/views/DbCollectiongate.vue | 69 ++++++++- src/views/Index.vue | 4 +- 16 files changed, 775 insertions(+), 445 deletions(-) delete mode 100644 src/components/CeCe.vue diff --git a/src/components/CeCe.vue b/src/components/CeCe.vue deleted file mode 100644 index adffccf..0000000 --- a/src/components/CeCe.vue +++ /dev/null @@ -1,218 +0,0 @@ - \ No newline at end of file diff --git a/src/components/ChiDevice.vue b/src/components/ChiDevice.vue index 3fa03a7..8b60ecd 100644 --- a/src/components/ChiDevice.vue +++ b/src/components/ChiDevice.vue @@ -543,7 +543,7 @@ export default { this.gateWay.wgpz_wgmc = res3.wgpz_wgmc; } } - if (node.leval == 2) { + if (node.level == 2) { this.menuShow = false this.menuShow = true this.nodekey = data.id; @@ -562,7 +562,6 @@ export default { console.log(index); if (index == 1) { this.add_passage = true; - } }, foo() { diff --git a/src/components/ChiDevicewifi.vue b/src/components/ChiDevicewifi.vue index 7967c9f..7c34081 100644 --- a/src/components/ChiDevicewifi.vue +++ b/src/components/ChiDevicewifi.vue @@ -529,7 +529,7 @@ export default { this.gateWay.wgpz_wgmc = res3.wgpz_wgmc; } } - if (node.leval == 2) { + if (node.level == 2) { this.menuShow = false this.menuShow = true this.nodekey = data.id; diff --git a/src/components/ChiGateway.vue b/src/components/ChiGateway.vue index 3db6bb5..6dc53ca 100644 --- a/src/components/ChiGateway.vue +++ b/src/components/ChiGateway.vue @@ -78,6 +78,7 @@ export default { name: "TestChiGate", data() { return { + isShow: true, loading: false, user_id: "", options1: [ @@ -120,10 +121,13 @@ export default { }, }; }, - + created() { + this.isShow = false; + }, mounted() { this.user_id = window.location.href.split("?")[1]; this.GetUserAnswer(); + // this.isShow = true; }, methods: { // 登陆时进行校验 @@ -179,6 +183,7 @@ export default { } else if (data.data.step == 2) { this.$router.push(`/collectionpoint?user_id=${this.user_id}`); } else { + this.isShow = true; console.log(JSON.parse(data.data.mark_value)); let obj = JSON.parse(data.data.mark_value); if (obj.wgpz_wgid) { @@ -195,18 +200,17 @@ export default { \ No newline at end of file diff --git a/src/components/CollectionWifi.vue b/src/components/CollectionWifi.vue index 8e0932e..13062c3 100644 --- a/src/components/CollectionWifi.vue +++ b/src/components/CollectionWifi.vue @@ -749,6 +749,7 @@ export default { type: 'success' }); } + this.$router.back(); }, foo() { // 取消鼠标监听事件 菜单栏 diff --git a/src/components/DataAcquisition.vue b/src/components/DataAcquisition.vue index fd1a3a9..660c7f2 100644 --- a/src/components/DataAcquisition.vue +++ b/src/components/DataAcquisition.vue @@ -97,9 +97,54 @@ export default { ], value: "", formData: { + ippz_wangkou: "", + ippz_zwym: "", + ippz_mrwg: "", + ippz_dns_sx: "", + ippz_dns_by: "", + ippz_ip: "", + ippz_mac: "3C:2D:50:20:30:3D", wgpz_wgmc: "", wgpz_wgid: "", wgpz_wglx: "", + tdpz_tdmc: "", + tdpz_td: "", + tdpz_qdmc: "", + tdpz_ip: "", + tdpz_port: "", + tdpz_cssj: "", + tdpz_jgsj: "", + tdpz_lxsj: "", + tdpz_cfcs: "", + tdpz_watchtime: "", + tdpz_cjsylxdz: "", + tdpz_dxzkb: "", + tdpz_050F: "", + tdpz_0610: "", + sbpz_sbid: "", + sbpz_sbmc: "", + sbpz_mac: "", + sbpz_jysb: "", + sbpz_jdzxz: "", + cjdpz_tagid: "", + cjdpz_mc: "", + cjdpz_sjq: "", + cjdpz_jcqdz: "", + cjdpz_cjsjlx: "", + cjdpz_zjx: "", + cjdpz_dxsx: "", + cjdpz_beilv: "", + mqtt_qiyong: "", + mqtt_ip: "", + mqtt_port: "", + mqtt_wgsn: "", + mqtt_sssjfbzt: "", + mqtt_qos: "", + mqtt_scms: "", + mqtt_sczq: "", + mqtt_sjgl: "", + mqtt_cjd_sbmc: "", + mqtt_cjd_tagid: "", }, rules: { wgpz_wgmc: [ @@ -135,15 +180,15 @@ export default { async innerConfirm() { this.outerVisible = false; this.innerVisible = false; - let datas = sessionStorage.getItem("DB-IotLite_yx"); + // let datas = sessionStorage.getItem("DB-IotLite_yx"); // console.log(JSON.parse(datas)); - datas = { ...JSON.parse(datas), ...this.formData }; - console.log(datas); + // datas = { ...JSON.parse(datas), ...this.formData }; + // console.log(datas); let res = await SaveUserAnswer({ mark: "DB-IotLite_yx", - user_id: this.user_id, - // user_id: "USER202307301114011710", - mark_value: JSON.stringify(datas), + // user_id: this.user_id, + user_id: "USER202307301114011710", + mark_value: JSON.stringify(this.formData), step: "1", }); if (res.data.state) { @@ -151,7 +196,7 @@ export default { message: "保存成功", type: "success", }); - sessionStorage.setItem("DB-IotLite_yx", JSON.stringify(this.formData)); + // sessionStorage.setItem("DB-IotLite_yx", JSON.stringify(this.formData)); this.$router.push(`/channelconfig?user_id=${this.user_id}&firstlabel=${this.formData.wgpz_wgid}`); } else { this.$message({ @@ -166,8 +211,8 @@ export default { this.loading = true; let res2 = await GetUserAnswer({ mark: "DB-IotLite_yx", - user_id: this.user_id, - // user_id: "USER202307301114011710", + // user_id: this.user_id, + user_id: "USER202307301114011710", }); this.loading = false; console.log(res2); @@ -175,19 +220,67 @@ export default { if (res2.data.data && res2.data.state) { if (res2.data.data.step == 1) { - this.$router.push(`/channelconfig?user_id=${this.user_id}`) + this.$router.replace(`/channelconfig?user_id=${this.user_id}`) } else if (res2.data.data.step == 2) { - this.$router.push(`/dbcollectdevice?user_id=${this.user_id}`) + this.$router.replace(`/dbcollectdevice?user_id=${this.user_id}`) } else if (res2.data.data.step == 3) { - this.$router.push(`/dbcollect?user_id=${this.user_id}`) + this.$router.replace(`/dbcollect?user_id=${this.user_id}`) } else { console.log(res2.data.data.mark_value); let res3 = JSON.parse(res2.data.data.mark_value); if (res3.wgpz_wgid) { this.formData.wgpz_wgid = res3.wgpz_wgid; - console.log(this.formData.wgpz_wgid); + // console.log(this.formData.wgpz_wgid); this.formData.wgpz_wgmc = res3.wgpz_wgmc; this.formData.wgpz_wglx = res3.wgpz_wglx; + + this.formData.ippz_wangkou = res3.ippz_wangkou; + this.formData.ippz_mrwg = res3.ippz_mrwg; + this.formData.ippz_ip = res3.ippz_ip; + this.formData.zwym = res3.zwym; + this.formData.ippz_dns_sx = res3.ippz_dns_sx; + this.formData.ippz_dns_by = res3.ippz_dns_by; + this.formData.ippz_mac = res3.ippz_mac; + this.formData.tdpz_tdmc = res3.tdpz_tdmc; + this.formData.tdpz_td = res3.tdpz_td; + this.formData.tdpz_qdmc = res3.tdpz_qdmc; + this.formData.tdpz_ip = res3.tdpz_ip; + this.formData.tdpz_port = res3.tdpz_port; + this.formData.tdpz_cssj = res3.tdpz_cssj; + this.formData.tdpz_jgsj = res3.tdpz_jgsj; + this.formData.tdpz_lxsj = res3.tdpz_lxsj; + this.formData.tdpz_cfcs = res3.tdpz_cfcs; + this.formData.tdpz_watchtime = res3.tdpz_watchtime; + this.formData.tdpz_cjsylxdz = res3.tdpz_cjsylxdz; + this.formData.tdpz_dxzkb = res3.tdpz_dxzkb; + this.formData.tdpz_050F = res3.tdpz_050F; + this.formData.tdpz_0610 = res3.tdpz_0610; + this.formData.sbpz_sbid = res3.sbpz_sbid; + this.formData.sbpz_sbmc = res3.sbpz_sbmc; + this.formData.sbpz_mac = res3.sbpz_mac; + this.formData.sbpz_jysb = res3.sbpz_jysb; + this.formData.sbpz_jdzxz = res3.sbpz_jdzxz; + + this.formData.cjdpz_tagid = res3.cjdpz_tagid; + this.formData.cjdpz_mc = res3.cjdpz_mc; + this.formData.cjdpz_sjq = res3.cjdpz_sjq; + this.formData.cjdpz_jcqdz = res3.cjdpz_jcqdz; + this.formData.cjdpz_cjsjlx = res3.cjdpz_cjsjlx; + this.formData.cjdpz_zjx = res3.cjdpz_zjx; + this.formData.cjdpz_dxsx = res3.cjdpz_dxsx; + this.formData.cjdpz_beilv = res3.cjdpz_beilv; + + this.formData.mqtt_qiyong = res3.mqtt_qiyong; + this.formData.mqtt_ip = res3.mqtt_ip; + this.formData.mqtt_port = res3.mqtt_port; + this.formData.mqtt_wgsn = res3.mqtt_wgsn; + this.formData.mqtt_sssjfbzt = res3.mqtt_sssjfbzt; + this.formData.mqtt_qos = res3.mqtt_qos; + this.formData.mqtt_scms = res3.mqtt_scms; + this.formData.mqtt_sczq = res3.mqtt_sczq; + this.formData.mqtt_sjgl = res3.mqtt_sjgl; + this.formData.mqtt_cjd_sbmc = res3.mqtt_cjd_sbmc; + this.formData.mqtt_cjd_tagid = res3.mqtt_cjd_tagid; } } } diff --git a/src/components/DeviceVIew.vue b/src/components/DeviceVIew.vue index b22ca30..33aea40 100644 --- a/src/components/DeviceVIew.vue +++ b/src/components/DeviceVIew.vue @@ -85,21 +85,21 @@
- + - + - + - + @@ -128,11 +128,54 @@ export default { user_id: "", trees: [], formdata: { + ippz_wangkou: "", + ippz_zwym: "", + ippz_mrwg: "", + ippz_dns_sx: "", + ippz_dns_by: "", + ippz_ip: "", + ippz_mac: "", + wgpz_wgmc: "", + wgpz_wgid: "", + wgpz_wglx: "", + tdpz_tdmc: "", + tdpz_td: "", + tdpz_qdmc: "", + tdpz_ip: "", + tdpz_port: "", + tdpz_cssj: "", + tdpz_jgsj: "", + tdpz_lxsj: "", + tdpz_cfcs: "", + tdpz_watchtime: "", + tdpz_cjsylxdz: "", + tdpz_dxzkb: "", + tdpz_050F: "", + tdpz_0610: "", sbpz_sbid: "", sbpz_sbmc: "", sbpz_mac: "3C:2D:50:20:30:3D", sbpz_jysb: false, sbpz_jdzxz: true, + cjdpz_tagid: "", + cjdpz_mc: "", + cjdpz_sjq: "", + cjdpz_jcqdz: "", + cjdpz_cjsjlx: "", + cjdpz_zjx: "", + cjdpz_dxsx: "", + cjdpz_beilv: "", + mqtt_qiyong: "", + mqtt_ip: "", + mqtt_port: "", + mqtt_wgsn: "", + mqtt_sssjfbzt: "", + mqtt_qos: "", + mqtt_scms: "", + mqtt_sczq: "", + mqtt_sjgl: "", + mqtt_cjd_sbmc: "", + mqtt_cjd_tagid: "", }, labelPosition: "left", formLabelWidth: "116px", @@ -326,19 +369,20 @@ export default { console.log(node); if (data.editing) { this.outerVisible = true; - let res2 = await GetUserAnswer({ - mark: "DB-IotLite_yx", - user_id: this.user_id, - // user_id: "USER202307301114011710", - }); - if (res2.data.data && res2.data.state) { - console.log(res2.data.data.mark_value); - let res3 = JSON.parse(res2.data.data.mark_value); - this.gateWay.wgpz_wgid = res3.wgpz_wgid; - // console.log(this.formData.wgpz_wgid); - this.gateWay.wgpz_wgmc = res3.wgpz_wgmc; - this.gateWay.wgpz_wglx = res3.wgpz_wglx; - } + this.GetUserAnswer(); + // let res2 = await GetUserAnswer({ + // mark: "DB-IotLite_yx", + // user_id: this.user_id, + // // user_id: "USER202307301114011710", + // }); + // if (res2.data.data && res2.data.state) { + // console.log(res2.data.data.mark_value); + // let res3 = JSON.parse(res2.data.data.mark_value); + // this.gateWay.wgpz_wgid = res3.wgpz_wgid; + // // console.log(this.formData.wgpz_wgid); + // this.gateWay.wgpz_wgmc = res3.wgpz_wgmc; + // this.gateWay.wgpz_wglx = res3.wgpz_wglx; + // } } if (node.level == 4) { this.menuShow = false; @@ -366,6 +410,7 @@ export default { message: '删除成功', type: 'success' }); + this.$router.back(); } }, foo() { @@ -393,7 +438,7 @@ export default { sbpz_jysb: String(Number(this.formdata.sbpz_jysb)), sbpz_jdzxz: String(Number(this.formdata.sbpz_jdzxz)), } - datas = { ...JSON.parse(datas), ...obj }; + datas = { ...this.formdata, ...obj }; this.add_passage = false; let res = await SaveUserAnswer({ mark: "DB-IotLite_yx", @@ -439,6 +484,47 @@ export default { this.formdata.sbpz_sbmc = obj.sbpz_sbmc; this.formdata.sbpz_mac = obj.sbpz_mac; } + this.formdata.ippz_mrwg = obj.ippz_mrwg; + this.formdata.ippz_ip = obj.ippz_ip; + this.formdata.zwym = obj.zwym; + this.formdata.ippz_dns_sx = obj.ippz_dns_sx; + this.formdata.ippz_dns_by = obj.ippz_dns_by; + this.formdata.wgpz_wgmc = obj.wgpz_wgmc; + this.formdata.wgpz_wgid = obj.wgpz_wgid; + this.formdata.wgpz_wglx = obj.wgpz_wglx; + this.formdata.tdpz_tdmc = obj.tdpz_tdmc; + this.formdata.tdpz_td = obj.tdpz_td; + this.formdata.tdpz_qdmc = obj.tdpz_qdmc; + this.formdata.tdpz_ip = obj.tdpz_ip; + this.formdata.tdpz_port = obj.tdpz_port; + this.formdata.tdpz_cssj = obj.tdpz_cssj; + this.formdata.tdpz_jgsj = obj.tdpz_jgsj; + this.formdata.tdpz_lxsj = obj.tdpz_lxsj; + this.formdata.tdpz_cfcs = obj.tdpz_cfcs; + this.formdata.tdpz_watchtime = obj.tdpz_watchtime; + this.formdata.tdpz_cjsylxdz = obj.tdpz_cjsylxdz; + this.formdata.tdpz_dxzkb = obj.tdpz_dxzkb; + this.formdata.tdpz_050F = obj.tdpz_050F; + this.formdata.tdpz_0610 = obj.tdpz_0610; + this.formdata.cjdpz_tagid = obj.cjdpz_tagid; + this.formdata.cjdpz_mc = obj.cjdpz_mc; + this.formdata.cjdpz_sjq = obj.cjdpz_sjq; + this.formdata.cjdpz_jcqdz = obj.cjdpz_jcqdz; + this.formdata.cjdpz_cjsjlx = obj.cjdpz_cjsjlx; + this.formdata.cjdpz_zjx = obj.cjdpz_zjx; + this.formdata.cjdpz_dxsx = obj.cjdpz_dxsx; + this.formdata.cjdpz_beilv = obj.cjdpz_beilv; + this.formdata.mqtt_qiyong = obj.mqtt_qiyong; + this.formdata.mqtt_ip = obj.mqtt_ip; + this.formdata.mqtt_port = obj.mqtt_port; + this.formdata.mqtt_wgsn = obj.mqtt_wgsn; + this.formdata.mqtt_sssjfbzt = obj.mqtt_sssjfbzt; + this.formdata.mqtt_qos = obj.mqtt_qos; + this.formdata.mqtt_scms = obj.mqtt_scms; + this.formdata.mqtt_sczq = obj.mqtt_sczq; + this.formdata.mqtt_sjgl = obj.mqtt_sjgl; + this.formdata.mqtt_cjd_sbmc = obj.mqtt_cjd_sbmc; + this.formdata.mqtt_cjd_tagid = obj.mqtt_cjd_tagid; } }, async sendTree() { @@ -465,27 +551,28 @@ export default { async saveGates() { this.outerVisible = false; // this.innerVisible = false; - let datas = sessionStorage.getItem("DB-IotLite_yx"); + // let datas = sessionStorage.getItem("DB-IotLite_yx"); // console.log(JSON.parse(datas)); - datas = { ...JSON.parse(datas), ...this.gateWay }; - console.log(datas); + // datas = { ...JSON.parse(datas), ...this.gateWay }; + // console.log(datas); let res = await SaveUserAnswer({ mark: "DB-IotLite_yx", user_id: this.user_id, // user_id: "USER202307301114011710", - mark_value: JSON.stringify(datas), + mark_value: JSON.stringify(this.formdata), + step: "2", }); if (res.data.state) { this.$message({ message: "修改成功", type: "success", }); - this.trees[0].label = this.gateWay.wgpz_wgid; + this.trees[0].label = this.formdata.wgpz_wgid; this.sendTree(); - sessionStorage.setItem("DB-IotLite_yx", JSON.stringify(this.gateWay)); + // sessionStorage.setItem("DB-IotLite_yx", JSON.stringify(this.gateWay)); } else { this.$message({ - message: `保存失败,原因是${res.data.message}`, + message: `修改失败,原因是${res.data.message}`, type: "error", }); } diff --git a/src/components/DeviceWirle.vue b/src/components/DeviceWirle.vue index 6a7d2a0..e1a002e 100644 --- a/src/components/DeviceWirle.vue +++ b/src/components/DeviceWirle.vue @@ -400,6 +400,7 @@ export default { message: "删除成功", type: "success", }); + this.$router.back(); } }, foo() { diff --git a/src/components/GateWay.vue b/src/components/GateWay.vue index 6564d88..6dff746 100644 --- a/src/components/GateWay.vue +++ b/src/components/GateWay.vue @@ -155,13 +155,54 @@ export default { // 判断是否保存过 loading: false, formData: { - ippz_wangkou: "ETH0", + ippz_wangkou: "", ippz_zwym: "", ippz_mrwg: "", ippz_dns_sx: "", ippz_dns_by: "", ippz_ip: "", ippz_mac: "3C:2D:50:20:30:3D", + wgpz_wgmc: "", + wgpz_wgid: "", + wgpz_wglx: "", + tdpz_tdmc: "", + tdpz_td: "", + tdpz_qdmc: "", + tdpz_ip: "", + tdpz_port: "", + tdpz_cssj: "", + tdpz_jgsj: "", + tdpz_lxsj: "", + tdpz_cfcs: "", + tdpz_watchtime: "", + tdpz_cjsylxdz: "", + tdpz_dxzkb: "", + tdpz_050F: "", + tdpz_0610: "", + sbpz_sbid: "", + sbpz_sbmc: "", + sbpz_mac: "", + sbpz_jysb: "", + sbpz_jdzxz: "", + cjdpz_tagid: "", + cjdpz_mc: "", + cjdpz_sjq: "", + cjdpz_jcqdz: "", + cjdpz_cjsjlx: "", + cjdpz_zjx: "", + cjdpz_dxsx: "", + cjdpz_beilv: "", + mqtt_qiyong: "", + mqtt_ip: "", + mqtt_port: "", + mqtt_wgsn: "", + mqtt_sssjfbzt: "", + mqtt_qos: "", + mqtt_scms: "", + mqtt_sczq: "", + mqtt_sjgl: "", + mqtt_cjd_sbmc: "", + mqtt_cjd_tagid: "", }, labelPosition: "left", ippz_zwym1: "255", @@ -250,10 +291,6 @@ export default { // }, }, methods: { - getParameter(data) { - console.log(data); - this.user_id = data; - }, // 提交时的校验 submitForm() { this.$refs["formData"].validate((valid) => { @@ -418,8 +455,6 @@ export default { // 保存数据, 发送请求 async saveAll() { - // this.dialogFormVisible = false; - // this.isSaveAnswer = true; this.formData.ippz_ip = this.Merge( this.formData.ippz_ip, this.ippz_ip1, @@ -456,13 +491,15 @@ export default { this.ippz_dns_by4 ); console.log(this.formData); - sessionStorage.setItem("DB-IotLite_yx", JSON.stringify(this.formData)); + // sessionStorage.setItem("DB-IotLite_yx", JSON.stringify(this.formData)); let data = { mark: "DB-IotLite_yx", - user_id: this.user_id, + // user_id: this.user_id, + user_id: "USER202307301114011710", mark_value: JSON.stringify(this.formData), }; let res = await SaveUserAnswer(data); + console.log(res); if (res.data.state) { this.$message({ message: "保存成功", @@ -486,21 +523,22 @@ export default { this.loading = true; let res2 = await GetUserAnswer({ mark: "DB-IotLite_yx", - user_id: this.user_id, + // user_id: this.user_id, + user_id: "USER202307301114011710", }); this.loading = false; console.log(res2); if (res2.data.data && res2.data.state) { - console.log("391"); let res3 = JSON.parse(res2.data.data.mark_value); console.log(res3); - if (res3.ippz_wangkou) { - this.formData.ippz_wangkou = res3.ippz_wangkou; - } - if (res3.ippz_mac) { - this.formData.ippz_mac = res3.ippz_mac; - } + this.formData.ippz_wangkou = res3.ippz_wangkou; + if (res3.ippz_mac) { this.formData.ippz_mac = res3.ippz_mac; } if (res3.ippz_mrwg) { + this.formData.ippz_mrwg = res3.ippz_mrwg; + this.formData.ippz_ip = res3.ippz_ip; + this.formData.zwym = res3.zwym; + this.formData.ippz_dns_sx = res3.ippz_dns_sx; + this.formData.ippz_dns_by = res3.ippz_dns_by; this.ippz_mrwg1 = res3.ippz_mrwg.split(".")[0]; this.ippz_mrwg2 = res3.ippz_mrwg.split(".")[1]; this.ippz_mrwg3 = res3.ippz_mrwg.split(".")[2]; @@ -522,6 +560,49 @@ export default { this.ippz_dns_by3 = res3.ippz_dns_by.split(".")[2]; this.ippz_dns_by4 = res3.ippz_dns_by.split(".")[3]; } + this.formData.wgpz_wgmc = res3.wgpz_wgmc; + this.formData.wgpz_wgid = res3.wgpz_wgid; + this.formData.wgpz_wglx = res3.wgpz_wglx; + this.formData.tdpz_tdmc = res3.tdpz_tdmc; + this.formData.tdpz_td = res3.tdpz_td; + this.formData.tdpz_qdmc = res3.tdpz_qdmc; + this.formData.tdpz_ip = res3.tdpz_ip; + this.formData.tdpz_port = res3.tdpz_port; + this.formData.tdpz_cssj = res3.tdpz_cssj; + this.formData.tdpz_jgsj = res3.tdpz_jgsj; + this.formData.tdpz_lxsj = res3.tdpz_lxsj; + this.formData.tdpz_cfcs = res3.tdpz_cfcs; + this.formData.tdpz_watchtime = res3.tdpz_watchtime; + this.formData.tdpz_cjsylxdz = res3.tdpz_cjsylxdz; + this.formData.tdpz_dxzkb = res3.tdpz_dxzkb; + this.formData.tdpz_050F = res3.tdpz_050F; + this.formData.tdpz_0610 = res3.tdpz_0610; + this.formData.sbpz_sbid = res3.sbpz_sbid; + this.formData.sbpz_sbmc = res3.sbpz_sbmc; + this.formData.sbpz_mac = res3.sbpz_mac; + this.formData.sbpz_jysb = res3.sbpz_jysb; + this.formData.sbpz_jdzxz = res3.sbpz_jdzxz; + + this.formData.cjdpz_tagid = res3.cjdpz_tagid; + this.formData.cjdpz_mc = res3.cjdpz_mc; + this.formData.cjdpz_sjq = res3.cjdpz_sjq; + this.formData.cjdpz_jcqdz = res3.cjdpz_jcqdz; + this.formData.cjdpz_cjsjlx = res3.cjdpz_cjsjlx; + this.formData.cjdpz_zjx = res3.cjdpz_zjx; + this.formData.cjdpz_dxsx = res3.cjdpz_dxsx; + this.formData.cjdpz_beilv = res3.cjdpz_beilv; + + this.formData.mqtt_qiyong = res3.mqtt_qiyong; + this.formData.mqtt_ip = res3.mqtt_ip; + this.formData.mqtt_port = res3.mqtt_port; + this.formData.mqtt_wgsn = res3.mqtt_wgsn; + this.formData.mqtt_sssjfbzt = res3.mqtt_sssjfbzt; + this.formData.mqtt_qos = res3.mqtt_qos; + this.formData.mqtt_scms = res3.mqtt_scms; + this.formData.mqtt_sczq = res3.mqtt_sczq; + this.formData.mqtt_sjgl = res3.mqtt_sjgl; + this.formData.mqtt_cjd_sbmc = res3.mqtt_cjd_sbmc; + this.formData.mqtt_cjd_tagid = res3.mqtt_cjd_tagid; } }, }, diff --git a/src/components/TreeView.vue b/src/components/TreeView.vue index 842901f..c2530c3 100644 --- a/src/components/TreeView.vue +++ b/src/components/TreeView.vue @@ -200,21 +200,21 @@
- + - + - + - + @@ -242,6 +242,16 @@ export default { gateway: "", user_id: "", FormData: { + ippz_wangkou: "", + ippz_zwym: "", + ippz_mrwg: "", + ippz_dns_sx: "", + ippz_dns_by: "", + ippz_ip: "", + ippz_mac: "", + wgpz_wgmc: "", + wgpz_wgid: "", + wgpz_wglx: "", tdpz_tdmc: "", tdpz_td: "", tdpz_qdmc: "", @@ -255,6 +265,30 @@ export default { tdpz_dxzkb: "", tdpz_050F: "auto", tdpz_0610: "auto", + sbpz_sbid: "", + sbpz_sbmc: "", + sbpz_mac: "", + sbpz_jysb: "", + sbpz_jdzxz: "", + cjdpz_tagid: "", + cjdpz_mc: "", + cjdpz_sjq: "", + cjdpz_jcqdz: "", + cjdpz_cjsjlx: "", + cjdpz_zjx: "", + cjdpz_dxsx: "", + cjdpz_beilv: "", + mqtt_qiyong: "", + mqtt_ip: "", + mqtt_port: "", + mqtt_wgsn: "", + mqtt_sssjfbzt: "", + mqtt_qos: "", + mqtt_scms: "", + mqtt_sczq: "", + mqtt_sjgl: "", + mqtt_cjd_sbmc: "", + mqtt_cjd_tagid: "", }, tdpz_dxzkb1: "1", tdpz_dxzkb2: "1", @@ -548,19 +582,20 @@ export default { // console.log(node); if (data.editing) { this.outerVisible = true; - let res2 = await GetUserAnswer({ - mark: "DB-IotLite_yx", - user_id: this.user_id, - // user_id: "USER202307301114011710", - }); - if (res2.data.data && res2.data.state) { - console.log(res2.data.data.mark_value); - let res3 = JSON.parse(res2.data.data.mark_value); - this.gateWay.wgpz_wgid = res3.wgpz_wgid; - // console.log(this.formData.wgpz_wgid); - this.gateWay.wgpz_wgmc = res3.wgpz_wgmc; - this.gateWay.wgpz_wglx = res3.wgpz_wglx; - } + // let res2 = await GetUserAnswer({ + // mark: "DB-IotLite_yx", + // user_id: this.user_id, + // // user_id: "USER202307301114011710", + // }); + // if (res2.data.data && res2.data.state) { + // console.log(res2.data.data.mark_value); + // let res3 = JSON.parse(res2.data.data.mark_value); + // this.gateWay.wgpz_wgid = res3.wgpz_wgid; + // // console.log(this.formData.wgpz_wgid); + // this.gateWay.wgpz_wgmc = res3.wgpz_wgmc; + // this.gateWay.wgpz_wglx = res3.wgpz_wglx; + // } + this.GetUserAnswer(); } if (node.level == 3) { this.nodekey = data.id; @@ -633,8 +668,11 @@ export default { tdpz_050F: this.FormData.tdpz_050F, tdpz_0610: this.FormData.tdpz_0610, }; - let datas = sessionStorage.getItem("DB-IotLite_yx"); - datas = { ...JSON.parse(datas), ...obj }; + // let datas = sessionStorage.getItem("DB-IotLite_yx"); + // datas = { ...JSON.parse(datas), ...obj }; + console.log(this.FormData); + let datas = { ...this.FormData, ...obj }; + console.log(datas); let res = await SaveUserAnswer({ mark: "DB-IotLite_yx", // user_id: "USER202307301114011710", @@ -642,13 +680,14 @@ export default { mark_value: JSON.stringify(datas), step: "2", }); + console.log(res); if (res.data.state) { this.$message({ message: "保存成功", type: "success", }); - sessionStorage.setItem("DB-IotLite_yx", JSON.stringify(datas)); - console.log(res); + // sessionStorage.setItem("DB-IotLite_yx", JSON.stringify(datas)); + this.add_passage = false; // console.log(res.data.data.mark_value); // this.$nextTick(() => { @@ -692,23 +731,21 @@ export default { if (obj.tdpz_dxzkb) { this.tdpz_dxzkb1 = obj.tdpz_dxzkb.split(":")[0]; this.tdpz_dxzkb2 = obj.tdpz_dxzkb.split(":")[1]; + this.FormData.tdpz_dxzkb = obj.tdpz_dxzkb; } this.FormData.tdpz_watchtime = Boolean(Number(obj.tdpz_watchtime)); if (obj.tdpz_cjsylxdz) { this.FormData.tdpz_cjsylxdz = Boolean(Number(obj.tdpz_cjsylxdz)); } if (obj.tdpz_ip) { + this.FormData.tdpz_ip = obj.tdpz_ip; this.tdpz_ip1 = obj.tdpz_ip.split(".")[0]; this.tdpz_ip2 = obj.tdpz_ip.split(".")[1]; this.tdpz_ip3 = obj.tdpz_ip.split(".")[2]; this.tdpz_ip4 = obj.tdpz_ip.split(".")[3]; } - if (obj.tdpz_tdmc) { - this.FormData.tdpz_tdmc = obj.tdpz_tdmc; - } - if (obj.tdpz_td) { - this.FormData.tdpz_td = obj.tdpz_td; - } + this.FormData.tdpz_tdmc = obj.tdpz_tdmc; + this.FormData.tdpz_td = obj.tdpz_td; this.FormData.tdpz_qdmc = obj.tdpz_qdmc; if (obj.tdpz_050F) { this.FormData.tdpz_050F = obj.tdpz_050F; @@ -721,6 +758,38 @@ export default { this.FormData.tdpz_jgsj = obj.tdpz_jgsj; this.FormData.tdpz_lxsj = obj.tdpz_lxsj; this.FormData.tdpz_cfcs = obj.tdpz_cfcs; + this.FormData.ippz_mrwg = obj.ippz_mrwg; + this.FormData.ippz_ip = obj.ippz_ip; + this.FormData.zwym = obj.zwym; + this.FormData.ippz_dns_sx = obj.ippz_dns_sx; + this.FormData.ippz_dns_by = obj.ippz_dns_by; + this.FormData.wgpz_wgmc = obj.wgpz_wgmc; + this.FormData.wgpz_wgid = obj.wgpz_wgid; + this.FormData.wgpz_wglx = obj.wgpz_wglx; + this.FormData.sbpz_sbid = obj.sbpz_sbid; + this.FormData.sbpz_sbmc = obj.sbpz_sbmc; + this.FormData.sbpz_mac = obj.sbpz_mac; + this.FormData.sbpz_jysb = obj.sbpz_jysb; + this.FormData.sbpz_jdzxz = obj.sbpz_jdzxz; + this.FormData.cjdpz_tagid = obj.cjdpz_tagid; + this.FormData.cjdpz_mc = obj.cjdpz_mc; + this.FormData.cjdpz_sjq = obj.cjdpz_sjq; + this.FormData.cjdpz_jcqdz = obj.cjdpz_jcqdz; + this.FormData.cjdpz_cjsjlx = obj.cjdpz_cjsjlx; + this.FormData.cjdpz_zjx = obj.cjdpz_zjx; + this.FormData.cjdpz_dxsx = obj.cjdpz_dxsx; + this.FormData.cjdpz_beilv = obj.cjdpz_beilv; + this.FormData.mqtt_qiyong = obj.mqtt_qiyong; + this.FormData.mqtt_ip = obj.mqtt_ip; + this.FormData.mqtt_port = obj.mqtt_port; + this.FormData.mqtt_wgsn = obj.mqtt_wgsn; + this.FormData.mqtt_sssjfbzt = obj.mqtt_sssjfbzt; + this.FormData.mqtt_qos = obj.mqtt_qos; + this.FormData.mqtt_scms = obj.mqtt_scms; + this.FormData.mqtt_sczq = obj.mqtt_sczq; + this.FormData.mqtt_sjgl = obj.mqtt_sjgl; + this.FormData.mqtt_cjd_sbmc = obj.mqtt_cjd_sbmc; + this.FormData.mqtt_cjd_tagid = obj.mqtt_cjd_tagid; } }, async sendTree() { @@ -748,27 +817,28 @@ export default { async saveGates() { this.outerVisible = false; // this.innerVisible = false; - let datas = sessionStorage.getItem("DB-IotLite_yx"); + // let datas = sessionStorage.getItem("DB-IotLite_yx"); // console.log(JSON.parse(datas)); - datas = { ...JSON.parse(datas), ...this.gateWay }; - console.log(datas); + // datas = { ...JSON.parse(datas), ...this.gateWay }; + // console.log(datas); let res = await SaveUserAnswer({ mark: "DB-IotLite_yx", user_id: this.user_id, // user_id: "USER202307301114011710", - mark_value: JSON.stringify(datas), + mark_value: JSON.stringify(this.FormData), + step: "1", }); if (res.data.state) { this.$message({ message: "修改成功", type: "success", }); - this.trees[0].label = this.gateWay.wgpz_wgid; + this.trees[0].label = this.FormData.wgpz_wgid; this.sendTree(); - sessionStorage.setItem("DB-IotLite_yx", JSON.stringify(this.gateWay)); + // sessionStorage.setItem("DB-IotLite_yx", JSON.stringify(this.gateWay)); } else { this.$message({ - message: `保存失败,原因是${res.data.message}`, + message: `修改失败,原因是${res.data.message}`, type: "error", }); } diff --git a/src/store/index.js b/src/store/index.js index ac9f4c4..bf1e074 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -7,6 +7,8 @@ export default new Vuex.Store({ state: { tree: JSON.parse(localStorage.getItem("tree")), type: "", + currentComponent: "", + user_id: "USER202307301114011710", }, mutations: { setTree(state, a) { @@ -16,6 +18,12 @@ export default new Vuex.Store({ setType(state, a) { state.type = a; }, + changeComPonent(state, a) { + state.currentComponent = a; + }, + saveUserID(state, a) { + state.user_id = a; + } }, actions: {}, }); diff --git a/src/views/DbCollectiongate.vue b/src/views/DbCollectiongate.vue index f0c4b8e..58509ed 100644 --- a/src/views/DbCollectiongate.vue +++ b/src/views/DbCollectiongate.vue @@ -1,6 +1,6 @@ @@ -8,25 +8,80 @@ import DataAcquisition from '@/components/DataAcquisition.vue'; export default { name: 'InternetCompetitionDbCollectiongate', - components:{ + components: { DataAcquisition }, data() { return { - + }; }, mounted() { - + }, methods: { - + }, }; - + \ No newline at end of file diff --git a/src/views/Index.vue b/src/views/Index.vue index 2ed5a57..5b7978b 100644 --- a/src/views/Index.vue +++ b/src/views/Index.vue @@ -45,15 +45,17 @@ 网络优化-网关维护
+