mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 08:48:06 +08:00
opt plan.js
This commit is contained in:
parent
587d5325c7
commit
91a538e866
2
frame.js
2
frame.js
@ -461,7 +461,7 @@ Volcanos(chat.ONAPPEND, {help: "渲染引擎", _init: function(can, meta, list,
|
||||
}, target||can._output, field)
|
||||
},
|
||||
plugin: function(can, meta, cb, target, field) { meta = meta||{}, meta.index = meta.index||can.core.Keys(meta.ctx, meta.cmd)
|
||||
var p = can.onengine.plugin(can, meta.index), res = {}; function cbs(sub, meta, skip) { res.__proto__ = sub, cb(sub, meta, skip) }
|
||||
var p = can.onengine.plugin(can, meta.index), res = {}; function cbs(sub, meta, skip) { res.__proto__ = sub, can._plugins = (can._plugins||[]).concat([sub]), cb(sub, meta, skip) }
|
||||
(meta.meta || meta.inputs && meta.inputs.length > 0)? /* 局部命令 */ can.onappend._plugin(can, {meta: meta.meta, list: meta.list}, meta, cbs, target, field):
|
||||
p? /* 前端命令 */ can.onappend._plugin(can, {name: meta.index, help: p.help, meta: p.meta, list: p.list}, meta, function(sub, meta, skip) {
|
||||
sub.run = function(event, cmds, cb) { var _cb = p, n = 0
|
||||
|
@ -122,7 +122,7 @@ Volcanos(chat.ONACTION, {help: "操作数据", _init: function(can, cb, target)
|
||||
can.Conf(html.MARGIN_X, 4*html.PLUGIN_MARGIN)
|
||||
|
||||
if (can.user.mod.isPod || can.user.isMobile) {
|
||||
var gt = "❯", lt = "❮"; function toggle(view) { return can.onmotion.toggle(can, can._root.River._target) }
|
||||
var gt = "❯", lt = "❮"; function toggle(view) { return can.onmotion.toggle(can, can._root.River._target) }
|
||||
can.page.Append(can, target, [{view: [[html.TOGGLE, chat.PROJECT]], list: [{text: [gt, html.DIV]}], onclick: function(event) {
|
||||
event.target.innerHTML = toggle()? gt: lt, can.onaction.layout(can, can.Conf(chat.LAYOUT))
|
||||
}}])
|
||||
@ -204,7 +204,7 @@ Volcanos(chat.ONACTION, {help: "操作数据", _init: function(can, cb, target)
|
||||
can.onlayout._init(can)
|
||||
|
||||
var cb = can.onlayout[button]; if (can.base.isFunc(cb)? cb(can, silent): (can.getActionSize(function(height, width) {
|
||||
can.ConfHeight(can.base.Min(200, height-can.Conf(html.MARGIN_Y)-200)), can.ConfWidth(width-can.Conf(html.MARGIN_X))
|
||||
can.ConfHeight(can.base.Min(200, height-can.Conf(html.MARGIN_Y)-(can.isCmdMode()? 0: 200))), can.ConfWidth(width-can.Conf(html.MARGIN_X))
|
||||
}), false)) { return }
|
||||
|
||||
can.core.Next(can._plugins, function(sub, next) { can.onmotion.delay(can, function() {
|
||||
|
@ -27,8 +27,8 @@ Volcanos(chat.ONFIGURE, {help: "控件详情", key: {
|
||||
})
|
||||
}}
|
||||
}), can.onappend._status(can, [mdb.TOTAL, mdb.INDEX]), can.Status(mdb.TOTAL, msg.Length())
|
||||
can.getActionSize(function(left, top, width, height) {
|
||||
can.page.style(can, can._target, html.MAX_HEIGHT, can.base.Max(top+height-can._target.offsetTop, 400))
|
||||
can.getActionSize(function(left, top, width, height) { left = left||0, top = top||0
|
||||
can.page.style(can, can._target, html.MAX_HEIGHT, can.base.Max(window.innerHeight-can._target.offsetTop-html.ACTION_HEIGHT, 600))
|
||||
})
|
||||
},
|
||||
_make: function(event, can, meta, cb, target, last) {
|
||||
|
@ -39,7 +39,7 @@ fieldset.inner>div.output fieldset.toolkit>div.output fieldset { display:none; }
|
||||
fieldset.inner>div.output fieldset.toolkit>div.output fieldset.select { background-color:#0e3369b3; color:white; display:block; z-index:10; }
|
||||
fieldset.inner div.output fieldset.toolkit>div.output { position:unset; }
|
||||
|
||||
fieldset>div.output>fieldset.plug { position:sticky; bottom:0px; right:0px; }
|
||||
fieldset>div.output>fieldset.plug { position:absolute; bottom:0px; right:0px; }
|
||||
fieldset>div.output>fieldset.plug { display:none; }
|
||||
fieldset>div.output>fieldset.plug.select { background-color:#0e3369b3; color:white; display:block; z-index:10; }
|
||||
fieldset>div.status legend { float:right; height:30px; }
|
||||
|
@ -269,7 +269,7 @@ Volcanos(chat.ONIMPORT, {help: "导入数据",
|
||||
},
|
||||
process: function(can, msg, target, height, width, cb) { can.onmotion.clear(can, target), can.user.toastSuccess(can)
|
||||
if (msg.Option(ice.MSG_PROCESS) == "_field") {
|
||||
msg.Table(function(item) { item.display = msg.Option(ice.MSG_DISPLAY)
|
||||
msg.Table(function(item) { item.display = msg.Option(ice.MSG_DISPLAY), item.height = height-3*html.ACTION_HEIGHT
|
||||
can.onimport.plug(can, item, target, function(sub) { sub.onaction._output = function(_sub, _msg) { can.base.isFunc(cb) && cb(_sub, _msg) }
|
||||
sub.onaction.close = function() { can.onmotion.hidden(can, target.parentNode), can.onimport.layout(can) }
|
||||
height && sub.ConfHeight(height-3*html.ACTION_HEIGHT), width && sub.ConfWidth(width), sub.Focus()
|
||||
@ -358,6 +358,7 @@ Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, tar
|
||||
can.onimport._profile(can, can.ui.profile), can.onimport._display(can, can.ui.display)
|
||||
if (msg.Result() == "" && can.Option(nfs.LINE) == "1") { return }
|
||||
|
||||
can.isCmdMode() && can.ConfHeight(can.ConfHeight()+2*html.ACTION_HEIGHT)
|
||||
if (msg.Option(nfs.FILE)) {
|
||||
msg.Option(nfs.PATH) && can.Option(nfs.PATH, msg.Option(nfs.PATH))
|
||||
can.Option(nfs.FILE, msg.Option(nfs.FILE))
|
||||
@ -422,11 +423,11 @@ Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, tar
|
||||
can.page.styleWidth(can, can.ui.display_output, width-project_width)
|
||||
|
||||
var height = can.user.isMobile && can.isFloatMode()? window.innerHeight-2*html.ACTION_HEIGHT: can.base.Min(can.ConfHeight(), 320)-1
|
||||
var display_height = can.ui.display.style.display == html.NONE? 0: (can.display_size[can.onexport.keys(can)]||height/2)
|
||||
var display_height = can.ui.display.style.display == html.NONE? 0: (can.display_size[can.onexport.keys(can)]||height/2-html.ACTION_HEIGHT)
|
||||
var content_height = height-display_height; if (can.isCmdMode()) { content_height -= can.ui._tabs.offsetHeight + can.ui._path.offsetHeight + 4 }
|
||||
var profile_height = height-html.ACTION_HEIGHT-display_height
|
||||
can.page.styleHeight(can, can.ui.profile_output, profile_height)
|
||||
can.page.styleHeight(can, can.ui.display_output, display_height)
|
||||
can.page.styleHeight(can, can.ui.display_output, display_height-html.ACTION_HEIGHT)
|
||||
can.page.styleHeight(can, can.ui.content, content_height-(can.ui.content != can.ui._content? 4: 0))
|
||||
can.page.styleHeight(can, can.ui.project, height)
|
||||
|
||||
|
@ -262,7 +262,7 @@ Volcanos(chat.ONSYNTAX, {help: "语法高亮",
|
||||
js: {
|
||||
render: {},
|
||||
split: {
|
||||
operator: "{[(.,:;!?|<*>)]}",
|
||||
operator: "{[(.,:;!?|<*>-+)]}",
|
||||
},
|
||||
prefix: {
|
||||
"// ": code.COMMENT,
|
||||
|
@ -402,7 +402,7 @@ Volcanos(chat.ONACTION, {help: "控件交互",
|
||||
},
|
||||
_selectLine: function(can) { if (!can.current) { return }
|
||||
can.page.Select(can, can.current.line, "td.text", function(td) { var target = can.ui.current; target.value = td.innerText
|
||||
can.current.line.appendChild(target), can.page.style(can, target, html.LEFT, td.offsetLeft-1, html.WIDTH, can.base.Max(can.ui.content.style.width, td.offsetWidth))
|
||||
can.current.line.appendChild(target), can.page.style(can, target, html.LEFT, td.offsetLeft-1, html.WIDTH, can.base.Min(td.offsetWidth, can.ui._content.offsetWidth))
|
||||
if (event && event.type == "click") { can.onkeymap._insert(event, can, 0, (event.offsetX)/12-1) }
|
||||
target.focus(), can.ui.content.scrollLeft -= 10000
|
||||
})
|
||||
|
@ -1,4 +1,5 @@
|
||||
fieldset.plan>div.output td { vertical-align:top; }
|
||||
fieldset.plan>div.output td.content { position:relative; }
|
||||
fieldset.plan>div.output td.over { border:solid 2px red; }
|
||||
fieldset.plan>div.output td div.date { color:gray; }
|
||||
fieldset.plan>div.output div.prepare { background-color:blue; color:white; }
|
||||
@ -6,4 +7,6 @@ fieldset.plan>div.output div.process { background-color:green; color:white; }
|
||||
fieldset.plan>div.output div.cancel { background-color:red; color:white; }
|
||||
fieldset.plan>div.output div.finish { background-color:gray; color:white; }
|
||||
|
||||
fieldset.plan>div.output div.content table { width: -webkit-fill-available; }
|
||||
fieldset.plan>div.output div.content table { height:-webkit-fill-available; width:-webkit-fill-available; }
|
||||
fieldset.plan>div.output div.content th:first-child { width:40px; position:sticky; left:2px; }
|
||||
fieldset.plan>div.output div.content tr:first-child { height:30px; position:sticky; top:2px; }
|
@ -1,5 +1,7 @@
|
||||
Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, target) { can.onmotion.clear(can, target)
|
||||
can.ui = can.onlayout.profile(can), can.onimport[can.Option("scale")||"week"](can, msg)
|
||||
can.ui = can.onlayout.profile(can)
|
||||
can._display_heights = {}
|
||||
can.onimport[can.Option("scale")||"week"](can, msg)
|
||||
can.page.style(can, can.ui.project, html.MAX_HEIGHT, can.ui.content.offsetHeight)
|
||||
can.page.style(can, can.ui.profile, html.MAX_HEIGHT, can.ui.content.offsetHeight)
|
||||
can.onappend.tools(can, msg), can.base.isFunc(cb) && cb(msg), can.Status(mdb.COUNT, msg.Length())
|
||||
@ -17,7 +19,7 @@ Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, tar
|
||||
return can.onimport._task(can, msg, get(begin_time, col, row, hash), set(begin_time, col, row))
|
||||
})}
|
||||
}) }]); if (!can.sup.task) { return }
|
||||
can.onmotion.delay(can, function() { var target = can.sup.task._target||can.task._target; can.sup.task = null, target && target.click() })
|
||||
can.onmotion.delay(can, function() { var target = can.sup.task._target; can.sup.task = null, target && target.click() })
|
||||
},
|
||||
_task: function(can, msg, list, time) { return {text: ["", html.TD],
|
||||
ondblclick: function(event) { can.onaction.insertTask(event, can, time+can.base.Time(null, "%y-%m-%d %H:%M:%S").slice(time.length)) },
|
||||
@ -31,14 +33,14 @@ Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, tar
|
||||
var item = can.onimport.item(can, {nick: task.name+":"+task.text}, function() { can.onmotion.delay(can, function() {
|
||||
can.onmotion.select(can, can.ui.content, html.TD, target.parentNode), can.onimport._profile(can, task)
|
||||
}) }, null, can.ui.project); task._target = target, target.onclick = function(event) { item.click() }
|
||||
can.task = can.task||task, can.sup.task = can.sup.task||task, can.sup.task.zone == task.zone && can.sup.task.id == task.id && (can.sup.task._target = target)
|
||||
var ls = can.core.Split(location.hash.slice(1))||[]; if (ls[0] == task.zone && ls[1] == task.id) { can.sup.task = can.task = task }
|
||||
can.sup.task = can.sup.task||task, can.sup.task.zone == task.zone && can.sup.task.id == task.id && (can.sup.task._target = target)
|
||||
var ls = can.core.Split(location.hash.slice(1))||[]; if (ls[0] == task.zone && ls[1] == task.id) { can.sup.task = task }
|
||||
},
|
||||
}
|
||||
}),
|
||||
} },
|
||||
_profile: function(can, task) { can.onexport.hash(can, task)
|
||||
if (can.onmotion.cache(can, function() { return can.sup.task = task, can.Status(task), [task.pod, task.zone, task.id].join(ice.PT) }, can.ui.profile, can.ui.display)) { return }
|
||||
if (can.onmotion.cache(can, function() { return can.sup.task = task, can.Status(task), [task.pod, task.zone, task.id].join(ice.PT) }, can.ui.profile, can.ui.display)) { return can.onimport.layout(can) }
|
||||
|
||||
task.extra && can.core.Item(can.base.Obj(task.extra), function(key, value) { task["extra."+key] = value }), delete(task.extra)
|
||||
var table = can.page.Appends(can, can.ui.profile, [{view: [chat.CONTENT, html.TABLE], list: [{th: [mdb.KEY, mdb.VALUE]}]}]).first
|
||||
@ -50,17 +52,20 @@ Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, tar
|
||||
ondblclick: function(event) { if ([ice.POD, mdb.ZONE, mdb.ID].indexOf(key) > -1) { return }
|
||||
can.onmotion.modify(can, event.target, function(sub, value) {
|
||||
can.onaction.modifyTask(event, can, task, key, value)
|
||||
}, {name: key, action: key.indexOf(mdb.TIME) > 0? "date": "key"})
|
||||
}, {name: key, action: key.indexOf(mdb.TIME) > 0? "date": "key", mode: "simple"})
|
||||
},
|
||||
}]) }), can.onimport._display(can, task)
|
||||
can.onimport.layout(can)
|
||||
},
|
||||
_display: function(can, task) { if (!task["extra.index"]) { return }
|
||||
can.onappend.plugin(can, {type: chat.STORY, index: task["extra.index"], args: task["extra.args"]}, function(sub, meta) {
|
||||
can.onappend.plugin(can, {type: "plug", index: task["extra.index"], args: task["extra.args"], height: can.ConfHeight()/2-2*html.ACTION_HEIGHT}, function(sub, meta) {
|
||||
sub.run = function(event, cmds, cb) {
|
||||
can.runAction(can.request(event, kit.Dict("task.pod", task.pod, "task.zone", task.zone, "task.id", task.id)), ice.RUN, [task[mdb.ZONE], task[mdb.ID]].concat(cmds), cb)
|
||||
}
|
||||
sub.ConfHeight(can.ConfHeight()-can.ui.content.offsetHeight-3*html.ACTION_HEIGHT), sub.ConfWidth(can.ConfWidth()-can.ui.project.offsetWidth)
|
||||
}, can._plugins_display = (can._plugins_display||[]).concat([sub])
|
||||
sub.onaction._output = function() {
|
||||
can._display_heights[[task.zone, task.id].join(ice.FS)] = can.base.Max(sub._output.offsetHeight+html.ACTION_HEIGHT+sub.onexport.statusHeight(sub), can.ConfHeight()/2)
|
||||
can.onimport.layout(can)
|
||||
}, sub.onaction.close = function() { can.onmotion.toggle(can, can.ui.display), can.onimport.layout(can) }
|
||||
}, can.ui.display)
|
||||
},
|
||||
|
||||
@ -114,7 +119,18 @@ Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, tar
|
||||
can.onimport._content(can, msg, head, list, key, get, set)
|
||||
},
|
||||
layout: function(can) {
|
||||
can.page.styleWidth(can, can.ui.content, can.ConfWidth()-can.ui.project.offsetWidth-can.ui.profile.offsetWidth)
|
||||
if (can.isCmdMode()) {
|
||||
var height = can._display_heights[can.sup.task? [can.sup.task.zone, can.sup.task.id].join(ice.FS): ""]||html.ACTION_HEIGHT
|
||||
if (can.ui.display.innerHTML && can.ui.display.style.display != "none") {
|
||||
can.page.style(can, can.ui.content, html.HEIGHT, can.ConfHeight()-height)
|
||||
can.page.style(can, can.ui.profile, html.HEIGHT, can.ConfHeight()-height)
|
||||
} else {
|
||||
can.page.style(can, can.ui.content, html.HEIGHT, can.ConfHeight())
|
||||
}
|
||||
}
|
||||
can.page.styleWidth(can, can.ui.content, can.ConfWidth()-can.ui.project.offsetWidth-can.ui.profile.offsetWidth), can.core.List(can._plugins_display, function(sub) {
|
||||
sub.onimport.size(sub, can.ConfHeight()-can.ui.content.offsetHeight-html.ACTION_HEIGHT-sub.onexport.statusHeight(sub), sub.ConfWidth(can.ConfWidth()-can.ui.project.offsetWidth), true)
|
||||
})
|
||||
}
|
||||
}, [""])
|
||||
Volcanos(chat.ONACTION, {help: "组件交互", list: [mdb.PREV, mdb.NEXT, mdb.INSERT, mdb.EXPORT, mdb.IMPORT,
|
||||
@ -122,11 +138,15 @@ Volcanos(chat.ONACTION, {help: "组件交互", list: [mdb.PREV, mdb.NEXT, mdb.IN
|
||||
["level", "all", "l1", "l2", "l3", "l4", "l5"],
|
||||
["score", "all", "s1", "s2", "s3", "s4", "s5"],
|
||||
["view", "", "name", "text", "level", "score"],
|
||||
], _trans: {"prev": "上一周", "next": "下一周", "task": "任务", "hour": "时间", "month": "月份"},
|
||||
], _trans: {"task": "任务", "hour": "时间", "month": "月份", "order": "月周"},
|
||||
prev: function(event, can) {
|
||||
var begin = can.base.Date(can.Option("begin_time")||can.base.Time(null, "%y-%m-%d %H:%M:%S"))
|
||||
switch (can.Option("scale")) {
|
||||
case "day": begin -= 24*3600*1000; break
|
||||
case "week": begin -= 7*24*3600*1000; break
|
||||
case "month": begin -= 30*24*3600*1000; break
|
||||
case "year": begin -= 365*24*3600*1000; break
|
||||
case "long": begin -= 365*24*3600*1000; break
|
||||
default: return
|
||||
}
|
||||
can.Option("begin_time", can.base.Time(new Date(begin), "%y-%m-%d %H:%M:%S")), can.Update()
|
||||
@ -134,7 +154,11 @@ Volcanos(chat.ONACTION, {help: "组件交互", list: [mdb.PREV, mdb.NEXT, mdb.IN
|
||||
next: function(event, can) {
|
||||
var begin = can.base.Date(can.Option("begin_time")||can.base.Time(null, "%y-%m-%d %H:%M:%S"))
|
||||
switch (can.Option("scale")) {
|
||||
case "day": begin -= -24*3600*1000; break
|
||||
case "week": begin -= -7*24*3600*1000; break
|
||||
case "month": begin -= -30*24*3600*1000; break
|
||||
case "year": begin -= -365*24*3600*1000; break
|
||||
case "long": begin -= -365*24*3600*1000; break
|
||||
default: return
|
||||
}
|
||||
can.Option("begin_time", can.base.Time(new Date(begin), "%y-%m-%d %H:%M:%S")), can.Update()
|
||||
|
@ -83,9 +83,9 @@ Volcanos(chat.ONIMPORT, {help: "导入数据", _process: function(can, msg) {
|
||||
},
|
||||
_open: function(can, msg, _arg) { return can.user.open(_arg), can.Update() },
|
||||
|
||||
size: function(can, height, width, auto, mode) { height += html.ACTION_HEIGHT-can.onexport.statusHeight(can)
|
||||
size: function(can, height, width, auto, mode) { // height += html.ACTION_HEIGHT-can.onexport.statusHeight(can)
|
||||
if (auto) {
|
||||
can.page.style(can, can._output, html.HEIGHT, "", html.WIDTH, "", html.MAX_HEIGHT, can.ConfHeight(height), html.MAX_WIDTH, can.ConfWidth(width))
|
||||
height && can.page.style(can, can._output, html.HEIGHT, "", html.WIDTH, "", html.MAX_HEIGHT, can.ConfHeight(height), html.MAX_WIDTH, can.ConfWidth(width))
|
||||
} else {
|
||||
can.page.style(can, can._output, html.HEIGHT, can.ConfHeight(height), html.WIDTH, can.ConfWidth(width), html.MAX_HEIGHT, "", html.MAX_WIDTH, "")
|
||||
}
|
||||
|
@ -4,7 +4,9 @@ Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, tar
|
||||
can.Action(html.SPEED, parseInt(msg.Option(html.SPEED)||"100"))
|
||||
can.page.ClassList.add(can, can._fields, "draw")
|
||||
can.require(["/plugin/local/wiki/draw.js", "/plugin/local/wiki/draw/path.js"], function() {
|
||||
can.base.isFunc(cb) && cb(msg), can.onimport.layout(can)
|
||||
can.base.isFunc(cb) && cb(msg)
|
||||
can.onimport.layout(can)
|
||||
can.base.isFunc(cb) && cb(msg)
|
||||
})
|
||||
},
|
||||
_sum: function(can) {
|
||||
|
@ -202,7 +202,7 @@ Volcanos(chat.ONLAYOUT, {help: "界面布局",
|
||||
can.onlayout._init(can)
|
||||
},
|
||||
cmd: function(can) {
|
||||
can.ConfHeight(can.ConfHeight()+html.ACTION_HEIGHT)
|
||||
// can.ConfHeight(can.ConfHeight()+html.ACTION_HEIGHT)
|
||||
can.sup.onimport.size(can.sup, can.ConfHeight(), can.ConfWidth(), true)
|
||||
can.onlayout._init(can)
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user