From 7f04b119a7da5a0bcbdba6334005a9a61cd6f313 Mon Sep 17 00:00:00 2001 From: xlsea Date: Tue, 16 Dec 2025 16:26:15 +0800 Subject: [PATCH] =?UTF-8?q?feat(project):=20=E4=BC=98=E5=8C=96=E4=B8=9A?= =?UTF-8?q?=E5=8A=A1=E4=BB=A3=E7=A0=81=E8=AF=AD=E6=B3=95=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/java/VelocityUtils.java | 4 +- docs/template/index-tree.vue.vm | 14 ++- docs/template/index.vue.vm | 13 ++- docs/template/modules/operate-drawer.vue.vm | 105 +++++++++--------- docs/template/modules/search.vue.vm | 57 ++-------- src/components/custom/dict-checkbox.vue | 28 +++++ src/components/custom/menu-tree-select.vue | 3 +- src/hooks/common/table.ts | 78 +------------ src/typings/common.d.ts | 8 +- src/typings/components.d.ts | 4 + src/utils/common.ts | 43 ++++--- .../_builtin/login/modules/code-login.vue | 4 +- .../_builtin/login/modules/reset-pwd.vue | 4 +- .../demo/demo/modules/demo-operate-drawer.vue | 4 +- src/views/demo/demo/modules/demo-search.vue | 4 +- src/views/demo/tree/index.vue | 8 +- .../demo/tree/modules/tree-operate-drawer.vue | 27 +++-- src/views/demo/tree/modules/tree-search.vue | 26 +---- .../logininfor/modules/login-infor-search.vue | 4 +- .../monitor/online/modules/online-search.vue | 4 +- .../operlog/modules/oper-log-search.vue | 4 +- .../client/modules/client-operate-drawer.vue | 4 +- .../system/client/modules/client-search.vue | 4 +- .../config/modules/config-operate-drawer.vue | 4 +- .../system/config/modules/config-search.vue | 4 +- .../dept/modules/dept-operate-drawer.vue | 7 +- src/views/system/dept/modules/dept-search.vue | 4 +- .../dict/modules/dict-data-operate-drawer.vue | 4 +- .../system/dict/modules/dict-data-search.vue | 4 +- .../dict/modules/dict-type-operate-drawer.vue | 4 +- src/views/system/menu/index.vue | 3 +- .../modules/menu-cascade-delete-modal.vue | 4 +- .../menu/modules/menu-operate-drawer.vue | 4 +- .../notice/modules/notice-operate-drawer.vue | 4 +- .../system/notice/modules/notice-search.vue | 4 +- .../modules/oss-config-operate-drawer.vue | 4 +- .../oss-config/modules/oss-config-search.vue | 4 +- src/views/system/oss/modules/oss-search.vue | 4 +- .../post/modules/post-operate-drawer.vue | 4 +- src/views/system/post/modules/post-search.vue | 4 +- .../role/modules/role-data-scope-drawer.vue | 4 +- .../role/modules/role-operate-drawer.vue | 4 +- src/views/system/role/modules/role-search.vue | 4 +- .../modules/tenant-package-operate-drawer.vue | 4 +- .../modules/tenant-package-search.vue | 4 +- .../tenant/modules/tenant-operate-drawer.vue | 4 +- .../system/tenant/modules/tenant-search.vue | 4 +- .../user/modules/user-operate-drawer.vue | 4 +- .../user/modules/user-password-drawer.vue | 4 +- src/views/system/user/modules/user-search.vue | 7 +- .../tool/gen/modules/gen-table-db-search.vue | 4 +- .../tool/gen/modules/gen-table-search.vue | 4 +- 52 files changed, 264 insertions(+), 311 deletions(-) create mode 100644 src/components/custom/dict-checkbox.vue diff --git a/docs/java/VelocityUtils.java b/docs/java/VelocityUtils.java index abcb11eb..b9a50ce2 100644 --- a/docs/java/VelocityUtils.java +++ b/docs/java/VelocityUtils.java @@ -290,11 +290,11 @@ public class VelocityUtils { for (GenTableColumn column : columns) { if (!column.isSuperColumn() && StringUtils.isNotEmpty(column.getDictType()) && StringUtils.equalsAny( column.getHtmlType(), - new String[]{GenConstants.HTML_SELECT, GenConstants.HTML_RADIO, GenConstants.HTML_CHECKBOX})) { + GenConstants.HTML_SELECT, GenConstants.HTML_RADIO, GenConstants.HTML_CHECKBOX)) { Map dict = new HashMap<>(); dict.put("type", column.getDictType()); dict.put("name", StringUtils.toCamelCase(column.getDictType())); - dict.put("immediate", !column.isList()); + dict.put("immediate", column.isList()); dicts.add(dict); } } diff --git a/docs/template/index-tree.vue.vm b/docs/template/index-tree.vue.vm index a90982fb..54539474 100644 --- a/docs/template/index-tree.vue.vm +++ b/docs/template/index-tree.vue.vm @@ -11,11 +11,19 @@ import { $t } from '@/locales'; import ButtonIcon from '@/components/custom/button-icon.vue'; import ${BusinessName}OperateDrawer from './modules/${business__name}-operate-drawer.vue'; import ${BusinessName}Search from './modules/${business__name}-search.vue'; +#if($dictList && $dictList.size() > 0) +import { useDict } from '@/hooks/business/dict'; +#end defineOptions({ name: '${BusinessName}List' }); +#if($dictList && $dictList.size() > 0) +#foreach($dict in $dictList) +useDict('${dict.type}'#if(!$dict.immediate), false#end); +#end#end + const appStore = useAppStore(); const { download } = useDownload(); const { hasAuth } = useAuth(); @@ -64,7 +72,10 @@ const { key: '$column.javaField', title: '$column.columnComment', align: 'center', - minWidth: 120 + minWidth: 120#if($column.dictType), + render(row) { + return ; + }#end }, #end #end @@ -213,7 +224,6 @@ function handleExport() { v-model:visible="drawerVisible" :operate-type="operateType" :row-data="editingData" - :tree-list="data" @submitted="getData" /> diff --git a/docs/template/index.vue.vm b/docs/template/index.vue.vm index 7018d8a6..39889751 100644 --- a/docs/template/index.vue.vm +++ b/docs/template/index.vue.vm @@ -10,11 +10,19 @@ import { $t } from '@/locales'; import ButtonIcon from '@/components/custom/button-icon.vue'; import ${BusinessName}OperateDrawer from './modules/${business__name}-operate-drawer.vue'; import ${BusinessName}Search from './modules/${business__name}-search.vue'; +#if($dictList && $dictList.size() > 0) +import { useDict } from '@/hooks/business/dict'; +#end defineOptions({ name: '${BusinessName}List' }); +#if($dictList && $dictList.size() > 0) +#foreach($dict in $dictList) +useDict('${dict.type}'#if(!$dict.immediate), false#end); +#end#end + const appStore = useAppStore(); const { download } = useDownload(); const { hasAuth } = useAuth(); @@ -57,7 +65,10 @@ const { columns, columnChecks, data, getData, getDataByPage, loading, mobilePagi key: '$column.javaField', title: '$column.columnComment', align: 'center', - minWidth: 120 + minWidth: 120#if($column.dictType), + render(row) { + return ; + }#end }, #end #end diff --git a/docs/template/modules/operate-drawer.vue.vm b/docs/template/modules/operate-drawer.vue.vm index 974da54e..58dfab4a 100644 --- a/docs/template/modules/operate-drawer.vue.vm +++ b/docs/template/modules/operate-drawer.vue.vm @@ -1,9 +1,11 @@