Browse Source

fix(设置):图表数据

geek 4 years ago
parent
commit
5a8acaec9c
2 changed files with 44 additions and 16 deletions
  1. 43 15
      src/views/join/list.vue
  2. 1 1
      src/views/login/index.vue

+ 43 - 15
src/views/join/list.vue

@@ -21,30 +21,30 @@
           <span>{{ scope.row.create_time }}</span>
         </template>
       </el-table-column>
-      <el-table-column class-name="status-col" label="名称" >
+      <el-table-column class-name="status-col" label="名称">
         <template slot-scope="scope">
           <span>{{ scope.row.account }}</span>
         </template>
       </el-table-column>
-      <el-table-column class-name="status-col" label="角色" >
+      <el-table-column class-name="status-col" label="角色">
         <template slot-scope="{row}">
           <span>{{ row.role_id | roleFilter }}</span>
         </template>
       </el-table-column>
-<!--      <el-table-column class-name="status-col" label="状态">-->
-<!--        <template slot-scope="{row}">-->
-<!--          <el-tag :type="row.status | statusFilter">-->
-<!--            {{ row.status | statusFilterTxt }}-->
-<!--          </el-tag>-->
-<!--        </template>-->
-<!--      </el-table-column>-->
-      <el-table-column align="center" label="Actions"  class-name="small-padding fixed-width">
+      <!--      <el-table-column class-name="status-col" label="状态">-->
+      <!--        <template slot-scope="{row}">-->
+      <!--          <el-tag :type="row.status | statusFilter">-->
+      <!--            {{ row.status | statusFilterTxt }}-->
+      <!--          </el-tag>-->
+      <!--        </template>-->
+      <!--      </el-table-column>-->
+      <el-table-column align="center" label="Actions" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-row>
-<!--            <el-button type="primary" size="mini" icon="el-icon-edit" style="margin-right: 10px;" @click="handleUpdate(scope)">-->
-<!--              查看-->
-<!--            </el-button>-->
-            <el-button type="primary" size="mini"  :disabled="(scope.row.status === 1 || scope.row.status === 3)" @click="handleUpdate(scope)">
+            <!--            <el-button type="primary" size="mini" icon="el-icon-edit" style="margin-right: 10px;" @click="handleUpdate(scope)">-->
+            <!--              查看-->
+            <!--            </el-button>-->
+            <el-button type="primary" size="mini" :disabled="(scope.row.status === 1 || scope.row.status === 3)" @click="handleUpdate(scope)">
               修改
             </el-button>
             <!--<el-button type="danger" size="mini" icon="el-icon-delete" style="margin-left: 10px;" @click="handleDelete(scope)">
@@ -63,7 +63,7 @@
         </el-form-item>
 
         <el-form-item label="密码" prop="passwd">
-          <el-input v-model="temp.passwd" ref="password" show-password />
+          <el-input ref="password" v-model="temp.passwd" show-password /><span style="font-size: 12px;color: #ff4949;">密码必须包含大写字母+小写字母+数字,且长度6~16位</span>
         </el-form-item>
         <el-form-item label="权限" prop="role_id">
           <template>
@@ -138,10 +138,38 @@ export default {
       dialogFormVisible: false
     }
   },
+  watch: {
+    'temp.passwd': {
+      handler: function(newValue, oldValue) {
+        const modes = this.checkStrong(newValue)
+      }
+    }
+  },
   created() {
     this.getList()
   },
   methods: {
+    checkStrong(sValue) {
+      let modes = 0
+      // 正则表达式验证符合要求的
+      if (sValue.length < 1) return modes
+      if (/\d/.test(sValue)) modes++ // 数字
+      if (/[a-z]/.test(sValue)) modes++ // 小写
+      if (/[A-Z]/.test(sValue)) modes++ // 大写
+      if (/\W/.test(sValue)) modes++ // 特殊字符
+
+      // 逻辑处理
+      switch (modes) {
+        case 1:
+          return 1
+        case 2:
+          return 2
+        case 3:
+        case 4:
+          return sValue.length < 12 ? 3 : 4
+      }
+      return modes
+    },
     getList() {
       this.listLoading = true
       fetchList(this.listQuery).then(response => {

+ 1 - 1
src/views/login/index.vue

@@ -88,7 +88,7 @@ export default {
     }
     return {
       loginForm: {
-        username: 'admin',
+        username: '',
         password: '',
         verify: ''
       },