1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-25 16:58:06 +08:00
This commit is contained in:
shaoying 2020-06-19 08:31:15 +08:00
parent 2665f9ff98
commit 740554ce81
2 changed files with 9 additions and 9 deletions

View File

@ -55,8 +55,7 @@ Volcanos("onengine", { _init: function(can, meta, list, cb, target) {
} }
break break
case "Storm": case "Storm":
var river = can.onengine.river[cmds[0]] var river = can.onengine.river[cmds[0]]; if (!river) { break }
if (!river) { break }
can.core.Item(river.storm, function(key, value) { can.core.Item(river.storm, function(key, value) {
msg.Push("key", key) msg.Push("key", key)
msg.Push("name", value.name) msg.Push("name", value.name)
@ -80,10 +79,11 @@ Volcanos("onengine", { _init: function(can, meta, list, cb, target) {
msg.Push("group", value.group||"") msg.Push("group", value.group||"")
msg.Push("index", value.index||"") msg.Push("index", value.index||"")
msg.Push("args", value.args||"[]") msg.Push("args", value.args||"[]")
msg.Push("action", value.action||value.index||"")
msg.Push("inputs", JSON.stringify(value.inputs||[])) msg.Push("inputs", JSON.stringify(value.inputs||[]))
msg.Push("feature", JSON.stringify(value.feature||{})) msg.Push("feature", JSON.stringify(value.feature||{}))
}) })
typeof cb == "function" && cb(msg); typeof cb == "function" && cb(msg)
} else if (action && action.engine) { } else if (action && action.engine) {
action.engine(event, can, msg, pane, cmds, cb) action.engine(event, can, msg, pane, cmds, cb)
} else if (action) { } else if (action) {
@ -176,21 +176,22 @@ Volcanos("onappend", { _init: function(can, meta, list, cb, target, field) { met
p != undefined && (input._target.value = p) p != undefined && (input._target.value = p)
} }
input.run = function(event, cmds, cb, silent) { var msg = sub.request(event); msg.Option("_action", item.name) input.run = function(event, cmds, cb, silent) { var msg = sub.request(event);
// 控件回调 // 控件回调
switch (item.name) { switch (item.name) {
case "查看":
case "打开": case "打开":
msg.Option("_action", "") case "查看":
break break
case "返回": case "返回":
// 历史命令 // 历史命令
msg.Option("_action", "")
sub._history.pop(); var his = sub._history.pop(); if (his) { sub._history.pop(); var his = sub._history.pop(); if (his) {
can.page.Select(can, option, "input.args", function(item, index) { can.page.Select(can, option, "input.args", function(item, index) {
item.value = his[index] || "" item.value = his[index] || ""
}) })
} }
break
default:
msg.Option("_action", item.name)
} }
// 解析参数 // 解析参数

View File

@ -42,8 +42,7 @@ Volcanos("onexport", {help: "导出数据", list: [], _init: function(can, msg,
can.Conf("action", value.name) can.Conf("action", value.name)
can.Conf("current", sub) can.Conf("current", sub)
// 插件回调 // 插件回调
cmds[0] == "search" || msg.Option("index", value.index) return can.run(event, can.onengine[cmds[0]]? cmds: [river, storm, value.action].concat(cmds), function(msg) {
return can.run(event, can.onengine[cmds[0]]? cmds: [river, storm, index].concat(cmds), function(msg) {
can.run(msg._event, ["search", "Footer.onaction.ncmd"]); can.run(msg._event, ["search", "Footer.onaction.ncmd"]);
can.onappend.toast(can, "执行成功", value.name, 2000); can.onappend.toast(can, "执行成功", value.name, 2000);
typeof cb == "function" && cb(msg) typeof cb == "function" && cb(msg)