日期控件替换为 laydate

This commit is contained in:
thinkgem
2020-04-13 15:28:03 +08:00
parent 8d270a7bdf
commit 8fe448ca2c
54 changed files with 2742 additions and 16119 deletions

View File

@@ -53,21 +53,21 @@
<div class="form-group">
<label class="control-label">日期选择:</label>
<div class="control-inline">
<#form:input path="testDate_gte" readonly="true" maxlength="20" class="form-control Wdate-date"
dataFormat="date" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false,onpicked:function(){testDate_lte.click()}});"/>
&nbsp;--&nbsp;
<#form:input path="testDate_lte" readonly="true" maxlength="20" class="form-control Wdate-date"
dataFormat="date" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
<#form:input path="testDate_gte" readonly="true" maxlength="20" class="form-control laydate width-date"
dataFormat="date" data-type="date" data-format="yyyy-MM-dd" data-done="testDate_lte.focus()"/>
&nbsp;-&nbsp;
<#form:input path="testDate_lte" readonly="true" maxlength="20" class="form-control laydate width-date"
dataFormat="date" data-type="date" data-format="yyyy-MM-dd"/>
</div>
</div>
<div class="form-group">
<label class="control-label">日期时间:</label>
<div class="control-inline">
<#form:input path="testDatetime_gte" readonly="true" maxlength="20" class="form-control Wdate-datetime"
dataFormat="datetime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:false,onpicked:function(){testDatetime_lte.click()}});"/>
&nbsp;--&nbsp;
<#form:input path="testDatetime_lte" readonly="true" maxlength="20" class="form-control Wdate-datetime"
dataFormat="datetime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:false});"/>
<#form:input path="testDatetime_gte" readonly="true" maxlength="20" class="form-control laydate width-datetime"
dataFormat="datetime" data-type="datetime" data-format="yyyy-MM-dd HH:mm" data-done="testDatetime_lte.focus()"/>
&nbsp;-&nbsp;
<#form:input path="testDatetime_lte" readonly="true" maxlength="20" class="form-control laydate width-datetime"
dataFormat="datetime" data-type="datetime" data-format="yyyy-MM-dd HH:mm"/>
</div>
</div>
<div class="form-group">
@@ -147,19 +147,19 @@ $('#dataGrid').dataGrid({
// },
{header:'日期选择', name:'testDate', width:150,
formatter:'date', formatoptions:{srcformat:'Y-m-d H:i:s',newformat:'Y-m-d'},
editable:true, edittype:'text', editoptions:{'class':'form-control Wdate required', 'readonly':'true',
dataInit: function(element){ $(element).on('focus', function(){
WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});
});
}}, unformat: function(val, obj, cell){return $('#'+obj.rowId+'_'+obj.colModel.name, cell).val();}
editable:true, edittype:'text', editoptions:{'class':'form-control laydate required', 'readonly':'true',
dataInit: function(element){
laydate.render({elem:element, type:'date', format:'yyyy-MM-dd'});
}
}, unformat: function(val, obj, cell){return $('#'+obj.rowId+'_'+obj.colModel.name, cell).val();}
},
{header:'日期时间', name:'testDatetime', width:150,
formatter:'date', formatoptions:{srcformat:'Y-m-d H:i:s',newformat:'Y-m-d H:i:s'},
editable:true, edittype:'text', editoptions:{'class':'form-control Wdate required', 'readonly':'true',
dataInit: function(element){ $(element).on('focus', function(){
WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:false});
});
}}, unformat: function(val, obj, cell){return $('#'+obj.rowId+'_'+obj.colModel.name, cell).val();}
editable:true, edittype:'text', editoptions:{'class':'form-control laydate required', 'readonly':'true',
dataInit: function(element){
laydate.render({elem:element, type:'datetime', format:'yyyy-MM-dd HH:mm'});
}
}, unformat: function(val, obj, cell){return $('#'+obj.rowId+'_'+obj.colModel.name, cell).val();}
},
{header:'用户选择', name:'testUser', width:150,
formatter: function(val, obj, row, act){

View File

@@ -54,21 +54,21 @@
<div class="form-group">
<label class="control-label">日期选择:</label>
<div class="control-inline">
<#form:input path="testDate_gte" readonly="true" maxlength="20" class="form-control Wdate-date"
dataFormat="date" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false,onpicked:function(){testDate_lte.click()}});"/>
&nbsp;--&nbsp;
<#form:input path="testDate_lte" readonly="true" maxlength="20" class="form-control Wdate-date"
dataFormat="date" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
<#form:input path="testDate_gte" readonly="true" maxlength="20" class="form-control laydate width-date"
dataFormat="date" data-type="date" data-format="yyyy-MM-dd" data-done="testDate_lte.focus()"/>
&nbsp;-&nbsp;
<#form:input path="testDate_lte" readonly="true" maxlength="20" class="form-control laydate width-date"
dataFormat="date" data-type="date" data-format="yyyy-MM-dd"/>
</div>
</div>
<div class="form-group">
<label class="control-label">日期时间:</label>
<div class="control-inline">
<#form:input path="testDatetime_gte" readonly="true" maxlength="20" class="form-control Wdate-datetime"
dataFormat="datetime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:false,onpicked:function(){testDatetime_lte.click()}});"/>
&nbsp;--&nbsp;
<#form:input path="testDatetime_lte" readonly="true" maxlength="20" class="form-control Wdate-datetime"
dataFormat="datetime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:false});"/>
<#form:input path="testDatetime_gte" readonly="true" maxlength="20" class="form-control laydate width-datetime"
dataFormat="datetime" data-type="datetime" data-format="yyyy-MM-dd HH:mm" data-done="testDatetime_lte.focus()"/>
&nbsp;-&nbsp;
<#form:input path="testDatetime_lte" readonly="true" maxlength="20" class="form-control laydate width-datetime"
dataFormat="datetime" data-type="datetime" data-format="yyyy-MM-dd HH:mm"/>
</div>
</div>
<div class="form-group">
@@ -127,7 +127,7 @@ $('#dataGrid').dataGrid({
if(obj.rowId == ''){ return '小计:'; }
return '<a href="${ctx}/test/testData/form?id='+row.id+'" class="btnList" data-title="编辑数据">'+(val||row.id)+'</a>';
}, summaryTpl: "<em>{0}</em> ", summaryType: "count"},
{header:'多行文本', name:'testTextarea', index:'a.test_textarea', width:150, align:"center", formatter: function(val, obj, row, act){
{header:'多行文本', name:'testTextarea', index:'a.test_textarea', width:150, align:"center", frozen:true, formatter: function(val, obj, row, act){
if(obj.rowId == ''){ return '<em>' + val + '</em>个' }
return val;
}, summaryTpl: "<em>{0}</em>", summaryType: "count"},

View File

@@ -81,8 +81,8 @@
<label class="control-label col-sm-4" title="">
<span class="required hide">*</span> 日期选择:<i class="fa icon-question hide"></i></label>
<div class="col-sm-8">
<#form:input path="testDate" readonly="true" maxlength="20" class="form-control Wdate "
dataFormat="date" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
<#form:input path="testDate" readonly="true" maxlength="20" class="form-control laydate "
dataFormat="date" data-type="date" data-format="yyyy-MM-dd"/>
</div>
</div>
</div>
@@ -91,8 +91,8 @@
<label class="control-label col-sm-4" title="">
<span class="required hide">*</span> 日期时间:<i class="fa icon-question hide"></i></label>
<div class="col-sm-8">
<#form:input path="testDatetime" readonly="true" maxlength="20" class="form-control Wdate "
dataFormat="datetime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:false});"/>
<#form:input path="testDatetime" readonly="true" maxlength="20" class="form-control laydate "
dataFormat="datetime" data-type="datetime" data-format="yyyy-MM-dd HH:mm"/>
</div>
</div>
</div>
@@ -323,19 +323,19 @@ $("#testDataChildDataGrid").dataGrid({
},
{header:'日期选择', name:'testDate', width:150,
formatter:'date', formatoptions:{srcformat:'Y-m-d H:i:s',newformat:'Y-m-d'},
editable:true, edittype:'text', editoptions:{'class':'form-control Wdate ', 'readonly':'true',
dataInit: function(element){ $(element).on('focus', function(){
WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});
});
}}
editable:true, edittype:'text', editoptions:{'class':'form-control laydate ', 'readonly':'true',
dataInit: function(element){
laydate.render({elem:element, type:'date', format:'yyyy-MM-dd'});
}
}
},
{header:'日期时间', name:'testDatetime', width:150,
formatter:'date', formatoptions:{srcformat:'Y-m-d H:i:s',newformat:'Y-m-d H:i:s'},
editable:true, edittype:'text', editoptions:{'class':'form-control Wdate ', 'readonly':'true',
dataInit: function(element){ $(element).on('focus', function(){
WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:false});
});
}}
editable:true, edittype:'text', editoptions:{'class':'form-control laydate ', 'readonly':'true',
dataInit: function(element){
laydate.render({elem:element, type:'datetime', format:'yyyy-MM-dd HH:mm'});
}
}
},
{header:'用户选择', name:'testUser', width:150,
formatter: function(val, obj, row, act){

View File

@@ -83,8 +83,8 @@
<label class="control-label col-sm-4" title="">
<span class="required hide">*</span> 日期:<i class="fa icon-question hide"></i></label>
<div class="col-sm-8">
<#form:input path="testDate" readonly="true" maxlength="20" class="form-control Wdate "
dataFormat="date" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
<#form:input path="testDate" readonly="true" maxlength="20" class="form-control laydate "
dataFormat="date" data-type="date" data-format="yyyy-MM-dd"/>
</div>
</div>
</div>
@@ -93,8 +93,8 @@
<label class="control-label col-sm-4" title="">
<span class="required hide">*</span> 时间:<i class="fa icon-question hide"></i></label>
<div class="col-sm-8">
<#form:input path="testDatetime" readonly="true" maxlength="20" class="form-control Wdate "
dataFormat="datetime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:false});"/>
<#form:input path="testDatetime" readonly="true" maxlength="20" class="form-control laydate "
dataFormat="datetime" data-type="datetime" data-format="yyyy-MM-dd HH:mm"/>
</div>
</div>
</div>

View File

@@ -81,8 +81,8 @@
<label class="control-label col-sm-4" title="">
<span class="required hide">*</span> 日期选择:<i class="fa icon-question hide"></i></label>
<div class="col-sm-8">
<#form:input path="testDate" readonly="true" maxlength="20" class="form-control Wdate "
dataFormat="date" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
<#form:input path="testDate" readonly="true" maxlength="20" class="form-control laydate "
dataFormat="date" data-type="date" data-format="yyyy-MM-dd"/>
</div>
</div>
</div>
@@ -91,8 +91,8 @@
<label class="control-label col-sm-4" title="">
<span class="required hide">*</span> 日期时间:<i class="fa icon-question hide"></i></label>
<div class="col-sm-8">
<#form:input path="testDatetime" readonly="true" maxlength="20" class="form-control Wdate "
dataFormat="datetime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:false});"/>
<#form:input path="testDatetime" readonly="true" maxlength="20" class="form-control laydate "
dataFormat="datetime" data-type="datetime" data-format="yyyy-MM-dd HH:mm"/>
</div>
</div>
</div>
@@ -269,19 +269,19 @@ $("#testDataChildDataGrid").dataGrid({
},
{header:'日期选择', name:'testDate', width:150,
formatter:'date', formatoptions:{srcformat:'Y-m-d H:i:s',newformat:'Y-m-d'},
editable:true, edittype:'text', editoptions:{'class':'form-control Wdate ', 'readonly':'true',
dataInit: function(element){ $(element).on('focus', function(){
WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});
});
}}
editable:true, edittype:'text', editoptions:{'class':'form-control laydate ', 'readonly':'true',
dataInit: function(element){
laydate.render({elem:element, type:'date', format:'yyyy-MM-dd'});
}
}
},
{header:'日期时间', name:'testDatetime', width:150,
formatter:'date', formatoptions:{srcformat:'Y-m-d H:i:s',newformat:'Y-m-d H:i:s'},
editable:true, edittype:'text', editoptions:{'class':'form-control Wdate ', 'readonly':'true',
dataInit: function(element){ $(element).on('focus', function(){
WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:false});
});
}}
editable:true, edittype:'text', editoptions:{'class':'form-control laydate ', 'readonly':'true',
dataInit: function(element){
laydate.render({elem:element, type:'datetime', format:'yyyy-MM-dd HH:mm'});
}
}
},
{header:'用户选择', name:'testUser', width:150,
formatter: function(val, obj, row, act){

View File

@@ -12,171 +12,171 @@
<#form:form id="inputForm" model="${testData}" action="${ctx}/test/testData/save" method="post" class="form-horizontal">
<div class="box-body">
<div class="form-unit">${text('基本信息')}</div>
<#form:hidden path="id"/>
<div class="row">
<div class="col-xs-6">
<div class="form-group">
<label class="control-label col-sm-4" title="">
<span class="required hide">*</span> ${text('单行文本')}<i class="fa icon-question hide"></i></label>
<div class="col-sm-8">
<#form:input path="testInput" maxlength="200" class="form-control"/>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="form-group">
<label class="control-label col-sm-2" title="">
<span class="required hide">*</span> ${text('多行文本')}<i class="fa icon-question hide"></i></label>
<div class="col-sm-10">
<#form:textarea path="testTextarea" rows="4" maxlength="200" class="form-control"/>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-6">
<div class="form-group">
<label class="control-label col-sm-4" title="">
<span class="required hide">*</span> ${text('下拉框')}<i class="fa icon-question hide"></i></label>
<div class="col-sm-8">
<#form:select path="testSelect" dictType="sys_menu_type" blankOption="true" class="form-control" />
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="control-label col-sm-4" title="">
<span class="required hide">*</span> ${text('下拉多选')}<i class="fa icon-question hide"></i></label>
<div class="col-sm-8">
<#form:select path="testSelectMultiple" dictType="sys_menu_type" multiple="true" blankOption="true" class="form-control" />
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-6">
<div class="form-group">
<label class="control-label col-sm-4" title="">
<span class="required hide">*</span> ${text('单选框')}<i class="fa icon-question hide"></i></label>
<div class="col-sm-8">
<#form:radio path="testRadio" dictType="sys_menu_type" class="form-control" />
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="control-label col-sm-4" title="">
<span class="required hide">*</span> ${text('复选框')}<i class="fa icon-question hide"></i></label>
<div class="col-sm-8">
<#form:checkbox path="testCheckbox" dictType="sys_menu_type" class="form-control" />
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-6">
<div class="form-group">
<label class="control-label col-sm-4" title="">
<span class="required hide">*</span> ${text('日期选择')}<i class="fa icon-question hide"></i></label>
<div class="col-sm-8">
<#form:input path="testDate" readonly="true" maxlength="20" class="form-control Wdate"
dataFormat="date" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="control-label col-sm-4" title="">
<span class="required hide">*</span> ${text('日期时间')}<i class="fa icon-question hide"></i></label>
<div class="col-sm-8">
<#form:input path="testDatetime" readonly="true" maxlength="20" class="form-control Wdate"
dataFormat="datetime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:true});"/>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-6">
<div class="form-group">
<label class="control-label col-sm-4" title="">
<span class="required hide">*</span> ${text('用户选择')}<i class="fa icon-question hide"></i></label>
<div class="col-sm-8">
<#form:treeselect id="testUser" title="${text('用户选择')}"
path="testUser.userCode" labelPath="testUser.userName"
url="${ctx}/sys/office/treeData?isLoadUser=true"
class="" allowClear="true"/>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="control-label col-sm-4" title="">
<span class="required hide">*</span> ${text('机构选择')}<i class="fa icon-question hide"></i></label>
<div class="col-sm-8">
<#form:treeselect id="testOffice" title="${text('机构选择')}"
path="testOffice.officeCode" labelPath="testOffice.officeName"
url="${ctx}/sys/office/treeData"
class="" allowClear="true"/>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-6">
<div class="form-group">
<label class="control-label col-sm-4" title="">
<span class="required hide">*</span> ${text('区域选择')}<i class="fa icon-question hide"></i></label>
<div class="col-sm-8">
<#form:treeselect id="testAreaCode" title="${text('区域选择')}"
path="testAreaCode" labelPath="testAreaName"
url="${ctx}/sys/area/treeData"
class="" allowClear="true"/>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="form-group">
<label class="control-label col-sm-2" title="">
<span class="required hide">*</span> ${text('备注信息')}<i class="fa icon-question hide"></i></label>
<div class="col-sm-10">
<#form:textarea path="remarks" rows="4" maxlength="500" class="form-control"/>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="form-group">
<label class="control-label col-sm-2">${text('图片上传')}</label>
<div class="col-sm-10">
<#form:fileupload id="uploadImage" bizKey="${testData.id}" bizType="testData_image"
uploadType="image" class="" readonly="false" preview="weboffice"/>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="form-group">
<label class="control-label col-sm-2">${text('附件上传')}</label>
<div class="col-sm-10">
<#form:fileupload id="uploadFile" bizKey="${testData.id}" bizType="testData_file"
uploadType="all" class="" readonly="false" preview="weboffice"/>
</div>
</div>
</div>
</div>
<h4 class="form-unit">${text('子表数据')}</h4>
<div class="ml10 mr10">
<table id="testDataChildDataGrid"></table>
<% if (hasPermi('test:testData:edit')){ %>
<a href="#" id="testDataChildDataGridAddRowBtn" class="btn btn-primary btn-sm mt10 mb10"><i class="fa fa-plus"></i> ${text('增行')}</a>
<% } %>
</div>
<#form:hidden path="id"/>
<div class="row">
<div class="col-xs-6">
<div class="form-group">
<label class="control-label col-sm-4" title="">
<span class="required hide">*</span> ${text('单行文本')}<i class="fa icon-question hide"></i></label>
<div class="col-sm-8">
<#form:input path="testInput" maxlength="200" class="form-control"/>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="form-group">
<label class="control-label col-sm-2" title="">
<span class="required hide">*</span> ${text('多行文本')}<i class="fa icon-question hide"></i></label>
<div class="col-sm-10">
<#form:textarea path="testTextarea" rows="4" maxlength="200" class="form-control"/>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-6">
<div class="form-group">
<label class="control-label col-sm-4" title="">
<span class="required hide">*</span> ${text('下拉框')}<i class="fa icon-question hide"></i></label>
<div class="col-sm-8">
<#form:select path="testSelect" dictType="sys_menu_type" blankOption="true" class="form-control" />
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="control-label col-sm-4" title="">
<span class="required hide">*</span> ${text('下拉多选')}<i class="fa icon-question hide"></i></label>
<div class="col-sm-8">
<#form:select path="testSelectMultiple" dictType="sys_menu_type" multiple="true" blankOption="true" class="form-control" />
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-6">
<div class="form-group">
<label class="control-label col-sm-4" title="">
<span class="required hide">*</span> ${text('单选框')}<i class="fa icon-question hide"></i></label>
<div class="col-sm-8">
<#form:radio path="testRadio" dictType="sys_menu_type" class="form-control" />
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="control-label col-sm-4" title="">
<span class="required hide">*</span> ${text('复选框')}<i class="fa icon-question hide"></i></label>
<div class="col-sm-8">
<#form:checkbox path="testCheckbox" dictType="sys_menu_type" class="form-control" />
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-6">
<div class="form-group">
<label class="control-label col-sm-4" title="">
<span class="required hide">*</span> ${text('日期选择')}<i class="fa icon-question hide"></i></label>
<div class="col-sm-8">
<#form:input path="testDate" readonly="true" maxlength="20" class="form-control laydate"
dataFormat="date" data-type="date" data-format="yyyy-MM-dd"/>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="control-label col-sm-4" title="">
<span class="required hide">*</span> ${text('日期时间')}<i class="fa icon-question hide"></i></label>
<div class="col-sm-8">
<#form:input path="testDatetime" readonly="true" maxlength="20" class="form-control laydate"
dataFormat="datetime" data-type="datetime" data-format="yyyy-MM-dd HH:mm"/>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-6">
<div class="form-group">
<label class="control-label col-sm-4" title="">
<span class="required hide">*</span> ${text('用户选择')}<i class="fa icon-question hide"></i></label>
<div class="col-sm-8">
<#form:treeselect id="testUser" title="${text('用户选择')}"
path="testUser.userCode" labelPath="testUser.userName"
url="${ctx}/sys/office/treeData?isLoadUser=true"
class="" allowClear="true"/>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="control-label col-sm-4" title="">
<span class="required hide">*</span> ${text('机构选择')}<i class="fa icon-question hide"></i></label>
<div class="col-sm-8">
<#form:treeselect id="testOffice" title="${text('机构选择')}"
path="testOffice.officeCode" labelPath="testOffice.officeName"
url="${ctx}/sys/office/treeData"
class="" allowClear="true"/>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-6">
<div class="form-group">
<label class="control-label col-sm-4" title="">
<span class="required hide">*</span> ${text('区域选择')}<i class="fa icon-question hide"></i></label>
<div class="col-sm-8">
<#form:treeselect id="testAreaCode" title="${text('区域选择')}"
path="testAreaCode" labelPath="testAreaName"
url="${ctx}/sys/area/treeData"
class="" allowClear="true"/>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="form-group">
<label class="control-label col-sm-2" title="">
<span class="required hide">*</span> ${text('备注信息')}<i class="fa icon-question hide"></i></label>
<div class="col-sm-10">
<#form:textarea path="remarks" rows="4" maxlength="500" class="form-control"/>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="form-group">
<label class="control-label col-sm-2">${text('图片上传')}</label>
<div class="col-sm-10">
<#form:fileupload id="uploadImage" bizKey="${testData.id}" bizType="testData_image"
uploadType="image" class="" readonly="false" preview="weboffice"/>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="form-group">
<label class="control-label col-sm-2">${text('附件上传')}</label>
<div class="col-sm-10">
<#form:fileupload id="uploadFile" bizKey="${testData.id}" bizType="testData_file"
uploadType="all" class="" readonly="false" preview="weboffice"/>
</div>
</div>
</div>
</div>
<h4 class="form-unit">${text('子表数据')}</h4>
<div class="ml10 mr10">
<table id="testDataChildDataGrid"></table>
<% if (hasPermi('test:testData:edit')){ %>
<a href="#" id="testDataChildDataGridAddRowBtn" class="btn btn-primary btn-sm mt10 mb10"><i class="fa fa-plus"></i> ${text('增行')}</a>
<% } %>
</div>
</div>
<div class="box-footer">
<div class="row">
@@ -192,168 +192,184 @@
</div>
</div>
<% } %>
<script>
//初始化测试数据子表DataGrid对象
$("#testDataChildDataGrid").dataGrid({
data: ${toJson(testData.testDataChildList)},
datatype: "local", // 设置本地数据
autoGridHeight: function(){return 'auto'}, // 设置自动高度
// 设置数据表格列
columnModel: [
{header:'状态', name:'status', editable:true, hidden:true},
{header:'主键', name:'id', editable:true, hidden:true},
{header:'${text("排序号")}', name:'testSort', width:150, editable:true, edittype:'text', editoptions:{'maxlength':'11', 'class':'form-control digits'}},
{header:'${text("父表主键")}', name:'testData.id', editable:true, hidden:true},
{header:'${text("单行文本")}', name:'testInput', width:150, editable:true, edittype:'text', editoptions:{'maxlength':'200', 'class':'form-control'}},
{header:'${text("多行文本")}', name:'testTextarea', width:150, editable:true, edittype:'textarea', editoptions:{'maxlength':'200', 'class':'form-control', 'rows':'1'}},
{header:'${text("下拉框")}', name:'testSelect', width:100,
editable:true, edittype:'select', editoptions:{'class':'form-control',
items: $.merge([{dictLabel:'&nbsp;',dictValue:''}], ${@DictUtils.getDictListJson('sys_menu_type')}),
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
$(element).select2().on("change",function(){$(this).resetValid()});
}
}
},
{header:'${text("下拉多选")}', name:'testSelectMultiple', width:100,
editable:true, edittype:'select', editoptions:{multiple:true, 'class':'form-control',
items: $.merge([], ${@DictUtils.getDictListJson('sys_menu_type')}),
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
$(element).select2().on("change",function(){$(this).resetValid()});
}
}
},
{header:'${text("单选框")}', name:'testRadio', width:100,
editable:true, edittype:'select', editoptions:{'class':'form-control',
items: $.merge([{dictLabel:'&nbsp;',dictValue:''}], ${@DictUtils.getDictListJson('sys_menu_type')}),
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
$(element).select2().on("change",function(){$(this).resetValid()});
}
}
},
{header:'${text("复选框")}', name:'testCheckbox', width:100,
editable:true, edittype:'select', editoptions:{multiple:true, 'class':'form-control',
items: $.merge([], ${@DictUtils.getDictListJson('sys_menu_type')}),
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
$(element).select2().on("change",function(){$(this).resetValid()});
}
}
},
{header:'${text("日期选择")}', name:'testDate', width:150,
formatter:'date', formatoptions:{srcformat:'Y-m-d H:i:s',newformat:'Y-m-d'},
editable:true, edittype:'text', editoptions:{'class':'form-control Wdate', 'readonly':'true',
dataInit: function(element){ $(element).on('focus', function(){
WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});
});
}}
},
{header:'${text("日期时间")}', name:'testDatetime', width:150,
formatter:'date', formatoptions:{srcformat:'Y-m-d H:i:s',newformat:'Y-m-d H:i:s'},
editable:true, edittype:'text', editoptions:{'class':'form-control Wdate', 'readonly':'true',
dataInit: function(element){ $(element).on('focus', function(){
WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:true});
});
}}
},
{header:'${text("用户选择")}', name:'testUser', width:150,
formatter: function(val, obj, row, act){
return js.val(row, 'testUser.userCode')+'|'+js.val(row, 'testUser.userName');
}, editable: true, edittype: "custom", editoptions: {
custom_element: function(val, editOptions) {
return js.template('treeselectTpl', {
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: ''
});
}
}
},
{header:'${text("用户列表选择")}', name:'testUser2', width:150,
formatter: function(val, obj, row, act){
return js.val(row, 'testUser.userCode')+'|'+js.val(row, 'testUser.userName');
}, editable: true, edittype: "custom", editoptions: {
custom_element: function(val, editOptions) {
return js.template('listselectTpl', {
id: 'user_'+editOptions.id, title: '用户选择',
name: 'testUser2.userCode', value: val.split('|')[0],
labelName: 'testUser2.userName', labelValue: val.split('|')[1],
<script>
//初始化测试数据子表DataGrid对象
$("#testDataChildDataGrid").dataGrid({
data: ${toJson(testData.testDataChildList)},
datatype: "local", // 设置本地数据
autoGridHeight: function(){return 'auto'}, // 设置自动高度
// 设置数据表格列
columnModel: [
{header:'状态', name:'status', editable:true, hidden:true},
{header:'主键', name:'id', editable:true, hidden:true},
{header:'${text("排序号")}', name:'testSort', width:150, editable:true, edittype:'text', editoptions:{'maxlength':'11', 'class':'form-control digits'}},
{header:'${text("父表主键")}', name:'testData.id', editable:true, hidden:true},
{header:'${text("单行文本")}', name:'testInput', width:150, editable:true, edittype:'text', editoptions:{'maxlength':'200', 'class':'form-control'}},
{header:'${text("多行文本")}', name:'testTextarea', width:150, editable:true, edittype:'textarea', editoptions:{'maxlength':'200', 'class':'form-control', 'rows':'1'}},
{header:'${text("下拉框")}', name:'testSelect', width:100,
editable:true, edittype:'select', editoptions:{'class':'form-control',
items: $.merge([{dictLabel:'&nbsp;',dictValue:''}], ${@DictUtils.getDictListJson('sys_menu_type')}),
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
$(element).select2().on("change",function(){$(this).resetValid()});
}
}
},
{header:'${text("下拉多选")}', name:'testSelectMultiple', width:100,
editable:true, edittype:'select', editoptions:{multiple:true, 'class':'form-control',
items: $.merge([], ${@DictUtils.getDictListJson('sys_menu_type')}),
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
$(element).select2().on("change",function(){$(this).resetValid()});
}
}
},
{header:'${text("单选框")}', name:'testRadio', width:100,
editable:true, edittype:'select', editoptions:{'class':'form-control',
items: $.merge([{dictLabel:'&nbsp;',dictValue:''}], ${@DictUtils.getDictListJson('sys_menu_type')}),
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
$(element).select2().on("change",function(){$(this).resetValid()});
}
}
},
{header:'${text("复选框")}', name:'testCheckbox', width:100,
editable:true, edittype:'select', editoptions:{multiple:true, 'class':'form-control',
items: $.merge([], ${@DictUtils.getDictListJson('sys_menu_type')}),
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
$(element).select2().on("change",function(){$(this).resetValid()});
}
}
},
{header:'${text("日期选择")}', name:'testDate', width:150,
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'});
}
}
},
{header:'${text("日期时间")}', name:'testDatetime', width:150,
formatter:'date', formatoptions:{srcformat:'Y-m-d H:i:s',newformat:'Y-m-d H:i:s'},
editable:true, edittype:'text', editoptions:{'class':'form-control laydate', 'readonly':'true',
dataInit: function(element){
laydate.render({elem:element, type:'datetime', format:'yyyy-MM-dd HH:mm'});
}
}
},
{header:'${text("用户选择")}', name:'testUser', width:150,
formatter: function(val, obj, row, act){
return js.val(row, 'testUser.userCode')+'|'+js.val(row, 'testUser.userName');
}, editable: true, edittype: "custom", editoptions: {
custom_element: function(val, editOptions) {
return js.template('treeselectTpl', {
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: ''
});
}
}
},
{header:'${text("列表选择")}', name:'testUser2', width:150,
formatter: function(val, obj, row, act){
return js.val(row, 'testUser.userCode')+'|'+js.val(row, 'testUser.userName');
}, editable: true, edittype: "custom", editoptions: {
custom_element: function(val, editOptions) {
return js.template('listselectTpl', {
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: '',
itemCode: 'userCode', itemName: 'userName'
});
}
}
},
{header:'${text("机构选择")}', name:'testOffice', width:150,
formatter: function(val, obj, row, act){
return js.val(row, 'testOffice.officeCode')+'|'+js.val(row, 'testOffice.officeName');
}, editable: true, edittype: "custom", editoptions: {
custom_element: function(val, editOptions) {
return js.template('treeselectTpl', {
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: ''
});
}
}
},
{header:'${text("区域选择")}', name:'testAreaCode', width:150,
formatter: function(val, obj, row, act){
return js.val(row, 'testAreaCode')+'|'+js.val(row, 'testAreaName');
}, editable: true, edittype: "custom", editoptions: {
custom_element: function(val, editOptions) {
return js.template('treeselectTpl', {
id: 'area_'+editOptions.id, title: '区域选择',
name: 'testAreaCode', value: val.split('|')[0],
labelName: 'testAreaName', labelValue: val.split('|')[1],
url: '${ctx}/sys/area/treeData', cssClass: ''
});
}
}
},
{header:'${text("操作")}', name:'actions', width:80, sortable:false, fixed:true, formatter: function(val, obj, row, act){
var actions = [];
if (val == 'new'){
actions.push('<a href="#" onclick="js.confirm(\'${text("你确认要删除这条数据吗?")}\', function(){$(\'#testDataChildDataGrid\').dataGrid(\'delRowData\',\''+obj.rowId+'\')});return false;"><i class="fa fa-trash-o"></i></a>&nbsp;');
}else{
actions.push('<a href="#" onclick="js.confirm(\'${text("你确认要删除这条数据吗?")}\', function(){$(\'#testDataChildDataGrid\').dataGrid(\'setRowData\',\''+obj.rowId+'\',null,{display:\'none\'});$(\'#'+obj.rowId+'_status\').val(\''+Global.STATUS_DELETE+'\');});return false;"><i class="fa fa-trash-o"></i></a>&nbsp;');
}
return actions.join('');
}, editoptions: {defaultValue: 'new'}}
],
// 编辑表格参数
editGrid: true, // 是否是编辑表格
editGridInitRowNum: 1, // 编辑表格的初始化新增行数
itemCode: 'userCode', itemName: 'userName'
});
}
}
},
{header:'${text("机构选择")}', name:'testOffice', width:150, title:false,
formatter: function(val, obj, row, act){
return js.val(row, 'testOffice.officeCode')+'|'+js.val(row, 'testOffice.officeName');
}, editable: true, edittype: "custom", editoptions: {
custom_element: function(val, editOptions) {
return js.template('treeselectTpl', {
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: ''
});
}
}
},
{header:'${text("区域选择")}', name:'testAreaCode', width:150,
formatter: function(val, obj, row, act){
return js.val(row, 'testAreaCode')+'|'+js.val(row, 'testAreaName');
}, editable: true, edittype: "custom", editoptions: {
custom_element: function(val, editOptions) {
return js.template('treeselectTpl', {
id: 'area_'+editOptions.id, title: '区域选择',
name: 'testAreaCode', value: val.split('|')[0],
labelName: 'testAreaName', labelValue: val.split('|')[1],
url: '${ctx}/sys/area/treeData', cssClass: ''
});
}
}
},
// {header:'${text("文件上传")}', name:'id', width:250,
// editable: true, edittype: "custom", editoptions: {
// custom_element: function(val, editOptions) {
// return js.template('fileuploadTpl', {
// id: 'fileupload_'+editOptions.id, title: '区域选择',
// bizKey: val, bizType: 'testDataChild_file', cssClass: ''
// });
// }
// }
// },
{header:'${text("操作")}', name:'actions', width:80, sortable:false, fixed:true, formatter: function(val, obj, row, act){
var actions = [];
if (val == 'new'){
actions.push('<a href="#" onclick="js.confirm(\'${text("你确认要删除这条数据吗?")}\', function(){$(\'#testDataChildDataGrid\').dataGrid(\'delRowData\',\''+obj.rowId+'\')});return false;"><i class="fa fa-trash-o"></i></a>&nbsp;');
}else{
actions.push('<a href="#" onclick="js.confirm(\'${text("你确认要删除这条数据吗?")}\', function(){$(\'#testDataChildDataGrid\').dataGrid(\'setRowData\',\''+obj.rowId+'\',null,{display:\'none\'});$(\'#'+obj.rowId+'_status\').val(\''+Global.STATUS_DELETE+'\');});return false;"><i class="fa fa-trash-o"></i></a>&nbsp;');
}
return actions.join('');
}, editoptions: {defaultValue: 'new'}}
],
// 编辑表格参数
editGrid: true, // 是否是编辑表格
editGridInitRowNum: 1, // 编辑表格的初始化新增行数
editGridAddRowBtn: $('#testDataChildDataGridAddRowBtn'), // 子表增行按钮
editGridAddRowBtnToHeader: true, // 子表增行按钮是否显示到表头上 v4.1.7
editGridAddRowInitData: {id: '', status: Global.STATUS_NORMAL}, // 新增行的时候初始化的数据
// 编辑表格的提交数据参数
editGridInputFormListName: 'testDataChildList', // 提交的数据列表名
editGridInputFormListAttrs: 'status,id,testSort,testData.id,testInput,testTextarea,testSelect,testSelectMultiple,testRadio,testCheckbox,testDate,testDatetime,testUser.userCode,testOffice.officeCode,testAreaCode,testAreaName,', // 提交数据列表的属性字段
// 加载成功后执行事件
editGridAddRowBtnToHeader: true, // 子表增行按钮是否显示到表头上 v4.1.7
editGridAddRowInitData: {id: '', status: Global.STATUS_NORMAL}, // 新增行的时候初始化的数据
// 编辑表格的提交数据参数
editGridInputFormListName: 'testDataChildList', // 提交的数据列表名
editGridInputFormListAttrs: 'status,id,testSort,testData.id,testInput,testTextarea,testSelect,testSelectMultiple,'
+'testRadio,testCheckbox,testDate,testDatetime,testUser.userCode,testOffice.officeCode,'
+'testAreaCode,testAreaName,testDataChild_file,testDataChild_file__del', // 提交数据列表的属性字段
// 加载成功后执行事件
ajaxSuccess: function(data){
// $('#jqgh_testDataChildDataGrid_rn').append('<a href="javascript:" onclick="'
// + '$(\'#testDataChildDataGridAddRowBtn\').click();">'
// + '<i class="fa fa-plus"></i></a>');
}
});
</script>
<script id="treeselectTpl" type="text/template">//<!--<div>
<#form:treeselect id="{{d.id}}" title="{{d.title}}" name="{{d.name}}" value="{{d.value}}"
labelName="{{d.labelName}}" labelValue="{{d.labelValue}}" url="{{d.url}}"
class="{{d.cssClass}}" btnClass="btn-sm" allowClear="true"/>
// + '<i class="fa fa-plus"></i></a>');
}
});
</script>
<script id="treeselectTpl" type="text/template">//<!--<div>
<#form:treeselect id="{{d.id}}" title="{{d.title}}" name="{{d.name}}" value="{{d.value}}"
labelName="{{d.labelName}}" labelValue="{{d.labelValue}}" url="{{d.url}}"
class="{{d.cssClass}}" btnClass="btn-sm" allowClear="true"/>
</div>//--></script>
<script id="listselectTpl" type="text/template">//<!--<div>
<#form:listselect id="{{d.id}}" title="{{d.title}}" name="{{d.name}}" value="{{d.value}}"
labelName="{{d.labelName}}" labelValue="{{d.labelValue}}" url="{{d.url}}"
class="{{d.cssClass}}" btnClass="btn-sm" allowClear="true"
itemCode="{{d.itemCode}}" itemName="{{d.itemName}}"/>
</div>//--></script>
</div>//--></script>
<script id="fileuploadTpl" type="text/template">//<!--<div>
<#form:fileupload id="{{d.id}}" bizKey="{{d.bizKey}}" bizType="{{d.bizType}}"
uploadType="all" class="{{d.cssClass}}" isMini="true" preview="weboffice"/>
</div>//--></script>
<script>
$("#inputForm").validate({
submitHandler: function(form){

View File

@@ -14,156 +14,154 @@
</div>
</div>
<div class="box-body">
<#form:form id="searchForm" model="${testData}" action="${ctx}/test/testData/listData" method="post" class="form-inline hide"
data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
<div class="form-group">
<label class="control-label">${text('单行文本')}</label>
<div class="control-inline">
<#form:input path="testInput" maxlength="200" class="form-control width-120"/>
</div>
</div>
<div class="form-group">
<label class="control-label">${text('多行文本')}</label>
<div class="control-inline">
<#form:input path="testTextarea" maxlength="200" class="form-control width-120"/>
</div>
</div>
<div class="form-group">
<label class="control-label">${text('下拉框')}</label>
<div class="control-inline width-120">
<#form:select path="testSelect" dictType="sys_menu_type" blankOption="true" class="form-control"/>
</div>
</div>
<div class="form-group">
<label class="control-label">${text('下拉多选')}</label>
<div class="control-inline width-120">
<#form:select path="testSelectMultiple" dictType="sys_menu_type" multiple="true" blankOption="true" class="form-control"/>
</div>
</div>
<div class="form-group">
<label class="control-label">${text('单选框')}</label>
<div class="control-inline">
<#form:radio path="testRadio" dictType="sys_menu_type" blankOption="true" class="form-control"/>
</div>
</div>
<div class="form-group">
<label class="control-label">${text('复选框')}</label>
<div class="control-inline">
<#form:checkbox path="testCheckbox" dictType="sys_menu_type" blankOption="true" class="form-control"/>
</div>
</div>
<div class="form-group">
<label class="control-label">${text('日期选择')}</label>
<div class="control-inline">
<#form:input path="testDate_gte" readonly="true" maxlength="20" class="form-control Wdate-date"
dataFormat="date" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false,onpicked:function(){testDate_lte.click()}});"/>
&nbsp;--&nbsp;
<#form:input path="testDate_lte" readonly="true" maxlength="20" class="form-control Wdate-date"
dataFormat="date" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
</div>
</div>
<div class="form-group">
<label class="control-label">${text('日期时间')}</label>
<div class="control-inline">
<#form:input path="testDatetime_gte" readonly="true" maxlength="20" class="form-control Wdate-datetime"
dataFormat="datetime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:false,onpicked:function(){testDatetime_lte.click()}});"/>
&nbsp;--&nbsp;
<#form:input path="testDatetime_lte" readonly="true" maxlength="20" class="form-control Wdate-datetime"
dataFormat="datetime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:false});"/>
</div>
</div>
<div class="form-group">
<label class="control-label">${text('用户选择')}</label>
<div class="control-inline width-120" >
<#form:treeselect id="testUser" title="${text('用户选择')}"
path="testUser.userCode" labelPath="testUser.userName"
url="${ctx}/sys/office/treeData?isLoadUser=true" allowClear="true"/>
</div>
</div>
<div class="form-group">
<label class="control-label">${text('机构选择')}</label>
<div class="control-inline width-120" >
<#form:treeselect id="testOffice" title="${text('机构选择')}"
path="testOffice.officeCode" labelPath="testOffice.officeName"
url="${ctx}/sys/office/treeData" allowClear="true"/>
</div>
</div>
<div class="form-group">
<label class="control-label">${text('区域选择')}</label>
<div class="control-inline width-120" >
<#form:treeselect id="testAreaCode" title="${text('区域选择')}"
path="testAreaCode" labelPath="testAreaName"
url="${ctx}/sys/area/treeData" allowClear="true"/>
</div>
</div>
<div class="form-group">
<label class="control-label">${text('状态')}</label>
<div class="control-inline width-120">
<#form:select path="status" dictType="sys_search_status" blankOption="true" class="form-control isQuick"/>
</div>
</div>
<div class="form-group">
<label class="control-label">${text('备注信息')}</label>
<div class="control-inline">
<#form:input path="remarks" maxlength="500" class="form-control width-120"/>
</div>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
</div>
</#form:form>
<#form:form id="searchForm" model="${testData}" action="${ctx}/test/testData/listData" method="post" class="form-inline "
data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
<div class="form-group">
<label class="control-label">${text('单行文本')}</label>
<div class="control-inline">
<#form:input path="testInput" maxlength="200" class="form-control width-120"/>
</div>
</div>
<div class="form-group">
<label class="control-label">${text('多行文本')}</label>
<div class="control-inline">
<#form:input path="testTextarea" maxlength="200" class="form-control width-120"/>
</div>
</div>
<div class="form-group">
<label class="control-label">${text('下拉框')}</label>
<div class="control-inline width-120">
<#form:select path="testSelect" dictType="sys_menu_type" blankOption="true" class="form-control"/>
</div>
</div>
<div class="form-group">
<label class="control-label">${text('日期选择')}</label>
<div class="control-inline">
<#form:input path="testDate_gte" readonly="true" maxlength="20" class="form-control laydate width-date"
dataFormat="date" data-type="date" data-format="yyyy-MM-dd" data-done="testDate_lte.focus()"/>
&nbsp;-&nbsp;
<#form:input path="testDate_lte" readonly="true" maxlength="20" class="form-control laydate width-date"
dataFormat="date" data-type="date" data-format="yyyy-MM-dd"/>
</div>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
<button type="button" class="btn btn-default btn-sm btnFormMore">${text('更多')}<i class="fa fa-angle-double-down"></i></button>
</div>
<div class="form-more">
<div class="form-group">
<label class="control-label">${text('日期时间')}</label>
<div class="control-inline">
<#form:input path="testDatetime_gte" readonly="true" maxlength="20" class="form-control laydate width-datetime"
dataFormat="datetime" data-type="datetime" data-format="yyyy-MM-dd HH:mm" data-done="testDatetime_lte.focus()"/>
&nbsp;-&nbsp;
<#form:input path="testDatetime_lte" readonly="true" maxlength="20" class="form-control laydate width-datetime"
dataFormat="datetime" data-type="datetime" data-format="yyyy-MM-dd HH:mm"/>
</div>
</div>
<div class="form-group">
<label class="control-label">${text('用户选择')}</label>
<div class="control-inline width-120" >
<#form:treeselect id="testUser" title="${text('用户选择')}"
path="testUser.userCode" labelPath="testUser.userName"
url="${ctx}/sys/office/treeData?isLoadUser=true" allowClear="true"/>
</div>
</div>
<div class="form-group">
<label class="control-label">${text('机构选择')}</label>
<div class="control-inline width-120" >
<#form:treeselect id="testOffice" title="${text('机构选择')}"
path="testOffice.officeCode" labelPath="testOffice.officeName"
url="${ctx}/sys/office/treeData" allowClear="true"/>
</div>
</div>
<div class="form-group">
<label class="control-label">${text('区域选择')}</label>
<div class="control-inline width-120" >
<#form:treeselect id="testAreaCode" title="${text('区域选择')}"
path="testAreaCode" labelPath="testAreaName"
url="${ctx}/sys/area/treeData" allowClear="true"/>
</div>
</div>
<div class="form-group">
<label class="control-label">${text('下拉多选')}</label>
<div class="control-inline width-120">
<#form:select path="testSelectMultiple" dictType="sys_menu_type" multiple="true" blankOption="true" class="form-control"/>
</div>
</div>
<div class="form-group">
<label class="control-label">${text('数据状态')}</label>
<div class="control-inline width-120">
<#form:select path="status" dictType="sys_search_status" blankOption="true" class="form-control isQuick"/>
</div>
</div>
<div class="form-group">
<label class="control-label">${text('单选框')}</label>
<div class="control-inline">
<#form:radio path="testRadio" dictType="sys_menu_type" blankOption="true" class="form-control"/>
</div>
</div>
<div class="form-group">
<label class="control-label">${text('复选框')}</label>
<div class="control-inline">
<#form:checkbox path="testCheckbox" dictType="sys_menu_type" blankOption="true" class="form-control"/>
</div>
</div>
</div>
</#form:form>
<table id="dataGrid"></table>
<div id="dataGridPage"></div>
</div>
</div>
</div>
<% } %>
<script>
// 初始化DataGrid对象
$('#dataGrid').dataGrid({
searchForm: $("#searchForm"),
columnModel: [
{header:'${text("单行文本")}', name:'testInput', index:'a.test_input', width:150, align:"left", frozen:true, formatter: function(val, obj, row, act){
return '<a href="${ctx}/test/testData/form?id='+row.id+'" class="btnList" data-title="${text("编辑数据")}">'+(val||row.id)+'</a>';
}},
{header:'${text("多行文本")}', name:'testTextarea', index:'a.test_textarea', width:150, align:"left"},
{header:'${text("下拉框")}', name:'testSelect', index:'a.test_select', width:150, align:"center", formatter: function(val, obj, row, act){
return js.getDictLabel(${@DictUtils.getDictListJson('sys_menu_type')}, val, '${text("未知")}', true);
}},
{header:'${text("下拉多选")}', name:'testSelectMultiple', index:'a.test_select_multiple', width:150, align:"center", formatter: function(val, obj, row, act){
return js.getDictLabel(${@DictUtils.getDictListJson('sys_menu_type')}, val, '${text("未知")}', true);
}},
{header:'${text("单选框")}', name:'testRadio', index:'a.test_radio', width:150, align:"center", formatter: function(val, obj, row, act){
return js.getDictLabel(${@DictUtils.getDictListJson('sys_menu_type')}, val, '${text("未知")}', true);
}},
{header:'${text("复选框")}', name:'testCheckbox', index:'a.test_checkbox', width:150, align:"center", formatter: function(val, obj, row, act){
return js.getDictLabel(${@DictUtils.getDictListJson('sys_menu_type')}, val, '${text("未知")}', true);
}},
{header:'${text("日期选择")}', name:'testDate', index:'a.test_date', width:150, align:"center"},
{header:'${text("日期时间")}', name:'testDatetime', index:'a.test_datetime', width:150, align:"center"},
{header:'${text("用户选择")}', name:'testUser.userName', index:'a.test_user_code', width:150, align:"center"},
{header:'${text("机构选择")}', name:'testOffice.officeName', index:'a.test_office_code', width:150, align:"center"},
{header:'${text("区域选择")}', name:'testAreaName', index:'a.test_area_code', width:150, align:"center"},
{header:'${text("区域名称")}', name:'testAreaName', index:'a.test_area_name', width:150, align:"left"},
{header:'${text("状态")}', name:'status', index:'a.status', width:150, align:"center", formatter: function(val, obj, row, act){
return js.getDictLabel(${@DictUtils.getDictListJson('sys_search_status')}, val, '${text("未知")}', true);
}},
{header:'${text("创建时间")}', name:'createDate', index:'a.create_date', firstsortorder:'desc', width:150, align:"center"},
{header:'${text("备注信息")}', name:'remarks', index:'a.remarks', width:150, align:"left"},
{header:'${text("操作")}', name:'actions', width:200, sortable:false, title:false, formatter: function(val, obj, row, act){
var actions = [];
<% if(hasPermi('test:testData:edit')){ %>
actions.push('<a href="${ctx}/test/testData/form?id='+row.id+'" class="btnList" title="${text("编辑数据")}"><i class="fa fa-pencil"></i></a>&nbsp;');
if (row.status == Global.STATUS_NORMAL){
actions.push('<a href="${ctx}/test/testData/disable?id='+row.id+'" class="btnList" title="${text("停用数据")}" data-confirm="${text("确认要停用该数据吗?")}"><i class="glyphicon glyphicon-ban-circle"></i></a>&nbsp;');
} else if (row.status == Global.STATUS_DISABLE){
actions.push('<a href="${ctx}/test/testData/enable?id='+row.id+'" class="btnList" title="${text("启用数据")}" data-confirm="${text("确认要启用该数据吗?")}"><i class="glyphicon glyphicon-ok-circle"></i></a>&nbsp;');
}
actions.push('<a href="${ctx}/test/testData/delete?id='+row.id+'" class="btnList" title="${text("删除数据")}" data-confirm="${text("确认要删除该数据吗?")}"><i class="fa fa-trash-o"></i></a>&nbsp;');
<% } %>
return actions.join('');
}}
<script>
// 初始化DataGrid对象
$('#dataGrid').dataGrid({
searchForm: $("#searchForm"),
columnModel: [
{header:'${text("单行文本")}', name:'testInput', index:'a.test_input', width:250, align:"left", frozen:true, formatter: function(val, obj, row, act){
if (obj.exporttype == "excel") { return val||'' };
return '<a href="${ctx}/test/testData/form?id='+row.id+'" class="btnList" data-title="${text("编辑数据")}">'+(val||row.id)+'</a>';
}},
{header:'${text("多行文本")}', name:'testTextarea', index:'a.test_textarea', width:150, align:"left"},
{header:'${text("下拉框")}', name:'testSelect', index:'a.test_select', width:150, align:"center", formatter: function(val, obj, row, act){
return js.getDictLabel(${@DictUtils.getDictListJson('sys_menu_type')}, val, '${text("未知")}', true);
}},
{header:'${text("下拉多选")}', name:'testSelectMultiple', index:'a.test_select_multiple', width:150, align:"center", formatter: function(val, obj, row, act){
return js.getDictLabel(${@DictUtils.getDictListJson('sys_menu_type')}, val, '${text("未知")}', true);
}},
{header:'${text("单选框")}', name:'testRadio', index:'a.test_radio', width:150, align:"center", formatter: function(val, obj, row, act){
return js.getDictLabel(${@DictUtils.getDictListJson('sys_menu_type')}, val, '${text("未知")}', true);
}},
{header:'${text("复选框")}', name:'testCheckbox', index:'a.test_checkbox', width:150, align:"center", formatter: function(val, obj, row, act){
return js.getDictLabel(${@DictUtils.getDictListJson('sys_menu_type')}, val, '${text("未知")}', true);
}},
{header:'${text("日期选择")}', name:'testDate', index:'a.test_date', width:150, align:"center"},
{header:'${text("日期时间")}', name:'testDatetime', index:'a.test_datetime', width:150, align:"center"},
{header:'${text("用户选择")}', name:'testUser.userName', index:'a.test_user_code', width:150, align:"center"},
{header:'${text("机构选择")}', name:'testOffice.officeName', index:'a.test_office_code', width:150, align:"center"},
{header:'${text("区域选择")}', name:'testAreaName', index:'a.test_area_code', width:150, align:"center"},
{header:'${text("区域名称")}', name:'testAreaName', index:'a.test_area_name', width:150, align:"left"},
{header:'${text("状态")}', name:'status', index:'a.status', width:150, align:"center", formatter: function(val, obj, row, act){
return js.getDictLabel(${@DictUtils.getDictListJson('sys_search_status')}, val, '${text("未知")}', true);
}},
{header:'${text("创建时间")}', name:'createDate', index:'a.create_date', firstsortorder:'desc', width:150, align:"center"},
{header:'${text("备注信息")}', name:'remarks', index:'a.remarks', width:150, align:"left"},
{header:'${text("操作")}', name:'actions', width:200, sortable:false, title:false, formatter: function(val, obj, row, act){
var actions = []; if (obj.exporttype == "excel") { return val||'' };
<% if(hasPermi('test:testData:edit')){ %>
actions.push('<a href="${ctx}/test/testData/form?id='+row.id+'" class="btnList" title="${text("编辑数据")}"><i class="fa fa-pencil"></i></a>&nbsp;');
if (row.status == Global.STATUS_NORMAL){
actions.push('<a href="${ctx}/test/testData/disable?id='+row.id+'" class="btnList" title="${text("停用数据")}" data-confirm="${text("确认要停用该数据吗?")}"><i class="glyphicon glyphicon-ban-circle"></i></a>&nbsp;');
} else if (row.status == Global.STATUS_DISABLE){
actions.push('<a href="${ctx}/test/testData/enable?id='+row.id+'" class="btnList" title="${text("启用数据")}" data-confirm="${text("确认要启用该数据吗?")}"><i class="glyphicon glyphicon-ok-circle"></i></a>&nbsp;');
}
actions.push('<a href="${ctx}/test/testData/delete?id='+row.id+'" class="btnList" title="${text("删除数据")}" data-confirm="${text("确认要删除该数据吗?")}"><i class="fa fa-trash-o"></i></a>&nbsp;');
<% } %>
return actions.join('');
}}
],
// 双击表格行时调用
ondblClickRow: function(id, rownum, colnum, event){
@@ -179,7 +177,7 @@ $('#dataGrid').dataGrid({
url: '${ctx}/test/testData/subListData',
postData: {'testData.id': rowId},
autoGridHeight: function(){return 'auto'}, // 设置自动高度
autoGridWidth: function(){return $("#"+subgridId).width();}, // 设置自动高度
autoGridWidth: function(){return $("#"+subgridId).width()}, // 设置自动高度
// 设置数据表格列
columnModel: [
{header:'${text("单行文本")}', name:'testInput', width:150},
@@ -204,20 +202,20 @@ $('#dataGrid').dataGrid({
emptyDataHint: true, // 表格内没有数据的时候提示 “无数据显示” v4.1.7
// 加载成功后执行事件
ajaxSuccess: function(data){
$(window).resize();
}
});
},
multiSort: true, // 是否支持多列排序,给列指定 firstsortorder 可设定初次排序方式
emptyDataHint: true, // 表格内没有数据的时候提示 “无数据显示” v4.1.7
// 加载成功后执行事件
// 加载成功后执行事件
ajaxSuccess: function(data){
// if (data.count == 0){
// $("#dataGrid").parent().append("<div class=\"ml10\">没有符合数据</div>");
// }
}
// }
}
});
$("#btnTrunsTest").click(function(){
js.ajaxSubmit("${ctx}/test/testData/transTest", function(data){