1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-25 16:58:06 +08:00

add order.js

This commit is contained in:
shaoying 2020-05-11 14:31:00 +08:00
parent 4a04a8f5b4
commit 5c39492fa6
3 changed files with 33 additions and 21 deletions

View File

@ -6,6 +6,7 @@ Volcanos("onaction", { _init: function(can, meta, list, cb, target) {
}, can[item.name] = pane, next(); }, can[item.name] = pane, next();
}, can._target); }, can._target);
}, function() { can.onlayout._init(can, meta, list, function() { }, function() { can.onlayout._init(can, meta, list, function() {
can.require(["publish/order.js"], function(can) {
function getAction() {} function getAction() {}
function getStorm(storm) { can.core.Item(storm, function(key, value) { function getStorm(storm) { can.core.Item(storm, function(key, value) {
value._link? can.require([value._link], function(can) { value._link? can.require([value._link], function(can) {
@ -25,6 +26,7 @@ Volcanos("onaction", { _init: function(can, meta, list, cb, target) {
var pane = can[meta.main.name], msg = can.request(can._event); var pane = can[meta.main.name], msg = can.request(can._event);
pane.onaction._init(pane, msg, msg.option||[], cb, target); pane.onaction._init(pane, msg, msg.option||[], cb, target);
})
}, target) }); }, target) });
}, },
search: function(event, can, msg, pane, cmds, cb) { var chain = cmds[1] search: function(event, can, msg, pane, cmds, cb) { var chain = cmds[1]
@ -34,7 +36,7 @@ Volcanos("onaction", { _init: function(can, meta, list, cb, target) {
typeof fun == "function" && fun(sub, msg, cmds.slice(2), cb, sub._target) typeof fun == "function" && fun(sub, msg, cmds.slice(2), cb, sub._target)
}, },
engine: function(event, can, msg, pane, cmds, cb) { engine: function(event, can, msg, pane, cmds, cb) { if (!can.onengine) { return false }
switch (pane._name) { switch (pane._name) {
case "River": case "River":
if (cmds.length == 0) { if (cmds.length == 0) {
@ -62,6 +64,7 @@ Volcanos("onaction", { _init: function(can, meta, list, cb, target) {
msg.Push("name", value.name||""); msg.Push("name", value.name||"");
msg.Push("help", value.help||""); msg.Push("help", value.help||"");
msg.Push("inputs", JSON.stringify(value.inputs||[])); msg.Push("inputs", JSON.stringify(value.inputs||[]));
msg.Push("feature", JSON.stringify(value.feature||{}));
}) })
typeof cb == "function" && cb(msg); typeof cb == "function" && cb(msg);
} else if (action.engine) { } else if (action.engine) {
@ -130,7 +133,9 @@ Volcanos("onappend", { _init: function(can, meta, list, cb, target, field) {
if (silent) { typeof cb == "function" && cb(msg); return } if (silent) { typeof cb == "function" && cb(msg); return }
// 添加组件 // 添加组件
var display = "plugin/"+(msg.Option("_display")||feature.display||"table.js") var display = (msg.Option("_display")||feature.display||"table.js")
display.indexOf("/") == 0 || (display = "plugin/"+display)
sub[display] = Volcanos(display, { _target: output, sub[display] = Volcanos(display, { _target: output,
_option: option, _action: action, _output: output, _option: option, _action: action, _output: output,
_follow: can._follow+"."+meta.name+"."+display, _follow: can._follow+"."+meta.name+"."+display,

View File

@ -15,7 +15,6 @@ var Config = {name: "demo", volcano: "frame.js", iceberg: "/chat/", intshell: "p
"plugin/input/date", "plugin/input/date",
"plugin/input/upload", "plugin/input/upload",
"plugin/input/province", "plugin/input/province",
"publish/order.js",
], ],
} }

View File

@ -54,6 +54,14 @@ var Volcanos = shy("火山架", {cache: {}, index: 1, order: 1, debug: {
var source = !libs[0].endsWith("/") && (libs[0].indexOf(".") == -1? libs[0]+".js": libs[0]) || libs[0]; var source = !libs[0].endsWith("/") && (libs[0].indexOf(".") == -1? libs[0]+".js": libs[0]) || libs[0];
if (source.endsWith(".js")) { var script = document.createElement("script"); if (source.endsWith(".js")) { var script = document.createElement("script");
if (can.user && source.indexOf("publish") == 0) {
source += "?pod="+(can.user.Search(can, "pod")||"")
libs[0] = source
}
if (can.user && source.indexOf("/publish") == 0) {
source += "?pod="+(can.user.Search(can, "pod")||"")
libs[0] = source
}
script.src = source, script.onload = function() { script.src = source, script.onload = function() {
can._load(libs[0], each), can.require(libs.slice(1), cb, each); can._load(libs[0], each), can.require(libs.slice(1), cb, each);
} // 加载脚本 } // 加载脚本