From c7a9ccf615e00f11364cb42f8ebdc31bf5c4b25c Mon Sep 17 00:00:00 2001 From: thinkgem Date: Sun, 16 Dec 2018 13:53:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E5=88=86=E7=A6=BB=E5=87=BAdataGrid=E7=94=9F=E6=88=90?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=EF=BC=9B=E6=97=A5=E6=9C=9F=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E9=80=89=E5=A1=AB=E6=98=BE=E7=A4=BA=E6=B8=85=E7=A9=BA=E6=8C=89?= =?UTF-8?q?=E9=92=AE=EF=BC=9B=E4=BB=85=E6=9F=A5=E8=AF=A2=E7=94=9F=E6=88=90?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E4=BC=98=E5=8C=96=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/modules/gen/crud/viewList.xml | 109 +---------------- .../modules/gen/include/dataGridScript.html | 114 ++++++++++++++++++ .../modules/gen/include/formChildTable.html | 2 + .../gen/include/formChildTableScript.html | 6 +- .../modules/gen/include/formControl.html | 2 +- .../templates/modules/gen/query/viewList.xml | 93 +------------- 6 files changed, 124 insertions(+), 202 deletions(-) create mode 100644 modules/core/src/main/resources/templates/modules/gen/include/dataGridScript.html diff --git a/modules/core/src/main/resources/templates/modules/gen/crud/viewList.xml b/modules/core/src/main/resources/templates/modules/gen/crud/viewList.xml index 7a2ee884..4fd8807b 100644 --- a/modules/core/src/main/resources/templates/modules/gen/crud/viewList.xml +++ b/modules/core/src/main/resources/templates/modules/gen/crud/viewList.xml @@ -33,113 +33,6 @@ \<% } %> -]]> +<% include('/templates/modules/gen/include/dataGridScript.html'){} %>]]> \ No newline at end of file diff --git a/modules/core/src/main/resources/templates/modules/gen/include/dataGridScript.html b/modules/core/src/main/resources/templates/modules/gen/include/dataGridScript.html new file mode 100644 index 00000000..aead9aac --- /dev/null +++ b/modules/core/src/main/resources/templates/modules/gen/include/dataGridScript.html @@ -0,0 +1,114 @@ + \ No newline at end of file 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 c6c9e30a..876c2dc4 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 @@ -5,9 +5,11 @@

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

+ <% if(table.tplCategory != 'query'){ %> \<% if (hasPermi('${permissionPrefix}:edit')){ %> \${text('增行')} \<% } %> + <% } %>
<% } diff --git a/modules/core/src/main/resources/templates/modules/gen/include/formChildTableScript.html b/modules/core/src/main/resources/templates/modules/gen/include/formChildTableScript.html index 7ec6a5db..58524b0c 100644 --- a/modules/core/src/main/resources/templates/modules/gen/include/formChildTableScript.html +++ b/modules/core/src/main/resources/templates/modules/gen/include/formChildTableScript.html @@ -73,7 +73,7 @@ for (c in child.columnList){ formatter:'date', formatoptions:{srcformat:'Y-m-d H:i:s',newformat:'Y-m-d${isTime?' H:i:s':''}'}, editable:true, edittype:'text', editoptions:{'class':'form-control Wdate${cssClass}', 'readonly':'true', dataInit: function(element){ $(element).on('focus', function(){ - WdatePicker({dateFmt:'yyyy-MM-dd${isTime?' HH:mm':''}',isShowClear:false}); + WdatePicker({dateFmt:'yyyy-MM-dd${isTime?' HH:mm':''}',isShowClear:${c.isRequired != '1'}}); }); }} }, @@ -133,6 +133,7 @@ for (c in child.columnList){ <% } } +if (table.tplCategory != 'query'){ %> {header:'\${text('操作')}', name:'actions', width:80, sortable:false, fixed:true, formatter: function(val, obj, row, act){ var actions = []; @@ -143,6 +144,9 @@ for (c in child.columnList){ } return actions.join(''); }, editoptions: {defaultValue: 'new'}} +<% }else{ %> + {header:'\${text('操作')}', name:'actions', hidden: true} +<% } %> ], // 编辑表格参数 diff --git a/modules/core/src/main/resources/templates/modules/gen/include/formControl.html b/modules/core/src/main/resources/templates/modules/gen/include/formControl.html index 84be69e3..6afbe842 100644 --- a/modules/core/src/main/resources/templates/modules/gen/include/formControl.html +++ b/modules/core/src/main/resources/templates/modules/gen/include/formControl.html @@ -131,7 +131,7 @@ var isTime = (c.showType == 'datetime'); %> <${'#'}form:input path="${c.attrName}" readonly="true" maxlength="20" class="form-control Wdate${cssClass}" - dataFormat="date${isTime?'time':''}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd${isTime?' HH:mm':''}',isShowClear:false});"/> + dataFormat="date${isTime?'time':''}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd${isTime?' HH:mm':''}',isShowClear:${c.isRequired != '1'}});"/> <% } else if (c.showType == 'userselect') { %> diff --git a/modules/core/src/main/resources/templates/modules/gen/query/viewList.xml b/modules/core/src/main/resources/templates/modules/gen/query/viewList.xml index 1d1010c0..3e760bd0 100644 --- a/modules/core/src/main/resources/templates/modules/gen/query/viewList.xml +++ b/modules/core/src/main/resources/templates/modules/gen/query/viewList.xml @@ -30,97 +30,6 @@ \<% } %> -]]> +<% include('/templates/modules/gen/include/dataGridScript.html'){} %>]]> \ No newline at end of file