mirror of
https://shylinux.com/x/operation
synced 2025-07-01 05:04:43 +08:00
add some
This commit is contained in:
parent
3a93591f39
commit
a59ab08113
@ -9,12 +9,12 @@ import (
|
|||||||
|
|
||||||
type client struct {
|
type client struct {
|
||||||
Table
|
Table
|
||||||
|
fields string `data:"host,port,username,database"`
|
||||||
config string `name:"config host* port* username* password* database*" role:"leader"`
|
config string `name:"config host* port* username* password* database*" role:"leader"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s client) List(m *ice.Message, arg ...string) {
|
func (s client) List(m *ice.Message, arg ...string) {
|
||||||
if len(arg) == 1 {
|
if len(arg) == 1 {
|
||||||
s.Fields(m, model.HOST, model.PORT, model.USERNAME, model.DATABASE)
|
|
||||||
s.SelectDetail(m, model.UID, arg[0])
|
s.SelectDetail(m, model.UID, arg[0])
|
||||||
if m.Append(model.USERNAME) == "" {
|
if m.Append(model.USERNAME) == "" {
|
||||||
m.SetAppend().EchoInfoButton("", s.Config)
|
m.SetAppend().EchoInfoButton("", s.Config)
|
||||||
|
@ -2,8 +2,6 @@ package dashboard
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"shylinux.com/x/ice"
|
"shylinux.com/x/ice"
|
||||||
"shylinux.com/x/icebergs/base/ctx"
|
|
||||||
"shylinux.com/x/icebergs/base/web"
|
|
||||||
kit "shylinux.com/x/toolkits"
|
kit "shylinux.com/x/toolkits"
|
||||||
|
|
||||||
"shylinux.com/x/operation/src/dashboard/model"
|
"shylinux.com/x/operation/src/dashboard/model"
|
||||||
@ -21,10 +19,6 @@ func (s Table) Inputs(m *ice.Message, arg ...string) {
|
|||||||
s.InputsListRole(m, UserClientRoleList, arg...)
|
s.InputsListRole(m, UserClientRoleList, arg...)
|
||||||
case model.CLIENT_TYPE:
|
case model.CLIENT_TYPE:
|
||||||
s.InputsList(m, ClientTypeList, arg...)
|
s.InputsList(m, ClientTypeList, arg...)
|
||||||
case web.SPACE:
|
|
||||||
s.Hash.Inputs(m, arg...)
|
|
||||||
case ctx.INDEX:
|
|
||||||
s.Hash.Inputs(m, arg...)
|
|
||||||
default:
|
default:
|
||||||
s.Table.Inputs(m, arg...)
|
s.Table.Inputs(m, arg...)
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"client_type": {
|
"client_type": {
|
||||||
|
"place": "place",
|
||||||
"mysql": "MySQL",
|
"mysql": "MySQL",
|
||||||
"redis": "Redis",
|
"redis": "Redis",
|
||||||
"icons": {
|
"icons": {
|
||||||
|
@ -24,9 +24,6 @@ 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.ValueCreate(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.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)
|
||||||
|
@ -2,7 +2,9 @@ Volcanos(chat.ONIMPORT, {
|
|||||||
_init: function(can, msg) { var count = (parseInt(can.ConfWidth()/80)); if (msg.Length() < count) { count = msg.Length() }
|
_init: function(can, msg) { var count = (parseInt(can.ConfWidth()/80)); if (msg.Length() < count) { count = msg.Length() }
|
||||||
var width = can.ConfWidth()/(count||1)
|
var width = can.ConfWidth()/(count||1)
|
||||||
can.page.Append(can, can._output, msg.Table(function(value) {
|
can.page.Append(can, can._output, msg.Table(function(value) {
|
||||||
return {view: html.ITEM, style: {width: width}, list: [{view: ["value", "", value.value]}, {view: ["title", "", value.title]}], oncontextmenu: function(event) {
|
return {view: html.ITEM, style: {width: width}, list: [
|
||||||
|
{view: [html.VALUE, "", value.value]}, {view: [html.TITLE, "", value.title]},
|
||||||
|
], oncontextmenu: function(event) {
|
||||||
can.user.carteItem(event, can, value)
|
can.user.carteItem(event, can, value)
|
||||||
}}
|
}}
|
||||||
}))
|
}))
|
||||||
|
@ -2,7 +2,7 @@ Volcanos(chat.ONIMPORT, {
|
|||||||
_init: function(can, msg) {
|
_init: function(can, msg) {
|
||||||
can.onimport.myView(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.onimport.timeView(can, value), value.user_name]},
|
||||||
{view: html.OUTPUT, list: [value.content]},
|
{view: html.OUTPUT, list: [value.content]},
|
||||||
] })
|
] })
|
||||||
},
|
},
|
||||||
|
@ -2,7 +2,7 @@ Volcanos(chat.ONIMPORT, {
|
|||||||
_init: function(can, msg) {
|
_init: function(can, msg) {
|
||||||
can.onimport.myView(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.onimport.timeView(can, value), value.user_name]},
|
||||||
{view: html.OUTPUT, list: [value.content]},
|
{view: html.OUTPUT, list: [value.content]},
|
||||||
] })
|
] })
|
||||||
},
|
},
|
||||||
|
@ -31,31 +31,39 @@ func (s Case) Remove(m *ice.Message, arg ...string) {
|
|||||||
s.taskCount(m, "-1")
|
s.taskCount(m, "-1")
|
||||||
s.planCount(m, "-1")
|
s.planCount(m, "-1")
|
||||||
}
|
}
|
||||||
func (s Case) Modify(m *ice.Message, arg ...string) {
|
|
||||||
s.ValueModify(m, arg...)
|
|
||||||
}
|
|
||||||
func (s Case) List(m *ice.Message, arg ...string) {
|
func (s Case) List(m *ice.Message, arg ...string) {
|
||||||
|
isLeader, user_uid := s.IsLeader(m), m.Option(model.USER_UID)
|
||||||
s.ValueList(m, arg).Table(func(value ice.Maps) {
|
s.ValueList(m, arg).Table(func(value ice.Maps) {
|
||||||
button := []ice.Any{}
|
button := []ice.Any{}
|
||||||
switch CaseStatus(kit.Int(value[model.CASE_STATUS])) {
|
switch CaseStatus(kit.Int(value[model.CASE_STATUS])) {
|
||||||
case CaseCreate:
|
case CaseCreate:
|
||||||
if value[model.PLAN_UID] == "" {
|
if isLeader && value[model.PLAN_UID] == "" {
|
||||||
button = append(button, s.PlanBind)
|
button = append(button, s.PlanBind)
|
||||||
}
|
}
|
||||||
button = append(button, s.Process)
|
if isLeader || user_uid == value[model.USER_UID] {
|
||||||
|
button = append(button, s.Process)
|
||||||
|
}
|
||||||
case CaseProcess:
|
case CaseProcess:
|
||||||
button = append(button, s.Finish)
|
if isLeader || user_uid == value[model.USER_UID] {
|
||||||
|
button = append(button, s.Finish)
|
||||||
|
}
|
||||||
case CaseFinish:
|
case CaseFinish:
|
||||||
kit.If(len(arg) == 2, func() { s.DoneMessage(m) })
|
kit.If(len(arg) == 2, func() { s.DoneMessage(m) })
|
||||||
}
|
}
|
||||||
m.PushButton(button...)
|
m.PushButton(button...)
|
||||||
}).Display("")
|
}).Display("")
|
||||||
s.SelectJoinPlan(m)
|
s.SelectJoinPlan(m)
|
||||||
s.SelectJoinUser(m)
|
|
||||||
}
|
}
|
||||||
func (s Case) Process(m *ice.Message, arg ...string) { s.changeStatus(m, CaseCreate, CaseProcess) }
|
func (s Case) Process(m *ice.Message, arg ...string) {
|
||||||
func (s Case) Finish(m *ice.Message, arg ...string) { s.changeStatus(m, CaseProcess, CaseFinish) }
|
s.changeStatus(m, CaseCreate, CaseProcess)
|
||||||
func (s Case) PlanBind(m *ice.Message, arg ...string) { s.ValueModify(m, arg...); s.planCount(m, "1") }
|
}
|
||||||
|
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...)
|
||||||
|
s.planCount(m, "1")
|
||||||
|
}
|
||||||
|
|
||||||
func init() { ice.TeamCtxCmd(Case{}) }
|
func init() { ice.TeamCtxCmd(Case{}) }
|
||||||
|
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
Volcanos(chat.ONIMPORT, {
|
Volcanos(chat.ONIMPORT, {
|
||||||
_init: function(can, msg) {
|
_init: function(can, msg) {
|
||||||
can.onimport.myView(can, msg, function(value) { return [
|
can.onimport.myView(can, msg, function(value) { return [
|
||||||
{view: html.TITLE, list: [value.title, value.case_status != "finish" && can.onimport.textView(can, value, "case_status"), can.onimport.titleAction(can, value)]},
|
{view: html.TITLE, list: [value.title, can.onimport.textView(can, value), 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.onimport.timeView(can, value), value.user_name]},
|
||||||
value.process_time && {view: html.STATUS, list: [can.base.TimeTrim(value.process_time), "~", can.base.TimeTrim(value.finish_time)]},
|
{view: html.STATUS, list: [can.base.TimeTrim(value.process_time), "~", can.base.TimeTrim(value.finish_time), "计划:", value.plan_title]},
|
||||||
value.plan_title && {view: html.STATUS, list: ["计划:", value.plan_title]},
|
|
||||||
{view: html.OUTPUT, list: [value.content]},
|
{view: html.OUTPUT, list: [value.content]},
|
||||||
] })
|
] })
|
||||||
},
|
},
|
||||||
|
@ -11,7 +11,7 @@ type issue struct {
|
|||||||
Table
|
Table
|
||||||
task task
|
task task
|
||||||
order string `data:"2"`
|
order string `data:"2"`
|
||||||
fields string `data:"title,content,issue_type,level,issue_status,process_time,finish_time,task_count,plan_uid,user_uid"`
|
fields string `data:"title,content,issue_type,level,issue_status,task_count,process_time,finish_time,plan_uid,user_uid"`
|
||||||
create string `name:"create title* content* issue_type:select level:select" role:"leader,worker"`
|
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"`
|
modify string `name:"modify title* content* issue_type*:select level*:select" role:"leader,worker"`
|
||||||
remove string `name:"remove" role:"leader,worker"`
|
remove string `name:"remove" role:"leader,worker"`
|
||||||
@ -35,29 +35,33 @@ func (s issue) Remove(m *ice.Message, arg ...string) {
|
|||||||
s.DashboardUpdate(m)
|
s.DashboardUpdate(m)
|
||||||
s.planCount(m, "-1")
|
s.planCount(m, "-1")
|
||||||
}
|
}
|
||||||
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) {
|
||||||
|
isLeader, user_uid := s.IsLeader(m), m.Option(model.USER_UID)
|
||||||
s.ValueList(m, arg).Table(func(value ice.Maps) {
|
s.ValueList(m, arg).Table(func(value ice.Maps) {
|
||||||
button := []ice.Any{}
|
button := []ice.Any{}
|
||||||
switch IssueStatus(kit.Int(value[model.ISSUE_STATUS])) {
|
switch IssueStatus(kit.Int(value[model.ISSUE_STATUS])) {
|
||||||
case IssueCreate:
|
case IssueCreate:
|
||||||
button = append(button, s.Reject, s.Approve)
|
if isLeader {
|
||||||
|
button = append(button, s.Reject, s.Approve)
|
||||||
|
}
|
||||||
case IssueApproved:
|
case IssueApproved:
|
||||||
if value[model.PLAN_UID] == "" {
|
if isLeader && value[model.PLAN_UID] == "" {
|
||||||
button = append(button, s.PlanBind)
|
button = append(button, s.PlanBind)
|
||||||
}
|
}
|
||||||
button = append(button, s.Process)
|
if isLeader || user_uid == value[model.USER_UID] {
|
||||||
|
button = append(button, s.Process)
|
||||||
|
}
|
||||||
case IssueProcess:
|
case IssueProcess:
|
||||||
button = append(button, s.TaskCreate, s.Finish)
|
button = append(button, s.TaskCreate)
|
||||||
|
if isLeader || user_uid == value[model.USER_UID] {
|
||||||
|
button = append(button, s.Finish)
|
||||||
|
}
|
||||||
case IssueFinish:
|
case IssueFinish:
|
||||||
kit.If(len(arg) == 2, func() { s.DoneMessage(m) })
|
kit.If(len(arg) == 2, func() { s.DoneMessage(m) })
|
||||||
}
|
}
|
||||||
m.PushButton(button...)
|
m.PushButton(button...)
|
||||||
}).Display("")
|
}).Display("")
|
||||||
s.SelectJoinPlan(m)
|
s.SelectJoinPlan(m)
|
||||||
s.SelectJoinUser(m)
|
|
||||||
}
|
}
|
||||||
func (s issue) Reject(m *ice.Message, arg ...string) {
|
func (s issue) Reject(m *ice.Message, arg ...string) {
|
||||||
s.changeStatus(m, IssueCreate, IssueRejected)
|
s.changeStatus(m, IssueCreate, IssueRejected)
|
||||||
|
@ -4,12 +4,10 @@ Volcanos(chat.ONIMPORT, {
|
|||||||
{view: html.TITLE, list: [value.title,
|
{view: html.TITLE, list: [value.title,
|
||||||
value.issue_type != "feature" && can.onimport.textView(can, value, "issue_type"),
|
value.issue_type != "feature" && can.onimport.textView(can, value, "issue_type"),
|
||||||
value.level != "level-3" && can.onimport.textView(can, value, "level"),
|
value.level != "level-3" && can.onimport.textView(can, value, "level"),
|
||||||
value.issue_status != "finish" && can.onimport.textView(can, value, "issue_status"),
|
can.onimport.textView(can, value), can.onimport.titleAction(can, value),
|
||||||
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.onimport.timeView(can, value), value.user_name]},
|
||||||
value.process_time && {view: html.STATUS, list: [can.base.TimeTrim(value.process_time), "~", can.base.TimeTrim(value.finish_time)]},
|
{view: html.STATUS, list: [can.base.TimeTrim(value.process_time), "~", can.base.TimeTrim(value.finish_time), "计划:", value.plan_title, "任务:", value.task_count+" 个"]},
|
||||||
value.plan_title && {view: html.STATUS, list: ["计划:", value.plan_title, "任务:", value.task_count+" 个"]},
|
|
||||||
{view: html.OUTPUT, list: [value.content]},
|
{view: html.OUTPUT, list: [value.content]},
|
||||||
] })
|
] })
|
||||||
},
|
},
|
||||||
|
@ -12,6 +12,7 @@ const (
|
|||||||
TITLE = "title"
|
TITLE = "title"
|
||||||
CONTENT = "content"
|
CONTENT = "content"
|
||||||
USER_UID = "user_uid"
|
USER_UID = "user_uid"
|
||||||
|
USER_ROLE = "user_role"
|
||||||
USER_STORY_ROLE = "user_story_role"
|
USER_STORY_ROLE = "user_story_role"
|
||||||
STORY_UID = "story_uid"
|
STORY_UID = "story_uid"
|
||||||
STORY_NAME = "story_name"
|
STORY_NAME = "story_name"
|
||||||
@ -46,13 +47,13 @@ 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"`
|
Status uint8 `gorm:"default:0"`
|
||||||
|
IssueCount int `gorm:"default:0"`
|
||||||
|
TaskCount int `gorm:"default:0"`
|
||||||
|
CaseCount int `gorm:"default:0"`
|
||||||
BeginTime db.Time
|
BeginTime db.Time
|
||||||
EndTime db.Time
|
EndTime db.Time
|
||||||
ProcessTime db.Time
|
ProcessTime db.Time
|
||||||
FinishTime db.Time
|
FinishTime db.Time
|
||||||
IssueCount int `gorm:"default:0"`
|
|
||||||
TaskCount int `gorm:"default:0"`
|
|
||||||
CaseCount int `gorm:"default:0"`
|
|
||||||
}
|
}
|
||||||
type Issue struct {
|
type Issue struct {
|
||||||
Common
|
Common
|
||||||
@ -63,9 +64,9 @@ type Issue struct {
|
|||||||
type Task struct {
|
type Task struct {
|
||||||
Common
|
Common
|
||||||
IssueUID string `gorm:"type:char(32);index"`
|
IssueUID string `gorm:"type:char(32);index"`
|
||||||
|
CaseCount int `gorm:"default:0"`
|
||||||
BeginTime db.Time
|
BeginTime db.Time
|
||||||
EndTime db.Time
|
EndTime db.Time
|
||||||
CaseCount int `gorm:"default:0"`
|
|
||||||
}
|
}
|
||||||
type Case struct {
|
type Case struct {
|
||||||
Common
|
Common
|
||||||
|
@ -11,7 +11,7 @@ type plan struct {
|
|||||||
Table
|
Table
|
||||||
issue issue
|
issue issue
|
||||||
order string `data:"1"`
|
order string `data:"1"`
|
||||||
fields string `data:"title,content,plan_status,begin_time,end_time,process_time,finish_time,issue_count,task_count,case_count"`
|
fields string `data:"title,content,plan_status,issue_count,task_count,case_count,begin_time,end_time,process_time,finish_time,user_uid"`
|
||||||
create string `name:"create title* content* begin_time:select@date end_time:select@date" role:"leader"`
|
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"`
|
modify string `name:"modify title* content* begin_time*:select@date end_time*:select@date" role:"leader"`
|
||||||
remove string `name:"remove" role:"leader"`
|
remove string `name:"remove" role:"leader"`
|
||||||
@ -24,24 +24,33 @@ func (s plan) Create(m *ice.Message, arg ...string) {
|
|||||||
s.ValueCreate(m, kit.ArgDef(arg, kit.Simple(model.BEGIN_TIME, m.Time(), model.END_TIME, m.Time("720h"))...)...)
|
s.ValueCreate(m, kit.ArgDef(arg, kit.Simple(model.BEGIN_TIME, m.Time(), model.END_TIME, m.Time("720h"))...)...)
|
||||||
s.SendMessage(m, "", "")
|
s.SendMessage(m, "", "")
|
||||||
}
|
}
|
||||||
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) {
|
func (s plan) List(m *ice.Message, arg ...string) {
|
||||||
|
isLeader := s.IsLeader(m)
|
||||||
s.ValueList(m, arg).Table(func(value ice.Maps) {
|
s.ValueList(m, arg).Table(func(value ice.Maps) {
|
||||||
button := []ice.Any{}
|
button := []ice.Any{}
|
||||||
switch PlanStatus(kit.Int(value[model.PLAN_STATUS])) {
|
switch PlanStatus(kit.Int(value[model.PLAN_STATUS])) {
|
||||||
case PlanCreate:
|
case PlanCreate:
|
||||||
button = append(button, s.Modify, s.Process)
|
if isLeader {
|
||||||
|
button = append(button, s.Modify, s.Process)
|
||||||
|
}
|
||||||
case PlanProcess:
|
case PlanProcess:
|
||||||
button = append(button, s.IssueCreate, s.Finish)
|
button = append(button, s.IssueCreate)
|
||||||
|
if isLeader {
|
||||||
|
button = append(button, s.Finish)
|
||||||
|
}
|
||||||
case PlanFinish:
|
case PlanFinish:
|
||||||
kit.If(m.Option(model.MARKET_UID) == "", func() { button = append(button, s.MarketInsert) })
|
if isLeader && m.Option(model.MARKET_UID) == "" {
|
||||||
|
button = append(button, s.MarketInsert)
|
||||||
|
}
|
||||||
kit.If(len(arg) == 2, func() { s.DoneMessage(m) })
|
kit.If(len(arg) == 2, func() { s.DoneMessage(m) })
|
||||||
}
|
}
|
||||||
m.PushButton(button...)
|
m.PushButton(button...)
|
||||||
}).Display("")
|
}).Display("")
|
||||||
|
kit.If(!isLeader, func() { m.Action() })
|
||||||
|
}
|
||||||
|
func (s plan) Process(m *ice.Message, arg ...string) {
|
||||||
|
s.changeStatus(m, PlanCreate, PlanProcess)
|
||||||
}
|
}
|
||||||
func (s plan) Process(m *ice.Message, arg ...string) { s.changeStatus(m, PlanCreate, PlanProcess) }
|
|
||||||
func (s plan) Finish(m *ice.Message, arg ...string) {
|
func (s plan) Finish(m *ice.Message, arg ...string) {
|
||||||
count := m.Cmd(s.issue, s.Select, "plan_uid = ? AND status != ?", m.Option(model.UID), IssueFinish).Length()
|
count := m.Cmd(s.issue, s.Select, "plan_uid = ? AND status != ?", m.Option(model.UID), IssueFinish).Length()
|
||||||
if m.WarnNotValid(count > 0, kit.Format("还有 %v 个未完成的需求", count)) {
|
if m.WarnNotValid(count > 0, kit.Format("还有 %v 个未完成的需求", count)) {
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
Volcanos(chat.ONIMPORT, {
|
Volcanos(chat.ONIMPORT, {
|
||||||
_init: function(can, msg) {
|
_init: function(can, msg) {
|
||||||
can.onimport.myView(can, msg, function(value) { return [
|
can.onimport.myView(can, msg, function(value) { return [
|
||||||
{view: html.TITLE, list: [value.title, value.plan_status != "finish" && can.onimport.textView(can, value, "plan_status"), can.onimport.titleAction(can, value)]},
|
{view: html.TITLE, list: [value.title, can.onimport.textView(can, value), can.onimport.titleAction(can, value)]},
|
||||||
|
{view: html.STATUS, list: [value.uid.slice(0, 6), can.onimport.timeView(can, value), value.user_name]},
|
||||||
{view: html.STATUS, list: [value.begin_time.split(" ")[0], "~", value.end_time.split(" ")[0]]},
|
{view: html.STATUS, list: [value.begin_time.split(" ")[0], "~", value.end_time.split(" ")[0]]},
|
||||||
value.process_time && {view: html.STATUS, list: [can.base.TimeTrim(value.process_time), "~", can.base.TimeTrim(value.finish_time)]},
|
{view: html.STATUS, list: [can.base.TimeTrim(value.process_time), "~", can.base.TimeTrim(value.finish_time), "需求:", value.issue_count+" 个", "任务:", value.task_count+" 个", "用例:", value.case_count+" 个"]},
|
||||||
{view: html.STATUS, list: ["需求:", value.issue_count+" 个", "任务:", value.task_count+" 个", "用例:", value.case_count+" 个"]},
|
|
||||||
{view: html.OUTPUT, list: [value.content]},
|
{view: html.OUTPUT, list: [value.content]},
|
||||||
] })
|
] })
|
||||||
},
|
},
|
||||||
|
@ -19,6 +19,7 @@ func (s Portal) AfterPlaceAuth(m *ice.Message, arg ...string) {
|
|||||||
s.DashboardInsert(m, "2", "需求待办", issue{}, "", "story_uid = ? AND status != ? AND status != ?", m.Option(model.STORY_UID), IssueRejected, IssueFinish)
|
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, "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)
|
s.DashboardInsert(m, "4", "任务待办", task{}, "", "story_uid = ? AND status != ?", m.Option(model.STORY_UID), TaskFinish)
|
||||||
|
s.DashboardUpdate(m)
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { gonganxitong.PortalCmd(Portal{Portal: guanlixitong.NewPortal(userStory{}, story{})}) }
|
func init() { gonganxitong.PortalCmd(Portal{Portal: guanlixitong.NewPortal(userStory{}, story{})}) }
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
"caseCreate": "创建用例",
|
"caseCreate": "创建用例",
|
||||||
"style": {
|
"style": {
|
||||||
"process": "notice",
|
"process": "notice",
|
||||||
|
"finish": "danger",
|
||||||
"issueCreate": "notice",
|
"issueCreate": "notice",
|
||||||
"taskCreate": "notice",
|
"taskCreate": "notice",
|
||||||
"caseCreate": "notice"
|
"caseCreate": "notice"
|
||||||
|
@ -11,7 +11,7 @@ type task struct {
|
|||||||
Table
|
Table
|
||||||
Case Case
|
Case Case
|
||||||
order string `data:"3"`
|
order string `data:"3"`
|
||||||
fields string `data:"title,content,task_status,begin_time,end_time,process_time,finish_time,case_count,issue_uid,plan_uid,user_uid"`
|
fields string `data:"title,content,task_status,case_count,begin_time,end_time,process_time,finish_time,issue_uid,plan_uid,user_uid"`
|
||||||
create string `name:"create title* content* begin_time:select@date end_time:select@date" role:"leader,worker"`
|
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"`
|
modify string `name:"modify title* content* begin_time*:select@date end_time*:select@date" role:"leader,worker"`
|
||||||
remove string `name:"remove" role:"leader,worker"`
|
remove string `name:"remove" role:"leader,worker"`
|
||||||
@ -35,27 +35,29 @@ func (s task) Remove(m *ice.Message, arg ...string) {
|
|||||||
s.issueCount(m, "-1")
|
s.issueCount(m, "-1")
|
||||||
s.planCount(m, "-1")
|
s.planCount(m, "-1")
|
||||||
}
|
}
|
||||||
func (s task) Modify(m *ice.Message, arg ...string) {
|
|
||||||
s.ValueModify(m, arg...)
|
|
||||||
}
|
|
||||||
func (s task) List(m *ice.Message, arg ...string) {
|
func (s task) List(m *ice.Message, arg ...string) {
|
||||||
|
isLeader, user_uid := s.IsLeader(m), m.Option(model.USER_UID)
|
||||||
s.ValueList(m, arg).Table(func(value ice.Maps) {
|
s.ValueList(m, arg).Table(func(value ice.Maps) {
|
||||||
button := []ice.Any{}
|
button := []ice.Any{}
|
||||||
switch TaskStatus(kit.Int(value[model.TASK_STATUS])) {
|
switch TaskStatus(kit.Int(value[model.TASK_STATUS])) {
|
||||||
case TaskCreate:
|
case TaskCreate:
|
||||||
if value[model.PLAN_UID] == "" {
|
if isLeader && value[model.PLAN_UID] == "" {
|
||||||
button = append(button, s.PlanBind)
|
button = append(button, s.PlanBind)
|
||||||
}
|
}
|
||||||
button = append(button, s.Process)
|
if isLeader || user_uid == value[model.USER_UID] {
|
||||||
|
button = append(button, s.Process)
|
||||||
|
}
|
||||||
case TaskProcess:
|
case TaskProcess:
|
||||||
button = append(button, s.CaseCreate, s.Finish)
|
button = append(button, s.CaseCreate)
|
||||||
|
if isLeader || user_uid == value[model.USER_UID] {
|
||||||
|
button = append(button, s.Finish)
|
||||||
|
}
|
||||||
case TaskFinish:
|
case TaskFinish:
|
||||||
kit.If(len(arg) == 2, func() { s.DoneMessage(m) })
|
kit.If(len(arg) == 2, func() { s.DoneMessage(m) })
|
||||||
}
|
}
|
||||||
m.PushButton(button...)
|
m.PushButton(button...)
|
||||||
}).Display("")
|
}).Display("")
|
||||||
s.SelectJoinPlan(m)
|
s.SelectJoinPlan(m)
|
||||||
s.SelectJoinUser(m)
|
|
||||||
}
|
}
|
||||||
func (s task) Process(m *ice.Message, arg ...string) {
|
func (s task) Process(m *ice.Message, arg ...string) {
|
||||||
s.changeStatus(m, TaskCreate, TaskProcess)
|
s.changeStatus(m, TaskCreate, TaskProcess)
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
Volcanos(chat.ONIMPORT, {
|
Volcanos(chat.ONIMPORT, {
|
||||||
_init: function(can, msg) {
|
_init: function(can, msg) {
|
||||||
can.onimport.myView(can, msg, function(value) { return [
|
can.onimport.myView(can, msg, function(value) { return [
|
||||||
{view: html.TITLE, list: [value.title, value.task_status != "finish" && can.onimport.textView(can, value, "task_status"), can.onimport.titleAction(can, value)]},
|
{view: html.TITLE, list: [value.title, can.onimport.textView(can, value), 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.onimport.timeView(can, value), value.user_name]},
|
||||||
value.process_time && {view: html.STATUS, list: [can.base.TimeTrim(value.process_time), "~", can.base.TimeTrim(value.finish_time)]},
|
{view: html.STATUS, list: [can.base.TimeTrim(value.process_time), "~", can.base.TimeTrim(value.finish_time), "计划:", value.plan_title, "用例:", value.case_count+" 个"]},
|
||||||
value.plan_title && {view: html.STATUS, list: ["计划:", value.plan_title, "用例:", value.case_count+" 个"]},
|
|
||||||
{view: html.OUTPUT, list: [value.content]},
|
{view: html.OUTPUT, list: [value.content]},
|
||||||
] })
|
] })
|
||||||
},
|
},
|
||||||
|
@ -12,4 +12,8 @@ func init() { ice.TeamCtxCmd(userStory{}) }
|
|||||||
|
|
||||||
type UserStoryRole = operation.UserCloudRole
|
type UserStoryRole = operation.UserCloudRole
|
||||||
|
|
||||||
|
var UserStoryCreator = operation.UserCloudCreator
|
||||||
|
|
||||||
|
var UserStoryLeader = operation.UserCloudLeader
|
||||||
|
|
||||||
var UserStoryRoleList = operation.UserCloudRoleList
|
var UserStoryRoleList = operation.UserCloudRoleList
|
||||||
|
@ -4,13 +4,11 @@ import "shylinux.com/x/ice"
|
|||||||
|
|
||||||
type {{.Option "name"}} struct {
|
type {{.Option "name"}} struct {
|
||||||
Table
|
Table
|
||||||
fields string `data:"title,content"`
|
fields string `data:"title,content,user_uid"`
|
||||||
create string `name:"create title* content*" role:"leader"`
|
create string `name:"create title* content*" role:"leader"`
|
||||||
remove string `name:"remove" role:"leader"`
|
remove string `name:"remove" role:"leader"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s {{.Option "name"}}) Create(m *ice.Message, arg ...string) { s.ValueCreate(m, arg...) }
|
func (s {{.Option "name"}}) List(m *ice.Message, arg ...string) { s.ValueList(m, arg).Display("") }
|
||||||
func (s {{.Option "name"}}) Remove(m *ice.Message, arg ...string) { s.ValueRemove(m, arg...) }
|
|
||||||
func (s {{.Option "name"}}) List(m *ice.Message, arg ...string) { s.ValueList(m, arg).Display("") }
|
|
||||||
|
|
||||||
func init() { ice.TeamCtxCmd({{.Option "name"}}{}) }
|
func init() { ice.TeamCtxCmd({{.Option "name"}}{}) }
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
Volcanos(chat.ONIMPORT, {
|
Volcanos(chat.ONIMPORT, {
|
||||||
_init: function(can, msg) {
|
_init: function(can, msg) {
|
||||||
can.onimport.myView(can, msg, function(value) { return [
|
can.onimport.myView(can, msg, function(value) { return [
|
||||||
{view: html.TITLE, list: [value.name||value.title||value.user_name]},
|
{view: html.TITLE, list: [value.title||value.name||value.user_name]},
|
||||||
{view: html.STATUS, list: [value.uid.slice(0, 6), can.base.TimeTrim(value.created_at)]},
|
{view: html.STATUS, list: [value.uid.slice(0, 6), can.onimport.timeView(can, value), value.user_name]},
|
||||||
{view: html.OUTPUT, list: [value.info||value.content]},
|
{view: html.OUTPUT, list: [value.content||value.info]},
|
||||||
] })
|
] })
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user