diff --git a/src/views/admin/client/index.vue b/src/views/admin/client/index.vue
index e7e4f09c..aeb1bf4b 100644
--- a/src/views/admin/client/index.vue
+++ b/src/views/admin/client/index.vue
@@ -30,7 +30,7 @@
-
+
diff --git a/src/views/admin/dict/dictItem/form.vue b/src/views/admin/dict/dictItem/form.vue
index edb18bf2..322c722e 100644
--- a/src/views/admin/dict/dictItem/form.vue
+++ b/src/views/admin/dict/dictItem/form.vue
@@ -1,7 +1,7 @@
-
+
@@ -28,7 +28,7 @@
-
+
@@ -69,7 +69,12 @@ const dataForm = reactive({
})
-const dataRules = reactive({})
+const dataRules = reactive({
+ value: [{ required: true, message: '数据值不能为空', trigger: 'blur' }],
+ label: [{ required: true, message: '标签不能为空', trigger: 'blur' }],
+ description: [{ required: true, message: '描述不能为空', trigger: 'blur' }],
+ sortOrder: [{ required: true, message: '排序不能为空', trigger: 'blur' }],
+})
// 打开弹窗
@@ -99,21 +104,30 @@ const onCancel = () => {
};
// 提交
const onSubmit = () => {
- if (dataForm.id) {
- putItemObj(dataForm).then(() => {
- closeDialog(); // 关闭弹窗
- emit('refresh');
- }).catch(err => {
- useMessage().error(err.msg)
- })
- } else {
- addItemObj(dataForm).then(() => {
- closeDialog(); // 关闭弹窗
- emit('refresh');
- }).catch(err => {
- useMessage().error(err.msg)
- })
- }
+ dicDialogFormRef.value.validate((valid: boolean) => {
+ if (!valid) {
+ return false
+ }
+ if (dataForm.id) {
+ putItemObj(dataForm).then(() => {
+ closeDialog(); // 关闭弹窗
+ emit('refresh');
+ }).catch(err => {
+ useMessage().error(err.msg)
+ })
+ } else {
+ addItemObj(dataForm).then(() => {
+ closeDialog(); // 关闭弹窗
+ emit('refresh');
+ }).catch(err => {
+ useMessage().error(err.msg)
+ })
+ }
+ })
+
+
+
+
};
// 暴露变量
defineExpose({
diff --git a/src/views/admin/dict/form.vue b/src/views/admin/dict/form.vue
index 1a5bf40e..4d3f6395 100644
--- a/src/views/admin/dict/form.vue
+++ b/src/views/admin/dict/form.vue
@@ -1,7 +1,7 @@
-
+
@@ -56,12 +56,16 @@ const dataForm = reactive({
id: '',
dictType: '',
description: '',
- systemFlag: '',
+ systemFlag: '0',
remarks: '',
})
-const dataRules = reactive({})
+const dataRules = reactive({
+ dictType: [{ required: true, message: '类型不能为空', trigger: 'blur' }],
+ systemFlag: [{ required: true, message: '字典类型不能为空', trigger: 'blur' }],
+ description: [{ required: true, message: '描述不能为空', trigger: 'blur' }],
+})
// 打开弹窗
@@ -90,21 +94,27 @@ const onCancel = () => {
};
// 提交
const onSubmit = () => {
- if (dataForm.id) {
- putObj(dataForm).then(() => {
- closeDialog(); // 关闭弹窗
- emit('refresh');
- }).catch(err => {
- useMessage().error(err.msg)
- })
- }else{
- addObj(dataForm).then(() => {
- closeDialog(); // 关闭弹窗
- emit('refresh');
- }).catch(err => {
- useMessage().error(err.msg)
- })
- }
+ dicDialogFormRef.value.validate((valid: boolean) => {
+ if (!valid) {
+ return false
+ }
+ if (dataForm.id) {
+ putObj(dataForm).then(() => {
+ closeDialog(); // 关闭弹窗
+ emit('refresh');
+ }).catch(err => {
+ useMessage().error(err.msg)
+ })
+ }else{
+ addObj(dataForm).then(() => {
+ closeDialog(); // 关闭弹窗
+ emit('refresh');
+ }).catch(err => {
+ useMessage().error(err.msg)
+ })
+ }
+ })
+
};
// 暴露变量
defineExpose({
diff --git a/src/views/admin/param/form.vue b/src/views/admin/param/form.vue
index e445222f..ada2b56c 100644
--- a/src/views/admin/param/form.vue
+++ b/src/views/admin/param/form.vue
@@ -88,14 +88,21 @@ const form = reactive({
publicName: '',
publicKey: '',
publicValue: '',
- status: '',
+ status: '0',
validateCode: '',
publicType: '',
- systemFlag: '',
+ systemFlag: '0',
});
// 定义校验规则
-const dataRules = ref({})
+const dataRules = reactive({
+ publicName: [{ required: true, message: '名称不能为空', trigger: 'blur' }],
+ publicKey: [{ required: true, message: '参数键不能为空', trigger: 'blur' }],
+ publicValue: [{ required: true, message: '参数值不能为空', trigger: 'blur' }],
+ status: [{ required: true, message: '状态不能为空', trigger: 'blur' }],
+ validateCode: [{ required: true, message: '编码不能为空', trigger: 'blur' }],
+ publicType: [{ required: true, message: '类型不能为空', trigger: 'blur' }],
+})
// 打开弹窗
const openDialog = (id: string) => {
diff --git a/src/views/admin/tenant/tenantMenu/form.vue b/src/views/admin/tenant/tenantMenu/form.vue
index c74edd29..22e99ee3 100644
--- a/src/views/admin/tenant/tenantMenu/form.vue
+++ b/src/views/admin/tenant/tenantMenu/form.vue
@@ -64,7 +64,9 @@ const form = reactive({
});
const dataRules = reactive({
-
+ name: [{ required: true, message: '套餐名称不能为空', trigger: 'blur' }],
+ status: [{ required: true, message: '套餐状态不能为空', trigger: 'blur' }],
+ menuIds: [{ required: true, message: '套餐菜单不能为空', trigger: 'blur' }]
})
const menuData = ref([])
@@ -101,6 +103,7 @@ const onSubmit = () => {
loading.value = true
dataFormRef.value.validate((valid: boolean) => {
if (!valid) {
+ loading.value = false
return false
}
form.menuIds = [...menuTreeRef.value.getCheckedKeys(),...menuTreeRef.value.getHalfCheckedKeys()].join(",")