mirror of
https://shylinux.com/x/volcanos
synced 2025-04-26 01:04:06 +08:00
opt some
This commit is contained in:
parent
6972b00f82
commit
f5ed18f30a
@ -165,7 +165,7 @@ Volcanos("onaction", {help: "组件交互", list: [
|
||||
if (key == "close_time") { value = value || time }
|
||||
key && value && args.push(key, value)
|
||||
})
|
||||
can.run(event, args, function(msg) { can.run({}) }, true)
|
||||
can.run(event, args, function(msg) { })
|
||||
return true
|
||||
})
|
||||
},
|
||||
@ -183,16 +183,15 @@ Volcanos("onaction", {help: "组件交互", list: [
|
||||
can.page.ClassList.del(can, item, "hidden")
|
||||
count++
|
||||
})
|
||||
can.Status("count", count)
|
||||
return
|
||||
} else {
|
||||
can.page.Select(can, can.ui.content, "div.item", function(item) {
|
||||
can.page.ClassList.add(can, item, "hidden")
|
||||
})
|
||||
can.page.Select(can, can.ui.content, "div."+value, function(item) {
|
||||
can.page.ClassList.del(can, item, "hidden")
|
||||
count++
|
||||
})
|
||||
}
|
||||
can.page.Select(can, can.ui.content, "div.item", function(item) {
|
||||
can.page.ClassList.add(can, item, "hidden")
|
||||
})
|
||||
can.page.Select(can, can.ui.content, "div."+value, function(item) {
|
||||
can.page.ClassList.del(can, item, "hidden")
|
||||
count++
|
||||
})
|
||||
can.Status("count", count)
|
||||
can.Action(key, value)
|
||||
},
|
||||
|
@ -7,10 +7,32 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg,
|
||||
{view: ["display", "pre"]},
|
||||
]))
|
||||
|
||||
var cmd = "", arg = ""
|
||||
can.onappend.table(can, can.ui.content, "table", msg, function(value, key, index, line, array) {
|
||||
if (key == "key") {
|
||||
switch (value) {
|
||||
case "extra.cmd": cmd += line.value; break
|
||||
case "extra.ctx": cmd = line.value + "." + cmd; break
|
||||
case "extra.arg": arg = line.value; break
|
||||
}
|
||||
}
|
||||
return can.onimport._table(can, value, key, index, line, array)
|
||||
})
|
||||
|
||||
cmd && can.onappend.plugin(can, {
|
||||
height: can.Conf("height"), width: can.Conf("width"), index: cmd, args: arg,
|
||||
}, function(sub) {
|
||||
sub.run = function(event, cmds, cb, silent) {
|
||||
var msg = can.request(event); can.core.List(msg["key"], function(key, index) {
|
||||
msg.Option("list."+key, msg["value"][index])
|
||||
})
|
||||
can.run(event, ["action", "command", "run", cmd].concat(cmds), function(msg) {
|
||||
typeof cb == "function" && cb(msg)
|
||||
}, true)
|
||||
}
|
||||
}, can.ui.display)
|
||||
|
||||
|
||||
can.onappend.board(can, can.ui.display, "board", msg)
|
||||
can.onimport._board(can, msg)
|
||||
return typeof cb == "function" && cb(msg)
|
||||
|
Loading…
x
Reference in New Issue
Block a user