From 18fcb8ad28f583e3e1b99b23e4f7d9e1833dcd83 Mon Sep 17 00:00:00 2001
From: pengwei <2071057782@qq.com>
Date: 星期三, 12 三月 2025 14:16:30 +0800
Subject: [PATCH] 最新提交

---
 项目代码/client/src/views/system/UserInfo.vue |   70 +++++++++++++++++++++++++----------
 1 files changed, 50 insertions(+), 20 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/client/src/views/system/UserInfo.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/client/src/views/system/UserInfo.vue"
index 67fc668..e678d73 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/client/src/views/system/UserInfo.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/client/src/views/system/UserInfo.vue"
@@ -42,7 +42,9 @@
         <el-row :gutter="2" style="height: 2.2rem">
           <el-col :span="3">
             <el-form-item label="鐧诲綍璐﹀彿:">
-              <span style="font-size: 1rem; font-weight: bold">dsfuis</span>
+              <span style="font-size: 1rem; font-weight: bold">{{
+                userInfo.userName
+              }}</span>
             </el-form-item>
           </el-col>
           <el-col :span="3"
@@ -101,7 +103,7 @@
               </template>
               <el-input
                 size="small"
-                v-model="form.name"
+                v-model="form.userName"
                 placeholder="璇疯緭鍏�"
                 style="width: 18.375rem"
               />
@@ -122,14 +124,14 @@
                 >
               </template>
               <el-input
-                v-model="form.name"
+                v-model="form.phoneNo"
                 size="small"
                 placeholder="璇疯緭鍏�"
                 style="width: 18.375rem"
               /> </el-form-item
           ></el-col>
         </el-row>
-        <el-form-item  label-position="top">
+        <el-form-item label-position="top">
           <template #label>
             <div style="display: flex; align-items: flex-end">
               <span style="color: red; margin-right: 0.2rem">*</span>
@@ -150,6 +152,7 @@
             action="#"
             list-type="picture-card"
             :auto-upload="false"
+            :limit="3"
           >
             <el-icon><Plus /></el-icon>
 
@@ -208,10 +211,10 @@
       <template #title>
         <div style="font-size: 1.25rem; font-weight: bold">瀵嗙爜淇敼</div>
       </template>
-      <el-form :model="form">
+      <el-form :model="Passwordform" ref="PasswordformRef" :rules="rules">
         <el-form-item>
           <el-input
-            v-model="form.name"
+            v-model="Passwordform.oldPwd"
             autocomplete="off"
             placeholder="璇疯緭鍏ュ師瀵嗙爜"
             style="width: 21.25rem; height: 2.8125rem; font-size: 1rem"
@@ -219,7 +222,7 @@
         </el-form-item>
         <el-form-item>
           <el-input
-            v-model="form.name"
+            v-model="Passwordform.newPwd"
             autocomplete="off"
             placeholder="璇疯緭鍏ユ柊瀵嗙爜"
             style="width: 21.25rem; height: 2.8125rem; font-size: 1rem"
@@ -227,7 +230,7 @@
         </el-form-item>
         <el-form-item>
           <el-input
-            v-model="form.name"
+            v-model="newPwd"
             autocomplete="off"
             placeholder="纭瀵嗙爜"
             style="width: 21.25rem; height: 2.8125rem; font-size: 1rem"
@@ -240,7 +243,7 @@
           style="display: flex; justify-content: center"
         >
           <el-button
-            @click="dialogVisible = false"
+            @click="clickPassword(PasswordformRef)"
             type="primary"
             style="
               width: 21.25rem;
@@ -257,27 +260,54 @@
 </template>
 <script setup>
 import { ref, reactive } from "vue";
+import { GetUserInfo, UpdatePassword, UpdateUser } from "@/api/user";
+import { ElMessage } from "element-plus";
 const formInline = reactive({
   user: "",
   region: "",
   date: "",
 });
-const form = reactive({
-  name: "",
-  region: "",
-  date1: "",
-  date2: "",
-  delivery: false,
-  type: [],
-  resource: "",
-  desc: "",
-});
-
+const form = ref({});
+const newPwd = ref("");
 const onSubmit = () => {
+  // UpdateUser().then((res) => {});
+  console.log(form.value);
+
   console.log("submit!");
+};
+const rules = reactive({
+  oldPwd: [{ required: true, message: "璇疯緭鍏ユ棫瀵嗙爜", trigger: "blur" }],
+  newPwd: [{ required: true, message: "璇疯緭鍏ユ柊瀵嗙爜", trigger: "blur" }],
+});
+const PasswordformRef = ref();
+const Passwordform = ref({
+  oldPwd: "",
+  newPwd: "",
+});
+const clickPassword = async (formEl) => {
+  if (!formEl) return;
+  await formEl.validate((valid, fields) => {
+    if (valid) {
+      UpdatePassword(Passwordform.value).then((res) => {
+        ElMessage({
+          message: "淇敼鎴愬姛",
+          type: "success",
+        });
+        console.log(res);
+      });
+    } else {
+      console.log("error submit!", fields);
+    }
+  });
 };
 
 const dialogVisible = ref(false);
+const userInfo = ref({});
+GetUserInfo({}).then((res) => {
+  userInfo.value = res.data;
+  form.value = res.data;
+  console.log(res);
+});
 </script>
 <style lang="scss" scoped>
 .personal {

--
Gitblit v1.9.3