From 1e329f7069fa6e7b860b2a75969b054d80579aa2 Mon Sep 17 00:00:00 2001 From: thinkgem Date: Mon, 26 Apr 2021 16:38:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9EA4=E7=BA=B8=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E7=9A=84=E8=A1=A8=E6=A0=BC=E8=A1=A8=E5=8D=95/=E5=8D=95?= =?UTF-8?q?=E6=8D=AE=E5=AE=9E=E4=BE=8B/=E8=A1=A8=E5=8D=95=E6=89=93?= =?UTF-8?q?=E5=8D=B0=E7=AD=89=E5=AE=9E=E4=BE=8B=EF=BC=9B=E4=B8=BB=E5=AD=90?= =?UTF-8?q?=E8=A1=A8=E6=A0=B7=E5=BC=8F=EF=BC=8C=E5=8F=AF=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E6=A0=B7=E5=BC=8F=E7=BE=8E=E5=8C=96=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/gen/include/formChildTable.html | 2 +- .../views/modules/sys/user/empUserForm.html | 2 +- .../modules/demo/demoDataGridEditGrid.html | 6 +- .../modules/demo/demoDataGridGroupGrid.html | 4 +- .../views/modules/demo/demoFormEditForm.html | 96 ++--- .../modules/demo/demoFormLayoutForm.html | 4 +- .../views/modules/demo/demoFormTableForm.html | 399 ++++++------------ .../views/modules/test/testDataForm.html | 2 +- 8 files changed, 190 insertions(+), 325 deletions(-) diff --git a/modules/core/src/main/resources/templates/modules/gen/include/formChildTable.html b/modules/core/src/main/resources/templates/modules/gen/include/formChildTable.html index 876c2dc4..9d6d34b1 100644 --- a/modules/core/src/main/resources/templates/modules/gen/include/formChildTable.html +++ b/modules/core/src/main/resources/templates/modules/gen/include/formChildTable.html @@ -3,7 +3,7 @@ for (child in table.childList){ %>

\${text('${child.comments}')}

-
+
<% if(table.tplCategory != 'query'){ %> \<% if (hasPermi('${permissionPrefix}:edit')){ %> diff --git a/modules/core/src/main/resources/views/modules/sys/user/empUserForm.html b/modules/core/src/main/resources/views/modules/sys/user/empUserForm.html index abab6bf2..73d900ee 100644 --- a/modules/core/src/main/resources/views/modules/sys/user/empUserForm.html +++ b/modules/core/src/main/resources/views/modules/sys/user/empUserForm.html @@ -167,7 +167,7 @@
-
+
<% if (hasPermi('sys:empUser:edit')){ %> ${text('增行')} diff --git a/web/src/main/resources/views/modules/demo/demoDataGridEditGrid.html b/web/src/main/resources/views/modules/demo/demoDataGridEditGrid.html index 50e10eef..1b2d2264 100644 --- a/web/src/main/resources/views/modules/demo/demoDataGridEditGrid.html +++ b/web/src/main/resources/views/modules/demo/demoDataGridEditGrid.html @@ -1,9 +1,9 @@ -<% layout('/layouts/default.html', {title: '数据管理', libs: ['dataGrid','validate']}){ %> +<% layout('/layouts/default.html', {title: '编辑表格多行编辑', libs: ['dataGrid','validate']}){ %>
- 数据管理 + 编辑表格多行编辑
查询 @@ -111,7 +111,7 @@
- <#form:form id="inputForm" model="${testData}" action="${ctx}/test/testData/save" method="post" class="form-horizontal"> + <#form:form id="inputForm" model="${testData}" action="${ctx}/test/testData/save" method="post" class="form-horizontal table-form">
diff --git a/web/src/main/resources/views/modules/demo/demoDataGridGroupGrid.html b/web/src/main/resources/views/modules/demo/demoDataGridGroupGrid.html index 7ca7096c..ec96eadc 100644 --- a/web/src/main/resources/views/modules/demo/demoDataGridGroupGrid.html +++ b/web/src/main/resources/views/modules/demo/demoDataGridGroupGrid.html @@ -1,9 +1,9 @@ -<% layout('/layouts/default.html', {title: '数据管理', libs: ['dataGrid']}){ %> +<% layout('/layouts/default.html', {title: '多表头分组小计合计', libs: ['dataGrid']}){ %>
- 数据管理 + 多表头分组小计合计
查询 diff --git a/web/src/main/resources/views/modules/demo/demoFormEditForm.html b/web/src/main/resources/views/modules/demo/demoFormEditForm.html index 925cd634..1c7ca916 100644 --- a/web/src/main/resources/views/modules/demo/demoFormEditForm.html +++ b/web/src/main/resources/views/modules/demo/demoFormEditForm.html @@ -1,9 +1,9 @@ -<% layout('/layouts/default.html', {title: '数据管理', libs: ['validate','fileupload','ueditor','dataGrid','inputmask']}){ %> +<% layout('/layouts/default.html', {title: '组件应用实例', libs: ['validate','fileupload','ueditor','dataGrid','inputmask']}){ %>
- ${testData.isNewRecord ? '新增数据' : '编辑数据'} + 组件应用实例
@@ -96,6 +96,36 @@
+
+
+
+
+ +
+
+ + <#form:input path="testInput_money" maxlength="200" class="form-control inputmask" + data-inputmask-alias="money" data-inputmask="'digits':'2'"/> + (千分位,右对齐,保留2位小数) +
+
+
+
+
+
+ +
+
+ + <#form:input path="testInput_regex" maxlength="200" class="form-control inputmask" + data-inputmask-regex="[a-zA-Z0-9._%-]+@[a-zA-Z0-9-]+\\.[a-zA-Z]{2,4}"/> + (正则表达式) +
+
+
+
@@ -147,7 +177,19 @@
-
+
+
+
+ +
+ <#form:treeselect id="testAreaCode" title="区域选择" + path="testAreaCode" labelPath="testAreaName" + url="${ctx}/sys/area/treeData?parentCode=0" + class="" allowClear="true" returnFullName="true"/> +
+
+
-
-
- -
- <#form:treeselect id="testAreaCode" title="区域选择" - path="testAreaCode" labelPath="testAreaName" - url="${ctx}/sys/area/treeData?parentCode=0" - class="" allowClear="true"/> -
-
-
+ * 城市选择(联动):
@@ -205,36 +235,6 @@
-
-
-
-
- -
-
- - <#form:input path="testInput_money" maxlength="200" class="form-control inputmask" - data-inputmask-alias="money" data-inputmask="'digits':'2'"/> - (千分位,右对齐,保留2位小数) -
-
-
-
-
-
- -
-
- - <#form:input path="testInput_regex" maxlength="200" class="form-control inputmask" - data-inputmask-regex="[a-zA-Z0-9._%-]+@[a-zA-Z0-9-]+\\.[a-zA-Z]{2,4}"/> - (正则表达式) -
-
-
-
@@ -285,7 +285,7 @@

测试数据子表

-
+
<% if (hasPermi('test:testData:edit')){ %> 增行 @@ -447,7 +447,7 @@ $("#testDataChildDataGrid").dataGrid({ // 编辑表格参数 editGrid: true, // 是否是编辑表格 - editGridInitRowNum: 1, // 编辑表格的初始化新增行数 + editGridInitRowNum: 3, // 编辑表格的初始化新增行数 editGridAddRowBtn: $('#testDataChildDataGridAddRowBtn'), // 子表增行按钮 editGridAddRowInitData: {id: '', status: Global.STATUS_NORMAL}, // 新增行的时候初始化的数据 diff --git a/web/src/main/resources/views/modules/demo/demoFormLayoutForm.html b/web/src/main/resources/views/modules/demo/demoFormLayoutForm.html index 3eeb7b38..8b88f28d 100644 --- a/web/src/main/resources/views/modules/demo/demoFormLayoutForm.html +++ b/web/src/main/resources/views/modules/demo/demoFormLayoutForm.html @@ -1,9 +1,9 @@ -<% layout('/layouts/default.html', {title: '数据管理', libs: ['validate','fileupload','ueditor','dataGrid']}){ %> +<% layout('/layouts/default.html', {title: '栅格布局实例', libs: ['validate','fileupload','ueditor','dataGrid']}){ %>
- ${testData.isNewRecord ? '新增数据' : '编辑数据'} + 栅格布局实例
diff --git a/web/src/main/resources/views/modules/demo/demoFormTableForm.html b/web/src/main/resources/views/modules/demo/demoFormTableForm.html index 309060fa..c5e00206 100644 --- a/web/src/main/resources/views/modules/demo/demoFormTableForm.html +++ b/web/src/main/resources/views/modules/demo/demoFormTableForm.html @@ -1,220 +1,146 @@ <% layout('/layouts/default.html', {title: '数据管理', libs: ['validate','fileupload','ueditor','dataGrid']}){ %> -
+
- ${testData.isNewRecord ? '新增数据' : '编辑数据'} + 表格表单实例
<#form:form id="inputForm" model="${testData}" action="${ctx}/test/testData/save" method="post" class="form-horizontal"> -
-
基本信息
- <#form:hidden path="id"/> -
-
-
- -
- <#form:input path="testInput" maxlength="200" class="form-control"/> -
-
-
-
-
-
-
- -
- <#form:textarea path="testTextarea" rows="4" maxlength="200" class="form-control"/> -
-
-
-
-
-
-
- -
- <#form:select path="testSelect" dictType="sys_menu_type" blankOption="true" class="form-control" /> -
-
-
-
-
- -
- <#form:select path="testSelectMultiple" dictType="sys_menu_type" multiple="true" blankOption="true" class="form-control" /> -
-
-
-
-
-
-
- -
- <#form:radio path="testRadio" dictType="sys_menu_type" class="form-control" /> -
-
-
-
-
- -
- <#form:checkbox path="testCheckbox" dictType="sys_menu_type" class="form-control" /> -
-
-
-
-
-
-
- -
- <#form:input path="testDate" readonly="true" maxlength="20" class="form-control laydate " - dataFormat="date" data-type="date" data-format="yyyy-MM-dd"/> -
-
-
-
-
- -
- <#form:input path="testDatetime" readonly="true" maxlength="20" class="form-control laydate " - dataFormat="datetime" data-type="datetime" data-format="yyyy-MM-dd HH:mm"/> -
-
-
-
-
-
-
- -
- <#form:treeselect id="testUser" title="用户选择" - path="testUser.userCode" labelPath="testUser.userName" - url="${ctx}/sys/office/treeData?isLoadUser=true" - class="" allowClear="true"/> -
-
-
-
-
- -
- <#form:treeselect id="testUser2" title="用户选择" - path="testUser.userCode" labelPath="testUser.userName" - url="${ctx}/sys/office/treeData?isLoadUser=true" - class="" allowClear="true" checkbox="true"/> -
-
-
-
-
-
-
- -
- <#form:treeselect id="testOffice" title="机构选择" +
+

产品信息情况

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
基本信息
* 负责人 + <#form:input path="testInput" maxlength="200" class="form-control required" defaultValue="小王"/> + 所属部门 + <#form:treeselect id="testOffice" title="机构选择" path="testOffice.officeCode" labelPath="testOffice.officeName" - url="${ctx}/sys/office/treeData" - class="" allowClear="true"/> - - - -
-
- -
- <#form:treeselect id="testAreaCode" title="区域选择" - path="testAreaCode" labelPath="testAreaName" - url="${ctx}/sys/area/treeData" - class="" allowClear="true"/> -
-
-
- -
-
-
- -
- <#form:ueditor path="remarks" maxlength="10000" height="200" class="" - simpleToolbars="true" readonly="false" outline="false"/> -
-
-
-
-
-
-
- -
+ url="${ctx}/sys/office/treeData" defaultLabel="技术部" + class="required" allowClear="true"/> +
+
<#form:fileupload id="uploadImage" bizKey="${testData.id}" bizType="testData_image" - uploadType="image" class="" readonly="false" preview="true"/> + uploadType="image" class="" readonly="false" preview="true" + maxUploadNum="1" isMini="true"/>
- - - -
-
-
- -
- <#form:fileupload id="uploadImage2" returnPath="true" - filePathInputId="uploadImage2Path" fileNameInputId="uploadImage2Name" - uploadType="image" readonly="false" preview="true" maxUploadNum="3" isMini="false"/> - <#form:input name="uploadImage2Path" class="form-control"/> - <#form:input name="uploadImage2Name" class="form-control"/> -
-
-
-
-
-
-
- -
- <#form:fileupload id="uploadFile" bizKey="${testData.id}" bizType="testData_file" +
单行文本 + <#form:input path="testInput" maxlength="200" class="form-control" defaultValue="演示文本"/> + 单行文本 + <#form:input path="testInput" maxlength="200" class="form-control" defaultValue="演示文本"/> +
下拉框 + <#form:select path="testSelect" dictType="sys_menu_type" blankOption="true" class="form-control" defaultValue="1"/> + 下拉多选 + <#form:select path="testSelectMultiple" dictType="sys_menu_type" multiple="true" blankOption="true" class="form-control" defaultValue="2"/> +
单选框 + <#form:radio path="testRadio" dictType="sys_menu_type" class="form-control" defaultValue="1"/> + 复选框 + <#form:checkbox path="testCheckbox" dictType="sys_menu_type" class="form-control" defaultValue="1"/> +
日期选择 + <#form:input path="testDate" readonly="true" maxlength="20" class="form-control laydate " + dataFormat="date" data-type="date" data-format="yyyy-MM-dd" defaultValue="${date()}"/> + 日期时间 + <#form:input path="testDatetime" readonly="true" maxlength="20" class="form-control laydate " + dataFormat="datetime" data-type="datetime" data-format="yyyy-MM-dd HH:mm" defaultValue="${date()}"/> +
团队人数 人。其中技术人员 + 人。 +
办公面积服务户数
详细信息
+ + + + + + + + + + + + + + + + + +
项目编号项目名称项目版本
新增产值 万元新增销售额 万元新增交税总额 万元
+
内容简介 + +
子表数据 +
+ 增行 +
+ + + + + +
附件
+ <#form:fileupload id="uploadFile" bizKey="${testData.id}" bizType="testData_file" uploadType="all" class="" readonly="false" preview="true"/> - - - - -

测试数据子表

-
-
- <% if (hasPermi('test:testData:edit')){ %> - 增行 - <% } %> -
- -
+
+   +   +
+
@@ -231,10 +157,8 @@ $("#testDataChildDataGrid").dataGrid({ 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:'testData.id', editable:true, hidden:true}, - {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:'testInput', width:100, editable:true, edittype:'text', editoptions:{'maxlength':'200', 'class':'form-control'}}, + {header:'多行文本', name:'testTextarea', width:100, 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')}), @@ -243,31 +167,7 @@ $("#testDataChildDataGrid").dataGrid({ } } }, - {header:'下拉多选', 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:'单选框', 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).resetValid()}); - } - } - }, - {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).resetValid()}); - } - } - }, - {header:'日期选择', name:'testDate', width:150, + {header:'日期选择', name:'testDate', width:100, 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){ @@ -275,15 +175,7 @@ $("#testDataChildDataGrid").dataGrid({ } } }, - {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 laydate ', 'readonly':'true', - dataInit: function(element){ - laydate.render({elem:element, type:'datetime', format:'yyyy-MM-dd HH:mm'}); - } - } - }, - {header:'用户选择', name:'testUser', width:150, + {header:'用户选择', name:'testUser', width:100, formatter: function(val, obj, row, act){ return js.val(row, 'testUser.userCode')+'|'+js.val(row, 'testUser.userName'); }, editable: true, edittype: "custom", editoptions: { @@ -297,34 +189,6 @@ $("#testDataChildDataGrid").dataGrid({ } } }, - {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 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:'区域选择', 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:'操作', name:'actions', width:80, sortable:false, fixed:true, formatter: function(val, obj, row, act){ var actions = []; if (val == 'new'){ @@ -340,6 +204,7 @@ $("#testDataChildDataGrid").dataGrid({ editGrid: true, // 是否是编辑表格 editGridInitRowNum: 1, // 编辑表格的初始化新增行数 editGridAddRowBtn: $('#testDataChildDataGridAddRowBtn'), // 子表增行按钮 + editGridAddRowBtnToHeader: true, // 子表增行按钮是否显示到表头上 v4.1.7 editGridAddRowInitData: {id: '', status: Global.STATUS_NORMAL}, // 新增行的时候初始化的数据 // 编辑表格的提交数据参数 diff --git a/web/src/main/resources/views/modules/test/testDataForm.html b/web/src/main/resources/views/modules/test/testDataForm.html index d51e3987..30e478c6 100644 --- a/web/src/main/resources/views/modules/test/testDataForm.html +++ b/web/src/main/resources/views/modules/test/testDataForm.html @@ -171,7 +171,7 @@

${text('子表数据')}

-
+
<% if (hasPermi('test:testData:edit')){ %> ${text('增行')}