diff --git a/UI2.0/src/js/personal.js b/UI2.0/src/js/personal.js index de0040e72c3afef6e5dc5ecc33bc612ef0a9af9c..80b258794efabd212c65526400856fd864d0e7ab 100644 --- a/UI2.0/src/js/personal.js +++ b/UI2.0/src/js/personal.js @@ -51,13 +51,34 @@ export default defineComponent({ closeAddIpWin() { document.getElementById("card-addIP").style.display = "none"; document.getElementById("fade").style.display = "none"; - this.ipInfo.isConnect = false; - this.ipInfo.hint = ""; + this.cleanIpInfo() }, - deleteIp(index){ + popUpdateIpWin(index) { + document.getElementById("card-editIP").style.display = "block" + document.getElementById("fade").style.display = "block"; + this.ipInfo.ipAddrs = this.$store.state.User.ipList[index].ipAddrs + this.ipInfo.description = this.$store.state.User.ipList[index].description + }, + closeUpdateIpWin() { + document.getElementById("card-editIP").style.display = "none" + document.getElementById("fade").style.display = "none"; + this.cleanIpInfo() + }, + updateIp() { + this.$store.dispatch("updateIp", { + userId: this.$store.state.User.userInfo.userId, + ipAddrs: this.ipInfo.ipAddrs, + ipPort: this.ipInfo.ipPort, + serverUser: this.ipInfo.serverUser, + serverPassword: base64Encode(this.ipInfo.serverPassword), + description: this.ipInfo.description + }) + this.closeUpdateIpWin() + }, + deleteIp(index) { this.$store.dispatch("deleteIp", index) }, - testConnect(){ + testConnect() { if(this.ipInfo.ipAddrs == "" || this.ipInfo.ipPort == "" || this.ipInfo.serverUser == "" || this.ipInfo.serverPassword == ""){ this.ipInfo.hint = "服务器信息请填完整" @@ -78,7 +99,7 @@ export default defineComponent({ }) } }, - addNewIp(){ + addNewIp() { this.$store.dispatch("addNewip",{ userId: this.$store.state.User.userInfo.userId, ipAddrs: this.ipInfo.ipAddrs, @@ -89,7 +110,7 @@ export default defineComponent({ }) this.closeAddIpWin() }, - changeBasicInfo(){ + changeBasicInfo() { if(this.basicInfo.name == this.$store.state.User.userInfo.name && this.basicInfo.description == this.$store.state.User.userInfo.description) { this.closeWin() @@ -146,6 +167,16 @@ export default defineComponent({ console.log(err) }) }, + cleanIpInfo() { + //关闭窗口清空ip信息 + this.ipInfo.hint ="", + this.ipInfo.ipAddrs = "", + this.ipInfo.ipPort = "", + this.ipInfo.serverUser = "", + this.ipInfo.serverPassword = "", + this.ipInfo.description = "", + this.ipInfo.isConnect = false + } }, mounted() { diff --git a/UI2.0/src/pages/Personal.vue b/UI2.0/src/pages/Personal.vue index c74a4bc77aeb3848664dfac61f74dbf49fde4dc7..7070670e23a07d0ebff06a795f9facca7a98d057 100644 --- a/UI2.0/src/pages/Personal.vue +++ b/UI2.0/src/pages/Personal.vue @@ -67,7 +67,9 @@