mirror of
https://shylinux.com/x/operation
synced 2025-07-03 14:01:20 +08:00
add some
This commit is contained in:
parent
d4d9b90c81
commit
6780763856
@ -1,14 +1,65 @@
|
||||
package production
|
||||
|
||||
import "shylinux.com/x/ice"
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
"shylinux.com/x/operation/src/production/model"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
)
|
||||
|
||||
type care struct {
|
||||
Tables
|
||||
order string `data:"7"`
|
||||
order string `data:"6"`
|
||||
}
|
||||
|
||||
func (s care) List(m *ice.Message, arg ...string) {
|
||||
// s.ValueList(m, arg).Display("")
|
||||
if s.Fields(m, model.USER_UID); s.IsLeader(m) {
|
||||
if len(arg) == 1 {
|
||||
m.Cmdy(userStory{}, s.Select, model.STORY_UID, arg[0])
|
||||
} else {
|
||||
m.FieldsSetDetail()
|
||||
m.Cmdy(userStory{}, s.Select, model.STORY_UID, arg[0], model.USER_UID, arg[1])
|
||||
}
|
||||
} else {
|
||||
m.FieldsSetDetail()
|
||||
m.Cmdy(userStory{}, s.Select, model.STORY_UID, arg[0], model.USER_UID, m.Option(model.USER_UID))
|
||||
}
|
||||
m.Table(func(value ice.Maps) {
|
||||
var stats = map[string]string{}
|
||||
sum := func(arg ...ice.Any) (res int) {
|
||||
kit.For(arg, func(value ice.Any) { res += kit.Int(stats[kit.Format(value)]) })
|
||||
return
|
||||
}
|
||||
stats = s.Count(m.Spawn(), Issue{}, model.STATUS, model.USER_UID, value[model.USER_UID])
|
||||
m.Push("原型已完成", sum(IssueFinish))
|
||||
m.Push("原型设计中", sum(IssueCreate, IssueApproved, IssueProcess, IssueSubmit))
|
||||
stats = s.Count(m.Spawn(), Design{}, model.STATUS, model.USER_UID, value[model.USER_UID])
|
||||
m.Push("界面已完成", sum(IssueFinish))
|
||||
m.Push("界面设计中", sum(IssueCreate, IssueApproved, IssueProcess, IssueSubmit))
|
||||
deal, msg := 0, m.Spawn()
|
||||
s.Fields(msg, "SUM(price) AS price").Groups(msg, model.TO_USER_UID)
|
||||
msg.Cmd(Deal{}, s.Select, model.TO_USER_UID, value[model.USER_UID]).Table(func(value ice.Maps) {
|
||||
deal += kit.Int(value[model.PRICE])
|
||||
})
|
||||
m.Push("已支付", kit.Format(deal/100))
|
||||
m.Push(model.UID, value[model.USER_UID])
|
||||
})
|
||||
if m.Action().Display(""); m.FieldsIsDetail() {
|
||||
s.OtherListCmd(m, s.IssueList, s.DesignList)
|
||||
} else {
|
||||
m.Sort(kit.Fields("已支付", "原型已完成", "原型设计中", "界面已完成", "界面设计中"), ice.INT_R, ice.INT_R, ice.INT_R, ice.INT_R, ice.INT_R)
|
||||
}
|
||||
}
|
||||
func (s care) IssueList(m *ice.Message, arg ...string) {
|
||||
s.Orders(m, model.STATUS, model.DESIGN_COUNT, model.TASK_COUNT, s.Desc(model.CREATED_AT)).Limit(m, 300)
|
||||
m.Cmdy(Issue{}, s.Select, model.USER_UID, m.Option(model.UID))
|
||||
m.RenameAppend(model.STORY_UID, model.PLACE_UID).Options("_other_cmd", ice.GetTypeKey(Issue{})).Display("issue.js")
|
||||
s.SelectJoinUser(m)
|
||||
}
|
||||
func (s care) DesignList(m *ice.Message, arg ...string) {
|
||||
s.Orders(m, model.STATUS, s.Desc(model.CREATED_AT)).Limit(m, 300)
|
||||
m.Cmdy(Design{}, s.Select, model.USER_UID, m.Option(model.UID))
|
||||
m.RenameAppend(model.STORY_UID, model.PLACE_UID).Options("_other_cmd", ice.GetTypeKey(Design{})).Display("design.js")
|
||||
s.SelectJoinUser(m)
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(care{}) }
|
||||
|
19
src/production/care.js
Normal file
19
src/production/care.js
Normal file
@ -0,0 +1,19 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
can.onimport.myView(can, msg, function(value) { return [
|
||||
{view: html.TITLE, list: [
|
||||
value.user_name,
|
||||
can.onimport.unitView(can, value, "已支付", "元"),
|
||||
can.onimport.titleAction(can, value),
|
||||
]},
|
||||
{view: html.STATUS, list: [
|
||||
can.onimport.unitView(can, value, "原型已完成", "个"),
|
||||
can.onimport.unitView(can, value, "原型设计中", "个"),
|
||||
]},
|
||||
{view: html.STATUS, list: [
|
||||
can.onimport.unitView(can, value, "界面已完成", "个"),
|
||||
can.onimport.unitView(can, value, "界面设计中", "个"),
|
||||
]},
|
||||
] })
|
||||
},
|
||||
})
|
@ -111,7 +111,9 @@ func (s Table) RewriteAppend(m *ice.Message, arg ...string) *ice.Message {
|
||||
}
|
||||
func (s Table) PushIssueButton(m *ice.Message, value ice.Maps, user_uid string, arg ...ice.Any) {
|
||||
button := []ice.Any{}
|
||||
// button := []ice.Any{s.Remove}
|
||||
if value[model.PLAN_TITLE] == "" {
|
||||
button = append(button, s.BindPlan)
|
||||
}
|
||||
defer func() { m.PushButton(button...) }()
|
||||
isCreator, isLeader, isWorker := s.IsCreator(m), s.IsLeader(m), s.IsWorker(m)
|
||||
switch IssueStatus(kit.Int(value[model.STATUS])) {
|
||||
@ -120,7 +122,10 @@ 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)
|
||||
button = append(button, s.Approve)
|
||||
}
|
||||
if isLeader {
|
||||
button = append(button, s.Reject)
|
||||
}
|
||||
if user_uid == value[model.USER_UID] {
|
||||
button = append(button, s.Modify, s.Remove)
|
||||
@ -140,26 +145,25 @@ func (s Table) PushIssueButton(m *ice.Message, value ice.Maps, user_uid string,
|
||||
if user_uid == value[model.USER_UID] {
|
||||
button = append(button, s.Submit)
|
||||
}
|
||||
// button = append(button, s.Remove)
|
||||
case IssueSubmit:
|
||||
if isWorker {
|
||||
button = append(button, s.Preview)
|
||||
}
|
||||
if isCreator {
|
||||
button = append(button, s.Discuss, s.Payfor)
|
||||
}
|
||||
if isWorker {
|
||||
button = append(button, s.Preview)
|
||||
}
|
||||
if isCreator {
|
||||
button = append(button, s.Finish, s.Reback, s.Cancel)
|
||||
}
|
||||
case IssueFinish:
|
||||
if isWorker {
|
||||
button = append(button, s.Preview)
|
||||
}
|
||||
if PlanStatus(kit.Int(value[model.PLAN_STATUS])) != PlanFinish {
|
||||
if isCreator {
|
||||
button = append(button, s.Discuss, s.Payfor)
|
||||
}
|
||||
}
|
||||
if isWorker {
|
||||
button = append(button, s.Preview)
|
||||
}
|
||||
if isWorker {
|
||||
button = append(button, arg...)
|
||||
}
|
||||
@ -172,9 +176,8 @@ func (s Table) PushIssueButton(m *ice.Message, value ice.Maps, user_uid string,
|
||||
}
|
||||
func (s Table) PushTaskButton(m *ice.Message, value ice.Maps, user_uid string, arg ...ice.Any) {
|
||||
button := []ice.Any{}
|
||||
defer func() { m.PushButton(button...) }()
|
||||
isWorker := s.IsWorker(m)
|
||||
// isCreator, isLeader, isWorker := s.IsCreator(m), s.IsLeader(m), s.IsWorker(m)
|
||||
// _ = isLeader
|
||||
switch IssueStatus(kit.Int(value[model.STATUS])) {
|
||||
case IssueCreate:
|
||||
if user_uid == value[model.USER_UID] {
|
||||
@ -193,7 +196,6 @@ func (s Table) PushTaskButton(m *ice.Message, value ice.Maps, user_uid string, a
|
||||
}
|
||||
kit.If(m.FieldsIsDetail(), func() { s.DoneMessage(m) })
|
||||
}
|
||||
m.PushButton(button...)
|
||||
}
|
||||
func (s Table) SelectJoinPlan(m *ice.Message, arg ...string) {
|
||||
s.SelectJoin(m, Plan{}, model.TITLE, model.STATUS)
|
||||
@ -283,7 +285,7 @@ func (s Table) OtherCreate(m *ice.Message, target ice.Any, arg ...string) {
|
||||
kit.If(!m.IsErr(), func() { m.ProcessField(target, []string{m.Option(model.STORY_UID), m.Result()}) })
|
||||
}
|
||||
func (s Table) OtherList(m *ice.Message, target ice.Any, arg ...string) *ice.Message {
|
||||
m.Cmdy(target, s.Select, m.OptionSimple(model.STORY_UID), m.CommandKey()+"_uid", m.Option(model.UID)).Option("_command", ice.GetTypeKey(target))
|
||||
m.Cmdy(target, s.Select, m.OptionSimple(model.STORY_UID), m.CommandKey()+"_uid", m.Option(model.UID))
|
||||
if m.ActionKeyIsIn(s.MeetList, s.DealList) {
|
||||
if s.IsLeader(m) {
|
||||
m.RenameAppend(model.TO_USER_UID, model.USER_UID)
|
||||
@ -291,9 +293,14 @@ func (s Table) OtherList(m *ice.Message, target ice.Any, arg ...string) *ice.Mes
|
||||
m.RenameAppend(model.FROM_USER_UID, model.USER_UID)
|
||||
}
|
||||
}
|
||||
m.Option("_other_cmd", ice.GetTypeKey(target))
|
||||
s.SelectJoinUser(m)
|
||||
return m
|
||||
}
|
||||
func (s Table) OtherListCmd(m *ice.Message, arg ...ice.Any) *ice.Message {
|
||||
kit.If(s.IsWorker(m), func() { m.Option("otherList", kit.Fields(arg...)) })
|
||||
return m
|
||||
}
|
||||
func (s Table) otherListButton(m *ice.Message, arg ...string) {
|
||||
m.Table(func(value ice.Maps) {
|
||||
switch IssueStatus(kit.Int(value[model.STATUS])) {
|
||||
|
2
src/production/date.css
Normal file
2
src/production/date.css
Normal file
@ -0,0 +1,2 @@
|
||||
$output th { box-shadow:none; color:var(--disable-fg-color); font-style:italic; padding:10px; }
|
||||
$output td { border:var(--box-border); padding:0; cursor:pointer; }
|
47
src/production/date.go
Normal file
47
src/production/date.go
Normal file
@ -0,0 +1,47 @@
|
||||
package production
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
"shylinux.com/x/operation/src/production/model"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type date struct {
|
||||
Tables
|
||||
order string `data:"9"`
|
||||
discuss string `name:"discuss issue_uid*:select meet_type*:select link* begin_time*" role:"leader"`
|
||||
}
|
||||
|
||||
func (s date) Discuss(m *ice.Message, arg ...string) {
|
||||
msg := m.Cmd(Issue{}, s.Select, model.UID, m.Option(model.ISSUE_UID), model.STORY_UID, m.Option(model.STORY_UID))
|
||||
m.Cmdy(Meet{}, s.Create, arg, model.FROM_USER_UID, m.Option(model.USER_UID), model.TO_USER_UID, msg.Append(model.USER_UID),
|
||||
msg.AppendSimple(model.TITLE, model.CONTENT),
|
||||
)
|
||||
}
|
||||
func (s date) List(m *ice.Message, arg ...string) {
|
||||
if msg := s.SelectJoinAuth(m.Cmd(story{}, s.Select, model.UID, arg[0])); msg.Append("auth_status") == "issued" {
|
||||
m.Cmdy(Meet{}, s.Select, model.COMPANY_UID, msg.Append(model.COMPANY_UID))
|
||||
} else {
|
||||
m.Cmdy(Meet{}, s.Select, model.STORY_UID, arg[0])
|
||||
}
|
||||
m.RenameAppend(model.TO_USER_UID, model.USER_UID)
|
||||
s.SelectJoin(m, story{}, model.NAME, model.INFO)
|
||||
m.Action().Display("").DisplayCSS("")
|
||||
head := []string{}
|
||||
for i := 0; i < 3; i++ {
|
||||
head = append(head, strings.Split(m.Time(kit.Format("%dh", i*24)), " ")[0])
|
||||
}
|
||||
list := []string{}
|
||||
for i := 38; i < 48; i++ {
|
||||
if i%2 == 0 {
|
||||
list = append(list, kit.Format("%2d:00", i/2))
|
||||
} else {
|
||||
list = append(list, kit.Format("%2d:30", i/2))
|
||||
}
|
||||
}
|
||||
m.Option("head", strings.Join(head, ","))
|
||||
m.Option("list", strings.Join(list, ","))
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(date{}) }
|
26
src/production/date.js
Normal file
26
src/production/date.js
Normal file
@ -0,0 +1,26 @@
|
||||
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}
|
||||
}))}]},
|
||||
{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) {
|
||||
return {type: html.TD, list: msg.Table(function(value) { if (!can.base.beginWith(value.begin_time, date+" "+time)) { return }
|
||||
return {view: html.ITEM, _init: function(target) { var msg = can.request({}); msg.Push(value)
|
||||
can.onimport.myView(can, msg, function(value) { return [
|
||||
{view: html.TITLE, list: [value.title, value.meet_type]},
|
||||
{view: html.STATUS, list: [value.story_name, value.user_name]},
|
||||
// {view: html.STATUS, list: [value.content]},
|
||||
] }, function(event, value) { can.onkeymap.prevent(event)
|
||||
can.onimport.myStory(can, { index: "web.team.production.meet", args: [value.story_uid, value.uid], })
|
||||
}, target)
|
||||
}}
|
||||
}), onclick: function(event) {
|
||||
can.run(can.request(event, {begin_time: date+" "+time+":00"}), [ctx.ACTION, "discuss"])
|
||||
}}
|
||||
}))}
|
||||
})},
|
||||
]}])
|
||||
},
|
||||
})
|
@ -8,7 +8,7 @@ import (
|
||||
|
||||
type Deal struct {
|
||||
Table
|
||||
order string `data:"9"`
|
||||
order string `data:"11"`
|
||||
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 title* content" role:"leader"`
|
||||
@ -31,7 +31,6 @@ func (s Deal) List(m *ice.Message, arg ...string) {
|
||||
s.DoneMessage(m)
|
||||
}
|
||||
}
|
||||
m.PushAction(s.Modify)
|
||||
if m.Display(""); s.IsLeader(m) {
|
||||
m.RenameAppend(model.TO_USER_UID, model.USER_UID)
|
||||
} else {
|
||||
|
@ -10,8 +10,8 @@ import (
|
||||
type Design struct {
|
||||
Table
|
||||
order string `data:"3"`
|
||||
fields string `data:"title,content,status,price,link,begin_time,end_time,process_time,finish_time,issue_uid,plan_uid,user_uid"`
|
||||
create string `name:"create issue_uid* title* content* price*=1000 begin_time:select@date end_time:select@date" role:"worker"`
|
||||
fields string `data:"updated_at,title,content,status,price,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* content* price*=1000 begin_time:select@date end_time:select@date" role:"worker"`
|
||||
modify string `name:"modify title* content* price* link begin_time*:select@date end_time*:select@date" role:"worker"`
|
||||
}
|
||||
|
||||
@ -30,11 +30,10 @@ func (s Design) Cancel(m *ice.Message, arg ...string) {
|
||||
}
|
||||
func (s Design) List(m *ice.Message, arg ...string) {
|
||||
user_uid := m.Option(model.USER_UID)
|
||||
s.Limit(m, 300)
|
||||
s.Orders(m, model.STATUS, s.Desc(model.CREATED_AT))
|
||||
s.Orders(m, model.STATUS, s.Desc(model.UPDATED_AT)).Limit(m, 300)
|
||||
s.ValueList(m, arg)
|
||||
s.SelectJoinPlan(m)
|
||||
// s.StatusCount(m, arg...)
|
||||
m.Table(func(value ice.Maps) { s.PushIssueButton(m, value, user_uid) }).Display("")
|
||||
kit.If(len(arg) == 1, func() { m.Sort("plan_status,status,updated_at", ice.STR, ice.STR, ice.STR_R) })
|
||||
}
|
||||
func init() { ice.TeamCtxCmd(Design{}) }
|
||||
|
@ -3,11 +3,10 @@ Volcanos(chat.ONIMPORT, {
|
||||
can.onimport.myViewTabs(can, "status", 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),
|
||||
(value.process_time||value.begin_time).split(" ")[0],
|
||||
can.onimport.timeView(can, value),
|
||||
can.onimport.unitView(can, value, "plan_title"),
|
||||
]},
|
||||
// value.price > 0 && {view: html.OUTPUT, list: [can.onimport.unitView(can, value, "price", "元")]},
|
||||
// msg.IsTech() && value.price > 0 && {view: html.OUTPUT, list: [can.onimport.unitView(can, value, "price", "元")]},
|
||||
{view: html.OUTPUT, list: [value.content]}, can.onimport.titleAction(can, value),
|
||||
] })
|
||||
},
|
||||
|
@ -10,11 +10,12 @@ import (
|
||||
type Issue struct {
|
||||
Table
|
||||
order string `data:"2"`
|
||||
fields string `data:"title,content,issue_type,level,status,price,link,design_count,task_count,begin_time,end_time,process_time,finish_time,plan_uid,user_uid"`
|
||||
create string `name:"create plan_uid* title* content* issue_type:select level:select price=1000 begin_time:select@date end_time:select@date" role:"worker"`
|
||||
fields string `data:"updated_at,title,content,issue_type,level,status,price,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* content* issue_type:select level:selelt price=1000 begin_time:select@date end_time:select@date" role:"worker"`
|
||||
modify string `name:"modify title* content* price* link begin_time:select@date end_time:select@date" role:"worker"`
|
||||
designCreate string `name:"designCreate title* 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"`
|
||||
}
|
||||
|
||||
func (s Issue) Create(m *ice.Message, arg ...string) {
|
||||
@ -35,17 +36,18 @@ func (s Issue) Cancel(m *ice.Message, arg ...string) {
|
||||
s.ChangeStatus(m, int(IssueSubmit), int(IssueCancel))
|
||||
s.planCount(m).DashboardUpdate(m)
|
||||
}
|
||||
func (s Table) BindPlan(m *ice.Message, arg ...string) {
|
||||
s.Update(m, arg, m.OptionSimple(model.UID, model.STORY_UID)...)
|
||||
}
|
||||
func (s Issue) List(m *ice.Message, arg ...string) {
|
||||
if !s.IsWorker(m) {
|
||||
s.ApplyCheck(m, arg...)
|
||||
return
|
||||
}
|
||||
user_uid, isCreator, isWorker := m.Option(model.USER_UID), s.IsCreator(m), s.IsWorker(m)
|
||||
s.Limit(m, 300)
|
||||
s.Orders(m, model.STATUS, model.DESIGN_COUNT, model.TASK_COUNT, s.Desc(model.CREATED_AT))
|
||||
s.Orders(m, model.STATUS, model.DESIGN_COUNT, model.TASK_COUNT, s.Desc(model.UPDATED_AT)).Limit(m, 300)
|
||||
s.ValueList(m, arg)
|
||||
s.SelectJoinPlan(m)
|
||||
// s.StatusCount(m, arg...)
|
||||
m.Table(func(value ice.Maps) {
|
||||
button := []ice.Any{}
|
||||
if PlanStatus(kit.Int(value[model.PLAN_STATUS])) != PlanFinish {
|
||||
@ -57,8 +59,11 @@ func (s Issue) List(m *ice.Message, arg ...string) {
|
||||
button = append(button, s.TaskCreate)
|
||||
}
|
||||
s.PushIssueButton(m, value, user_uid, button...)
|
||||
}).Display("").Option("otherList", "designList,taskList,caseList,meetList,dealList")
|
||||
kit.If(len(arg) == 1, func() { m.Sort("plan_status,status,design_count,task_count,created_at") })
|
||||
}).Display("")
|
||||
kit.If(len(arg) == 1, func() {
|
||||
m.Sort("plan_status,status,design_count,task_count,updated_at", ice.STR, ice.STR, ice.STR, ice.STR, ice.STR_R)
|
||||
})
|
||||
s.OtherListCmd(m, s.DesignList, s.TaskList, s.CaseList, s.MeetList, s.DealList)
|
||||
}
|
||||
func (s Issue) Finish(m *ice.Message, arg ...string) {
|
||||
if s.finishCheck(m, Design{}, "设计") {
|
||||
|
@ -7,13 +7,12 @@ Volcanos(chat.ONIMPORT, {
|
||||
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],
|
||||
can.onimport.timeView(can, value),
|
||||
can.onimport.unitView(can, value, "plan_title"),
|
||||
can.onimport.unitView(can, value, "design_count", "个"),
|
||||
can.onimport.unitView(can, value, "task_count", "个"),
|
||||
]},
|
||||
// value.price > 0 && {view: html.OUTPUT, list: [can.onimport.unitView(can, value, "price", "元")]},
|
||||
// msg.IsTech() && value.price > 0 && {view: html.OUTPUT, list: [can.onimport.unitView(can, value, "price", "元")]},
|
||||
{view: html.OUTPUT, list: [value.content]}, can.onimport.titleAction(can, value),
|
||||
] })
|
||||
},
|
||||
|
@ -11,21 +11,24 @@ import (
|
||||
|
||||
type Meet struct {
|
||||
Table
|
||||
order string `data:"8"`
|
||||
fields string `data:"from_user_uid,to_user_uid,meet_type,title,content,link,begin_time,end_time,issue_uid,plan_uid,company_uid"`
|
||||
create string `name:"create issue_uid* from_user_uid* to_user_uid* meet_type* title* content* link* date time" role:"leader"`
|
||||
remove string `name:"remove" role:"leader"`
|
||||
order string `data:"10"`
|
||||
fields string `data:"from_user_uid,to_user_uid,meet_type,title,content,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* meet_type* title* content* link* date time" role:"leader"`
|
||||
remove string `name:"remove" role:"leader"`
|
||||
preview string `name:"preview" help:"入会" role:"worker"`
|
||||
}
|
||||
|
||||
func (s Meet) Create(m *ice.Message, arg ...string) {
|
||||
t := time.Unix(kit.Time(m.Option("date")+" "+m.Option("time")+":00")/int64(time.Second), 0)
|
||||
m.Options(model.BEGIN_TIME, t.Format(ice.MOD_TIME), model.END_TIME, t.Add(30*time.Minute).Format(ice.MOD_TIME))
|
||||
s.ValueCreate(m, m.OptionSimple("issue_uid,from_user_uid,to_user_uid,meet_type,title,content,link,begin_time,end_time,plan_uid")...)
|
||||
company_uid := m.Cmd(story{}, s.Select, model.UID, m.Option(model.STORY_UID)).Append(model.COMPANY_UID)
|
||||
m.Option(model.COMPANY_UID, company_uid)
|
||||
m.OptionDefault(model.BEGIN_TIME, t.Format(ice.MOD_TIME), model.END_TIME, t.Add(30*time.Minute).Format(ice.MOD_TIME))
|
||||
s.ValueCreate(m, m.OptionSimple("issue_uid,from_user_uid,to_user_uid,meet_type,title,content,link,begin_time,end_time,plan_uid,company_uid")...)
|
||||
s.SendMessage(s.GetCommandUID(m), m.Option(model.FROM_USER_UID), m.Option(model.TO_USER_UID))
|
||||
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).PushAction(s.Preview).Display("")
|
||||
s.ValueList(m, arg).PushAction(s.Preview, s.Remove).Display("")
|
||||
if s.IsLeader(m) {
|
||||
m.RenameAppend(model.TO_USER_UID, model.USER_UID)
|
||||
} else {
|
||||
|
@ -37,11 +37,13 @@ const (
|
||||
TASK_UID = "task_uid"
|
||||
TASK_STATUS = "task_status"
|
||||
TASK_COUNT = "task_count"
|
||||
PLAN_TITLE = "plan_title"
|
||||
CASE_STATUS = "case_status"
|
||||
CASE_COUNT = "case_count"
|
||||
MEET_TYPE = "meet_type"
|
||||
MARKET_UID = "market_uid"
|
||||
CREATED_AT = "created_at"
|
||||
UPDATED_AT = "updated_at"
|
||||
FROM_USER_UID = "from_user_uid"
|
||||
TO_USER_UID = "to_user_uid"
|
||||
BEGIN_TIME = "begin_time"
|
||||
|
@ -10,7 +10,7 @@ import (
|
||||
type Plan struct {
|
||||
Table
|
||||
order string `data:"1"`
|
||||
fields string `data:"title,content,version,plan_status,issue_count,begin_time,end_time,process_time,finish_time,user_uid"`
|
||||
fields string `data:"updated_at,title,content,version,plan_status,issue_count,begin_time,end_time,process_time,finish_time,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"`
|
||||
@ -30,7 +30,7 @@ func (s Plan) List(m *ice.Message, arg ...string) {
|
||||
}
|
||||
})
|
||||
s.Limit(m, 300)
|
||||
s.Orders(m, model.STATUS, model.ISSUE_COUNT, s.Desc(model.CREATED_AT))
|
||||
s.Orders(m, model.STATUS, model.ISSUE_COUNT, s.Desc(model.UPDATED_AT))
|
||||
s.ValueList(m, arg).Table(func(value ice.Maps) {
|
||||
button := []ice.Any{}
|
||||
defer func() { m.PushButton(button...) }()
|
||||
@ -56,7 +56,8 @@ func (s Plan) List(m *ice.Message, arg ...string) {
|
||||
kit.If(m.FieldsIsDetail(), func() { s.DoneMessage(m) })
|
||||
}
|
||||
}).Display("").DisplayCSS("")
|
||||
m.Option("otherList", "issueList,designList,taskList,caseList,meetList,dealList")
|
||||
s.OtherListCmd(m, s.IssueList, s.DesignList, s.TaskList, s.CaseList, s.MeetList, s.DealList)
|
||||
// m.Option("otherList", "issueList,designList,taskList,caseList,meetList,dealList")
|
||||
// s.StatusCount(m, arg...)
|
||||
}
|
||||
func (s Plan) Process(m *ice.Message, arg ...string) {
|
||||
|
@ -2,7 +2,7 @@ Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
can.onimport.myViewTabs(can, "plan_status", msg, function(value) { return [
|
||||
{view: html.TITLE, list: [value.title, value.version, can.onimport.textView(can, value)]},
|
||||
{view: html.STATUS, list: [can.onimport.beginTime(can, value), can.onimport.unitView(can, value, "issue_count", "个")]},
|
||||
{view: html.STATUS, list: [can.onimport.timeView(can, value), can.onimport.unitView(can, value, "issue_count", "个")]},
|
||||
{view: html.OUTPUT, list: [value.content]}, can.onimport.titleAction(can, value),
|
||||
] })
|
||||
},
|
||||
|
@ -1,8 +1,8 @@
|
||||
{
|
||||
"portal": "产品迭代", "member": "项目成员",
|
||||
"plan": "迭代计划", "issue": "产品需求", "design": "界面设计", "task": "开发任务", "case": "测试用例",
|
||||
"meet": "会议记录", "deal": "支付记录",
|
||||
"take": "项目接单", "stat": "项目进度", "care": "新人帮助",
|
||||
"care": "新人帮助", "take": "项目接单", "stat": "项目统计", "date": "会议预约", "meet": "会议记录", "deal": "支付记录",
|
||||
"bindPlan": "绑定计划",
|
||||
"discuss": "约会", "payfor": "支付", "program": "编程",
|
||||
"process": "开始", "submit": "提交", "reback": "返工", "finish": "完成",
|
||||
"issueCreate": "原型设计", "designCreate": "界面设计", "taskCreate": "开发任务", "caseCreate": "测试用例",
|
||||
@ -11,8 +11,8 @@
|
||||
"style": {
|
||||
"discuss": "notice",
|
||||
"payfor": "notice",
|
||||
"program": "notice",
|
||||
"preview": "notice",
|
||||
"program": "notice",
|
||||
"process": "notice",
|
||||
"submit": "notice",
|
||||
"reback": "danger",
|
||||
@ -23,16 +23,17 @@
|
||||
"caseCreate": "notice"
|
||||
},
|
||||
"icons": {
|
||||
"take": "meet.png",
|
||||
"care": "meet.png",
|
||||
"stat": "meet.png",
|
||||
"meet": "meet.png",
|
||||
"deal": "deal.png",
|
||||
"plan": "plan.png",
|
||||
"issue": "issue.png",
|
||||
"design": "design.png",
|
||||
"task": "task.png",
|
||||
"case": "case.png"
|
||||
"case": "case.png",
|
||||
"care": "meet.png",
|
||||
"take": "meet.png",
|
||||
"stat": "meet.png",
|
||||
"meet": "meet.png",
|
||||
"date": "meet.png",
|
||||
"deal": "meet.png"
|
||||
},
|
||||
"input": {
|
||||
"My Story": "我的产品",
|
||||
|
@ -8,7 +8,7 @@ import (
|
||||
|
||||
type Stat struct {
|
||||
Tables
|
||||
order string `data:"10"`
|
||||
order string `data:"8"`
|
||||
}
|
||||
|
||||
func (s Stat) List(m *ice.Message, arg ...string) {
|
||||
@ -83,7 +83,7 @@ func (s Table) SelectAuthPlace(m *ice.Message, target ice.Any, arg ...string) *i
|
||||
}
|
||||
return s.SelectJoinAuth(m.Cmd(target, s.Select, "company_uid = ? AND auth_uid IS NOT NULL AND auth_uid != ''", msg.Append(model.COMPANY_UID)))
|
||||
}
|
||||
func (s Stat) Count(m *ice.Message, target ice.Any, field string, arg ...string) map[string]string {
|
||||
func (s Table) Count(m *ice.Message, target ice.Any, field string, arg ...string) map[string]string {
|
||||
stats := map[string]string{}
|
||||
s.Fields(m, field, "COUNT(*) AS count").Groups(m, field)
|
||||
m.Cmd(target, s.Select, arg).Table(func(value ice.Maps) { stats[value[field]] = value[model.COUNT] })
|
||||
|
@ -8,7 +8,9 @@ import (
|
||||
|
||||
type take struct {
|
||||
Tables
|
||||
order string `data:"6"`
|
||||
order string `data:"7"`
|
||||
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) {
|
||||
@ -28,10 +30,7 @@ func (s take) List(m *ice.Message, arg ...string) {
|
||||
m.Push("story_name", value[model.NAME])
|
||||
m.Push("created_at", value["created_at"])
|
||||
} else {
|
||||
m.Cmd(Issue{}, s.Select, model.STORY_UID, value[model.UID], model.PLAN_UID, val[model.UID],
|
||||
model.STATUS, kit.Format(IssueFinish),
|
||||
model.DESIGN_COUNT, "0",
|
||||
).Table(func(val ice.Maps) {
|
||||
m.Cmd(Issue{}, s.Select, model.STORY_UID, value[model.UID], model.PLAN_UID, val[model.UID], model.STATUS, kit.Format(IssueFinish), model.DESIGN_COUNT, "0").Table(func(val ice.Maps) {
|
||||
m.Push("type", "UI")
|
||||
m.Push("uid", val["uid"])
|
||||
m.Push("title", val["title"])
|
||||
@ -44,8 +43,20 @@ func (s take) List(m *ice.Message, arg ...string) {
|
||||
}
|
||||
})
|
||||
})
|
||||
m.SortStrR("created_at")
|
||||
m.Display("")
|
||||
m.PushAction(s.Info, s.Main).Display("").SortStrR(model.CREATED_AT)
|
||||
}
|
||||
func (s take) Main(m *ice.Message, arg ...string) {
|
||||
m.ProcessField(Portal{}, []string{m.Option(model.STORY_UID)}, arg...)
|
||||
}
|
||||
func (s take) Info(m *ice.Message, arg ...string) {
|
||||
switch m.Option(model.TYPE) {
|
||||
case "PM":
|
||||
m.ProcessField(Plan{}, []string{m.Option(model.STORY_UID), m.Option(model.UID)}, arg...)
|
||||
case "UI":
|
||||
m.ProcessField(Issue{}, []string{m.Option(model.STORY_UID), m.Option(model.UID)}, arg...)
|
||||
default:
|
||||
m.ProcessField(Issue{}, []string{m.Option(model.STORY_UID), m.Option(model.UID)}, arg...)
|
||||
}
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(take{}) }
|
||||
|
@ -1,16 +1,12 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
can.onimport.myViewTabs(can, "type", msg, function(value) { return [
|
||||
{view: html.TITLE, list: [
|
||||
value.story_name,
|
||||
value.title, can.onimport.textView(can, value, "type", "status"), can.onimport.titleAction(can, value),
|
||||
]},
|
||||
can.onimport.myViewTabs(can, TYPE, msg, function(value) { return [
|
||||
{view: html.TITLE, list: [value.story_name, value.title, can.onimport.textView(can, value, TYPE, STATUS)]},
|
||||
{view: html.STATUS, list: [can.onimport.timeView(can, value), value.user_name]},
|
||||
{view: html.OUTPUT, list: [value.content]},
|
||||
{view: html.OUTPUT, list: [value.content]}, can.onimport.titleAction(can, value),
|
||||
] }, function(event, value) {
|
||||
can.onimport.myStory(can, {index: "web.team.production.portal", args: [value.story_uid]})
|
||||
return
|
||||
if (value.type == "PM") {
|
||||
// can.onimport.myStory(can, {index: "web.team.production.portal", args: [value.story_uid, "web.team.production.plan", value.uid]})
|
||||
can.onimport.myStory(can, {index: "web.team.production.plan", args: [value.story_uid, value.uid]})
|
||||
} else {
|
||||
can.onimport.myStory(can, {index: "web.team.production.issue", args: [value.story_uid, value.uid]})
|
||||
|
@ -28,17 +28,18 @@ func (s Task) Remove(m *ice.Message, arg ...string) {
|
||||
}
|
||||
func (s Task) List(m *ice.Message, arg ...string) {
|
||||
user_uid := m.Option(model.USER_UID)
|
||||
s.Orders(m, model.STATUS, model.CASE_COUNT, s.Desc(model.CREATED_AT))
|
||||
s.Orders(m, model.STATUS, model.CASE_COUNT, s.Desc(model.CREATED_AT)).Limit(m, 300)
|
||||
s.ValueList(m, arg)
|
||||
s.SelectJoinPlan(m)
|
||||
s.StatusCount(m, arg...)
|
||||
// s.StatusCount(m, arg...)
|
||||
m.Table(func(value ice.Maps) {
|
||||
if IssueStatus(kit.Int(value[model.STATUS])) == IssueFinish {
|
||||
s.PushTaskButton(m, value, user_uid, s.Program)
|
||||
} else {
|
||||
s.PushTaskButton(m, value, user_uid, s.Program, s.CaseCreate)
|
||||
}
|
||||
}).RenameAppend(model.STATUS, model.TASK_STATUS).Display("").Option("otherList", "caseList")
|
||||
}).RenameAppend(model.STATUS, model.TASK_STATUS).Display("")
|
||||
s.OtherListCmd(m, s.CaseList)
|
||||
}
|
||||
func (s Task) Process(m *ice.Message, arg ...string) {
|
||||
s.changeStatus(m, IssueCreate, IssueProcess)
|
||||
|
Loading…
x
Reference in New Issue
Block a user