@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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CodeGenLocaleConfig } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_i18n";
|
|
2
2
|
|
|
3
3
|
/** 代码生成国际化配置的 JSON 兼容形态。 */
|
|
4
|
-
type CodeGenLocaleConfigRecord = Record<string, CodeGenLocaleConfig>;
|
|
4
|
+
export type CodeGenLocaleConfigRecord = Record<string, CodeGenLocaleConfig>;
|
|
5
5
|
|
|
6
6
|
/** 将 REST 响应中的 JSON 对象规范为生成 RPC 声明使用的 Map。 */
|
|
7
7
|
export function normalizeCodeGenLocaleConfigMap(value: unknown): Map<string, CodeGenLocaleConfig> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CodeGenTask } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/code_gen";
|
|
2
|
-
import { subscribeSseEvent, type SseStop } from "../base/sse";
|
|
2
|
+
import { subscribeSseEvent, type SseStop } from "../api/base/v1/sse";
|
|
3
3
|
|
|
4
4
|
const sseStreamCodeGen = "system.admin.codegen";
|
|
5
5
|
const sseEventCodeGenProgress = "codegen.progress";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { NotificationSummary, PageNotificationResponse } from "../rpc/base/v1/notification";
|
|
2
|
+
|
|
3
|
+
/** 归一化站内信分页响应。 */
|
|
4
|
+
export function normalizePageNotificationResponse(response: Partial<PageNotificationResponse>): PageNotificationResponse {
|
|
5
|
+
return {
|
|
6
|
+
...response,
|
|
7
|
+
notifications: response.notifications ?? [],
|
|
8
|
+
total: response.total ?? 0,
|
|
9
|
+
next_cursor_id: response.next_cursor_id ?? 0,
|
|
10
|
+
has_more: response.has_more ?? false
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** 归一化站内信未读汇总响应。 */
|
|
15
|
+
export function normalizeNotificationSummary(response: Partial<NotificationSummary>): NotificationSummary {
|
|
16
|
+
return {
|
|
17
|
+
...response,
|
|
18
|
+
unread_total: response.unread_total ?? 0,
|
|
19
|
+
latest_delivery_id: response.latest_delivery_id ?? 0,
|
|
20
|
+
category_unread: response.category_unread ?? []
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -115,11 +115,11 @@
|
|
|
115
115
|
</template>
|
|
116
116
|
<div class="agent-message-tool-payload">
|
|
117
117
|
<section class="agent-message-tool-payload__section">
|
|
118
|
-
<div class="agent-message-tool-payload__label">
|
|
118
|
+
<div class="agent-message-tool-payload__label">{{ t("system.ai.chat.field.request_payload") }}</div>
|
|
119
119
|
<pre>{{ formatToolRequest(tool) }}</pre>
|
|
120
120
|
</section>
|
|
121
121
|
<section class="agent-message-tool-payload__section">
|
|
122
|
-
<div class="agent-message-tool-payload__label">
|
|
122
|
+
<div class="agent-message-tool-payload__label">{{ t("system.ai.chat.field.response_payload") }}</div>
|
|
123
123
|
<pre>{{ formatToolResponse(tool) }}</pre>
|
|
124
124
|
</section>
|
|
125
125
|
</div>
|
|
@@ -848,11 +848,9 @@ function formatToolRequest(tool: AiToolCall) {
|
|
|
848
848
|
return formatToolArguments(input);
|
|
849
849
|
}
|
|
850
850
|
|
|
851
|
-
/**
|
|
851
|
+
/** 格式化工具出参。 */
|
|
852
852
|
function formatToolResponse(tool: AiToolCall) {
|
|
853
|
-
|
|
854
|
-
if (hasToolPayloadValue(tool.input) && !isJSONLikeText(tool.input)) return formatToolPayload(tool.input);
|
|
855
|
-
return "{}";
|
|
853
|
+
return hasToolPayloadValue(tool.output) ? formatToolPayload(tool.output) : "{}";
|
|
856
854
|
}
|
|
857
855
|
|
|
858
856
|
/** 判断文本是否像 JSON,工具请求报文正常应由模型参数 JSON 构成。 */
|
|
@@ -107,7 +107,7 @@ import type { FilesCardProps } from "vue-element-plus-x/types/FilesCard";
|
|
|
107
107
|
import { Loading, Microphone, Paperclip, Promotion } from "@element-plus/icons-vue";
|
|
108
108
|
import { ElMessage } from "element-plus";
|
|
109
109
|
import { t } from "@liujitcn/kratos-admin-core";
|
|
110
|
-
import { defFileService } from "@liujitcn/kratos-admin-core/api/base/file";
|
|
110
|
+
import { defFileService } from "@liujitcn/kratos-admin-core/api/base/v1/file";
|
|
111
111
|
import type { AiAttachment } from "@liujitcn/kratos-admin-system/rpc/base/v1/ai_session";
|
|
112
112
|
import type { SubmitPayload } from "../types";
|
|
113
113
|
import { buildAIAttachmentFileCard } from "../attachment";
|
|
@@ -51,9 +51,9 @@ import { DArrowRight } from "@element-plus/icons-vue";
|
|
|
51
51
|
import { ElMessage, ElMessageBox } from "element-plus";
|
|
52
52
|
import { getCurrentLocale, t } from "@liujitcn/kratos-admin-core";
|
|
53
53
|
import { getAdminAiExtension } from "@liujitcn/kratos-admin-system";
|
|
54
|
-
import { defAiMessageService } from "@liujitcn/kratos-admin-system/api/base/ai_message";
|
|
55
|
-
import { defAiSessionService } from "@liujitcn/kratos-admin-system/api/base/ai_session";
|
|
56
|
-
import { defAiToolService } from "@liujitcn/kratos-admin-system/api/base/ai_tool";
|
|
54
|
+
import { defAiMessageService } from "@liujitcn/kratos-admin-system/api/base/v1/ai_message";
|
|
55
|
+
import { defAiSessionService } from "@liujitcn/kratos-admin-system/api/base/v1/ai_session";
|
|
56
|
+
import { defAiToolService } from "@liujitcn/kratos-admin-system/api/base/v1/ai_tool";
|
|
57
57
|
import type { AiAction } from "@liujitcn/kratos-admin-system/rpc/base/v1/ai_message";
|
|
58
58
|
import type { AiSession } from "@liujitcn/kratos-admin-system/rpc/base/v1/ai_session";
|
|
59
59
|
import type { AiShortcut } from "@liujitcn/kratos-admin-system/rpc/base/v1/ai_tool";
|
|
@@ -15,7 +15,6 @@ import type { AiStreamPayload, AIFlowBlock, ChatMessageItem, ReplySourceTag } fr
|
|
|
15
15
|
const THINKING_MESSAGE_ID_PREFIX = "ai-thinking";
|
|
16
16
|
const LOCAL_USER_MESSAGE_ID_PREFIX = "ai-user-local";
|
|
17
17
|
const PENDING_STREAM_MESSAGE_ID = "pending";
|
|
18
|
-
const DEFAULT_SESSION_TITLES = new Set(["新对话", "新對話", "New conversation"]);
|
|
19
18
|
const thinkingMessageContent = () => t("system.ai.chat.message.thinking");
|
|
20
19
|
|
|
21
20
|
/** 生成流式消息分组键,确保同一轮回复只更新当前占位气泡。 */
|
|
@@ -52,10 +51,10 @@ export function normalizeSession(session?: Partial<AiSession> | null): AiSession
|
|
|
52
51
|
};
|
|
53
52
|
}
|
|
54
53
|
|
|
55
|
-
/**
|
|
54
|
+
/** 归一化会话文本。 */
|
|
56
55
|
function resolveSessionText(value: unknown, fallbackWhenEmpty: boolean) {
|
|
57
56
|
const text = String(value ?? "");
|
|
58
|
-
if (
|
|
57
|
+
if (fallbackWhenEmpty && !text) {
|
|
59
58
|
return t("system.ai.chat.value.new_conversation");
|
|
60
59
|
}
|
|
61
60
|
return text;
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
<el-table-column prop="path" :label="t('system.base.api.doc.field.name')" min-width="220" />
|
|
42
42
|
<el-table-column prop="in" :label="t('system.base.api.doc.field.location')" width="90" />
|
|
43
43
|
<el-table-column :label="t('system.base.api.doc.field.type')" min-width="180">
|
|
44
|
-
<template #default="{ row }">{{ formatSchemaType(row) }}</template>
|
|
44
|
+
<template #default="{ row }">{{ formatSchemaType(row as BaseApiDocSchema) }}</template>
|
|
45
45
|
</el-table-column>
|
|
46
46
|
<el-table-column :label="t('system.base.api.doc.field.required')" width="80" align="center">
|
|
47
47
|
<template #default="{ row }">{{ t(row.required ? "common.value.yes" : "common.value.no") }}</template>
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
>
|
|
68
68
|
<el-table-column prop="path" :label="t('system.base.api.doc.field.name')" min-width="220" />
|
|
69
69
|
<el-table-column :label="t('system.base.api.doc.field.type')" min-width="180">
|
|
70
|
-
<template #default="{ row }">{{ formatSchemaType(row) }}</template>
|
|
70
|
+
<template #default="{ row }">{{ formatSchemaType(row as BaseApiDocSchema) }}</template>
|
|
71
71
|
</el-table-column>
|
|
72
72
|
<el-table-column :label="t('system.base.api.doc.field.required')" width="80" align="center">
|
|
73
73
|
<template #default="{ row }">{{ t(row.required ? "common.value.yes" : "common.value.no") }}</template>
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
>
|
|
99
99
|
<el-table-column prop="path" :label="t('system.base.api.doc.field.name')" min-width="220" />
|
|
100
100
|
<el-table-column :label="t('system.base.api.doc.field.type')" min-width="180">
|
|
101
|
-
<template #default="{ row }">{{ formatSchemaType(row) }}</template>
|
|
101
|
+
<template #default="{ row }">{{ formatSchemaType(row as BaseApiDocSchema) }}</template>
|
|
102
102
|
</el-table-column>
|
|
103
103
|
<el-table-column
|
|
104
104
|
prop="description"
|
|
@@ -137,7 +137,7 @@ import ProTable from "@liujitcn/kratos-admin-core/components/ProTable";
|
|
|
137
137
|
import FormDialog from "@liujitcn/kratos-admin-core/components/Dialog/FormDialog.vue";
|
|
138
138
|
import type { ProFormField } from "@liujitcn/kratos-admin-core/components/ProForm/interface";
|
|
139
139
|
import { useAuthButtons } from "@liujitcn/kratos-admin-core/auth";
|
|
140
|
-
import { defBaseApiService } from "@liujitcn/kratos-admin-system/api/system/base_api";
|
|
140
|
+
import { defBaseApiService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_api";
|
|
141
141
|
import { Status } from "@liujitcn/kratos-admin-system/rpc/common/v1/enum";
|
|
142
142
|
import type {
|
|
143
143
|
BaseApi,
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<LogTable ref="page" :config="config" />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script setup lang="ts">
|
|
6
|
+
import { computed, ref } from "vue";
|
|
7
|
+
import type { ColumnProps } from "@liujitcn/kratos-admin-core/components/ProTable/interface";
|
|
8
|
+
import { t } from "@liujitcn/kratos-admin-core";
|
|
9
|
+
import { buildPageRequest } from "@liujitcn/kratos-admin-core/table";
|
|
10
|
+
import LogTable, { type LogTableConfig } from "@liujitcn/kratos-admin-system/components/LogTable.vue";
|
|
11
|
+
import {
|
|
12
|
+
createLogEnumOptions,
|
|
13
|
+
formatLogBytes,
|
|
14
|
+
formatLogDuration,
|
|
15
|
+
formatLogStatusCode,
|
|
16
|
+
logDateSearch,
|
|
17
|
+
logDetailColumn,
|
|
18
|
+
logEnumLabel,
|
|
19
|
+
requestLogTrace
|
|
20
|
+
} from "@liujitcn/kratos-admin-system/components/log";
|
|
21
|
+
import { defBaseApiLogService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_api_log";
|
|
22
|
+
import { BaseLogResult } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_log";
|
|
23
|
+
import type { BaseApiLog, PageBaseApiLogRequest } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_api_log";
|
|
24
|
+
|
|
25
|
+
defineOptions({ name: "BaseApiLog", inheritAttrs: false });
|
|
26
|
+
|
|
27
|
+
const page = ref<InstanceType<typeof LogTable>>();
|
|
28
|
+
const resultOptions = computed(() =>
|
|
29
|
+
createLogEnumOptions([
|
|
30
|
+
[BaseLogResult.BASE_LOG_RESULT_UNSPECIFIED, t("system.base.log.result.unspecified")],
|
|
31
|
+
[BaseLogResult.BASE_LOG_RESULT_SUCCESS, t("system.base.log.result.success")],
|
|
32
|
+
[BaseLogResult.BASE_LOG_RESULT_FAILURE, t("system.base.log.result.failure")],
|
|
33
|
+
[BaseLogResult.BASE_LOG_RESULT_ERROR, t("system.base.log.result.error")]
|
|
34
|
+
])
|
|
35
|
+
);
|
|
36
|
+
const columns = computed<ColumnProps[]>(() => [
|
|
37
|
+
{ prop: "operation", label: t("system.base.log.field.operation"), minWidth: 320, search: { el: "input" } },
|
|
38
|
+
{ prop: "method", label: t("system.base.log.field.method"), minWidth: 90 },
|
|
39
|
+
{ prop: "status_code", label: t("system.base.log.field.status_code"), minWidth: 100 },
|
|
40
|
+
{
|
|
41
|
+
prop: "result",
|
|
42
|
+
label: t("system.base.log.field.result"),
|
|
43
|
+
minWidth: 110,
|
|
44
|
+
search: { el: "select", enum: resultOptions.value },
|
|
45
|
+
render: scope => logEnumLabel(resultOptions.value, (scope.row as BaseApiLog).result)
|
|
46
|
+
},
|
|
47
|
+
{ prop: "latency_ms", label: t("system.base.log.field.latency_ms"), minWidth: 110 },
|
|
48
|
+
{ prop: "user_name", label: t("system.base.log.field.user_name"), minWidth: 130 },
|
|
49
|
+
{ prop: "occurred_at", label: t("system.base.log.field.occurred_at"), minWidth: 190, search: logDateSearch(t) },
|
|
50
|
+
logDetailColumn(t("common.action.view"), id => page.value?.handleOpenDialog(id))
|
|
51
|
+
]);
|
|
52
|
+
|
|
53
|
+
const config = computed<LogTableConfig>(() => ({
|
|
54
|
+
columns: columns.value,
|
|
55
|
+
detailTitle: t("system.base.log.api.title.detail"),
|
|
56
|
+
closeText: t("common.action.close"),
|
|
57
|
+
trace: requestLogTrace,
|
|
58
|
+
detailFields: [
|
|
59
|
+
{ key: "id", label: t("system.base.log.field.id") },
|
|
60
|
+
{ key: "tenant_id", label: t("system.base.log.field.tenant_id") },
|
|
61
|
+
{ key: "tenant_code", label: t("system.base.log.field.tenant_code") },
|
|
62
|
+
{ key: "user_id", label: t("system.base.log.field.user_id") },
|
|
63
|
+
{ key: "user_name", label: t("system.base.log.field.user_name") },
|
|
64
|
+
{ key: "service_name", label: t("system.base.log.field.service_name") },
|
|
65
|
+
{ key: "operation", label: t("system.base.log.field.operation"), span: 2 },
|
|
66
|
+
{ key: "method", label: t("system.base.log.field.method") },
|
|
67
|
+
{ key: "path", label: t("system.base.log.field.path"), span: 2 },
|
|
68
|
+
{ key: "status_code", label: t("system.base.log.field.status_code"), format: value => formatLogStatusCode(value, t) },
|
|
69
|
+
{ key: "result", label: t("system.base.log.field.result"), enum: resultOptions.value },
|
|
70
|
+
{ key: "reason_code", label: t("system.base.log.field.reason_code") },
|
|
71
|
+
{ key: "reason", label: t("system.base.log.field.reason"), span: 2 },
|
|
72
|
+
{ key: "latency_ms", label: t("system.base.log.field.latency_ms"), format: value => formatLogDuration(value, t) },
|
|
73
|
+
{ key: "request_size", label: t("system.base.log.field.request_size"), format: value => formatLogBytes(value, t) },
|
|
74
|
+
{ key: "response_size", label: t("system.base.log.field.response_size"), format: value => formatLogBytes(value, t) },
|
|
75
|
+
{ key: "client_ip", label: t("system.base.log.field.client_ip") },
|
|
76
|
+
{ key: "user_agent", label: t("system.base.log.field.user_agent"), span: 2 },
|
|
77
|
+
{ key: "request_id", label: t("system.base.log.field.request_id") },
|
|
78
|
+
{ key: "trace_id", label: t("system.base.log.field.trace_id") },
|
|
79
|
+
{ key: "occurred_at", label: t("system.base.log.field.occurred_at") },
|
|
80
|
+
{ key: "created_at", label: t("system.base.log.field.created_at") }
|
|
81
|
+
],
|
|
82
|
+
request: requestTable,
|
|
83
|
+
get: getDetail
|
|
84
|
+
}));
|
|
85
|
+
|
|
86
|
+
async function requestTable(params: Record<string, unknown>) {
|
|
87
|
+
const response = await defBaseApiLogService.PageBaseApiLog(buildPageRequest(params as unknown as PageBaseApiLogRequest));
|
|
88
|
+
return { list: response.base_api_logs as unknown as Record<string, unknown>[], total: response.total };
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
async function getDetail(id: string) {
|
|
92
|
+
return (await defBaseApiLogService.GetBaseApiLog({ id })) as unknown as Record<string, unknown>;
|
|
93
|
+
}
|
|
94
|
+
</script>
|
|
@@ -38,7 +38,7 @@ import ProTable from "@liujitcn/kratos-admin-core/components/ProTable";
|
|
|
38
38
|
import FormDialog from "@liujitcn/kratos-admin-core/components/Dialog/FormDialog.vue";
|
|
39
39
|
import type { ProFormField, ProFormOption } from "@liujitcn/kratos-admin-core/components/ProForm/interface";
|
|
40
40
|
import { useAuthButtons } from "@liujitcn/kratos-admin-core/auth";
|
|
41
|
-
import { defBaseAreaService } from "@liujitcn/kratos-admin-system/api/system/base_area";
|
|
41
|
+
import { defBaseAreaService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_area";
|
|
42
42
|
|
|
43
43
|
import type { TreeBaseAreaRequest, BaseArea, BaseAreaForm } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_area";
|
|
44
44
|
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="table-box">
|
|
3
|
+
<ProTable ref="proTable" row-key="id" :columns="columns" :header-actions="headerActions" :request-api="requestTable" />
|
|
4
|
+
<FormDialog
|
|
5
|
+
ref="formDialogRef"
|
|
6
|
+
v-model="dialog.visible"
|
|
7
|
+
:title="t(dialog.editing ? 'common.action.edit_resource' : 'common.action.create_resource', { resource: t('system.backup.archive.config') })"
|
|
8
|
+
:model="formData"
|
|
9
|
+
:fields="formFields"
|
|
10
|
+
:rules="formRules"
|
|
11
|
+
@confirm="handleSubmit"
|
|
12
|
+
@close="resetForm"
|
|
13
|
+
/>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script setup lang="ts">
|
|
18
|
+
import { computed, reactive, ref } from "vue";
|
|
19
|
+
import { CirclePlus, Delete, EditPen } from "@element-plus/icons-vue";
|
|
20
|
+
import { ElMessage, ElMessageBox } from "element-plus";
|
|
21
|
+
import ProTable from "@liujitcn/kratos-admin-core/components/ProTable";
|
|
22
|
+
import FormDialog from "@liujitcn/kratos-admin-core/components/Dialog/FormDialog.vue";
|
|
23
|
+
import type { ColumnProps, HeaderActionProps, ProTableInstance } from "@liujitcn/kratos-admin-core/components/ProTable/interface";
|
|
24
|
+
import type { ProFormField, ProFormOption } from "@liujitcn/kratos-admin-core/components/ProForm/interface";
|
|
25
|
+
import { useAuthButtons } from "@liujitcn/kratos-admin-core/auth";
|
|
26
|
+
import { buildPageRequest, normalizeSelectedIds } from "@liujitcn/kratos-admin-core/table";
|
|
27
|
+
import { t } from "@liujitcn/kratos-admin-core";
|
|
28
|
+
import { defBaseTableArchiveService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_table_archive";
|
|
29
|
+
import { defBaseTableSourceService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_table_source";
|
|
30
|
+
import { BaseTableArchiveMode, type BaseTableArchiveForm, type PageBaseTableArchiveRequest } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_table_archive";
|
|
31
|
+
import { Status } from "@liujitcn/kratos-admin-system/rpc/common/v1/enum";
|
|
32
|
+
|
|
33
|
+
defineOptions({ name: "BaseTableArchiveConfig", inheritAttrs: false });
|
|
34
|
+
const { BUTTONS } = useAuthButtons();
|
|
35
|
+
const proTable = ref<ProTableInstance>();
|
|
36
|
+
const formDialogRef = ref<InstanceType<typeof FormDialog>>();
|
|
37
|
+
const dialog = reactive({ visible: false, editing: false });
|
|
38
|
+
const formData = reactive<BaseTableArchiveForm>(defaultForm());
|
|
39
|
+
const sourceOptions = ref<ProFormOption[]>([]);
|
|
40
|
+
const tableOptions = ref<ProFormOption[]>([]);
|
|
41
|
+
const loadingSources = ref(false);
|
|
42
|
+
const loadingTables = ref(false);
|
|
43
|
+
const modeOptions = computed<ProFormOption[]>(() => [
|
|
44
|
+
{ label: t("system.backup.archive.mode.internal"), value: BaseTableArchiveMode.BASE_TABLE_ARCHIVE_MODE_INTERNAL_DATABASE },
|
|
45
|
+
{ label: t("system.backup.archive.mode.oss"), value: BaseTableArchiveMode.BASE_TABLE_ARCHIVE_MODE_OSS }
|
|
46
|
+
]);
|
|
47
|
+
const statusOptions = computed<ProFormOption[]>(() => [
|
|
48
|
+
{ label: t("common.status.enabled"), value: Status.STATUS_ENABLE },
|
|
49
|
+
{ label: t("common.status.disabled"), value: Status.STATUS_DISABLE }
|
|
50
|
+
]);
|
|
51
|
+
const formFields = computed<ProFormField[]>(() => [
|
|
52
|
+
{ prop: "source_name", label: t("system.backup.field.source_name"), component: "select", options: sourceOptions.value, props: { loading: loadingSources.value, filterable: true, placeholder: t("system.backup.placeholder.source_name"), onChange: handleSourceChange } },
|
|
53
|
+
{ prop: "table_name", label: t("system.backup.field.table_name"), component: "select", options: tableOptions.value, props: { loading: loadingTables.value, filterable: true, placeholder: t("system.backup.placeholder.table_name"), disabled: !formData.source_name } },
|
|
54
|
+
{ prop: "archive_mode", label: t("system.backup.field.archive_mode"), component: "select", options: modeOptions.value },
|
|
55
|
+
{ prop: "online_retention_days", label: t("system.backup.field.online_retention_days"), component: "input-number", props: { min: 0, max: 36500 } },
|
|
56
|
+
{ prop: "archive_retention_days", label: t("system.backup.field.archive_retention_days"), component: "input-number", props: { min: 0, max: 36500 } },
|
|
57
|
+
{ prop: "batch_size", label: t("system.backup.field.batch_size"), component: "input-number", props: { min: 1, max: 100000 } },
|
|
58
|
+
{ prop: "delete_after_verify", label: t("system.backup.field.delete_after_verify"), component: "switch" },
|
|
59
|
+
{ prop: "oss_prefix", label: t("system.backup.field.oss_prefix"), component: "input" },
|
|
60
|
+
{ prop: "status", label: t("common.field.status"), component: "radio-group", options: statusOptions.value }
|
|
61
|
+
]);
|
|
62
|
+
const formRules = computed(() => ({
|
|
63
|
+
source_name: [{ required: true, message: t("system.backup.validation.source_name"), trigger: "change" }],
|
|
64
|
+
table_name: [{ required: true, message: t("system.backup.validation.table_name"), trigger: "change" }]
|
|
65
|
+
}));
|
|
66
|
+
const columns = computed<ColumnProps[]>(() => [
|
|
67
|
+
{ type: "selection", width: 55 },
|
|
68
|
+
{ prop: "source_name", label: t("system.backup.field.source_name"), minWidth: 140 },
|
|
69
|
+
{ prop: "table_name", label: t("system.backup.field.table_name"), minWidth: 180 },
|
|
70
|
+
{ prop: "archive_mode", label: t("system.backup.field.archive_mode"), minWidth: 130, render: scope => modeLabel(scope.row.archive_mode) },
|
|
71
|
+
{ prop: "online_retention_days", label: t("system.backup.field.online_retention_days"), width: 120 },
|
|
72
|
+
{ prop: "archive_retention_days", label: t("system.backup.field.archive_retention_days"), width: 120 },
|
|
73
|
+
{ prop: "status", label: t("common.field.status"), width: 100, cellType: "status", statusProps: { activeValue: Status.STATUS_ENABLE, inactiveValue: Status.STATUS_DISABLE, activeText: t("common.status.enabled"), inactiveText: t("common.status.disabled"), disabled: () => !BUTTONS.value["base:table-archive:status"], beforeChange: scope => setStatus(scope.row as BaseTableArchiveForm) } },
|
|
74
|
+
{ prop: "operation", label: t("common.field.operation"), width: 180, fixed: "right", cellType: "actions", actions: [{ label: t("common.action.edit"), link: true, icon: EditPen, hidden: () => !BUTTONS.value["base:table-archive:update"], onClick: scope => openDialog((scope.row as BaseTableArchiveForm).id) }, { label: t("common.action.delete"), link: true, type: "danger", icon: Delete, hidden: () => !BUTTONS.value["base:table-archive:delete"], onClick: scope => remove(scope.row as BaseTableArchiveForm) }] }
|
|
75
|
+
]);
|
|
76
|
+
const headerActions = computed<HeaderActionProps[]>(() => [{ label: t("common.action.create"), type: "primary", icon: CirclePlus, hidden: !BUTTONS.value["base:table-archive:create"], onClick: () => openDialog() }, { label: t("common.action.delete"), type: "danger", icon: Delete, hidden: !BUTTONS.value["base:table-archive:delete"], disabled: scope => !scope.isSelected, onClick: scope => remove(scope.selectedListIds as number[]) }]);
|
|
77
|
+
|
|
78
|
+
async function requestTable(params: PageBaseTableArchiveRequest) {
|
|
79
|
+
const data = await defBaseTableArchiveService.PageBaseTableArchive(buildPageRequest(params));
|
|
80
|
+
return { data: { list: data.base_table_archives ?? [], total: data.total } };
|
|
81
|
+
}
|
|
82
|
+
function refresh() { proTable.value?.getTableList(); }
|
|
83
|
+
function defaultForm(): BaseTableArchiveForm { return { id: 0, source_name: "", table_name: "", archive_mode: BaseTableArchiveMode.BASE_TABLE_ARCHIVE_MODE_INTERNAL_DATABASE, online_retention_days: 180, archive_retention_days: 3650, batch_size: 5000, delete_after_verify: false, oss_prefix: "archive", status: Status.STATUS_ENABLE }; }
|
|
84
|
+
function resetForm() { dialog.visible = false; formDialogRef.value?.resetFields(); Object.assign(formData, defaultForm()); }
|
|
85
|
+
async function openDialog(id?: number) {
|
|
86
|
+
await loadSourceOptions();
|
|
87
|
+
Object.assign(formData, defaultForm());
|
|
88
|
+
dialog.editing = Boolean(id);
|
|
89
|
+
if (id) Object.assign(formData, await defBaseTableArchiveService.GetBaseTableArchive({ id }));
|
|
90
|
+
if (!formData.source_name) formData.source_name = String(sourceOptions.value[0]?.value ?? "");
|
|
91
|
+
await loadTableOptions(formData.source_name);
|
|
92
|
+
dialog.visible = true;
|
|
93
|
+
}
|
|
94
|
+
async function loadSourceOptions() {
|
|
95
|
+
if (sourceOptions.value.length || loadingSources.value) return;
|
|
96
|
+
loadingSources.value = true;
|
|
97
|
+
try {
|
|
98
|
+
const data = await defBaseTableSourceService.OptionBaseTableSource({});
|
|
99
|
+
sourceOptions.value = (data.value ?? []).map(value => ({ label: value, value }));
|
|
100
|
+
} finally {
|
|
101
|
+
loadingSources.value = false;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
async function handleSourceChange(value: string | number | boolean | undefined) {
|
|
105
|
+
formData.source_name = String(value ?? "");
|
|
106
|
+
formData.table_name = "";
|
|
107
|
+
await loadTableOptions(formData.source_name);
|
|
108
|
+
}
|
|
109
|
+
async function loadTableOptions(sourceName: string) {
|
|
110
|
+
tableOptions.value = [];
|
|
111
|
+
if (!sourceName) return;
|
|
112
|
+
loadingTables.value = true;
|
|
113
|
+
try {
|
|
114
|
+
const data = await defBaseTableSourceService.OptionBaseTable({ source_name: sourceName });
|
|
115
|
+
tableOptions.value = (data.value ?? []).map(value => ({ label: value, value }));
|
|
116
|
+
} finally {
|
|
117
|
+
loadingTables.value = false;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
async function handleSubmit() { const valid = await formDialogRef.value?.validate(); if (!valid) return; const payload = JSON.parse(JSON.stringify(formData)) as BaseTableArchiveForm; if (payload.id) await defBaseTableArchiveService.UpdateBaseTableArchive({ base_table_archive: payload }); else await defBaseTableArchiveService.CreateBaseTableArchive({ base_table_archive: payload }); ElMessage.success(t("common.message.save_success")); resetForm(); refresh(); }
|
|
121
|
+
/** 确认并切换归档配置状态。 */
|
|
122
|
+
async function setStatus(row: BaseTableArchiveForm) {
|
|
123
|
+
const status = row.status === Status.STATUS_ENABLE ? Status.STATUS_DISABLE : Status.STATUS_ENABLE;
|
|
124
|
+
const action = t(status === Status.STATUS_ENABLE ? "common.status.enabled" : "common.status.disabled");
|
|
125
|
+
const name = row.table_name || row.source_name || `ID:${row.id}`;
|
|
126
|
+
try {
|
|
127
|
+
await ElMessageBox.confirm(
|
|
128
|
+
t("common.dialog.status_change", {
|
|
129
|
+
action,
|
|
130
|
+
resource: t("system.backup.archive.config"),
|
|
131
|
+
field: t("system.backup.field.table_name"),
|
|
132
|
+
value: name
|
|
133
|
+
}),
|
|
134
|
+
t("common.title.notice"),
|
|
135
|
+
{
|
|
136
|
+
confirmButtonText: t("common.action.confirm"),
|
|
137
|
+
cancelButtonText: t("common.action.cancel"),
|
|
138
|
+
type: "warning"
|
|
139
|
+
}
|
|
140
|
+
);
|
|
141
|
+
await defBaseTableArchiveService.SetBaseTableArchiveStatus({ id: row.id, status });
|
|
142
|
+
ElMessage.success(t("common.message.status_success", { action }));
|
|
143
|
+
await proTable.value?.getTableList();
|
|
144
|
+
return true;
|
|
145
|
+
} catch {
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
async function remove(selected: number | number[] | BaseTableArchiveForm) { let ids: number[]; if (Array.isArray(selected)) ids = selected.map(Number); else if (typeof selected === "object") ids = [selected.id]; else ids = normalizeSelectedIds(selected).map(Number); if (!ids.length) return; await ElMessageBox.confirm(t("common.dialog.delete_selected", { resource: t("system.backup.archive.config") }), t("common.title.warning"), { type: "warning" }); await defBaseTableArchiveService.DeleteBaseTableArchive({ id: ids.join(",") }); ElMessage.success(t("common.message.delete_success", { resource: t("system.backup.archive.config") })); refresh(); }
|
|
150
|
+
function modeLabel(value: BaseTableArchiveMode) { return modeOptions.value.find(item => item.value === value)?.label ?? String(value); }
|
|
151
|
+
</script>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="table-box">
|
|
3
|
+
<ProTable ref="proTable" row-key="id" :columns="columns" :request-api="requestTable" />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup lang="ts">
|
|
8
|
+
import { computed, ref } from "vue";
|
|
9
|
+
import ProTable from "@liujitcn/kratos-admin-core/components/ProTable";
|
|
10
|
+
import type { ColumnProps, ProTableInstance } from "@liujitcn/kratos-admin-core/components/ProTable/interface";
|
|
11
|
+
import { buildPageRequest } from "@liujitcn/kratos-admin-core/table";
|
|
12
|
+
import { t } from "@liujitcn/kratos-admin-core";
|
|
13
|
+
import { defBaseTableArchiveRecordService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_table_archive_record";
|
|
14
|
+
import { BaseTableArchiveMode } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_table_archive";
|
|
15
|
+
import { BaseTableArchiveRecordStatus, type PageBaseTableArchiveRecordRequest } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_table_archive_record";
|
|
16
|
+
|
|
17
|
+
defineOptions({ name: "BaseTableArchiveRecord", inheritAttrs: false });
|
|
18
|
+
const proTable = ref<ProTableInstance>();
|
|
19
|
+
const statusOptions = computed(() => [
|
|
20
|
+
{ label: t("system.backup.status.running"), value: BaseTableArchiveRecordStatus.BASE_TABLE_ARCHIVE_RECORD_STATUS_RUNNING },
|
|
21
|
+
{ label: t("system.backup.status.success"), value: BaseTableArchiveRecordStatus.BASE_TABLE_ARCHIVE_RECORD_STATUS_SUCCESS },
|
|
22
|
+
{ label: t("system.backup.status.failed"), value: BaseTableArchiveRecordStatus.BASE_TABLE_ARCHIVE_RECORD_STATUS_FAILED },
|
|
23
|
+
{ label: t("system.backup.status.deleted"), value: BaseTableArchiveRecordStatus.BASE_TABLE_ARCHIVE_RECORD_STATUS_DELETED }
|
|
24
|
+
]);
|
|
25
|
+
const columns = computed<ColumnProps[]>(() => [
|
|
26
|
+
{ prop: "id", label: t("system.backup.field.id"), width: 90 },
|
|
27
|
+
{ prop: "source_name", label: t("system.backup.field.source_name"), minWidth: 140 },
|
|
28
|
+
{ prop: "table_name", label: t("system.backup.field.table_name"), minWidth: 180 },
|
|
29
|
+
{ prop: "archive_mode", label: t("system.backup.field.archive_mode"), width: 130, render: scope => scope.row.archive_mode === BaseTableArchiveMode.BASE_TABLE_ARCHIVE_MODE_INTERNAL_DATABASE ? t("system.backup.archive.mode.internal") : t("system.backup.archive.mode.oss") },
|
|
30
|
+
{ prop: "cutoff_at", label: t("system.backup.field.cutoff_at"), minWidth: 170 },
|
|
31
|
+
{ prop: "archived_rows", label: t("system.backup.field.archived_rows"), width: 110 },
|
|
32
|
+
{ prop: "deleted_rows", label: t("system.backup.field.deleted_rows"), width: 110 },
|
|
33
|
+
{ prop: "object_key", label: t("system.backup.field.object_key"), minWidth: 220 },
|
|
34
|
+
{ prop: "status", label: t("common.field.status"), width: 110, search: { el: "select", enum: statusOptions.value }, render: scope => statusOptions.value.find(item => item.value === scope.row.status)?.label ?? String(scope.row.status) },
|
|
35
|
+
{ prop: "started_at", label: t("system.backup.field.started_at"), minWidth: 170 },
|
|
36
|
+
{ prop: "finished_at", label: t("system.backup.field.finished_at"), minWidth: 170 }
|
|
37
|
+
]);
|
|
38
|
+
|
|
39
|
+
/** 请求归档记录分页列表。 */
|
|
40
|
+
async function requestTable(params: PageBaseTableArchiveRecordRequest) {
|
|
41
|
+
const data = await defBaseTableArchiveRecordService.PageBaseTableArchiveRecord(buildPageRequest(params));
|
|
42
|
+
return { data: { list: data.base_table_archive_records ?? [], total: data.total } };
|
|
43
|
+
}
|
|
44
|
+
</script>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="table-box">
|
|
3
|
+
<ProTable ref="proTable" row-key="id" :columns="columns" :request-api="requestTable" />
|
|
4
|
+
<el-card class="restore-card">
|
|
5
|
+
<template #header>{{ t("system.backup.archive.restore.manual") }}</template>
|
|
6
|
+
<ProForm ref="formRef" :model="formData" :fields="formFields" :rules="formRules" label-width="160px" />
|
|
7
|
+
<el-button v-if="BUTTONS['base:table-archive-restore:execute']" type="primary" :loading="submitting" @click="submitRestore">{{ t("system.backup.action.restore") }}</el-button>
|
|
8
|
+
</el-card>
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script setup lang="ts">
|
|
13
|
+
import { computed, reactive, ref } from "vue";
|
|
14
|
+
import { ElMessage } from "element-plus";
|
|
15
|
+
import ProTable from "@liujitcn/kratos-admin-core/components/ProTable";
|
|
16
|
+
import ProForm from "@liujitcn/kratos-admin-core/components/ProForm/index.vue";
|
|
17
|
+
import type { ColumnProps, ProTableInstance } from "@liujitcn/kratos-admin-core/components/ProTable/interface";
|
|
18
|
+
import type { ProFormField, ProFormInstance, ProFormOption } from "@liujitcn/kratos-admin-core/components/ProForm/interface";
|
|
19
|
+
import { buildPageRequest } from "@liujitcn/kratos-admin-core/table";
|
|
20
|
+
import { useAuthButtons } from "@liujitcn/kratos-admin-core/auth";
|
|
21
|
+
import { t } from "@liujitcn/kratos-admin-core";
|
|
22
|
+
import { defBaseTableArchiveRestoreService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_table_archive_restore";
|
|
23
|
+
import { BaseTableArchiveRestoreMode, BaseTableArchiveRestoreStatus, type BaseTableArchiveRestore } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_table_archive_restore";
|
|
24
|
+
|
|
25
|
+
defineOptions({ name: "BaseTableArchiveRestore", inheritAttrs: false });
|
|
26
|
+
const proTable = ref<ProTableInstance>();
|
|
27
|
+
const { BUTTONS } = useAuthButtons();
|
|
28
|
+
const formRef = ref<ProFormInstance>();
|
|
29
|
+
const submitting = ref(false);
|
|
30
|
+
const formData = reactive<BaseTableArchiveRestore>({ id: 0, archive_record_id: 0, table_name: "", restore_mode: BaseTableArchiveRestoreMode.BASE_TABLE_ARCHIVE_RESTORE_MODE_ALL, restore_range: "", restored_rows: 0, operator_id: 0, status: BaseTableArchiveRestoreStatus.BASE_TABLE_ARCHIVE_RESTORE_STATUS_PENDING, error: "", started_at: "", finished_at: "" });
|
|
31
|
+
const modeOptions = computed<ProFormOption[]>(() => [{ label: t("system.backup.restore.mode.all"), value: BaseTableArchiveRestoreMode.BASE_TABLE_ARCHIVE_RESTORE_MODE_ALL }, { label: t("system.backup.restore.mode.selected"), value: BaseTableArchiveRestoreMode.BASE_TABLE_ARCHIVE_RESTORE_MODE_SELECTED }]);
|
|
32
|
+
const formFields = computed<ProFormField[]>(() => [{ prop: "archive_record_id", label: t("system.backup.field.archive_record_id"), component: "input-number", props: { min: 0, precision: 0 } }, { prop: "restore_mode", label: t("system.backup.field.restore_mode"), component: "select", options: modeOptions.value }, { prop: "restore_range", label: t("system.backup.field.restore_range"), component: "input", visible: model => model.restore_mode === BaseTableArchiveRestoreMode.BASE_TABLE_ARCHIVE_RESTORE_MODE_SELECTED, props: { placeholder: '{"start_id":1,"end_id":100}' } }]);
|
|
33
|
+
const formRules = computed(() => ({
|
|
34
|
+
archive_record_id: [
|
|
35
|
+
{ required: true, message: t("system.backup.validation.archive_record_id"), trigger: "blur" },
|
|
36
|
+
{ type: "number", min: 1, message: t("system.backup.validation.archive_record_id_positive"), trigger: "change" }
|
|
37
|
+
]
|
|
38
|
+
}));
|
|
39
|
+
const columns = computed<ColumnProps[]>(() => [{ prop: "id", label: t("system.backup.field.id"), width: 90 }, { prop: "archive_record_id", label: t("system.backup.field.archive_record_id"), width: 130 }, { prop: "table_name", label: t("system.backup.field.table_name"), minWidth: 180 }, { prop: "restore_mode", label: t("system.backup.field.restore_mode"), width: 120, render: scope => modeOptions.value.find(item => item.value === scope.row.restore_mode)?.label ?? String(scope.row.restore_mode) }, { prop: "restored_rows", label: t("system.backup.field.restored_rows"), width: 110 }, { prop: "status", label: t("common.field.status"), width: 110 }, { prop: "error", label: t("system.backup.field.error"), minWidth: 220 }, { prop: "started_at", label: t("system.backup.field.started_at"), minWidth: 170 }, { prop: "finished_at", label: t("system.backup.field.finished_at"), minWidth: 170 }]);
|
|
40
|
+
|
|
41
|
+
/** 请求归档恢复记录分页列表。 */
|
|
42
|
+
async function requestTable(params: Record<string, unknown>) { const data = await defBaseTableArchiveRestoreService.PageBaseTableArchiveRestore(buildPageRequest(params)); return { data: { list: data.base_table_archive_restores ?? [], total: data.total } }; }
|
|
43
|
+
/** 手工提交归档恢复请求。 */
|
|
44
|
+
async function submitRestore() {
|
|
45
|
+
if (!(await formRef.value?.validate())) return;
|
|
46
|
+
if (!Number.isInteger(formData.archive_record_id) || formData.archive_record_id < 1) {
|
|
47
|
+
ElMessage.warning(t("system.backup.validation.archive_record_id_positive"));
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
submitting.value = true;
|
|
51
|
+
try {
|
|
52
|
+
await defBaseTableArchiveRestoreService.ExecuteBaseTableArchiveRestore({ base_table_archive_restore: { ...formData } });
|
|
53
|
+
ElMessage.success(t("system.backup.message.restore_submitted"));
|
|
54
|
+
proTable.value?.getTableList();
|
|
55
|
+
} finally {
|
|
56
|
+
submitting.value = false;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
</script>
|