子表实现,多选提交空优化,列表复杂控件选择实现

This commit is contained in:
thinkgem
2018-02-05 20:31:34 +08:00
parent 23ab1ae851
commit 86d3d04f40
10 changed files with 34 additions and 52 deletions

View File

@@ -34,9 +34,9 @@ import com.jeesite.modules.sys.service.MenuService;
import eu.bitwalker.useragentutils.UserAgent; import eu.bitwalker.useragentutils.UserAgent;
/** /**
* 字典工具类 * 日志工具类
* @author ThinkGem * @author ThinkGem
* @version 2014-11-7 * @version 2017-11-7
*/ */
public class LogUtils { public class LogUtils {

View File

@@ -5,7 +5,7 @@ rem *
rem * Author: ThinkGem@163.com rem * Author: ThinkGem@163.com
rem */ rem */
echo. echo.
echo [<5B><>Ϣ] <20><><EFBFBD><EFBFBD> Web <20><><EFBFBD>̡<EFBFBD> echo [<5B><>Ϣ] <20><><EFBFBD><EFBFBD> Web <20><><EFBFBD>̡<EFBFBD>
echo. echo.
rem pause rem pause
rem echo. rem echo.
@@ -16,8 +16,10 @@ cd %~dp0
cd ../ cd ../
title %cd% title %cd%
set JAVA_OPTS= -Xms256m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=256m rem set JAVA_OPTS= -Xms256m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=512m
set JAVA_OPTS= -Xms256m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
java -jar target/jeesite-web-4.0-SNAPSHOT.war cd target/
java -jar jeesite-web.war
pause pause

View File

@@ -76,6 +76,7 @@
</dependencies> </dependencies>
<build> <build>
<finalName>${project.artifactId}</finalName>
<outputDirectory>${project.basedir}/src/main/webapp/WEB-INF/classes/</outputDirectory> <outputDirectory>${project.basedir}/src/main/webapp/WEB-INF/classes/</outputDirectory>
<plugins> <plugins>
@@ -83,30 +84,10 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
</plugin> </plugin>
<plugin> <!-- <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId> <artifactId>maven-shade-plugin</artifactId>
</plugin> </plugin> -->
<!-- WAR打包插件, 设定war包名称不带版本号 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<packagingExcludes>
</packagingExcludes>
<warSourceExcludes>
userfiles/**,
test/**
</warSourceExcludes>
<webappDirectory>${project.build.directory}/${project.artifactId}</webappDirectory>
<warName>${project.artifactId}</warName>
<archive>
<addMavenDescriptor>false</addMavenDescriptor>
</archive>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<!-- Eclipse插件 --> <!-- Eclipse插件 -->
<plugin> <plugin>

View File

@@ -10,7 +10,7 @@ import com.jeesite.modules.test.entity.TestDataChild;
/** /**
* 测试数据DAO接口 * 测试数据DAO接口
* @author ThinkGem * @author ThinkGem
* @version 2018-01-31 * @version 2018-02-05
*/ */
@MyBatisDao @MyBatisDao
public interface TestDataChildDao extends CrudDao<TestDataChild> { public interface TestDataChildDao extends CrudDao<TestDataChild> {

View File

@@ -10,7 +10,7 @@ import com.jeesite.modules.test.entity.TestData;
/** /**
* 测试数据DAO接口 * 测试数据DAO接口
* @author ThinkGem * @author ThinkGem
* @version 2018-01-31 * @version 2018-02-05
*/ */
@MyBatisDao @MyBatisDao
public interface TestDataDao extends CrudDao<TestData> { public interface TestDataDao extends CrudDao<TestData> {

View File

@@ -22,7 +22,7 @@ import com.jeesite.common.mybatis.mapper.query.QueryType;
/** /**
* 测试数据Entity * 测试数据Entity
* @author ThinkGem * @author ThinkGem
* @version 2018-01-31 * @version 2018-02-05
*/ */
@Table(name="test_data", alias="a", columns={ @Table(name="test_data", alias="a", columns={
@Column(name="id", attrName="id", label="编号", isPK=true), @Column(name="id", attrName="id", label="编号", isPK=true),
@@ -37,7 +37,7 @@ import com.jeesite.common.mybatis.mapper.query.QueryType;
@Column(name="test_user_code", attrName="testUser.userCode", label="用户选择"), @Column(name="test_user_code", attrName="testUser.userCode", label="用户选择"),
@Column(name="test_office_code", attrName="testOffice.officeCode", label="部门选择"), @Column(name="test_office_code", attrName="testOffice.officeCode", label="部门选择"),
@Column(name="test_area_code", attrName="testAreaCode", label="区域选择"), @Column(name="test_area_code", attrName="testAreaCode", label="区域选择"),
@Column(name="test_area_name", attrName="testAreaName", label="区域名称", isQuery=false), @Column(name="test_area_name", attrName="testAreaName", label="区域名称"),
@Column(includeEntity=DataEntity.class), @Column(includeEntity=DataEntity.class),
}, joinTable={ }, joinTable={
@JoinTable(type=Type.LEFT_JOIN, entity=User.class, attrName="testUser", alias="u10", @JoinTable(type=Type.LEFT_JOIN, entity=User.class, attrName="testUser", alias="u10",

View File

@@ -20,7 +20,7 @@ import com.jeesite.common.mybatis.mapper.query.QueryType;
/** /**
* 测试数据Entity * 测试数据Entity
* @author ThinkGem * @author ThinkGem
* @version 2018-01-31 * @version 2018-02-05
*/ */
@Table(name="test_data_child", alias="a", columns={ @Table(name="test_data_child", alias="a", columns={
@Column(name="id", attrName="id", label="编号", isPK=true), @Column(name="id", attrName="id", label="编号", isPK=true),

View File

@@ -20,7 +20,7 @@ import com.jeesite.modules.test.dao.TestDataChildDao;
/** /**
* 测试数据Service * 测试数据Service
* @author ThinkGem * @author ThinkGem
* @version 2018-01-31 * @version 2018-02-05
*/ */
@Service @Service
@Transactional(readOnly=true) @Transactional(readOnly=true)

View File

@@ -26,7 +26,7 @@ import com.jeesite.modules.test.service.TestDataService;
/** /**
* 测试数据Controller * 测试数据Controller
* @author ThinkGem * @author ThinkGem
* @version 2018-01-31 * @version 2018-02-05
*/ */
@Controller @Controller
@RequestMapping(value = "${adminPath}/test/testData") @RequestMapping(value = "${adminPath}/test/testData")

View File

@@ -19,7 +19,7 @@
<label class="control-label col-sm-4" title=""> <label class="control-label col-sm-4" title="">
<span class="required hide">*</span> 单行文本:<i class="fa icon-question hide"></i></label> <span class="required hide">*</span> 单行文本:<i class="fa icon-question hide"></i></label>
<div class="col-sm-8"> <div class="col-sm-8">
<#form:input path="testInput" maxlength="200" class="form-control "/> <#form:input path="testInput" maxlength="200" class="form-control"/>
</div> </div>
</div> </div>
</div> </div>
@@ -30,7 +30,7 @@
<label class="control-label col-sm-2" title=""> <label class="control-label col-sm-2" title="">
<span class="required hide">*</span> 多行文本:<i class="fa icon-question hide"></i></label> <span class="required hide">*</span> 多行文本:<i class="fa icon-question hide"></i></label>
<div class="col-sm-10"> <div class="col-sm-10">
<#form:textarea path="testTextarea" rows="4" maxlength="200" class="form-control "/> <#form:textarea path="testTextarea" rows="4" maxlength="200" class="form-control"/>
</div> </div>
</div> </div>
</div> </div>
@@ -41,7 +41,7 @@
<label class="control-label col-sm-4" title=""> <label class="control-label col-sm-4" title="">
<span class="required hide">*</span> 下拉框:<i class="fa icon-question hide"></i></label> <span class="required hide">*</span> 下拉框:<i class="fa icon-question hide"></i></label>
<div class="col-sm-8"> <div class="col-sm-8">
<#form:select path="testSelect" dictType="sys_menu_type" blankOption="true" class="form-control " /> <#form:select path="testSelect" dictType="sys_menu_type" blankOption="true" class="form-control" />
</div> </div>
</div> </div>
</div> </div>
@@ -50,7 +50,7 @@
<label class="control-label col-sm-4" title=""> <label class="control-label col-sm-4" title="">
<span class="required hide">*</span> 下拉多选:<i class="fa icon-question hide"></i></label> <span class="required hide">*</span> 下拉多选:<i class="fa icon-question hide"></i></label>
<div class="col-sm-8"> <div class="col-sm-8">
<#form:select path="testSelectMultiple" dictType="sys_menu_type" multiple="true" blankOption="true" class="form-control required" /> <#form:select path="testSelectMultiple" dictType="sys_menu_type" multiple="true" blankOption="true" class="form-control" />
</div> </div>
</div> </div>
</div> </div>
@@ -61,7 +61,7 @@
<label class="control-label col-sm-4" title=""> <label class="control-label col-sm-4" title="">
<span class="required hide">*</span> 单选框:<i class="fa icon-question hide"></i></label> <span class="required hide">*</span> 单选框:<i class="fa icon-question hide"></i></label>
<div class="col-sm-8"> <div class="col-sm-8">
<#form:radio path="testRadio" dictType="sys_menu_type" class="form-control " /> <#form:radio path="testRadio" dictType="sys_menu_type" class="form-control" />
</div> </div>
</div> </div>
</div> </div>
@@ -70,7 +70,7 @@
<label class="control-label col-sm-4" title=""> <label class="control-label col-sm-4" title="">
<span class="required hide">*</span> 复选框:<i class="fa icon-question hide"></i></label> <span class="required hide">*</span> 复选框:<i class="fa icon-question hide"></i></label>
<div class="col-sm-8"> <div class="col-sm-8">
<#form:checkbox path="testCheckbox" dictType="sys_menu_type" class="form-control " /> <#form:checkbox path="testCheckbox" dictType="sys_menu_type" class="form-control" />
</div> </div>
</div> </div>
</div> </div>
@@ -81,7 +81,7 @@
<label class="control-label col-sm-4" title=""> <label class="control-label col-sm-4" title="">
<span class="required ">*</span> 日期选择:<i class="fa icon-question hide"></i></label> <span class="required ">*</span> 日期选择:<i class="fa icon-question hide"></i></label>
<div class="col-sm-8"> <div class="col-sm-8">
<#form:input path="testDate" readonly="true" maxlength="20" class="form-control Wdate required " <#form:input path="testDate" readonly="true" maxlength="20" class="form-control Wdate required"
dataFormat="date" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/> dataFormat="date" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
</div> </div>
</div> </div>
@@ -91,7 +91,7 @@
<label class="control-label col-sm-4" title=""> <label class="control-label col-sm-4" title="">
<span class="required ">*</span> 日期时间:<i class="fa icon-question hide"></i></label> <span class="required ">*</span> 日期时间:<i class="fa icon-question hide"></i></label>
<div class="col-sm-8"> <div class="col-sm-8">
<#form:input path="testDatetime" readonly="true" maxlength="20" class="form-control Wdate required " <#form:input path="testDatetime" readonly="true" maxlength="20" class="form-control Wdate required"
dataFormat="datetime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:false});"/> dataFormat="datetime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:false});"/>
</div> </div>
</div> </div>
@@ -106,7 +106,7 @@
<#form:treeselect id="testUser" title="用户" <#form:treeselect id="testUser" title="用户"
path="testUser.userCode" labelPath="testUser.userName" path="testUser.userCode" labelPath="testUser.userName"
url="${ctx}/sys/office/treeData?isLoadUser=true" url="${ctx}/sys/office/treeData?isLoadUser=true"
class=" " allowClear="true"/> class="" allowClear="true"/>
</div> </div>
</div> </div>
</div> </div>
@@ -118,7 +118,7 @@
<#form:treeselect id="testOffice" title="部门" <#form:treeselect id="testOffice" title="部门"
path="testOffice.officeCode" labelPath="testOffice.officeName" path="testOffice.officeCode" labelPath="testOffice.officeName"
url="${ctx}/sys/office/treeData" url="${ctx}/sys/office/treeData"
class=" " allowClear="true"/> class="" allowClear="true"/>
</div> </div>
</div> </div>
</div> </div>
@@ -132,7 +132,7 @@
<#form:treeselect id="testAreaCode" title="区域" <#form:treeselect id="testAreaCode" title="区域"
path="testAreaCode" labelPath="testAreaName" path="testAreaCode" labelPath="testAreaName"
url="${ctx}/sys/area/treeData" url="${ctx}/sys/area/treeData"
class=" " allowClear="true"/> class="" allowClear="true"/>
</div> </div>
</div> </div>
</div> </div>
@@ -143,7 +143,7 @@
<label class="control-label col-sm-2" title=""> <label class="control-label col-sm-2" title="">
<span class="required hide">*</span> 备注信息:<i class="fa icon-question hide"></i></label> <span class="required hide">*</span> 备注信息:<i class="fa icon-question hide"></i></label>
<div class="col-sm-10"> <div class="col-sm-10">
<#form:textarea path="remarks" rows="4" maxlength="500" class="form-control "/> <#form:textarea path="remarks" rows="4" maxlength="500" class="form-control"/>
</div> </div>
</div> </div>
</div> </div>
@@ -205,7 +205,7 @@ $("#testDataChildDataGrid").dataGrid({
{header:'状态', name:'status', editable:true, hidden:true}, {header:'状态', name:'status', editable:true, hidden:true},
{header:'主键', name:'id', editable:true, hidden:true}, {header:'主键', name:'id', editable:true, hidden:true},
{header:'排序号', name:'testSort', width:150, editable:true, edittype:'text', editoptions:{'maxlength':'11', 'class':'form-control digits'}}, {header:'排序号', name:'testSort', width:150, editable:true, edittype:'text', editoptions:{'maxlength':'11', 'class':'form-control digits'}},
{header:'父表主键', name:'testDataId.id', width:150, editable:true, edittype:'text', editoptions:{'maxlength':'64', 'class':'form-control'}}, {header:'父表主键', name:'testDataId.id', editable:true, hidden:true},
{header:'单行文本', name:'testInput', width:150, editable:true, edittype:'text', editoptions:{'maxlength':'200', 'class':'form-control'}}, {header:'单行文本', name:'testInput', width:150, editable:true, edittype:'text', editoptions:{'maxlength':'200', 'class':'form-control'}},
{header:'多行文本', name:'testTextarea', width:150, editable:true, edittype:'textarea', editoptions:{'maxlength':'200', 'class':'form-control', 'rows':'1'}}, {header:'多行文本', name:'testTextarea', width:150, editable:true, edittype:'textarea', editoptions:{'maxlength':'200', 'class':'form-control', 'rows':'1'}},
{header:'下拉框', name:'testSelect', width:100, {header:'下拉框', name:'testSelect', width:100,
@@ -218,7 +218,7 @@ $("#testDataChildDataGrid").dataGrid({
}, },
{header:'下拉多选', name:'testSelectMultiple', width:100, {header:'下拉多选', name:'testSelectMultiple', width:100,
editable:true, edittype:'select', editoptions:{multiple:true, 'class':'form-control', editable:true, edittype:'select', editoptions:{multiple:true, 'class':'form-control',
items: $.merge([{dictLabel:'&nbsp;',dictValue:''}], ${@DictUtils.getDictListJson('sys_menu_type')}), items: $.merge([], ${@DictUtils.getDictListJson('sys_menu_type')}),
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){ itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
$(element).select2().on("change",function(){$(this).valid()}); $(element).select2().on("change",function(){$(this).valid()});
} }
@@ -261,7 +261,7 @@ $("#testDataChildDataGrid").dataGrid({
return js.val(row, 'testUser.userCode')+'|'+js.val(row, 'testUser.userName'); return js.val(row, 'testUser.userCode')+'|'+js.val(row, 'testUser.userName');
}, editable: true, edittype: "custom", editoptions: { }, editable: true, edittype: "custom", editoptions: {
custom_element: function(val, editOptions) { custom_element: function(val, editOptions) {
return template('treeselectTpl', { return js.template('treeselectTpl', {
id: 'user_'+editOptions.id, title: '用户', id: 'user_'+editOptions.id, title: '用户',
name: 'testUser.userCode', value: val.split('|')[0], name: 'testUser.userCode', value: val.split('|')[0],
labelName: 'testUser.userName', labelValue: val.split('|')[1], labelName: 'testUser.userName', labelValue: val.split('|')[1],
@@ -275,7 +275,7 @@ $("#testDataChildDataGrid").dataGrid({
return js.val(row, 'testOffice.officeCode')+'|'+js.val(row, 'testOffice.officeName'); return js.val(row, 'testOffice.officeCode')+'|'+js.val(row, 'testOffice.officeName');
}, editable: true, edittype: "custom", editoptions: { }, editable: true, edittype: "custom", editoptions: {
custom_element: function(val, editOptions) { custom_element: function(val, editOptions) {
return template('treeselectTpl', { return js.template('treeselectTpl', {
id: 'office_'+editOptions.id, title: '部门', id: 'office_'+editOptions.id, title: '部门',
name: 'testOffice.officeCode', value: val.split('|')[0], name: 'testOffice.officeCode', value: val.split('|')[0],
labelName: 'testOffice.officeName', labelValue: val.split('|')[1], labelName: 'testOffice.officeName', labelValue: val.split('|')[1],
@@ -289,7 +289,7 @@ $("#testDataChildDataGrid").dataGrid({
return js.val(row, 'testAreaCode')+'|'+js.val(row, 'testAreaName'); return js.val(row, 'testAreaCode')+'|'+js.val(row, 'testAreaName');
}, editable: true, edittype: "custom", editoptions: { }, editable: true, edittype: "custom", editoptions: {
custom_element: function(val, editOptions) { custom_element: function(val, editOptions) {
return template('treeselectTpl', { return js.template('treeselectTpl', {
id: 'area_'+editOptions.id, title: '区域', id: 'area_'+editOptions.id, title: '区域',
name: 'testAreaCode', value: val.split('|')[0], name: 'testAreaCode', value: val.split('|')[0],
labelName: 'testAreaName', labelValue: val.split('|')[1], labelName: 'testAreaName', labelValue: val.split('|')[1],
@@ -298,7 +298,6 @@ $("#testDataChildDataGrid").dataGrid({
} }
} }
}, },
{header:'区域名称', name:'testAreaName', width:150, editable:true, edittype:'text', editoptions:{'maxlength':'100', 'class':'form-control'}},
{header:'操作', name:'actions', width:80, sortable:false, fixed:true, formatter: function(val, obj, row, act){ {header:'操作', name:'actions', width:80, sortable:false, fixed:true, formatter: function(val, obj, row, act){
var actions = []; var actions = [];
if (val == 'new'){ if (val == 'new'){