@@ -421,6 +421,7 @@ | |||||
table: '', | table: '', | ||||
field: "", | field: "", | ||||
proportion: '1', | proportion: '1', | ||||
verify: '', | |||||
dataSource: '0', // 0数据字典1数据源 | dataSource: '0', // 0数据字典1数据源 | ||||
dataSourceId: '', | dataSourceId: '', | ||||
@@ -431,7 +432,7 @@ | |||||
}, | }, | ||||
property: function ($component) { | property: function ($component) { | ||||
var dfop = $component[0].dfop; | var dfop = $component[0].dfop; | ||||
var $html = setComponentPropertyHtml($component); | |||||
var $html = setComponentPropertyHtml($component, verifyDatalist2); | |||||
var _html = ''; | var _html = ''; | ||||
_html += '<div class="lr-component-title">数据来源</div>'; | _html += '<div class="lr-component-title">数据来源</div>'; | ||||
_html += '<div class="lr-component-control"><div id="lr_component_dataSource"></div></div>'; | _html += '<div class="lr-component-control"><div id="lr_component_dataSource"></div></div>'; | ||||
@@ -459,7 +460,7 @@ | |||||
setDatasource(dfop); | setDatasource(dfop); | ||||
}, | }, | ||||
renderTable: function (compont, $row) {//使用表单的时候渲染成table | renderTable: function (compont, $row) {//使用表单的时候渲染成table | ||||
var $compont = $('<div class="radio"></div>'); | |||||
var $compont = $('<div id="' + compont.id + '" class="radio"></div>'); | |||||
/*获取数据字典或者数据源数据*/ | /*获取数据字典或者数据源数据*/ | ||||
if (compont.dataSource == '0') { | if (compont.dataSource == '0') { | ||||
learun.clientdata.getAllAsync('dataItem', { | learun.clientdata.getAllAsync('dataItem', { | ||||
@@ -488,7 +489,7 @@ | |||||
return $compont; | return $compont; | ||||
}, | }, | ||||
renderQuery: function (compont, $row) { | renderQuery: function (compont, $row) { | ||||
var $compont = $('<div class="radio"></div>'); | |||||
var $compont = $('<div id="' + compont.id + '" class="radio"></div>'); | |||||
/*获取数据字典或者数据源数据*/ | /*获取数据字典或者数据源数据*/ | ||||
if (compont.dataSource == '0') { | if (compont.dataSource == '0') { | ||||
learun.clientdata.getAllAsync('dataItem', { | learun.clientdata.getAllAsync('dataItem', { | ||||
@@ -530,17 +531,18 @@ | |||||
table: '', | table: '', | ||||
field: "", | field: "", | ||||
proportion: '1', | proportion: '1', | ||||
verify: '', | |||||
dataSource: '0', // 0数据字典1数据源 | dataSource: '0', // 0数据字典1数据源 | ||||
dataSourceId: '', | dataSourceId: '', | ||||
itemCode:'', | |||||
itemCode: '', | |||||
dfvalue: '' // 默认值 | dfvalue: '' // 默认值 | ||||
}; | }; | ||||
$component.html(getComponentRowHtml({ name: $component[0].dfop.title, text: "多选项" })); | $component.html(getComponentRowHtml({ name: $component[0].dfop.title, text: "多选项" })); | ||||
}, | }, | ||||
property: function ($component) { | property: function ($component) { | ||||
var dfop = $component[0].dfop; | var dfop = $component[0].dfop; | ||||
var $html = setComponentPropertyHtml($component); | |||||
var $html = setComponentPropertyHtml($component, verifyDatalist2); | |||||
var _html = ''; | var _html = ''; | ||||
_html += '<div class="lr-component-title">数据来源</div>'; | _html += '<div class="lr-component-title">数据来源</div>'; | ||||
_html += '<div class="lr-component-control"><div id="lr_component_dataSource"></div></div>'; | _html += '<div class="lr-component-control"><div id="lr_component_dataSource"></div></div>'; | ||||
@@ -567,7 +569,7 @@ | |||||
setDatasource(dfop); | setDatasource(dfop); | ||||
}, | }, | ||||
renderTable: function (compont, $row) {//使用表单的时候渲染成table | renderTable: function (compont, $row) {//使用表单的时候渲染成table | ||||
var $compont = $('<div class="checkbox"></div>'); | |||||
var $compont = $('<div id="' + compont.id + '" class="checkbox"></div>'); | |||||
/*获取数据字典或者数据源数据*/ | /*获取数据字典或者数据源数据*/ | ||||
if (compont.dataSource == '0') { | if (compont.dataSource == '0') { | ||||
learun.clientdata.getAllAsync('dataItem', { | learun.clientdata.getAllAsync('dataItem', { | ||||
@@ -597,7 +599,7 @@ | |||||
return $compont; | return $compont; | ||||
}, | }, | ||||
renderQuery: function (compont, $row) { | renderQuery: function (compont, $row) { | ||||
var $compont = $('<div class="checkbox"></div>'); | |||||
var $compont = $('<div id="' + compont.id + '" class="checkbox"></div>'); | |||||
/*获取数据字典或者数据源数据*/ | /*获取数据字典或者数据源数据*/ | ||||
if (compont.dataSource == '0') { | if (compont.dataSource == '0') { | ||||
learun.clientdata.getAllAsync('dataItem', { | learun.clientdata.getAllAsync('dataItem', { | ||||
@@ -106,6 +106,7 @@ | |||||
$.lrValidCustmerform = function () { | $.lrValidCustmerform = function () { | ||||
var validateflag = true; | var validateflag = true; | ||||
var validHelper = learun.validator; | var validHelper = learun.validator; | ||||
$('body').find("[isvalid=yes]").each(function () { | $('body').find("[isvalid=yes]").each(function () { | ||||
var $this = $(this); | var $this = $(this); | ||||
if ($this.parent().find('.lr-field-error-info').length > 0) { | if ($this.parent().find('.lr-field-error-info').length > 0) { | ||||
@@ -126,7 +127,27 @@ | |||||
value = $this.lrformselectGet(); | value = $this.lrformselectGet(); | ||||
} | } | ||||
else { | else { | ||||
value = $this.val(); | |||||
if ($this.hasClass("checkbox")) {//多选框 | |||||
var checkedList = $this.find("input[name='" + $this.attr('id') + "']:checked"); | |||||
if (checkedList.length > 0) { | |||||
value = ''; | |||||
$.each(checkedList, function (i, item) { | |||||
if (value != '' && value != undefined) { | |||||
value += ','; | |||||
} | |||||
value += $(item).val(); | |||||
}); | |||||
} | |||||
} | |||||
else if ($this.hasClass("radio")) {//单选框 | |||||
var checkedList = $this.find("input[name='" + $this.attr('id') + "']:checked"); | |||||
if (checkedList.length > 0) { | |||||
value = checkedList.val(); | |||||
} | |||||
} | |||||
else { | |||||
value = $this.val(); | |||||
} | |||||
} | } | ||||
var r = { code: true, msg: '' }; | var r = { code: true, msg: '' }; | ||||
if (checkexpession == 'LenNum' || checkexpession == 'LenNumOrNull' || checkexpession == 'LenStr' || checkexpession == 'LenStrOrNull') { | if (checkexpession == 'LenNum' || checkexpession == 'LenNumOrNull' || checkexpession == 'LenStr' || checkexpession == 'LenStrOrNull') { | ||||
@@ -236,6 +257,12 @@ | |||||
if ($obj.hasClass("lr-input-wdatepicker")) { | if ($obj.hasClass("lr-input-wdatepicker")) { | ||||
type = "datepicker"; | type = "datepicker"; | ||||
} | } | ||||
else if ($obj.hasClass("checkbox")) { | |||||
type = "checkbox"; | |||||
} | |||||
else if ($obj.hasClass("radio")) { | |||||
type = "radio"; | |||||
} | |||||
switch (type) { | switch (type) { | ||||
case "lrselect": | case "lrselect": | ||||
$obj.lrselectSet(value); | $obj.lrselectSet(value); | ||||
@@ -243,6 +270,21 @@ | |||||
case "formselect": | case "formselect": | ||||
$obj.lrformselectSet(value); | $obj.lrformselectSet(value); | ||||
break; | break; | ||||
case "checkbox": | |||||
$obj.find('input[name="' + id + '"]:checked').trigger('click'); | |||||
if (value != null && value != undefined && value != '') { | |||||
vs = value.split(','); | |||||
for (var i = 0; i < vs.length; i++) { | |||||
$obj.find('input[name="' + id + '"][value="' + vs[i] + '"]').trigger('click'); | |||||
} | |||||
} | |||||
break; | |||||
case "radio": | |||||
$obj.find('input[name="' + id + '"]:checked').trigger('click'); | |||||
if (value != null && value != undefined && value != '') { | |||||
$obj.find('input[name="' + id + '"][value="' + value + '"]').trigger('click'); | |||||
} | |||||
break; | |||||
case "datepicker": | case "datepicker": | ||||
if ($obj.attr('dateformat') == "0") { | if ($obj.attr('dateformat') == "0") { | ||||
$obj.val(learun.formatDate(value, 'yyyy-MM-dd')); | $obj.val(learun.formatDate(value, 'yyyy-MM-dd')); | ||||
@@ -12,7 +12,7 @@ | |||||
/*错误处理*/ | /*错误处理*/ | ||||
$this.addClass('lr-field-error'); | $this.addClass('lr-field-error'); | ||||
$this.parent().append('<div class="lr-field-error-info" title="' + errormsg + '!"><i class="fa fa-info-circle"></i></div>'); | $this.parent().append('<div class="lr-field-error-info" title="' + errormsg + '!"><i class="fa fa-info-circle"></i></div>'); | ||||
var validatemsg = $this.parent().find('.form-item-title').text() + ' ' + errormsg; | |||||
var validatemsg = $this.parent().find('.lr-form-item-title').text() + ' ' + errormsg; | |||||
learun.alert.error('表单信息输入有误,请检查!</br>' + validatemsg); | learun.alert.error('表单信息输入有误,请检查!</br>' + validatemsg); | ||||
if ($this.attr('type') == 'lrselect') { | if ($this.attr('type') == 'lrselect') { | ||||
$this.on('change', function () { | $this.on('change', function () { | ||||
@@ -32,6 +32,16 @@ | |||||
} | } | ||||
}); | }); | ||||
} | } | ||||
else if ($this.hasClass('checkbox')) { | |||||
$this.on('change', function () { | |||||
removeErrorMessage($(this)); | |||||
}); | |||||
} | |||||
else if ($this.hasClass('radio')) { | |||||
$this.on('change', function () { | |||||
removeErrorMessage($(this)); | |||||
}); | |||||
} | |||||
else { | else { | ||||
$this.on('input propertychange', function () { | $this.on('input propertychange', function () { | ||||
var $input = $(this); | var $input = $(this); | ||||