From 8a1268d8a8bc4b59f52856f3537d2e43b730cb56 Mon Sep 17 00:00:00 2001 From: thinkgem Date: Sat, 2 Jan 2021 09:33:17 +0800 Subject: [PATCH] =?UTF-8?q?fileupload=E3=80=81listselect=E3=80=81treeselec?= =?UTF-8?q?t=E6=94=AF=E6=8C=81=E9=80=9A=E8=BF=87js.template=E6=8C=87?= =?UTF-8?q?=E5=AE=9Areadonly=E5=B1=9E=E6=80=A7=EF=BC=8C=E6=88=96=E8=80=85?= =?UTF-8?q?=E9=80=9A=E8=BF=87cssClass=E6=8C=87=E5=AE=9Adisabled=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E5=8F=AA=E8=AF=BB=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/modules/test/testDataForm.html | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/web/src/main/resources/views/modules/test/testDataForm.html b/web/src/main/resources/views/modules/test/testDataForm.html index cb4bf897..d51e3987 100644 --- a/web/src/main/resources/views/modules/test/testDataForm.html +++ b/web/src/main/resources/views/modules/test/testDataForm.html @@ -244,7 +244,10 @@ $("#testDataChildDataGrid").dataGrid({ formatter:'date', formatoptions:{srcformat:'Y-m-d H:i:s',newformat:'Y-m-d'}, editable:true, edittype:'text', editoptions:{'class':'form-control laydate', 'readonly':'true', dataInit: function(element){ - laydate.render({elem:element, type:'date', format:'yyyy-MM-dd'}); + laydate.render({elem:element, type:'date', format:'yyyy-MM-dd', done: function(){ + // 选择日期后,自动给下一个输入框赋值(联动实例) + // $(element).closest('td').next().find('.form-control').val('2020-11-26 10:10:10'); + }}); } } }, @@ -265,12 +268,16 @@ $("#testDataChildDataGrid").dataGrid({ id: 'user_'+editOptions.id, title: '用户选择', name: 'testUser.userCode', value: val.split('|')[0], labelName: 'testUser.userName', labelValue: val.split('|')[1], - url: '${ctx}/sys/office/treeData?isLoadUser=true', cssClass: '' + url: '${ctx}/sys/office/treeData?isLoadUser=true', cssClass: '', readonly: false }); }, custom_value: function(element, act){ return {userCode: element.find('[type=hidden]').val(), userName: element.find('[type=text]').val()}; + }, + dataInit: function(element){ + // 初始化控件后设置只读模式(实例) + // $(element).find('.form-control, .btn').addClass('disabled'); } }, unformat: function(val, obj, cell){ @@ -286,7 +293,7 @@ $("#testDataChildDataGrid").dataGrid({ id: 'user_'+editOptions.id, title: '用户选择', name: 'testUser2.userCode', value: val.split('|')[0], labelName: 'testUser2.userName', labelValue: val.split('|')[1], - url: '${ctx}/sys/empUser/empUserSelect', cssClass: '', + url: '${ctx}/sys/empUser/empUserSelect', cssClass: '', readonly: false, itemCode: 'userCode', itemName: 'userName' }); } @@ -301,7 +308,7 @@ $("#testDataChildDataGrid").dataGrid({ id: 'office_'+editOptions.id, title: '机构选择', name: 'testOffice.officeCode', value: val.split('|')[0], labelName: 'testOffice.officeName', labelValue: val.split('|')[1], - url: '${ctx}/sys/office/treeData?officeTypes=1,2', cssClass: '' + url: '${ctx}/sys/office/treeData?officeTypes=1,2', cssClass: '', readonly: false }); } } @@ -315,7 +322,7 @@ $("#testDataChildDataGrid").dataGrid({ id: 'area_'+editOptions.id, title: '区域选择', name: 'testAreaCode', value: val.split('|')[0], labelName: 'testAreaName', labelValue: val.split('|')[1], - url: '${ctx}/sys/area/treeData', cssClass: '' + url: '${ctx}/sys/area/treeData', cssClass: '', readonly: false }); } } @@ -325,7 +332,7 @@ $("#testDataChildDataGrid").dataGrid({ custom_element: function(val, editOptions) { return js.template('fileuploadTpl', { id: 'fileupload_'+editOptions.id, title: '区域选择', - bizKey: val, bizType: 'testDataChild_file', cssClass: '' + bizKey: val, bizType: 'testDataChild_file', cssClass: '', readonly: false }); } } @@ -365,17 +372,17 @@ $("#testDataChildDataGrid").dataGrid({