1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-28 01:52:01 +08:00
This commit is contained in:
shaoying 2020-09-24 23:48:49 +08:00
parent ca8b0a8ab5
commit af564ea26a
2 changed files with 20 additions and 24 deletions

View File

@ -108,23 +108,18 @@ Volcanos("onengine", {help: "解析引擎", list: [], _init: function(can, meta,
typeof cb == "function" && cb(msg)
return true
}
can.misc.Run(event, can, {names: pane._name}, [river.name, storm.name, "order"].concat(storm.index), cb)
can.misc.Run(event, can, {names: pane._name}, ["action", "command"].concat(storm.index), cb)
return true
}
if (location.pathname == "/share") {
return false
}
if (location.pathname == "/share") { return false }
can.core.List(storm.action, function(value) {
msg.Push("name", value.name||"")
msg.Push("help", value.help||"")
msg.Push("pod", value.pod||"")
msg.Push("group", value.group||"")
msg.Push("index", value.index||"")
msg.Push("args", value.args||"[]")
msg.Push("action", value.action||value.index||"")
msg.Push("inputs", JSON.stringify(value.inputs||[]))
msg.Push("feature", JSON.stringify(value.feature||{}))
msg.Push("index", value.index||"")
msg.Push("args", value.args||"[]")
})
typeof cb == "function" && cb(msg)
} else if (action && action.engine) {
@ -316,12 +311,11 @@ Volcanos("onappend", {help: "渲染引擎", list: [], _init: function(can, meta,
},
}, [Volcanos.meta.volcano].concat(list), function(sub) { cb(sub)
meta.feature = sub.base.Obj(meta.feature, {})
sub.page.ClassList.add(sub, field, meta.feature.style||"")
sub.page.ClassList.add(sub, field, meta.style||"")
meta.detail = meta.feature["detail"] || {}
sub.page.ClassList.add(sub, field, meta.style||meta.feature.style||"")
sub.onimport && sub.onimport._init(sub, sub.Conf(meta), list, function() {}, field)
// meta.detail = meta.feature["detail"] || {}
meta.inputs && sub.onappend._option(sub, meta, list, cb)
sub.onaction && sub.onappend._action(sub, sub._action, meta.button || sub.onaction.list)
sub.onexport && sub.onappend._status(sub, sub._status, sub.onexport.list)

View File

@ -34,6 +34,10 @@ Volcanos("onaction", {help: "交互操作", list: [], _init: function(can, msg,
})
},
add_plugin: function(can, river, storm, value) {
value.action = value.id || value.index
value.height = can._target.offsetHeight
value.width = can._target.offsetWidth
if (can.user.Search(can, "river") == river && can.user.Search(can, "storm") == storm && can.user.Search(can, "active") == value.name) {
value.args = can.core.List(value.inputs, function(item) {
if (item._input == "text" || item._input == "select") {
@ -41,7 +45,7 @@ Volcanos("onaction", {help: "交互操作", list: [], _init: function(can, msg,
}
})
}
value.name && can.onappend._init(can, value, Volcanos.meta.libs.concat(["/plugin/state.js"]), function(sub) {
can.onappend._init(can, value, Volcanos.meta.libs.concat(["/plugin/state.js"]), function(sub) {
sub._legend.onclick = function(event) {
var opt = {pod: can.user.Search(can, "pod"), river: river, storm: storm, active: value.name}
can.core.Item(sub.Option(), function(key, value) { opt[key] = value })
@ -86,18 +90,16 @@ Volcanos("onexport", {help: "导出数据", list: [], _init: function(can, msg,
can.core.Next(sup.Table(), function(value, next) {
value.feature = can.base.Obj(value.feature||value.meta||"{}", [])
value.inputs = can.base.Obj(value.inputs||value.list||"[]", [])
value.height = can._target.offsetHeight
value.width = can._target.offsetWidth
if (value.inputs.length == 0) {
can.run({}, ["action", "command", value.index], function(msg) {
value.inputs = can.base.Obj(msg.list&&msg.list[0]||"[]", [])
value.feature = can.base.Obj(msg.meta&&msg.meta[0]||"{}", {})
can.onaction.add_plugin(can, river, storm, value), next()
})
if (value.inputs.length > 0) {
can.onaction.add_plugin(can, river, storm, value), next()
return
}
can.onaction.add_plugin(can, river, storm, value), next()
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()
})
})
})
},