mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-20 18:15:56 +08:00
update 优化 代码生成页面模板 校验不必要的表单数据
This commit is contained in:
parent
6c928c9b60
commit
a8a79f4778
@ -333,6 +333,7 @@ export default {
|
||||
// 表单校验
|
||||
rules: {
|
||||
#foreach ($column in $columns)
|
||||
#if($column.isInsert || $column.isEdit)
|
||||
#if($column.required)
|
||||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
||||
#if($parentheseIndex != -1)
|
||||
@ -344,6 +345,7 @@ export default {
|
||||
{ required: true, message: "$comment不能为空", trigger: #if($column.htmlType == "select" || $column.htmlType == "radio")"change"#else"blur"#end }
|
||||
]#if($foreach.count != $columns.size()),#end
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
}
|
||||
};
|
||||
@ -404,11 +406,13 @@ export default {
|
||||
reset() {
|
||||
this.form = {
|
||||
#foreach ($column in $columns)
|
||||
#if($column.isInsert || $column.isEdit)
|
||||
#if($column.htmlType == "checkbox")
|
||||
$column.javaField: []#if($foreach.count != $columns.size()),#end
|
||||
#else
|
||||
$column.javaField: null#if($foreach.count != $columns.size()),#end
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
};
|
||||
this.resetForm("form");
|
||||
|
||||
@ -343,6 +343,7 @@ export default {
|
||||
// 表单校验
|
||||
rules: {
|
||||
#foreach ($column in $columns)
|
||||
#if($column.isInsert || $column.isEdit)
|
||||
#if($column.required)
|
||||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
||||
#if($parentheseIndex != -1)
|
||||
@ -354,6 +355,7 @@ export default {
|
||||
{ required: true, message: "$comment不能为空", trigger: #if($column.htmlType == "select" || $column.htmlType == "radio")"change"#else"blur"#end }
|
||||
]#if($foreach.count != $columns.size()),#end
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
}
|
||||
};
|
||||
@ -395,11 +397,13 @@ export default {
|
||||
reset() {
|
||||
this.form = {
|
||||
#foreach ($column in $columns)
|
||||
#if($column.isInsert || $column.isEdit)
|
||||
#if($column.htmlType == "checkbox")
|
||||
$column.javaField: []#if($foreach.count != $columns.size()),#end
|
||||
#else
|
||||
$column.javaField: undefined#if($foreach.count != $columns.size()),#end
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
};
|
||||
this.resetForm("form");
|
||||
|
||||
@ -304,6 +304,7 @@ const data = reactive({
|
||||
},
|
||||
rules: {
|
||||
#foreach ($column in $columns)
|
||||
#if($column.isInsert || $column.isEdit)
|
||||
#if($column.required)
|
||||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
||||
#if($parentheseIndex != -1)
|
||||
@ -315,6 +316,7 @@ const data = reactive({
|
||||
{ required: true, message: "$comment不能为空", trigger: #if($column.htmlType == "select" || $column.htmlType == "radio")"change"#else"blur"#end }
|
||||
]#if($foreach.count != $columns.size()),#end
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
}
|
||||
});
|
||||
@ -365,11 +367,13 @@ function cancel() {
|
||||
function reset() {
|
||||
form.value = {
|
||||
#foreach ($column in $columns)
|
||||
#if($column.isInsert || $column.isEdit)
|
||||
#if($column.htmlType == "checkbox")
|
||||
$column.javaField: []#if($foreach.count != $columns.size()),#end
|
||||
#else
|
||||
$column.javaField: null#if($foreach.count != $columns.size()),#end
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
};
|
||||
proxy.resetForm("${businessName}Ref");
|
||||
|
||||
@ -315,6 +315,7 @@ const data = reactive({
|
||||
},
|
||||
rules: {
|
||||
#foreach ($column in $columns)
|
||||
#if($column.isInsert || $column.isEdit)
|
||||
#if($column.required)
|
||||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
||||
#if($parentheseIndex != -1)
|
||||
@ -326,6 +327,7 @@ const data = reactive({
|
||||
{ required: true, message: "$comment不能为空", trigger: #if($column.htmlType == "select" || $column.htmlType == "radio")"change"#else"blur"#end }
|
||||
]#if($foreach.count != $columns.size()),#end
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
}
|
||||
});
|
||||
@ -367,11 +369,13 @@ function cancel() {
|
||||
function reset() {
|
||||
form.value = {
|
||||
#foreach ($column in $columns)
|
||||
#if($column.isInsert || $column.isEdit)
|
||||
#if($column.htmlType == "checkbox")
|
||||
$column.javaField: []#if($foreach.count != $columns.size()),#end
|
||||
#else
|
||||
$column.javaField: null#if($foreach.count != $columns.size()),#end
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
};
|
||||
proxy.resetForm("${businessName}Ref");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user