This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-09-14 13:10:39 +08:00
parent a3cf46f398
commit 3a93591f39
10 changed files with 39 additions and 42 deletions

View File

@ -20,8 +20,8 @@ type Case struct {
}
func (s Case) Create(m *ice.Message, arg ...string) {
s.GetCommandUID(m)
s.ValueCreate(m, arg...)
s.GetCommandUID(m)
s.SendMessage(m, "", "")
s.taskCount(m, "1")
s.planCount(m, "1")
@ -53,12 +53,9 @@ func (s Case) List(m *ice.Message, arg ...string) {
s.SelectJoinPlan(m)
s.SelectJoinUser(m)
}
func (s Case) Process(m *ice.Message, arg ...string) { s.changeStatus(m, CaseCreate, CaseProcess) }
func (s Case) Finish(m *ice.Message, arg ...string) { s.changeStatus(m, CaseProcess, CaseFinish) }
func (s Case) PlanBind(m *ice.Message, arg ...string) {
s.ValueModify(m, arg...)
s.planCount(m, "1")
}
func (s Case) Process(m *ice.Message, arg ...string) { s.changeStatus(m, CaseCreate, CaseProcess) }
func (s Case) Finish(m *ice.Message, arg ...string) { s.changeStatus(m, CaseProcess, CaseFinish) }
func (s Case) PlanBind(m *ice.Message, arg ...string) { s.ValueModify(m, arg...); s.planCount(m, "1") }
func init() { ice.TeamCtxCmd(Case{}) }
@ -72,9 +69,10 @@ func (s Case) taskCount(m *ice.Message, value string) {
if m.IsErr() {
return
}
if m.Option(model.TASK_UID) != "" {
m.Cmd(task{}, s.AddCount, model.CASE_COUNT, value, m.Option(model.TASK_UID))
if m.Option(model.TASK_UID) == "" {
return
}
m.Cmd(task{}, s.AddCount, model.CASE_COUNT, value, m.Option(model.TASK_UID))
}
type CaseStatus int

View File

@ -1,10 +1,7 @@
Volcanos(chat.ONIMPORT, {
_init: function(can, msg) {
can.onimport.myView(can, msg, function(value) { return [
{view: html.TITLE, list: [value.title,
value.case_status != "finish" && can.onimport.textView(can, value, "case_status"),
can.onimport.titleAction(can, value),
]},
{view: html.TITLE, list: [value.title, value.case_status != "finish" && can.onimport.textView(can, value, "case_status"), can.onimport.titleAction(can, value)]},
{view: html.STATUS, list: [value.uid.slice(0, 6), can.base.TimeTrim(value.created_at), value.user_name]},
value.process_time && {view: html.STATUS, list: [can.base.TimeTrim(value.process_time), "~", can.base.TimeTrim(value.finish_time)]},
value.plan_title && {view: html.STATUS, list: ["计划:", value.plan_title]},

View File

@ -19,14 +19,14 @@ func (s Table) Inputs(m *ice.Message, arg ...string) {
s.InputsListRole(m, UserStoryRoleList, arg...)
case model.STORY_TYPE:
s.InputsList(m, StoryTypeList, arg...)
case model.PLAN_UID:
s.Fields(m, model.UID, model.TITLE)
m.Cmdy(plan{}, s.Select, m.OptionSimple(model.STORY_UID)).RenameAppend(model.UID, arg[0])
m.DisplayInputKeyNameIconTitle()
case model.ISSUE_TYPE:
s.InputsList(m, IssueTypeList, arg...)
case model.LEVEL:
s.InputsList(m, LevelList, arg...)
case model.PLAN_UID:
s.Fields(m, model.UID, model.TITLE)
m.Cmdy(plan{}, s.Select, m.OptionSimple(model.STORY_UID)).RenameAppend(model.UID, model.PLAN_UID)
m.DisplayInputKeyNameIconTitle()
default:
s.Table.Inputs(m, arg...)
}
@ -66,9 +66,10 @@ func (s Table) planCount(m *ice.Message, key, value string) {
if m.IsErr() {
return
}
if m.Option(model.PLAN_UID) != "" {
m.Cmd(plan{}, s.AddCount, key, value, m.Option(model.PLAN_UID))
if m.Option(model.PLAN_UID) == "" {
return
}
m.Cmd(plan{}, s.AddCount, key, value, m.Option(model.PLAN_UID))
}
type Tables struct{ Table }

View File

@ -24,8 +24,8 @@ type issue struct {
}
func (s issue) Create(m *ice.Message, arg ...string) {
s.GetCommandUID(m)
s.ValueCreate(m, kit.ArgDef(arg, kit.Simple(model.ISSUE_TYPE, IssueFeature, model.LEVEL, Level3)...)...)
s.GetCommandUID(m)
s.SendMessage(m, "", "")
s.DashboardUpdate(m)
s.planCount(m, "1")
@ -70,7 +70,7 @@ func (s issue) Process(m *ice.Message, arg ...string) {
}
func (s issue) Finish(m *ice.Message, arg ...string) {
count := m.Cmd(s.task, s.Select, "issue_uid = ? AND status != ?", m.Option(model.UID), TaskFinish).Length()
if m.WarnNotValid(count > 0, kit.Format("还有%v个未完成的任务", count)) {
if m.WarnNotValid(count > 0, kit.Format("还有 %v 个未完成的任务", count)) {
return
}
s.changeStatus(m, IssueProcess, IssueFinish)

View File

@ -44,7 +44,7 @@ func (s plan) List(m *ice.Message, arg ...string) {
func (s plan) Process(m *ice.Message, arg ...string) { s.changeStatus(m, PlanCreate, PlanProcess) }
func (s plan) Finish(m *ice.Message, arg ...string) {
count := m.Cmd(s.issue, s.Select, "plan_uid = ? AND status != ?", m.Option(model.UID), IssueFinish).Length()
if m.WarnNotValid(count > 0, kit.Format("还有%v个未完成的需求", count)) {
if m.WarnNotValid(count > 0, kit.Format("还有 %v 个未完成的需求", count)) {
return
}
s.changeStatus(m, PlanProcess, PlanFinish)

View File

@ -1,10 +1,7 @@
Volcanos(chat.ONIMPORT, {
_init: function(can, msg) {
can.onimport.myView(can, msg, function(value) { return [
{view: html.TITLE, list: [value.title,
value.plan_status != "finish" && can.onimport.textView(can, value, "plan_status"),
can.onimport.titleAction(can, value)
]},
{view: html.TITLE, list: [value.title, value.plan_status != "finish" && can.onimport.textView(can, value, "plan_status"), can.onimport.titleAction(can, value)]},
{view: html.STATUS, list: [value.begin_time.split(" ")[0], "~", value.end_time.split(" ")[0]]},
value.process_time && {view: html.STATUS, list: [can.base.TimeTrim(value.process_time), "~", can.base.TimeTrim(value.finish_time)]},
{view: html.STATUS, list: ["需求:", value.issue_count+" 个", "任务:", value.task_count+" 个", "用例:", value.case_count+" 个"]},

View File

@ -53,9 +53,11 @@
}
},
"story_type": {
"system": "系统开发",
"enterprise": "企业应用",
"custom": "消费应用"
"custom": "应用软件",
"enterprise": "企业软件",
"industry": "工业软件",
"military": "军用软件",
"system": "系统软件"
},
"plan_status": {
"create": "待开始",

View File

@ -9,15 +9,19 @@ func init() { ice.TeamCtxCmd(story{}) }
type StoryType int
const (
StorySystem StoryType = iota
StoryCustom StoryType = iota
StoryEnterprise
StoryCustom
StoryIndustry
StoryMilitary
StorySystem
)
var StoryTypeList = map[StoryType]string{
StorySystem: "system",
StoryEnterprise: "enterprise",
StoryCustom: "custom",
StoryEnterprise: "enterprise",
StoryIndustry: "industry",
StoryMilitary: "military",
StorySystem: "system",
}
func (s StoryType) String() string { return StoryTypeList[s] }

View File

@ -22,8 +22,8 @@ type task struct {
}
func (s task) Create(m *ice.Message, arg ...string) {
s.GetCommandUID(m)
s.ValueCreate(m, kit.ArgDef(arg, kit.Simple(model.BEGIN_TIME, m.Time(), model.END_TIME, m.Time("72h"))...)...)
s.GetCommandUID(m)
s.SendMessage(m, "", "")
s.DashboardUpdate(m)
s.issueCount(m, "1")
@ -62,7 +62,7 @@ func (s task) Process(m *ice.Message, arg ...string) {
}
func (s task) Finish(m *ice.Message, arg ...string) {
count := m.Cmd(s.Case, s.Select, "task_uid = ? AND status != ?", m.Option(model.UID), CaseFinish).Length()
if m.WarnNotValid(count > 0, kit.Format("还有%v个未完成的用例", count)) {
if m.WarnNotValid(count > 0, kit.Format("还有 %v 个未完成的用例", count)) {
return
}
s.changeStatus(m, TaskProcess, TaskFinish)
@ -70,7 +70,7 @@ func (s task) Finish(m *ice.Message, arg ...string) {
}
func (s task) PlanBind(m *ice.Message, arg ...string) {
s.ValueModify(m, arg...)
s.DashboardUpdate(m)
s.planCount(m, "1")
}
func (s task) CaseCreate(m *ice.Message, arg ...string) {
m.Cmd(s.Case, s.Create, arg, model.TASK_UID, m.Option(model.UID), m.OptionSimple(model.PLAN_UID))
@ -88,9 +88,10 @@ func (s task) issueCount(m *ice.Message, value string) {
if m.IsErr() {
return
}
if m.Option(model.ISSUE_UID) != "" {
m.Cmd(issue{}, s.AddCount, model.TASK_COUNT, value, m.Option(model.ISSUE_UID))
if m.Option(model.ISSUE_UID) == "" {
return
}
m.Cmd(issue{}, s.AddCount, model.TASK_COUNT, value, m.Option(model.ISSUE_UID))
}
type TaskStatus int

View File

@ -1,10 +1,7 @@
Volcanos(chat.ONIMPORT, {
_init: function(can, msg) {
can.onimport.myView(can, msg, function(value) { return [
{view: html.TITLE, list: [value.title,
value.task_status != "finish" && can.onimport.textView(can, value, "task_status"),
can.onimport.titleAction(can, value),
]},
{view: html.TITLE, list: [value.title, value.task_status != "finish" && can.onimport.textView(can, value, "task_status"), can.onimport.titleAction(can, value)]},
{view: html.STATUS, list: [value.uid.slice(0, 6), can.base.TimeTrim(value.created_at), value.user_name]},
value.process_time && {view: html.STATUS, list: [can.base.TimeTrim(value.process_time), "~", can.base.TimeTrim(value.finish_time)]},
value.plan_title && {view: html.STATUS, list: ["计划:", value.plan_title, "用例:", value.case_count+" 个"]},