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 @@ {{item.ipAddrs}} {{item.description}} - + + | + @@ -75,7 +77,7 @@ - + @@ -233,6 +235,75 @@ + + +
修改IP信息
+
+
+
+
+ + ip地址 + + +
+
+ + ip端口 + + +
+
+ + 登陆用户名 + +
+
+ + 登陆密码 + +
+
+ 备注 + +
+

{{ ipInfo.hint }}

+
+ +
+ + +
+
diff --git a/UI2.0/src/store/user/userInfo.js b/UI2.0/src/store/user/userInfo.js index e54974be3444e04ea603886ae7370016991bab63..a96f2618e763317460b27dda4732c50b3ce6e5ec 100644 --- a/UI2.0/src/store/user/userInfo.js +++ b/UI2.0/src/store/user/userInfo.js @@ -50,6 +50,14 @@ const User = { } }) }, + updateIp({dispatch}, ipInfo) { + axios("/v1/UI/user/updateIp", ipInfo, "post").then(res => { + res = JSON.parse(res) + if(res.success) { + dispatch("getIpListFromBackend") + } + }) + }, deleteIp({state, dispatch}, index) { axios("/v1/UI/user/deleteIp", { userId: state.userInfo.userId,