From 93201d7992165cace7bc9ec0c0327bb7833b2c7a Mon Sep 17 00:00:00 2001 From: shy Date: Wed, 28 May 2025 13:57:13 +0800 Subject: [PATCH] add some --- src/production/case.go | 2 +- src/production/coder.go | 44 +++++++++++++++++++++++++++++--------- src/production/date.go | 2 +- src/production/design.go | 2 +- src/production/file.go | 6 ++++-- src/production/issue.go | 2 +- src/production/plan.go | 4 ++-- src/production/portal.go | 8 ++++--- src/production/portal.json | 2 +- src/production/take.go | 12 ++++++++--- src/production/task.go | 2 +- 11 files changed, 60 insertions(+), 26 deletions(-) diff --git a/src/production/case.go b/src/production/case.go index 4304113..b94672a 100644 --- a/src/production/case.go +++ b/src/production/case.go @@ -12,7 +12,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,user_uid"` + 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* title* content* space index begin_time:select@date end_time:select@date" role:"worker"` modify string `name:"modify title* content* space index begin_time*:select@date end_time*:select@date" role:"worker"` finish string `name:"finish" role:"worker"` diff --git a/src/production/coder.go b/src/production/coder.go index a613a37..c0006a6 100644 --- a/src/production/coder.go +++ b/src/production/coder.go @@ -1,18 +1,42 @@ package production -import "shylinux.com/x/ice" +import ( + "shylinux.com/x/ice" + "shylinux.com/x/operation/src/production/model" +) 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"` + Tables + list string `name:"list path file line auto" help:"编辑器" role:"void"` + render string `name:"render" role:"void"` + repos string `name:"repos" role:"void"` + save string `name:"save" role:"void"` + compile string `name:"compile" 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 (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) { s.cmd(m, arg...) } +func (s coder) Compile(m *ice.Message, arg ...string) { s.cmd(m, arg...) } +func (s coder) List(m *ice.Message, arg ...string) { m.Cmdy("vimer", arg) } func init() { ice.TeamCtxCmd(coder{}) } + +func (s coder) cmd(m *ice.Message, arg ...string) { + if s.check(m) { + m.Cmdy("vimer", m.ActionKey(), arg) + } +} +func (s coder) check(m *ice.Message, arg ...string) bool { + s.SettingSelect(m.Options(model.PLACE_UID, m.Option(model.STORY_UID))) + msg := m.Cmd(userStory{}, s.Select, m.OptionSimple(model.STORY_UID, model.USER_UID)) + msg.Info("what %v", m.FormatChain()) + if m.Option("creator_program") == "on" && msg.Append("role") == "1" { + return true + } else if m.Option("leader_program") == "on" && msg.Append("role") == "2" { + return true + } else { + m.WarnNotRight(true) + return false + } +} diff --git a/src/production/date.go b/src/production/date.go index d153e54..cd217d4 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.OptionDefault("date_begin", kit.Select("0", "2", s.IsCreator(m)))); i < kit.Int(m.OptionDefault("date_end", "2")); i++ { + for i := -kit.Int(m.OptionDefault("date_begin", kit.Select("0", "2", !m.IsMobileUA()))); 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/design.go b/src/production/design.go index 3e2768d..42153ca 100644 --- a/src/production/design.go +++ b/src/production/design.go @@ -13,7 +13,7 @@ type Design struct { role string `data:"leader,worker"` fields string `data:"updated_at,title,design_content,status,price,score,link,begin_time,end_time,process_time,finish_time,issue_uid,plan_uid,story_uid,user_uid"` create string `name:"create issue_uid*:select title* design_content* price*=1000 begin_time:select@date end_time:select@date" role:"worker"` - modify string `name:"modify title* design_content* price* link begin_time*:select@date end_time*:select@date" role:"worker"` + modify string `name:"modify title* design_content* price* begin_time*:select@date end_time*:select@date" role:"worker"` } func (s Design) Create(m *ice.Message, arg ...string) { diff --git a/src/production/file.go b/src/production/file.go index 7aa9fc8..7fd5991 100644 --- a/src/production/file.go +++ b/src/production/file.go @@ -33,11 +33,13 @@ func (s File) List(m *ice.Message, arg ...string) { m.Display("") s.OtherListCmd(m, s.IssueList, s.DesignList) } -func (s Table) Download(m *ice.Message, arg ...string) {} +func (s Table) Download(m *ice.Message, arg ...string) { + m.Cmdy(File{}, m.ActionKey(), arg) +} func (s File) Download(m *ice.Message, arg ...string) { s.Select(m, m.OptionSimple(model.UID, model.STORY_UID)...) m.ProcessOpen("/share/" + m.Cmdx(web.SPACE, ice.OPS, web.SHARE, mdb.CREATE, mdb.TYPE, web.DOWNLOAD, - mdb.NAME, m.Append(model.FILE_NAME), mdb.TEXT, kit.Path(m.Append(model.FILE_LINK)))) + mdb.NAME, m.Append(model.FILE_NAME), mdb.TEXT, kit.Path(m.Append(model.FILE_LINK)), kit.Dict(ice.MSG_USERROLE, aaa.TECH))) } func init() { ice.TeamCtxCmd(File{}) } diff --git a/src/production/issue.go b/src/production/issue.go index 3eb1c22..a0f0135 100644 --- a/src/production/issue.go +++ b/src/production/issue.go @@ -12,7 +12,7 @@ type Issue struct { order string `data:"2"` fields string `data:"updated_at,title,issue_content,issue_type,level,status,price,score,link,design_count,task_count,begin_time,end_time,process_time,finish_time,plan_uid,story_uid,user_uid"` create string `name:"create plan_uid*:select title* issue_content* price=1000 begin_time:select@date end_time:select@date" role:"worker"` - modify string `name:"modify title* issue_content* price* link begin_time:select@date end_time:select@date" role:"worker"` + modify string `name:"modify title* issue_content* price* begin_time:select@date end_time:select@date" role:"worker"` designCreate string `name:"designCreate title* design_content* price=1000 begin_time:select@date end_time:select@date" role:"worker"` taskCreate string `name:"taskCreate title* content* space path begin_time:select@date end_time:select@date" role:"worker"` bindPlan string `name:"bindPlan plan_uid*:select"` diff --git a/src/production/plan.go b/src/production/plan.go index 4feaff1..fb54d21 100644 --- a/src/production/plan.go +++ b/src/production/plan.go @@ -10,7 +10,7 @@ import ( type Plan struct { Table order string `data:"1"` - fields string `data:"updated_at,title,content,version,plan_type,plan_status,issue_count,begin_time,end_time,process_time,finish_time,user_uid"` + fields string `data:"updated_at,title,content,version,plan_type,plan_status,issue_count,begin_time,end_time,process_time,finish_time,story_uid,user_uid"` create string `name:"create title* content version begin_time:select@date end_time:select@date" role:"leader"` modify string `name:"modify title* content version begin_time*:select@date end_time*:select@date" role:"leader"` remove string `name:"remove" role:"leader"` @@ -20,7 +20,7 @@ type Plan struct { } func (s Plan) Create(m *ice.Message, arg ...string) { - m.Options(kit.ArgDef(arg, kit.Simple(model.VERSION, "v1.0", model.BEGIN_TIME, m.Time(), model.END_TIME, m.Time("168h"))...)) + m.Options(kit.ArgDef(arg, kit.Simple(model.VERSION, "v1.0", model.BEGIN_TIME, m.Time(), model.END_TIME, m.Time("120h"))...)) s.Transaction(m, func() { if m.WarnNotValid(s.Select(m, m.OptionSimple(model.STORY_UID, model.TITLE, model.VERSION)...).Length() > 0, "项目已经存在") { return diff --git a/src/production/portal.go b/src/production/portal.go index a83a6c2..f4cc72f 100644 --- a/src/production/portal.go +++ b/src/production/portal.go @@ -15,9 +15,11 @@ type Portal struct { func (s Plan) AfterMigrate(m *ice.Message, arg ...string) { s.Table.AfterMigrate(m, arg...) - s.SettingCreate(m, "leader_approved", "radio", "help", "允许管理人员审批项目", "scope", "place") - s.SettingCreate(m, "leader_finish", "radio", "help", "允许管理人员验收项目", "scope", "place") - s.SettingCreate(m, "leader_payfor", "radio", "help", "允许管理人员支付项目", "scope", "place") + s.SettingCreate(m, "leader_approved", "radio", "help", "允许管理人员审批项目", "role", "creator") + s.SettingCreate(m, "leader_finish", "radio", "help", "允许管理人员验收项目", "role", "creator") + s.SettingCreate(m, "leader_payfor", "radio", "help", "允许管理人员支付项目", "role", "creator") + s.SettingCreate(m, "leader_program", "radio", "help", "允许管理人员本地开发", "role", "tech") + s.SettingCreate(m, "creator_program", "radio", "help", "允许创建人本地开发", "role", "tech") } func (s Portal) AfterPlaceAuth(m *ice.Message, arg ...string) { defer s.DashboardCreate(m, "")() diff --git a/src/production/portal.json b/src/production/portal.json index 7f656fc..d8f8da4 100644 --- a/src/production/portal.json +++ b/src/production/portal.json @@ -62,7 +62,7 @@ "meet_type": "会议类型", "meet_link": "会议链接", "file_type": "文件类型", - "file_link": "文件链接", + "file_link": "文件上传", "file_name": "文件名称", "file_size": "文件大小", "from_user_uid": "付款人", diff --git a/src/production/take.go b/src/production/take.go index dfdcbbe..94d1786 100644 --- a/src/production/take.go +++ b/src/production/take.go @@ -2,8 +2,11 @@ package production import ( "shylinux.com/x/ice" - "shylinux.com/x/operation/src/production/model" + "shylinux.com/x/icebergs/base/ctx" + "shylinux.com/x/icebergs/base/web" kit "shylinux.com/x/toolkits" + + "shylinux.com/x/operation/src/production/model" ) type take struct { @@ -29,7 +32,7 @@ func (s take) List(m *ice.Message, arg ...string) { m.Push(model.CONTENT, kit.Select(val[model.CONTENT], val[model.ISSUE_CONTENT], val[model.DESIGN_CONTENT])) m.Push(model.LINK, val[model.LINK]) m.Push(model.STORY_NAME, value[model.NAME]) - m.Push(model.STORY_UID, value[model.UID]) + m.Push(model.STORY_UID, val[model.STORY_UID]) m.Push(model.USER_UID, val[model.USER_UID]) if val[model.LINK] == "" { m.PushButton(s.Info, s.Main) @@ -84,7 +87,10 @@ func (s take) List(m *ice.Message, arg ...string) { 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可测试") }) + m.Cmd(Case{}, s.Select, model.STORY_UID, value[model.UID]).Table(func(val ice.Maps) { + val[model.LINK] = web.S(val[web.SPACE]) + web.C(val[ctx.INDEX]) + push(val, "QA可测试") + }) } }) m.Display("").DisplayCSS("").Sort(kit.Fields(model.TYPE, model.UPDATED_AT), []string{ diff --git a/src/production/task.go b/src/production/task.go index 6eca106..98daae1 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,begin_time,end_time,process_time,finish_time,issue_uid,plan_uid,user_uid"` + fields string `data:"title,content,status,space,path,case_count,begin_time,end_time,process_time,finish_time,issue_uid,plan_uid,story_uid,user_uid"` create string `name:"create issue_uid* title* content* space path begin_time:select@date end_time:select@date" role:"worker"` modify string `name:"modify title* content* space path begin_time*:select@date end_time*:select@date" role:"worker"` finish string `name:"finish" role:"worker"`