This commit is contained in:
IT 老营长 @云轩领航-创始人 2025-05-28 13:57:13 +08:00
parent 4f044fee10
commit 93201d7992
11 changed files with 60 additions and 26 deletions

View File

@ -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"`

View File

@ -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
}
}

View File

@ -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{}

View File

@ -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) {

View File

@ -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{}) }

View File

@ -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"`

View File

@ -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

View File

@ -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, "")()

View File

@ -62,7 +62,7 @@
"meet_type": "会议类型",
"meet_link": "会议链接",
"file_type": "文件类型",
"file_link": "文件链接",
"file_link": "文件上传",
"file_name": "文件名称",
"file_size": "文件大小",
"from_user_uid": "付款人",

View File

@ -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{

View File

@ -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"`