Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a2da4f095b | ||
|
|
302eb47b83 | ||
|
|
4fa6225017 | ||
|
|
68058f948f | ||
|
|
fc59e3a7aa | ||
|
|
d1cd3ad5ad | ||
|
|
213834810c | ||
|
|
6d381b31da | ||
|
|
5e55b5f4b3 | ||
|
|
e3dc77b75a | ||
|
|
58b22924dd | ||
|
|
f7cdda05d1 | ||
|
|
cb52f25931 | ||
|
|
5b9a7c1d2c | ||
|
|
c295b87f35 | ||
|
|
d6eecc1c56 |
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-parent</artifactId>
|
||||
<version>5.9.0-SNAPSHOT</version>
|
||||
<version>5.9.1-SNAPSHOT</version>
|
||||
<relativePath>../parent/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
|
||||
public static final String COLON = ":";
|
||||
public static final String TILDE = "~";
|
||||
public static final String UNDERLINE = "_";
|
||||
public static final String MINUS = "-";
|
||||
|
||||
/**
|
||||
* 分隔字符串(逗号分隔)
|
||||
@@ -284,7 +285,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
|
||||
boolean upperCase = false;
|
||||
for (int i = 0; i < s.length(); i++) {
|
||||
char c = s.charAt(i);
|
||||
if (c == UNDERLINE.charAt(0)) {
|
||||
if (c == UNDERLINE.charAt(0) || c == MINUS.charAt(0)) {
|
||||
upperCase = i != 1; // 不允许第二个字符是大写
|
||||
} else if (upperCase) {
|
||||
sb.append(Character.toUpperCase(c));
|
||||
|
||||
BIN
common/src/main/resources/static/upbw/img/edge.png
Normal file
BIN
common/src/main/resources/static/upbw/img/edge.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
@@ -20,11 +20,11 @@ span{display:block;font-size:12px;line-height:12px;}
|
||||
<p>您正在使用 Internet Explorer 的过期版本(IE6、IE7、IE8 内核的浏览器)。这意味着在升级浏览器前,您将无法继续访问。</p>
|
||||
<hr>
|
||||
<h2>为什么会出现这个页面?</h2>
|
||||
<p>如果您不知道升级浏览器是什么意思,请请教一些熟练电脑操作的朋友。如果您使用的不是IE6/7/8,而是360、QQ、搜狗等,双核浏览器,出现这个页面可能是您切换到了兼容模式,请<strong style="color:#f00;">切换到极速模式</strong>下,如果还不行请升级至最新版浏览器。</p>
|
||||
<p>如果您不知道升级浏览器是什么意思,请请教一些熟练电脑操作的朋友。如果您使用的不是Internet Explorer,而是360、QQ、搜狗等,双核浏览器,出现这个页面可能是您切换到了兼容模式,请<strong style="color:#f00;">切换到极速模式</strong>下,如果还不行请升级至最新版浏览器。</p>
|
||||
<hr>
|
||||
<h2>请注意:微软(Microsoft)对 Windows XP 及 IE6、IE7、IE8、IE9、IE10 的支持已经结束</h2>
|
||||
<p>自 2014 年 4 月 8 日起,微软(Microsoft)不再为 Windows XP 和 Internet Explorer 8 及以下版本提供相应支持和更新。如果您继续使用这些,您将可能受到病毒、间谍软件和其他恶意软件的攻击,无法确保个人信息的安全。请参阅 <a href="http://windows.microsoft.com/zh-cn/windows/end-support-help">Microsoft 关于 Windows XP 支持已经结束的说明</a> 。</p>
|
||||
<p>尽管 Internet Explorer 11 将于 2022 年 6 月 15 日也停止了支持。但您也可以继续使用 <a href="http://windows.microsoft.com/zh-cn/internet-explorer/download-ie"> Internet Explorer 11 浏览器</a>。</p>
|
||||
<h2>请注意:微软(Microsoft)对 Windows XP、Vista、7、8、8.1 及 Internet Explorer 的支持已经结束</h2>
|
||||
<p>微软(Microsoft)不再为已经结束的版本提供相应支持和更新。如果您继续使用这些,您将可能受到病毒、间谍软件和其他恶意软件的攻击,无法确保个人信息的安全。请参阅 <a href="http://windows.microsoft.com/zh-cn/windows/end-support-help">Windows XP 支持已经结束的说明</a> 。</p>
|
||||
<p>于 2022 年 6 月 15 日,微软对 Internet Explorer 11 的支持也已结束。请参阅 <a href="http://windows.microsoft.com/zh-cn/internet-explorer/download-ie"> Internet Explorer 浏览器下载</a>。</p>
|
||||
<hr>
|
||||
<h2>您可以选择更先进的浏览器</h2>
|
||||
<p>推荐使用以下浏览器的最新版本。如果您的电脑已有以下浏览器的最新版本则直接使用该浏览器访问 <b id="url"></b>即可。</p>
|
||||
@@ -32,7 +32,7 @@ span{display:block;font-size:12px;line-height:12px;}
|
||||
<li><img src="img/chrome360.jpg"><a href="http://chrome.360.cn/"> 360极速浏览器<span>360 Chrome</span></a></li>
|
||||
<li><img src="img/chrome.jpg"><a href="http://www.google.cn/intl/zh-CN/chrome/browser/desktop/index.html"> 谷歌浏览器<span>Google Chrome</span></a></li>
|
||||
<li><img src="img/firefox.jpg"><a href="http://www.firefox.com.cn/download/"> 火狐浏览器<span>Mozilla Firefox</span></a></li>
|
||||
<li><img src="img/ie.jpg"><a href="https://www.microsoft.com/zh-cn/edge"> Edge 浏览器<span>Microsoft Edge</span></a></li>
|
||||
<li><img src="img/edge.png"><a href="https://www.microsoft.com/zh-cn/edge"> Edge 浏览器<span>Microsoft Edge</span></a></li>
|
||||
</ul><div class="clean"></div></div>
|
||||
<hr><br/>
|
||||
<script>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-parent</artifactId>
|
||||
<version>5.9.0-SNAPSHOT</version>
|
||||
<version>5.9.1-SNAPSHOT</version>
|
||||
<relativePath>../../parent/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -20,4 +20,5 @@
|
||||
5.7.1
|
||||
5.8.0
|
||||
5.8.1
|
||||
5.9.0
|
||||
5.9.0
|
||||
5.9.1
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-parent</artifactId>
|
||||
<version>5.9.0-SNAPSHOT</version>
|
||||
<version>5.9.1-SNAPSHOT</version>
|
||||
<relativePath>../../parent/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -28,4 +28,5 @@
|
||||
5.7.1
|
||||
5.8.0
|
||||
5.8.1
|
||||
5.9.0
|
||||
5.9.0
|
||||
5.9.1
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-parent</artifactId>
|
||||
<version>5.9.0-SNAPSHOT</version>
|
||||
<version>5.9.1-SNAPSHOT</version>
|
||||
<relativePath>../../parent/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import java.io.IOException;
|
||||
* @version 2017年11月30日
|
||||
*/
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@ConditionalOnProperty(name="state.enabled", havingValue="true", matchIfMissing=true)
|
||||
@ConditionalOnProperty(name={"state.enabled","state.druid"}, havingValue="true", matchIfMissing=true)
|
||||
public class DruidStatConfig {
|
||||
|
||||
/**
|
||||
@@ -43,7 +43,7 @@ public class DruidStatConfig {
|
||||
bean.addUrlPatterns("/*");
|
||||
return bean;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 注册DruidServlet
|
||||
*/
|
||||
|
||||
@@ -58,7 +58,9 @@ public class UserfilesController extends BaseController {
|
||||
request.setAttribute("fileUrl", fileUrl); // 文件访问地址
|
||||
request.setAttribute("fileUri", fileUri); // 文件下载地址(fileDown)
|
||||
request.setAttribute("filePath", filePath); // 文件相对路径或文件名
|
||||
request.setAttribute("fileUrls", request.getParameter("urls")); // 前后照片列表
|
||||
request.setAttribute("fileUrls", request.getParameter("urls")); // 文件地址列表
|
||||
request.setAttribute("fileNames", request.getParameter("names")); // 文件名称列表
|
||||
request.setAttribute("imageFlag", request.getParameter("image")); // 是否图片控件
|
||||
request.setAttribute(RequestDispatcher.FORWARD_REQUEST_URI, previewUrl);
|
||||
request.getRequestDispatcher(previewUrl).forward(request, response);
|
||||
return null;
|
||||
|
||||
@@ -343,6 +343,12 @@ gen:
|
||||
# 系统监控
|
||||
state:
|
||||
enabled: true
|
||||
# 服务器监控
|
||||
server: true
|
||||
# 缓存监控
|
||||
cache: true
|
||||
# 数据监控
|
||||
druid: true
|
||||
|
||||
#======================================#
|
||||
#========= Framework settings =========#
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<include resource="org/springframework/boot/logging/logback/defaults.xml" />
|
||||
|
||||
<logger name="org.springframework.boot.web.embedded" level="INFO" />
|
||||
<logger name="org.apache.catalina.core.StandardEngine" level="INFO" />
|
||||
<logger name="net.oschina.j2cache.caffeine.CaffeineProvider" level="ERROR" />
|
||||
<logger name="ShardingSphere-SQL" level="DEBUG" />
|
||||
<!-- <logger name="org.apache.ibatis" level="DEBUG" /> -->
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
<template>crud/vueImport.xml</template>
|
||||
<childTable>
|
||||
<template>category-ref:dao</template>
|
||||
<template>crud/vueFormChildList.xml</template>
|
||||
</childTable>
|
||||
</category>
|
||||
<category value="crud_only_vue" label="单表/主子表 (增删改查) 仅vue">
|
||||
@@ -31,17 +32,25 @@
|
||||
<template>crud/vueForm.xml</template>
|
||||
<template>crud/vueIndex.xml</template>
|
||||
<template>crud/vueImport.xml</template>
|
||||
<childTable>
|
||||
<template>crud/vueFormChildList.xml</template>
|
||||
</childTable>
|
||||
</category>
|
||||
<category value="crud_only_vue_modal" label="单表/主子表 (增删改查,弹窗表单) 仅vue ">
|
||||
<template>category-ref:crud_only_vue</template>
|
||||
<childTable>
|
||||
<template>crud/vueFormChildList.xml</template>
|
||||
</childTable>
|
||||
</category>
|
||||
<category value="crud_only_vue_modal_route" label="单表/主子表 (增删改查,路由表单) 仅vue ">
|
||||
<template>crud/vueApi.xml</template>
|
||||
<template>crud/vueList.xml</template>
|
||||
<!--<template>crud/vueForm.xml</template>-->
|
||||
<template>crud/vueFormRoute.xml</template>
|
||||
<template>crud/vueIndex.xml</template>
|
||||
<template>crud/vueImport.xml</template>
|
||||
<childTable>
|
||||
<template>crud/vueFormChildList.xml</template>
|
||||
</childTable>
|
||||
</category>
|
||||
<category value="crud_select" label="单表/主子表 (增删改查,含 listselect 选择页面) beetl">
|
||||
<template>category-ref:crud</template>
|
||||
@@ -55,6 +64,7 @@
|
||||
<template>crud/vueSelect.xml</template>
|
||||
<childTable>
|
||||
<template>category-ref:dao</template>
|
||||
<template>crud/vueFormChildList.xml</template>
|
||||
</childTable>
|
||||
</category>
|
||||
<category value="crud_java" label="单表/主子表 (增删改查,只生成 java/mapper) 仅后端 ">
|
||||
@@ -83,6 +93,7 @@
|
||||
<template>crud/vueImport.xml</template>
|
||||
<childTable>
|
||||
<template>category-ref:dao_cloud</template>
|
||||
<template>crud/vueFormChildList.xml</template>
|
||||
</childTable>
|
||||
</category>
|
||||
<category value="crud_cloud_select" label="单表/主子表 (增删改查 Cloud,含 listselect 选择页面) beetl">
|
||||
@@ -97,6 +108,7 @@
|
||||
<template>crud/vueSelect.xml</template>
|
||||
<childTable>
|
||||
<template>category-ref:dao_cloud</template>
|
||||
<template>crud/vueFormChildList.xml</template>
|
||||
</childTable>
|
||||
</category>
|
||||
<category value="crud_cloud_java" label="单表/主子表 (增删改查 Cloud,只生成 java/mapper) 仅后端">
|
||||
|
||||
@@ -146,7 +146,7 @@ public class ${ClassName}Controller extends BaseController {
|
||||
* 查询子表数据
|
||||
*/
|
||||
@RequiresPermissions("${permissionPrefix}:view")
|
||||
@RequestMapping(value = "${@StringUtils.uncap(child.className)}ListData")
|
||||
@RequestMapping(value = "${@StringUtils.uncap(child.classNameSimple)}ListData")
|
||||
@ResponseBody
|
||||
public Page<${@StringUtils.cap(child.className)}> subListData(${@StringUtils.cap(child.className)} ${@StringUtils.uncap(child.className)}, HttpServletRequest request, HttpServletResponse response) {
|
||||
${@StringUtils.uncap(child.className)}.setPage(new Page<>(request, response));
|
||||
|
||||
@@ -213,7 +213,7 @@ public class ${ClassName} extends ${toBoolean(table.optionMap['isBpmForm'])?(tab
|
||||
// 生成子表列表字段
|
||||
for(child in table.childList){
|
||||
%>
|
||||
private List<${@StringUtils.cap(child.className)}> ${@StringUtils.uncap(child.className)}List = ListUtils.newArrayList(); // 子表列表
|
||||
private List<${@StringUtils.cap(child.className)}> ${@StringUtils.uncap(child.classNameSimple)}List = ListUtils.newArrayList(); // 子表列表
|
||||
<%
|
||||
}
|
||||
|
||||
@@ -366,12 +366,12 @@ public class ${ClassName} extends ${toBoolean(table.optionMap['isBpmForm'])?(tab
|
||||
%>
|
||||
|
||||
@Valid
|
||||
public List<${@StringUtils.cap(child.className)}> get${@StringUtils.cap(child.className)}List() {
|
||||
return ${@StringUtils.uncap(child.className)}List;
|
||||
public List<${@StringUtils.cap(child.className)}> get${@StringUtils.cap(child.classNameSimple)}List() {
|
||||
return ${@StringUtils.uncap(child.classNameSimple)}List;
|
||||
}
|
||||
|
||||
public void set${@StringUtils.cap(child.className)}List(List<${@StringUtils.cap(child.className)}> ${@StringUtils.uncap(child.className)}List) {
|
||||
this.${@StringUtils.uncap(child.className)}List = ${@StringUtils.uncap(child.className)}List;
|
||||
public void set${@StringUtils.cap(child.classNameSimple)}List(List<${@StringUtils.cap(child.className)}> ${@StringUtils.uncap(child.classNameSimple)}List) {
|
||||
this.${@StringUtils.uncap(child.classNameSimple)}List = ${@StringUtils.uncap(child.classNameSimple)}List;
|
||||
}
|
||||
<% } %>
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
|
||||
<% for (child in table.childList){ %>
|
||||
${@StringUtils.cap(child.className)} ${@StringUtils.uncap(child.className)} = new ${@StringUtils.cap(child.className)}(entity);
|
||||
${@StringUtils.uncap(child.className)}.setStatus(${@StringUtils.cap(child.className)}.STATUS_NORMAL);
|
||||
entity.set${@StringUtils.cap(child.className)}List(${@StringUtils.uncap(child.className)}Dao.findList(${@StringUtils.uncap(child.className)}));
|
||||
entity.set${@StringUtils.cap(child.classNameSimple)}List(${@StringUtils.uncap(child.className)}Dao.findList(${@StringUtils.uncap(child.className)}));
|
||||
<% } %>
|
||||
}
|
||||
return entity;
|
||||
@@ -168,7 +168,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
|
||||
<% } %>
|
||||
<% for (child in table.childList) { %>
|
||||
// 保存 ${ClassName}子表
|
||||
for (${@StringUtils.cap(child.className)} ${@StringUtils.uncap(child.className)} : ${className}.get${@StringUtils.cap(child.className)}List()){
|
||||
for (${@StringUtils.cap(child.className)} ${@StringUtils.uncap(child.className)} : ${className}.get${@StringUtils.cap(child.classNameSimple)}List()){
|
||||
if (!${@StringUtils.cap(child.className)}.STATUS_DELETE.equals(${@StringUtils.uncap(child.className)}.getStatus())){
|
||||
<%
|
||||
for(c in child.columnList){
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
No deletion without permission, or be held responsible to law. -->
|
||||
<template>
|
||||
<name>viewForm</name>
|
||||
<filePath>${frontDir}/src/main/resources/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
|
||||
<filePath>${baseDir}/src/main/resources/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
|
||||
<fileName>${className}Form.html</fileName>
|
||||
<content><![CDATA[
|
||||
<% include('/templates/modules/gen/include/viewForm.html'){} %>]]>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
No deletion without permission, or be held responsible to law. -->
|
||||
<template>
|
||||
<name>viewIndex</name>
|
||||
<filePath>${frontDir}/src/main/resources/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
|
||||
<filePath>${baseDir}/src/main/resources/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
|
||||
<fileName>${className}Index.html</fileName>
|
||||
<content><![CDATA[
|
||||
<% include('/templates/modules/gen/include/viewIndex.html'){} %>]]>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
No deletion without permission, or be held responsible to law. -->
|
||||
<template>
|
||||
<name>viewList</name>
|
||||
<filePath>${frontDir}/src/main/resources/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
|
||||
<filePath>${baseDir}/src/main/resources/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
|
||||
<fileName>${className}List.html</fileName>
|
||||
<content><![CDATA[
|
||||
<% include('/templates/modules/gen/include/viewList.html'){} %>]]>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
No deletion without permission, or be held responsible to law. -->
|
||||
<template>
|
||||
<name>viewSelect</name>
|
||||
<filePath>${frontDir}/src/main/resources/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
|
||||
<filePath>${baseDir}/src/main/resources/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
|
||||
<fileName>${className}Select.html</fileName>
|
||||
<content><![CDATA[
|
||||
<% include('/templates/modules/gen/include/viewSelect.html'){} %>]]>
|
||||
|
||||
@@ -72,7 +72,7 @@ for(c in table.columnList){
|
||||
%>
|
||||
<% // 生成子表列表字段
|
||||
for(child in table.childList){ %>
|
||||
${@StringUtils.uncap(child.className)}List?: any[]; // 子表列表
|
||||
${@StringUtils.uncap(child.classNameSimple)}List?: any[]; // 子表列表
|
||||
<% } %>
|
||||
}
|
||||
|
||||
|
||||
@@ -28,16 +28,8 @@
|
||||
<% if (table.childList.~size > 0){ %>
|
||||
<BasicForm @register="registerForm">
|
||||
<% for (child in table.childList){ %>
|
||||
<template #${@StringUtils.uncap(child.className)}List>
|
||||
<BasicTable
|
||||
@register="register${child.className}Table"
|
||||
@row-click="handle${child.className}RowClick"
|
||||
/>
|
||||
<% if(table.tplCategory != 'query'){ %>
|
||||
<a-button class="mt-2" @click="handle${child.className}Add" v-auth="'${permissionPrefix}:edit'">
|
||||
<Icon icon="i-ant-design:plus-circle-outlined" /> {{ t('新增') }}
|
||||
</a-button>
|
||||
<% } %>
|
||||
<template #${@StringUtils.uncap(child.classNameSimple)}List>
|
||||
<Form${@StringUtils.cap(child.classNameSimple)}List ref="form${@StringUtils.cap(child.classNameSimple)}ListRef" />
|
||||
</template>
|
||||
<% } %>
|
||||
</BasicForm>
|
||||
@@ -70,42 +62,42 @@
|
||||
import { router } from '/@/router';
|
||||
import { Icon } from '/@/components/Icon';
|
||||
import { BasicForm, FormSchema, useForm } from '/@/components/Form';
|
||||
<% if (table.childList.~size > 0){ %>
|
||||
import { BasicTable, useTable } from '/@/components/Table';
|
||||
<% } %>
|
||||
import { Basic${modalOrDrawer}, use${modalOrDrawer}Inner } from '/@/components/${modalOrDrawer}';
|
||||
import { ${ClassName}, ${className}Save, ${className}Form<% if(table.isTreeEntity){ %>, ${className}TreeData<% } %> } from '/@/api/${moduleName}${isNotEmpty(subModuleName)?'/'+subModuleName:''}/${className}';
|
||||
<%
|
||||
var userselectExists = false;
|
||||
var officeselectExists = false;
|
||||
var companyselectExists = false;
|
||||
var areaselectExists = false;
|
||||
for(c in table.columnList){
|
||||
if(c.isQuery == "1" && !c.isTreeEntityColumn){
|
||||
if(c.showType == 'userselect'){
|
||||
userselectExists = true;
|
||||
}else if(c.showType == 'officeselect'){
|
||||
officeselectExists = true;
|
||||
}else if(c.showType == 'companyselect'){
|
||||
companyselectExists = true;
|
||||
}else if(c.showType == 'areaselect'){
|
||||
areaselectExists = true;
|
||||
<%
|
||||
var userselectExists = false;
|
||||
var officeselectExists = false;
|
||||
var companyselectExists = false;
|
||||
var areaselectExists = false;
|
||||
for(c in table.columnList){
|
||||
if(c.isQuery == "1" && !c.isTreeEntityColumn){
|
||||
if(c.showType == 'userselect'){
|
||||
userselectExists = true;
|
||||
}else if(c.showType == 'officeselect'){
|
||||
officeselectExists = true;
|
||||
}else if(c.showType == 'companyselect'){
|
||||
companyselectExists = true;
|
||||
}else if(c.showType == 'areaselect'){
|
||||
areaselectExists = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
%>
|
||||
<% if(userselectExists || officeselectExists) { %>
|
||||
%>
|
||||
<% if(userselectExists || officeselectExists) { %>
|
||||
import { officeTreeData } from '/@/api/sys/office';
|
||||
<% } %>
|
||||
<% if(companyselectExists) { %>
|
||||
<% } %>
|
||||
<% if(companyselectExists) { %>
|
||||
import { companyTreeData } from '/@/api/sys/company';
|
||||
<% } %>
|
||||
<% if(areaselectExists) { %>
|
||||
<% } %>
|
||||
<% if(areaselectExists) { %>
|
||||
import { areaTreeData } from '/@/api/sys/area';
|
||||
<% } %>
|
||||
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
|
||||
<% } %>
|
||||
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
|
||||
import { BpmButton } from '/@/components/Bpm';
|
||||
<% } %>
|
||||
<% } %>
|
||||
<% for (child in table.childList){ %>
|
||||
import Form${@StringUtils.cap(child.classNameSimple)}List from './form${@StringUtils.cap(child.classNameSimple)}List.vue';
|
||||
<% } %>
|
||||
|
||||
const emit = defineEmits(['success', 'register']);
|
||||
|
||||
@@ -113,9 +105,12 @@ for(c in table.columnList){
|
||||
const { showMessage } = useMessage();
|
||||
const { meta } = unref(router.currentRoute);
|
||||
const record = ref<${ClassName}>({} as ${ClassName});
|
||||
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
|
||||
<% for (child in table.childList){ %>
|
||||
const form${@StringUtils.cap(child.classNameSimple)}ListRef = ref<InstanceType<typeof Form${@StringUtils.cap(child.classNameSimple)}List>>();
|
||||
<% } %>
|
||||
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
|
||||
const loadingRef = ref(false);
|
||||
<% } %>
|
||||
<% } %>
|
||||
|
||||
const getTitle = computed(() => ({
|
||||
icon: meta.icon || 'i-ant-design:book-outlined',
|
||||
@@ -135,7 +130,7 @@ for(c in table.columnList){
|
||||
},
|
||||
colProps: { md: 24, lg: 24 },
|
||||
},
|
||||
<% }
|
||||
<% }
|
||||
for (c in table.columnList){
|
||||
if (c.isEdit == '1' && c.showType != 'hidden'){
|
||||
// 如果是树结构的字段,则自动忽略
|
||||
@@ -152,7 +147,7 @@ for (c in table.columnList){
|
||||
isNewLine = true;
|
||||
}
|
||||
}
|
||||
%>
|
||||
%>
|
||||
{
|
||||
label: t('${c.columnLabel}'),
|
||||
field: '${c.attrName}',
|
||||
@@ -316,9 +311,8 @@ for (c in table.columnList){
|
||||
},
|
||||
<%
|
||||
}
|
||||
}
|
||||
if(toBoolean(table.optionMap['isImageUpload'])){
|
||||
%>
|
||||
} %>
|
||||
<% if(toBoolean(table.optionMap['isImageUpload'])){ %>
|
||||
{
|
||||
label: t('图片上传'),
|
||||
field: 'dataMap',
|
||||
@@ -333,8 +327,7 @@ for (c in table.columnList){
|
||||
},
|
||||
<%
|
||||
}
|
||||
if(toBoolean(table.optionMap['isFileUpload'])){
|
||||
%>
|
||||
if(toBoolean(table.optionMap['isFileUpload'])){ %>
|
||||
{
|
||||
label: t('附件上传'),
|
||||
field: 'dataMap',
|
||||
@@ -352,15 +345,14 @@ for (c in table.columnList){
|
||||
for (child in table.childList){ %>
|
||||
{
|
||||
label: t('${child.comments}'),
|
||||
field: '${@StringUtils.uncap(child.className)}List',
|
||||
field: '${@StringUtils.uncap(child.classNameSimple)}List',
|
||||
component: 'Input',
|
||||
colProps: { md: 24, lg: 24 },
|
||||
slot: '${@StringUtils.uncap(child.className)}List',
|
||||
slot: '${@StringUtils.uncap(child.classNameSimple)}List',
|
||||
},
|
||||
<%
|
||||
<%
|
||||
}
|
||||
if(false && toBoolean(table.optionMap['isBpmForm'])){
|
||||
%>
|
||||
if(false && toBoolean(table.optionMap['isBpmForm'])){ %>
|
||||
{
|
||||
label: t('审批意见'),
|
||||
field: 'bpm.comment',
|
||||
@@ -403,9 +395,7 @@ for (c in table.columnList){
|
||||
selectType: 'empUserSelect',
|
||||
},
|
||||
},
|
||||
<%
|
||||
}
|
||||
%>
|
||||
<% } %>
|
||||
];
|
||||
<%
|
||||
var updateSchemas = [];
|
||||
@@ -444,186 +434,6 @@ for (c in table.columnList){
|
||||
<% var formColNum = table.optionMap['formColNum']; %>
|
||||
baseColProps: { md: 24, lg: ${formColNum=="1"?24:formColNum=="3"?8:12} },
|
||||
});
|
||||
<% for (child in table.childList){ %>
|
||||
|
||||
const [register${child.className}Table, ${@StringUtils.uncap(child.className)}Table] = useTable({
|
||||
actionColumn: {
|
||||
width: 60,
|
||||
actions: (record: Recordable) => [
|
||||
{
|
||||
icon: 'i-ant-design:delete-outlined',
|
||||
color: 'error',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handle${child.className}Delete.bind(this, record),
|
||||
},
|
||||
auth: '${permissionPrefix}:edit',
|
||||
},
|
||||
],
|
||||
},
|
||||
rowKey: 'id',
|
||||
pagination: false,
|
||||
bordered: true,
|
||||
size: 'small',
|
||||
inset: true,
|
||||
});
|
||||
|
||||
async function set${child.className}TableData(_res: Recordable) {
|
||||
${@StringUtils.uncap(child.className)}Table.setColumns([
|
||||
<%
|
||||
for (c in child.columnList){
|
||||
if (c.isEdit != '1' || c.isPk == '1'){
|
||||
continue;
|
||||
}
|
||||
if(child.parentExists && child.parentTableFkName == c.columnName){
|
||||
continue;
|
||||
}
|
||||
%>
|
||||
{
|
||||
title: t('${c.columnLabel}'),
|
||||
dataIndex: '${c.attrName}',
|
||||
<% if(c.showType == 'datetime'){ %>
|
||||
width: 215,
|
||||
<% }else{ %>
|
||||
width: 130,
|
||||
<% } %>
|
||||
<% if ((isNotBlank(c.optionMap['dictType']) || @StringUtils.inString(c.attrType, 'java.util.Date', 'Integer', 'Long'))){ %>
|
||||
align: 'center',
|
||||
<% }else if (@StringUtils.inString(c.attrType, 'Float', 'Double')){ %>
|
||||
align: 'right',
|
||||
<% }else{ %>
|
||||
align: 'left',
|
||||
<% } %>
|
||||
<% if(c.showType == 'select' || c.showType == 'select_multiple' || c.showType == 'checkbox' || c.showType == 'radio'){ %>
|
||||
dictType: '${c.optionMap['dictType']}',
|
||||
<% } %>
|
||||
editRow: true,
|
||||
<% if(c.showType == 'input' || c.showType == 'textarea'){ %>
|
||||
<% if (c.simpleAttrType == 'Integer' && c.attrName == 'treeSort'){ %>
|
||||
editComponent: 'InputNumber',
|
||||
editDefaultValue: '30',
|
||||
<% }else{ %>
|
||||
editComponent: '${c.showType == 'input' ? 'Input' : 'InputTextArea'}',
|
||||
<% } %>
|
||||
<% if (c.dataLength != '0'){ %>
|
||||
editComponentProps: {
|
||||
maxlength: ${c.dataLength},
|
||||
},
|
||||
<% } %>
|
||||
<% }else if(c.showType == 'select' || c.showType == 'select_multiple' || c.showType == 'radio' || c.showType == 'checkbox'){
|
||||
var isMultiple = (c.showType == 'select_multiple'); %>
|
||||
editComponent: 'Select',
|
||||
editComponentProps: {
|
||||
dictType: '${c.optionMap['dictType']}',
|
||||
allowClear: true,
|
||||
<% if(isMultiple){ %>
|
||||
mode: 'multiple',
|
||||
<% } %>
|
||||
},
|
||||
<% }else if(c.showType == 'date' || c.showType == 'datetime'){
|
||||
var isTime = (c.showType == 'datetime'); %>
|
||||
editComponent: 'DatePicker',
|
||||
editComponentProps: {
|
||||
format: 'YYYY-MM-DD${isTime?' HH:mm':''}',
|
||||
showTime: ${isTime?'{ format: \'HH:mm\' \}':'false'},
|
||||
},
|
||||
<% }else if(c.showType == 'userselect'){
|
||||
if (isNotBlank(c.attrName2)){ %>
|
||||
dataLabel: '${c.attrName2}',
|
||||
<% } %>
|
||||
editComponent: 'TreeSelect',
|
||||
editComponentProps: {
|
||||
api: officeTreeData,
|
||||
params: { isLoadUser: true, userIdPrefix: '' },
|
||||
canSelectParent: false,
|
||||
allowClear: true,
|
||||
},
|
||||
<% }else if(c.showType == 'officeselect'){
|
||||
if (isNotBlank(c.attrName2)){ %>
|
||||
dataLabel: '${c.attrName2}',
|
||||
<% } %>
|
||||
editComponent: 'TreeSelect',
|
||||
editComponentProps: {
|
||||
api: officeTreeData,
|
||||
canSelectParent: false,
|
||||
allowClear: true,
|
||||
},
|
||||
<% }else if(c.showType == 'companyselect'){
|
||||
if (isNotBlank(c.attrName2)){ %>
|
||||
dataLabel: '${c.attrName2}',
|
||||
<% } %>
|
||||
editComponent: 'TreeSelect',
|
||||
editComponentProps: {
|
||||
api: companyTreeData,
|
||||
canSelectParent: false,
|
||||
allowClear: true,
|
||||
},
|
||||
<% }else if(c.showType == 'areaselect'){
|
||||
if (isNotBlank(c.attrName2)){ %>
|
||||
dataLabel: '${c.attrName2}',
|
||||
<% } %>
|
||||
editComponent: 'TreeSelect',
|
||||
editComponentProps: {
|
||||
api: areaTreeData,
|
||||
canSelectParent: false,
|
||||
allowClear: true,
|
||||
},
|
||||
<% }else{ %>
|
||||
editComponent: 'Input',
|
||||
<% } %>
|
||||
editRule: ${c.isRequired == '1'},
|
||||
},
|
||||
<%
|
||||
}
|
||||
%>
|
||||
]);
|
||||
${@StringUtils.uncap(child.className)}Table.setTableData(record.value.${@StringUtils.uncap(child.className)}List || []);
|
||||
}
|
||||
|
||||
function handle${child.className}RowClick(record: Recordable) {
|
||||
record.onEdit?.(true, false);
|
||||
}
|
||||
|
||||
function handle${child.className}Add() {
|
||||
${@StringUtils.uncap(child.className)}Table.insertTableDataRecord({
|
||||
id: new Date().getTime(),
|
||||
isNewRecord: true,
|
||||
editable: true,
|
||||
});
|
||||
}
|
||||
|
||||
function handle${child.className}Delete(record: Recordable) {
|
||||
${@StringUtils.uncap(child.className)}Table.deleteTableDataRecord(record);
|
||||
}
|
||||
|
||||
async function get${child.className}List() {
|
||||
let ${@StringUtils.uncap(child.className)}ListValid = true;
|
||||
let ${@StringUtils.uncap(child.className)}List: Recordable[] = [];
|
||||
for (const record of ${@StringUtils.uncap(child.className)}Table.getDataSource()) {
|
||||
if (!(await record.onEdit?.(false, true))) {
|
||||
${@StringUtils.uncap(child.className)}ListValid = false;
|
||||
}
|
||||
${@StringUtils.uncap(child.className)}List.push({
|
||||
...record,
|
||||
id: !!record.isNewRecord ? '' : record.id,
|
||||
});
|
||||
}
|
||||
for (const record of ${@StringUtils.uncap(child.className)}Table.getDelDataSource()) {
|
||||
if (!!record.isNewRecord) continue;
|
||||
${@StringUtils.uncap(child.className)}List.push({
|
||||
...record,
|
||||
status: '1',
|
||||
});
|
||||
}
|
||||
if (!${@StringUtils.uncap(child.className)}ListValid) {
|
||||
throw {
|
||||
errorFields: [{ name: ['${@StringUtils.uncap(child.className)}List'] }],
|
||||
message: t('${child.comments}填写有误,请根据提示修正'),
|
||||
};
|
||||
}
|
||||
return ${@StringUtils.uncap(child.className)}List;
|
||||
}
|
||||
<% } %>
|
||||
|
||||
const [register${modalOrDrawer}, { set${modalOrDrawer}Props, close${modalOrDrawer} }] = use${modalOrDrawer}Inner(async (data) => {
|
||||
set${modalOrDrawer}Props({ loading: true });
|
||||
@@ -639,7 +449,7 @@ for (c in table.columnList){
|
||||
<% } %>
|
||||
setFieldsValue(record.value);
|
||||
<% for (child in table.childList){ %>
|
||||
set${child.className}TableData(res);
|
||||
form${@StringUtils.cap(child.classNameSimple)}ListRef.value?.setTableData(record.value);
|
||||
<% } %>
|
||||
<% if(updateSchemas.~size > 0){ %>
|
||||
updateSchema([
|
||||
@@ -658,7 +468,7 @@ for (c in table.columnList){
|
||||
formData(true, data); // 将表单数据传递给 BpmButton
|
||||
} catch (error: any) {
|
||||
if (error && error.errorFields) {
|
||||
showMessage(t('common.validateError'));
|
||||
showMessage(error.message || t('common.validateError'));
|
||||
}
|
||||
console.log('error', error);
|
||||
}
|
||||
@@ -688,7 +498,7 @@ for (c in table.columnList){
|
||||
%>
|
||||
};
|
||||
<% for (child in table.childList){ %>
|
||||
data.${@StringUtils.uncap(child.className)}List = await get${child.className}List();
|
||||
await form${@StringUtils.cap(child.classNameSimple)}ListRef.value?.getTableData(data);
|
||||
<% } %>
|
||||
<% if(table.isTreeEntity){ %>
|
||||
data.oldParentCode = record.value.parentCode;
|
||||
|
||||
@@ -0,0 +1,250 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
No deletion without permission, or be held responsible to law. -->
|
||||
<template>
|
||||
<name>vueFormChildList</name>
|
||||
<filePath>${frontDir}/src/views/${urlPrefix}</filePath>
|
||||
<fileName>form${@StringUtils.cap(table.classNameSimple)}List.vue</fileName>
|
||||
<content><![CDATA[
|
||||
<!--
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
* No deletion without permission, or be held responsible to law.
|
||||
* @author ${functionAuthor}
|
||||
-->
|
||||
<template>
|
||||
<div>
|
||||
<BasicTable @register="registerTable" @row-click="handleRowClick" />
|
||||
<% if(table.tplCategory != 'query'){ %>
|
||||
<a-button class="mt-2" @click="handleRowAdd" v-auth="'${permissionPrefix}:edit'">
|
||||
<Icon icon="i-ant-design:plus-circle-outlined" /> {{ t('新增') }}
|
||||
</a-button>
|
||||
<% } %>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
import { Icon } from '/@/components/Icon';
|
||||
import { BasicTable, BasicColumn, useTable } from '/@/components/Table';
|
||||
import { ${ParentClassName} } from '/@/api/${moduleName}${isNotEmpty(subModuleName)?'/'+subModuleName:''}/${parentClassName}';
|
||||
<%
|
||||
var userselectExists = false;
|
||||
var officeselectExists = false;
|
||||
var companyselectExists = false;
|
||||
var areaselectExists = false;
|
||||
for(c in table.columnList){
|
||||
if(c.isQuery == "1" && !c.isTreeEntityColumn){
|
||||
if(c.showType == 'userselect'){
|
||||
userselectExists = true;
|
||||
}else if(c.showType == 'officeselect'){
|
||||
officeselectExists = true;
|
||||
}else if(c.showType == 'companyselect'){
|
||||
companyselectExists = true;
|
||||
}else if(c.showType == 'areaselect'){
|
||||
areaselectExists = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
%>
|
||||
<% if(userselectExists || officeselectExists) { %>
|
||||
import { officeTreeData } from '/@/api/sys/office';
|
||||
<% } %>
|
||||
<% if(companyselectExists) { %>
|
||||
import { companyTreeData } from '/@/api/sys/company';
|
||||
<% } %>
|
||||
<% if(areaselectExists) { %>
|
||||
import { areaTreeData } from '/@/api/sys/area';
|
||||
<% } %>
|
||||
|
||||
const { t } = useI18n('${moduleName}${isNotEmpty(subModuleName)?'.'+subModuleName:''}.${className}');
|
||||
const record = ref<TestData>({} as ${ParentClassName});
|
||||
|
||||
const tableColumns: BasicColumn[] = [
|
||||
<%
|
||||
for (c in table.columnList){
|
||||
if (c.isEdit != '1' || c.isPk == '1'){
|
||||
continue;
|
||||
}
|
||||
if(table.parentExists && table.parentTableFkName == c.columnName){
|
||||
continue;
|
||||
}
|
||||
%>
|
||||
{
|
||||
title: t('${c.columnLabel}'),
|
||||
dataIndex: '${c.attrName}',
|
||||
<% if(c.showType == 'datetime'){ %>
|
||||
width: 215,
|
||||
<% }else{ %>
|
||||
width: 130,
|
||||
<% } %>
|
||||
<% if ((isNotBlank(c.optionMap['dictType']) || @StringUtils.inString(c.attrType, 'java.util.Date', 'Integer', 'Long'))){ %>
|
||||
align: 'center',
|
||||
<% }else if (@StringUtils.inString(c.attrType, 'Float', 'Double')){ %>
|
||||
align: 'right',
|
||||
<% }else{ %>
|
||||
align: 'left',
|
||||
<% } %>
|
||||
<% if(c.showType == 'select' || c.showType == 'select_multiple' || c.showType == 'checkbox' || c.showType == 'radio'){ %>
|
||||
dictType: '${c.optionMap['dictType']}',
|
||||
<% } %>
|
||||
editRow: true,
|
||||
<% if(c.showType == 'input' || c.showType == 'textarea'){ %>
|
||||
<% if (c.simpleAttrType == 'Integer' && c.attrName == 'treeSort'){ %>
|
||||
editComponent: 'InputNumber',
|
||||
editDefaultValue: '30',
|
||||
<% }else{ %>
|
||||
editComponent: '${c.showType == 'input' ? 'Input' : 'InputTextArea'}',
|
||||
<% } %>
|
||||
<% if (c.dataLength != '0'){ %>
|
||||
editComponentProps: {
|
||||
maxlength: ${c.dataLength},
|
||||
},
|
||||
<% } %>
|
||||
<% }else if(c.showType == 'select' || c.showType == 'select_multiple' || c.showType == 'radio' || c.showType == 'checkbox'){
|
||||
var isMultiple = (c.showType == 'select_multiple'); %>
|
||||
editComponent: 'Select',
|
||||
editComponentProps: {
|
||||
dictType: '${c.optionMap['dictType']}',
|
||||
allowClear: true,
|
||||
<% if(isMultiple){ %>
|
||||
mode: 'multiple',
|
||||
<% } %>
|
||||
},
|
||||
<% }else if(c.showType == 'date' || c.showType == 'datetime'){
|
||||
var isTime = (c.showType == 'datetime'); %>
|
||||
editComponent: 'DatePicker',
|
||||
editComponentProps: {
|
||||
format: 'YYYY-MM-DD${isTime?' HH:mm':''}',
|
||||
showTime: ${isTime?'{ format: \'HH:mm\' \}':'false'},
|
||||
},
|
||||
<% }else if(c.showType == 'userselect'){
|
||||
if (isNotBlank(c.attrName2)){ %>
|
||||
dataLabel: '${c.attrName2}',
|
||||
<% } %>
|
||||
editComponent: 'TreeSelect',
|
||||
editComponentProps: {
|
||||
api: officeTreeData,
|
||||
params: { isLoadUser: true, userIdPrefix: '' },
|
||||
canSelectParent: false,
|
||||
allowClear: true,
|
||||
},
|
||||
<% }else if(c.showType == 'officeselect'){
|
||||
if (isNotBlank(c.attrName2)){ %>
|
||||
dataLabel: '${c.attrName2}',
|
||||
<% } %>
|
||||
editComponent: 'TreeSelect',
|
||||
editComponentProps: {
|
||||
api: officeTreeData,
|
||||
canSelectParent: false,
|
||||
allowClear: true,
|
||||
},
|
||||
<% }else if(c.showType == 'companyselect'){
|
||||
if (isNotBlank(c.attrName2)){ %>
|
||||
dataLabel: '${c.attrName2}',
|
||||
<% } %>
|
||||
editComponent: 'TreeSelect',
|
||||
editComponentProps: {
|
||||
api: companyTreeData,
|
||||
canSelectParent: false,
|
||||
allowClear: true,
|
||||
},
|
||||
<% }else if(c.showType == 'areaselect'){
|
||||
if (isNotBlank(c.attrName2)){ %>
|
||||
dataLabel: '${c.attrName2}',
|
||||
<% } %>
|
||||
editComponent: 'TreeSelect',
|
||||
editComponentProps: {
|
||||
api: areaTreeData,
|
||||
canSelectParent: false,
|
||||
allowClear: true,
|
||||
},
|
||||
<% }else{ %>
|
||||
editComponent: 'Input',
|
||||
<% } %>
|
||||
editRule: ${c.isRequired == '1'},
|
||||
},
|
||||
<% } %>
|
||||
];
|
||||
|
||||
const [registerTable, tableAction] = useTable({
|
||||
columns: tableColumns,
|
||||
actionColumn: {
|
||||
width: 60,
|
||||
actions: (record: Recordable) => [
|
||||
{
|
||||
icon: 'i-ant-design:delete-outlined',
|
||||
color: 'error',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleRowDelete.bind(this, record),
|
||||
},
|
||||
auth: '${permissionPrefix}:edit',
|
||||
},
|
||||
],
|
||||
},
|
||||
rowKey: 'id',
|
||||
pagination: false,
|
||||
bordered: true,
|
||||
size: 'small',
|
||||
inset: true,
|
||||
});
|
||||
|
||||
function handleRowClick(data: Recordable) {
|
||||
data.onEdit?.(true, false);
|
||||
}
|
||||
|
||||
function handleRowAdd() {
|
||||
tableAction.insertTableDataRecord({
|
||||
id: 'rid_' + new Date().getTime(),
|
||||
isNewRecord: true,
|
||||
editable: true,
|
||||
});
|
||||
}
|
||||
|
||||
function handleRowDelete(data: Recordable) {
|
||||
tableAction.deleteTableDataRecord(data);
|
||||
}
|
||||
|
||||
async function getTableData(data: Recordable): Promise<Recordable> {
|
||||
let valid = true;
|
||||
let tableList: Recordable[] = [];
|
||||
for (const record of tableAction.getDataSource()) {
|
||||
if (!(await record.onEdit?.(false, true))) {
|
||||
valid = false;
|
||||
}
|
||||
tableList.push({
|
||||
...record,
|
||||
id: !!record.isNewRecord ? '' : record.id,
|
||||
});
|
||||
}
|
||||
for (const record of tableAction.getDelDataSource()) {
|
||||
if (!!record.isNewRecord) continue;
|
||||
tableList.push({
|
||||
...record,
|
||||
status: '1',
|
||||
});
|
||||
}
|
||||
if (!valid) {
|
||||
throw {
|
||||
errorFields: [{ name: ['${@StringUtils.uncap(table.classNameSimple)}List'] }],
|
||||
message: t('${table.comments}填写有误,请根据提示修正'),
|
||||
};
|
||||
}
|
||||
data.${@StringUtils.uncap(table.classNameSimple)}List = tableList;
|
||||
return tableList;
|
||||
}
|
||||
|
||||
async function setTableData(data: Recordable) {
|
||||
record.value = data as ${ParentClassName};
|
||||
tableAction.setTableData(data.${@StringUtils.uncap(table.classNameSimple)}List || []);
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
getTableData,
|
||||
setTableData,
|
||||
});
|
||||
</script>
|
||||
<% %>
|
||||
]]>
|
||||
</content>
|
||||
</template>
|
||||
@@ -26,7 +26,7 @@
|
||||
<% for (child in table.childList){ %>
|
||||
<template #${@StringUtils.uncap(child.className)}>
|
||||
<BasicForm @register="register${child.className}Form">
|
||||
<template #${@StringUtils.uncap(child.className)}List>
|
||||
<template #${@StringUtils.uncap(child.classNameSimple)}List>
|
||||
<BasicTable
|
||||
@register="register${child.className}Table"
|
||||
@row-click="handle${child.className}RowClick"
|
||||
@@ -370,10 +370,10 @@ for (c in table.columnList){
|
||||
|
||||
const input${child.className}FormSchemas: FormSchema[] = [
|
||||
{
|
||||
field: '${@StringUtils.uncap(child.className)}List',
|
||||
field: '${@StringUtils.uncap(child.classNameSimple)}List',
|
||||
component: 'Input',
|
||||
colProps: { md: 24, lg: 24 },
|
||||
slot: '${@StringUtils.uncap(child.className)}List',
|
||||
slot: '${@StringUtils.uncap(child.classNameSimple)}List',
|
||||
},
|
||||
];
|
||||
<%
|
||||
@@ -473,7 +473,7 @@ for (c in table.columnList){
|
||||
baseColProps: { md: 24, lg: 24 },
|
||||
});
|
||||
|
||||
const [register${child.className}Table, ${@StringUtils.uncap(child.className)}Table] = useTable({
|
||||
const [register${child.className}Table, ${@StringUtils.uncap(child.classNameSimple)}Table] = useTable({
|
||||
actionColumn: {
|
||||
width: 60,
|
||||
actions: (record: Recordable) => [
|
||||
@@ -496,7 +496,7 @@ for (c in table.columnList){
|
||||
});
|
||||
|
||||
async function set${child.className}TableData(_res: Recordable) {
|
||||
${@StringUtils.uncap(child.className)}Table.setColumns([
|
||||
${@StringUtils.uncap(child.classNameSimple)}Table.setColumns([
|
||||
<%
|
||||
for (c in child.columnList){
|
||||
if (c.isEdit != '1' || c.isPk == '1'){
|
||||
@@ -604,7 +604,7 @@ for (c in table.columnList){
|
||||
}
|
||||
%>
|
||||
]);
|
||||
${@StringUtils.uncap(child.className)}Table.setTableData(record.value.${@StringUtils.uncap(child.className)}List || []);
|
||||
${@StringUtils.uncap(child.classNameSimple)}Table.setTableData(record.value.${@StringUtils.uncap(child.classNameSimple)}List || []);
|
||||
}
|
||||
|
||||
function handle${child.className}RowClick(record: Recordable) {
|
||||
@@ -612,7 +612,7 @@ for (c in table.columnList){
|
||||
}
|
||||
|
||||
function handle${child.className}Add() {
|
||||
${@StringUtils.uncap(child.className)}Table.insertTableDataRecord({
|
||||
${@StringUtils.uncap(child.classNameSimple)}Table.insertTableDataRecord({
|
||||
id: new Date().getTime(),
|
||||
isNewRecord: true,
|
||||
editable: true,
|
||||
@@ -620,35 +620,35 @@ for (c in table.columnList){
|
||||
}
|
||||
|
||||
function handle${child.className}Delete(record: Recordable) {
|
||||
${@StringUtils.uncap(child.className)}Table.deleteTableDataRecord(record);
|
||||
${@StringUtils.uncap(child.classNameSimple)}Table.deleteTableDataRecord(record);
|
||||
}
|
||||
|
||||
async function get${child.className}List() {
|
||||
let ${@StringUtils.uncap(child.className)}ListValid = true;
|
||||
let ${@StringUtils.uncap(child.className)}List: Recordable[] = [];
|
||||
for (const record of ${@StringUtils.uncap(child.className)}Table.getDataSource()) {
|
||||
let ${@StringUtils.uncap(child.classNameSimple)}ListValid = true;
|
||||
let ${@StringUtils.uncap(child.classNameSimple)}List: Recordable[] = [];
|
||||
for (const record of ${@StringUtils.uncap(child.classNameSimple)}Table.getDataSource()) {
|
||||
if (!(await record.onEdit?.(false, true))) {
|
||||
${@StringUtils.uncap(child.className)}ListValid = false;
|
||||
${@StringUtils.uncap(child.classNameSimple)}ListValid = false;
|
||||
}
|
||||
${@StringUtils.uncap(child.className)}List.push({
|
||||
${@StringUtils.uncap(child.classNameSimple)}List.push({
|
||||
...record,
|
||||
id: !!record.isNewRecord ? '' : record.id,
|
||||
});
|
||||
}
|
||||
for (const record of ${@StringUtils.uncap(child.className)}Table.getDelDataSource()) {
|
||||
for (const record of ${@StringUtils.uncap(child.classNameSimple)}Table.getDelDataSource()) {
|
||||
if (!!record.isNewRecord) continue;
|
||||
${@StringUtils.uncap(child.className)}List.push({
|
||||
${@StringUtils.uncap(child.classNameSimple)}List.push({
|
||||
...record,
|
||||
status: '1',
|
||||
});
|
||||
}
|
||||
if (!${@StringUtils.uncap(child.className)}ListValid) {
|
||||
if (!${@StringUtils.uncap(child.classNameSimple)}ListValid) {
|
||||
throw {
|
||||
errorFields: [{ name: ['${@StringUtils.uncap(child.className)}List'] }],
|
||||
errorFields: [{ name: ['${@StringUtils.uncap(child.classNameSimple)}List'] }],
|
||||
message: t('${child.comments}填写有误,请根据提示修正'),
|
||||
};
|
||||
}
|
||||
return ${@StringUtils.uncap(child.className)}List;
|
||||
return ${@StringUtils.uncap(child.classNameSimple)}List;
|
||||
}
|
||||
<% } %>
|
||||
|
||||
@@ -713,7 +713,7 @@ for (c in table.columnList){
|
||||
formData(true, data); // 将表单数据传递给 BpmButton
|
||||
} catch (error: any) {
|
||||
if (error && error.errorFields) {
|
||||
showMessage(t('common.validateError'));
|
||||
showMessage(error.message || t('common.validateError'));
|
||||
}
|
||||
console.log('error', error);
|
||||
}
|
||||
@@ -742,7 +742,7 @@ for (c in table.columnList){
|
||||
%>
|
||||
};
|
||||
<% for (child in table.childList){ %>
|
||||
data.${@StringUtils.uncap(child.className)}List = await get${child.className}List();
|
||||
data.${@StringUtils.uncap(child.classNameSimple)}List = await get${child.className}List();
|
||||
<% } %>
|
||||
<% if(table.isTreeEntity){ %>
|
||||
data.oldParentCode = record.value.parentCode;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<!-- Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
No deletion without permission, or be held responsible to law. -->
|
||||
<template>
|
||||
<name>formImport</name>
|
||||
<name>vueFormImport</name>
|
||||
<filePath>${frontDir}/src/views/${urlPrefix}</filePath>
|
||||
<fileName>formImport.vue</fileName>
|
||||
<content><![CDATA[
|
||||
@@ -107,7 +107,7 @@
|
||||
emit('success');
|
||||
} catch (error: any) {
|
||||
if (error && error.errorFields) {
|
||||
showMessage(t('common.validateError'));
|
||||
showMessage(error.message || t('common.validateError'));
|
||||
}
|
||||
console.log('error', error);
|
||||
} finally {
|
||||
|
||||
@@ -109,64 +109,64 @@ if(table.isTreeEntity){
|
||||
import { Icon } from '/@/components/Icon';
|
||||
import { BasicTable, BasicColumn, useTable } from '/@/components/Table';
|
||||
import { ${className}Delete, ${className}ListData } from '/@/api/${moduleName}${isNotEmpty(subModuleName)?'/'+subModuleName:''}/${className}';
|
||||
<% if(toBoolean(table.optionMap['isHaveDisableEnable'])){ %>
|
||||
<% if(toBoolean(table.optionMap['isHaveDisableEnable'])){ %>
|
||||
import { ${className}Disable, ${className}Enable } from '/@/api/${moduleName}${isNotEmpty(subModuleName)?'/'+subModuleName:''}/${className}';
|
||||
<% } %>
|
||||
<%
|
||||
var userselectExists = false;
|
||||
var officeselectExists = false;
|
||||
var companyselectExists = false;
|
||||
var areaselectExists = false;
|
||||
for(c in table.columnList){
|
||||
if(c.isQuery == "1" && !c.isTreeEntityColumn){
|
||||
if(c.showType == 'userselect'){
|
||||
userselectExists = true;
|
||||
}else if(c.showType == 'officeselect'){
|
||||
officeselectExists = true;
|
||||
}else if(c.showType == 'companyselect'){
|
||||
companyselectExists = true;
|
||||
}else if(c.showType == 'areaselect'){
|
||||
areaselectExists = true;
|
||||
<% } %>
|
||||
<%
|
||||
var userselectExists = false;
|
||||
var officeselectExists = false;
|
||||
var companyselectExists = false;
|
||||
var areaselectExists = false;
|
||||
for(c in table.columnList){
|
||||
if(c.isQuery == "1" && !c.isTreeEntityColumn){
|
||||
if(c.showType == 'userselect'){
|
||||
userselectExists = true;
|
||||
}else if(c.showType == 'officeselect'){
|
||||
officeselectExists = true;
|
||||
}else if(c.showType == 'companyselect'){
|
||||
companyselectExists = true;
|
||||
}else if(c.showType == 'areaselect'){
|
||||
areaselectExists = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
%>
|
||||
<% if(userselectExists || officeselectExists) { %>
|
||||
%>
|
||||
<% if(userselectExists || officeselectExists) { %>
|
||||
import { officeTreeData } from '/@/api/sys/office';
|
||||
<% } %>
|
||||
<% if(companyselectExists) { %>
|
||||
<% } %>
|
||||
<% if(companyselectExists) { %>
|
||||
import { companyTreeData } from '/@/api/sys/company';
|
||||
<% } %>
|
||||
<% if(areaselectExists) { %>
|
||||
<% } %>
|
||||
<% if(areaselectExists) { %>
|
||||
import { areaTreeData } from '/@/api/sys/area';
|
||||
<% } %>
|
||||
<% if(modalOrDrawer == 'Drawer' && !@StringUtils.contains(table.tplCategory, '_route')){ %>
|
||||
<% } %>
|
||||
<% if(modalOrDrawer == 'Drawer' && !@StringUtils.contains(table.tplCategory, '_route')){ %>
|
||||
import { useDrawer } from '/@/components/Drawer';
|
||||
<% } %>
|
||||
<% if(modalOrDrawer == 'Modal' || (toBoolean(table.optionMap['isBpmForm'])
|
||||
<% } %>
|
||||
<% if(modalOrDrawer == 'Modal' || (toBoolean(table.optionMap['isBpmForm'])
|
||||
|| toBoolean(table.optionMap['isImportExport']))){ %>
|
||||
import { useModal } from '/@/components/Modal';
|
||||
<% } %>
|
||||
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
|
||||
<% } %>
|
||||
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
|
||||
import { BpmRuntimeTrace } from '/@/components/Bpm';
|
||||
<% } %>
|
||||
<% } %>
|
||||
import { FormProps } from '/@/components/Form';
|
||||
<% if(!@StringUtils.contains(table.tplCategory, '_route')) { %>
|
||||
<% if(!@StringUtils.contains(table.tplCategory, '_route')) { %>
|
||||
import InputForm from './form.vue';
|
||||
<% } %>
|
||||
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
|
||||
<% } %>
|
||||
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
|
||||
import FormImport from './formImport.vue';
|
||||
<% } %>
|
||||
<% if(table.isTreeEntity || isNotBlank(table.optionMap['leftTreeRightTableFk'])){ %>
|
||||
<% } %>
|
||||
<% if(table.isTreeEntity || isNotBlank(table.optionMap['leftTreeRightTableFk'])){ %>
|
||||
|
||||
const props = defineProps({
|
||||
treeCode: String,
|
||||
});
|
||||
<% } %>
|
||||
<% if(@StringUtils.contains(table.tplCategory, '_route')) { %>
|
||||
<% } %>
|
||||
<% if(@StringUtils.contains(table.tplCategory, '_route')) { %>
|
||||
|
||||
const emitter = useEmitter();
|
||||
<% } %>
|
||||
<% } %>
|
||||
|
||||
const { t } = useI18n('${moduleName}${isNotEmpty(subModuleName)?'.'+subModuleName:''}.${className}');
|
||||
const { showMessage } = useMessage();
|
||||
@@ -176,9 +176,9 @@ for(c in table.columnList){
|
||||
icon: meta.icon || 'i-ant-design:book-outlined',
|
||||
value: meta.title || t('${functionNameSimple}管理'),
|
||||
};
|
||||
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
|
||||
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
|
||||
const loading = ref(false);
|
||||
<% } %>
|
||||
<% } %>
|
||||
|
||||
const searchForm: FormProps = {
|
||||
baseColProps: { md: 8, lg: 6 },
|
||||
@@ -409,9 +409,6 @@ for(c in table.columnList){
|
||||
],
|
||||
};
|
||||
|
||||
<% if(!@StringUtils.contains(table.tplCategory, '_route')) { %>
|
||||
const [register${modalOrDrawer}, { open${modalOrDrawer} }] = use${modalOrDrawer}();
|
||||
<% } %>
|
||||
const [registerTable, { reload<% if(table.isTreeEntity){ %>, expandAll, collapseAll, expandCollapse<% } %><%
|
||||
if (table.isTreeEntity || isNotBlank(table.optionMap['leftTreeRightTableFk'])
|
||||
|| toBoolean(table.optionMap['isImportExport'])){ %>, getForm<% } %> }] = useTable({
|
||||
@@ -430,7 +427,11 @@ for(c in table.columnList){
|
||||
<% } %>
|
||||
canResize: true,
|
||||
});
|
||||
<% if(table.isTreeEntity || isNotBlank(table.optionMap['leftTreeRightTableFk'])){ %>
|
||||
|
||||
<% if(!@StringUtils.contains(table.tplCategory, '_route')) { %>
|
||||
const [register${modalOrDrawer}, { open${modalOrDrawer} }] = use${modalOrDrawer}();
|
||||
<% } %>
|
||||
<% if(table.isTreeEntity || isNotBlank(table.optionMap['leftTreeRightTableFk'])){ %>
|
||||
|
||||
watch(
|
||||
() => props.treeCode,
|
||||
@@ -447,15 +448,15 @@ for(c in table.columnList){
|
||||
reload();
|
||||
},
|
||||
);
|
||||
<% } %>
|
||||
<% if(table.isTreeEntity){ %>
|
||||
<% } %>
|
||||
<% if(table.isTreeEntity){ %>
|
||||
|
||||
function fetchSuccess() {
|
||||
if (props.treeCode) {
|
||||
nextTick(expandAll);
|
||||
}
|
||||
}
|
||||
<% } %>
|
||||
<% } %>
|
||||
|
||||
function handleForm(record: Recordable) {
|
||||
<% if(!@StringUtils.contains(table.tplCategory, '_route')) { %>
|
||||
@@ -467,7 +468,7 @@ for(c in table.columnList){
|
||||
});
|
||||
<% } %>
|
||||
}
|
||||
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
|
||||
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
|
||||
|
||||
async function handleExport() {
|
||||
loading.value = true;
|
||||
@@ -484,8 +485,8 @@ for(c in table.columnList){
|
||||
function handleImport() {
|
||||
importModal(true, {});
|
||||
}
|
||||
<% } %>
|
||||
<% if(toBoolean(table.optionMap['isHaveDisableEnable'])){ %>
|
||||
<% } %>
|
||||
<% if(toBoolean(table.optionMap['isHaveDisableEnable'])){ %>
|
||||
|
||||
async function handleDisable(record: Recordable) {
|
||||
const params = { ${idParam} };
|
||||
@@ -500,7 +501,7 @@ for(c in table.columnList){
|
||||
showMessage(res.message);
|
||||
handleSuccess(record);
|
||||
}
|
||||
<% } %>
|
||||
<% } %>
|
||||
|
||||
async function handleDelete(record: Recordable) {
|
||||
const params = { ${idParam} };
|
||||
|
||||
@@ -148,7 +148,7 @@ public class ${ClassName}Controller extends BaseController {
|
||||
* 查询子表数据
|
||||
*/
|
||||
@RequiresPermissions("${permissionPrefix}:view")
|
||||
@RequestMapping(value = "${@StringUtils.uncap(child.className)}ListData")
|
||||
@RequestMapping(value = "${@StringUtils.uncap(child.classNameSimple)}ListData")
|
||||
@ResponseBody
|
||||
public Page<${@StringUtils.cap(child.className)}> subListData(${@StringUtils.cap(child.className)} ${@StringUtils.uncap(child.className)}, HttpServletRequest request, HttpServletResponse response) {
|
||||
${@StringUtils.uncap(child.className)}.setPage(new Page<>(request, response));
|
||||
|
||||
@@ -213,7 +213,7 @@ public class ${ClassName} extends ${toBoolean(table.optionMap['isBpmForm'])?(tab
|
||||
// 生成子表列表字段
|
||||
for(child in table.childList){
|
||||
%>
|
||||
private List<${@StringUtils.cap(child.className)}> ${@StringUtils.uncap(child.className)}List = ListUtils.newArrayList(); // 子表列表
|
||||
private List<${@StringUtils.cap(child.className)}> ${@StringUtils.uncap(child.classNameSimple)}List = ListUtils.newArrayList(); // 子表列表
|
||||
<%
|
||||
}
|
||||
|
||||
@@ -366,12 +366,12 @@ public class ${ClassName} extends ${toBoolean(table.optionMap['isBpmForm'])?(tab
|
||||
%>
|
||||
|
||||
@Valid
|
||||
public List<${@StringUtils.cap(child.className)}> get${@StringUtils.cap(child.className)}List() {
|
||||
return ${@StringUtils.uncap(child.className)}List;
|
||||
public List<${@StringUtils.cap(child.className)}> get${@StringUtils.cap(child.classNameSimple)}List() {
|
||||
return ${@StringUtils.uncap(child.classNameSimple)}List;
|
||||
}
|
||||
|
||||
public void set${@StringUtils.cap(child.className)}List(List<${@StringUtils.cap(child.className)}> ${@StringUtils.uncap(child.className)}List) {
|
||||
this.${@StringUtils.uncap(child.className)}List = ${@StringUtils.uncap(child.className)}List;
|
||||
public void set${@StringUtils.cap(child.classNameSimple)}List(List<${@StringUtils.cap(child.className)}> ${@StringUtils.uncap(child.classNameSimple)}List) {
|
||||
this.${@StringUtils.uncap(child.classNameSimple)}List = ${@StringUtils.uncap(child.classNameSimple)}List;
|
||||
}
|
||||
<% } %>
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
|
||||
<% for (child in table.childList){ %>
|
||||
${@StringUtils.cap(child.className)} ${@StringUtils.uncap(child.className)} = new ${@StringUtils.cap(child.className)}(entity);
|
||||
${@StringUtils.uncap(child.className)}.setStatus(${@StringUtils.cap(child.className)}.STATUS_NORMAL);
|
||||
entity.set${@StringUtils.cap(child.className)}List(${@StringUtils.uncap(child.className)}Dao.findList(${@StringUtils.uncap(child.className)}));
|
||||
entity.set${@StringUtils.cap(child.classNameSimple)}List(${@StringUtils.uncap(child.className)}Dao.findList(${@StringUtils.uncap(child.className)}));
|
||||
<% } %>
|
||||
}
|
||||
return entity;
|
||||
@@ -175,7 +175,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
|
||||
<% } %>
|
||||
<% for (child in table.childList) { %>
|
||||
// 保存 ${ClassName}子表
|
||||
for (${@StringUtils.cap(child.className)} ${@StringUtils.uncap(child.className)} : ${className}.get${@StringUtils.cap(child.className)}List()){
|
||||
for (${@StringUtils.cap(child.className)} ${@StringUtils.uncap(child.className)} : ${className}.get${@StringUtils.cap(child.classNameSimple)}List()){
|
||||
if (!${@StringUtils.cap(child.className)}.STATUS_DELETE.equals(${@StringUtils.uncap(child.className)}.getStatus())){
|
||||
<%
|
||||
for(c in child.columnList){
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
No deletion without permission, or be held responsible to law. -->
|
||||
<template>
|
||||
<name>viewForm</name>
|
||||
<filePath>${frontDir}/${moduleName}/src/main/resources/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
|
||||
<filePath>${baseDir}/${moduleName}/src/main/resources/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
|
||||
<fileName>${className}Form.html</fileName>
|
||||
<content><![CDATA[
|
||||
<% include('/templates/modules/gen/include/viewForm.html'){} %>]]>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
No deletion without permission, or be held responsible to law. -->
|
||||
<template>
|
||||
<name>viewIndex</name>
|
||||
<filePath>${frontDir}/${moduleName}/src/main/resources/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
|
||||
<filePath>${baseDir}/${moduleName}/src/main/resources/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
|
||||
<fileName>${className}Index.html</fileName>
|
||||
<content><![CDATA[
|
||||
<% include('/templates/modules/gen/include/viewIndex.html'){} %>]]>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
No deletion without permission, or be held responsible to law. -->
|
||||
<template>
|
||||
<name>viewList</name>
|
||||
<filePath>${frontDir}/${moduleName}/src/main/resources/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
|
||||
<filePath>${baseDir}/${moduleName}/src/main/resources/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
|
||||
<fileName>${className}List.html</fileName>
|
||||
<content><![CDATA[
|
||||
<% include('/templates/modules/gen/include/viewList.html'){} %>]]>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
No deletion without permission, or be held responsible to law. -->
|
||||
<template>
|
||||
<name>viewSelect</name>
|
||||
<filePath>${frontDir}/${moduleName}/src/main/resources/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
|
||||
<filePath>${baseDir}/${moduleName}/src/main/resources/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
|
||||
<fileName>${className}Select.html</fileName>
|
||||
<content><![CDATA[
|
||||
<% include('/templates/modules/gen/include/viewSelect.html'){} %>]]>
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
%>
|
||||
<div class="form-unit">\${text('${child.comments}')}</div>
|
||||
<div class="form-unit-wrap table-form">
|
||||
<table id="${@StringUtils.uncap(child.className)}DataGrid"></table>
|
||||
<table id="${@StringUtils.uncap(child.classNameSimple)}DataGrid"></table>
|
||||
<% if(table.tplCategory != 'query'){ %>
|
||||
\<% if (hasPermi('${permissionPrefix}:edit')){ %>
|
||||
<a href="#" id="${@StringUtils.uncap(child.className)}DataGridAddRowBtn" class="btn btn-primary btn-sm mt10 mb10"><i class="fa fa-plus"></i> \${text('增行')}</a>
|
||||
<a href="#" id="${@StringUtils.uncap(child.classNameSimple)}DataGridAddRowBtn" class="btn btn-primary btn-sm mt10 mb10"><i class="fa fa-plus"></i> \${text('增行')}</a>
|
||||
\<% } %>
|
||||
<% } %>
|
||||
</div>
|
||||
|
||||
@@ -6,9 +6,9 @@ var treeselectExists = false;
|
||||
for(child in table.childList){
|
||||
%>
|
||||
\//# // 初始化${child.comments}DataGrid对象
|
||||
$('#${@StringUtils.uncap(child.className)}DataGrid').dataGrid({
|
||||
$('#${@StringUtils.uncap(child.classNameSimple)}DataGrid').dataGrid({
|
||||
|
||||
data: \"#{toJson(${className}.${@StringUtils.uncap(child.className)}List)}",
|
||||
data: \"#{toJson(${className}.${@StringUtils.uncap(child.classNameSimple)}List)}",
|
||||
datatype: 'local', // 设置本地数据
|
||||
autoGridHeight: function(){return 'auto'}, // 设置自动高度
|
||||
|
||||
@@ -164,9 +164,9 @@ if (table.tplCategory != 'query'){
|
||||
{header:'\${text("操作")}', name:'actions', width:80, align:'center', formatter: function(val, obj, row, act){
|
||||
var actions = [];
|
||||
if (val == 'new'){
|
||||
actions.push('<a href="#" onclick="js.confirm(\'\${text("你确认要删除这条数据吗?")}\', function(){$(\'#${@StringUtils.uncap(child.className)}DataGrid\').dataGrid(\'delRowData\',\''+obj.rowId+'\')});return false;"><i class="fa fa-trash-o"></i></a> ');
|
||||
actions.push('<a href="#" onclick="js.confirm(\'\${text("你确认要删除这条数据吗?")}\', function(){$(\'#${@StringUtils.uncap(child.classNameSimple)}DataGrid\').dataGrid(\'delRowData\',\''+obj.rowId+'\')});return false;"><i class="fa fa-trash-o"></i></a> ');
|
||||
}else{
|
||||
actions.push('<a href="#" onclick="js.confirm(\'\${text("你确认要删除这条数据吗?")}\', function(){$(\'#${@StringUtils.uncap(child.className)}DataGrid\').dataGrid(\'setRowData\',\''+obj.rowId+'\',null,{display:\'none\'});$(\'#'+obj.rowId+'_status\').val(\''+Global.STATUS_DELETE+'\');});return false;"><i class="fa fa-trash-o"></i></a> ');
|
||||
actions.push('<a href="#" onclick="js.confirm(\'\${text("你确认要删除这条数据吗?")}\', function(){$(\'#${@StringUtils.uncap(child.classNameSimple)}DataGrid\').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'}}
|
||||
@@ -178,12 +178,12 @@ if (table.tplCategory != 'query'){
|
||||
\//# // 编辑表格参数
|
||||
editGrid: true, // 是否是编辑表格
|
||||
editGridInitRowNum: 1, // 编辑表格的初始化新增行数
|
||||
editGridAddRowBtn: $('#${@StringUtils.uncap(child.className)}DataGridAddRowBtn'), // 子表增行按钮
|
||||
editGridAddRowBtn: $('#${@StringUtils.uncap(child.classNameSimple)}DataGridAddRowBtn'), // 子表增行按钮
|
||||
editGridAddRowBtnToHeader: true, // 子表增行按钮是否显示到表头上
|
||||
editGridAddRowInitData: {<% for(pk in child.pkList){ %>${pk.attrName}<% break; }%>: '', status: Global.STATUS_NORMAL}, // 新增行的时候初始化的数据
|
||||
|
||||
\//# // 编辑表格的提交数据参数
|
||||
editGridInputFormListName: '${@StringUtils.uncap(child.className)}List', // 提交的数据列表名
|
||||
editGridInputFormListName: '${@StringUtils.uncap(child.classNameSimple)}List', // 提交的数据列表名
|
||||
editGridInputFormListAttrs: 'status,<% for(c in child.columnList){if(c.attrName!="status"){%>${c.attrName},<% }} %>', // 提交数据列表的属性字段
|
||||
|
||||
\//# // 加载成功后执行事件
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
No deletion without permission, or be held responsible to law. -->
|
||||
<template>
|
||||
<name>package</name>
|
||||
<filePath>${baseDir}/${moduleCode}/src/main/java/com/jeesite/modules/${moduleCode}</filePath>
|
||||
<filePath>${baseDir}/${moduleCode}/src/main/java/com/jeesite/modules/${@StringUtils.replace(moduleCode, '-', '/')}</filePath>
|
||||
<fileName></fileName>
|
||||
<content><![CDATA[
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<content><![CDATA[
|
||||
# 温馨提示:不建议直接修改此文件,为了平台升级方便,建议将需要修改的参数值,复制到application.yml里进行覆盖该参数值。
|
||||
|
||||
#${moduleCode}:
|
||||
#${@StringUtils.camelCase(moduleCode)}:
|
||||
# enabled: true
|
||||
|
||||
]]>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
No deletion without permission, or be held responsible to law. -->
|
||||
<template>
|
||||
<name>static</name>
|
||||
<filePath>${baseDir}/${moduleCode}/src/main/resources/static/modules/${moduleCode}</filePath>
|
||||
<filePath>${baseDir}/${moduleCode}/src/main/resources/static/modules/${@StringUtils.replace(moduleCode, '-', '/')}</filePath>
|
||||
<fileName></fileName>
|
||||
<content><![CDATA[
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
No deletion without permission, or be held responsible to law. -->
|
||||
<template>
|
||||
<name>package</name>
|
||||
<filePath>${baseDir}/${moduleCode}/${moduleCode}-client/src/main/java/com/jeesite/modules/${moduleCode}</filePath>
|
||||
<filePath>${baseDir}/${moduleCode}/${moduleCode}-client/src/main/java/com/jeesite/modules/${@StringUtils.replace(moduleCode, '-', '/')}</filePath>
|
||||
<fileName></fileName>
|
||||
<content><![CDATA[
|
||||
|
||||
|
||||
@@ -21,15 +21,15 @@
|
||||
<artifactId>jeesite-cloud-module-${moduleCode}-web</artifactId>
|
||||
<packaging>war</packaging>
|
||||
|
||||
<name>JeeSite Cloud Module ${moduleName} Web</name>
|
||||
<name>JeeSite Cloud Module ${@StringUtils.capCamelCase(moduleCode)} Web</name>
|
||||
<url>http://jeesite.com</url>
|
||||
<inceptionYear>2013-Now</inceptionYear>
|
||||
|
||||
<properties>
|
||||
|
||||
<finalName>web</finalName><!-- war包的名称 -->
|
||||
<start-class>com.jeesite.modules.${@StringUtils.cap(module.moduleCode)}Application</start-class>
|
||||
|
||||
<start-class>com.jeesite.modules.${@StringUtils.capCamelCase(moduleCode)}Application</start-class>
|
||||
|
||||
<!-- docker setting -->
|
||||
<docker.run.port>8989:8989</docker.run.port>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
No deletion without permission, or be held responsible to law. -->
|
||||
<template>
|
||||
<name>package</name>
|
||||
<filePath>${baseDir}/${moduleCode}/${moduleCode}/src/main/java/com/jeesite/modules/${moduleCode}</filePath>
|
||||
<filePath>${baseDir}/${moduleCode}/${moduleCode}/src/main/java/com/jeesite/modules/${@StringUtils.replace(moduleCode, '-', '/')}</filePath>
|
||||
<fileName></fileName>
|
||||
<content><![CDATA[
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<template>
|
||||
<name>start-class</name>
|
||||
<filePath>${baseDir}/${moduleCode}/${moduleCode}/src/main/java/com/jeesite/modules</filePath>
|
||||
<fileName>${@StringUtils.cap(module.moduleCode)}Application.java</fileName>
|
||||
<fileName>${@StringUtils.capCamelCase(moduleCode)}Application.java</fileName>
|
||||
<content><![CDATA[
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
@@ -12,6 +12,8 @@
|
||||
*/
|
||||
package com.jeesite.modules;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
@@ -27,16 +29,22 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
@SpringBootApplication
|
||||
@EnableDiscoveryClient
|
||||
@EnableFeignClients(basePackages={"com.jeesite.modules"})
|
||||
public class ${@StringUtils.cap(module.moduleCode)}Application extends SpringBootServletInitializer {
|
||||
|
||||
public class ${@StringUtils.capCamelCase(moduleCode)}Application extends SpringBootServletInitializer {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(${@StringUtils.capCamelCase(moduleCode)}Application.class);
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(${@StringUtils.cap(module.moduleCode)}Application.class, args);
|
||||
SpringApplication.run(${@StringUtils.capCamelCase(moduleCode)}Application.class, args);
|
||||
logger.info(
|
||||
"\r\n\r\n==============================================================\r\n"
|
||||
+ "\r\n " + ${@StringUtils.capCamelCase(moduleCode)}Application.class.getName() + " 启动完成。"
|
||||
+ "\r\n\r\n==============================================================\r\n");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
|
||||
this.setRegisterErrorPageFilter(false); // 错误页面有容器来处理,而不是SpringBoot
|
||||
return builder.sources(${@StringUtils.cap(module.moduleCode)}Application.class);
|
||||
return builder.sources(${@StringUtils.capCamelCase(moduleCode)}Application.class);
|
||||
}
|
||||
|
||||
}]]>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
No deletion without permission, or be held responsible to law. -->
|
||||
<template>
|
||||
<name>static</name>
|
||||
<filePath>${baseDir}/${moduleCode}/${moduleCode}/src/main/resources/static/modules/${moduleCode}</filePath>
|
||||
<filePath>${baseDir}/${moduleCode}/${moduleCode}/src/main/resources/static/modules/${@StringUtils.replace(moduleCode, '-', '/')}</filePath>
|
||||
<fileName></fileName>
|
||||
<content><![CDATA[
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ public class ${ClassName}Controller extends BaseController {
|
||||
* 查询子表数据
|
||||
*/
|
||||
@RequiresPermissions("${permissionPrefix}:view")
|
||||
@RequestMapping(value = "${@StringUtils.uncap(child.className)}ListData")
|
||||
@RequestMapping(value = "${@StringUtils.uncap(child.classNameSimple)}ListData")
|
||||
@ResponseBody
|
||||
public Page<${@StringUtils.cap(child.className)}> subListData(${@StringUtils.cap(child.className)} ${@StringUtils.uncap(child.className)}, HttpServletRequest request, HttpServletResponse response) {
|
||||
${@StringUtils.uncap(child.className)}.setPage(new Page<>(request, response));
|
||||
|
||||
@@ -49,7 +49,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Query'}Ser
|
||||
<% for (child in table.childList){ %>
|
||||
${@StringUtils.cap(child.className)} ${@StringUtils.uncap(child.className)} = new ${@StringUtils.cap(child.className)}(entity);
|
||||
${@StringUtils.uncap(child.className)}.setStatus(${@StringUtils.cap(child.className)}.STATUS_NORMAL);
|
||||
entity.set${@StringUtils.cap(child.className)}List(${@StringUtils.uncap(child.className)}Dao.findList(${@StringUtils.uncap(child.className)}));
|
||||
entity.set${@StringUtils.cap(child.classNameSimple)}List(${@StringUtils.uncap(child.className)}Dao.findList(${@StringUtils.uncap(child.className)}));
|
||||
<% } %>
|
||||
}
|
||||
return entity;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
No deletion without permission, or be held responsible to law. -->
|
||||
<template>
|
||||
<name>viewForm</name>
|
||||
<filePath>${frontDir}/src/main/resources/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
|
||||
<filePath>${baseDir}/src/main/resources/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
|
||||
<fileName>${className}Form.html</fileName>
|
||||
<content><![CDATA[
|
||||
<%
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
No deletion without permission, or be held responsible to law. -->
|
||||
<template>
|
||||
<name>viewList</name>
|
||||
<filePath>${frontDir}/src/main/resources/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
|
||||
<filePath>${baseDir}/src/main/resources/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
|
||||
<fileName>${className}List.html</fileName>
|
||||
<content><![CDATA[
|
||||
\<% layout('/layouts/default.html', {title: '${functionNameSimple}查询', libs: ['dataGrid']}){ %>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-modules</artifactId>
|
||||
<version>5.9.0-SNAPSHOT</version>
|
||||
<version>5.9.1-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>JeeSite Modules</name>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-parent</artifactId>
|
||||
<version>5.9.0-SNAPSHOT</version>
|
||||
<version>5.9.1-SNAPSHOT</version>
|
||||
<relativePath>../../parent/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
.append("<div class=\"form-error\">"+$.validator.messages.errorMessage+"</div>");
|
||||
}
|
||||
$.extend($.validator.defaults, {
|
||||
ignore: ":hidden:not(.required),input.select2-focusser", // 忽略验证的class名称
|
||||
ignore: ":hidden:not(.required),input.select2-focusser,.jqgrow:hidden input,.jqgrow:hidden textarea", // 忽略验证的class名称
|
||||
errorClass: 'has-error',
|
||||
errorContainer: ".form-error",
|
||||
errorPlacement: function(error, element) {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-parent</artifactId>
|
||||
<version>5.9.0-SNAPSHOT</version>
|
||||
<version>5.9.1-SNAPSHOT</version>
|
||||
<relativePath>../../parent/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-parent</artifactId>
|
||||
<version>5.9.0-SNAPSHOT</version>
|
||||
<version>5.9.1-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>JeeSite Parent</name>
|
||||
@@ -59,6 +59,8 @@
|
||||
<j2cache.version>2.8.0-release</j2cache.version>
|
||||
<swagger.version>1.6.6</swagger.version>
|
||||
<liquibase.version>4.20.0</liquibase.version>
|
||||
<spring-framework.version>5.3.39</spring-framework.version>
|
||||
<logback.version>1.2.13</logback.version>
|
||||
|
||||
<!-- jdbc setting -->
|
||||
<mysql.version>8.0.33</mysql.version>
|
||||
|
||||
2
pom.xml
2
pom.xml
@@ -5,7 +5,7 @@
|
||||
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite</artifactId>
|
||||
<version>5.9.0-SNAPSHOT</version>
|
||||
<version>5.9.1-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>JeeSite</name>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-root</artifactId>
|
||||
<version>5.9.0-SNAPSHOT</version>
|
||||
<version>5.9.1-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>JeeSite Root</name>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-parent</artifactId>
|
||||
<version>5.9.0-SNAPSHOT</version>
|
||||
<version>5.9.1-SNAPSHOT</version>
|
||||
<relativePath>../parent/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -257,7 +257,7 @@ spring:
|
||||
|
||||
# 应用程序名称
|
||||
application:
|
||||
name: jeesite-web
|
||||
name: jeesite-web-api
|
||||
|
||||
# 环境名称(注意:不可设置为 test 它是单元测试专用的名称)
|
||||
profiles:
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-parent</artifactId>
|
||||
<version>5.9.0-SNAPSHOT</version>
|
||||
<version>5.9.1-SNAPSHOT</version>
|
||||
<relativePath>../parent/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-parent</artifactId>
|
||||
<version>5.9.0-SNAPSHOT</version>
|
||||
<version>5.9.1-SNAPSHOT</version>
|
||||
<relativePath>../parent/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user