diff --git a/base/mdb/zone.go b/base/mdb/zone.go index 65cd90e9..258a2af7 100644 --- a/base/mdb/zone.go +++ b/base/mdb/zone.go @@ -196,6 +196,9 @@ func ZoneInsert(m *ice.Message, arg ...Any) { if len(args) == 0 { args = m.OptionSimple(ZoneShort(m), m.Config(FIELD)) } + if len(args)%2 == 1 { + args = args[:len(args)-1] + } for i := len(args) - 2; i >= 0; i -= 2 { if args[i+1] == "" { args = args[:i] diff --git a/core/team/plan.go b/core/team/plan.go index 8ee3de8c..b034705c 100644 --- a/core/team/plan.go +++ b/core/team/plan.go @@ -38,7 +38,7 @@ func _plan_scope(m *ice.Message, tz int, arg ...string) (begin_time, end_time ti return begin_time, end_time } func _plan_list(m *ice.Message, begin_time, end_time time.Time) *ice.Message { - m.Option(mdb.CACHE_LIMIT, "100") + m.Option(mdb.CACHE_LIMIT, "-1") m.OptionFields("begin_time,close_time,zone,id,level,status,score,type,name,text,pod,extra") m.Cmd(mdb.SELECT, m.Prefix(TASK), "", mdb.ZONE, mdb.FOREACH, func(key string, fields []string, value, val ice.Map) { begin, _ := time.ParseInLocation(ice.MOD_TIME, kit.Format(value[BEGIN_TIME]), time.Local) @@ -63,12 +63,13 @@ const PLAN = "plan" func init() { Index.MergeCommands(ice.Commands{ PLAN: {Name: "plan scale=week,day,week,month,year,long begin_time@date list", Help: "计划", Actions: ice.MergeActions(ice.Actions{ - mdb.INPUTS: {Name: "inputs", Help: "补全", Hand: func(m *ice.Message, arg ...string) { - m.Cmdy(TODO, mdb.INPUTS, arg) - }}, - mdb.PLUGIN: {Name: "plugin extra.index extra.args", Help: "插件", Hand: func(m *ice.Message, arg ...string) { - m.Cmdy(TASK, mdb.MODIFY, arg) + mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) { m.Cmdy(TODO, mdb.INPUTS, arg) }}, + mdb.INSERT: {Name: "insert zone type=once,step,week name text begin_time@date close_time@date", Help: "添加", Hand: func(m *ice.Message, arg ...string) { + m.Cmdy(TASK, mdb.INSERT, arg) }}, + mdb.PLUGIN: {Hand: func(m *ice.Message, arg ...string) { m.Cmdy(TASK, mdb.MODIFY, arg) }}, + mdb.EXPORT: {Hand: func(m *ice.Message, arg ...string) { m.Cmdy(TASK, mdb.EXPORT) }}, + mdb.IMPORT: {Hand: func(m *ice.Message, arg ...string) { m.Cmdy(TASK, mdb.IMPORT) }}, ice.RUN: {Name: "run", Help: "执行", Hand: func(m *ice.Message, arg ...string) { m.Option(ice.POD, m.Option("task.pod")) if m.Option("task.pod", ""); ctx.PodCmd(m, m.PrefixKey(), ice.RUN, arg) { @@ -76,11 +77,6 @@ func init() { } m.Cmdy(m.CmdAppend(TASK, arg[0], arg[1], ctx.INDEX), arg[2:]) }}, - mdb.INSERT: {Name: "insert zone type=once,step,week name text begin_time@date close_time@date", Help: "添加", Hand: func(m *ice.Message, arg ...string) { - m.Cmdy(TASK, mdb.INSERT, arg) - }}, - mdb.EXPORT: {Hand: func(m *ice.Message, arg ...string) { m.Cmdy(TASK, mdb.EXPORT) }}, - mdb.IMPORT: {Hand: func(m *ice.Message, arg ...string) { m.Cmdy(TASK, mdb.IMPORT) }}, }, ctx.CmdAction()), Hand: func(m *ice.Message, arg ...string) { if len(arg) > 0 && arg[0] == ctx.ACTION { m.Cmdy(TASK, arg) diff --git a/core/team/task.go b/core/team/task.go index 930bf007..d3467b76 100644 --- a/core/team/task.go +++ b/core/team/task.go @@ -72,7 +72,7 @@ func init() { m.PushButton(_task_action(m, value[STATUS])) status[value[mdb.STATUS]]++ }) - m.Status(status) + m.StatusTimeCount(status) } }}, }) diff --git a/core/team/todo.go b/core/team/todo.go index a2955e68..e2446b89 100644 --- a/core/team/todo.go +++ b/core/team/todo.go @@ -14,12 +14,11 @@ func init() { Index.MergeCommands(ice.Commands{ TODO: {Name: "todo hash list create export import", Help: "待办", Actions: ice.MergeActions(ice.Actions{ mdb.INPUTS: {Name: "inputs", Help: "补全", Hand: func(m *ice.Message, arg ...string) { - mdb.HashInputs(m, arg) - // m.Cmdy(TASK, mdb.INPUTS, arg) + mdb.HashInputs(m, arg).Cmdy(TASK, mdb.INPUTS, arg) }}, mdb.CREATE: {Name: "create zone name text", Help: "创建"}, cli.START: {Name: "start type=once,step,week", Help: "启动", Hand: func(m *ice.Message, arg ...string) { - m.Cmd(TASK, mdb.INSERT, m.OptionSimple("zone,type,name,text"), BEGIN_TIME, m.Time()) + m.Cmd(TASK, mdb.INSERT, m.OptionSimple("zone,type,name,text")) mdb.HashRemove(m, m.OptionSimple(mdb.HASH)) }}, }, mdb.HashAction(mdb.FIELD, "time,hash,zone,name,text")), Hand: func(m *ice.Message, arg ...string) {