From 0558eef131598fee762f4456ddfd0ea313c69ed6 Mon Sep 17 00:00:00 2001 From: shaoying Date: Mon, 12 Oct 2020 15:51:29 +0800 Subject: [PATCH] opt some --- pane/Action.js | 2 +- pane/Header.js | 6 ++++++ plugin/table.js | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pane/Action.js b/pane/Action.js index 52eb3068..98ab6812 100644 --- a/pane/Action.js +++ b/pane/Action.js @@ -95,7 +95,7 @@ Volcanos("onexport", {help: "导出数据", list: [], _init: function(can, msg, return } - can.run({}, ["action", "command", value.index], function(msg) { + value.index && can.run({}, ["action", "command", value.index], function(msg) { value.feature = can.base.Obj(msg.meta&&msg.meta[0]||"{}", {}) value.inputs = can.base.Obj(msg.list&&msg.list[0]||"[]", []) can.onaction.add_plugin(can, river, storm, value), next() diff --git a/pane/Header.js b/pane/Header.js index 4ee16cce..4b3810c2 100644 --- a/pane/Header.js +++ b/pane/Header.js @@ -124,6 +124,12 @@ Volcanos("onexport", {help: "导出数据", list: [], _init: function(can, msg, }, time: function(event, can, key, target) { target.innerHTML = can.base.Time(null, "%w %H:%M:%S") + + if (can.user.Search(can, "pod")) { return } + if (can.user.Search(can, "topic")) { return } + var h = parseInt(can.base.Time(null, "%H")) + var topic = h < 7 || h > 17? "black": "white" + can.onaction[topic]({}, can, topic) }, }) diff --git a/plugin/table.js b/plugin/table.js index d294adbe..c431ae10 100644 --- a/plugin/table.js +++ b/plugin/table.js @@ -88,7 +88,7 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg, can.onmotion[value.indexOf("\n") >= 0 || event.ctrlKey? "modifys": "modify"](can, event.target, function(event, value, old) { var msg = can.sup.request(event); msg.Option(can.Option()), msg.Option(line) if (key == "value") { key = line.key } - can.run(event, ["action", "编辑", key, value], function(msg) { can.run({}) }, true) + can.run(event, ["action", "modify", key, value], function(msg) { can.run({}) }, true) }) }, onmouseover: function(event) { can.user.toast(can, index+1+"/"+array.length)