1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-25 16:58:06 +08:00
This commit is contained in:
harveyshao 2022-05-23 08:31:21 +08:00
parent aafa3f52f3
commit 4efab3b3ce
2 changed files with 6 additions and 2 deletions

View File

@ -244,7 +244,7 @@ Volcanos("user", {help: "用户操作", info: {}, agent: {
input: function(event, can, form, cb, button) { if (!form || form.length == 0) { return cb() } input: function(event, can, form, cb, button) { if (!form || form.length == 0) { return cb() }
var msg = can.request(event) var msg = can.request(event)
var ui = can.page.Append(can, document.body, [{view: [html.INPUT], style: {left: 0, top: 0}, list: [ var ui = can.page.Append(can, document.body, [{view: [html.INPUT], style: {left: 0, top: 0}, list: [
{view: [chat.OPTION, html.TABLE], list: can.core.List(form, function(item) { {view: "content", list: [{view: [chat.OPTION, html.TABLE], list: can.core.List(form, function(item) {
item = can.base.isString(item)? {type: html.TEXT, name: item}: item.length > 0? {type: html.SELECT, name: item[0], values: item.slice(1)}: item item = can.base.isString(item)? {type: html.TEXT, name: item}: item.length > 0? {type: html.SELECT, name: item[0], values: item.slice(1)}: item
item.type = item.type||(item.values? html.SELECT: item.name == html.TEXT? html.TEXTAREA: html.TEXT) item.type = item.type||(item.values? html.SELECT: item.name == html.TEXT? html.TEXTAREA: html.TEXT)
@ -265,7 +265,7 @@ Volcanos("user", {help: "用户操作", info: {}, agent: {
// return {type: html.TR, list: [{type: html.TD, list: [{text: item._trans||can.user.trans(can, item.name)||""}]}, {type: html.TD, list: [can.page.input(can, item)]} ]} // return {type: html.TR, list: [{type: html.TD, list: [{text: item._trans||can.user.trans(can, item.name)||""}]}, {type: html.TD, list: [can.page.input(can, item)]} ]}
return {type: html.TR, list: [{type: html.TD, list: [{text: item.name||""}]}, {type: html.TD, list: [can.page.input(can, item)]} ]} return {type: html.TR, list: [{type: html.TD, list: [{text: item.name||""}]}, {type: html.TD, list: [can.page.input(can, item)]} ]}
})}, {view: chat.ACTION}, })}]}, {view: chat.ACTION},
]}]) ]}])
var layout = can.onlayout.figure(event, can, ui._target) var layout = can.onlayout.figure(event, can, ui._target)
@ -274,6 +274,9 @@ Volcanos("user", {help: "用户操作", info: {}, agent: {
can.page.style(can, ui._target, layout) can.page.style(can, ui._target, layout)
} }
can.page.ClassList.add(can, ui._target, chat.FLOAT) can.page.ClassList.add(can, ui._target, chat.FLOAT)
if (layout.top) {
can.page.style(can, ui.content, html.MAX_HEIGHT, window.innerHeight - layout.top - 200)
}
var action = can.onappend._action(can, button||[html.SUBMIT, html.CANCEL], ui.action, { var action = can.onappend._action(can, button||[html.SUBMIT, html.CANCEL], ui.action, {
focus: function(event) { can.page.Select(can, ui.first, html.INPUT_ARGS)[0].focus() }, focus: function(event) { can.page.Select(can, ui.first, html.INPUT_ARGS)[0].focus() },

View File

@ -107,6 +107,7 @@ body>div.carte div.item { padding:3px 12px; }
body>div.input { background-color:#0d4142a6; padding:5px; } body>div.input { background-color:#0d4142a6; padding:5px; }
body>div.input div.item { float:left; } body>div.input div.item { float:left; }
body>div.input tr td:first-child { text-align:center; } body>div.input tr td:first-child { text-align:center; }
body>div.input div.content { overflow:auto; max-height:200px; }
body>div.input select { width:183px; margin:5px; } body>div.input select { width:183px; margin:5px; }
body>div.input input[type=text] { width:171px; margin:5px; } body>div.input input[type=text] { width:171px; margin:5px; }
body>div.input input[name=username] { width:171px; } body>div.input input[name=username] { width:171px; }