mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-11-11 03:33:53 +08:00
发布v2.15.7版本,更新内容请查看:https://github.com/bufanyun/hotgo/tree/v2.0/docs/guide-zh-CN/addon-version-upgrade.md
This commit is contained in:
@@ -165,6 +165,32 @@ func (l *gCurd) generateStructFieldDefinition(in *CurdPreviewInput, field *sysin
|
||||
return result
|
||||
}
|
||||
|
||||
isUpdateOrInsertInputFields := func() bool {
|
||||
if !isMaster {
|
||||
return field.IsEdit
|
||||
}
|
||||
|
||||
if field.IsEdit {
|
||||
return true
|
||||
}
|
||||
|
||||
// 树表内部维护字段
|
||||
if in.options.Step.IsTreeTable && gstr.InArray(defaultTreeFields, field.Name) {
|
||||
return true
|
||||
}
|
||||
|
||||
// 修改人
|
||||
if inputType == InputTypeUpdateFields && field.GoName == "UpdatedBy" {
|
||||
return true
|
||||
}
|
||||
|
||||
// 创建人
|
||||
if inputType == InputTypeInsertFields && field.GoName == "CreatedBy" {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
isQuery := false
|
||||
|
||||
switch inputType {
|
||||
@@ -225,12 +251,12 @@ func (l *gCurd) generateStructFieldDefinition(in *CurdPreviewInput, field *sysin
|
||||
}
|
||||
result = []string{rule}
|
||||
case InputTypeUpdateFields:
|
||||
if !field.IsEdit && field.GoName != "UpdatedBy" {
|
||||
if !isUpdateOrInsertInputFields() {
|
||||
return nil
|
||||
}
|
||||
addResult()
|
||||
case InputTypeInsertFields:
|
||||
if !field.IsEdit && field.GoName != "CreatedBy" {
|
||||
if !isUpdateOrInsertInputFields() {
|
||||
return nil
|
||||
}
|
||||
addResult()
|
||||
|
||||
Reference in New Issue
Block a user