每天进步一点点。
This commit is contained in:
@@ -15,7 +15,7 @@ CREATE TABLE test_data
|
||||
(
|
||||
id varchar2(64) NOT NULL,
|
||||
test_input varchar2(200),
|
||||
test_textarea varchar2(200),
|
||||
test_textarea nvarchar2(200),
|
||||
test_select varchar2(10),
|
||||
test_select_multiple varchar2(200),
|
||||
test_radio varchar2(10),
|
||||
@@ -43,7 +43,7 @@ CREATE TABLE test_data_child
|
||||
test_sort number(10,0),
|
||||
test_data_id varchar2(64),
|
||||
test_input varchar2(200),
|
||||
test_textarea varchar2(200),
|
||||
test_textarea nvarchar2(200),
|
||||
test_select varchar2(10),
|
||||
test_select_multiple varchar2(200),
|
||||
test_radio varchar2(10),
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<category_index>0</category_index>
|
||||
<zoom>1.0</zoom>
|
||||
<x>0</x>
|
||||
<y>91</y>
|
||||
<y>0</y>
|
||||
<default_color>
|
||||
<r>128</r>
|
||||
<g>128</g>
|
||||
@@ -840,7 +840,7 @@
|
||||
<type>integer</type>
|
||||
</word>
|
||||
<word>
|
||||
<id>68b1f859bfea8bf1733964c0ccaf826fc05f3b1f</id>
|
||||
<id>2fed92437d28f1427e913aba1251fe0807c7b209</id>
|
||||
<length>200</length>
|
||||
<decimal>null</decimal>
|
||||
<array>false</array>
|
||||
@@ -853,7 +853,7 @@
|
||||
<description></description>
|
||||
<logical_name>多行文本</logical_name>
|
||||
<physical_name>test_textarea</physical_name>
|
||||
<type>varchar(n)</type>
|
||||
<type>nvarchar(n)</type>
|
||||
</word>
|
||||
<word>
|
||||
<id>2eda719a62fb7e1d3face62555046d938abddda9</id>
|
||||
@@ -1257,13 +1257,13 @@
|
||||
</sequence>
|
||||
</normal_column>
|
||||
<normal_column>
|
||||
<word_id>68b1f859bfea8bf1733964c0ccaf826fc05f3b1f</word_id>
|
||||
<word_id>2fed92437d28f1427e913aba1251fe0807c7b209</word_id>
|
||||
<id>693f8af2fe6cf45255b6f2bc7e9077f3630c3dd8</id>
|
||||
<description></description>
|
||||
<unique_key_name></unique_key_name>
|
||||
<logical_name></logical_name>
|
||||
<physical_name></physical_name>
|
||||
<type>varchar(n)</type>
|
||||
<type>nvarchar(n)</type>
|
||||
<constraint></constraint>
|
||||
<default_value></default_value>
|
||||
<auto_increment>false</auto_increment>
|
||||
@@ -1717,13 +1717,13 @@
|
||||
</sequence>
|
||||
</normal_column>
|
||||
<normal_column>
|
||||
<word_id>68b1f859bfea8bf1733964c0ccaf826fc05f3b1f</word_id>
|
||||
<word_id>2fed92437d28f1427e913aba1251fe0807c7b209</word_id>
|
||||
<id>8050d948828b16267482e9e3716219321f206b81</id>
|
||||
<description></description>
|
||||
<unique_key_name></unique_key_name>
|
||||
<logical_name></logical_name>
|
||||
<physical_name></physical_name>
|
||||
<type>varchar(n)</type>
|
||||
<type>nvarchar(n)</type>
|
||||
<constraint></constraint>
|
||||
<default_value></default_value>
|
||||
<auto_increment>false</auto_increment>
|
||||
|
||||
@@ -10,7 +10,7 @@ import com.jeesite.modules.test.entity.TestDataChild;
|
||||
/**
|
||||
* 测试数据DAO接口
|
||||
* @author ThinkGem
|
||||
* @version 2018-01-30
|
||||
* @version 2018-01-31
|
||||
*/
|
||||
@MyBatisDao
|
||||
public interface TestDataChildDao extends CrudDao<TestDataChild> {
|
||||
|
||||
@@ -10,7 +10,7 @@ import com.jeesite.modules.test.entity.TestData;
|
||||
/**
|
||||
* 测试数据DAO接口
|
||||
* @author ThinkGem
|
||||
* @version 2018-01-30
|
||||
* @version 2018-01-31
|
||||
*/
|
||||
@MyBatisDao
|
||||
public interface TestDataDao extends CrudDao<TestData> {
|
||||
|
||||
@@ -8,9 +8,9 @@ import java.util.Date;
|
||||
import com.jeesite.common.mybatis.annotation.JoinTable;
|
||||
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import com.jeesite.modules.sys.entity.User;
|
||||
import com.jeesite.modules.sys.entity.Office;
|
||||
import com.jeesite.common.entity.Extend;
|
||||
import java.util.List;
|
||||
import com.jeesite.common.collect.ListUtils;
|
||||
|
||||
@@ -22,7 +22,7 @@ import com.jeesite.common.mybatis.mapper.query.QueryType;
|
||||
/**
|
||||
* 测试数据Entity
|
||||
* @author ThinkGem
|
||||
* @version 2018-01-30
|
||||
* @version 2018-01-31
|
||||
*/
|
||||
@Table(name="test_data", alias="a", columns={
|
||||
@Column(name="id", attrName="id", label="编号", isPK=true),
|
||||
@@ -39,7 +39,6 @@ import com.jeesite.common.mybatis.mapper.query.QueryType;
|
||||
@Column(name="test_area_code", attrName="testAreaCode", label="区域选择"),
|
||||
@Column(name="test_area_name", attrName="testAreaName", label="区域名称", isQuery=false),
|
||||
@Column(includeEntity=DataEntity.class),
|
||||
@Column(includeEntity=Extend.class, attrName="extend"),
|
||||
}, joinTable={
|
||||
@JoinTable(type=Type.LEFT_JOIN, entity=User.class, attrName="testUser", alias="u10",
|
||||
on="u10.user_code = a.test_user_code", columns={
|
||||
@@ -68,7 +67,6 @@ public class TestData extends DataEntity<TestData> {
|
||||
private Office testOffice; // 部门选择
|
||||
private String testAreaCode; // 区域选择
|
||||
private String testAreaName; // 区域名称
|
||||
private Extend extend; // 扩展字段
|
||||
private List<TestDataChild> testDataChildList = ListUtils.newArrayList(); // 子表列表
|
||||
|
||||
public TestData() {
|
||||
@@ -134,6 +132,7 @@ public class TestData extends DataEntity<TestData> {
|
||||
}
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@NotNull(message="日期选择不能为空")
|
||||
public Date getTestDate() {
|
||||
return testDate;
|
||||
}
|
||||
@@ -143,6 +142,7 @@ public class TestData extends DataEntity<TestData> {
|
||||
}
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@NotNull(message="日期时间不能为空")
|
||||
public Date getTestDatetime() {
|
||||
return testDatetime;
|
||||
}
|
||||
@@ -185,14 +185,6 @@ public class TestData extends DataEntity<TestData> {
|
||||
this.testAreaName = testAreaName;
|
||||
}
|
||||
|
||||
public Extend getExtend() {
|
||||
return extend;
|
||||
}
|
||||
|
||||
public void setExtend(Extend extend) {
|
||||
this.extend = extend;
|
||||
}
|
||||
|
||||
public Date getTestDate_gte() {
|
||||
return sqlMap.getWhere().getValue("test_date", QueryType.GTE);
|
||||
}
|
||||
|
||||
@@ -8,6 +8,9 @@ import java.util.Date;
|
||||
import com.jeesite.common.mybatis.annotation.JoinTable;
|
||||
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import com.jeesite.modules.sys.entity.User;
|
||||
import com.jeesite.modules.sys.entity.Office;
|
||||
|
||||
import com.jeesite.common.entity.DataEntity;
|
||||
import com.jeesite.common.mybatis.annotation.Column;
|
||||
@@ -17,31 +20,42 @@ import com.jeesite.common.mybatis.mapper.query.QueryType;
|
||||
/**
|
||||
* 测试数据Entity
|
||||
* @author ThinkGem
|
||||
* @version 2018-01-30
|
||||
* @version 2018-01-31
|
||||
*/
|
||||
@Table(name="test_data_child", alias="a", columns={
|
||||
@Column(name="id", attrName="id", label="编号", isPK=true),
|
||||
@Column(name="test_sort", attrName="testSort", label="排序号"),
|
||||
@Column(name="test_data_id", attrName="testData.id", label="父表主键"),
|
||||
@Column(name="test_input", attrName="testInput", label="单行文本"),
|
||||
@Column(name="test_textarea", attrName="testTextarea", label="多行文本"),
|
||||
@Column(name="test_data_id", attrName="testDataId.id", label="父表主键"),
|
||||
@Column(name="test_input", attrName="testInput", label="单行文本", queryType=QueryType.LIKE),
|
||||
@Column(name="test_textarea", attrName="testTextarea", label="多行文本", queryType=QueryType.LIKE),
|
||||
@Column(name="test_select", attrName="testSelect", label="下拉框"),
|
||||
@Column(name="test_select_multiple", attrName="testSelectMultiple", label="下拉多选"),
|
||||
@Column(name="test_radio", attrName="testRadio", label="单选框"),
|
||||
@Column(name="test_checkbox", attrName="testCheckbox", label="复选框"),
|
||||
@Column(name="test_date", attrName="testDate", label="日期选择"),
|
||||
@Column(name="test_datetime", attrName="testDatetime", label="日期时间"),
|
||||
@Column(name="test_user_code", attrName="testUserCode", label="用户选择"),
|
||||
@Column(name="test_office_code", attrName="testOfficeCode", label="部门选择"),
|
||||
@Column(name="test_user_code", attrName="testUser.userCode", label="用户选择"),
|
||||
@Column(name="test_office_code", attrName="testOffice.officeCode", label="部门选择"),
|
||||
@Column(name="test_area_code", attrName="testAreaCode", label="区域选择"),
|
||||
@Column(name="test_area_name", attrName="testAreaName", label="区域名称", queryType=QueryType.LIKE),
|
||||
@Column(name="test_area_name", attrName="testAreaName", label="区域名称", isQuery=false),
|
||||
}, joinTable={
|
||||
@JoinTable(type=Type.LEFT_JOIN, entity=User.class, attrName="testUser", alias="u12",
|
||||
on="u12.user_code = a.test_user_code", columns={
|
||||
@Column(name="user_code", label="用户编码", isPK=true),
|
||||
@Column(name="user_name", label="用户名称", isQuery=false),
|
||||
}),
|
||||
@JoinTable(type=Type.LEFT_JOIN, entity=Office.class, attrName="testOffice", alias="u13",
|
||||
on="u13.office_code = a.test_office_code", columns={
|
||||
@Column(name="office_code", label="部门编码", isPK=true),
|
||||
@Column(name="office_name", label="部门名称", isQuery=false),
|
||||
}),
|
||||
}, orderBy="a.id ASC"
|
||||
)
|
||||
public class TestDataChild extends DataEntity<TestDataChild> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private Integer testSort; // 排序号
|
||||
private TestData testData; // 父表主键 父类
|
||||
private Long testSort; // 排序号
|
||||
private TestData testDataId; // 父表主键 父类
|
||||
private String testInput; // 单行文本
|
||||
private String testTextarea; // 多行文本
|
||||
private String testSelect; // 下拉框
|
||||
@@ -50,8 +64,8 @@ public class TestDataChild extends DataEntity<TestDataChild> {
|
||||
private String testCheckbox; // 复选框
|
||||
private Date testDate; // 日期选择
|
||||
private Date testDatetime; // 日期时间
|
||||
private String testUserCode; // 用户选择
|
||||
private String testOfficeCode; // 部门选择
|
||||
private User testUser; // 用户选择
|
||||
private Office testOffice; // 部门选择
|
||||
private String testAreaCode; // 区域选择
|
||||
private String testAreaName; // 区域名称
|
||||
|
||||
@@ -60,25 +74,25 @@ public class TestDataChild extends DataEntity<TestDataChild> {
|
||||
}
|
||||
|
||||
|
||||
public TestDataChild(TestData testData){
|
||||
this.testData = testData;
|
||||
public TestDataChild(TestData testDataId){
|
||||
this.testDataId = testDataId;
|
||||
}
|
||||
|
||||
public Integer getTestSort() {
|
||||
public Long getTestSort() {
|
||||
return testSort;
|
||||
}
|
||||
|
||||
public void setTestSort(Integer testSort) {
|
||||
public void setTestSort(Long testSort) {
|
||||
this.testSort = testSort;
|
||||
}
|
||||
|
||||
@Length(min=0, max=64, message="父表主键长度不能超过 64 个字符")
|
||||
public TestData getTestData() {
|
||||
return testData;
|
||||
public TestData getTestDataId() {
|
||||
return testDataId;
|
||||
}
|
||||
|
||||
public void setTestData(TestData testData) {
|
||||
this.testData = testData;
|
||||
public void setTestDataId(TestData testDataId) {
|
||||
this.testDataId = testDataId;
|
||||
}
|
||||
|
||||
@Length(min=0, max=200, message="单行文本长度不能超过 200 个字符")
|
||||
@@ -136,6 +150,7 @@ public class TestDataChild extends DataEntity<TestDataChild> {
|
||||
}
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@NotNull(message="日期选择不能为空")
|
||||
public Date getTestDate() {
|
||||
return testDate;
|
||||
}
|
||||
@@ -145,6 +160,7 @@ public class TestDataChild extends DataEntity<TestDataChild> {
|
||||
}
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@NotNull(message="日期时间不能为空")
|
||||
public Date getTestDatetime() {
|
||||
return testDatetime;
|
||||
}
|
||||
@@ -153,22 +169,20 @@ public class TestDataChild extends DataEntity<TestDataChild> {
|
||||
this.testDatetime = testDatetime;
|
||||
}
|
||||
|
||||
@Length(min=0, max=64, message="用户选择长度不能超过 64 个字符")
|
||||
public String getTestUserCode() {
|
||||
return testUserCode;
|
||||
public User getTestUser() {
|
||||
return testUser;
|
||||
}
|
||||
|
||||
public void setTestUserCode(String testUserCode) {
|
||||
this.testUserCode = testUserCode;
|
||||
public void setTestUser(User testUser) {
|
||||
this.testUser = testUser;
|
||||
}
|
||||
|
||||
@Length(min=0, max=64, message="部门选择长度不能超过 64 个字符")
|
||||
public String getTestOfficeCode() {
|
||||
return testOfficeCode;
|
||||
public Office getTestOffice() {
|
||||
return testOffice;
|
||||
}
|
||||
|
||||
public void setTestOfficeCode(String testOfficeCode) {
|
||||
this.testOfficeCode = testOfficeCode;
|
||||
public void setTestOffice(Office testOffice) {
|
||||
this.testOffice = testOffice;
|
||||
}
|
||||
|
||||
@Length(min=0, max=64, message="区域选择长度不能超过 64 个字符")
|
||||
@@ -189,4 +203,36 @@ public class TestDataChild extends DataEntity<TestDataChild> {
|
||||
this.testAreaName = testAreaName;
|
||||
}
|
||||
|
||||
public Date getTestDate_gte() {
|
||||
return sqlMap.getWhere().getValue("test_date", QueryType.GTE);
|
||||
}
|
||||
|
||||
public void setTestDate_gte(Date testDate) {
|
||||
sqlMap.getWhere().and("test_date", QueryType.GTE, testDate);
|
||||
}
|
||||
|
||||
public Date getTestDate_lte() {
|
||||
return sqlMap.getWhere().getValue("test_date", QueryType.LTE);
|
||||
}
|
||||
|
||||
public void setTestDate_lte(Date testDate) {
|
||||
sqlMap.getWhere().and("test_date", QueryType.LTE, testDate);
|
||||
}
|
||||
|
||||
public Date getTestDatetime_gte() {
|
||||
return sqlMap.getWhere().getValue("test_datetime", QueryType.GTE);
|
||||
}
|
||||
|
||||
public void setTestDatetime_gte(Date testDatetime) {
|
||||
sqlMap.getWhere().and("test_datetime", QueryType.GTE, testDatetime);
|
||||
}
|
||||
|
||||
public Date getTestDatetime_lte() {
|
||||
return sqlMap.getWhere().getValue("test_datetime", QueryType.LTE);
|
||||
}
|
||||
|
||||
public void setTestDatetime_lte(Date testDatetime) {
|
||||
sqlMap.getWhere().and("test_datetime", QueryType.LTE, testDatetime);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
*/
|
||||
package com.jeesite.modules.test.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.jeesite.common.entity.Page;
|
||||
import com.jeesite.common.service.CrudService;
|
||||
import com.jeesite.modules.test.entity.TestDataChild;
|
||||
import com.jeesite.modules.test.dao.TestDataChildDao;
|
||||
|
||||
/**
|
||||
* 测试子表Service
|
||||
* @author ThinkGem
|
||||
* @version 2018-01-31
|
||||
*/
|
||||
@Service
|
||||
@Transactional(readOnly=true)
|
||||
public class TestDataChildService extends CrudService<TestDataChildDao, TestDataChild> {
|
||||
|
||||
/**
|
||||
* 获取单条数据
|
||||
* @param testDataChild
|
||||
* @return
|
||||
*/
|
||||
public TestDataChild get(TestDataChild testDataChild) {
|
||||
return super.get(testDataChild);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分页数据
|
||||
* @param page 分页对象
|
||||
* @param testDataChild
|
||||
* @return
|
||||
*/
|
||||
public Page<TestDataChild> findPage(Page<TestDataChild> page, TestDataChild testDataChild) {
|
||||
return super.findPage(page, testDataChild);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存数据(插入或更新)
|
||||
* @param testDataChild
|
||||
*/
|
||||
@Transactional(readOnly=false)
|
||||
public void save(TestDataChild testDataChild) {
|
||||
super.save(testDataChild);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新状态
|
||||
* @param testDataChild
|
||||
*/
|
||||
@Transactional(readOnly=false)
|
||||
public void updateStatus(TestDataChild testDataChild) {
|
||||
super.updateStatus(testDataChild);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
* @param testDataChild
|
||||
*/
|
||||
@Transactional(readOnly=false)
|
||||
public void delete(TestDataChild testDataChild) {
|
||||
super.delete(testDataChild);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ import com.jeesite.modules.test.dao.TestDataChildDao;
|
||||
/**
|
||||
* 测试数据Service
|
||||
* @author ThinkGem
|
||||
* @version 2018-01-30
|
||||
* @version 2018-01-31
|
||||
*/
|
||||
@Service
|
||||
@Transactional(readOnly=true)
|
||||
@@ -68,7 +68,7 @@ public class TestDataService extends CrudService<TestDataDao, TestData> {
|
||||
// 保存 TestData子表
|
||||
for (TestDataChild testDataChild : testData.getTestDataChildList()){
|
||||
if (!TestDataChild.STATUS_DELETE.equals(testDataChild.getStatus())){
|
||||
testDataChild.setTestData(testData);
|
||||
testDataChild.setTestDataId(testData);
|
||||
if (testDataChild.getIsNewRecord()){
|
||||
testDataChild.preInsert();
|
||||
testDataChildDao.insert(testDataChild);
|
||||
@@ -99,7 +99,7 @@ public class TestDataService extends CrudService<TestDataDao, TestData> {
|
||||
public void delete(TestData testData) {
|
||||
super.delete(testData);
|
||||
TestDataChild testDataChild = new TestDataChild();
|
||||
testDataChild.setTestData(testData);
|
||||
testDataChild.setTestDataId(testData);
|
||||
testDataChildDao.delete(testDataChild);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
*/
|
||||
package com.jeesite.modules.test.web;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.entity.Page;
|
||||
import com.jeesite.common.web.BaseController;
|
||||
import com.jeesite.modules.sys.utils.UserUtils;
|
||||
import com.jeesite.modules.test.entity.TestDataChild;
|
||||
import com.jeesite.modules.test.service.TestDataChildService;
|
||||
|
||||
/**
|
||||
* 测试子表Controller
|
||||
* @author ThinkGem
|
||||
* @version 2018-01-31
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/test/testDataChild")
|
||||
public class TestDataChildController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private TestDataChildService testDataChildService;
|
||||
|
||||
/**
|
||||
* 获取数据
|
||||
*/
|
||||
@ModelAttribute
|
||||
public TestDataChild get(String id, boolean isNewRecord) {
|
||||
return testDataChildService.get(id, isNewRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
@RequiresPermissions("test:testDataChild:view")
|
||||
@RequestMapping(value = {"list", ""})
|
||||
public String list(TestDataChild testDataChild, Model model) {
|
||||
model.addAttribute("testDataChild", testDataChild);
|
||||
return "modules/test/testDataChildList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表数据
|
||||
*/
|
||||
@RequiresPermissions("test:testDataChild:view")
|
||||
@RequestMapping(value = "listData")
|
||||
@ResponseBody
|
||||
public Page<TestDataChild> listData(TestDataChild testDataChild, HttpServletRequest request, HttpServletResponse response) {
|
||||
Page<TestDataChild> page = testDataChildService.findPage(new Page<TestDataChild>(request, response), testDataChild);
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看编辑表单
|
||||
*/
|
||||
@RequiresPermissions("test:testDataChild:view")
|
||||
@RequestMapping(value = "form")
|
||||
public String form(TestDataChild testDataChild, Model model) {
|
||||
model.addAttribute("testDataChild", testDataChild);
|
||||
return "modules/test/testDataChildForm";
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存数据
|
||||
*/
|
||||
@RequiresPermissions("test:testDataChild:edit")
|
||||
@PostMapping(value = "save")
|
||||
@ResponseBody
|
||||
public String save(@Validated TestDataChild testDataChild) {
|
||||
testDataChildService.save(testDataChild);
|
||||
return renderResult(Global.TRUE, "保存数据成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*/
|
||||
@RequiresPermissions("test:testDataChild:edit")
|
||||
@RequestMapping(value = "delete")
|
||||
@ResponseBody
|
||||
public String delete(TestDataChild testDataChild) {
|
||||
testDataChildService.delete(testDataChild);
|
||||
return renderResult(Global.TRUE, "删除数据成功!");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -26,7 +26,7 @@ import com.jeesite.modules.test.service.TestDataService;
|
||||
/**
|
||||
* 测试数据Controller
|
||||
* @author ThinkGem
|
||||
* @version 2018-01-30
|
||||
* @version 2018-01-31
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/test/testData")
|
||||
|
||||
@@ -7,20 +7,20 @@
|
||||
jdbc:
|
||||
|
||||
# Mysql 数据库配置
|
||||
# type: mysql
|
||||
# driver: com.mysql.jdbc.Driver
|
||||
# url: jdbc:mysql://127.0.0.1:3306/jeesite4?useUnicode=true&characterEncoding=utf-8
|
||||
# username: root
|
||||
# password: 123456
|
||||
# testSql: SELECT 1
|
||||
type: mysql
|
||||
driver: com.mysql.jdbc.Driver
|
||||
url: jdbc:mysql://127.0.0.1:3306/jeesite4?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull
|
||||
username: root
|
||||
password: 123456
|
||||
testSql: SELECT 1
|
||||
|
||||
# Oracle 数据库配置
|
||||
type: oracle
|
||||
driver: oracle.jdbc.driver.OracleDriver
|
||||
url: jdbc:oracle:thin:@127.0.0.1:1521/orcl
|
||||
username: jeesite
|
||||
password: jeesite
|
||||
testSql: SELECT 1 FROM DUAL
|
||||
# type: oracle
|
||||
# driver: oracle.jdbc.driver.OracleDriver
|
||||
# url: jdbc:oracle:thin:@127.0.0.1:1521/orcl
|
||||
# username: jeesite
|
||||
# password: jeesite
|
||||
# testSql: SELECT 1 FROM DUAL
|
||||
|
||||
# Redis 配置
|
||||
redis:
|
||||
|
||||
@@ -12,372 +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">基本信息</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> 单行文本:<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> 多行文本:<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> 下拉框:<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> 下拉多选:<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> 单选框:<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> 复选框:<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> 日期选择:<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});"/>
|
||||
</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> 日期时间:<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});"/>
|
||||
</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> 用户选择:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:treeselect id="testUser" title="用户"
|
||||
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> 部门选择:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:treeselect id="testOffice" title="部门"
|
||||
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> 区域选择:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:treeselect id="testAreaCode" title="区域"
|
||||
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> 备注信息:<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="form-unit">扩展字段</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> 扩展 String 1:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:input path="extend.extendS1" maxlength="500" 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> 扩展 String 2:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:input path="extend.extendS2" maxlength="500" 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> 扩展 String 3:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:input path="extend.extendS3" maxlength="500" 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> 扩展 String 4:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:input path="extend.extendS4" maxlength="500" 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> 扩展 String 5:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:input path="extend.extendS5" maxlength="500" 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> 扩展 String 6:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:input path="extend.extendS6" maxlength="500" 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> 扩展 String 7:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:input path="extend.extendS7" maxlength="500" 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> 扩展 String 8:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:input path="extend.extendS8" maxlength="500" 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> 扩展 Integer 1:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:input path="extend.extendI1" maxlength="19" class="form-control digits"/>
|
||||
</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> 扩展 Integer 2:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:input path="extend.extendI2" maxlength="19" class="form-control digits"/>
|
||||
</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> 扩展 Integer 3:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:input path="extend.extendI3" maxlength="19" class="form-control digits"/>
|
||||
</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> 扩展 Integer 4:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:input path="extend.extendI4" maxlength="19" class="form-control digits"/>
|
||||
</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> 扩展 Float 1:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:input path="extend.extendF1" class="form-control number"/>
|
||||
</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> 扩展 Float 2:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:input path="extend.extendF2" class="form-control number"/>
|
||||
</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> 扩展 Float 3:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:input path="extend.extendF3" class="form-control number"/>
|
||||
</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> 扩展 Float 4:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:input path="extend.extendF4" class="form-control number"/>
|
||||
</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> 扩展 Date 1:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:input path="extend.extendD1" maxlength="6" 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> 扩展 Date 2:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:input path="extend.extendD2" maxlength="6" 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> 扩展 Date 3:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:input path="extend.extendD3" maxlength="6" 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> 扩展 Date 4:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:input path="extend.extendD4" maxlength="6" 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">图片上传:</label>
|
||||
<div class="col-sm-10">
|
||||
<#form:fileupload id="uploadImage" bizKey="${testData.id}" bizType="testData_image"
|
||||
uploadType="image" class="" readonly="false"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2">附件上传:</label>
|
||||
<div class="col-sm-10">
|
||||
<#form:fileupload id="uploadFile" bizKey="${testData.id}" bizType="testData_file"
|
||||
uploadType="all" class="" readonly="false"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="form-unit">测试数据子表</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> 增行</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> 单行文本:<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> 多行文本:<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> 下拉框:<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> 下拉多选:<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 required" />
|
||||
</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> 单选框:<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> 复选框:<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 ">*</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 required "
|
||||
dataFormat="date" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-4" title="">
|
||||
<span class="required ">*</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 required "
|
||||
dataFormat="datetime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:false});"/>
|
||||
</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> 用户选择:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:treeselect id="testUser" title="用户"
|
||||
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> 部门选择:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:treeselect id="testOffice" title="部门"
|
||||
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> 区域选择:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:treeselect id="testAreaCode" title="区域"
|
||||
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> 备注信息:<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">图片上传:</label>
|
||||
<div class="col-sm-10">
|
||||
<#form:fileupload id="uploadImage" bizKey="${testData.id}" bizType="testData_image"
|
||||
uploadType="image" class="" readonly="false"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2">附件上传:</label>
|
||||
<div class="col-sm-10">
|
||||
<#form:fileupload id="uploadFile" bizKey="${testData.id}" bizType="testData_file"
|
||||
uploadType="all" class="" readonly="false"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="form-unit">测试数据子表</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> 增行</a>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<div class="row">
|
||||
@@ -393,57 +192,146 @@
|
||||
</div>
|
||||
</div>
|
||||
<% } %>
|
||||
<script>//初始化测试数据子表DataGrid对象
|
||||
$("#testDataChildDataGrid").dataGrid({
|
||||
|
||||
data: ${toJson(testData.testDataChildList)},
|
||||
datatype: "local", // 设置本地数据
|
||||
autoGridHeight: function(){return 'auto'}, // 设置自动高度
|
||||
|
||||
// 设置数据表格列
|
||||
columnModel: [
|
||||
{header:'状态', name:'status', editable:true, hidden:false},
|
||||
{header:'主键', name:'id', editable:true, hidden:false},
|
||||
{header:'排序号', name:'testSort', width:150, editable:true, edittype:'text', editoptions:{'maxlength':'10', 'class':'form-control digits'}},
|
||||
{header:'父表主键', name:'testData.id', width:150, editable:true, edittype:'text', editoptions:{'maxlength':'64', '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:'text', editoptions:{'maxlength':'200', 'class':'form-control'}},
|
||||
{header:'下拉框', name:'testSelect', width:150, editable:true, edittype:'text', editoptions:{'maxlength':'10', 'class':'form-control'}},
|
||||
{header:'下拉多选', name:'testSelectMultiple', width:150, editable:true, edittype:'text', editoptions:{'maxlength':'200', 'class':'form-control'}},
|
||||
{header:'单选框', name:'testRadio', width:150, editable:true, edittype:'text', editoptions:{'maxlength':'10', 'class':'form-control'}},
|
||||
{header:'复选框', name:'testCheckbox', width:150, editable:true, edittype:'text', editoptions:{'maxlength':'200', 'class':'form-control'}},
|
||||
{header:'日期选择', name:'testDate', width:150, editable:true, edittype:'text', editoptions:{'maxlength':'6', 'class':'form-control'}},
|
||||
{header:'日期时间', name:'testDatetime', width:150, editable:true, edittype:'text', editoptions:{'maxlength':'6', 'class':'form-control'}},
|
||||
{header:'用户选择', name:'testUserCode', width:150, editable:true, edittype:'text', editoptions:{'maxlength':'64', 'class':'form-control'}},
|
||||
{header:'部门选择', name:'testOfficeCode', width:150, editable:true, edittype:'text', editoptions:{'maxlength':'64', 'class':'form-control'}},
|
||||
{header:'区域选择', name:'testAreaCode', width:150, editable:true, edittype:'text', editoptions:{'maxlength':'64', 'class':'form-control'}},
|
||||
{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){
|
||||
var actions = [];
|
||||
if (val == 'new'){
|
||||
actions.push('<a href="#" onclick="js.confirm(\'你确认要删除这条数据吗?\', function(){$(\'#testDataChildDataGrid\').dataGrid(\'delRowData\',\''+obj.rowId+'\')});return false;"><i class="fa fa-trash-o"></i></a> ');
|
||||
}else{
|
||||
actions.push('<a href="#" onclick="js.confirm(\'你确认要删除这条数据吗?\', 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> ');
|
||||
}
|
||||
return actions.join('');
|
||||
}, editoptions: {defaultValue: 'new'}}
|
||||
],
|
||||
|
||||
// 编辑表格参数
|
||||
editGrid: true, // 是否是编辑表格
|
||||
editGridInitRowNum: 1, // 编辑表格的初始化新增行数
|
||||
editGridAddRowBtn: $('#testDataChildDataGridAddRowBtn'), // 子表增行按钮
|
||||
editGridAddRowInitData: {id: '', status: Global.STATUS_NORMAL}, // 新增行的时候初始化的数据
|
||||
|
||||
// 编辑表格的提交数据参数
|
||||
editGridInputFormListName: 'testDataChildList', // 提交的数据列表名
|
||||
editGridInputFormListAttrs: 'status,id,testSort,testData.id,testInput,testTextarea,testSelect,testSelectMultiple,testRadio,testCheckbox,testDate,testDatetime,testUserCode,testOfficeCode,testAreaCode,testAreaName,', // 提交数据列表的属性字段
|
||||
|
||||
// 加载成功后执行事件
|
||||
ajaxSuccess: function(data){
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
<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:'排序号', 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:'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:'testSelect', width:100,
|
||||
editable:true, edittype:'select', editoptions:{'class':'form-control',
|
||||
items: $.merge([{dictLabel:' ',dictValue:''}], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
||||
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
||||
$(element).select2().on("change",function(){$(this).valid()});
|
||||
}
|
||||
}
|
||||
},
|
||||
{header:'下拉多选', name:'testSelectMultiple', width:100,
|
||||
editable:true, edittype:'select', editoptions:{multiple:true, 'class':'form-control',
|
||||
items: $.merge([{dictLabel:' ',dictValue:''}], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
||||
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
||||
$(element).select2().on("change",function(){$(this).valid()});
|
||||
}
|
||||
}
|
||||
},
|
||||
{header:'单选框', name:'testRadio', width:100,
|
||||
editable:true, edittype:'select', editoptions:{'class':'form-control',
|
||||
items: $.merge([{dictLabel:' ',dictValue:''}], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
||||
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
||||
$(element).select2().on("change",function(){$(this).valid()});
|
||||
}
|
||||
}
|
||||
},
|
||||
{header:'复选框', 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).valid()});
|
||||
}
|
||||
}
|
||||
},
|
||||
{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});
|
||||
});
|
||||
}}
|
||||
},
|
||||
{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});
|
||||
});
|
||||
}}
|
||||
},
|
||||
{header:'用户选择', 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 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:'部门选择', 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 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:'区域选择', 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 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:'区域名称', 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){
|
||||
var actions = [];
|
||||
if (val == 'new'){
|
||||
actions.push('<a href="#" onclick="js.confirm(\'你确认要删除这条数据吗?\', function(){$(\'#testDataChildDataGrid\').dataGrid(\'delRowData\',\''+obj.rowId+'\')});return false;"><i class="fa fa-trash-o"></i></a> ');
|
||||
}else{
|
||||
actions.push('<a href="#" onclick="js.confirm(\'你确认要删除这条数据吗?\', 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> ');
|
||||
}
|
||||
return actions.join('');
|
||||
}, editoptions: {defaultValue: 'new'}}
|
||||
],
|
||||
|
||||
// 编辑表格参数
|
||||
editGrid: true, // 是否是编辑表格
|
||||
editGridInitRowNum: 1, // 编辑表格的初始化新增行数
|
||||
editGridAddRowBtn: $('#testDataChildDataGridAddRowBtn'), // 子表增行按钮
|
||||
editGridAddRowInitData: {id: '', status: Global.STATUS_NORMAL}, // 新增行的时候初始化的数据
|
||||
|
||||
// 编辑表格的提交数据参数
|
||||
editGridInputFormListName: 'testDataChildList', // 提交的数据列表名
|
||||
editGridInputFormListAttrs: 'status,id,testSort,testDataId.id,testInput,testTextarea,testSelect,testSelectMultiple,testRadio,testCheckbox,testDate,testDatetime,testUser.userCode,testOffice.officeCode,testAreaCode,testAreaName,', // 提交数据列表的属性字段
|
||||
|
||||
// 加载成功后执行事件
|
||||
ajaxSuccess: function(data){
|
||||
|
||||
}
|
||||
});
|
||||
</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>
|
||||
$("#inputForm").validate({
|
||||
submitHandler: function(form){
|
||||
js.ajaxSubmitForm($(form), function(data){
|
||||
@@ -456,4 +344,4 @@ $("#inputForm").validate({
|
||||
}, "json");
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
@@ -111,7 +111,7 @@
|
||||
<button type="submit" class="btn btn-primary btn-sm">查询</button>
|
||||
<button type="reset" class="btn btn-default btn-sm">重置</button>
|
||||
</div>
|
||||
</#form:form>
|
||||
</#form:form>
|
||||
<table id="dataGrid"></table>
|
||||
<div id="dataGridPage"></div>
|
||||
</div>
|
||||
|
||||
@@ -21,8 +21,8 @@ public class InitGenData extends com.jeesite.modules.gen.db.InitGenData {
|
||||
|
||||
@Test
|
||||
public void initGenData() throws Exception{
|
||||
initGenTestData();
|
||||
initGenTreeData();
|
||||
initGenTestData();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user