From 2f794c4b73f9cf93ebe83323575bbc5ccbf63952 Mon Sep 17 00:00:00 2001 From: AN <1983933789@qq.com> Date: Wed, 10 Sep 2025 10:40:23 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(projects):=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90=E5=8A=9F=E8=83=BD=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E5=90=8D=E4=B8=BA=E9=A9=BC=E5=B3=B0=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E8=B7=AF=E7=94=B1=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/java/VelocityUtils.java | 24 ++++++++++--------- .../gen/modules/gen-table-operate-drawer.vue | 2 +- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/docs/java/VelocityUtils.java b/docs/java/VelocityUtils.java index a1c47602..2c540be1 100644 --- a/docs/java/VelocityUtils.java +++ b/docs/java/VelocityUtils.java @@ -10,6 +10,7 @@ import org.apache.velocity.VelocityContext; import org.dromara.common.core.utils.DateUtils; import org.dromara.common.core.utils.StringUtils; import org.dromara.common.json.utils.JsonUtils; +import org.dromara.common.mybatis.enums.DataBaseType; import org.dromara.common.mybatis.helper.DataBaseHelper; import org.dromara.generator.constant.GenConstants; import org.dromara.generator.domain.GenTable; @@ -58,7 +59,7 @@ public class VelocityUtils { velocityContext.put("functionName", StringUtils.isNotEmpty(functionName) ? functionName : "【请填写功能名称】"); velocityContext.put("ClassName", genTable.getClassName()); velocityContext.put("className", StringUtils.uncapitalize(genTable.getClassName())); - velocityContext.put("moduleName", genTable.getModuleName()); + velocityContext.put("moduleName", StrUtil.toSymbolCase(genTable.getModuleName(), '-')); velocityContext.put("BusinessName", StringUtils.capitalize(genTable.getBusinessName())); velocityContext.put("businessName", genTable.getBusinessName()); velocityContext.put("business_name", StrUtil.toUnderlineCase(genTable.getBusinessName())); @@ -124,11 +125,12 @@ public class VelocityUtils { templates.add("vm/java/serviceImpl.java.vm"); templates.add("vm/java/controller.java.vm"); templates.add("vm/xml/mapper.xml.vm"); - if (DataBaseHelper.isOracle()) { + DataBaseType dataBaseType = DataBaseHelper.getDataBaseType(); + if (dataBaseType.isOracle()) { templates.add("vm/sql/oracle/sql.vm"); - } else if (DataBaseHelper.isPostgerSql()) { + } else if (dataBaseType.isPostgreSql()) { templates.add("vm/sql/postgres/sql.vm"); - } else if (DataBaseHelper.isSqlServer()) { + } else if (dataBaseType.isSqlServer()) { templates.add("vm/sql/sqlserver/sql.vm"); } else { templates.add("vm/sql/sql.vm"); @@ -163,7 +165,7 @@ public class VelocityUtils { String javaPath = PROJECT_PATH + "/" + StringUtils.replace(packageName, ".", "/"); String mybatisPath = MYBATIS_PATH + "/" + moduleName; String soybeanPath = "soy"; - + String soybeanModuleName = StrUtil.toSymbolCase(moduleName, '-'); if (template.contains("domain.java.vm")) { fileName = StringUtils.format("{}/domain/{}.java", javaPath, className); } @@ -186,17 +188,17 @@ public class VelocityUtils { } else if (template.contains("sql.vm")) { fileName = businessName + "Menu.sql"; } else if (template.contains("index.vue.vm")) { - fileName = StringUtils.format("{}/views/{}/{}/index.vue", soybeanPath, moduleName, StrUtil.toSymbolCase(businessName, '-')); + fileName = StringUtils.format("{}/views/{}/{}/index.vue", soybeanPath, soybeanModuleName, StrUtil.toSymbolCase(businessName, '-')); } else if (template.contains("index-tree.vue.vm")) { - fileName = StringUtils.format("{}/views/{}/{}/index.vue", soybeanPath, moduleName, StrUtil.toSymbolCase(businessName, '-')); + fileName = StringUtils.format("{}/views/{}/{}/index.vue", soybeanPath, soybeanModuleName, StrUtil.toSymbolCase(businessName, '-')); } else if (template.contains("api.d.ts.vm")) { - fileName = StringUtils.format("{}/typings/api/{}.{}.api.d.ts", soybeanPath, moduleName, StrUtil.toSymbolCase(businessName, '-')); + fileName = StringUtils.format("{}/typings/api/{}.{}.api.d.ts", soybeanPath, soybeanModuleName, StrUtil.toSymbolCase(businessName, '-')); } else if (template.contains("api.ts.vm")) { - fileName = StringUtils.format("{}/service/api/{}/{}.ts", soybeanPath, moduleName, StrUtil.toSymbolCase(businessName, '-')); + fileName = StringUtils.format("{}/service/api/{}/{}.ts", soybeanPath, soybeanModuleName, StrUtil.toSymbolCase(businessName, '-')); } else if (template.contains("search.vue.vm")) { - fileName = StringUtils.format("{}/views/{}/{}/modules/{}-search.vue", soybeanPath, moduleName, StrUtil.toSymbolCase(businessName, '-'), StrUtil.toSymbolCase(businessName, '-')); + fileName = StringUtils.format("{}/views/{}/{}/modules/{}-search.vue", soybeanPath, soybeanModuleName, StrUtil.toSymbolCase(businessName, '-'), StrUtil.toSymbolCase(businessName, '-')); } else if (template.contains("operate-drawer.vue.vm")) { - fileName = StringUtils.format("{}/views/{}/{}/modules/{}-operate-drawer.vue", soybeanPath, moduleName, StrUtil.toSymbolCase(businessName, '-'), StrUtil.toSymbolCase(businessName, '-')); + fileName = StringUtils.format("{}/views/{}/{}/modules/{}-operate-drawer.vue", soybeanPath, soybeanModuleName, StrUtil.toSymbolCase(businessName, '-'), StrUtil.toSymbolCase(businessName, '-')); } return fileName; } diff --git a/src/views/tool/gen/modules/gen-table-operate-drawer.vue b/src/views/tool/gen/modules/gen-table-operate-drawer.vue index f61b4fbe..2f8171c2 100644 --- a/src/views/tool/gen/modules/gen-table-operate-drawer.vue +++ b/src/views/tool/gen/modules/gen-table-operate-drawer.vue @@ -356,7 +356,7 @@ const columns: NaiveUI.TableColumn[] = [ From d5bbc37dec1160683d3b55d3cf9f32770344a558 Mon Sep 17 00:00:00 2001 From: AN <1983933789@qq.com> Date: Wed, 10 Sep 2025 11:48:13 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix(projects):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=83=A8=E9=97=A8=E6=97=B6=E4=B8=8D=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=B8=8A=E7=BA=A7=E9=83=A8=E9=97=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/dept/modules/dept-operate-drawer.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/views/system/dept/modules/dept-operate-drawer.vue b/src/views/system/dept/modules/dept-operate-drawer.vue index 2e6c8dae..b5e53bc1 100644 --- a/src/views/system/dept/modules/dept-operate-drawer.vue +++ b/src/views/system/dept/modules/dept-operate-drawer.vue @@ -40,6 +40,7 @@ const deptData = ref([]); const userOptions = ref[]>([]); const placeholder = ref($t('page.system.dept.placeholder.defaultLeaderPlaceHolder')); const disabled = ref(false); +const expandedKeys = ref([]); const title = computed(() => { const titles: Record = { @@ -55,7 +56,7 @@ const model: Model = reactive(createDefaultModel()); function createDefaultModel(): Model { return { - parentId: '', + parentId: props.rowData?.deptId || '', deptName: '', deptCategory: '', orderNum: null, @@ -80,7 +81,6 @@ const rules: Record = { function handleUpdateModelWhenEdit() { if (props.operateType === 'add') { Object.assign(model, createDefaultModel()); - model.parentId = props.rowData?.deptId || 0; } if (props.operateType === 'edit' && props.rowData) { @@ -144,6 +144,7 @@ async function getDeptData() { if (data) { deptData.value = handleTree(data, { idField: 'deptId' }); + expandedKeys.value = [deptData.value[0].deptId]; } endDeptLoading(); } @@ -186,15 +187,15 @@ watch(visible, () => { - +