|
|
@@ -3,6 +3,7 @@ import { sysRoleQueryPage } from '/@/api/sys/sysRoleApi';
|
|
|
import { sysPortalQueryPage } from '/@/api/sys/sysPortalApi';
|
|
|
import { sysOrgQueryTree } from '/@/api/sys/sysOrgApi';
|
|
|
import { sysPosQueryPage } from '/@/api/sys/sysPosApi';
|
|
|
+import { validatorUsername } from '/@/api/sys/sysUserApi';
|
|
|
import { listDictModel } from '/@/api/common';
|
|
|
export const columns: BasicColumn[] = [
|
|
|
{
|
|
|
@@ -74,6 +75,30 @@ export const dataFormSchema: FormSchema[] = [
|
|
|
componentProps: {
|
|
|
placeholder: '请输入账号',
|
|
|
},
|
|
|
+ dynamicRules: () => {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ validator: async (_, value) => {
|
|
|
+ if (!value) {
|
|
|
+ return Promise.reject('管理账号不能为空');
|
|
|
+ }
|
|
|
+ if (value.length > 16 || value.length < 4) {
|
|
|
+ return Promise.reject('管理账号为4-16为字母或数字组成');
|
|
|
+ }
|
|
|
+ if (!/^[A-Za-z0-9_-]$/.test(value)) {
|
|
|
+ return Promise.reject('管理账号为4-16为字母或数字组成');
|
|
|
+ }
|
|
|
+ await validatorUsername({ username: value }).then(res => {
|
|
|
+ if (res != 1) {
|
|
|
+ return Promise.reject('管理账号不可用,请重新输入!');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return Promise.resolve();
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
field: 'password',
|