diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/plugin/custmerform/lr-formcomponts.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/plugin/custmerform/lr-formcomponts.js index d5e4da00f..30a47cd73 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/plugin/custmerform/lr-formcomponts.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/plugin/custmerform/lr-formcomponts.js @@ -421,6 +421,7 @@ table: '', field: "", proportion: '1', + verify: '', dataSource: '0', // 0数据字典1数据源 dataSourceId: '', @@ -431,7 +432,7 @@ }, property: function ($component) { var dfop = $component[0].dfop; - var $html = setComponentPropertyHtml($component); + var $html = setComponentPropertyHtml($component, verifyDatalist2); var _html = ''; _html += '
数据来源
'; _html += '
'; @@ -459,7 +460,7 @@ setDatasource(dfop); }, renderTable: function (compont, $row) {//使用表单的时候渲染成table - var $compont = $('
'); + var $compont = $('
'); /*获取数据字典或者数据源数据*/ if (compont.dataSource == '0') { learun.clientdata.getAllAsync('dataItem', { @@ -488,7 +489,7 @@ return $compont; }, renderQuery: function (compont, $row) { - var $compont = $('
'); + var $compont = $('
'); /*获取数据字典或者数据源数据*/ if (compont.dataSource == '0') { learun.clientdata.getAllAsync('dataItem', { @@ -530,17 +531,18 @@ table: '', field: "", proportion: '1', + verify: '', dataSource: '0', // 0数据字典1数据源 dataSourceId: '', - itemCode:'', + itemCode: '', dfvalue: '' // 默认值 }; $component.html(getComponentRowHtml({ name: $component[0].dfop.title, text: "多选项" })); }, property: function ($component) { var dfop = $component[0].dfop; - var $html = setComponentPropertyHtml($component); + var $html = setComponentPropertyHtml($component, verifyDatalist2); var _html = ''; _html += '
数据来源
'; _html += '
'; @@ -567,7 +569,7 @@ setDatasource(dfop); }, renderTable: function (compont, $row) {//使用表单的时候渲染成table - var $compont = $('
'); + var $compont = $('
'); /*获取数据字典或者数据源数据*/ if (compont.dataSource == '0') { learun.clientdata.getAllAsync('dataItem', { @@ -597,7 +599,7 @@ return $compont; }, renderQuery: function (compont, $row) { - var $compont = $('
'); + var $compont = $('
'); /*获取数据字典或者数据源数据*/ if (compont.dataSource == '0') { learun.clientdata.getAllAsync('dataItem', { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/plugin/custmerform/lr-formrender.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/plugin/custmerform/lr-formrender.js index 964d76f57..b69fbaa5b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/plugin/custmerform/lr-formrender.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/plugin/custmerform/lr-formrender.js @@ -106,6 +106,7 @@ $.lrValidCustmerform = function () { var validateflag = true; var validHelper = learun.validator; + $('body').find("[isvalid=yes]").each(function () { var $this = $(this); if ($this.parent().find('.lr-field-error-info').length > 0) { @@ -126,7 +127,27 @@ value = $this.lrformselectGet(); } 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: '' }; if (checkexpession == 'LenNum' || checkexpession == 'LenNumOrNull' || checkexpession == 'LenStr' || checkexpession == 'LenStrOrNull') { @@ -236,6 +257,12 @@ if ($obj.hasClass("lr-input-wdatepicker")) { type = "datepicker"; } + else if ($obj.hasClass("checkbox")) { + type = "checkbox"; + } + else if ($obj.hasClass("radio")) { + type = "radio"; + } switch (type) { case "lrselect": $obj.lrselectSet(value); @@ -243,6 +270,21 @@ case "formselect": $obj.lrformselectSet(value); 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": if ($obj.attr('dateformat') == "0") { $obj.val(learun.formatDate(value, 'yyyy-MM-dd')); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-validator.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-validator.js index 290b9ad5e..42737faf6 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-validator.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-validator.js @@ -12,7 +12,7 @@ /*错误处理*/ $this.addClass('lr-field-error'); $this.parent().append('
'); - var validatemsg = $this.parent().find('.form-item-title').text() + ' ' + errormsg; + var validatemsg = $this.parent().find('.lr-form-item-title').text() + ' ' + errormsg; learun.alert.error('表单信息输入有误,请检查!
' + validatemsg); if ($this.attr('type') == 'lrselect') { $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 { $this.on('input propertychange', function () { var $input = $(this);