From af83ed031e82bd7fa93f19d1eb64e7c1923db1fa Mon Sep 17 00:00:00 2001 From: shy Date: Mon, 5 May 2025 14:15:27 +0800 Subject: [PATCH] add some --- src/production/case.js | 6 +++++- src/production/common.go | 17 +++++++++-------- src/production/deal.go | 2 +- src/production/design.js | 6 +++++- src/production/issue.go | 6 +++++- src/production/issue.js | 9 +++++---- src/production/meet.go | 2 +- src/production/task.js | 6 ++++-- 8 files changed, 35 insertions(+), 19 deletions(-) diff --git a/src/production/case.js b/src/production/case.js index 62a9d6c..81291e3 100644 --- a/src/production/case.js +++ b/src/production/case.js @@ -2,7 +2,11 @@ Volcanos(chat.ONIMPORT, { _init: function(can, msg) { can.onimport.myView(can, msg, function(value) { return [ {view: html.TITLE, list: [value.title, can.onimport.textView(can, value, "status")]}, - {view: html.STATUS, list: [can.onimport.beginTime(can, value), can.onimport.unitView(can, value, "plan_title")]}, + {view: html.STATUS, list: [ + // can.onimport.beginTime(can, value), + (value.process_time||value.begin_time).split(" ")[0], + can.onimport.unitView(can, value, "plan_title"), + ]}, {view: html.OUTPUT, list: [value.content]}, can.onimport.titleAction(can, value), ] }) }, diff --git a/src/production/common.go b/src/production/common.go index 948fb68..33f5d3c 100644 --- a/src/production/common.go +++ b/src/production/common.go @@ -121,7 +121,7 @@ func (s Table) PushIssueButton(m *ice.Message, value ice.Maps, user_uid string, button = append(button, s.Discuss, s.Payfor) } if isCreator { - button = append(button, s.Approve, s.Reject, s.Cancel, s.Remove) + button = append(button, s.Approve, s.Reject) } if user_uid == value[model.USER_UID] { button = append(button, s.Modify, s.Remove) @@ -138,22 +138,22 @@ func (s Table) PushIssueButton(m *ice.Message, value ice.Maps, user_uid string, button = append(button, s.Submit) } case IssueSubmit: - if isLeader { - button = append(button, s.Discuss, s.Payfor) - } if isWorker { button = append(button, s.Preview) } + if isLeader { + button = append(button, s.Discuss, s.Payfor) + } if isCreator { button = append(button, s.Finish, s.Reback, s.Cancel) } case IssueFinish: - if isLeader { - button = append(button, s.Discuss, s.Payfor) - } if isWorker { button = append(button, s.Preview) } + if isLeader { + button = append(button, s.Discuss, s.Payfor) + } if isWorker { button = append(button, arg...) } @@ -312,7 +312,8 @@ func (s Table) DealList(m *ice.Message, arg ...string) { } func (s Table) finishCheck(m *ice.Message, target ice.Any, name string, arg ...string) bool { - count := m.Cmd(target, s.Select, m.CommandKey()+"_uid = ? AND status != ?", m.Option(model.UID), IssueFinish).Length() + count := m.Cmd(target, s.Select, m.CommandKey()+"_uid = ? AND status != ? AND status != ? AND status != ?", + m.Option(model.UID), IssueRejected, IssueFinish, IssueCancel).Length() if m.WarnNotValid(count > 0, kit.Format("还有 %v 个未完成的%s", count, name)) { return true } diff --git a/src/production/deal.go b/src/production/deal.go index fda7d30..25aa958 100644 --- a/src/production/deal.go +++ b/src/production/deal.go @@ -11,7 +11,7 @@ type deal struct { order string `data:"7"` fields string `data:"from_user_uid,to_user_uid,price,title,content"` create string `name:"create issue_uid* from_user_uid* to_user_uid* price* title* content" role:"leader"` - modify string `name:"modify price* title* content" role:"leader"` + modify string `name:"modify title* content" role:"leader"` } func (s deal) Create(m *ice.Message, arg ...string) { diff --git a/src/production/design.js b/src/production/design.js index 715b6b2..5d14e3c 100644 --- a/src/production/design.js +++ b/src/production/design.js @@ -2,7 +2,11 @@ Volcanos(chat.ONIMPORT, { _init: function(can, msg) { can.onimport.myView(can, msg, function(value) { return [ {view: html.TITLE, list: [value.title, can.onimport.textView(can, value, "status")]}, - {view: html.STATUS, list: [can.onimport.beginTime(can, value), can.onimport.unitView(can, value, "plan_title")]}, + {view: html.STATUS, list: [ + // can.onimport.beginTime(can, value), + (value.process_time||value.begin_time).split(" ")[0], + can.onimport.unitView(can, value, "plan_title"), + ]}, // value.price > 0 && {view: html.OUTPUT, list: [can.onimport.unitView(can, value, "price", "元")]}, {view: html.OUTPUT, list: [value.content]}, can.onimport.titleAction(can, value), ] }) diff --git a/src/production/issue.go b/src/production/issue.go index 082dc6c..5b10069 100644 --- a/src/production/issue.go +++ b/src/production/issue.go @@ -28,8 +28,12 @@ func (s Issue) Remove(m *ice.Message, arg ...string) { s.ValueRemove(m, arg...) s.planCount(m).DashboardUpdate(m) } +func (s Issue) Reject(m *ice.Message, arg ...string) { + s.changeStatus(m, IssueCreate, IssueRejected) + s.planCount(m).DashboardUpdate(m) +} func (s Issue) Cancel(m *ice.Message, arg ...string) { - s.ChangeStatus(m, int(IssueCreate), int(IssueCancel)) + s.ChangeStatus(m, int(IssueSubmit), int(IssueCancel)) s.planCount(m).DashboardUpdate(m) } func (s Issue) List(m *ice.Message, arg ...string) { diff --git a/src/production/issue.js b/src/production/issue.js index bbd085d..8a1977e 100644 --- a/src/production/issue.js +++ b/src/production/issue.js @@ -2,15 +2,16 @@ Volcanos(chat.ONIMPORT, { _init: function(can, msg) { can.onimport.myView(can, msg, function(value) { return [ {view: html.TITLE, list: [value.title, - value.issue_type != "feature" && can.onimport.textView(can, value, "issue_type"), - value.level != "level-3" && can.onimport.textView(can, value, "level"), + // value.issue_type != "feature" && can.onimport.textView(can, value, "issue_type"), + // value.level != "level-3" && can.onimport.textView(can, value, "level"), can.onimport.textView(can, value, "status"), ]}, {view: html.STATUS, list: [ - (value.process_time||value.begin_time).split(" ")[0]+" ~ "+(value.finish_time||value.end_time).split(" ")[0], + (value.process_time||value.begin_time).split(" ")[0], + // +" ~ "+(value.finish_time||value.end_time).split(" ")[0], + can.onimport.unitView(can, value, "plan_title"), can.onimport.unitView(can, value, "design_count", "个"), can.onimport.unitView(can, value, "task_count", "个"), - can.onimport.unitView(can, value, "plan_title"), ]}, // value.price > 0 && {view: html.OUTPUT, list: [can.onimport.unitView(can, value, "price", "元")]}, {view: html.OUTPUT, list: [value.content]}, can.onimport.titleAction(can, value), diff --git a/src/production/meet.go b/src/production/meet.go index 172779b..6b79120 100644 --- a/src/production/meet.go +++ b/src/production/meet.go @@ -25,7 +25,7 @@ func (s meet) Create(m *ice.Message, arg ...string) { s.SendMessage(s.GetCommandUID(m), m.Option(model.TO_USER_UID), m.Option(model.FROM_USER_UID)) } func (s meet) List(m *ice.Message, arg ...string) { - s.ValueList(m, arg).Display("") + s.ValueList(m, arg).PushAction(s.Preview).Display("") if s.IsLeader(m) { m.RenameAppend(model.TO_USER_UID, model.USER_UID) } else { diff --git a/src/production/task.js b/src/production/task.js index 2a09ce7..71a4efb 100644 --- a/src/production/task.js +++ b/src/production/task.js @@ -2,9 +2,11 @@ Volcanos(chat.ONIMPORT, { _init: function(can, msg) { can.onimport.myView(can, msg, function(value) { return [ {view: html.TITLE, list: [value.title, can.onimport.textView(can, value, "status")]}, - {view: html.STATUS, list: [can.onimport.beginTime(can, value), - can.onimport.unitView(can, value, "case_count", "个"), + {view: html.STATUS, list: [ + // can.onimport.beginTime(can, value), + (value.process_time||value.begin_time).split(" ")[0], can.onimport.unitView(can, value, "plan_title"), + can.onimport.unitView(can, value, "case_count", "个"), ]}, {view: html.OUTPUT, list: [value.content]}, can.onimport.titleAction(can, value), ] })