From 289a37e7a4ee60e8e2de8d5cd9be75d950f64dd6 Mon Sep 17 00:00:00 2001 From: shylinux Date: Thu, 6 Aug 2020 10:28:01 +0800 Subject: [PATCH] opt some --- plugin/local/team/plan.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugin/local/team/plan.js b/plugin/local/team/plan.js index d567c353..f7faeb8a 100644 --- a/plugin/local/team/plan.js +++ b/plugin/local/team/plan.js @@ -153,7 +153,8 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg, }) var head = ["hour"].concat(["周日", "周一", "周二", "周三", "周四", "周五", "周六"]); - var list = [0]; for (var i = 7; i < 23; i++) { list.push(can.base.Number(i, 2)) } + var list = [0]; for (var i = 7; i < 24; i++) { list.push(can.base.Number(i, 2)) } + for (var i = 0; i < 7; i++) { list.push(can.base.Number(i, 2)) } function set(week, hour) { return can.base.Time(can.base.TimeAdd(begin_time, week-begin_time.getDay()+hour/24)) } var table = can.page.Append(can, can.ui.content, [{type: "table", list: @@ -182,9 +183,9 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg, can.core.List(list, function(date, row) { if (row == 0) { return {type: "tr", list: can.core.List(head, function(head) { return {text: [head, "th"]} })} } return {type: "tr", list: can.core.List(head, function(head, col) { - var day = can.base.TimeAdd(last, (row-1)*7+col+1); + var day = can.base.TimeAdd(last, (row-1)*7+col+1) var list = [day.getDate()+""].concat(hash[key(day)]||[]) - return can.onimport._task(can, msg, key(day)+can.base.Time(" %H:%M:%S"), list) + return can.onimport._task(can, msg, key(day)+can.base.Time(null, " %H:%M:%S"), list) })} }) }]).table @@ -238,7 +239,7 @@ Volcanos("onaction", {help: "组件交互", list: [ ["view", "", "name", "text", "level", "score"], ], insertTask: function(event, can, time) { - can.user.input(event, can, can.Conf("feature").insert, function(event, button, data, list) { + can.user.input(event, can, can.Conf("feature")["添加"], function(event, button, data, list) { var args = ["action", "insert"]; can.core.Item(data, function(key, value) { if (key == "begin_time") { value = value || time