feat: 完成多模块功能迭代与优化
本次提交包含多模块功能更新: 1. 权限系统重构:移除硬编码admin放行逻辑,新增精细化权限控制,完善权限树形结构与用户/角色保护 2. 新增物料导入导出接口,补充台账查询条件 3. 优化列表查询排序逻辑,新增区域编码大小写不敏感搜索 4. 修复帮助抽屉重复弹出问题,补充页面权限控制 5. 新增弱密码提示逻辑,优化MES/WMS用户/角色管理权限 6. 调整路由结构,新增权限校验脚本与前端权限树重构 7. 补充数据库字段与依赖包更新
This commit is contained in:
@@ -17,6 +17,8 @@ const (
|
||||
FieldName = "name"
|
||||
// FieldType holds the string denoting the type field in the database.
|
||||
FieldType = "type"
|
||||
// FieldParentCode holds the string denoting the parent_code field in the database.
|
||||
FieldParentCode = "parent_code"
|
||||
// FieldPath holds the string denoting the path field in the database.
|
||||
FieldPath = "path"
|
||||
// FieldIcon holds the string denoting the icon field in the database.
|
||||
@@ -39,6 +41,7 @@ var Columns = []string{
|
||||
FieldCode,
|
||||
FieldName,
|
||||
FieldType,
|
||||
FieldParentCode,
|
||||
FieldPath,
|
||||
FieldIcon,
|
||||
FieldSort,
|
||||
@@ -66,6 +69,10 @@ var (
|
||||
DefaultType string
|
||||
// TypeValidator is a validator for the "type" field. It is called by the builders before save.
|
||||
TypeValidator func(string) error
|
||||
// DefaultParentCode holds the default value on creation for the "parent_code" field.
|
||||
DefaultParentCode string
|
||||
// ParentCodeValidator is a validator for the "parent_code" field. It is called by the builders before save.
|
||||
ParentCodeValidator func(string) error
|
||||
// DefaultPath holds the default value on creation for the "path" field.
|
||||
DefaultPath string
|
||||
// PathValidator is a validator for the "path" field. It is called by the builders before save.
|
||||
@@ -109,6 +116,11 @@ func ByType(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldType, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByParentCode orders the results by the parent_code field.
|
||||
func ByParentCode(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldParentCode, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByPath orders the results by the path field.
|
||||
func ByPath(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldPath, opts...).ToFunc()
|
||||
|
||||
@@ -68,6 +68,11 @@ func Type(v string) predicate.Permission {
|
||||
return predicate.Permission(sql.FieldEQ(FieldType, v))
|
||||
}
|
||||
|
||||
// ParentCode applies equality check predicate on the "parent_code" field. It's identical to ParentCodeEQ.
|
||||
func ParentCode(v string) predicate.Permission {
|
||||
return predicate.Permission(sql.FieldEQ(FieldParentCode, v))
|
||||
}
|
||||
|
||||
// Path applies equality check predicate on the "path" field. It's identical to PathEQ.
|
||||
func Path(v string) predicate.Permission {
|
||||
return predicate.Permission(sql.FieldEQ(FieldPath, v))
|
||||
@@ -293,6 +298,81 @@ func TypeContainsFold(v string) predicate.Permission {
|
||||
return predicate.Permission(sql.FieldContainsFold(FieldType, v))
|
||||
}
|
||||
|
||||
// ParentCodeEQ applies the EQ predicate on the "parent_code" field.
|
||||
func ParentCodeEQ(v string) predicate.Permission {
|
||||
return predicate.Permission(sql.FieldEQ(FieldParentCode, v))
|
||||
}
|
||||
|
||||
// ParentCodeNEQ applies the NEQ predicate on the "parent_code" field.
|
||||
func ParentCodeNEQ(v string) predicate.Permission {
|
||||
return predicate.Permission(sql.FieldNEQ(FieldParentCode, v))
|
||||
}
|
||||
|
||||
// ParentCodeIn applies the In predicate on the "parent_code" field.
|
||||
func ParentCodeIn(vs ...string) predicate.Permission {
|
||||
return predicate.Permission(sql.FieldIn(FieldParentCode, vs...))
|
||||
}
|
||||
|
||||
// ParentCodeNotIn applies the NotIn predicate on the "parent_code" field.
|
||||
func ParentCodeNotIn(vs ...string) predicate.Permission {
|
||||
return predicate.Permission(sql.FieldNotIn(FieldParentCode, vs...))
|
||||
}
|
||||
|
||||
// ParentCodeGT applies the GT predicate on the "parent_code" field.
|
||||
func ParentCodeGT(v string) predicate.Permission {
|
||||
return predicate.Permission(sql.FieldGT(FieldParentCode, v))
|
||||
}
|
||||
|
||||
// ParentCodeGTE applies the GTE predicate on the "parent_code" field.
|
||||
func ParentCodeGTE(v string) predicate.Permission {
|
||||
return predicate.Permission(sql.FieldGTE(FieldParentCode, v))
|
||||
}
|
||||
|
||||
// ParentCodeLT applies the LT predicate on the "parent_code" field.
|
||||
func ParentCodeLT(v string) predicate.Permission {
|
||||
return predicate.Permission(sql.FieldLT(FieldParentCode, v))
|
||||
}
|
||||
|
||||
// ParentCodeLTE applies the LTE predicate on the "parent_code" field.
|
||||
func ParentCodeLTE(v string) predicate.Permission {
|
||||
return predicate.Permission(sql.FieldLTE(FieldParentCode, v))
|
||||
}
|
||||
|
||||
// ParentCodeContains applies the Contains predicate on the "parent_code" field.
|
||||
func ParentCodeContains(v string) predicate.Permission {
|
||||
return predicate.Permission(sql.FieldContains(FieldParentCode, v))
|
||||
}
|
||||
|
||||
// ParentCodeHasPrefix applies the HasPrefix predicate on the "parent_code" field.
|
||||
func ParentCodeHasPrefix(v string) predicate.Permission {
|
||||
return predicate.Permission(sql.FieldHasPrefix(FieldParentCode, v))
|
||||
}
|
||||
|
||||
// ParentCodeHasSuffix applies the HasSuffix predicate on the "parent_code" field.
|
||||
func ParentCodeHasSuffix(v string) predicate.Permission {
|
||||
return predicate.Permission(sql.FieldHasSuffix(FieldParentCode, v))
|
||||
}
|
||||
|
||||
// ParentCodeIsNil applies the IsNil predicate on the "parent_code" field.
|
||||
func ParentCodeIsNil() predicate.Permission {
|
||||
return predicate.Permission(sql.FieldIsNull(FieldParentCode))
|
||||
}
|
||||
|
||||
// ParentCodeNotNil applies the NotNil predicate on the "parent_code" field.
|
||||
func ParentCodeNotNil() predicate.Permission {
|
||||
return predicate.Permission(sql.FieldNotNull(FieldParentCode))
|
||||
}
|
||||
|
||||
// ParentCodeEqualFold applies the EqualFold predicate on the "parent_code" field.
|
||||
func ParentCodeEqualFold(v string) predicate.Permission {
|
||||
return predicate.Permission(sql.FieldEqualFold(FieldParentCode, v))
|
||||
}
|
||||
|
||||
// ParentCodeContainsFold applies the ContainsFold predicate on the "parent_code" field.
|
||||
func ParentCodeContainsFold(v string) predicate.Permission {
|
||||
return predicate.Permission(sql.FieldContainsFold(FieldParentCode, v))
|
||||
}
|
||||
|
||||
// PathEQ applies the EQ predicate on the "path" field.
|
||||
func PathEQ(v string) predicate.Permission {
|
||||
return predicate.Permission(sql.FieldEQ(FieldPath, v))
|
||||
|
||||
Reference in New Issue
Block a user