package production import ( "shylinux.com/x/ice" kit "shylinux.com/x/toolkits" "shylinux.com/x/operation/src/production/model" ) type Task struct { Table order string `data:"4"` role string `data:"leader,worker"` fields string `data:"title,content,status,space,path,case_count AS case_count,begin_time,end_time,process_time,finish_time,issue_uid,plan_uid,story_uid,user_uid"` create string `name:"create issue_uid*:select title* content* space:select path:select begin_time:select@date end_time:select@date" role:"worker"` modify string `name:"modify title* content* space:select path:select begin_time*:select@date end_time*:select@date" role:"worker"` finish string `name:"finish" role:"worker"` caseCreate string `name:"caseCreate title* content* space:select index:select" role:"leader"` } func (s Task) Create(m *ice.Message, arg ...string) { s.ValueCreate(m, kit.ArgDef(arg, kit.Simple(model.BEGIN_TIME, m.Time(), model.END_TIME, m.Time("72h"))...)...) s.SendMessage(s.GetCommandUID(m), "", "") s.issueCount(m).DashboardUpdate(m) } func (s Task) Remove(m *ice.Message, arg ...string) { s.ValueRemove(m, arg...) s.issueCount(m).DashboardUpdate(m) } func (s Task) List(m *ice.Message, arg ...string) { s.Orders(m, model.STATUS, model.CASE_COUNT, s.Desc(model.CREATED_AT)).Limit(m, 300) s.ValueList(m, arg) s.SelectJoinPlan(m) m.Table(func(value ice.Maps) { if IssueStatus(kit.Int(value[model.STATUS])) == IssueFinish { s.PushTaskButton(m, value, s.Program) } else { s.PushTaskButton(m, value, s.Program, s.CaseCreate) } }).RenameAppend(model.STATUS, model.TASK_STATUS).Display("") s.OtherListCmd(m, s.IssueList, s.DesignList, s.CaseList) } func (s Task) Process(m *ice.Message, arg ...string) { s.changeStatus(m, IssueCreate, IssueProcess) } func (s Task) Finish(m *ice.Message, arg ...string) { if s.finishCheck(m, Case{}, "用例") { return } s.changeStatus(m, IssueProcess, IssueFinish) } func (s Task) CaseCreate(m *ice.Message, arg ...string) { s.commonOtherCreate(m, Case{}, kit.Simple(m.OptionSimple(model.ISSUE_UID), arg)...) } func init() { ice.TeamCtxCmd(Task{}) }