diff --git a/src/production/care.go b/src/production/care.go index ccb3435..ce728d5 100644 --- a/src/production/care.go +++ b/src/production/care.go @@ -8,11 +8,19 @@ import ( type care struct { Tables - order string `data:"6"` + order string `data:"6"` + setInfo string `name:"setInfo info" help:"备注" role:"void"` } +func (s care) SetInfo(m *ice.Message, arg ...string) { + msg := m.Cmd(userStory{}, s.Select, model.STORY_UID, m.Option(model.STORY_UID), model.USER_UID, m.Option(model.UID)) + m.Option(model.UID, msg.Append(model.UID)) + m.Cmdy(s.Prefix(m, "member"), m.ActionKey(), arg) +} func (s care) List(m *ice.Message, arg ...string) { - if s.Fields(m, model.USER_UID); s.IsLeader(m) { + s.Limit(m, 300) + user_uid, isLeader := m.Option(model.USER_UID), s.IsLeader(m) + if s.Fields(m, model.USER_UID, model.INFO); s.IsLeader(m) { if len(arg) == 1 { m.Cmdy(userStory{}, s.Select, model.STORY_UID, arg[0]) } else { @@ -47,6 +55,11 @@ func (s care) List(m *ice.Message, arg ...string) { m.Push("一星", check(Issue{}, 1)+check(Design{}, 1)) m.Push("五星", check(Issue{}, 5)+check(Design{}, 5)) m.Push(model.UID, value[model.USER_UID]) + if value[model.USER_UID] == user_uid || isLeader { + m.PushButton(s.SetInfo) + } else { + m.PushButton() + } }) if m.Action().Display(""); m.FieldsIsDetail() { s.OtherListCmd(m, s.IssueList, s.DesignList) diff --git a/src/production/care.js b/src/production/care.js index 179041a..a6d64ba 100644 --- a/src/production/care.js +++ b/src/production/care.js @@ -15,6 +15,9 @@ Volcanos(chat.ONIMPORT, { can.onimport.unitView(can, value, "界面已完成", "个"), can.onimport.unitView(can, value, "界面设计中", "个"), ]}, + {view: html.STATUS, list: [ + value.info + ]}, ] }) }, }) \ No newline at end of file diff --git a/src/production/case.js b/src/production/case.js index 452a37d..cdd17e3 100644 --- a/src/production/case.js +++ b/src/production/case.js @@ -7,7 +7,7 @@ Volcanos(chat.ONIMPORT, { (value.process_time||value.begin_time).split(" ")[0], can.onimport.unitView(can, value, "plan_title"), ]}, - {view: html.OUTPUT, list: [value.content]}, can.onimport.titleAction(can, value), + {view: html.OUTPUT, list: [value.content||value.info]}, can.onimport.titleAction(can, value), ] }) }, }) \ No newline at end of file diff --git a/src/production/common.go b/src/production/common.go index cfa6b08..3acfe2c 100644 --- a/src/production/common.go +++ b/src/production/common.go @@ -47,6 +47,8 @@ func (s Table) Inputs(m *ice.Message, arg ...string) { s.InputsListRole(m, UserStoryRoleList, arg...) case model.STORY_TYPE: s.InputsList(m, StoryTypeList, arg...) + case model.PLAN_TYPE: + s.InputsList(m, PlanTypeList, arg...) case model.PLAN_UID: s.InputsUID(m, arg, Plan{}, m.OptionSimple(model.STORY_UID)...) case model.ISSUE_UID: @@ -95,6 +97,8 @@ func (s Table) RewriteAppend(m *ice.Message, arg ...string) *ice.Message { value = UserStoryRole(kit.Int(value)).String() case model.STORY_TYPE: value = StoryType(kit.Int(value)).String() + case model.PLAN_TYPE: + value = PlanType(kit.Int(value)).String() case model.PLAN_STATUS: value = PlanStatus(kit.Int(value)).String() case model.ISSUE_TYPE: @@ -112,17 +116,20 @@ 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) + isLeaderApproved := isCreator || (isLeader && m.Option("leader_approved") == "on") + isLeaderFinish := isCreator || (isLeader && m.Option("leader_finish") == "on") switch IssueStatus(kit.Int(value[model.STATUS])) { case IssueCreate: if isCreator { - button = append(button, s.Discuss, s.Payfor) + button = append(button, s.Payfor) } - if isCreator { + if isLeaderApproved { button = append(button, s.Approve) } if isLeader { @@ -132,7 +139,7 @@ func (s Table) PushIssueButton(m *ice.Message, value ice.Maps, user_uid string, button = append(button, s.Modify, s.Remove) } case IssueRejected: - if isLeader { + if isLeaderApproved { button = append(button, s.Trash) } case IssueApproved: @@ -141,25 +148,31 @@ func (s Table) PushIssueButton(m *ice.Message, value ice.Maps, user_uid string, } case IssueProcess: if isCreator { - button = append(button, s.Discuss, s.Payfor) + button = append(button, s.Payfor) } if user_uid == value[model.USER_UID] { button = append(button, s.Submit) } + if isWorker { + button = append(button, arg...) + } case IssueSubmit: if isCreator { - button = append(button, s.Discuss, s.Payfor) + button = append(button, s.Payfor) } if isWorker { button = append(button, s.Preview) } - if isCreator { + if isLeaderFinish { button = append(button, s.Finish, s.Reback, s.Cancel) } + if isWorker { + button = append(button, arg...) + } case IssueFinish: if PlanStatus(kit.Int(value[model.PLAN_STATUS])) != PlanFinish { if isCreator { - button = append(button, s.Discuss, s.Payfor) + button = append(button, s.Payfor) } } if isWorker { @@ -176,7 +189,7 @@ func (s Table) PushIssueButton(m *ice.Message, value ice.Maps, user_uid string, if isCreator && value[model.SCORE] == "0" { button = append(button, s.SetScore) } - if isCreator { + if isLeaderApproved { button = append(button, s.Trash) } } @@ -234,6 +247,12 @@ func (s Table) StatusCount(m *ice.Message, arg ...string) { func (s Table) SetScore(m *ice.Message, arg ...string) { s.Update(m, arg, m.OptionSimple(model.UID, model.STORY_UID)...) } +func (s Table) UserInfo(m *ice.Message, arg ...string) { + m.ProcessField(care{}, []string{m.Option(model.STORY_UID), m.Option(model.UID)}, arg...) +} +func (s care) UserInfo(m *ice.Message, arg ...string) { + m.Cmdy(s.PrefixPortal(m), s.UserInfo, arg) +} func (s Table) Reject(m *ice.Message, arg ...string) { s.changeStatus(m, IssueCreate, IssueRejected) } @@ -310,7 +329,7 @@ func (s Table) commonOtherList(m *ice.Message, target ice.Any, arg ...string) *i 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...)) }) + kit.If(m.FieldsIsDetail() && m.Length() > 0 && s.IsWorker(m), func() { m.Option("otherList", kit.Fields(arg...)) }) return m } func (s Table) otherListButton(m *ice.Message, arg ...string) { diff --git a/src/production/date.css b/src/production/date.css index 9be1292..24c19b6 100644 --- a/src/production/date.css +++ b/src/production/date.css @@ -1,2 +1,3 @@ $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; } \ No newline at end of file +$output td { border:var(--box-border); padding:0; cursor:pointer; } +$output th:first-child { position:sticky; left:2px; z-index:1; } \ No newline at end of file diff --git a/src/production/date.go b/src/production/date.go index 935f196..aaa733f 100644 --- a/src/production/date.go +++ b/src/production/date.go @@ -7,27 +7,32 @@ import ( "strings" ) -type date struct { +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)) +func (s Date) Discuss(m *ice.Message, arg ...string) { + msg := m.Cmd(Issue{}, s.Select, model.UID, m.Option(model.ISSUE_UID), m.OptionSimple(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), - ) + msg.AppendSimple(model.TITLE, model.CONTENT)) } -func (s date) List(m *ice.Message, arg ...string) { +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)) + m.Cmdy(Meet{}, s.Select, msg.AppendSimple(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.RenameAppend(model.TO_USER_UID, model.USER_UID) m.Action().Display("").DisplayCSS("") + s.head(m) +} + +func init() { ice.TeamCtxCmd(Date{}) } + +func (s Date) head(m *ice.Message, arg ...string) { head := []string{} for i := 0; i < 3; i++ { head = append(head, strings.Split(m.Time(kit.Format("%dh", i*24)), " ")[0]) @@ -43,5 +48,3 @@ func (s date) List(m *ice.Message, arg ...string) { m.Option("head", strings.Join(head, ",")) m.Option("list", strings.Join(list, ",")) } - -func init() { ice.TeamCtxCmd(date{}) } diff --git a/src/production/date.js b/src/production/date.js index 62ce578..6bcda0d 100644 --- a/src/production/date.js +++ b/src/production/date.js @@ -11,16 +11,18 @@ Volcanos(chat.ONIMPORT, { 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], }) + can.onimport.myStory(can, {index: "web.team.production.meet", args: [value.story_uid, value.uid]}) }, 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"]) }} }))} })}, - ]}]) + ], ontouchmove: function(event) { var msg = can.request(event, {}) + if (can._output.scrollLeft > -10) { msg.Option(ice.MSG_HANDLE, ice.TRUE) } + }}]) }, }) \ No newline at end of file diff --git a/src/production/design.go b/src/production/design.go index 067b8ab..2b938e8 100644 --- a/src/production/design.go +++ b/src/production/design.go @@ -11,7 +11,7 @@ type Design struct { Table order string `data:"3"` fields string `data:"updated_at,title,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* content* price*=1000 begin_time:select@date end_time:select@date" role:"worker"` + 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"` } diff --git a/src/production/design.js b/src/production/design.js index c0e81ea..8f822e6 100644 --- a/src/production/design.js +++ b/src/production/design.js @@ -1,12 +1,11 @@ Volcanos(chat.ONIMPORT, { _init: function(can, msg) { can.onimport.myViewTabs(can, "status", msg, function(value) { return [ - {view: html.TITLE, list: [ - value.title, + {view: html.TITLE, list: [value.title, value.score != "3" && can.onimport.unitView(can, value, "score", "星"), can.onimport.textView(can, value, "status"), ]}, - {view: html.STATUS, list: [ + {view: html.STATUS, list: [value.uid.slice(0, 6), can.onimport.timeView(can, value), can.onimport.unitView(can, value, "plan_title"), ]}, diff --git a/src/production/issue.go b/src/production/issue.go index dbc5087..4968b46 100644 --- a/src/production/issue.go +++ b/src/production/issue.go @@ -11,7 +11,7 @@ type Issue struct { Table order string `data:"2"` fields string `data:"updated_at,title,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* content* issue_type:select level:selelt price=1000 begin_time:select@date end_time:select@date" role:"worker"` + create string `name:"create plan_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"` 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"` @@ -48,6 +48,7 @@ func (s Issue) List(m *ice.Message, arg ...string) { 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.SettingSelect(m) m.Table(func(value ice.Maps) { button := []ice.Any{} if PlanStatus(kit.Int(value[model.PLAN_STATUS])) != PlanFinish { @@ -65,15 +66,6 @@ func (s Issue) List(m *ice.Message, arg ...string) { }) 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{}, "设计") { - return - } - if s.finishCheck(m, Task{}, "任务") { - return - } - s.changeStatus(m, IssueSubmit, IssueFinish) -} func (s Issue) DesignCreate(m *ice.Message, arg ...string) { s.commonOtherCreate(m, Design{}, arg...) } func (s Issue) TaskCreate(m *ice.Message, arg ...string) { s.commonOtherCreate(m, Task{}, arg...) } diff --git a/src/production/issue.js b/src/production/issue.js index f7346b4..ecfdda0 100644 --- a/src/production/issue.js +++ b/src/production/issue.js @@ -8,6 +8,7 @@ Volcanos(chat.ONIMPORT, { can.onimport.textView(can, value, "status"), ]}, {view: html.STATUS, list: [ + value.uid.slice(0, 6), can.onimport.timeView(can, value), can.onimport.unitView(can, value, "plan_title"), can.onimport.unitView(can, value, "design_count", "个"), diff --git a/src/production/model/model.go b/src/production/model/model.go index 859e7ee..06b2742 100644 --- a/src/production/model/model.go +++ b/src/production/model/model.go @@ -27,6 +27,7 @@ const ( STORY_UID = "story_uid" STORY_NAME = "story_name" STORY_TYPE = "story_type" + PLAN_TYPE = "plan_type" PLAN_UID = "plan_uid" PLAN_STATUS = "plan_status" DESIGN_STATUS = "design_status" @@ -63,6 +64,7 @@ type Plan struct { db.ModelContent StoryUID string `gorm:"type:char(32);index"` Version string `gorm:"type:varchar(16)"` + Type uint8 `gorm:"default:0"` Status uint8 `gorm:"default:0"` IssueCount int `gorm:"default:0"` BeginTime db.Time diff --git a/src/production/plan.css b/src/production/plan.css index 6be0211..292dcd9 100644 --- a/src/production/plan.css +++ b/src/production/plan.css @@ -1 +1,3 @@ -$output div.item.card>div.output span.status.create { color:var(--danger-bg-color); } \ No newline at end of file +$output div.item.card>div.output span.status.create { color:var(--danger-bg-color); } +body.width1 $output div.item.card>div.output span.status { margin-left:unset !important; } +body.width1 $output div.item.card>div.output span.type { margin-left:auto; } \ No newline at end of file diff --git a/src/production/plan.go b/src/production/plan.go index 56ab258..ca15551 100644 --- a/src/production/plan.go +++ b/src/production/plan.go @@ -10,12 +10,13 @@ import ( type Plan struct { Table order string `data:"1"` - fields string `data:"updated_at,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_type,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"` process string `name:"process" role:"leader"` issueCreate string `name:"issueCreate title* content* price=1000 begin_time:select@date end_time:select@date" role:"worker"` + setType string `name:"setType plan_type" role:"creator"` } func (s Plan) Create(m *ice.Message, arg ...string) { @@ -23,14 +24,13 @@ func (s Plan) Create(m *ice.Message, arg ...string) { s.SendMessage(m, "", "") } func (s Plan) List(m *ice.Message, arg ...string) { - isLeader, isWorker := s.IsLeader(m), s.IsWorker(m) + isCreator, isLeader, isWorker := s.IsCreator(m), s.IsLeader(m), s.IsWorker(m) defer kit.If(!isLeader, func() { if m.Action(); m.Length() == 0 { m.SetResult("请等待「管理员」创建迭代计划") } }) - s.Limit(m, 300) - s.Orders(m, model.STATUS, model.ISSUE_COUNT, s.Desc(model.UPDATED_AT)) + s.Orders(m, model.STATUS, model.ISSUE_COUNT, s.Desc(model.UPDATED_AT)).Limit(m, 300) s.ValueList(m, arg).Table(func(value ice.Maps) { button := []ice.Any{} defer func() { m.PushButton(button...) }() @@ -55,10 +55,14 @@ func (s Plan) List(m *ice.Message, arg ...string) { case PlanFinish: 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, s.MeetList, s.DealList) - // m.Option("otherList", "issueList,designList,taskList,caseList,meetList,dealList") - // s.StatusCount(m, arg...) +} +func (s Plan) SetType(m *ice.Message, arg ...string) { + s.Modify(m, m.OptionSimple(model.PLAN_TYPE)...) } func (s Plan) Process(m *ice.Message, arg ...string) { s.changeStatus(m, PlanCreate, PlanProcess) @@ -70,12 +74,6 @@ func (s Plan) Finish(m *ice.Message, arg ...string) { if s.finishCheck(m, Design{}, "设计") { return } - if s.finishCheck(m, Task{}, "任务") { - return - } - if s.finishCheck(m, Case{}, "用例") { - return - } s.changeStatus(m, PlanProcess, PlanFinish) } func (s Plan) IssueCreate(m *ice.Message, arg ...string) { s.commonOtherCreate(m, Issue{}, arg...) } @@ -86,6 +84,24 @@ func (s Plan) changeStatus(m *ice.Message, from, to PlanStatus) { s.ChangeStatus(m, int(from), int(to), m.ActionKey()+"_time", m.Time()) } +type PlanType int + +const ( + PlanPlace PlanType = iota + PlanFunc + PlanMatrix + PlanSolution +) + +var PlanTypeList = map[PlanType]string{ + PlanPlace: "place", + PlanFunc: "func", + PlanMatrix: "matrix", + PlanSolution: "solution", +} + +func (s PlanType) String() string { return PlanTypeList[s] } + type PlanStatus int const ( diff --git a/src/production/plan.js b/src/production/plan.js index 5339da6..cce3f97 100644 --- a/src/production/plan.js +++ b/src/production/plan.js @@ -1,8 +1,8 @@ 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.timeView(can, value), can.onimport.unitView(can, value, "issue_count", "个")]}, + {view: html.TITLE, list: [value.title, value.version, can.onimport.textView(can, value, "plan_type"), can.onimport.textView(can, value)]}, + {view: html.STATUS, list: [value.uid.slice(0, 6), can.onimport.timeView(can, value), can.onimport.unitView(can, value, "issue_count", "个")]}, {view: html.OUTPUT, list: [value.content]}, can.onimport.titleAction(can, value), ] }) }, diff --git a/src/production/portal.go b/src/production/portal.go index bb5c5a0..270836c 100644 --- a/src/production/portal.go +++ b/src/production/portal.go @@ -13,6 +13,11 @@ type Portal struct { placeCreate string `name:"placeCreate city_name* company_name* story_name* story_type:select" role:"void"` } +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") +} func (s Portal) AfterPlaceAuth(m *ice.Message, arg ...string) { defer s.DashboardCreate(m, "")() s.DashboardInsert(m, 1, "需求总量", "个", Issue{}, "") diff --git a/src/production/portal.json b/src/production/portal.json index 19b8f43..ebefb78 100644 --- a/src/production/portal.json +++ b/src/production/portal.json @@ -7,6 +7,7 @@ "issueList": "原型设计", "designList": "界面设计", "taskList": "开发任务", "caseList": "测试用例", "discuss": "约会", "payfor": "支付", "program": "编程", "bindPlan": "绑定计划", "meetList": "会议安排", "dealList": "支付记录", + "setType": "设置类型", "style": { "discuss": "notice", "payfor": "notice", @@ -42,6 +43,7 @@ "story_name": "产品名称", "story_type": "产品类型", "plan_uid": "产品计划", + "plan_type": "产品类型", "plan_title": "产品计划", "plan_status": "计划状态", "issue_uid": "产品需求", @@ -91,6 +93,17 @@ "bugfix": "danger" } }, + "plan_type": { + "place": "场景化", + "func": "功能性", + "matrix": "方向性", + "solution": "方案型", + "style": { + "func": "danger", + "matrix": "danger", + "solution": "danger" + } + }, "plan_status": { "create": "待开始", "process": "进行中", diff --git a/src/production/take.css b/src/production/take.css index 6754bcc..0f4c1b7 100644 --- a/src/production/take.css +++ b/src/production/take.css @@ -1,4 +1,9 @@ $output>div.tabs>div.item.select.PM待评审 { border-top:var(--box-danger) !important; } $output>div.tabs>div.item.select.PM待提交 { border-top:var(--box-danger) !important; } +$output>div.tabs>div.item.select.PM待验收 { border-top:var(--box-danger) !important; } $output>div.tabs>div.item.select.UI待评审 { border-top:var(--box-danger) !important; } -$output>div.tabs>div.item.select.UI待提交 { border-top:var(--box-danger) !important; } \ No newline at end of file +$output>div.tabs>div.item.select.UI待提交 { border-top:var(--box-danger) !important; } +$output>div.tabs>div.item.select.UI待验收 { border-top:var(--box-danger) !important; } +$output>div.tabs>div.item.select.RD可接单 { border-top:var(--box-danger) !important; } +$output>div.tabs>div.item.select.RD可编程 { border-top:var(--box-danger) !important; } +$output>div.tabs>div.item.select.QA可测试 { border-top:var(--box-danger) !important; } \ No newline at end of file diff --git a/src/production/take.go b/src/production/take.go index aca5d69..0345750 100644 --- a/src/production/take.go +++ b/src/production/take.go @@ -29,59 +29,75 @@ func (s take) List(m *ice.Message, arg ...string) { m.Push(model.STORY_NAME, value[model.NAME]) m.Push(model.UPDATED_AT, kit.Select(val[model.CREATED_AT], val[model.UPDATED_AT])) } - m.Cmd(Plan{}, s.Select, model.STORY_UID, value[model.UID], model.STATUS, PlanProcess).Table(func(val ice.Maps) { - if kit.Int(val[model.ISSUE_COUNT]) == 0 { - push(val, "PM可接单") - } else { - m.Cmd(Issue{}, s.Select, model.STORY_UID, value[model.UID], model.PLAN_UID, val[model.UID], model.STATUS, IssueFinish, model.DESIGN_COUNT, "0").Table(func(val ice.Maps) { - push(val, "UI可接单") - }) + m.Cmd(Plan{}, s.Select, model.STORY_UID, value[model.UID]).Table(func(val ice.Maps) { + switch PlanStatus(kit.Int(val[model.PLAN_STATUS])) { + case PlanProcess: + if kit.Int(val[model.ISSUE_COUNT]) == 0 { + push(val, "PM可接单") + } else { + m.Cmd(Issue{}, s.Select, model.STORY_UID, value[model.UID], model.PLAN_UID, val[model.UID], model.STATUS, IssueProcess, model.DESIGN_COUNT, "0").Table(func(val ice.Maps) { + push(val, "UI可接单") + }) + } + case PlanFinish: + if m.IsTech() { + push(val, "RD可接单") + } } }) deadline := m.Time("-120h") - check := func(target ice.Any, status IssueStatus, t string) { - m.Cmd(target, s.Select, model.STORY_UID, value[model.UID], model.STATUS, status).Table(func(val ice.Maps) { - kit.If(kit.Select(val[model.CREATED_AT], val[model.UPDATED_AT]) < deadline, func() { push(val, t) }) + 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() { + 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+"待评审") + case IssueProcess: + kit.If(kit.Select(val[model.CREATED_AT], val[model.UPDATED_AT]) < deadline, func() { + }) + push(val, t+"待提交") + case IssueSubmit: + push(val, t+"待验收") + case IssueFinish: + kit.If(kit.IsIn(val[model.SCORE], "4", "5"), func() { push(val, t+"优秀项目") }) + } }) } - check(Issue{}, IssueCreate, "PM待评审") - check(Issue{}, IssueProcess, "PM待提交") - check(Design{}, IssueCreate, "UI待评审") - check(Design{}, IssueProcess, "UI待提交") - 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可测试") - }) - good := func(target ice.Any, t string) { - m.Cmd(target, s.Select, model.STORY_UID, value[model.UID], model.STATUS, IssueFinish).Table(func(val ice.Maps) { - kit.If(kit.IsIn(val[model.SCORE], "4", "5"), func() { push(val, t) }) - }) + check(Issue{}, "PM") + check(Design{}, "UI") + if m.IsTech() { + 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可测试") }) } - good(Issue{}, "PM优秀项目") - good(Design{}, "UI优秀项目") }) m.PushAction(s.Info, s.Main).Display("").DisplayCSS("").Sort(kit.Fields(model.TYPE, model.UPDATED_AT), []string{ - "PM可接单", "UI可接单", "PM待评审", "PM待提交", "UI待评审", "UI待提交", "PM优秀项目", "UI优秀项目", "RD可编程", "QA可测试", + "PM可接单", "UI可接单", "PM优秀项目", "UI优秀项目", + "PM待评审", "PM待提交", "PM待验收", + "UI待评审", "UI待提交", "UI待验收", + "RD可接单", "RD可编程", "QA可测试", }, ice.STR_R) } +func (s take) Info(m *ice.Message, arg ...string) { + var target ice.Any + switch m.Option(model.TYPE) { + case "PM可接单", "RD可接单": + target = Plan{} + case "UI可接单", "PM优秀项目", "PM待评审", "PM待提交", "PM待验收": + target = Issue{} + case "UI优秀项目", "UI待评审", "UI待提交", "UI待验收": + target = Design{} + case "RD可测试": + target = Task{} + case "QA可测试": + target = Case{} + } + m.ProcessField(target, []string{m.Option(model.STORY_UID), m.Option(model.UID)}, arg...) +} 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 "RD可测试": - m.ProcessField(Task{}, []string{m.Option(model.STORY_UID), m.Option(model.UID)}, arg...) - case "QA可测试": - m.ProcessField(Case{}, []string{m.Option(model.STORY_UID), m.Option(model.UID)}, arg...) - case "PM可接单": - m.ProcessField(Plan{}, []string{m.Option(model.STORY_UID), m.Option(model.UID)}, arg...) - case "PM待评审", "PM待提交", "PM优秀项目", "UI可接单": - m.ProcessField(Issue{}, []string{m.Option(model.STORY_UID), m.Option(model.UID)}, arg...) - default: - m.ProcessField(Design{}, []string{m.Option(model.STORY_UID), m.Option(model.UID)}, arg...) - } -} func init() { ice.TeamCtxCmd(take{}) } diff --git a/src/production/take.js b/src/production/take.js index ac4e7ce..46bbcfd 100644 --- a/src/production/take.js +++ b/src/production/take.js @@ -2,15 +2,16 @@ 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)]}, - {view: html.STATUS, list: [can.onimport.timeView(can, value), value.user_name]}, + {view: html.STATUS, list: [can.onimport.uidView(can, value), can.onimport.timeView(can, value), value.user_name]}, {view: html.OUTPUT, list: [value.content]}, can.onimport.titleAction(can, value), - ] }, function(event, value) { var index = "web.team.production.design" + ] }, function(event, value) { var index = "web.team.production.issue" switch (value.type) { - case "PM可接单": index = "web.team.production.plan"; break - case "PM待评审": - case "PM待提交": - case "PM优秀项目": - case "UI可接单": index = "web.team.production.issue"; break + case "PM可接单": + case "RD可接单": index = "web.team.production.plan"; break + case "UI优秀项目": + case "UI待评审": + case "UI待提交": + case "UI待验收": index = "web.team.production.design"; break case "RD可编程": index = "web.team.production.task"; break case "QA可测试": index = "web.team.production.case"; break } can.onimport.myStory(can, {index: index, args: [value.story_uid, value.uid]})