1
0
forked from x/icebergs
icebergs/core/team/todo.go
2022-10-16 13:55:43 +08:00

29 lines
999 B
Go

package team
import (
ice "shylinux.com/x/icebergs"
"shylinux.com/x/icebergs/base/ctx"
"shylinux.com/x/icebergs/base/mdb"
"shylinux.com/x/icebergs/base/web"
"shylinux.com/x/icebergs/base/cli"
)
const TODO = "todo"
func init() {
Index.MergeCommands(ice.Commands{
TODO: {Name: "todo hash list create export import", Help: "待办", Actions: ice.MergeActions(ice.Actions{
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) { mdb.HashInputs(m, arg).Cmdy(TASK, mdb.INPUTS, arg) }},
mdb.CREATE: {Name: "create zone name text"},
cli.START: {Name: "start type=once,step,week", Hand: func(m *ice.Message, arg ...string) {
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) {
mdb.HashSelect(m, arg...).PushAction(cli.START, mdb.REMOVE)
web.PushPodCmd(m, "", arg...)
ctx.DisplayTableCard(m)
}},
})
}