|
@@ -3,6 +3,7 @@ import { FormSchema } from '/@/components/Form/index';
|
|
|
import { adapt } from '/@/utils/adapt';
|
|
|
import { h } from 'vue';
|
|
|
import CustomInput from './customCom/CustomInput.vue';
|
|
|
+import CustomInputPassword from './customCom/CustomInputPassword.vue';
|
|
|
import moment from 'moment';
|
|
|
import { Tag } from 'ant-design-vue';
|
|
|
|
|
@@ -285,7 +286,6 @@ export const schemas: FormSchema[] = [
|
|
|
span: adaptWidth.elContainer,
|
|
|
},
|
|
|
render: ({ model, field }) => {
|
|
|
- console.log(`model.type`, model.type);
|
|
|
return h(CustomInput, {
|
|
|
value: model.name,
|
|
|
type: model.type,
|
|
@@ -309,7 +309,20 @@ export const schemas: FormSchema[] = [
|
|
|
componentProps: {
|
|
|
placeholder: '用户名',
|
|
|
},
|
|
|
- required: true,
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ validator: async (_, value: any) => {
|
|
|
+ if (!value) {
|
|
|
+ return Promise.reject('请输入用户名');
|
|
|
+ }
|
|
|
+ if (value.length < 3 || value.lenght > 30) {
|
|
|
+ return Promise.reject('用户名:请填写3-12位数字、字母、下划线');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ trigger: 'blur',
|
|
|
+ },
|
|
|
+ ],
|
|
|
},
|
|
|
{
|
|
|
field: 'password',
|
|
@@ -320,8 +333,15 @@ export const schemas: FormSchema[] = [
|
|
|
colProps: {
|
|
|
span: adaptWidth.elContainer,
|
|
|
},
|
|
|
- componentProps: {
|
|
|
- placeholder: '密码(初始密码123456)',
|
|
|
+ render: ({ model, field }) => {
|
|
|
+ return h(CustomInputPassword, {
|
|
|
+ value: model.password,
|
|
|
+ tip: '初始密码为123456',
|
|
|
+ placeholder: '密码',
|
|
|
+ onChange(value) {
|
|
|
+ model[field] = value;
|
|
|
+ },
|
|
|
+ });
|
|
|
},
|
|
|
required: true,
|
|
|
},
|