1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-25 16:58:06 +08:00
This commit is contained in:
shaoying 2020-07-31 22:15:20 +08:00
parent 1f583aebfa
commit 6b45404e2c
2 changed files with 6 additions and 3 deletions

View File

@ -552,8 +552,11 @@ Volcanos("onappend", { _init: function(can, meta, list, cb, target, field) { met
case "select":
item.values = typeof item.values == "string"? item.values.split(" "): item.values
if (!item.values && item.value) {
item.values = item.value.split("|")
item.values = item.value.split("|")
item.value = item.values[0]
if (item.values[0] == "day") {
item.value = item.values[1]
}
}
input.type = "select", input.list = item.values.map(function(value) {
return {type: "option", value: value, inner: value}
@ -586,7 +589,7 @@ Volcanos("onappend", { _init: function(can, meta, list, cb, target, field) { met
item.type == "text" && !target.placeholder && (target.placeholder = item.name || "")
item.type == "text" && !target.title && (target.title = target.placeholder)
// item.type == "button" && item.action == "auto" && can.run && can.run({})
// item.type == "select" && (target.value = item.value || item.values[item.index||0])
item.type == "select" && item.value && (target.value = item.value)
return target
},
table: function(can, target, type, msg, cb) {

View File

@ -130,7 +130,7 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg,
})
var head = ["hour"].concat(["周日", "周一", "周二", "周三", "周四", "周五", "周六"]);
var list = [0]; for (var i = 6; i < 24; i++) { list.push(i) }
var list = [0]; for (var i = 6; i < 24; i++) { list.push(can.base.Number(i, 2)) }
function set(week, hour) { return can.base.Time(can.base.TimeAdd(begin_time, week-begin_time.getDay()+hour/24)) }
var table = can.page.Append(can, can.ui.content, [{type: "table", list: