From 13fdb067fc3d752e8bd278de539fb2de40fe8397 Mon Sep 17 00:00:00 2001
From: lixuliang <lixuliang_hd@126.com>
Date: 星期五, 10 十一月 2023 18:20:33 +0800
Subject: [PATCH] 土地管理弹窗、工具栏整合、功能点击响应

---
 src/components/right/right-top.vue |  170 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 168 insertions(+), 2 deletions(-)

diff --git a/src/components/right/right-top.vue b/src/components/right/right-top.vue
index a89411d..0be5280 100644
--- a/src/components/right/right-top.vue
+++ b/src/components/right/right-top.vue
@@ -1,13 +1,57 @@
 <template>
   <div class="trigger" style="margin-top: 140px; margin-right: 10px">
-    <div class="user" @click="showLayer()">
+    <div class="user">
       <el-avatar
         class="user_btn"
         :size="70.6"
         icon="el-icon-user-solid"
         alt="涓汉涓績"
       ></el-avatar>
+      <div class="transition-box">
+        <ul>
+          <li @click="showLayer()">鏍囩粯鏁版嵁</li>
+          <li @click="dialogFormVisible = true">淇敼瀵嗙爜</li>
+        </ul>
+      </div>
     </div>
+    <el-dialog
+      append-to-body
+      title="淇敼瀵嗙爜"
+      :visible.sync="dialogFormVisible"
+      width="30%"
+      :close-on-click-modal="false"
+      custom-class="psdDialog"
+    >
+      <el-form :model="form" ref="pwdForm" :rules="rules">
+        <el-form-item label="鍘熷瘑鐮�">
+          <el-input
+            show-password
+            v-model="form.oldPassword"
+            autocomplete="off"
+          ></el-input>
+        </el-form-item>
+
+        <el-form-item label="鏂板瘑鐮�" prop="newPassword">
+          <el-input
+            show-password
+            v-model="form.newPassword"
+            autocomplete="off"
+          ></el-input>
+        </el-form-item>
+
+        <el-form-item label="纭瀵嗙爜" prop="checkPassword">
+          <el-input
+            show-password
+            v-model="form.checkPassword"
+            autocomplete="off"
+          ></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="closeDig('pwdForm')">鍙� 娑�</el-button>
+        <el-button type="primary" @click="onSubmit('pwdForm')">纭� 瀹�</el-button>
+      </div>
+    </el-dialog>
     <div class="rightTool">
       <el-button @click="showInput">
         <img class="searchBg" src="@/assets/img/new/leftCircle.png" />
@@ -339,6 +383,7 @@
   pointer-events: all;
   margin: 0 auto;
 }
+
 .user_menu {
   right: 10px;
   top: 100px;
@@ -349,7 +394,54 @@
   margin-top: 0px !important;
   /* border-radius: 3px !important; */
 }
-
+.user:hover .transition-box {
+  display: block;
+}
+.transition-box {
+  display: none;
+  width: 130px;
+  height: 90px;
+  position: relative;
+  left: -50px;
+  border-radius: 4px;
+  background: rgba(14, 50, 143, 0.6);
+  text-align: center;
+  color: #fff;
+  padding: 10px;
+  box-sizing: border-box;
+}
+.transition-box ul li {
+  /* min-width: 154px; */
+  height: 35px;
+  text-align: center;
+  line-height: 35px;
+}
+.transition-box ul li:hover {
+  background: rgba(18, 80, 172, 0.6);
+  box-shadow: 0px 0px 10px 5px rgba(0, 132, 255, 0.7) inset;
+}
+.psdDialog .el-form-item {
+  margin-bottom: 0px;
+}
+/* .psdDialog,
+.psdDialog /deep/ .el-pager li {
+	background-color: rgba(255, 0, 0, 0.0);
+	color: #FFFFFF;
+}
+.psdDialog /deep/ .el-dialog__header {
+	padding-top: 10px !important;
+	background-color:rgb(255,255,255,0);
+	border-radius: 14px 14px  0  0 ;
+}
+.psdDialog /deep/ .el-dialog__body {
+	border-top: 0 !important;
+	background-color: rgba(19, 31, 59, 0);
+	color: #FFFFFF;
+}
+.psdDialog /deep/ .el-dialog__footer{
+	text-align: center;
+	background-color: rgba(255,255,255,0);
+} */
 .pointInfoBoxContext {
   position: relative;
   /*right: 12px;*/
@@ -668,6 +760,8 @@
 </style>
 
 <script>
+import { getUserInfo, updateUserPwd } from "@/api/api";
+import qs from "qs";
 import axios from "axios";
 import location from "@/components/right/tools/location";
 import plotting from "@/components/right/tools/plotting";
@@ -704,7 +798,30 @@
   },
   name: "right-top",
   data() {
+    let checkpass = (rule, value, callback) => {
+      if (value == this.form.newPassword) {
+        callback();
+      } else {
+        callback(new Error("瀵嗙爜涓嶄竴鑷�"));
+      }
+    };
     return {
+      rules: {
+        newPassword: [
+          { required: true, message: "璇疯緭鍏ユ柊瀵嗙爜", trigger: "blur" },
+        ],
+        checkPassword: [
+          { required: true, message: "涓嶈兘涓虹┖", trigger: "blur" },
+          { validator: checkpass, trigger: "blur" },
+        ],
+      },
+      dialogFormVisible: false,
+      nickName: "鐢ㄦ埛",
+      form: {
+        oldPassword: "",
+        newPassword: "",
+        checkPassword: "",
+      },
       resBypoi: [],
       expands: [],
       showRangeBox: false,
@@ -811,6 +928,55 @@
   },
   methods: {
     ...mapMutations(["setViewer1Show", "setYqfk"]),
+    onSubmit(formName) {
+      this.$refs[formName].validate((valid) => {
+        if (valid) {
+          let pwdItem = {
+            newPassword: this.form.newPassword,
+            oldPassword: this.form.oldPassword,
+          };
+
+          const options = {
+            method: "PUT",
+            headers: {
+              "content-type": "application/x-www-form-urlencoded",
+              Authorization: window.localStorage.getItem("TokenKey"),
+            },
+            data: qs.stringify(pwdItem),
+            url: "http://10.10.4.116:8089/system/user/profile/updatePwd",
+          };
+          axios(options).then((res) => {
+            if (res.data.code != 200) {
+              this.$message.error(res.data.msg);
+            } else {
+              this.$message({
+                message: res.data.msg,
+                type: "success",
+              });
+              this.form.newPassword = "";
+              this.form.oldPassword = "";
+              this.form.checkPassword = "";
+              this.dialogFormVisible = false;
+              setTimeout(() => {
+                localStorage.removeItem("TokenKey");
+                localStorage.removeItem("TokenTime");
+                this.$router.push("/login");
+              }, 3000);
+            }
+          });
+        } else {
+          alert("楠岃瘉涓嶉�氳繃");
+          return false;
+        }
+      });
+    },
+    closeDig(formName) {
+      this.form.newPassword = "";
+      this.form.oldPassword = "";
+      this.form.checkPassword = "";
+      this.dialogFormVisible = false;
+      this.$refs[formName].resetFields();
+    },
     /*鍒嗗眰鍒嗘埛*/
     fcfhpick(open) {
       if (open) {

--
Gitblit v1.9.3