1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-26 01:04:06 +08:00
This commit is contained in:
shaoying 2021-01-25 22:10:12 +08:00
parent 2f34531c60
commit 5c1489f914
5 changed files with 18 additions and 11 deletions

View File

@ -276,7 +276,7 @@ Volcanos("onappend", {help: "渲染引擎", list: [], _init: function(can, meta,
}
var feature = can.Conf("feature")
var input = cmds && cmds[0] == "action" && cmds.length == 2 && feature && feature[cmds[1]]; if (input) {
var input = cmds && cmds[0] == "action" && cmds.length < 4 && feature && feature[cmds[1]]; if (input) {
can.user.input(event, can, input, function(ev, button, data, list) {
cmds = cmds.slice(0, 2), can.core.Item(data, function(key, value) {
key && value && cmds.push(key, value)

View File

@ -78,6 +78,9 @@ input[type=text]:hover {
input[name=cmd] {
width:160px;
}
fieldset>form.option>div.item input.args[name=date] {
width:150px;
}
select {
box-shadow: 4px 4px 10px 1px #626bd0;
background-color:black; color:cyan;

View File

@ -44,8 +44,8 @@ Volcanos("onaction", {help: "控件交互", list: [], _init: function(can, msg,
can.run({}, ["search", "Header.onimport.menu", "river",
["添加", "创建群组", "添加应用", "添加工具", "添加用户", "添加设备", "创建空间"],
["访问", "内部系统", "访问应用", "访问工具", "访问用户", "访问设备", "访问任务"],
["共享", "共享群组", "共享应用", "共享工具", "共享用户", "邀请设备"],
["访问", "内部系统", "访问应用", "访问工具", "访问用户", "访问设备", "工作任务"],
["共享", "共享群组", "共享应用", "共享工具", "共享用户", "共享设备"],
], function(event, item) {
can.core.CallFunc([can.ondetail, item], [event, can, item, can.Conf("river"), can.Conf("storm")])
})
@ -211,7 +211,7 @@ Volcanos("ondetail", {help: "菜单交互", list: ["共享群组", "添加用户
"访问设备": function(event, can, button, river, storm) {
can.user.select(event, can, "space", "time,type,name,text")
},
"访问任务": function(event, can, button, river, storm) {
"工作任务": function(event, can, button, river, storm) {
var msg = can.request(event, {index: "web.team.task"})
can.user.select(event, can, "task", "time,zone,id,type,name,text")
},
@ -224,10 +224,10 @@ Volcanos("ondetail", {help: "菜单交互", list: ["共享群组", "添加用户
return true
})
},
"邀请设备": function(event, can, button, river, storm) {
"共享设备": function(event, can, button, river, storm) {
can.run(event, ["action", "invite"], function(msg) {
var toast = can.user.toast(can, {
text: msg.Result(), title: "邀请设备",
text: msg.Result(), title: "共享设备",
width: -100, duration: -1, button: [
{button: ["关闭", function() { toast.Close() }]},
]

View File

@ -10,13 +10,14 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg,
}]},
{view: "content"}, {view: ["display", "table"]}, {view: "preview"},
]), typeof cb == "function" && cb(msg)
can.page.ClassList.add(can, can.ui.display, "content")
var header = can.run({}, ["search", "Header.onexport.height"])||0
var footer = can.run({}, ["search", "Footer.onexport.height"])||0
can.page.Modify(can, can._output, {style: {"max-height": window.innerHeight-header-footer-64}})
},
_table: function(can, msg, fields) { can.onmotion.clear(can, can.ui.content)
can.onappend.table(can, msg, function(value, key, index, line) { can.Status("count", index+1)
var table = can.onappend.table(can, msg, function(value, key, index, line) { can.Status("count", index+1)
return {text: [key == "text" && typeof line.text == "function" && line.text.help || value, "td"], onclick: function(event) {
if (event.shiftKey) { event.stopPropagation(), event.preventDefault()
return can.onappend.plugin(can, {index: line.ctx? line.ctx+"."+line.cmd: msg.Option("index"), option: line}, function(sub, meta) {
@ -36,6 +37,7 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg,
}, can.ui.content, can.core.List((msg.Option("sort")||"ctx,cmd,type,name,text").split(","), function(item) {
return fields.indexOf(item)
}))
can.page.Modify(can, can.ui.display, {style: {width: table.offsetWidth}})
},
_word: function(can, msg, cmds, fields) {
msg = can.request({}, {word: cmds, fields: fields.join(","), sort: msg.Option("sort"), index: msg.Option("index")})

View File

@ -53,14 +53,16 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg,
task.extra && can.core.Item(can.base.Obj(task.extra), function(key, value) { task["extra."+key] = value }), delete(task.extra)
var info = {}; can.core.List(can.onexport.list, function(key) { info[key] = task[key] }), can.Status(info)
function keys(task, key) { return [task.zone, task.id, key].join(".") }
if (can.task) {
can.page.Cache(can.task.id+".profile", can.ui.profile, can.task.id)
can.page.Cache(can.task.id+".display", can.ui.display, can.task.id)
can.page.Cache(keys(can.task, "profile"), can.ui.profile, can.task.id)
can.page.Cache(keys(can.task, "display"), can.ui.display, can.task.id)
}
can.task = task
var profile = can.page.Cache(task.id+".profile", can.ui.profile)
var display = can.page.Cache(task.id+".display", can.ui.display)
var profile = can.page.Cache(keys(task, "profile"), can.ui.profile)
var display = can.page.Cache(keys(task, "display"), can.ui.display)
if (profile || display) { return }
var table = can.page.Appends(can, can.ui.profile, [{view: ["content", "table"], list: [{th: ["key", "value"]}]}]).first