mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-09-11 23:51:53 +08:00
perf: 优化表单校验和查询参数
This commit is contained in:
@@ -63,7 +63,7 @@ const { getList, setSearchParams, delList, exportList } = methods
|
||||
|
||||
// ========== 创建部门树结构 ==========
|
||||
const filterText = ref('')
|
||||
const deptOptions = ref([]) // 树形结构
|
||||
const deptOptions = ref<any[]>([]) // 树形结构
|
||||
const searchForm = ref<FormExpose>()
|
||||
const treeRef = ref<InstanceType<typeof ElTree>>()
|
||||
const getTree = async () => {
|
||||
|
@@ -7,8 +7,18 @@ import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas'
|
||||
const { t } = useI18n()
|
||||
// 表单校验
|
||||
export const rules = reactive({
|
||||
username: [required],
|
||||
nickname: [required],
|
||||
status: [required]
|
||||
email: [required],
|
||||
status: [required],
|
||||
mobile: [
|
||||
{
|
||||
pattern:
|
||||
/^(?:(?:\+|00)86)?1(?:(?:3[\d])|(?:4[5-79])|(?:5[0-35-9])|(?:6[5-7])|(?:7[0-8])|(?:8[\d])|(?:9[189]))\d{8}$/,
|
||||
trigger: 'blur',
|
||||
message: '请输入正确的手机号码'
|
||||
}
|
||||
]
|
||||
})
|
||||
// crudSchemas
|
||||
const crudSchemas = reactive<CrudSchema[]>([
|
||||
|
Reference in New Issue
Block a user