Skip to content

Commit

Permalink
add ui validation
Browse files Browse the repository at this point in the history
  • Loading branch information
LinuxSuRen committed Aug 23, 2023
1 parent a0d5d72 commit 3444efa
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion console/atest-ui/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,13 @@ const submitForm = async (formEl: FormInstance | undefined) => {
})
}
const importSuiteFormRules = reactive<FormRules<Suite>>({
url: [
{ required: true, message: 'URL is required', trigger: 'blur' },
{ type: 'url', message: 'Should be a valid URL value', trigger: 'blur' }
],
store: [{ required: true, message: 'Location is required', trigger: 'blur' }]
})
const importSuiteFormSubmit = async (formEl: FormInstance | undefined) => {
if (!formEl) return
await formEl.validate((valid: boolean, fields) => {
Expand Down Expand Up @@ -334,7 +341,7 @@ const viewName = ref('testcase')
<template #footer>
<span class="dialog-footer">
<el-form
:rules="rules"
:rules="importSuiteFormRules"
:model="importSuiteForm"
ref="importSuiteFormRef"
status-icon label-width="120px">
Expand Down

0 comments on commit 3444efa

Please sign in to comment.