feat: 重构代码生成模块并优化相关功能

- 重构代码生成模板,统一路由前缀和业务路径规范
- 优化数据库表分页查询性能,支持方言特定实现
- 新增同步数据库差异预览功能
- 调整字段配置界面,支持拖拽排序和批量设置
- 清理旧版示例代码和冗余配置
- 修复权限和路由嵌套路径处理问题
- 优化前端样式和交互细节
This commit is contained in:
zhangtao
2026-04-03 00:43:50 +08:00
parent 8a3360ef35
commit b552b29ac5
40 changed files with 3287 additions and 1811 deletions
@@ -12,7 +12,6 @@
<el-step title="字段配置" />
<el-step title="预览代码" />
</el-steps>
<p v-if="stepHintText" class="gencode-step-hint">{{ stepHintText }}</p>
<div class="gencode-drawer-step-wrap mt-4">
<div v-show="activeStep === 0">
@@ -104,13 +103,6 @@ import GenPreviewStep from "./GenPreviewStep.vue";
defineOptions({ name: "GenCodeDrawer" });
/** 每步一行,细则在基础配置页的折叠「对照表」 */
const STEP_HINTS = [
"配置包名、模块名与上级目录;点「下一步」保存并进入字段页(规则见本页折叠说明)。",
"批量设置可快速改列表/查询;点「下一步」保存并加载预览。",
"左侧点文件看代码;「下载」=ZIP;「写入本地」=服务端落盘并创建菜单。",
] as const;
const props = defineProps<{
info: GenTableSchema;
rules: FormRules;
@@ -126,7 +118,6 @@ const props = defineProps<{
bulkSet: (field: string | string[], value: unknown) => void;
}>();
const stepHintText = computed(() => STEP_HINTS[props.activeStep] ?? "");
const nextStepButtonLabel = computed(() =>
props.activeStep === 0 ? "下一步:字段配置" : "下一步:预览代码"
);
@@ -156,15 +147,8 @@ const emit = defineEmits<{
/* 新版 ElDrawer 内部用 Splitter,size 需为百分比或纯数字(px),勿用 min(),否则面板宽度可能异常 */
.gencode-drawer-step-wrap {
max-height: calc(100vh - 220px);
padding-right: 6px;
overflow-x: hidden;
overflow-y: auto;
padding-right: 6px;
}
.gencode-step-hint {
margin: 10px 0 0;
font-size: 13px;
line-height: 1.5;
color: var(--el-text-color-secondary);
}
</style>