refactor: 完善 view 代码生成模板,rules 动态生成
This commit is contained in:
@@ -157,9 +157,6 @@
|
|||||||
const queryParams = reactive<${entityName}PageQuery>({
|
const queryParams = reactive<${entityName}PageQuery>({
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
keywords: '',
|
|
||||||
name: '',
|
|
||||||
code: '',
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// $!{businessName}表格数据
|
// $!{businessName}表格数据
|
||||||
@@ -170,16 +167,19 @@
|
|||||||
title: "",
|
title: "",
|
||||||
visible: false,
|
visible: false,
|
||||||
});
|
});
|
||||||
// $!{businessName}表单
|
|
||||||
const formData = reactive<${entityName}Form>({
|
|
||||||
keywords: '',
|
|
||||||
name: '',
|
|
||||||
code: '',
|
|
||||||
});
|
|
||||||
|
|
||||||
|
// $!{businessName}表单数据
|
||||||
|
const formData = reactive<${entityName}Form>({});
|
||||||
|
|
||||||
|
// $!{businessName}表单校验规则
|
||||||
const rules = reactive({
|
const rules = reactive({
|
||||||
name: [{ required: true, message: "请输入$!{businessName}名称", trigger: "blur" }],
|
#if($fieldConfigs)
|
||||||
code: [{ required: true, message: "请输入$!{businessName}编码", trigger: "blur" }],
|
#foreach($fieldConfig in ${fieldConfigs})
|
||||||
|
#if($fieldConfig.isShowInForm && $fieldConfig.isRequired)
|
||||||
|
${fieldConfig.fieldName}: [{ required: true, message: "请输入${fieldConfig.fieldComment}", trigger: "blur" }],
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
#end
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 查询$!{businessName} */
|
/** 查询$!{businessName} */
|
||||||
@@ -194,6 +194,7 @@
|
|||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 重置$!{businessName}查询 */
|
/** 重置$!{businessName}查询 */
|
||||||
function handleResetQuery() {
|
function handleResetQuery() {
|
||||||
queryFormRef.value!.resetFields();
|
queryFormRef.value!.resetFields();
|
||||||
|
|||||||
Reference in New Issue
Block a user