本次提交包含以下核心变更: 1. 新增按钮级权限控制框架与前端权限校验 2. 新增工位管理、工艺流程、巡检终端等核心业务模块 3. 完善用户体系,支持工位终端专属登录权限 4. 新增文件上传下载、报表查询等配套功能 5. 修复多系统兼容性与交互体验问题 6. 完成所有文档与配置项的规范化更新
37 lines
963 B
Go
37 lines
963 B
Go
package schema
|
|
|
|
import (
|
|
"time"
|
|
|
|
"entgo.io/ent"
|
|
"entgo.io/ent/dialect/entsql"
|
|
"entgo.io/ent/schema"
|
|
"entgo.io/ent/schema/field"
|
|
"entgo.io/ent/schema/index"
|
|
)
|
|
|
|
// Station 工位主数据:工位固定只对应一个工序编号,绑定一个工艺流程图(flowId)
|
|
type Station struct {
|
|
ent.Schema
|
|
}
|
|
|
|
func (Station) Annotations() []schema.Annotation {
|
|
return []schema.Annotation{entsql.Annotation{Table: "station"}}
|
|
}
|
|
|
|
func (Station) Fields() []ent.Field {
|
|
return []ent.Field{
|
|
field.Int("id").Positive(),
|
|
field.Int("stationNo").Unique().Comment("工位号 1..12"),
|
|
field.String("name").Default("").MaxLen(64).Comment("工位名称"),
|
|
field.Int("flowId").Optional().Comment("绑定工艺流程图ID"),
|
|
// ENABLED / DISABLED
|
|
field.String("status").Default("ENABLED").MaxLen(20),
|
|
field.Time("createdAt").Default(time.Now).Immutable(),
|
|
}
|
|
}
|
|
|
|
func (Station) Indexes() []ent.Index {
|
|
return []ent.Index{index.Fields("stationNo").Unique()}
|
|
}
|