// 自定义校验--部门编码是否重复,value输入的内容const validCode = (rule: any, value: any, callback: any) => {const existCodeList = parseId.deptsList.map(item => (item as ItDepartmentsItem).code)existCodeList.includes(value) ? callback(new Error('编码' + value + '已经存在')) : callback()console.log(existCodeList);}
code: [{ required: true, message: '部门编码不能为空', trigger: 'blur' },{ min: 1, max: 50, message: '部门编码要求1-50个字符', trigger: 'blur' },{ validator: validCode, trigger: 'blur' }]
