qushaowei
2023-12-13 41d50b20c975faeaa9e5277bdcff13b5acecb575
src/views/system/modules/UserModal.vue
@@ -67,7 +67,7 @@
          <j-select-production  v-model="model.selectedProduction" :multi="true" @back="backProductionInfo" :backProduction="true" :treeProductOpera="true"></j-select-production>
        </a-form-model-item>
        <a-form-model-item label="班组分配" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="teamId">
          <j-dict-select-tag
          <j-dict-select-tag
          v-model="model.teamId"
          :triggerChange="true"
          dictCode="mom_base_team,name,id,del_flag = 0"
@@ -150,6 +150,7 @@
  import { duplicateCheck } from '@/api/api'
  import JSelectProduction from '../../../components/jeecgbiz/JSelectProduction'
  import {mapActions} from 'vuex'
  import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api'
  export default {
    name: "UserModal",
@@ -215,6 +216,13 @@
        nextProductionOptions:[],
        isDepartType:'',
      }
    },
    watch:{
      visible:{
        handler(value){
          if(value) this.initDictData('password_length')
        }
      }
    },
    created () {
@@ -548,7 +556,22 @@
        }else{
            this.departIdShow=true;
        }
      }
      },
      initDictData(dictCode) {
        //根据字典Code, 初始化字典数组
        ajaxGetDictItems(dictCode, null).then((res) => {
          if (res.success) {
            const regExp = new RegExp("^(?=.*[a-zA-Z])(?=.*\\\d)(?=.*[~!@#$%^&*()_+`\\-={}:\";'<>?,./]).{"+Number(res.result[0].value)+",}$");
            this.validatorRules.password[0]={
              required:true,
              pattern: regExp,
              message: `密码由${res.result[0].value}位数字、大小写字母和特殊符号组成!`,
            }
          }
        })
      },
    }
  }
</script>