This commit is contained in:
IT 老营长 @云轩领航-创始人 2025-05-26 18:41:58 +08:00
parent 6e59592309
commit 3870e9777c
13 changed files with 64 additions and 30 deletions

View File

@ -9,6 +9,7 @@ import (
type care struct {
Tables
order string `data:"6"`
role string `data:"leader,worker"`
setInfo string `name:"setInfo info" help:"备注" role:"worker"`
}

View File

@ -11,7 +11,8 @@ import (
type Case struct {
Table
order string `data:"5"`
fields string `data:"title,content,status,space,index,begin_time,end_time,process_time,finish_time,task_uid,plan_uid,user_uid"`
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"`
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"`
@ -37,6 +38,7 @@ func (s Case) List(m *ice.Message, arg ...string) {
s.PushTaskButton(m, value, s.Preview)
}
}).RenameAppend(model.STATUS, model.CASE_STATUS).Display("")
s.OtherListCmd(m, s.TaskList)
}
func (s Case) Process(m *ice.Message, arg ...string) {
s.changeStatus(m, IssueCreate, IssueProcess)

View File

@ -36,6 +36,7 @@ type Table struct {
upload string `name:"upload" role:"worker"`
download string `name:"download" style:"notice" role:"worker"`
fileCreate string `name:"fileCreate title* content file_type*:select file_link*@upload" help:"上传附件" role:"worker"`
dateInsert string `name:"dateInsert" help:"约会" role:"leader"`
planList string `name:"planList" role:"worker"`
issueList string `name:"issueList" role:"worker"`
designList string `name:"designList" role:"worker"`
@ -44,7 +45,6 @@ type Table struct {
fileList string `name:"fileList" role:"worker"`
meetList string `name:"meetList" role:"worker"`
dealList string `name:"dealList" role:"worker"`
dateInsert string `name:"dateInsert" help:"约会" role:"leader"`
}
func (s Table) Inputs(m *ice.Message, arg ...string) {
@ -131,6 +131,7 @@ func (s Table) DateInsert(m *ice.Message, arg ...string) {
}
func (s Table) PushIssueButton(m *ice.Message, value ice.Maps, arg ...ice.Any) {
user_uid := m.Option(ice.MSG_USERUID)
// button := []ice.Any{s.Remove}
button := []ice.Any{}
defer func() { m.PushButton(button...) }()
isCreator, isLeader, isWorker := s.IsCreator(m), s.IsLeader(m), s.IsWorker(m)
@ -167,8 +168,11 @@ func (s Table) PushIssueButton(m *ice.Message, value ice.Maps, arg ...ice.Any) {
if isWorker {
button = append(button, arg...)
}
if isLeaderFinish {
button = append(button, s.Cancel)
}
case IssueSubmit:
if isWorker {
if isWorker && value[model.LINK] != "" {
button = append(button, s.Preview)
}
if isWorker {
@ -178,13 +182,15 @@ func (s Table) PushIssueButton(m *ice.Message, value ice.Maps, arg ...ice.Any) {
button = append(button, arg...)
}
if isLeaderFinish {
button = append(button, s.Finish, s.Reback, s.Cancel)
button = append(button, s.Finish, s.Reback)
}
case IssueFinish:
if isWorker {
if isWorker && value[model.LINK] != "" {
button = append(button, s.Preview)
}
if isLeader {
if isWorker && PlanStatus(kit.Int(value[model.PLAN_STATUS])) != PlanFinish {
button = append(button, s.FileCreate)
} else if isLeader {
button = append(button, s.FileCreate)
}
if isWorker {
@ -279,7 +285,7 @@ func (s Table) Reback(m *ice.Message, arg ...string) {
s.ChangeStatus(m, int(IssueSubmit), int(IssueProcess))
}
func (s Table) Cancel(m *ice.Message, arg ...string) {
s.ChangeStatus(m, int(IssueSubmit), int(IssueCancel))
s.ChangeStatus(m, int(IssueProcess), int(IssueCancel))
}
func (s Table) Trash(m *ice.Message, arg ...string) {
s.Delete(m, m.OptionSimple(model.UID, model.STORY_UID)...)
@ -290,7 +296,13 @@ func (s Table) Preview(m *ice.Message, arg ...string) {
}
func (s Table) Program(m *ice.Message, arg ...string) {
p := path.Base(m.Option(nfs.PATH))
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")))
m.ProcessOpen(m.MergePodCmd("", "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) Discuss(m *ice.Message, arg ...string) {
s.issueOtherCreate(m, Meet{}, arg...)

View File

@ -10,6 +10,7 @@ import (
type Date struct {
Tables
order string `data:"9"`
role string `data:"leader,worker"`
discuss string `name:"discuss issue_uid*:select meet_type*:select meet_link* begin_time*:select@date" role:"leader"`
}
@ -19,6 +20,7 @@ func (s Date) Discuss(m *ice.Message, arg ...string) {
msg.AppendSimple(model.TITLE), model.CONTENT, msg.Append(model.ISSUE_CONTENT))
}
func (s Date) List(m *ice.Message, arg ...string) {
s.Limit(m, 300)
if msg := s.SelectJoinAuth(m.Cmd(story{}, s.Select, model.UID, arg[0])); msg.Append("auth_status") == "issued" {
m.Cmdy(Meet{}, s.Select, msg.AppendSimple(model.COMPANY_UID))
} else {
@ -34,11 +36,11 @@ func init() { ice.TeamCtxCmd(Date{}) }
func (s Date) head(m *ice.Message, arg ...string) {
head := []string{}
for i := 0; i < 3; i++ {
for i := -kit.Int(m.Option("date_begin")); i < kit.Int(m.OptionDefault("date_end", "2")); i++ {
head = append(head, strings.Split(m.Time(kit.Format("%dh", i*24)), " ")[0])
}
list := []string{}
for i := 38; i < 48; i++ {
for i := kit.Int(m.OptionDefault("date_start", "38")); i < kit.Int(m.OptionDefault("date_stop", "48")); i++ {
if i%2 == 0 {
list = append(list, kit.Format("%2d:00", i/2))
} else {

View File

@ -10,6 +10,7 @@ import (
type Design struct {
Table
order string `data:"3"`
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"`
@ -29,7 +30,7 @@ func (s Design) Reject(m *ice.Message, arg ...string) {
s.issueCount(m)
}
func (s Design) Cancel(m *ice.Message, arg ...string) {
s.ChangeStatus(m, int(IssueCreate), int(IssueCancel))
s.ChangeStatus(m, int(IssueProcess), int(IssueCancel))
s.issueCount(m)
}
func (s Design) List(m *ice.Message, arg ...string) {

View File

@ -15,6 +15,7 @@ import (
type File struct {
Table
order string `data:"11"`
role string `data:"leader,worker"`
fields string `data:"title,content,file_type,file_link,file_name,file_size,issue_uid,user_uid"`
create string `name:"create issue_uid* title* content file_type*:select file_link*@upload" role:"worker"`
}

View File

@ -33,7 +33,7 @@ func (s Issue) Reject(m *ice.Message, arg ...string) {
s.planCount(m).DashboardUpdate(m)
}
func (s Issue) Cancel(m *ice.Message, arg ...string) {
s.ChangeStatus(m, int(IssueSubmit), int(IssueCancel))
s.ChangeStatus(m, int(IssueProcess), int(IssueCancel))
s.planCount(m).DashboardUpdate(m)
}
func (s Table) BindPlan(m *ice.Message, arg ...string) {

View File

@ -12,10 +12,12 @@ import (
type Meet struct {
Table
order string `data:"10"`
role string `data:"leader,worker"`
fields string `data:"from_user_uid,to_user_uid,title,content,meet_type,meet_link,begin_time,end_time,issue_uid,plan_uid,story_uid,company_uid"`
create string `name:"create issue_uid* from_user_uid* to_user_uid* title* content* meet_type* meet_link* date time" role:"leader"`
modify string `name:"modify" role:"leader"`
remove string `name:"remove" role:"leader"`
preview string `name:"preview" help:"入会" role:"worker"`
preview string `name:"preview" help:"入会" role:"void"`
}
func (s Meet) Create(m *ice.Message, arg ...string) {
@ -35,7 +37,7 @@ func (s Meet) List(m *ice.Message, arg ...string) {
m.PushAction(s.Preview)
}
kit.If(!s.IsLeader(m) && m.Length() == 0, func() { m.SetResult().Echo("请等待管理员创建会议") })
s.OtherListCmd(m, s.IssueList, s.DesignList, s.DealList)
s.OtherListCmd(m, s.IssueList, s.DesignList)
}
func init() { ice.TeamCtxCmd(Meet{}) }

View File

@ -20,7 +20,13 @@ type Plan struct {
}
func (s Plan) Create(m *ice.Message, arg ...string) {
s.ValueCreate(m, 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("168h"))...))
s.Transaction(m, func() {
if m.WarnNotValid(s.Select(m, m.OptionSimple(model.STORY_UID, model.TITLE, model.VERSION)...).Length() > 0, "项目已经存在") {
return
}
s.ValueCreate(m, arg...)
})
s.SendMessage(m, "", "")
}
func (s Plan) List(m *ice.Message, arg ...string) {
@ -46,6 +52,9 @@ func (s Plan) List(m *ice.Message, arg ...string) {
if isLeader && m.Option(model.MARKET_UID) == "" {
button = append(button, s.MarketInsert)
}
if isCreator {
button = append(button, s.SetType)
}
if isLeader && kit.Int(value[model.ISSUE_COUNT]) > 0 {
button = append(button, s.Finish)
}
@ -53,11 +62,11 @@ func (s Plan) List(m *ice.Message, arg ...string) {
button = append(button, s.Remove)
}
case PlanFinish:
if isCreator {
button = append(button, s.SetType)
}
kit.If(m.FieldsIsDetail(), func() { s.DoneMessage(m) })
}
if isCreator {
button = append(button, s.SetType)
}
}).Display("").DisplayCSS("")
s.OtherListCmd(m, s.IssueList, s.DesignList, s.TaskList, s.CaseList)
}

View File

@ -9,6 +9,7 @@ import (
type Stat struct {
Tables
order string `data:"8"`
role string `data:"leader,worker"`
}
func (s Stat) List(m *ice.Message, arg ...string) {
@ -34,14 +35,14 @@ func (s Stat) List(m *ice.Message, arg ...string) {
stats = s.Count(m, Plan{}, model.STATUS, model.STORY_UID, value[model.UID], model.STATUS, kit.Format(PlanProcess), model.ISSUE_COUNT, "0")
m.Push("待接单", sum(PlanProcess))
stats = s.Count(m, Issue{}, model.STATUS, model.STORY_UID, value[model.UID])
m.Push("原型设计中", sum(IssueCreate, IssueApproved, IssueProcess, IssueSubmit))
m.Push("原型设计中", sum(IssueApproved, IssueProcess, IssueSubmit))
stats = s.Count(m, Design{}, model.STATUS, model.STORY_UID, value[model.UID])
m.Push("界面设计中", sum(IssueCreate, IssueApproved, IssueProcess, IssueSubmit))
m.Push("界面设计中", sum(IssueApproved, IssueProcess, IssueSubmit))
price, msg := 0, m.Spawn()
s.Tables.Tables(msg, "left join deals on issues.user_uid = deals.user_uid AND issues.uid = deals.issue_uid")
s.Fields(msg, "issues.title, issues.price AS issue_price, SUM(deals.price) AS deal_price").Groups(msg, "issues.uid")
msg.Cmd(Issue{}, s.Select, "issues.story_uid = ? AND (status != ? AND status != ? AND status != ?) AND deals.deleted_at IS NULL",
value[model.UID], kit.Format(IssueCreate), kit.Format(IssueRejected), kit.Format(IssueCancel),
value[model.UID], IssueCreate, IssueRejected, IssueCancel,
).Table(func(value ice.Maps) {
p := kit.Int(value["issue_price"]) - kit.Int(value["deal_price"])
kit.If(p > 0, func() { price += p })
@ -49,7 +50,7 @@ func (s Stat) List(m *ice.Message, arg ...string) {
s.Tables.Tables(msg, "left join deals on designs.user_uid = deals.user_uid AND designs.issue_uid = deals.issue_uid")
s.Fields(msg, "designs.title, designs.price AS design_price, SUM(deals.price) AS deal_price").Groups(msg, "designs.uid")
msg.Cmd(Design{}, s.Select, "designs.story_uid = ? AND (status != ? AND status != ? AND status != ?) AND deals.deleted_at IS NULL",
value[model.UID], kit.Format(IssueCreate), kit.Format(IssueRejected), kit.Format(IssueCancel),
value[model.UID], IssueCreate, IssueRejected, IssueCancel,
).Table(func(value ice.Maps) {
p := kit.Int(value["design_price"]) - kit.Int(value["deal_price"])
kit.If(p > 0, func() { price += p })

View File

@ -9,12 +9,14 @@ import (
type take struct {
Tables
order string `data:"7"`
role string `data:"leader,worker"`
info string `name:"info" help:"详情" style:"notice" role:"worker"`
main string `name:"main" help:"主页" style:"notice" role:"worker"`
}
func (s take) List(m *ice.Message, arg ...string) {
s.Limit(m, 300)
isLeader := s.IsLeader(m)
s.SelectAuthPlace(m, story{}).Table(func(value ice.Maps) {
if value["auth_status"] != "issued" {
return
@ -57,13 +59,13 @@ func (s take) List(m *ice.Message, arg ...string) {
deadline := m.Time("-120h")
check := func(target ice.Any, t string) {
m.Cmd(target, s.Select, model.STORY_UID, value[model.UID]).Table(func(val ice.Maps) {
if !m.IsTech() {
if !isLeader {
kit.If(kit.IsIn(val[model.SCORE], "4", "5"), func() { push(val, t+"优秀项目") })
return
}
switch IssueStatus(kit.Int(val[model.STATUS])) {
case IssueCreate:
push(val, t+"待审")
push(val, t+"待")
case IssueProcess:
kit.If(kit.Select(val[model.CREATED_AT], val[model.UPDATED_AT]) < deadline, func() {
})
@ -77,15 +79,15 @@ func (s take) List(m *ice.Message, arg ...string) {
}
check(Issue{}, "PM")
check(Design{}, "UI")
if m.IsTech() {
if isLeader {
m.Cmd(Task{}, s.Select, model.STORY_UID, value[model.UID]).Table(func(val ice.Maps) { push(val, "RD可编程") })
m.Cmd(Case{}, s.Select, model.STORY_UID, value[model.UID]).Table(func(val ice.Maps) { push(val, "QA可测试") })
}
})
m.Display("").DisplayCSS("").Sort(kit.Fields(model.TYPE, model.UPDATED_AT), []string{
"PM可接单", "UI可接单", "PM优秀项目", "UI优秀项目",
"PM待审", "PM待提交", "PM待验收",
"UI待审", "UI待提交", "UI待验收",
"PM待", "PM待提交", "PM待验收",
"UI待", "UI待提交", "UI待验收",
"RD可接单", "RD可编程", "QA可测试",
}, ice.STR_R)
}
@ -94,9 +96,9 @@ func (s take) Info(m *ice.Message, arg ...string) {
switch m.Option(model.TYPE) {
case "PM可接单", "RD可接单":
target = Plan{}
case "UI可接单", "PM优秀项目", "PM待审", "PM待提交", "PM待验收":
case "UI可接单", "PM优秀项目", "PM待", "PM待提交", "PM待验收":
target = Issue{}
case "UI优秀项目", "UI待审", "UI待提交", "UI待验收":
case "UI优秀项目", "UI待", "UI待提交", "UI待验收":
target = Design{}
case "RD可测试":
target = Task{}

View File

@ -9,7 +9,7 @@ Volcanos(chat.ONIMPORT, {
case "PM可接单":
case "RD可接单": index = "web.team.production.plan"; break
case "UI优秀项目":
case "UI待审":
case "UI待":
case "UI待提交":
case "UI待验收": index = "web.team.production.design"; break
case "RD可编程": index = "web.team.production.task"; break

View File

@ -10,6 +10,7 @@ import (
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"`
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"`