diff --git a/changelog.md b/changelog.md index e3b2b9b7263774b9a2834b551020b9ba12179367..f7f54df423d0d7a12b020be7a2c9ec9cd03b7942 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,18 @@ # changelog +## 1.5.9 + +- 支持达梦数据库 [pr](https://gitee.com/durcframework/code-gen/pulls/22) + +## 1.5.8 + +- 修复oracle数据源时,生成代码页面加载不到表列表问题 [pr](https://gitee.com/durcframework/code-gen/pulls/18) [#I4AIPV](https://gitee.com/durcframework/code-gen/issues/I4AIPV) + +## 1.5.7 + +- sqlite在mac m1架构下无法运行问题。 +- 修复连接Oracle数据库生成代码时,查询字段sql报错问题 + ## 1.5.6 - 【新增】常用变量 diff --git a/docker-build.sh b/docker-build.sh index 909202fe7d9744efcd5e32194e598626b885827c..d41edccd1d8882ea5740fe8030a870ac3ebc2301 100644 --- a/docker-build.sh +++ b/docker-build.sh @@ -8,3 +8,9 @@ sh build.sh # 创建镜像 docker build -t tanghc2020/gen . + +sleep 1 + +echo "推送到docker,命令:docker push tanghc2020/gen:latest" + +docker push tanghc2020/gen:latest diff --git a/front/public/velocity/java.json b/front/public/velocity/java.json index 7e59241fa0bc3a9a11879ae8cb414b9a8882df8c..76c2e6e462bb4e1f736e2fb8da75607f61bd235b 100644 --- a/front/public/velocity/java.json +++ b/front/public/velocity/java.json @@ -74,6 +74,14 @@ "expression": "${context.javaBeanNameLF}", "text": "Java类名且首字母小写" }, + { + "expression": "${context.javaBeanNameL}", + "text": "Java类名全部小写" + }, + { + "expression": "${context.javaBeanNameHB}", + "text": "Java类名驼峰转横杠" + }, { "expression": "${context.datetime}", "text": "日期时间,年月日时分秒" diff --git a/front/src/utils/global.js b/front/src/utils/global.js index 8f6452360cba328e6fd25cd854ea72f4b64145d0..dd374e166731287098dfadcce9bf3ba295cfa5ef 100644 --- a/front/src/utils/global.js +++ b/front/src/utils/global.js @@ -106,6 +106,10 @@ Object.assign(Vue.prototype, { goRoute: function(path) { this.$router.push({ path: path }) }, + goRouteNewWindow: function(path) { + let routeData = this.$router.resolve({ path: path }) + window.open(routeData.href, '_blank'); + }, cellStyleSmall: function() { return { padding: '5px 0' } }, diff --git a/front/src/views/generate/GenerateConfig/index.vue b/front/src/views/generate/GenerateConfig/index.vue index 12a447aa0d6343ee1e4fb2e9cc804c1faf163ade..a6107fc9fd77fe2fc05bf0647dba297751717e82 100644 --- a/front/src/views/generate/GenerateConfig/index.vue +++ b/front/src/views/generate/GenerateConfig/index.vue @@ -7,21 +7,24 @@ placeholder="选择数据源" @change="onDataSourceChange" > - - {{ getDatasourceLabel(item) }} - + + + {{ getDatasourceLabel(item) }} + - + + + 新建数据源 @@ -68,6 +71,7 @@ @@ -81,6 +85,7 @@ 生成代码 + 生成代码(新窗口) @@ -118,6 +124,9 @@ size="mini" label-width="120px" > + + + + + + @@ -250,15 +262,19 @@ export default { author: '' }, tableSearch: '', + datasourceGroupMap: {}, datasourceConfigList: [], tableListData: [], templateListData: [], + templateListSelect: [], // add datasource datasourceTitle: '新建连接', datasourceDlgShow: false, datasourceFormData: { id: 0, + dbGroupName: '', dbType: 1, + dbDesc: '', host: '', port: '', username: '', @@ -383,7 +399,7 @@ export default { }, getDatasourceLabel(item) { const schema = item.schemaName ? `/${item.schemaName}` : '' - return `${item.dbName}${schema} (${item.host}) - ${item.username}` + return `${item.dbDesc} ${item.dbName}${schema} (${item.host}) - ${item.username}` }, loadGroups() { this.post(`/group/list/`, {}, function(resp) { @@ -395,6 +411,7 @@ export default { this.post('/datasource/list', {}, resp => { let id const list = resp.data + this.getDatasourceGroupMap(list) this.datasourceConfigList = list for (const item of list) { // 缓存id是否有效 @@ -411,6 +428,15 @@ export default { } }) }, + getDatasourceGroupMap(list) { + const groups = {} + for (const item of list) { + let groupName = item.dbGroupName || ''; + groups[groupName] = groups[groupName] || [] + groups[groupName].push(item) + } + this.datasourceGroupMap = groups + }, loadTemplate() { this.post('/template/list', {}, resp => { this.templateListData = resp.data @@ -480,6 +506,10 @@ export default { } }) }, + onTemplateGroupChange(templateId) { + //切换模板下拉框 清除先前被选中的模板 + this.$refs.templateListSelect.clearSelection(); + }, onTableListSelect(selectedRows) { this.clientParam.tableNames = selectedRows .filter(row => row.hidden === undefined || row.hidden === false) @@ -521,7 +551,7 @@ export default { }) }) }, - onGenerate() { + onGenerate(target) { this.$refs.genForm.validate((valid) => { if (valid) { if (this.clientParam.tableNames.length === 0) { @@ -533,7 +563,13 @@ export default { return } const config = JSON.stringify(this.clientParam) - this.goRoute(`result/${config}`) + console.log(target); + if (target === '_blank') { + //新窗口打开 + this.goRouteNewWindow(`result/${config}`) + }else{ + this.goRoute(`result/${config}`) + } } }) }, diff --git a/front/src/views/generate/result.vue b/front/src/views/generate/result.vue index bbc1651a0718a68b5a8f927d12594bcb4fb8cb42..eb721f82ddb07816a0cfc53065e6cabf0fff9697 100644 --- a/front/src/views/generate/result.vue +++ b/front/src/views/generate/result.vue @@ -203,8 +203,9 @@ export default { const children = row.children const isFolder = children.length > 0 if (isFolder) { - // 创建文件夹 - const folderZip = zip.folder(row.fileName) + // 创建文件夹 将文件层级的点 改为 路径 斜杠 + let folderName = row.fileName.replaceAll('.','/'); + const folderZip = zip.folder(folderName) children.forEach(child => { // 文件放入文件夹中 folderZip.file(child.fileName, child.content) diff --git a/front/src/views/template/edit.vue b/front/src/views/template/edit.vue index 0b1cd0a38a750c3785e3681046ab30cb3b652d53..a0685180fac7e4628ac1ea5af80c2519d9f78996 100644 --- a/front/src/views/template/edit.vue +++ b/front/src/views/template/edit.vue @@ -40,7 +40,14 @@ - Velocity语法 + + + Velocity语法 + + +
[代码样式:{{ item }}]
+
+
+ + +

+ 快捷键 +

+
+ {{ item }} +
+
@@ -114,14 +130,39 @@