|
|
@@ -8,16 +8,19 @@ import { AddFuturesFormState, BusinessFormState, ResetPasswordFormState, TraderF
|
|
|
* @returns
|
|
|
*/
|
|
|
export function handleBusinessForm() {
|
|
|
+ function initFormData() {
|
|
|
+ return {
|
|
|
+ logincode: '',
|
|
|
+ userid: undefined,
|
|
|
+ accountname: '',
|
|
|
+ password: '',
|
|
|
+ mobile: '',
|
|
|
+ roleids: [],
|
|
|
+ logintaaccounts: [],
|
|
|
+ }
|
|
|
+ }
|
|
|
const formRef = ref();
|
|
|
- const formState: UnwrapRef<BusinessFormState> = reactive({
|
|
|
- logincode: '',
|
|
|
- userid: undefined,
|
|
|
- accountname: '',
|
|
|
- password: '',
|
|
|
- mobile: '',
|
|
|
- roleids: [],
|
|
|
- logintaaccounts: [],
|
|
|
- })
|
|
|
+ const formState: UnwrapRef<BusinessFormState> = reactive(initFormData())
|
|
|
const rules = {
|
|
|
logincode: [{ required: true, message: '请输入账户名称', trigger: 'blur' }],
|
|
|
accountname: [{ required: true, message: '请输入登录账号', trigger: 'blur' }],
|
|
|
@@ -27,7 +30,7 @@ export function handleBusinessForm() {
|
|
|
roleids: [{ required: true, message: '请选择账号角色', trigger: 'change', type: 'array', }],
|
|
|
logintaaccounts: [{ required: true, message: '请选择期货账户', trigger: 'change', type: 'array', }],
|
|
|
}
|
|
|
- return { rules, formState, formRef }
|
|
|
+ return { rules, formState, formRef, initFormData }
|
|
|
}
|
|
|
|
|
|
/**
|