From 5c1489f91444b27b9a0790de2006f07dd30907b7 Mon Sep 17 00:00:00 2001 From: shaoying Date: Mon, 25 Jan 2021 22:10:12 +0800 Subject: [PATCH] opt some --- frame.js | 2 +- page/index.css | 3 +++ pane/River.js | 10 +++++----- pane/Search.js | 4 +++- plugin/local/team/plan.js | 10 ++++++---- 5 files changed, 18 insertions(+), 11 deletions(-) diff --git a/frame.js b/frame.js index e779f7f4..e8b290f2 100644 --- a/frame.js +++ b/frame.js @@ -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) diff --git a/page/index.css b/page/index.css index 4c02fd3e..27358971 100644 --- a/page/index.css +++ b/page/index.css @@ -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; diff --git a/pane/River.js b/pane/River.js index 5fd36c74..278b92b6 100644 --- a/pane/River.js +++ b/pane/River.js @@ -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() }]}, ] diff --git a/pane/Search.js b/pane/Search.js index b4b3a7c4..53b952c4 100644 --- a/pane/Search.js +++ b/pane/Search.js @@ -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")}) diff --git a/plugin/local/team/plan.js b/plugin/local/team/plan.js index daa4a3c2..4de0ab01 100644 --- a/plugin/local/team/plan.js +++ b/plugin/local/team/plan.js @@ -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