@liujitcn/kratos-admin-system 0.0.29 → 0.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +46 -15
- package/dist/package/declarations/src/api/base/v1/notification.d.ts +26 -0
- package/dist/package/declarations/src/api/system/admin/v1/base_api_log.d.ts +10 -0
- package/dist/package/declarations/src/api/system/{base_area.d.ts → admin/v1/base_area.d.ts} +1 -1
- package/dist/package/declarations/src/api/system/{base_config.d.ts → admin/v1/base_config.d.ts} +5 -1
- package/dist/package/declarations/src/api/system/admin/v1/base_dashboard.d.ts +14 -0
- package/dist/package/declarations/src/api/system/admin/v1/base_data_access_log.d.ts +10 -0
- package/dist/package/declarations/src/api/system/admin/v1/base_dict.d.ts +20 -0
- package/dist/package/declarations/src/api/system/admin/v1/base_dict_item.d.ts +18 -0
- package/dist/package/declarations/src/api/system/admin/v1/base_file.d.ts +13 -0
- package/dist/package/declarations/src/api/system/{base_job.d.ts → admin/v1/base_job.d.ts} +4 -5
- package/dist/package/declarations/src/api/system/admin/v1/base_job_log.d.ts +9 -0
- package/dist/package/declarations/src/api/system/{base_language.d.ts → admin/v1/base_language.d.ts} +3 -3
- package/dist/package/declarations/src/api/system/admin/v1/base_log.d.ts +8 -0
- package/dist/package/declarations/src/api/system/admin/v1/base_login_log.d.ts +10 -0
- package/dist/package/declarations/src/api/system/admin/v1/base_login_policy.d.ts +19 -0
- package/dist/package/declarations/src/api/system/admin/v1/base_message.d.ts +24 -0
- package/dist/package/declarations/src/api/system/admin/v1/base_message_category.d.ts +21 -0
- package/dist/package/declarations/src/api/system/admin/v1/base_operation_log.d.ts +10 -0
- package/dist/package/declarations/src/api/system/admin/v1/base_permission_log.d.ts +10 -0
- package/dist/package/declarations/src/api/system/admin/v1/base_policy_evaluation_log.d.ts +10 -0
- package/dist/package/declarations/src/api/system/admin/v1/base_session.d.ts +11 -0
- package/dist/package/declarations/src/api/system/admin/v1/base_table_archive.d.ts +20 -0
- package/dist/package/declarations/src/api/system/admin/v1/base_table_archive_record.d.ts +11 -0
- package/dist/package/declarations/src/api/system/admin/v1/base_table_archive_restore.d.ts +14 -0
- package/dist/package/declarations/src/api/system/admin/v1/base_table_backup.d.ts +20 -0
- package/dist/package/declarations/src/api/system/admin/v1/base_table_backup_record.d.ts +11 -0
- package/dist/package/declarations/src/api/system/admin/v1/base_table_backup_restore.d.ts +14 -0
- package/dist/package/declarations/src/api/system/admin/v1/base_table_source.d.ts +11 -0
- package/dist/package/declarations/src/api/system/admin/v1/cache.d.ts +7 -0
- package/dist/package/declarations/src/api/system/admin/v1/oauth_client.d.ts +24 -0
- package/dist/package/declarations/src/api/system/base_redact_field.d.ts +20 -0
- package/dist/package/declarations/src/api/system/base_redact_policy.d.ts +19 -0
- package/dist/package/declarations/src/api/system/base_redact_rule.d.ts +22 -0
- package/dist/package/declarations/src/components/DynamicI18nCell.vue.d.ts +5 -1
- package/dist/package/declarations/src/components/ForcedPasswordDialog.vue.d.ts +3 -0
- package/dist/package/declarations/src/components/LogTable.vue.d.ts +52 -0
- package/dist/package/declarations/src/components/Notification.vue.d.ts +3 -0
- package/dist/package/declarations/src/components/dynamicI18n.d.ts +4 -7
- package/dist/package/declarations/src/components/log.d.ts +20 -0
- package/dist/package/declarations/src/config/base-log-fallback.d.ts +7 -0
- package/dist/package/declarations/src/config/database-backup.d.ts +12 -0
- package/dist/package/declarations/src/config/index.d.ts +7 -0
- package/dist/package/declarations/src/config/types.d.ts +56 -0
- package/dist/package/declarations/src/locales/generated.d.ts +1968 -88
- package/dist/package/declarations/src/rpc/base/v1/login.d.ts +151 -0
- package/dist/package/declarations/src/rpc/base/v1/notification.d.ts +306 -0
- package/dist/package/declarations/src/rpc/base/v1/oauth.d.ts +25 -0
- package/dist/package/declarations/src/rpc/base/v1/oauth_client.d.ts +23 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/auth.d.ts +13 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_api.d.ts +2 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_api_log.d.ts +84 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_config.d.ts +38 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_dashboard.d.ts +60 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_data_access_log.d.ts +112 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_dict.d.ts +0 -101
- package/dist/package/declarations/src/rpc/system/admin/v1/base_dict_item.d.ts +107 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_file.d.ts +73 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_i18n.d.ts +10 -6
- package/dist/package/declarations/src/rpc/system/admin/v1/base_job.d.ts +10 -56
- package/dist/package/declarations/src/rpc/system/admin/v1/base_job_log.d.ts +60 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_log.d.ts +66 -76
- package/dist/package/declarations/src/rpc/system/admin/v1/base_login_log.d.ts +92 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_login_policy.d.ts +179 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_message.d.ts +193 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_message_category.d.ts +125 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_operation_log.d.ts +106 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_permission_log.d.ts +118 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_policy_evaluation_log.d.ts +119 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_redact_common.d.ts +9 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_redact_field.d.ts +161 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_redact_policy.d.ts +150 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_redact_rule.d.ts +111 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_session.d.ts +33 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_table_archive.d.ts +90 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_table_archive_record.d.ts +82 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_table_archive_restore.d.ts +76 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_table_backup.d.ts +74 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_table_backup_record.d.ts +69 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_table_backup_restore.d.ts +76 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_table_source.d.ts +16 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_user.d.ts +18 -3
- package/dist/package/declarations/src/rpc/system/admin/v1/cache.d.ts +47 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/code_gen_column.d.ts +2 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/code_gen_table.d.ts +8 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/oauth_client.d.ts +145 -0
- package/dist/package/declarations/src/rpc/system/common/v1/common.d.ts +26 -0
- package/dist/package/declarations/src/rpc/system/config/v1/system_config.d.ts +8 -0
- package/dist/package/declarations/src/{api/system → utils}/code_gen_i18n.d.ts +1 -2
- package/dist/package/declarations/src/{api/system → utils}/code_gen_sse.d.ts +1 -1
- package/dist/package/declarations/src/utils/notification-response.d.ts +5 -0
- package/dist/package/declarations/src/{api/system → utils}/ops_monitoring_sse.d.ts +1 -1
- package/dist/package/declarations/src/{api/system → utils}/runtime_log_sse.d.ts +1 -1
- package/dist/package/declarations/src/views/base/api-log/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/backup-management/archive-config/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/backup-management/archive-record/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/backup-management/archive-restore/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/backup-management/backup-config/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/backup-management/backup-record/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/backup-management/backup-restore/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/dashboard/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/data-access-log/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/file/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/login-log/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/login-policy/format.d.ts +2 -0
- package/dist/package/declarations/src/views/base/login-policy/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/message/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/message-category/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/oauth-client/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/operation-log/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/permission-log/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/policy-evaluation-log/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/redact-field/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/redact-policy/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/redact-rule/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/runtime-config/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/message/inbox/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/profile/components/session.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/tool/cache/index.vue.d.ts +3 -0
- package/dist/package/src/api/base/v1/notification.ts +99 -0
- package/dist/package/src/api/base/{sse.ts → v1/sse.ts} +4 -4
- package/dist/package/src/api/system/{auth.ts → admin/v1/auth.ts} +1 -0
- package/dist/package/src/api/system/admin/v1/base_api_log.ts +33 -0
- package/dist/package/src/api/system/{base_area.ts → admin/v1/base_area.ts} +1 -1
- package/dist/package/src/api/system/{base_config.ts → admin/v1/base_config.ts} +20 -0
- package/dist/package/src/api/system/admin/v1/base_dashboard.ts +55 -0
- package/dist/package/src/api/system/admin/v1/base_data_access_log.ts +33 -0
- package/dist/package/src/api/system/{base_dict.ts → admin/v1/base_dict.ts} +0 -60
- package/dist/package/src/api/system/admin/v1/base_dict_item.ts +72 -0
- package/dist/package/src/api/system/admin/v1/base_file.ts +43 -0
- package/dist/package/src/api/system/{base_job.ts → admin/v1/base_job.ts} +11 -22
- package/dist/package/src/api/system/admin/v1/base_job_log.ts +32 -0
- package/dist/package/src/api/system/{base_language.ts → admin/v1/base_language.ts} +3 -3
- package/dist/package/src/api/system/admin/v1/base_log.ts +23 -0
- package/dist/package/src/api/system/admin/v1/base_login_log.ts +33 -0
- package/dist/package/src/api/system/admin/v1/base_login_policy.ts +67 -0
- package/dist/package/src/api/system/admin/v1/base_message.ts +90 -0
- package/dist/package/src/api/system/admin/v1/base_message_category.ts +80 -0
- package/dist/package/src/api/system/admin/v1/base_operation_log.ts +33 -0
- package/dist/package/src/api/system/admin/v1/base_permission_log.ts +33 -0
- package/dist/package/src/api/system/admin/v1/base_policy_evaluation_log.ts +33 -0
- package/dist/package/src/api/system/admin/v1/base_session.ts +33 -0
- package/dist/package/src/api/system/admin/v1/base_table_archive.ts +70 -0
- package/dist/package/src/api/system/admin/v1/base_table_archive_record.ts +33 -0
- package/dist/package/src/api/system/admin/v1/base_table_archive_restore.ts +44 -0
- package/dist/package/src/api/system/admin/v1/base_table_backup.ts +70 -0
- package/dist/package/src/api/system/admin/v1/base_table_backup_record.ts +33 -0
- package/dist/package/src/api/system/admin/v1/base_table_backup_restore.ts +44 -0
- package/dist/package/src/api/system/admin/v1/base_table_source.ts +33 -0
- package/dist/package/src/api/system/admin/v1/cache.ts +22 -0
- package/dist/package/src/api/system/{code_gen_column.ts → admin/v1/code_gen_column.ts} +19 -3
- package/dist/package/src/api/system/{code_gen_table.ts → admin/v1/code_gen_table.ts} +13 -4
- package/dist/package/src/api/system/admin/v1/oauth_client.ts +102 -0
- package/dist/package/src/api/system/base_redact_field.ts +25 -0
- package/dist/package/src/api/system/base_redact_policy.ts +24 -0
- package/dist/package/src/api/system/base_redact_rule.ts +27 -0
- package/dist/package/src/components/Ai.vue +1 -1
- package/dist/package/src/components/ChangePasswordForm.vue +143 -0
- package/dist/package/src/components/DynamicI18nCell.vue +28 -8
- package/dist/package/src/components/DynamicI18nEditor.vue +1 -1
- package/dist/package/src/components/ForcedPasswordDialog.vue +40 -0
- package/dist/package/src/components/LogTable.vue +190 -0
- package/dist/package/src/components/Notification.vue +301 -0
- package/dist/package/src/components/dynamicI18n.ts +5 -9
- package/dist/package/src/components/log.ts +87 -0
- package/dist/package/src/config/base-log-fallback.ts +26 -0
- package/dist/package/src/config/database-backup.ts +57 -0
- package/dist/package/src/config/index.ts +26 -0
- package/dist/package/src/config/types.ts +59 -0
- package/dist/package/src/locales/README.md +6 -3
- package/dist/package/src/locales/en-US.json +511 -29
- package/dist/package/src/locales/ja-JP.json +515 -33
- package/dist/package/src/locales/zh-CN.json +511 -29
- package/dist/package/src/locales/zh-TW.json +514 -32
- package/dist/package/src/module.ts +7 -2
- package/dist/package/src/rpc/base/v1/login.ts +174 -0
- package/dist/package/src/rpc/base/v1/notification.ts +343 -0
- package/dist/package/src/rpc/base/v1/oauth.ts +25 -0
- package/dist/package/src/rpc/base/v1/oauth_client.ts +33 -0
- package/dist/package/src/rpc/system/admin/v1/auth.ts +13 -0
- package/dist/package/src/rpc/system/admin/v1/base_api.ts +2 -0
- package/dist/package/src/rpc/system/admin/v1/base_api_log.ts +102 -0
- package/dist/package/src/rpc/system/admin/v1/base_config.ts +42 -0
- package/dist/package/src/rpc/system/admin/v1/base_dashboard.ts +81 -0
- package/dist/package/src/rpc/system/admin/v1/base_data_access_log.ts +135 -0
- package/dist/package/src/rpc/system/admin/v1/base_dict.ts +0 -112
- package/dist/package/src/rpc/system/admin/v1/base_dict_item.ts +126 -0
- package/dist/package/src/rpc/system/admin/v1/base_file.ts +88 -0
- package/dist/package/src/rpc/system/admin/v1/base_i18n.ts +10 -6
- package/dist/package/src/rpc/system/admin/v1/base_job.ts +10 -62
- package/dist/package/src/rpc/system/admin/v1/base_job_log.ts +75 -0
- package/dist/package/src/rpc/system/admin/v1/base_log.ts +67 -78
- package/dist/package/src/rpc/system/admin/v1/base_login_log.ts +113 -0
- package/dist/package/src/rpc/system/admin/v1/base_login_policy.ts +212 -0
- package/dist/package/src/rpc/system/admin/v1/base_message.ts +236 -0
- package/dist/package/src/rpc/system/admin/v1/base_message_category.ts +149 -0
- package/dist/package/src/rpc/system/admin/v1/base_operation_log.ts +127 -0
- package/dist/package/src/rpc/system/admin/v1/base_permission_log.ts +142 -0
- package/dist/package/src/rpc/system/admin/v1/base_policy_evaluation_log.ts +143 -0
- package/dist/package/src/rpc/system/admin/v1/base_redact_common.ts +17 -0
- package/dist/package/src/rpc/system/admin/v1/base_redact_field.ts +182 -0
- package/dist/package/src/rpc/system/admin/v1/base_redact_policy.ts +174 -0
- package/dist/package/src/rpc/system/admin/v1/base_redact_rule.ts +131 -0
- package/dist/package/src/rpc/system/admin/v1/base_session.ts +44 -0
- package/dist/package/src/rpc/system/admin/v1/base_table_archive.ts +109 -0
- package/dist/package/src/rpc/system/admin/v1/base_table_archive_record.ts +95 -0
- package/dist/package/src/rpc/system/admin/v1/base_table_archive_restore.ts +93 -0
- package/dist/package/src/rpc/system/admin/v1/base_table_backup.ts +91 -0
- package/dist/package/src/rpc/system/admin/v1/base_table_backup_record.ts +82 -0
- package/dist/package/src/rpc/system/admin/v1/base_table_backup_restore.ts +91 -0
- package/dist/package/src/rpc/system/admin/v1/base_table_source.ts +26 -0
- package/dist/package/src/rpc/system/admin/v1/base_user.ts +18 -3
- package/dist/package/src/rpc/system/admin/v1/cache.ts +59 -0
- package/dist/package/src/rpc/system/admin/v1/code_gen_column.ts +2 -0
- package/dist/package/src/rpc/system/admin/v1/code_gen_table.ts +8 -0
- package/dist/package/src/rpc/system/admin/v1/oauth_client.ts +174 -0
- package/dist/package/src/rpc/system/common/v1/common.ts +35 -0
- package/dist/package/src/rpc/system/config/v1/system_config.ts +16 -0
- package/dist/package/src/{api/system → utils}/code_gen_i18n.ts +1 -1
- package/dist/package/src/{api/system → utils}/code_gen_sse.ts +1 -1
- package/dist/package/src/utils/notification-response.ts +22 -0
- package/dist/package/src/{api/system → utils}/ops_monitoring_sse.ts +1 -1
- package/dist/package/src/{api/system → utils}/runtime_log_sse.ts +1 -1
- package/dist/package/src/views/ai/chat/components/AiMarkdown.vue +1 -1
- package/dist/package/src/views/ai/chat/components/ChatPanel.vue +4 -6
- package/dist/package/src/views/ai/chat/components/XSender.vue +1 -1
- package/dist/package/src/views/ai/chat/index.vue +3 -3
- package/dist/package/src/views/ai/chat/message.ts +2 -3
- package/dist/package/src/views/base/api/index.vue +4 -4
- package/dist/package/src/views/base/api-log/index.vue +94 -0
- package/dist/package/src/views/base/area/index.vue +1 -1
- package/dist/package/src/views/base/backup-management/archive-config/index.vue +151 -0
- package/dist/package/src/views/base/backup-management/archive-record/index.vue +44 -0
- package/dist/package/src/views/base/backup-management/archive-restore/index.vue +59 -0
- package/dist/package/src/views/base/backup-management/backup-config/index.vue +119 -0
- package/dist/package/src/views/base/backup-management/backup-record/index.vue +41 -0
- package/dist/package/src/views/base/backup-management/backup-restore/index.vue +66 -0
- package/dist/package/src/views/base/config/index.vue +19 -28
- package/dist/package/src/views/base/dashboard/index.vue +202 -0
- package/dist/package/src/views/base/data-access-log/index.vue +96 -0
- package/dist/package/src/views/base/dept/index.vue +11 -11
- package/dist/package/src/views/base/dict/index.vue +7 -7
- package/dist/package/src/views/base/dict/item.vue +14 -14
- package/dist/package/src/views/base/file/index.vue +323 -0
- package/dist/package/src/views/base/job/index.vue +63 -8
- package/dist/package/src/views/base/job/log.vue +38 -11
- package/dist/package/src/views/base/language/index.vue +3 -2
- package/dist/package/src/views/base/login-log/index.vue +96 -0
- package/dist/package/src/views/base/login-policy/format.ts +4 -0
- package/dist/package/src/views/base/login-policy/index.vue +530 -0
- package/dist/package/src/views/base/menu/index.vue +19 -19
- package/dist/package/src/views/base/message/index.vue +712 -0
- package/dist/package/src/views/base/message-category/index.vue +387 -0
- package/dist/package/src/views/base/migration/index.vue +2 -2
- package/dist/package/src/views/base/oauth-client/index.vue +421 -0
- package/dist/package/src/views/base/operation-log/index.vue +86 -0
- package/dist/package/src/views/base/permission-log/index.vue +90 -0
- package/dist/package/src/views/base/policy-evaluation-log/index.vue +93 -0
- package/dist/package/src/views/base/post/index.vue +11 -11
- package/dist/package/src/views/base/redact-field/index.vue +59 -0
- package/dist/package/src/views/base/redact-policy/index.vue +92 -0
- package/dist/package/src/views/base/redact-rule/index.vue +51 -0
- package/dist/package/src/views/base/role/index.vue +9 -9
- package/dist/package/src/views/base/runtime-config/index.vue +479 -0
- package/dist/package/src/views/base/tenant/index.vue +9 -9
- package/dist/package/src/views/base/user/components/dept-tree.vue +1 -1
- package/dist/package/src/views/base/user/index.vue +86 -47
- package/dist/package/src/views/message/inbox/index.vue +276 -0
- package/dist/package/src/views/profile/components/base.vue +90 -13
- package/dist/package/src/views/profile/components/password.vue +3 -229
- package/dist/package/src/views/profile/components/security.vue +477 -64
- package/dist/package/src/views/profile/components/session.vue +161 -0
- package/dist/package/src/views/profile/index.vue +45 -31
- package/dist/package/src/views/tool/api-doc/index.vue +3 -3
- package/dist/package/src/views/tool/cache/index.vue +352 -0
- package/dist/package/src/views/tool/code-gen/code-preview/index.vue +4 -4
- package/dist/package/src/views/tool/code-gen/columns/index.vue +16 -16
- package/dist/package/src/views/tool/code-gen/components/CodeGenLocaleEditor.vue +2 -2
- package/dist/package/src/views/tool/code-gen/components/CodeGenProgressDialog.vue +2 -2
- package/dist/package/src/views/tool/code-gen/config.ts +3 -0
- package/dist/package/src/views/tool/code-gen/preview/index.vue +9 -9
- package/dist/package/src/views/tool/code-gen/proto/index.vue +10 -12
- package/dist/package/src/views/tool/code-gen/table/index.vue +71 -15
- package/dist/package/src/views/tool/ops-monitoring/index.vue +55 -116
- package/dist/package/src/views/tool/project-doc/index.vue +2 -2
- package/dist/package/src/views/tool/runtime-log/index.vue +6 -6
- package/package.json +7 -2
- package/dist/package/declarations/src/api/system/base_dict.d.ts +0 -32
- package/dist/package/declarations/src/api/system/base_log.d.ts +0 -9
- package/dist/package/src/api/system/base_log.ts +0 -32
- package/dist/package/src/views/base/log/index.vue +0 -339
- /package/dist/package/declarations/src/api/base/{ai_message.d.ts → v1/ai_message.d.ts} +0 -0
- /package/dist/package/declarations/src/api/base/{ai_session.d.ts → v1/ai_session.d.ts} +0 -0
- /package/dist/package/declarations/src/api/base/{ai_tool.d.ts → v1/ai_tool.d.ts} +0 -0
- /package/dist/package/declarations/src/api/base/{oauth.d.ts → v1/oauth.d.ts} +0 -0
- /package/dist/package/declarations/src/api/base/{sse.d.ts → v1/sse.d.ts} +0 -0
- /package/dist/package/declarations/src/api/system/{auth.d.ts → admin/v1/auth.d.ts} +0 -0
- /package/dist/package/declarations/src/api/system/{base_api.d.ts → admin/v1/base_api.d.ts} +0 -0
- /package/dist/package/declarations/src/api/system/{base_dept.d.ts → admin/v1/base_dept.d.ts} +0 -0
- /package/dist/package/declarations/src/api/system/{base_i18n.d.ts → admin/v1/base_i18n.d.ts} +0 -0
- /package/dist/package/declarations/src/api/system/{base_menu.d.ts → admin/v1/base_menu.d.ts} +0 -0
- /package/dist/package/declarations/src/api/system/{base_migration.d.ts → admin/v1/base_migration.d.ts} +0 -0
- /package/dist/package/declarations/src/api/system/{base_post.d.ts → admin/v1/base_post.d.ts} +0 -0
- /package/dist/package/declarations/src/api/system/{base_role.d.ts → admin/v1/base_role.d.ts} +0 -0
- /package/dist/package/declarations/src/api/system/{base_tenant.d.ts → admin/v1/base_tenant.d.ts} +0 -0
- /package/dist/package/declarations/src/api/system/{base_user.d.ts → admin/v1/base_user.d.ts} +0 -0
- /package/dist/package/declarations/src/api/system/{code_gen.d.ts → admin/v1/code_gen.d.ts} +0 -0
- /package/dist/package/declarations/src/api/system/{code_gen_column.d.ts → admin/v1/code_gen_column.d.ts} +0 -0
- /package/dist/package/declarations/src/api/system/{code_gen_proto.d.ts → admin/v1/code_gen_proto.d.ts} +0 -0
- /package/dist/package/declarations/src/api/system/{code_gen_table.d.ts → admin/v1/code_gen_table.d.ts} +0 -0
- /package/dist/package/declarations/src/api/system/{ops_monitoring.d.ts → admin/v1/ops_monitoring.d.ts} +0 -0
- /package/dist/package/declarations/src/api/system/{project_document.d.ts → admin/v1/project_document.d.ts} +0 -0
- /package/dist/package/declarations/src/api/system/{runtime_log.d.ts → admin/v1/runtime_log.d.ts} +0 -0
- /package/dist/package/declarations/src/{views/base/log/index.vue.d.ts → components/ChangePasswordForm.vue.d.ts} +0 -0
- /package/dist/package/src/api/base/{ai_message.ts → v1/ai_message.ts} +0 -0
- /package/dist/package/src/api/base/{ai_session.ts → v1/ai_session.ts} +0 -0
- /package/dist/package/src/api/base/{ai_tool.ts → v1/ai_tool.ts} +0 -0
- /package/dist/package/src/api/base/{oauth.ts → v1/oauth.ts} +0 -0
- /package/dist/package/src/api/system/{base_api.ts → admin/v1/base_api.ts} +0 -0
- /package/dist/package/src/api/system/{base_dept.ts → admin/v1/base_dept.ts} +0 -0
- /package/dist/package/src/api/system/{base_i18n.ts → admin/v1/base_i18n.ts} +0 -0
- /package/dist/package/src/api/system/{base_menu.ts → admin/v1/base_menu.ts} +0 -0
- /package/dist/package/src/api/system/{base_migration.ts → admin/v1/base_migration.ts} +0 -0
- /package/dist/package/src/api/system/{base_post.ts → admin/v1/base_post.ts} +0 -0
- /package/dist/package/src/api/system/{base_role.ts → admin/v1/base_role.ts} +0 -0
- /package/dist/package/src/api/system/{base_tenant.ts → admin/v1/base_tenant.ts} +0 -0
- /package/dist/package/src/api/system/{base_user.ts → admin/v1/base_user.ts} +0 -0
- /package/dist/package/src/api/system/{code_gen.ts → admin/v1/code_gen.ts} +0 -0
- /package/dist/package/src/api/system/{code_gen_proto.ts → admin/v1/code_gen_proto.ts} +0 -0
- /package/dist/package/src/api/system/{ops_monitoring.ts → admin/v1/ops_monitoring.ts} +0 -0
- /package/dist/package/src/api/system/{project_document.ts → admin/v1/project_document.ts} +0 -0
- /package/dist/package/src/api/system/{runtime_log.ts → admin/v1/runtime_log.ts} +0 -0
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
import { computed, ref, watch } from "vue";
|
|
33
33
|
import { Clock, Promotion } from "@element-plus/icons-vue";
|
|
34
34
|
import { useRoute } from "vue-router";
|
|
35
|
-
import { t } from "@liujitcn/kratos-admin-core";
|
|
35
|
+
import { setAdminDocumentTitle, t } from "@liujitcn/kratos-admin-core";
|
|
36
36
|
import { useAuthButtons } from "@liujitcn/kratos-admin-core/auth";
|
|
37
37
|
import { useTabsStore } from "@liujitcn/kratos-admin-core/stores/runtime";
|
|
38
|
-
import { defCodeGenService } from "@liujitcn/kratos-admin-system/api/system/code_gen";
|
|
39
|
-
import { defCodeGenTableService } from "@liujitcn/kratos-admin-system/api/system/code_gen_table";
|
|
38
|
+
import { defCodeGenService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/code_gen";
|
|
39
|
+
import { defCodeGenTableService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/code_gen_table";
|
|
40
40
|
import type { CodeGenPreviewFile } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/code_gen";
|
|
41
41
|
import type { CodeGenTableForm } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/code_gen_table";
|
|
42
42
|
import { CodeGenTableStatus } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/code_gen_table";
|
|
@@ -124,7 +124,7 @@ async function loadCodePreview() {
|
|
|
124
124
|
function syncWorkspaceTitle() {
|
|
125
125
|
const title = t("system.code.gen.preview.title.workspace", { table: pageTitle.value });
|
|
126
126
|
tabsStore.setTabsTitle(title);
|
|
127
|
-
|
|
127
|
+
setAdminDocumentTitle(title);
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
/** 启动当前生成对象的代码生成任务。 */
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
<el-button
|
|
109
109
|
:icon="ChatLineSquare"
|
|
110
110
|
circle
|
|
111
|
-
:type="hasMissingColumnLocales(row) ? 'warning' : 'success'"
|
|
111
|
+
:type="hasMissingColumnLocales(row as CodeGenColumnView) ? 'warning' : 'success'"
|
|
112
112
|
:aria-label="t('system.code.gen.i18n.action.edit_column')"
|
|
113
113
|
/>
|
|
114
114
|
</template>
|
|
@@ -148,7 +148,7 @@
|
|
|
148
148
|
v-model="row.query_config.component"
|
|
149
149
|
:disabled="!canEdit || !row.query_config.enabled"
|
|
150
150
|
:placeholder="t('system.code.gen.column.placeholder.query_component')"
|
|
151
|
-
@change="handleComponentChange(row, 'query')"
|
|
151
|
+
@change="handleComponentChange(row as CodeGenColumnView, 'query')"
|
|
152
152
|
>
|
|
153
153
|
<el-option
|
|
154
154
|
v-for="item in queryComponentOptions"
|
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
:type="hasOptionConfig(row.query_config.option) ? 'primary' : 'default'"
|
|
168
168
|
:icon="Setting"
|
|
169
169
|
:disabled="!canEdit"
|
|
170
|
-
@click="openOptionDialog(row, 'query')"
|
|
170
|
+
@click="openOptionDialog(row as CodeGenColumnView, 'query')"
|
|
171
171
|
>
|
|
172
172
|
{{ t("system.code.gen.column.action.options") }}
|
|
173
173
|
</el-button>
|
|
@@ -190,7 +190,7 @@
|
|
|
190
190
|
v-model="row.list_config.component"
|
|
191
191
|
:disabled="!canEdit || !row.list_config.enabled"
|
|
192
192
|
:placeholder="t('system.code.gen.column.placeholder.list_component')"
|
|
193
|
-
@change="handleComponentChange(row, 'list')"
|
|
193
|
+
@change="handleComponentChange(row as CodeGenColumnView, 'list')"
|
|
194
194
|
>
|
|
195
195
|
<el-option
|
|
196
196
|
v-for="item in listComponentOptions"
|
|
@@ -209,7 +209,7 @@
|
|
|
209
209
|
:type="hasOptionConfig(row.list_config.option) ? 'primary' : 'default'"
|
|
210
210
|
:icon="Setting"
|
|
211
211
|
:disabled="!canEdit"
|
|
212
|
-
@click="openOptionDialog(row, 'list')"
|
|
212
|
+
@click="openOptionDialog(row as CodeGenColumnView, 'list')"
|
|
213
213
|
>
|
|
214
214
|
{{ t("system.code.gen.column.action.options") }}
|
|
215
215
|
</el-button>
|
|
@@ -227,13 +227,13 @@
|
|
|
227
227
|
inline-prompt
|
|
228
228
|
:active-text="t('system.code.gen.value.on')"
|
|
229
229
|
:inactive-text="t('system.code.gen.value.off')"
|
|
230
|
-
@change="handleFormEnabledChange(row)"
|
|
230
|
+
@change="handleFormEnabledChange(row as CodeGenColumnView)"
|
|
231
231
|
/>
|
|
232
232
|
<el-select
|
|
233
233
|
v-model="row.form_config.component"
|
|
234
234
|
:disabled="!canEdit || !row.form_config.enabled"
|
|
235
235
|
:placeholder="t('system.code.gen.column.placeholder.form_component')"
|
|
236
|
-
@change="handleComponentChange(row, 'form')"
|
|
236
|
+
@change="handleComponentChange(row as CodeGenColumnView, 'form')"
|
|
237
237
|
>
|
|
238
238
|
<el-option
|
|
239
239
|
v-for="item in formComponentOptions"
|
|
@@ -255,7 +255,7 @@
|
|
|
255
255
|
:type="hasOptionConfig(row.form_config.option) ? 'primary' : 'default'"
|
|
256
256
|
:icon="Setting"
|
|
257
257
|
:disabled="!canEdit"
|
|
258
|
-
@click="openOptionDialog(row, 'form')"
|
|
258
|
+
@click="openOptionDialog(row as CodeGenColumnView, 'form')"
|
|
259
259
|
>
|
|
260
260
|
{{ t("system.code.gen.column.action.options") }}
|
|
261
261
|
</el-button>
|
|
@@ -538,14 +538,14 @@ import Sortable from "sortablejs";
|
|
|
538
538
|
import { computed, nextTick, onBeforeUnmount, onMounted, reactive, ref, watch } from "vue";
|
|
539
539
|
import { ChatLineSquare, Delete, Document, List, Plus, Setting } from "@element-plus/icons-vue";
|
|
540
540
|
import { useRoute, useRouter } from "vue-router";
|
|
541
|
-
import { t } from "@liujitcn/kratos-admin-core";
|
|
541
|
+
import { setAdminDocumentTitle, t } from "@liujitcn/kratos-admin-core";
|
|
542
542
|
import ProDialog from "@liujitcn/kratos-admin-core/components/Dialog/ProDialog.vue";
|
|
543
543
|
import { useAuthButtons } from "@liujitcn/kratos-admin-core/auth";
|
|
544
544
|
import { useTabsStore } from "@liujitcn/kratos-admin-core/stores/runtime";
|
|
545
|
-
import { defBaseDictService } from "@liujitcn/kratos-admin-system/api/system/base_dict";
|
|
546
|
-
import { loadEnabledBaseLanguages } from "@liujitcn/kratos-admin-system/api/system/base_language";
|
|
547
|
-
import { defCodeGenColumnService } from "@liujitcn/kratos-admin-system/api/system/code_gen_column";
|
|
548
|
-
import { defCodeGenTableService } from "@liujitcn/kratos-admin-system/api/system/code_gen_table";
|
|
545
|
+
import { defBaseDictService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_dict";
|
|
546
|
+
import { loadEnabledBaseLanguages } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_language";
|
|
547
|
+
import { defCodeGenColumnService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/code_gen_column";
|
|
548
|
+
import { defCodeGenTableService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/code_gen_table";
|
|
549
549
|
import type { OptionBaseDictResponse_BaseDict } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_dict";
|
|
550
550
|
import type {
|
|
551
551
|
CodeGenColumn as CodeGenColumnDTO,
|
|
@@ -742,7 +742,7 @@ function syncWorkspaceTitle() {
|
|
|
742
742
|
? t("system.code.gen.column.title.workspace_with_table", { table: tableTitle })
|
|
743
743
|
: t("system.code.gen.column.title.workspace");
|
|
744
744
|
tabsStore.setTabsTitle(title);
|
|
745
|
-
|
|
745
|
+
setAdminDocumentTitle(title);
|
|
746
746
|
}
|
|
747
747
|
|
|
748
748
|
/** 保存字段配置。 */
|
|
@@ -986,7 +986,7 @@ async function loadDatabaseTables() {
|
|
|
986
986
|
if (databaseTablesLoaded || loadingDatabaseTables.value) return;
|
|
987
987
|
loadingDatabaseTables.value = true;
|
|
988
988
|
try {
|
|
989
|
-
const data = await defCodeGenTableService.ListCodeGenDatabaseTable({});
|
|
989
|
+
const data = await defCodeGenTableService.ListCodeGenDatabaseTable({ source_name: formData.source_name });
|
|
990
990
|
databaseTables.value = data.tables ?? [];
|
|
991
991
|
databaseTablesLoaded = true;
|
|
992
992
|
} finally {
|
|
@@ -999,7 +999,7 @@ async function loadDatabaseColumns(tableName: string) {
|
|
|
999
999
|
if (!tableName || databaseColumns[tableName] || loadingDatabaseColumns.has(tableName)) return;
|
|
1000
1000
|
loadingDatabaseColumns.add(tableName);
|
|
1001
1001
|
try {
|
|
1002
|
-
const data = await defCodeGenColumnService.ListCodeGenDatabaseColumn({ table_name: tableName });
|
|
1002
|
+
const data = await defCodeGenColumnService.ListCodeGenDatabaseColumn({ source_name: formData.source_name, table_name: tableName });
|
|
1003
1003
|
databaseColumns[tableName] = data.columns ?? [];
|
|
1004
1004
|
} finally {
|
|
1005
1005
|
loadingDatabaseColumns.delete(tableName);
|
|
@@ -67,8 +67,8 @@
|
|
|
67
67
|
import { computed, ref } from "vue";
|
|
68
68
|
import { Promotion } from "@element-plus/icons-vue";
|
|
69
69
|
import { t } from "@liujitcn/kratos-admin-core";
|
|
70
|
-
import { defBaseI18nService } from "@liujitcn/kratos-admin-system/api/system/base_i18n";
|
|
71
|
-
import { loadEnabledBaseLanguages, useEnabledBaseLanguages } from "@liujitcn/kratos-admin-system/api/system/base_language";
|
|
70
|
+
import { defBaseI18nService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_i18n";
|
|
71
|
+
import { loadEnabledBaseLanguages, useEnabledBaseLanguages } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_language";
|
|
72
72
|
import type { CodeGenLocaleConfig } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_i18n";
|
|
73
73
|
|
|
74
74
|
/** 代码生成多语言编辑器属性。 */
|
|
@@ -109,8 +109,8 @@ import { onBeforeUnmount, ref, watch } from "vue";
|
|
|
109
109
|
import { Check, CircleClose, Clock, CopyDocument, Document, Loading, Minus } from "@element-plus/icons-vue";
|
|
110
110
|
import { getCurrentLocale, t } from "@liujitcn/kratos-admin-core";
|
|
111
111
|
import ProDialog from "@liujitcn/kratos-admin-core/components/Dialog/ProDialog.vue";
|
|
112
|
-
import { defCodeGenService } from "@liujitcn/kratos-admin-system/api/system/code_gen";
|
|
113
|
-
import { subscribeCodeGenProgress, type SseStop } from "
|
|
112
|
+
import { defCodeGenService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/code_gen";
|
|
113
|
+
import { subscribeCodeGenProgress, type SseStop } from "../../../../utils/code_gen_sse";
|
|
114
114
|
import type { CodeGenTask } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/code_gen";
|
|
115
115
|
import { CodeGenTaskStatus, CodeGenTaskStepStatus } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/code_gen";
|
|
116
116
|
|
|
@@ -73,6 +73,7 @@ const codeGenFormComponentLabelKeys: Record<ProFormComponentType, string> = {
|
|
|
73
73
|
password: "system.code.gen.component.password",
|
|
74
74
|
textarea: "system.code.gen.component.textarea",
|
|
75
75
|
"input-number": "system.code.gen.component.input_number",
|
|
76
|
+
"color-picker": "system.code.gen.component.color_picker",
|
|
76
77
|
segmented: "system.code.gen.component.segmented",
|
|
77
78
|
switch: "system.code.gen.component.switch",
|
|
78
79
|
checkbox: "system.code.gen.component.checkbox",
|
|
@@ -105,6 +106,7 @@ export function codeGenFormComponentOptions(): ProFormOption[] {
|
|
|
105
106
|
/** 代码生成表配置校验规则。 */
|
|
106
107
|
export function codeGenTableRules(): FormRules {
|
|
107
108
|
return {
|
|
109
|
+
source_name: [{ required: true, message: t("system.code.gen.validation.source_required"), trigger: "change" }],
|
|
108
110
|
name: [{ required: true, max: 128, message: t("system.code.gen.validation.table_required"), trigger: "change" }],
|
|
109
111
|
business_module: [
|
|
110
112
|
{
|
|
@@ -160,6 +162,7 @@ export function createDefaultCodeGenLeftTreeConfig(): CodeGenLeftTreeConfig {
|
|
|
160
162
|
export function createDefaultCodeGenTableForm(): CodeGenTableForm {
|
|
161
163
|
return {
|
|
162
164
|
id: 0,
|
|
165
|
+
source_name: "",
|
|
163
166
|
name: "",
|
|
164
167
|
comment: "",
|
|
165
168
|
business_module: "",
|
|
@@ -82,7 +82,7 @@ import { computed, nextTick, onMounted, reactive, ref, watch } from "vue";
|
|
|
82
82
|
import { ElMessage, ElMessageBox } from "element-plus";
|
|
83
83
|
import { CirclePlus, Delete, EditPen } from "@element-plus/icons-vue";
|
|
84
84
|
import { useRoute } from "vue-router";
|
|
85
|
-
import { t } from "@liujitcn/kratos-admin-core";
|
|
85
|
+
import { setAdminDocumentTitle, t } from "@liujitcn/kratos-admin-core";
|
|
86
86
|
import ProTable from "@liujitcn/kratos-admin-core/components/ProTable";
|
|
87
87
|
import type {
|
|
88
88
|
ColumnProps,
|
|
@@ -95,10 +95,10 @@ import PasswordStrength from "@liujitcn/kratos-admin-core/components/PasswordStr
|
|
|
95
95
|
import type { ProFormComponentType, ProFormField, ProFormOption } from "@liujitcn/kratos-admin-core/components/ProForm/interface";
|
|
96
96
|
import TreeFilter from "@liujitcn/kratos-admin-core/components/TreeFilter/index.vue";
|
|
97
97
|
import { useTabsStore } from "@liujitcn/kratos-admin-core/stores/runtime";
|
|
98
|
-
import { defBaseDictService } from "@liujitcn/kratos-admin-system/api/system/base_dict";
|
|
99
|
-
import { defCodeGenColumnService } from "@liujitcn/kratos-admin-system/api/system/code_gen_column";
|
|
100
|
-
import { defCodeGenProtoService } from "@liujitcn/kratos-admin-system/api/system/code_gen_proto";
|
|
101
|
-
import { defCodeGenTableService } from "@liujitcn/kratos-admin-system/api/system/code_gen_table";
|
|
98
|
+
import { defBaseDictService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_dict";
|
|
99
|
+
import { defCodeGenColumnService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/code_gen_column";
|
|
100
|
+
import { defCodeGenProtoService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/code_gen_proto";
|
|
101
|
+
import { defCodeGenTableService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/code_gen_table";
|
|
102
102
|
import type { OptionBaseDictResponse_BaseDict } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_dict";
|
|
103
103
|
import type { CodeGenColumn, CodeGenColumnOptionConfig } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/code_gen_column";
|
|
104
104
|
import type { CodeGenProtoCheck } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/code_gen_proto";
|
|
@@ -430,12 +430,12 @@ async function loadPreview() {
|
|
|
430
430
|
dictionaries.value = [];
|
|
431
431
|
databaseTables.value = [];
|
|
432
432
|
if (!tableId.value) return;
|
|
433
|
-
const
|
|
434
|
-
|
|
433
|
+
const table = await defCodeGenTableService.GetCodeGenTable({ id: tableId.value });
|
|
434
|
+
const [columnResponse, protoResponse, dictionaryResponse, databaseTableResponse] = await Promise.all([
|
|
435
435
|
defCodeGenColumnService.ListCodeGenColumn({ table_id: tableId.value }),
|
|
436
436
|
defCodeGenProtoService.ListCodeGenProto({ table_id: tableId.value }),
|
|
437
437
|
defBaseDictService.OptionBaseDict({}),
|
|
438
|
-
defCodeGenTableService.ListCodeGenDatabaseTable({})
|
|
438
|
+
defCodeGenTableService.ListCodeGenDatabaseTable({ source_name: table.source_name })
|
|
439
439
|
]);
|
|
440
440
|
snapshot.value = { table, columns: columnResponse.code_gen_columns ?? [] };
|
|
441
441
|
protoChecks.value = protoResponse.code_gen_protos ?? [];
|
|
@@ -548,7 +548,7 @@ function createMockRows() {
|
|
|
548
548
|
function syncWorkspaceTitle() {
|
|
549
549
|
const title = snapshot.value?.table.comment || snapshot.value?.table.name || t("system.code.gen.preview.title.data_list");
|
|
550
550
|
tabsStore.setTabsTitle(title);
|
|
551
|
-
|
|
551
|
+
setAdminDocumentTitle(title);
|
|
552
552
|
}
|
|
553
553
|
|
|
554
554
|
/** 将数据库表名转换为生成器使用的实体名。 */
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
import { computed, onMounted, reactive, ref, watch } from "vue";
|
|
127
127
|
import { Document, Setting } from "@element-plus/icons-vue";
|
|
128
128
|
import { useRoute, useRouter } from "vue-router";
|
|
129
|
-
import { t } from "@liujitcn/kratos-admin-core";
|
|
129
|
+
import { setAdminDocumentTitle, t } from "@liujitcn/kratos-admin-core";
|
|
130
130
|
import ProDialog from "@liujitcn/kratos-admin-core/components/Dialog/ProDialog.vue";
|
|
131
131
|
import ProForm from "@liujitcn/kratos-admin-core/components/ProForm/index.vue";
|
|
132
132
|
import type { ProFormField, ProFormOption } from "@liujitcn/kratos-admin-core/components/ProForm/interface";
|
|
@@ -134,9 +134,9 @@ import type { ColumnProps } from "@liujitcn/kratos-admin-core/components/ProTabl
|
|
|
134
134
|
import ProTable from "@liujitcn/kratos-admin-core/components/ProTable";
|
|
135
135
|
import { useAuthButtons } from "@liujitcn/kratos-admin-core/auth";
|
|
136
136
|
import { useTabsStore } from "@liujitcn/kratos-admin-core/stores/runtime";
|
|
137
|
-
import { defCodeGenColumnService } from "@liujitcn/kratos-admin-system/api/system/code_gen_column";
|
|
138
|
-
import { defCodeGenProtoService } from "@liujitcn/kratos-admin-system/api/system/code_gen_proto";
|
|
139
|
-
import { defCodeGenTableService } from "@liujitcn/kratos-admin-system/api/system/code_gen_table";
|
|
137
|
+
import { defCodeGenColumnService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/code_gen_column";
|
|
138
|
+
import { defCodeGenProtoService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/code_gen_proto";
|
|
139
|
+
import { defCodeGenTableService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/code_gen_table";
|
|
140
140
|
import type {
|
|
141
141
|
CodeGenProto,
|
|
142
142
|
CodeGenProtoCheck,
|
|
@@ -328,13 +328,11 @@ async function handleQuery() {
|
|
|
328
328
|
databaseTables.value = [];
|
|
329
329
|
Object.keys(targetColumnOptions).forEach(key => delete targetColumnOptions[key]);
|
|
330
330
|
if (!tableId.value) return;
|
|
331
|
-
const
|
|
332
|
-
|
|
333
|
-
defCodeGenTableService.ListCodeGenDatabaseTable({})
|
|
334
|
-
]);
|
|
331
|
+
const table = await defCodeGenTableService.GetCodeGenTable({ id: tableId.value });
|
|
332
|
+
const tableResponse = await defCodeGenTableService.ListCodeGenDatabaseTable({ source_name: table.source_name });
|
|
335
333
|
Object.assign(formData, table);
|
|
336
334
|
databaseTables.value = tableResponse.tables ?? [];
|
|
337
|
-
const columnResponse = await defCodeGenColumnService.ListCodeGenDatabaseColumn({ table_name: formData.name });
|
|
335
|
+
const columnResponse = await defCodeGenColumnService.ListCodeGenDatabaseColumn({ source_name: formData.source_name, table_name: formData.name });
|
|
338
336
|
targetColumnOptions[formData.name] = createColumnOptions(columnResponse.columns ?? []);
|
|
339
337
|
await loadProtoChecks();
|
|
340
338
|
syncWorkspaceTitle();
|
|
@@ -352,7 +350,7 @@ function syncWorkspaceTitle() {
|
|
|
352
350
|
? t("system.code.gen.proto.title.workspace_with_table", { table: tableTitle })
|
|
353
351
|
: t("system.code.gen.proto.title.workspace");
|
|
354
352
|
tabsStore.setTabsTitle(title);
|
|
355
|
-
|
|
353
|
+
setAdminDocumentTitle(title);
|
|
356
354
|
}
|
|
357
355
|
|
|
358
356
|
/**
|
|
@@ -533,7 +531,7 @@ async function loadTargetColumnOptions(tableName: string) {
|
|
|
533
531
|
if (!tableName || targetColumnOptions[tableName] || loadingTargetColumns.has(tableName)) return;
|
|
534
532
|
loadingTargetColumns.add(tableName);
|
|
535
533
|
try {
|
|
536
|
-
const data = await defCodeGenColumnService.ListCodeGenDatabaseColumn({ table_name: tableName });
|
|
534
|
+
const data = await defCodeGenColumnService.ListCodeGenDatabaseColumn({ source_name: formData.source_name, table_name: tableName });
|
|
537
535
|
targetColumnOptions[tableName] = createColumnOptions(data.columns ?? []);
|
|
538
536
|
} finally {
|
|
539
537
|
loadingTargetColumns.delete(tableName);
|
|
@@ -717,7 +715,7 @@ onMounted(() => {
|
|
|
717
715
|
white-space: pre;
|
|
718
716
|
background: var(--admin-page-card-bg-soft);
|
|
719
717
|
border: 1px solid var(--admin-page-card-border-soft);
|
|
720
|
-
border-radius:
|
|
718
|
+
border-radius: var(--admin-page-radius);
|
|
721
719
|
}
|
|
722
720
|
.code-gen-proto-capability-popover__item {
|
|
723
721
|
display: grid;
|
|
@@ -68,11 +68,12 @@ import ProTable from "@liujitcn/kratos-admin-core/components/ProTable";
|
|
|
68
68
|
import FormDialog from "@liujitcn/kratos-admin-core/components/Dialog/FormDialog.vue";
|
|
69
69
|
import type { ProFormField, ProFormOption } from "@liujitcn/kratos-admin-core/components/ProForm/interface";
|
|
70
70
|
import { useAuthButtons } from "@liujitcn/kratos-admin-core/auth";
|
|
71
|
-
import { defBaseMenuService } from "@liujitcn/kratos-admin-system/api/system/base_menu";
|
|
72
|
-
import { defBaseDictService } from "@liujitcn/kratos-admin-system/api/system/base_dict";
|
|
73
|
-
import { defCodeGenService } from "@liujitcn/kratos-admin-system/api/system/code_gen";
|
|
74
|
-
import { defCodeGenColumnService } from "@liujitcn/kratos-admin-system/api/system/code_gen_column";
|
|
75
|
-
import { defCodeGenTableService } from "@liujitcn/kratos-admin-system/api/system/code_gen_table";
|
|
71
|
+
import { defBaseMenuService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_menu";
|
|
72
|
+
import { defBaseDictService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_dict";
|
|
73
|
+
import { defCodeGenService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/code_gen";
|
|
74
|
+
import { defCodeGenColumnService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/code_gen_column";
|
|
75
|
+
import { defCodeGenTableService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/code_gen_table";
|
|
76
|
+
import { defBaseTableSourceService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_table_source";
|
|
76
77
|
import type { CodeGenDatabaseColumn } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/code_gen_column";
|
|
77
78
|
import type {
|
|
78
79
|
CodeGenDatabaseTable,
|
|
@@ -126,6 +127,8 @@ const router = useRouter();
|
|
|
126
127
|
const proTable = ref<ProTableInstance>();
|
|
127
128
|
const formDialogRef = ref<InstanceType<typeof FormDialog>>();
|
|
128
129
|
const saving = ref(false);
|
|
130
|
+
const sourceOptions = ref<ProFormOption[]>([]);
|
|
131
|
+
const loadingSourceOptions = ref(false);
|
|
129
132
|
const databaseTables = ref<CodeGenDatabaseTable[]>([]);
|
|
130
133
|
const businessModuleItems = ref<OptionBaseDictResponse_BaseDictItem[]>([]);
|
|
131
134
|
const databaseColumns = ref<CodeGenDatabaseColumn[]>([]);
|
|
@@ -186,6 +189,21 @@ const leftTreeColumnOptions = computed<ProFormOption[]>(() => createDatabaseColu
|
|
|
186
189
|
|
|
187
190
|
/** 代码生成表配置表单字段。 */
|
|
188
191
|
const formFields = computed<ProFormField[]>(() => [
|
|
192
|
+
{
|
|
193
|
+
prop: "source_name",
|
|
194
|
+
label: t("system.code.gen.table.field.source_name"),
|
|
195
|
+
component: "select",
|
|
196
|
+
options: sourceOptions.value,
|
|
197
|
+
colSpan: 24,
|
|
198
|
+
labelTooltip: t("system.code.gen.table.tooltip.source_name"),
|
|
199
|
+
props: {
|
|
200
|
+
loading: loadingSourceOptions.value,
|
|
201
|
+
placeholder: t("system.code.gen.table.placeholder.source_name"),
|
|
202
|
+
filterable: true,
|
|
203
|
+
style: { width: "100%" },
|
|
204
|
+
onChange: handleSourceNameChange
|
|
205
|
+
}
|
|
206
|
+
},
|
|
189
207
|
// 标签提示与当前生成器的实际读写逻辑保持一致,方便配置时判断影响范围。
|
|
190
208
|
{
|
|
191
209
|
prop: "name",
|
|
@@ -411,6 +429,7 @@ const formFields = computed<ProFormField[]>(() => [
|
|
|
411
429
|
/** 代码生成表配置列表列。 */
|
|
412
430
|
const columns = computed<ColumnProps[]>(() => [
|
|
413
431
|
{ type: "selection", width: 55 },
|
|
432
|
+
{ prop: "source_name", label: t("system.code.gen.table.field.source_name"), minWidth: 130 },
|
|
414
433
|
{ prop: "name", label: t("system.code.gen.table.field.name"), minWidth: 160, search: { el: "input" } },
|
|
415
434
|
{ prop: "comment", label: t("system.code.gen.table.field.comment"), minWidth: 160, showOverflowTooltip: true },
|
|
416
435
|
{
|
|
@@ -745,17 +764,19 @@ function refreshTable() {
|
|
|
745
764
|
/** 打开新增或编辑弹窗,并加载当前表单所需选项。 */
|
|
746
765
|
async function handleOpenDialog(tableId?: number) {
|
|
747
766
|
resetForm();
|
|
767
|
+
await loadSourceOptions();
|
|
768
|
+
const detail = tableId ? await defCodeGenTableService.GetCodeGenTable({ id: tableId }) : undefined;
|
|
769
|
+
if (detail) Object.assign(formData, detail);
|
|
770
|
+
if (!formData.source_name) formData.source_name = String(sourceOptions.value[0]?.value ?? "");
|
|
748
771
|
const [tableData, menuData, dictionaryData] = await Promise.all([
|
|
749
|
-
|
|
772
|
+
loadDatabaseTables(formData.source_name),
|
|
750
773
|
defBaseMenuService.TreeBaseMenu({}),
|
|
751
774
|
defBaseDictService.OptionBaseDict({})
|
|
752
775
|
]);
|
|
753
776
|
databaseTables.value = tableData.tables ?? [];
|
|
754
777
|
parentMenuOptions.value = convertMenuOptions(menuData.base_menus ?? []);
|
|
755
778
|
businessModuleItems.value = dictionaryData.base_dicts?.find(item => item.code === "business_module")?.items ?? [];
|
|
756
|
-
if (
|
|
757
|
-
const detail = await defCodeGenTableService.GetCodeGenTable({ id: tableId });
|
|
758
|
-
Object.assign(formData, detail);
|
|
779
|
+
if (detail) {
|
|
759
780
|
formData.parent_menu_id = detail.parent_menu_id || undefined;
|
|
760
781
|
formData.left_tree_config ??= createDefaultCodeGenLeftTreeConfig();
|
|
761
782
|
if (!formData.comment) {
|
|
@@ -765,12 +786,24 @@ async function handleOpenDialog(tableId?: number) {
|
|
|
765
786
|
formData.left_tree_config.comment =
|
|
766
787
|
databaseTables.value.find(item => item.name === formData.left_tree_config?.table_name)?.comment ?? "";
|
|
767
788
|
}
|
|
768
|
-
await Promise.all([loadDatabaseColumns(databaseColumns, formData.name), loadLeftTreeDatabaseColumns()]);
|
|
789
|
+
await Promise.all([loadDatabaseColumns(databaseColumns, formData.source_name, formData.name), loadLeftTreeDatabaseColumns()]);
|
|
769
790
|
dialog.editing = true;
|
|
770
791
|
}
|
|
771
792
|
dialog.visible = true;
|
|
772
793
|
}
|
|
773
794
|
|
|
795
|
+
/** 加载已初始化的数据源选项。 */
|
|
796
|
+
async function loadSourceOptions() {
|
|
797
|
+
if (sourceOptions.value.length || loadingSourceOptions.value) return;
|
|
798
|
+
loadingSourceOptions.value = true;
|
|
799
|
+
try {
|
|
800
|
+
const data = await defBaseTableSourceService.OptionBaseTableSource({});
|
|
801
|
+
sourceOptions.value = (data.value ?? []).map(value => ({ label: value, value }));
|
|
802
|
+
} finally {
|
|
803
|
+
loadingSourceOptions.value = false;
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
|
|
774
807
|
/** 关闭弹窗并清理表单状态。 */
|
|
775
808
|
function handleCloseDialog() {
|
|
776
809
|
dialog.visible = false;
|
|
@@ -794,7 +827,7 @@ async function handleTableNameChange(tableName: string) {
|
|
|
794
827
|
const table = databaseTables.value.find(item => item.name === tableName);
|
|
795
828
|
formData.comment = table?.comment ?? "";
|
|
796
829
|
formData.i18n_config = new Map();
|
|
797
|
-
await loadDatabaseColumns(databaseColumns, tableName);
|
|
830
|
+
await loadDatabaseColumns(databaseColumns, formData.source_name, tableName);
|
|
798
831
|
resetUnavailableTableColumns();
|
|
799
832
|
formData.parent_column = resolveDefaultColumn(databaseColumns.value, "parent_id");
|
|
800
833
|
formData.tree_label_column = resolveDefaultColumn(databaseColumns.value, "name");
|
|
@@ -879,13 +912,36 @@ async function handleDelete(selected?: CodeGenDeleteTarget) {
|
|
|
879
912
|
refreshTable();
|
|
880
913
|
}
|
|
881
914
|
|
|
882
|
-
/**
|
|
883
|
-
async function
|
|
915
|
+
/** 切换数据源后清理旧表并重新加载当前数据源的表列表。 */
|
|
916
|
+
async function handleSourceNameChange(value: string | number | boolean | undefined) {
|
|
917
|
+
formData.source_name = String(value ?? "");
|
|
918
|
+
formData.name = "";
|
|
919
|
+
formData.comment = "";
|
|
920
|
+
formData.i18n_config = new Map();
|
|
921
|
+
databaseColumns.value = [];
|
|
922
|
+
leftTreeDatabaseColumns.value = [];
|
|
923
|
+
resetLeftTreeConfig();
|
|
924
|
+
await loadDatabaseTables(formData.source_name);
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
/** 按数据源加载代码生成可选数据库表。 */
|
|
928
|
+
async function loadDatabaseTables(sourceName: string) {
|
|
929
|
+
if (!sourceName) {
|
|
930
|
+
databaseTables.value = [];
|
|
931
|
+
return { tables: [] as CodeGenDatabaseTable[] };
|
|
932
|
+
}
|
|
933
|
+
const data = await defCodeGenTableService.ListCodeGenDatabaseTable({ source_name: sourceName });
|
|
934
|
+
databaseTables.value = data.tables ?? [];
|
|
935
|
+
return data;
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
/** 查询指定数据源的数据表字段选项。 */
|
|
939
|
+
async function loadDatabaseColumns(target: { value: CodeGenDatabaseColumn[] }, sourceName: string, tableName: string) {
|
|
884
940
|
if (!tableName) {
|
|
885
941
|
target.value = [];
|
|
886
942
|
return;
|
|
887
943
|
}
|
|
888
|
-
const data = await defCodeGenColumnService.ListCodeGenDatabaseColumn({ table_name: tableName });
|
|
944
|
+
const data = await defCodeGenColumnService.ListCodeGenDatabaseColumn({ source_name: sourceName, table_name: tableName });
|
|
889
945
|
target.value = data.columns ?? [];
|
|
890
946
|
}
|
|
891
947
|
|
|
@@ -896,7 +952,7 @@ async function loadLeftTreeDatabaseColumns() {
|
|
|
896
952
|
leftTreeDatabaseColumns.value = [];
|
|
897
953
|
return;
|
|
898
954
|
}
|
|
899
|
-
await loadDatabaseColumns(leftTreeDatabaseColumns, config.table_name);
|
|
955
|
+
await loadDatabaseColumns(leftTreeDatabaseColumns, formData.source_name, config.table_name);
|
|
900
956
|
}
|
|
901
957
|
|
|
902
958
|
/** 转换数据库字段为 ProForm 选择项。 */
|