人生啊人生 3 ヶ月 前
コミット
60a851616d
1 ファイル変更27 行追加5 行削除
  1. 27 5
      user_web/src/view/admin/ManageUser.vue

+ 27 - 5
user_web/src/view/admin/ManageUser.vue

@@ -776,11 +776,12 @@ const btnBatchDel = () => {
 
 /**
  * 弹出指定分页详情
- * @param res 
+ * @param res       当前点击分页的数据参数
+ * type             类型 ,不传的时候,弹出,编辑, pwd 弹出修改密码
  */
-const btnDetail = (res) => {
+const btnDetail = (res, type) => {
 
-    console.log('弹出指定分页详情', res);
+    console.log('弹出指定分页详情', res, type);
     
     let submit = {
         id: res.id,
@@ -819,9 +820,30 @@ const btnDetail = (res) => {
             // "password2": data.password2
         }
 
+        updatePwdDb.value = {
+            "id": data.id,
+            // 账号
+            "userName": data.userName,
+            // 0 表示教师,1表示学生
+            "userType": data.userType,
+            // 昵称
+            "nickName": data.nickName,
+            // 用户分配到的班级数组,可以是多个
+            "classInfo": classInfoIdArray,
+            // 密码
+            "password": data.password,
+            // 确认密码
+            "password2": data.password2
+        }
+        
         // console.log("detailsDb.value", detailsDb.value);
 
-        state.value.showDetails = true;
+        if (type == null || type == undefined) {
+            state.value.showDetails = true;
+        }
+        else if (type == 'pwd') {
+
+        }
         
     }).catch(error => {
         
@@ -1017,7 +1039,7 @@ onMounted(function() {
                     <el-table-column label="操作">
                         <template #default="scope">
                             <el-button link type="primary" @click="btnDetail(scope.row)">编辑</el-button>
-                            <!-- <el-button link type="primary" @click="btnDetail(scope.row)">修改密码</el-button> -->
+                            <el-button link type="primary" @click="btnDetail(scope.row, 'pwd')">修改密码</el-button>
                             <el-popconfirm :title="`你确定删除${scope.row.userName}吗?`" @confirm="btnDel(scope.row)">
                                 <template #reference>
                                     <el-button link type="danger" style="margin-left: 3rem">移除</el-button>