From 42e9132b22ccb6d16ac8a96f6f6a341184ce0705 Mon Sep 17 00:00:00 2001 From: shy Date: Sat, 28 Jun 2025 00:22:31 +0800 Subject: [PATCH] add some --- src/production/case.go | 13 ++++++++----- src/production/task.go | 5 ++++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/production/case.go b/src/production/case.go index 33425e7..d0f6002 100644 --- a/src/production/case.go +++ b/src/production/case.go @@ -11,7 +11,7 @@ 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"` + fields string `data:"title,content,status,score,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"` @@ -36,11 +36,14 @@ func (s Case) List(m *ice.Message, arg ...string) { 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) + button := []ice.Any{} + if value[model.SPACE] != "" { + button = append(button, s.Preview) } + if s.IsLeader(m) { + button = append(button, s.SetScore) + } + s.PushTaskButton(m, value, button...) }).RenameAppend(model.STATUS, model.CASE_STATUS).Display("") s.OtherListCmd(m, s.TaskList) } diff --git a/src/production/task.go b/src/production/task.go index 4047c9e..1203290 100644 --- a/src/production/task.go +++ b/src/production/task.go @@ -11,7 +11,7 @@ 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"` + fields string `data:"title,content,status,score,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"` @@ -40,6 +40,9 @@ func (s Task) List(m *ice.Message, arg ...string) { if IssueStatus(kit.Int(value[model.STATUS])) != IssueFinish { button = append(button, s.CaseCreate) } + if s.IsLeader(m) { + button = append(button, s.SetScore) + } s.PushTaskButton(m, value, button...) }).RenameAppend(model.STATUS, model.TASK_STATUS).Display("") s.OtherListCmd(m, s.IssueList, s.DesignList, s.CaseList)