feat: 完成多模块功能迭代与优化
本次提交包含多模块功能更新: 1. 权限系统重构:移除硬编码admin放行逻辑,新增精细化权限控制,完善权限树形结构与用户/角色保护 2. 新增物料导入导出接口,补充台账查询条件 3. 优化列表查询排序逻辑,新增区域编码大小写不敏感搜索 4. 修复帮助抽屉重复弹出问题,补充页面权限控制 5. 新增弱密码提示逻辑,优化MES/WMS用户/角色管理权限 6. 调整路由结构,新增权限校验脚本与前端权限树重构 7. 补充数据库字段与依赖包更新
This commit is contained in:
@@ -47,6 +47,20 @@ func (_c *PermissionCreate) SetNillableType(v *string) *PermissionCreate {
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetParentCode sets the "parent_code" field.
|
||||
func (_c *PermissionCreate) SetParentCode(v string) *PermissionCreate {
|
||||
_c.mutation.SetParentCode(v)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetNillableParentCode sets the "parent_code" field if the given value is not nil.
|
||||
func (_c *PermissionCreate) SetNillableParentCode(v *string) *PermissionCreate {
|
||||
if v != nil {
|
||||
_c.SetParentCode(*v)
|
||||
}
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetPath sets the "path" field.
|
||||
func (_c *PermissionCreate) SetPath(v string) *PermissionCreate {
|
||||
_c.mutation.SetPath(v)
|
||||
@@ -170,6 +184,10 @@ func (_c *PermissionCreate) defaults() {
|
||||
v := permission.DefaultType
|
||||
_c.mutation.SetType(v)
|
||||
}
|
||||
if _, ok := _c.mutation.ParentCode(); !ok {
|
||||
v := permission.DefaultParentCode
|
||||
_c.mutation.SetParentCode(v)
|
||||
}
|
||||
if _, ok := _c.mutation.Path(); !ok {
|
||||
v := permission.DefaultPath
|
||||
_c.mutation.SetPath(v)
|
||||
@@ -222,6 +240,11 @@ func (_c *PermissionCreate) check() error {
|
||||
return &ValidationError{Name: "type", err: fmt.Errorf(`ent: validator failed for field "Permission.type": %w`, err)}
|
||||
}
|
||||
}
|
||||
if v, ok := _c.mutation.ParentCode(); ok {
|
||||
if err := permission.ParentCodeValidator(v); err != nil {
|
||||
return &ValidationError{Name: "parent_code", err: fmt.Errorf(`ent: validator failed for field "Permission.parent_code": %w`, err)}
|
||||
}
|
||||
}
|
||||
if v, ok := _c.mutation.Path(); ok {
|
||||
if err := permission.PathValidator(v); err != nil {
|
||||
return &ValidationError{Name: "path", err: fmt.Errorf(`ent: validator failed for field "Permission.path": %w`, err)}
|
||||
@@ -282,6 +305,10 @@ func (_c *PermissionCreate) createSpec() (*Permission, *sqlgraph.CreateSpec) {
|
||||
_spec.SetField(permission.FieldType, field.TypeString, value)
|
||||
_node.Type = value
|
||||
}
|
||||
if value, ok := _c.mutation.ParentCode(); ok {
|
||||
_spec.SetField(permission.FieldParentCode, field.TypeString, value)
|
||||
_node.ParentCode = value
|
||||
}
|
||||
if value, ok := _c.mutation.Path(); ok {
|
||||
_spec.SetField(permission.FieldPath, field.TypeString, value)
|
||||
_node.Path = value
|
||||
@@ -394,6 +421,24 @@ func (u *PermissionUpsert) UpdateType() *PermissionUpsert {
|
||||
return u
|
||||
}
|
||||
|
||||
// SetParentCode sets the "parent_code" field.
|
||||
func (u *PermissionUpsert) SetParentCode(v string) *PermissionUpsert {
|
||||
u.Set(permission.FieldParentCode, v)
|
||||
return u
|
||||
}
|
||||
|
||||
// UpdateParentCode sets the "parent_code" field to the value that was provided on create.
|
||||
func (u *PermissionUpsert) UpdateParentCode() *PermissionUpsert {
|
||||
u.SetExcluded(permission.FieldParentCode)
|
||||
return u
|
||||
}
|
||||
|
||||
// ClearParentCode clears the value of the "parent_code" field.
|
||||
func (u *PermissionUpsert) ClearParentCode() *PermissionUpsert {
|
||||
u.SetNull(permission.FieldParentCode)
|
||||
return u
|
||||
}
|
||||
|
||||
// SetPath sets the "path" field.
|
||||
func (u *PermissionUpsert) SetPath(v string) *PermissionUpsert {
|
||||
u.Set(permission.FieldPath, v)
|
||||
@@ -590,6 +635,27 @@ func (u *PermissionUpsertOne) UpdateType() *PermissionUpsertOne {
|
||||
})
|
||||
}
|
||||
|
||||
// SetParentCode sets the "parent_code" field.
|
||||
func (u *PermissionUpsertOne) SetParentCode(v string) *PermissionUpsertOne {
|
||||
return u.Update(func(s *PermissionUpsert) {
|
||||
s.SetParentCode(v)
|
||||
})
|
||||
}
|
||||
|
||||
// UpdateParentCode sets the "parent_code" field to the value that was provided on create.
|
||||
func (u *PermissionUpsertOne) UpdateParentCode() *PermissionUpsertOne {
|
||||
return u.Update(func(s *PermissionUpsert) {
|
||||
s.UpdateParentCode()
|
||||
})
|
||||
}
|
||||
|
||||
// ClearParentCode clears the value of the "parent_code" field.
|
||||
func (u *PermissionUpsertOne) ClearParentCode() *PermissionUpsertOne {
|
||||
return u.Update(func(s *PermissionUpsert) {
|
||||
s.ClearParentCode()
|
||||
})
|
||||
}
|
||||
|
||||
// SetPath sets the "path" field.
|
||||
func (u *PermissionUpsertOne) SetPath(v string) *PermissionUpsertOne {
|
||||
return u.Update(func(s *PermissionUpsert) {
|
||||
@@ -969,6 +1035,27 @@ func (u *PermissionUpsertBulk) UpdateType() *PermissionUpsertBulk {
|
||||
})
|
||||
}
|
||||
|
||||
// SetParentCode sets the "parent_code" field.
|
||||
func (u *PermissionUpsertBulk) SetParentCode(v string) *PermissionUpsertBulk {
|
||||
return u.Update(func(s *PermissionUpsert) {
|
||||
s.SetParentCode(v)
|
||||
})
|
||||
}
|
||||
|
||||
// UpdateParentCode sets the "parent_code" field to the value that was provided on create.
|
||||
func (u *PermissionUpsertBulk) UpdateParentCode() *PermissionUpsertBulk {
|
||||
return u.Update(func(s *PermissionUpsert) {
|
||||
s.UpdateParentCode()
|
||||
})
|
||||
}
|
||||
|
||||
// ClearParentCode clears the value of the "parent_code" field.
|
||||
func (u *PermissionUpsertBulk) ClearParentCode() *PermissionUpsertBulk {
|
||||
return u.Update(func(s *PermissionUpsert) {
|
||||
s.ClearParentCode()
|
||||
})
|
||||
}
|
||||
|
||||
// SetPath sets the "path" field.
|
||||
func (u *PermissionUpsertBulk) SetPath(v string) *PermissionUpsertBulk {
|
||||
return u.Update(func(s *PermissionUpsert) {
|
||||
|
||||
Reference in New Issue
Block a user