2025-06-23 21:48:40 +08:00

54 lines
1.7 KiB
Go

package production
import (
"shylinux.com/x/ice"
kit "shylinux.com/x/toolkits"
"shylinux.com/x/operation/src/production/model"
)
type Case struct {
Table
order string `data:"5"`
role string `data:"leader,worker"`
fields string `data:"title,content,status,space,index,begin_time,end_time,process_time,finish_time,task_uid,issue_uid,plan_uid,story_uid,user_uid"`
create string `name:"create task_uid*:select title* content* space:select index:select begin_time:select@date end_time:select@date" role:"worker"`
modify string `name:"modify title* content* space:select index:select" role:"worker"`
finish string `name:"finish" role:"worker"`
}
func (s Case) 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.taskCount(m)
}
func (s Case) Remove(m *ice.Message, arg ...string) {
s.ValueRemove(m, arg...)
s.taskCount(m)
}
func (s Case) Cancel(m *ice.Message, arg ...string) {
s.ChangeStatus(m, int(IssueProcess), int(IssueCancel))
s.taskCount(m)
}
func (s Case) List(m *ice.Message, arg ...string) {
s.Orders(m, model.STATUS, s.Desc(model.CREATED_AT))
s.ValueList(m, arg)
s.SelectJoinPlan(m)
m.Table(func(value ice.Maps) {
if value[model.SPACE] == "" {
s.PushTaskButton(m, value)
} else {
s.PushTaskButton(m, value, s.Preview)
}
}).RenameAppend(model.STATUS, model.CASE_STATUS).Display("")
s.OtherListCmd(m, s.TaskList)
}
func (s Case) Process(m *ice.Message, arg ...string) {
s.changeStatus(m, IssueCreate, IssueProcess)
}
func (s Case) Finish(m *ice.Message, arg ...string) {
s.changeStatus(m, IssueProcess, IssueFinish)
}
func init() { ice.TeamCtxCmd(Case{}) }