添加不使用API Service的时候生成ruleForm属性

This commit is contained in:
轻风2016 2024-09-01 12:13:59 +08:00
parent 9da7412017
commit 94a075fa20

View File

@ -242,7 +242,20 @@ const state = reactive({
}
else
{
@:ruleForm: {},
@:ruleForm: {
@:@(@pkFieldName):0,
@foreach (var column in Model.TableField){
if (@column.WhetherAddUpdate == "Y"){
if(@column.NetType.StartsWith("int")||@column.NetType.StartsWith("decimal")||@column.NetType.StartsWith("float")||@column.NetType.StartsWith("double")){
@:@(@column.LowerPropertyName):@(string.IsNullOrEmpty(@column.DefaultValue)?"null":@column.DefaultValue),
} else if(@column.NetType.StartsWith("string")){
@:@column.LowerPropertyName:@(string.IsNullOrEmpty(@column.DefaultValue)?"null":("'"+column.DefaultValue+"'")),
}else{
@:@column.LowerPropertyName:null,
}
}
}
@:},
}
});