From 6a78d49d25fa9b5743e2b8b8c94887b7c1fcdd8a Mon Sep 17 00:00:00 2001 From: shy Date: Tue, 27 May 2025 10:33:07 +0800 Subject: [PATCH] add some --- src/option.go | 1 + src/production/coder.go | 18 ++++++++++++++++++ src/production/common.go | 12 ++++++------ src/production/date.go | 2 +- src/production/date.js | 4 ++-- src/production/take.go | 5 ++++- 6 files changed, 32 insertions(+), 10 deletions(-) create mode 100644 src/production/coder.go diff --git a/src/option.go b/src/option.go index eb8c9df..665ce6e 100644 --- a/src/option.go +++ b/src/option.go @@ -3,4 +3,5 @@ package main import ( _ "shylinux.com/x/ice/devops" _ "shylinux.com/x/ice/portal" + _ "shylinux.com/x/operation/src/storage" ) diff --git a/src/production/coder.go b/src/production/coder.go new file mode 100644 index 0000000..a613a37 --- /dev/null +++ b/src/production/coder.go @@ -0,0 +1,18 @@ +package production + +import "shylinux.com/x/ice" + +type coder struct { + list string `name:"list path file line auto" help:"编辑器" role:"void"` + render string `name:"render" role:"void"` + repos string `name:"repos" role:"void"` +} + +func (s coder) Render(m *ice.Message, arg ...string) { m.Cmdy("vimer", m.ActionKey(), arg) } +func (s coder) Repos(m *ice.Message, arg ...string) { m.Cmdy("vimer", m.ActionKey(), arg) } +func (s coder) Save(m *ice.Message, arg ...string) { + m.Cmdy("vimer", m.ActionKey(), arg) +} +func (s coder) List(m *ice.Message, arg ...string) { m.Cmdy("vimer", arg) } + +func init() { ice.TeamCtxCmd(coder{}) } diff --git a/src/production/common.go b/src/production/common.go index aa31bce..03ab4df 100644 --- a/src/production/common.go +++ b/src/production/common.go @@ -294,15 +294,15 @@ func (s Table) Preview(m *ice.Message, arg ...string) { m.OptionDefault(model.LINK, m.Option(model.MEET_LINK)) m.ProcessOpen(m.OptionDefault(model.LINK, web.S(m.Option(web.SPACE))+web.C(m.Option(ctx.INDEX)))) } -func (s Table) Program(m *ice.Message, arg ...string) { +func (s Table) coderLink(m *ice.Message, arg ...string) string { p := path.Base(m.Option(nfs.PATH)) - m.ProcessOpen(m.MergePodCmd("", "web.team.production.coder", + return kit.MergeURL(web.S(m.Option(web.SPACE))+web.C("web.team.production.coder"), nfs.PATH, nfs.SRC, nfs.FILE, path.Join(p, "portal.go"), m.OptionSimple(model.STORY_UID, model.ISSUE_UID), - )) - return - m.ProcessOpen(kit.MergeURL(web.S(m.Option(web.SPACE))+web.C(web.VIMER), - nfs.PATH, nfs.SRC, nfs.FILE, path.Join(p, "portal.go"))) + ) +} +func (s Table) Program(m *ice.Message, arg ...string) { + m.ProcessOpen(s.coderLink(m)) } func (s Table) Discuss(m *ice.Message, arg ...string) { s.issueOtherCreate(m, Meet{}, arg...) diff --git a/src/production/date.go b/src/production/date.go index 46b71b0..d153e54 100644 --- a/src/production/date.go +++ b/src/production/date.go @@ -36,7 +36,7 @@ func init() { ice.TeamCtxCmd(Date{}) } func (s Date) head(m *ice.Message, arg ...string) { head := []string{} - for i := -kit.Int(m.Option("date_begin")); i < kit.Int(m.OptionDefault("date_end", "2")); i++ { + for i := -kit.Int(m.OptionDefault("date_begin", kit.Select("0", "2", s.IsCreator(m)))); i < kit.Int(m.OptionDefault("date_end", "2")); i++ { head = append(head, strings.Split(m.Time(kit.Format("%dh", i*24)), " ")[0]) } list := []string{} diff --git a/src/production/date.js b/src/production/date.js index 6bcda0d..14ade92 100644 --- a/src/production/date.js +++ b/src/production/date.js @@ -2,7 +2,8 @@ Volcanos(chat.ONIMPORT, { _init: function(can, msg) { var head = can.core.Split(msg.Option("head")), list = can.core.Split(msg.Option("list")) can.page.Append(can, can._output, [{type: html.TABLE, className: "content full", list: [ {type: html.THEAD, list: [{type: html.TR, list: [{type: html.TH, inner: "时间"}].concat(can.core.List(head, function(value) { - return {type: html.TH, inner: value} + var today = can.base.beginWith(can.base.Time(), value)? "(今天)": "" + return {type: html.TH, inner: value+today} }))}]}, {type: html.TBODY, list: can.core.List(list, function(time) { return {type: html.TR, list: [{type: html.TH, inner: time}].concat(can.core.List(head, function(date) { @@ -16,7 +17,6 @@ Volcanos(chat.ONIMPORT, { }, target) }} }), onclick: function(event) { - // if (!can.base.isIn(can._stacks_root.current._role, "creator", "leader")) { return } can.run(can.request(event, {begin_time: date+" "+time+":00"}), [ctx.ACTION, "discuss"]) }} }))} diff --git a/src/production/take.go b/src/production/take.go index 2786e65..dfdcbbe 100644 --- a/src/production/take.go +++ b/src/production/take.go @@ -80,7 +80,10 @@ func (s take) List(m *ice.Message, arg ...string) { check(Issue{}, "PM") check(Design{}, "UI") if isLeader { - m.Cmd(Task{}, s.Select, model.STORY_UID, value[model.UID]).Table(func(val ice.Maps) { push(val, "RD可编程") }) + m.Cmd(Task{}, s.Select, model.STORY_UID, value[model.UID]).Table(func(val ice.Maps) { + val[model.LINK] = s.coderLink(m.Spawn(val)) + push(val, "RD可编程") + }) m.Cmd(Case{}, s.Select, model.STORY_UID, value[model.UID]).Table(func(val ice.Maps) { push(val, "QA可测试") }) } })