Merge pull request '添加不使用API Service的时候生成ruleForm属性' (#117) from 616036448/Admin.NET.Pro:main into main

Reviewed-on: http://101.43.53.74:3000/Admin.NET/Admin.NET.Pro/pulls/117
This commit is contained in:
zuohuaijun 2024-09-01 13:08:05 +08:00
commit fda8248b0e

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,
}
}
}
@:},
}
});