diff --git a/core/mall/paper.go b/core/mall/paper.go deleted file mode 100644 index 21fdc3d8..00000000 --- a/core/mall/paper.go +++ /dev/null @@ -1,14 +0,0 @@ -package mall - -import ( - ice "shylinux.com/x/icebergs" - "shylinux.com/x/icebergs/base/mdb" -) - -const PAPER = "paper" - -func init() { - Index.MergeCommands(ice.Commands{ - PAPER: {Name: "paper", Help: "问卷", Actions: ice.MergeActions(ice.Actions{}, mdb.ZoneAction(mdb.FIELD, "time,id,type,name,text"))}, - }) -} diff --git a/core/team/count.css b/core/team/count.css deleted file mode 100644 index 4c8e7aee..00000000 --- a/core/team/count.css +++ /dev/null @@ -1,22 +0,0 @@ -fieldset.count div.output div.item { - margin:10px; padding:10px; - border:solid 2px green; - float:left; -} -fieldset.count div.output div.item.gone { - border:solid 2px red; -} -fieldset.count div.output div.item div.name { - font-size:38px; color:green; - font-family:cursive; - text-align:center; -} -fieldset.count div.output div.item span.day { - font-size:24px; color:green; -} -fieldset.count div.output div.item.gone div.name { - color:red; -} -fieldset.count div.output div.item.gone span.day { - color:red; -} diff --git a/core/team/count.go b/core/team/count.go deleted file mode 100644 index 385bfd4b..00000000 --- a/core/team/count.go +++ /dev/null @@ -1,48 +0,0 @@ -package team - -import ( - "strings" - "time" - - ice "shylinux.com/x/icebergs" - "shylinux.com/x/icebergs/base/mdb" - kit "shylinux.com/x/toolkits" -) - -const COUNT = "count" - -func init() { - Index.MergeCommands(ice.Commands{ - COUNT: {Name: "count begin_time@date end_time@date auto insert", Help: "倒计时", Meta: kit.Dict( - ice.Display(""), - ), Actions: ice.MergeActions(ice.Actions{ - 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) - }}, - }, TASK), Hand: func(m *ice.Message, arg ...string) { - begin_time, end_time := _plan_scope(m, 8, append([]string{LONG}, arg...)...) - msg := _plan_list(m.Spawn(), begin_time, end_time) - msg.SortTime(BEGIN_TIME) - - tz := int64(8) - msg.Tables(func(value ice.Maps) { - if value[mdb.STATUS] == CANCEL { - return - } - - show := []string{} - for _, k := range []string{mdb.NAME, mdb.TEXT} { - show = append(show, kit.Format(`
%v
`, k, value[k])) - } - - t := (kit.Time(value[BEGIN_TIME])+int64(time.Hour)*tz)/int64(time.Second)/3600/24 - (time.Now().Unix()+3600*tz)/3600/24 - m.Echo(`
距离 %v%v%v %v
`, - kit.Select("gone", "come", t > 0), value[mdb.TEXT], - strings.Split(value[BEGIN_TIME], " ")[0], - strings.Join(show, ""), - kit.Select("已经", "还有", t > 0), t, - ) - }) - }}, - }) -} diff --git a/core/team/count.js b/core/team/count.js deleted file mode 100644 index c094b118..00000000 --- a/core/team/count.js +++ /dev/null @@ -1,20 +0,0 @@ -Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg, list, cb, target) { - can.onmotion.clear(can) - can.onappend.table(can, msg) - can.onappend.board(can, msg) - can.base.isFunc(cb) && cb(msg) - }, -}, [""]) -Volcanos("onaction", {help: "控件交互", list: ["play"], - play: function(event, can) { - can.page.Select(can, can._output, "div.item", function(item) { - can.onmotion.hidden(can, item) - }) - can.core.Next(can.page.Select(can, can._output, "div.item"), function(item, next) { - can.onmotion.show(can, 300, next, item) - }, function() { - can.user.toast(can, "播放结束") - }) - }, -}) -Volcanos("onexport", {help: "导出数据", list: []}) diff --git a/core/team/epic.go b/core/team/epic.go index 080e2790..64be4227 100644 --- a/core/team/epic.go +++ b/core/team/epic.go @@ -14,10 +14,10 @@ const EPIC = "epic" func init() { Index.MergeCommands(ice.Commands{ - EPIC: {Name: "epic hash list create export import", Help: "史记", Actions: ice.MergeActions(ice.Actions{ + EPIC: {Name: "epic hash list", Help: "史记", Actions: ice.MergeActions(ice.Actions{ mdb.CREATE: {Name: "create time@date zone name"}, mdb.MODIFY: {Name: "modify time@date zone name"}, }, mdb.HashAction(mdb.FIELD, "time,hash,zone,name")), Hand: func(m *ice.Message, arg ...string) { - mdb.HashSelect(m, arg...).Tables(func(value ice.Maps) { + if mdb.HashSelect(m, arg...).Tables(func(value ice.Maps) { if span := kit.Time(m.Time()) - kit.Time(value[mdb.TIME]); span > 0 { m.Push(mdb.TEXT, kit.Format(`已经 %v
距 %s
`, int(time.Duration(span)/time.Hour/24), kit.Split(value[mdb.TIME])[0], @@ -27,7 +27,9 @@ func init() { -int(time.Duration(span)/time.Hour/24)+1, kit.Split(value[mdb.TIME])[0], )) } - }).Sort(mdb.TIME).PushAction(mdb.MODIFY, mdb.REMOVE) + }).PushAction(mdb.MODIFY, mdb.REMOVE); len(arg) == 0 || arg[0] == "" { + m.Sort(mdb.TIME).Action(mdb.CREATE, mdb.EXPORT, mdb.IMPORT) + } web.PushPodCmd(m, "", arg...) ctx.DisplayTableCard(m) }}, diff --git a/core/team/plan.go b/core/team/plan.go index b995648e..dc117a25 100644 --- a/core/team/plan.go +++ b/core/team/plan.go @@ -38,16 +38,14 @@ 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 { +func _plan_list(m *ice.Message, begin_time, end_time time.Time) { 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) - if begin.After(begin_time) && end_time.After(begin) { + if begin, _ := time.ParseInLocation(ice.MOD_TIME, kit.Format(value[BEGIN_TIME]), time.Local); begin.After(begin_time) && end_time.After(begin) { m.Push(key, value, fields, val).PushButton(_task_action(m, value[STATUS], mdb.PLUGIN)) } }) - return m } const ( diff --git a/core/team/team.go b/core/team/team.go index fd87052b..3459330c 100644 --- a/core/team/team.go +++ b/core/team/team.go @@ -9,4 +9,4 @@ const TEAM = "team" var Index = &ice.Context{Name: TEAM, Help: "团队中心"} -func init() { web.Index.Register(Index, nil, TASK, PLAN) } +func init() { web.Index.Register(Index, nil, TODO, EPIC, TASK, PLAN) } diff --git a/core/team/todo.go b/core/team/todo.go index 34336d1a..25828601 100644 --- a/core/team/todo.go +++ b/core/team/todo.go @@ -12,14 +12,16 @@ const TODO = "todo" func init() { Index.MergeCommands(ice.Commands{ - TODO: {Name: "todo hash list create export import", Help: "待办", Actions: ice.MergeActions(ice.Actions{ + TODO: {Name: "todo hash list", Help: "待办", Actions: ice.MergeActions(ice.Actions{ mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) { mdb.HashInputs(m, arg).Cmdy(TASK, mdb.INPUTS, arg) }}, 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) + if mdb.HashSelect(m, arg...).PushAction(cli.START, mdb.REMOVE); len(arg) == 0 || arg[0] == "" { + m.Action(mdb.CREATE, mdb.EXPORT, mdb.IMPORT) + } web.PushPodCmd(m, "", arg...) ctx.DisplayTableCard(m) }},