This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-09-14 00:36:38 +08:00
parent 30fef61528
commit 18295f0776
18 changed files with 497 additions and 71 deletions

View File

@ -6,6 +6,7 @@ import (
"gorm.io/gorm/logger" "gorm.io/gorm/logger"
"shylinux.com/x/ice" "shylinux.com/x/ice"
"shylinux.com/x/icebergs/base/aaa"
"shylinux.com/x/icebergs/base/ctx" "shylinux.com/x/icebergs/base/ctx"
"shylinux.com/x/icebergs/base/mdb" "shylinux.com/x/icebergs/base/mdb"
"shylinux.com/x/icebergs/base/web" "shylinux.com/x/icebergs/base/web"
@ -23,16 +24,19 @@ type summary struct {
scan string `name:"scan" role:"leader"` scan string `name:"scan" role:"leader"`
} }
func (s summary) Create(m *ice.Message, arg ...string) { s.Table.ValueCreate(m, arg...) } func (s summary) Create(m *ice.Message, arg ...string) { s.ValueCreate(m, arg...) }
func (s summary) Modify(m *ice.Message, arg ...string) { s.Table.ValueModify(m, arg...) } func (s summary) Modify(m *ice.Message, arg ...string) { s.ValueModify(m, arg...) }
func (s summary) Remove(m *ice.Message, arg ...string) { s.Table.ValueRemove(m, arg...) } func (s summary) Remove(m *ice.Message, arg ...string) { s.ValueRemove(m, arg...) }
func (s summary) Scan(m *ice.Message, arg ...string) { func (s summary) Scan(m *ice.Message, arg ...string) {
client_uid := kit.Select(m.Option(model.CLIENT_UID), arg, 0) client_uid := kit.Select(m.Option(model.CLIENT_UID), arg, 0)
msg := m.Cmd(s.client, s.Select, model.UID, client_uid) msg := m.Cmd(s.client, s.Select, model.UID, client_uid)
switch ClientType(kit.Int(msg.Append(model.TYPE))) { switch ClientType(kit.Int(msg.Append(model.TYPE))) {
case ClientPlace: case ClientPlace:
s.List(m, client_uid).Table(func(value ice.Maps) { s.List(m, client_uid).Table(func(value ice.Maps) {
msg := m.Cmd(web.SPACE, value[web.SPACE], value[ctx.INDEX], mdb.SELECT, kit.Simple(kit.UnMarshal(value[model.QUERY])), kit.Dict(mdb.SELECT, kit.Select("count(*)", value[mdb.FIELD]))) msg := m.Cmd(web.SPACE, value[web.SPACE], value[ctx.INDEX], mdb.SELECT, kit.Simple(kit.UnMarshal(value[model.QUERY])), kit.Dict(
mdb.SELECT, kit.Select("count(*)", value[mdb.FIELD]),
ice.MSG_USERROLE, aaa.TECH,
))
s.Update(m, kit.Dict(model.VALUE, msg.Append(msg.Append(ice.MSG_APPEND))), model.UID, value[model.UID]) s.Update(m, kit.Dict(model.VALUE, msg.Append(msg.Append(ice.MSG_APPEND))), model.UID, value[model.UID])
}) })
case ClientMySQL: case ClientMySQL:

View File

@ -7,7 +7,7 @@ import (
type Portal struct { type Portal struct {
operation.Portal operation.Portal
placeCreate string `name:"placeCreate city_name* company_name* repos_type*:select repos_name*" role:"void"` placeCreate string `name:"placeCreate city_name* company_name* repos_name* repos_type*:select" role:"void"`
} }
func init() { gonganxitong.PortalCmd(Portal{Portal: operation.NewPortal(userRepos{}, repos{})}) } func init() { gonganxitong.PortalCmd(Portal{Portal: operation.NewPortal(userRepos{}, repos{})}) }

View File

@ -1,25 +1,16 @@
package development package development
import ( import "shylinux.com/x/ice"
"shylinux.com/x/ice"
kit "shylinux.com/x/toolkits"
"shylinux.com/x/operation/src/development/model"
)
type version struct { type version struct {
Table Table
repos repos fields string `data:"title,content"`
userRepos userRepos create string `name:"create title* content*" role:"leader"`
create string `name:"create title* content*" role:"leader"` remove string `name:"remove" role:"leader"`
} }
func (s version) Create(m *ice.Message, arg ...string) { func (s version) Create(m *ice.Message, arg ...string) { s.ValueCreate(m, arg...) }
s.Table.Create(m, kit.Simple(arg, m.OptionSimple(model.USER_UID, model.REPOS_UID))...) func (s version) Remove(m *ice.Message, arg ...string) { s.ValueRemove(m, arg...) }
s.RecordEventWithName(m, "") func (s version) List(m *ice.Message, arg ...string) { s.ValueList(m, arg).Display("") }
}
func (s version) List(m *ice.Message, arg ...string) {
s.TablesWithRole(m, arg, s.userRepos, s.repos, s, model.TITLE, model.CONTENT).Display("")
}
func init() { ice.TeamCtxCmd(version{}) } func init() { ice.TeamCtxCmd(version{}) }

View File

@ -1,6 +1,6 @@
Volcanos(chat.ONIMPORT, { Volcanos(chat.ONIMPORT, {
_init: function(can, msg) { can.onimport.shareTitle(can, msg) _init: function(can, msg) {
can.onimport.itemcards(can, msg, function(value) { return [ can.onimport.myView(can, msg, function(value) { return [
{view: html.TITLE, list: [value.title]}, {view: html.TITLE, list: [value.title]},
{view: html.STATUS, list: [value.uid.slice(0, 6), can.base.TimeTrim(value.created_at), value.user_name]}, {view: html.STATUS, list: [value.uid.slice(0, 6), can.base.TimeTrim(value.created_at), value.user_name]},
{view: html.OUTPUT, list: [value.content]}, {view: html.OUTPUT, list: [value.content]},

View File

@ -7,7 +7,7 @@ import (
type Portal struct { type Portal struct {
guanlixitong.Portal guanlixitong.Portal
placeCreate string `name:"placeCreate city_name* company_name* cloud_type*:select cloud_name*" role:"void"` placeCreate string `name:"placeCreate city_name* company_name* cloud_name*" cloud_type*:select role:"void"`
} }
func init() { gonganxitong.PortalCmd(Portal{Portal: guanlixitong.NewPortal(userCloud{}, cloud{})}) } func init() { gonganxitong.PortalCmd(Portal{Portal: guanlixitong.NewPortal(userCloud{}, cloud{})}) }

View File

@ -1,25 +1,16 @@
package operation package operation
import ( import "shylinux.com/x/ice"
"shylinux.com/x/ice"
kit "shylinux.com/x/toolkits"
"shylinux.com/x/operation/src/operation/model"
)
type release struct { type release struct {
Table Table
cloud cloud fields string `data:"title,content"`
userCloud userCloud create string `name:"create title* content*" role:"leader"`
create string `name:"create title* content*" role:"leader"` remove string `name:"remove" role:"leader"`
} }
func (s release) Create(m *ice.Message, arg ...string) { func (s release) Create(m *ice.Message, arg ...string) { s.ValueCreate(m, arg...) }
s.Table.Create(m, kit.Simple(arg, m.OptionSimple(model.USER_UID, model.CLOUD_UID))...) func (s release) Remove(m *ice.Message, arg ...string) { s.ValueRemove(m, arg...) }
s.RecordEventWithName(m, "") func (s release) List(m *ice.Message, arg ...string) { s.ValueList(m, arg).Display("") }
}
func (s release) List(m *ice.Message, arg ...string) {
s.TablesWithRole(m, arg, s.userCloud, s.cloud, s, model.TITLE, model.CONTENT).Display("")
}
func init() { ice.TeamCtxCmd(release{}) } func init() { ice.TeamCtxCmd(release{}) }

View File

@ -1,6 +1,6 @@
Volcanos(chat.ONIMPORT, { Volcanos(chat.ONIMPORT, {
_init: function(can, msg) { can.onimport.shareTitle(can, msg) _init: function(can, msg) {
can.onimport.itemcards(can, msg, function(value) { return [ can.onimport.myView(can, msg, function(value) { return [
{view: html.TITLE, list: [value.title]}, {view: html.TITLE, list: [value.title]},
{view: html.STATUS, list: [value.uid.slice(0, 6), can.base.TimeTrim(value.created_at), value.user_name]}, {view: html.STATUS, list: [value.uid.slice(0, 6), can.base.TimeTrim(value.created_at), value.user_name]},
{view: html.OUTPUT, list: [value.content]}, {view: html.OUTPUT, list: [value.content]},

71
src/production/case.go Normal file
View File

@ -0,0 +1,71 @@
package production
import (
"shylinux.com/x/ice"
kit "shylinux.com/x/toolkits"
"shylinux.com/x/operation/src/production/model"
)
type Case struct {
Table
order string `data:"3"`
fields string `data:"title,content,case_status,plan_uid,user_uid"`
create string `name:"create title* content*" role:"leader,worker"`
modify string `name:"create title* content*" role:"leader,worker"`
remove string `name:"remove" role:"leader,worker"`
process string `name:"process" role:"leader,worker"`
finish string `name:"finish" role:"leader,worker"`
planBind string `name:"planBind plan_uid*" role:"leader"`
}
func (s Case) Create(m *ice.Message, arg ...string) {
s.ValueCreate(m, arg...)
s.SendMessage(m, "", "")
}
func (s Case) Modify(m *ice.Message, arg ...string) { s.ValueModify(m, arg...) }
func (s Case) Remove(m *ice.Message, arg ...string) { s.ValueRemove(m, arg...) }
func (s Case) List(m *ice.Message, arg ...string) {
s.ValueList(m, arg).Table(func(value ice.Maps) {
button := []ice.Any{}
switch CaseStatus(kit.Int(value[model.CASE_STATUS])) {
case CaseCreate:
if value[model.PLAN_UID] == "" {
button = append(button, s.PlanBind)
}
button = append(button, s.Process)
case CaseProcess:
button = append(button, s.Finish)
case CaseFinish:
kit.If(len(arg) == 2, func() { s.DoneMessage(m) })
}
m.PushButton(button...)
}).Display("")
s.SelectJoinPlan(m)
s.SelectJoinUser(m)
}
func (s Case) Process(m *ice.Message, arg ...string) { s.changeStatus(m, CaseCreate, CaseProcess) }
func (s Case) Finish(m *ice.Message, arg ...string) { s.changeStatus(m, CaseProcess, CaseFinish) }
func (s Case) PlanBind(m *ice.Message, arg ...string) { s.ValueModify(m, arg...) }
func init() { ice.TeamCtxCmd(Case{}) }
func (s Case) changeStatus(m *ice.Message, from, to CaseStatus, arg ...string) {
s.ChangeStatus(m, int(from), int(to))
}
type CaseStatus int
const (
CaseCreate CaseStatus = iota
CaseProcess
CaseFinish
)
var CaseStatusList = map[CaseStatus]string{
CaseCreate: "create",
CaseProcess: "process",
CaseFinish: "finish",
}
func (s CaseStatus) String() string { return CaseStatusList[s] }

View File

@ -19,6 +19,14 @@ func (s Table) Inputs(m *ice.Message, arg ...string) {
s.InputsListRole(m, UserStoryRoleList, arg...) s.InputsListRole(m, UserStoryRoleList, arg...)
case model.STORY_TYPE: case model.STORY_TYPE:
s.InputsList(m, StoryTypeList, arg...) s.InputsList(m, StoryTypeList, arg...)
case model.ISSUE_TYPE:
s.InputsList(m, IssueTypeList, arg...)
case model.LEVEL:
s.InputsList(m, LevelList, arg...)
case model.PLAN_UID:
s.Fields(m, model.UID, model.TITLE)
m.Cmdy(plan{}, s.Select, m.OptionSimple(model.STORY_UID)).RenameAppend(model.UID, model.PLAN_UID)
m.DisplayInputKeyNameIconTitle()
default: default:
s.Table.Inputs(m, arg...) s.Table.Inputs(m, arg...)
} }
@ -30,12 +38,51 @@ func (s Table) RewriteAppend(m *ice.Message, arg ...string) *ice.Message {
value = UserStoryRole(kit.Int(value)).String() value = UserStoryRole(kit.Int(value)).String()
case model.STORY_TYPE: case model.STORY_TYPE:
value = StoryType(kit.Int(value)).String() value = StoryType(kit.Int(value)).String()
case model.PLAN_STATUS:
value = PlanStatus(kit.Int(value)).String()
case model.ISSUE_TYPE:
value = IssueType(kit.Int(value)).String()
case model.ISSUE_STATUS:
value = IssueStatus(kit.Int(value)).String()
case model.TASK_STATUS:
value = TaskStatus(kit.Int(value)).String()
case model.CASE_STATUS:
value = CaseStatus(kit.Int(value)).String()
case model.LEVEL:
value = Level(kit.Int(value)).String()
} }
return value return value
}) })
return s.Table.RewriteAppend(m) return s.Table.RewriteAppend(m)
} }
func (s Table) SelectJoinPlan(m *ice.Message, arg ...string) {
s.SelectJoin(m, plan{}, model.TITLE)
}
func (s Table) ChangeStatus(m *ice.Message, from, to int, arg ...string) {
s.Table.ChangeStatus(m, m.Option(model.STORY_UID), m.Option(model.UID), from, to, arg...)
s.DashboardUpdate(m)
}
type Tables struct{ Table } type Tables struct{ Table }
func (s Tables) BeforeMigrate(m *ice.Message, arg ...string) {} func (s Tables) BeforeMigrate(m *ice.Message, arg ...string) {}
type Level int
const (
Level1 Level = iota
Level2
Level3
Level4
Level5
)
var LevelList = map[Level]string{
Level1: "level-1",
Level2: "level-2",
Level3: "level-3",
Level4: "level-4",
Level5: "level-5",
}
func (s Level) String() string { return LevelList[s] }

View File

@ -9,21 +9,60 @@ import (
type issue struct { type issue struct {
Table Table
story story task task
userStory userStory order string `data:"2"`
create string `name:"create title* content*" role:"leader"` fields string `data:"title,content,issue_type,level,issue_status,plan_uid,user_uid"`
create string `name:"create title* content* issue_type*:select level*:select" role:"leader,worker"`
modify string `name:"modify title* content* issue_type*:select level*:select" role:"leader,worker"`
remove string `name:"remove" role:"leader,worker"`
reject string `name:"reject" role:"leader"`
approve string `name:"approve" role:"leader"`
finish string `name:"finish" role:"leader,worker"`
planBind string `name:"planBind plan_uid*" role:"leader"`
taskCreate string `name:"taskCreate title* content* begin_time*:select@date end_time*:select@date" role:"leader,worker"`
} }
func (s issue) Create(m *ice.Message, arg ...string) { func (s issue) Create(m *ice.Message, arg ...string) {
s.Table.Create(m, kit.Simple(arg, m.OptionSimple(model.USER_UID, model.STORY_UID))...) s.ValueCreate(m, arg...)
s.RecordEventWithName(m, "") s.SendMessage(m, "", "")
s.DashboardUpdate(m)
} }
func (s issue) Remove(m *ice.Message, arg ...string) { s.ValueRemove(m, arg...); s.DashboardUpdate(m) }
func (s issue) Modify(m *ice.Message, arg ...string) { s.ValueModify(m, arg...) }
func (s issue) List(m *ice.Message, arg ...string) { func (s issue) List(m *ice.Message, arg ...string) {
s.TablesWithRole(m, arg, s.userStory, s.story, s, model.TITLE, model.CONTENT).Display("") s.ValueList(m, arg).Table(func(value ice.Maps) {
button := []ice.Any{}
switch IssueStatus(kit.Int(value[model.ISSUE_STATUS])) {
case IssueCreate:
button = append(button, s.Reject, s.Approve)
case IssueApproved:
if value[model.PLAN_UID] == "" {
button = append(button, s.PlanBind)
}
button = append(button, s.TaskCreate, s.Finish)
case IssueFinish:
kit.If(len(arg) == 2, func() { s.DoneMessage(m) })
}
m.PushButton(button...)
}).Display("")
s.SelectJoinPlan(m)
s.SelectJoinUser(m)
}
func (s issue) Reject(m *ice.Message, arg ...string) { s.changeStatus(m, IssueCreate, IssueRejected) }
func (s issue) Approve(m *ice.Message, arg ...string) { s.changeStatus(m, IssueCreate, IssueApproved) }
func (s issue) Finish(m *ice.Message, arg ...string) { s.changeStatus(m, IssueApproved, IssueFinish) }
func (s issue) PlanBind(m *ice.Message, arg ...string) { s.ValueModify(m, arg...) }
func (s issue) TaskCreate(m *ice.Message, arg ...string) {
m.Cmd(s.task, s.Create, arg, model.ISSUE_UID, m.Option(model.UID), m.OptionSimple(model.PLAN_UID))
} }
func init() { ice.TeamCtxCmd(issue{}) } func init() { ice.TeamCtxCmd(issue{}) }
func (s issue) changeStatus(m *ice.Message, from, to IssueStatus, arg ...string) {
s.ChangeStatus(m, int(from), int(to))
s.DashboardUpdate(m)
}
type IssueType int type IssueType int
const ( const (
@ -37,3 +76,23 @@ var IssueTypeList = map[IssueType]string{
} }
func (s IssueType) String() string { return IssueTypeList[s] } func (s IssueType) String() string { return IssueTypeList[s] }
type IssueStatus int
const (
IssueCreate IssueStatus = iota
IssueRejected
IssueApproved
IssueProcess
IssueFinish
)
var IssueStatusList = map[IssueStatus]string{
IssueCreate: "create",
IssueRejected: "rejected",
IssueApproved: "approved",
IssueProcess: "process",
IssueFinish: "finish",
}
func (s IssueStatus) String() string { return IssueStatusList[s] }

View File

@ -1,8 +1,14 @@
Volcanos(chat.ONIMPORT, { Volcanos(chat.ONIMPORT, {
_init: function(can, msg) { can.onimport.shareTitle(can, msg) _init: function(can, msg) {
can.onimport.itemcards(can, msg, function(value) { return [ can.onimport.myView(can, msg, function(value) { return [
{view: html.TITLE, list: [value.title]}, {view: html.TITLE, list: [value.title,
value.issue_type != "feature" && can.onimport.textView(can, value, "issue_type"),
value.level != "level-3" && can.onimport.textView(can, value, "level"),
value.issue_status != "finish" && can.onimport.textView(can, value, "issue_status"),
can.onimport.titleAction(can, value),
]},
{view: html.STATUS, list: [value.uid.slice(0, 6), can.base.TimeTrim(value.created_at), value.user_name]}, {view: html.STATUS, list: [value.uid.slice(0, 6), can.base.TimeTrim(value.created_at), value.user_name]},
{view: html.OUTPUT, list: [value.plan_title]},
{view: html.OUTPUT, list: [value.content]}, {view: html.OUTPUT, list: [value.content]},
] }) ] })
}, },

View File

@ -7,6 +7,8 @@ const (
NAME = "name" NAME = "name"
TYPE = "type" TYPE = "type"
ROLE = "role" ROLE = "role"
LEVEL = "level"
STATUS = "status"
TITLE = "title" TITLE = "title"
CONTENT = "content" CONTENT = "content"
USER_UID = "user_uid" USER_UID = "user_uid"
@ -14,9 +16,17 @@ const (
STORY_UID = "story_uid" STORY_UID = "story_uid"
STORY_NAME = "story_name" STORY_NAME = "story_name"
STORY_TYPE = "story_type" STORY_TYPE = "story_type"
PLAN_UID = "plan_uid"
PLAN_STATUS = "plan_status"
ISSUE_UID = "issue_uid" ISSUE_UID = "issue_uid"
ISSUE_TYPE = "issue_type"
ISSUE_STATUS = "issue_status"
TASK_UID = "task_uid"
TASK_STATUS = "task_status"
CASE_STATUS = "case_status"
COMPANY_UID = "company_uid" COMPANY_UID = "company_uid"
CITY_UID = "city_uid" CITY_UID = "city_uid"
MARKET_UID = "market_uid"
) )
type UserStory struct { type UserStory struct {
@ -28,8 +38,33 @@ type Story struct {
CompanyUID string `gorm:"type:char(32);index"` CompanyUID string `gorm:"type:char(32);index"`
} }
type Issue struct { type Issue struct {
Common
}
type Task struct {
Common
IssueUID string `gorm:"type:char(32);index"`
BeginTime db.Time
EndTime db.Time
}
type Case struct {
Common
TaskUID string `gorm:"type:char(32);index"`
}
type Plan struct {
db.ModelContent db.ModelContent
StoryUID string `gorm:"type:char(32);index"` StoryUID string `gorm:"type:char(32);index"`
Status uint8 `gorm:"default:0"`
BeginTime db.Time
EndTime db.Time
} }
func init() { db.CmdModels("", &UserStory{}, &Story{}, &Issue{}) } func init() { db.CmdModels("", &UserStory{}, &Story{}, &Plan{}, &Issue{}, &Task{}, &Case{}) }
type Common struct {
db.ModelContent
StoryUID string `gorm:"type:char(32);index:idx_story"`
PlanUID string `gorm:"type:char(32);index:idx_story"`
Type uint8 `gorm:"default:0"`
Level uint8 `gorm:"default:0"`
Status uint8 `gorm:"default:0"`
}

68
src/production/plan.go Normal file
View File

@ -0,0 +1,68 @@
package production
import (
"shylinux.com/x/ice"
kit "shylinux.com/x/toolkits"
"shylinux.com/x/operation/src/production/model"
)
type plan struct {
Table
issue issue
order string `data:"1"`
fields string `data:"title,content,plan_status,begin_time,end_time"`
create string `name:"create title* content* begin_time*:select@date end_time*:select@date" role:"leader"`
modify string `name:"modify title* content* begin_time*:select@date end_time*:select@date" role:"leader"`
remove string `name:"remove" role:"leader"`
process string `name:"process" role:"leader"`
finish string `name:"finish" role:"leader"`
issueCreate string `name:"issueCreate issue_title* issue_content* issue_type*:select level*:select" role:"leader,worker"`
}
func (s plan) Create(m *ice.Message, arg ...string) { s.ValueCreate(m, arg...) }
func (s plan) Modify(m *ice.Message, arg ...string) { s.ValueModify(m, arg...) }
func (s plan) Remove(m *ice.Message, arg ...string) { s.ValueRemove(m, arg...) }
func (s plan) List(m *ice.Message, arg ...string) {
s.ValueList(m, arg).Table(func(value ice.Maps) {
button := []ice.Any{}
switch PlanStatus(kit.Int(value[model.PLAN_STATUS])) {
case PlanCreate:
button = append(button, s.Modify, s.Process)
case PlanProcess:
button = append(button, s.IssueCreate, s.Modify, s.Finish)
default:
if m.Option(model.MARKET_UID) == "" {
button = append(button, s.MarketInsert)
}
}
m.PushButton(button...)
}).Display("")
}
func (s plan) Process(m *ice.Message, arg ...string) { s.changeStatus(m, PlanCreate, PlanProcess) }
func (s plan) Finish(m *ice.Message, arg ...string) { s.changeStatus(m, PlanProcess, PlanFinish) }
func (s plan) IssueCreate(m *ice.Message, arg ...string) {
m.Cmd(s.issue, s.Create, arg, model.PLAN_UID, m.Option(model.UID))
}
func init() { ice.TeamCtxCmd(plan{}) }
func (s plan) changeStatus(m *ice.Message, from, to PlanStatus, arg ...string) {
s.ChangeStatus(m, int(from), int(to))
}
type PlanStatus int
const (
PlanCreate PlanStatus = iota
PlanProcess
PlanFinish
)
var PlanStatusList = map[PlanStatus]string{
PlanCreate: "create",
PlanProcess: "process",
PlanFinish: "finish",
}
func (s PlanStatus) String() string { return PlanStatusList[s] }

View File

@ -1,13 +1,24 @@
package production package production
import ( import (
"shylinux.com/x/ice"
"shylinux.com/x/community/src/gonganxitong" "shylinux.com/x/community/src/gonganxitong"
"shylinux.com/x/enterprise/src/guanlixitong" "shylinux.com/x/enterprise/src/guanlixitong"
"shylinux.com/x/operation/src/production/model"
) )
type Portal struct { type Portal struct {
guanlixitong.Portal guanlixitong.Portal
placeCreate string `name:"placeCreate city_name* company_name* story_type*:select story_name*" role:"void"` placeCreate string `name:"placeCreate city_name* company_name* story_name* story_type*:select" role:"void"`
}
func (s Portal) AfterPlaceAuth(m *ice.Message, arg ...string) {
s.DashboardCreate(m, "")
s.DashboardInsert(m, "1", "需求总量", issue{}, "", model.STORY_UID, m.Option(model.STORY_UID))
s.DashboardInsert(m, "2", "需求待办", issue{}, "", "story_uid = ? AND status != ? AND status != ?", m.Option(model.STORY_UID), IssueRejected, IssueFinish)
s.DashboardInsert(m, "3", "任务总量", task{}, "", model.STORY_UID, m.Option(model.STORY_UID))
s.DashboardInsert(m, "4", "任务待办", task{}, "", "story_uid = ? AND status != ?", m.Option(model.STORY_UID), TaskFinish)
} }
func init() { gonganxitong.PortalCmd(Portal{Portal: guanlixitong.NewPortal(userStory{}, story{})}) } func init() { gonganxitong.PortalCmd(Portal{Portal: guanlixitong.NewPortal(userStory{}, story{})}) }

View File

@ -1,14 +1,40 @@
{ {
"portal": "产品迭代", "portal": "产品迭代",
"issue": "场景应用", "plan": "迭代计划",
"issue": "产品需求",
"task": "开发任务",
"case": "测试用例",
"member": "项目成员",
"process": "开始",
"planBind": "绑定计划",
"issueCreate": "创建需求",
"taskCreate": "创建任务",
"caseCreate": "创建用例",
"style": {
"process": "notice",
"issueCreate": "notice",
"taskCreate": "notice",
"caseCreate": "notice"
},
"icons": { "icons": {
"issue": "https://img.icons8.com/officel/80/activity-grid.png" "plan": "https://img.icons8.com/officel/80/timeline-week.png",
"issue": "https://img.icons8.com/officel/80/communication.png",
"task": "https://img.icons8.com/officel/80/tasks.png",
"case": "https://img.icons8.com/officel/80/faq.png"
}, },
"input": { "input": {
"My Story": "我的场景", "My Story": "我的产品",
"user_story_role": "用户角色", "user_story_role": "用户角色",
"story_name": "场景名称", "plan_uid": "产品计划",
"story_type": "场景类型" "plan_title": "产品计划",
"plan_status": "计划状态",
"story_name": "产品名称",
"story_type": "产品类型",
"issue_type": "需求类型",
"issue_status": "需求状态",
"task_status": "任务状态",
"case_status": "用例状态",
"level": "优先级"
}, },
"value": { "value": {
"user_story_role": { "user_story_role": {
@ -23,13 +49,51 @@
} }
}, },
"story_type": { "story_type": {
"RD": "研发群", "system": "系统开发",
"OP": "运维群", "enterprise": "企业应用",
"HR": "人力群" "custom": "消费应用"
},
"plan_status": {
"create": "待开始",
"process": "进行中",
"finish": "已完成"
}, },
"issue_type": { "issue_type": {
"feature": "新功能", "feature": "功能",
"bugfix": "问题修复" "bugfix": "问题",
"style": {
"bugfix": "danger"
}
},
"issue_status": {
"create": "待评审",
"rejected": "已驳回",
"approved": "已通过",
"process": "开发中",
"finish": "已完成",
"style": {
"rejected": "danger"
}
},
"task_status": {
"create": "待开发",
"process": "开发中",
"finish": "已完成"
},
"case_status": {
"create": "待开发",
"process": "开发中",
"finish": "已完成"
},
"level": {
"level-1": "紧急",
"level-2": "优先",
"level-3": "普通",
"level-4": "稍后",
"level-5": "不急",
"style": {
"level-1": "danger"
}
} }
} }
} }

View File

@ -9,15 +9,15 @@ func init() { ice.TeamCtxCmd(story{}) }
type StoryType int type StoryType int
const ( const (
StoryRD StoryType = iota StorySystem StoryType = iota
StoryOP StoryEnterprise
StoryHR StoryCustom
) )
var StoryTypeList = map[StoryType]string{ var StoryTypeList = map[StoryType]string{
StoryRD: "RD", StorySystem: "system",
StoryOP: "OP", StoryEnterprise: "enterprise",
StoryHR: "HR", StoryCustom: "custom",
} }
func (s StoryType) String() string { return StoryTypeList[s] } func (s StoryType) String() string { return StoryTypeList[s] }

79
src/production/task.go Normal file
View File

@ -0,0 +1,79 @@
package production
import (
"shylinux.com/x/ice"
kit "shylinux.com/x/toolkits"
"shylinux.com/x/operation/src/production/model"
)
type task struct {
Table
Case Case
order string `data:"3"`
fields string `data:"title,content,begin_time,end_time,task_status,issue_uid,plan_uid,user_uid"`
create string `name:"create title* content* begin_time*:select@date end_time*:select@date" role:"leader,worker"`
modify string `name:"modify title* content* begin_time*:select@date end_time*:select@date" role:"leader,worker"`
remove string `name:"remove" role:"leader,worker"`
process string `name:"process" role:"leader,worker"`
finish string `name:"finish" role:"leader,worker"`
planBind string `name:"planBind plan_uid*" role:"leader"`
caseCreate string `name:"caseCreate title* content*" role:"leader,worker"`
}
func (s task) Create(m *ice.Message, arg ...string) {
s.ValueCreate(m, arg...)
s.SendMessage(m, "", "")
s.DashboardUpdate(m)
}
func (s task) Remove(m *ice.Message, arg ...string) { s.ValueRemove(m, arg...); s.DashboardUpdate(m) }
func (s task) Modify(m *ice.Message, arg ...string) { s.ValueModify(m, arg...) }
func (s task) List(m *ice.Message, arg ...string) {
s.ValueList(m, arg).Table(func(value ice.Maps) {
button := []ice.Any{}
switch TaskStatus(kit.Int(value[model.TASK_STATUS])) {
case TaskCreate:
if value[model.PLAN_UID] == "" {
button = append(button, s.PlanBind)
}
button = append(button, s.Process)
case TaskProcess:
button = append(button, s.CaseCreate)
button = append(button, s.Finish)
case TaskFinish:
kit.If(len(arg) == 2, func() { s.DoneMessage(m) })
}
m.PushButton(button...)
}).Display("")
s.SelectJoinPlan(m)
s.SelectJoinUser(m)
}
func (s task) Process(m *ice.Message, arg ...string) { s.changeStatus(m, TaskCreate, TaskProcess) }
func (s task) Finish(m *ice.Message, arg ...string) { s.changeStatus(m, TaskProcess, TaskFinish) }
func (s task) PlanBind(m *ice.Message, arg ...string) { s.ValueModify(m, arg...) }
func (s task) CaseCreate(m *ice.Message, arg ...string) {
m.Cmd(s.Case, s.Create, arg, model.TASK_UID, m.Option(model.UID), m.OptionSimple(model.PLAN_UID))
}
func init() { ice.TeamCtxCmd(task{}) }
func (s task) changeStatus(m *ice.Message, from, to TaskStatus, arg ...string) {
s.ChangeStatus(m, int(from), int(to))
s.DashboardUpdate(m)
}
type TaskStatus int
const (
TaskCreate TaskStatus = iota
TaskProcess
TaskFinish
)
var TaskStatusList = map[TaskStatus]string{
TaskCreate: "create",
TaskProcess: "process",
TaskFinish: "finish",
}
func (s TaskStatus) String() string { return TaskStatusList[s] }