提交 d557e65f 编写于 作者: 傻拖

增加时间选择方式

上级 1f8d349c
......@@ -17,3 +17,4 @@ package-lock.json
ftpconfig.js
gulpconfig.js
jsdoc.dev.json
/dest2/
......@@ -364,6 +364,9 @@ o2.LP.widget = {
"year": ", ",
"month": " ",
"date": " ",
"hour": "hour",
"minute": "minute",
"second": "second",
"week": "week",
"dateGreaterThanCurrentNotice" : "The selected date must be greater than the current date",
......
......@@ -366,6 +366,9 @@ o2.LP.widget = {
"year": "",
"month": "",
"date": "",
"hour": "",
"minute": "",
"second": "",
"week": "",
"dateGreaterThanCurrentNotice" : "选择的日期必须大于当前日期",
......
......@@ -9,6 +9,7 @@ o2.widget.Calendar = o2.Calendar = new Class({
"defaultView": "day", //day, month, year
"baseDate": new Date(),
"secondEnable" : false,
"secondSelectType" : "slider",
"isTime": false,
"isMulti": false,
"before": null,
......@@ -961,6 +962,59 @@ o2.widget.Calendar = o2.Calendar = new Class({
//});
//this.showMNode.set("text", sel.options[sel.selectedIndex].get("value"));
}else{
if(this.options.secondSelectType === "select"){
this.itmeHNode = this.contentTimeTable.getElement(".MWF_calendar_time_h").empty();
this.itmeMNode = this.contentTimeTable.getElement(".MWF_calendar_time_m").empty();
this.itmeSNode = this.contentTimeTable.getElement(".MWF_calendar_time_s").empty();
new Element("span",{"text": o2.LP.widget.hour + ""}).inject(this.itmeHNode);
this.itmeSelectHNode = new Element("select").inject(this.itmeHNode);
for( var i=0; i<24; i++ ){
new Element("option",{
"text" : this.addZero(i, 2 ),
"value" : this.addZero(i, 2 ),
"styles" : this.css.calendarTimeSelectItem_mobile
}).inject( this.itmeSelectHNode );
}
this.itmeSelectHNode.set("value",this.addZero( h.toInt(), 2));
this.itmeSelectHNode.addEvent("change",function(){
this.showHNode.set("text", this.itmeSelectHNode.get("value") );
}.bind(this));
new Element("span",{"text":o2.LP.widget.minute + ""}).inject(this.itmeMNode);
this.itmeSelectMNode = new Element("select").inject(this.itmeMNode);
for( var i=0; i<60; i++ ){
new Element("option",{
"text" : this.addZero(i, 2 ),
"value" : this.addZero(i, 2 ),
"styles" : this.css.calendarTimeSelectItem_mobile
}).inject( this.itmeSelectMNode );
}
this.itmeSelectMNode.set("value",this.addZero( m.toInt(), 2));
this.itmeSelectMNode.addEvent("change",function(){
this.showMNode.set("text", this.itmeSelectMNode.get("value") );
}.bind(this));
if( this.options.secondEnable && this.itmeSNode ){
new Element("span",{"text":o2.LP.widget.second + ""}).inject(this.itmeSNode);
this.itmeSelectSNode = new Element("select").inject(this.itmeSNode);
for( var i=0; i<60; i++ ){
new Element("option",{
"text" : this.addZero(i, 2 ),
"value" : this.addZero(i, 2 ),
"styles" : this.css.calendarTimeSelectItem_mobile
}).inject( this.itmeSelectSNode );
}
this.itmeSelectSNode.set("value",this.addZero( s.toInt(), 2));
this.itmeSelectSNode.addEvent("change",function(){
this.showSNode.set("text", this.itmeSelectSNode.get("value") );
}.bind(this));
}
}else {
var hSlider = new Slider(this.itmeHNode, this.itmeHNode.getFirst(), {
range: [0, 23],
initialStep: h.toInt(),
......@@ -1005,6 +1059,8 @@ o2.widget.Calendar = o2.Calendar = new Class({
this.itmeSNode.getFirst().set("text", s);
}
}
}
this.showHNode.set("text", this.addZero( h.toInt(), 2) );
this.showMNode.set("text", this.addZero( m.toInt(), 2));
if( this.options.secondEnable && this.showSNode ){
......
......@@ -48,6 +48,13 @@
<input type="radio" name="isSelectSecond" value="true" text{($.isSelectSecond)?'checked':''}/>{{$.lp.yes}}
<input type="radio" name="isSelectSecond" value="false" text{(!$.isSelectSecond)?'checked':''}/>{{$.lp.no}}
</td>
</tr>
<tr>
<td class="editTableTitle">{{$.lp.secondSelectType}}:</td>
<td class="editTableValue">
<input type="radio" name="secondSelectType" value="slider" text{$.secondSelectType=='select'||!$.secondSelectType ?'checked':''}/>滑块
<input type="radio" name="secondSelectType" value="select" text{$.secondSelectType=='slider' ?'checked':''}/>下拉
</td>
</tr>
<tr>
<td class="editTableTitle">{{$.lp.format}}:</td>
......
......@@ -522,6 +522,7 @@ MWF.xApplication.process.FormDesigner.LP = {
"yearOnly": "YearOnly",
"timeOnly": "TimeOnly",
"selectSecond": "Select Second",
"secondSelectType": "Second Select Type",
"format": "Format",
"selectStyle": "Select Style",
......
......@@ -520,6 +520,7 @@ MWF.xApplication.process.FormDesigner.LP = {
"yearOnly": "仅年度",
"timeOnly": "仅时间",
"selectSecond": "是否选择秒",
"secondSelectType": "秒选择方式",
"format": "格式化",
"selectStyle": "Select样式",
......
......@@ -127,6 +127,7 @@ MWF.xApplication.process.Xform.Calendar = MWF.APPCalendar = new Class(
var options = {
"style": layout.mobile ? "xform_mobile" : "xform",
"secondEnable" : this.json.isSelectSecond,
"secondSelectType" : this.json.secondSelectType,
"isTime": (this.json.selectType==="datetime" || this.json.selectType==="time"),
"timeOnly": (this.json.selectType === "time"),
"monthOnly" : (this.json.selectType === "month"),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册