vbea 3 年之前
父節點
當前提交
83163a0309

+ 5 - 1
Strides-Admin/src/views/login/Password.vue

@@ -144,7 +144,7 @@
       },
       showPwd() {
         if (this.passwordType === 'password') {
-          this.passwordType = ''
+          this.passwordType = 'text'
         } else {
           this.passwordType = 'password'
         }
@@ -318,4 +318,8 @@
     font-size: 16px;
     position: absolute;
   }
+  .show-pwd {
+    color: #666;
+    cursor: pointer;
+  }
 </style>

+ 2 - 2
Strides-Admin/src/views/login/login.vue

@@ -227,7 +227,7 @@ export default {
   methods: {
     showPwd() {
       if (this.passwordType === 'password') {
-        this.passwordType = ''
+        this.passwordType = 'text'
       } else {
         this.passwordType = 'password'
       }
@@ -454,7 +454,7 @@ export default {
   }
   
   .show-pwd {
-    color: #999;
+    color: #666;
     cursor: pointer;
     font-size: 16px;
     user-select: none;

+ 37 - 8
Strides-Admin/src/views/zetting/Administrator.vue

@@ -177,12 +177,18 @@
             <el-form-item
               label="Password:"
               prop="password">
-              <el-input
-                class="add-text"
-                type="password"
-                v-model="settingsForm.password"
-                placeholder="Add text"
-                maxlength="20"/>
+              <div class="flexc">
+                <el-input
+                  class="add-text pwd"
+                  ref="password"
+                  :type="passwordType"
+                  v-model="settingsForm.password"
+                  placeholder="Email password"
+                  maxlength="64"/>
+                <span class="show-pwd" @click="showPwd">
+                  <svg-icon :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'" />
+                </span>
+              </div>
             </el-form-item>
           </el-col>
           <el-col :span="8">
@@ -397,7 +403,8 @@
         features: [],
         featuresGroup: 0,
         manualValid: false,
-        chargeTypeOptions: []
+        chargeTypeOptions: [],
+        passwordType: "password"
       }
     },
     created() {
@@ -565,7 +572,17 @@
             });
           }
         });
-      }
+      },
+      showPwd() {
+        if (this.passwordType === 'password') {
+          this.passwordType = 'text'
+        } else {
+          this.passwordType = 'password'
+        }
+        this.$nextTick(() => {
+          this.$refs.password.focus()
+        })
+      },
     }
   }
 </script>
@@ -599,11 +616,15 @@
   }
   .add-text {
     width: 100%;
+    min-width: 150px;
     max-width: 300px;
   }
   .add-text ::v-deep .el-textarea__inner {
     font-family: sans-serif;
   }
+  .add-text.pwd ::v-deep .el-input__inner {
+    padding-right: 30px;
+  }
   .value-text {
     width: 100%;
     max-width: 280px;
@@ -704,4 +725,12 @@
     word-break: break-all;
     white-space: normal;
   }
+  .show-pwd {
+    width: 15px;
+    color: #666;
+    cursor: pointer;
+    font-size: 14px;
+    position: relative;
+    margin-left: -24px;
+  }
 </style>