@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
|
@@ -69,21 +69,22 @@ import PasswordStrength from "@liujitcn/kratos-admin-core/components/PasswordStr
|
|
|
69
69
|
import type { ProFormField, ProFormOption } from "@liujitcn/kratos-admin-core/components/ProForm/interface";
|
|
70
70
|
import TreeFilter from "@liujitcn/kratos-admin-core/components/TreeFilter/index.vue";
|
|
71
71
|
import { useAuthButtons } from "@liujitcn/kratos-admin-core/auth";
|
|
72
|
-
import { defBaseUserService } from "@liujitcn/kratos-admin-system/api/system/base_user";
|
|
72
|
+
import { defBaseUserService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_user";
|
|
73
73
|
import type {
|
|
74
74
|
BaseUser,
|
|
75
75
|
BaseUserForm,
|
|
76
76
|
PageBaseUserRequest,
|
|
77
77
|
ResetBaseUserPasswordRequest
|
|
78
78
|
} from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_user";
|
|
79
|
-
import {
|
|
80
|
-
import {
|
|
81
|
-
import {
|
|
82
|
-
import {
|
|
79
|
+
import { BaseUserIDType } from "@liujitcn/kratos-admin-system/rpc/system/common/v1/common";
|
|
80
|
+
import { defBaseDeptService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_dept";
|
|
81
|
+
import { defBaseRoleService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_role";
|
|
82
|
+
import { defBasePostService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_post";
|
|
83
|
+
import { defBaseTenantService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_tenant";
|
|
83
84
|
import type { SelectOptionResponse_Option, TreeOptionResponse_Option } from "@liujitcn/kratos-admin-system/rpc/common/v1/common";
|
|
84
85
|
import { Status } from "@liujitcn/kratos-admin-system/rpc/common/v1/enum";
|
|
85
86
|
import { buildPageRequest, normalizeSelectedIds } from "@liujitcn/kratos-admin-core/table";
|
|
86
|
-
import { PASSWORD_CRYPTO_SCENE, encryptPassword
|
|
87
|
+
import { PASSWORD_CRYPTO_SCENE, encryptPassword } from "@liujitcn/kratos-admin-core/security";
|
|
87
88
|
import { DEFAULT_TENANT_CODE, requestTenantOptions } from "@liujitcn/kratos-admin-core/tenant";
|
|
88
89
|
import { useUserStore } from "@liujitcn/kratos-admin-core/stores/runtime";
|
|
89
90
|
import { t } from "@liujitcn/kratos-admin-core";
|
|
@@ -159,6 +160,12 @@ const formData = reactive<BaseUserFormState>({
|
|
|
159
160
|
post_id: undefined,
|
|
160
161
|
/** 手机号 */
|
|
161
162
|
phone: "",
|
|
163
|
+
/** 邮箱 */
|
|
164
|
+
email: "",
|
|
165
|
+
/** 证件类型 */
|
|
166
|
+
id_type: BaseUserIDType.BASE_USER_ID_TYPE_UNSPECIFIED,
|
|
167
|
+
/** 证件号 */
|
|
168
|
+
id_code: "",
|
|
162
169
|
/** 密码 */
|
|
163
170
|
pwd: "",
|
|
164
171
|
/** 性别 */
|
|
@@ -180,7 +187,7 @@ const rules = computed(() => ({
|
|
|
180
187
|
tenant_id: [
|
|
181
188
|
{
|
|
182
189
|
required: true,
|
|
183
|
-
message: t("common.validation.required_select", { field: t("
|
|
190
|
+
message: t("common.validation.required_select", { field: t("common.field.tenant") }),
|
|
184
191
|
trigger: "change"
|
|
185
192
|
}
|
|
186
193
|
],
|
|
@@ -223,28 +230,41 @@ const rules = computed(() => ({
|
|
|
223
230
|
dept_id: [
|
|
224
231
|
{
|
|
225
232
|
required: true,
|
|
226
|
-
message: t("common.validation.required_select", { field: t("
|
|
233
|
+
message: t("common.validation.required_select", { field: t("common.field.department") }),
|
|
227
234
|
trigger: "change"
|
|
228
235
|
}
|
|
229
236
|
],
|
|
230
237
|
role_id: [
|
|
231
238
|
{
|
|
232
239
|
required: true,
|
|
233
|
-
message: t("common.validation.required_select", { field: t("
|
|
240
|
+
message: t("common.validation.required_select", { field: t("common.field.role") }),
|
|
234
241
|
trigger: "change"
|
|
235
242
|
}
|
|
236
243
|
],
|
|
237
244
|
phone: [
|
|
238
245
|
{ max: 20, message: t("common.validation.max_length", { field: t("common.field.phone"), max: 20 }), trigger: "blur" },
|
|
239
246
|
{
|
|
240
|
-
pattern: /^1[3-9]
|
|
247
|
+
pattern: /^(?:1[3-9][0-9*]{9})?$/,
|
|
241
248
|
message: t("common.validation.phone_invalid"),
|
|
242
249
|
trigger: "blur"
|
|
243
250
|
}
|
|
244
251
|
],
|
|
252
|
+
email: [
|
|
253
|
+
{
|
|
254
|
+
type: "email",
|
|
255
|
+
message: t("system.base.user.validation.email_invalid"),
|
|
256
|
+
trigger: "blur"
|
|
257
|
+
}
|
|
258
|
+
],
|
|
259
|
+
id_code: [
|
|
260
|
+
{
|
|
261
|
+
pattern: /^[A-Za-z0-9][A-Za-z0-9-]{0,63}$/,
|
|
262
|
+
message: t("system.base.user.validation.id_code_invalid"),
|
|
263
|
+
trigger: "blur"
|
|
264
|
+
}
|
|
265
|
+
],
|
|
245
266
|
pwd: [
|
|
246
|
-
{ required:
|
|
247
|
-
{ validator: validatePasswordField, trigger: "blur" }
|
|
267
|
+
{ required: false, trigger: "blur" }
|
|
248
268
|
],
|
|
249
269
|
status: [
|
|
250
270
|
{
|
|
@@ -263,8 +283,7 @@ const rules = computed(() => ({
|
|
|
263
283
|
}));
|
|
264
284
|
const resetPwdRules = computed(() => ({
|
|
265
285
|
pwd: [
|
|
266
|
-
{ required: true, message: t("system.base.user.placeholder.new_password"), trigger: "blur" }
|
|
267
|
-
{ validator: validatePasswordField, trigger: "blur" }
|
|
286
|
+
{ required: true, message: t("system.base.user.placeholder.new_password"), trigger: "blur" }
|
|
268
287
|
]
|
|
269
288
|
}));
|
|
270
289
|
|
|
@@ -276,6 +295,18 @@ const statusOptions = computed<ProFormOption[]>(() => [
|
|
|
276
295
|
{ label: t("common.status.enabled"), value: Status.STATUS_ENABLE },
|
|
277
296
|
{ label: t("common.status.disabled"), value: Status.STATUS_DISABLE }
|
|
278
297
|
]);
|
|
298
|
+
const idTypeOptions = computed<ProFormOption[]>(() => [
|
|
299
|
+
{ label: t("system.base.user.id_type.unspecified"), value: BaseUserIDType.BASE_USER_ID_TYPE_UNSPECIFIED },
|
|
300
|
+
{ label: t("system.base.user.id_type.id_card"), value: BaseUserIDType.BASE_USER_ID_TYPE_ID_CARD },
|
|
301
|
+
{ label: t("system.base.user.id_type.passport"), value: BaseUserIDType.BASE_USER_ID_TYPE_PASSPORT },
|
|
302
|
+
{ label: t("system.base.user.id_type.hk_macao_permit"), value: BaseUserIDType.BASE_USER_ID_TYPE_HK_MACAO_PERMIT },
|
|
303
|
+
{ label: t("system.base.user.id_type.taiwan_permit"), value: BaseUserIDType.BASE_USER_ID_TYPE_TAIWAN_PERMIT },
|
|
304
|
+
{
|
|
305
|
+
label: t("system.base.user.id_type.foreign_permanent_residence"),
|
|
306
|
+
value: BaseUserIDType.BASE_USER_ID_TYPE_FOREIGN_PERMANENT_RESIDENCE
|
|
307
|
+
},
|
|
308
|
+
{ label: t("system.base.user.id_type.other"), value: BaseUserIDType.BASE_USER_ID_TYPE_OTHER }
|
|
309
|
+
]);
|
|
279
310
|
const resetPwdFields = computed<ProFormField[]>(() => [
|
|
280
311
|
{
|
|
281
312
|
prop: "pwd",
|
|
@@ -307,10 +338,10 @@ const isSuperEditUser = computed(() => Boolean(formData.id && formData.user_name
|
|
|
307
338
|
const formFields = computed<ProFormField[]>(() => [
|
|
308
339
|
{
|
|
309
340
|
prop: "tenant_id",
|
|
310
|
-
label: t("
|
|
341
|
+
label: t("common.field.tenant"),
|
|
311
342
|
component: "select",
|
|
312
343
|
props: {
|
|
313
|
-
placeholder: t("
|
|
344
|
+
placeholder: t("common.placeholder.select"),
|
|
314
345
|
filterable: true,
|
|
315
346
|
disabled: Boolean(formData.id),
|
|
316
347
|
onChange: handleFormTenantChange
|
|
@@ -338,18 +369,18 @@ const formFields = computed<ProFormField[]>(() => [
|
|
|
338
369
|
},
|
|
339
370
|
{
|
|
340
371
|
prop: "role_id",
|
|
341
|
-
label: t("
|
|
372
|
+
label: t("common.field.role"),
|
|
342
373
|
component: "select",
|
|
343
374
|
options: baseRoleOptions.value.map(item => ({ label: item.label, value: item.value, disabled: item.disabled })),
|
|
344
375
|
props: { placeholder: t("common.placeholder.select"), disabled: isProtectedUserRole.value }
|
|
345
376
|
},
|
|
346
377
|
{
|
|
347
378
|
prop: "dept_id",
|
|
348
|
-
label: t("
|
|
379
|
+
label: t("common.field.department"),
|
|
349
380
|
component: "tree-select",
|
|
350
381
|
options: basedDeptOptions.value as unknown as ProFormOption[],
|
|
351
382
|
props: {
|
|
352
|
-
placeholder: t("
|
|
383
|
+
placeholder: t("common.placeholder.select"),
|
|
353
384
|
filterable: true,
|
|
354
385
|
checkStrictly: true,
|
|
355
386
|
renderAfterExpand: false,
|
|
@@ -358,10 +389,10 @@ const formFields = computed<ProFormField[]>(() => [
|
|
|
358
389
|
},
|
|
359
390
|
{
|
|
360
391
|
prop: "post_id",
|
|
361
|
-
label: t("
|
|
392
|
+
label: t("common.field.post"),
|
|
362
393
|
component: "select",
|
|
363
394
|
options: basePostOptions.value.map(item => ({ label: item.label, value: item.value, disabled: item.disabled })),
|
|
364
|
-
props: { placeholder: t("
|
|
395
|
+
props: { placeholder: t("common.placeholder.select"), clearable: true, filterable: true }
|
|
365
396
|
},
|
|
366
397
|
{
|
|
367
398
|
prop: "phone",
|
|
@@ -369,11 +400,30 @@ const formFields = computed<ProFormField[]>(() => [
|
|
|
369
400
|
component: "input",
|
|
370
401
|
props: { placeholder: t("common.validation.phone_required") }
|
|
371
402
|
},
|
|
403
|
+
{
|
|
404
|
+
prop: "email",
|
|
405
|
+
label: t("system.base.user.field.email"),
|
|
406
|
+
component: "input",
|
|
407
|
+
props: { placeholder: t("system.base.user.placeholder.email") }
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
prop: "id_type",
|
|
411
|
+
label: t("system.base.user.field.id_type"),
|
|
412
|
+
component: "select",
|
|
413
|
+
options: idTypeOptions.value,
|
|
414
|
+
props: { placeholder: t("common.placeholder.select") }
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
prop: "id_code",
|
|
418
|
+
label: t("system.base.user.field.id_code"),
|
|
419
|
+
component: "input",
|
|
420
|
+
props: { placeholder: t("system.base.user.placeholder.id_code") }
|
|
421
|
+
},
|
|
372
422
|
{
|
|
373
423
|
prop: "pwd",
|
|
374
424
|
label: t("system.base.user.field.password"),
|
|
375
425
|
component: "password",
|
|
376
|
-
props: { placeholder: t("system.base.user.placeholder.
|
|
426
|
+
props: { placeholder: t("system.base.user.placeholder.password_optional"), showPassword: true },
|
|
377
427
|
visible: model => !model.id
|
|
378
428
|
},
|
|
379
429
|
{
|
|
@@ -406,7 +456,7 @@ const columns = computed<ColumnProps[]>(() => [
|
|
|
406
456
|
? ([
|
|
407
457
|
{
|
|
408
458
|
prop: "tenant_id",
|
|
409
|
-
label: t("
|
|
459
|
+
label: t("common.field.tenant"),
|
|
410
460
|
minWidth: 140,
|
|
411
461
|
showOverflowTooltip: true,
|
|
412
462
|
search: { el: "select", key: "tenant_id", props: { filterable: true }, order: 1 },
|
|
@@ -417,16 +467,19 @@ const columns = computed<ColumnProps[]>(() => [
|
|
|
417
467
|
{ prop: "user_name", label: t("system.base.user.field.user_name"), minWidth: 140, search: { el: "input" } },
|
|
418
468
|
{ prop: "user_code", label: t("system.base.user.field.user_code"), minWidth: 140, search: { el: "input" } },
|
|
419
469
|
{ prop: "nick_name", label: t("system.base.user.field.nick_name_short"), minWidth: 100, search: { el: "input" } },
|
|
420
|
-
{ prop: "role_id", label: t("
|
|
470
|
+
{ prop: "role_id", label: t("common.field.role"), minWidth: 140, enum: requestRoleOptions },
|
|
421
471
|
{
|
|
422
472
|
prop: "dept_id",
|
|
423
|
-
label: t("
|
|
473
|
+
label: t("common.field.department"),
|
|
424
474
|
minWidth: 180,
|
|
425
475
|
showOverflowTooltip: true,
|
|
426
476
|
enum: requestDeptOptions
|
|
427
477
|
},
|
|
428
|
-
{ prop: "post_id", label: t("
|
|
478
|
+
{ prop: "post_id", label: t("common.field.post"), minWidth: 120, enum: requestPostOptions },
|
|
429
479
|
{ prop: "phone", label: t("common.field.phone"), minWidth: 130, search: { el: "input" } },
|
|
480
|
+
{ prop: "email", label: t("system.base.user.field.email"), minWidth: 180, search: { el: "input" } },
|
|
481
|
+
{ prop: "id_type", label: t("system.base.user.field.id_type"), minWidth: 150, enum: idTypeOptions },
|
|
482
|
+
{ prop: "id_code", label: t("system.base.user.field.id_code"), minWidth: 180, showOverflowTooltip: true },
|
|
430
483
|
{
|
|
431
484
|
prop: "gender",
|
|
432
485
|
label: t("system.base.user.field.gender"),
|
|
@@ -687,6 +740,9 @@ function resetForm() {
|
|
|
687
740
|
formData.dept_id = undefined;
|
|
688
741
|
formData.post_id = undefined;
|
|
689
742
|
formData.phone = "";
|
|
743
|
+
formData.email = "";
|
|
744
|
+
formData.id_type = BaseUserIDType.BASE_USER_ID_TYPE_UNSPECIFIED;
|
|
745
|
+
formData.id_code = "";
|
|
690
746
|
formData.pwd = "";
|
|
691
747
|
formData.gender = 3;
|
|
692
748
|
formData.avatar = "";
|
|
@@ -746,7 +802,10 @@ const handleSubmit = useDebounceFn(() => {
|
|
|
746
802
|
const submitData = JSON.parse(JSON.stringify(formData)) as BaseUserFormState;
|
|
747
803
|
const baseUser = {
|
|
748
804
|
...submitData,
|
|
749
|
-
pwd:
|
|
805
|
+
pwd:
|
|
806
|
+
submitData.id || !submitData.pwd
|
|
807
|
+
? undefined
|
|
808
|
+
: await encryptPassword(submitData.pwd, PASSWORD_CRYPTO_SCENE.PASSWORD_CRYPTO_SCENE_CREATE_BASE_USER)
|
|
750
809
|
} as BaseUserForm;
|
|
751
810
|
const request = submitData.id
|
|
752
811
|
? defBaseUserService.UpdateBaseUser({ base_user: baseUser })
|
|
@@ -832,26 +891,6 @@ function handleDelete(selected?: number | string | Array<number | string> | Base
|
|
|
832
891
|
);
|
|
833
892
|
}
|
|
834
893
|
|
|
835
|
-
/**
|
|
836
|
-
* 校验密码强度,新增用户和重置密码统一要求达到最高强度。
|
|
837
|
-
*
|
|
838
|
-
* @param _rule 表单规则对象
|
|
839
|
-
* @param value 当前密码值
|
|
840
|
-
* @param callback 校验回调
|
|
841
|
-
*/
|
|
842
|
-
function validatePasswordField(_rule: unknown, value: string, callback: (error?: Error) => void) {
|
|
843
|
-
if (!value) {
|
|
844
|
-
callback();
|
|
845
|
-
return;
|
|
846
|
-
}
|
|
847
|
-
const result = validatePasswordStrengthValue(value);
|
|
848
|
-
if (!result.valid) {
|
|
849
|
-
callback(new Error(t("core.password.error")));
|
|
850
|
-
return;
|
|
851
|
-
}
|
|
852
|
-
callback();
|
|
853
|
-
}
|
|
854
|
-
|
|
855
894
|
/**
|
|
856
895
|
* 根据后端管理保护标记判断用户是否禁止通过用户管理操作。
|
|
857
896
|
*/
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="table-box">
|
|
3
|
+
<ProTable ref="proTable" row-key="id" :columns="columns" :header-actions="headerActions" :request-api="requestTable" />
|
|
4
|
+
<ProDialog v-model="detailVisible" :title="detail?.title" width="720px" destroy-on-close :show-footer="false">
|
|
5
|
+
<div v-if="detail" class="message-detail">
|
|
6
|
+
<div class="message-meta">
|
|
7
|
+
<span class="message-category" :style="{ color: detail.category_color || undefined }">
|
|
8
|
+
<component :is="resolveNotificationIcon(detail.category_icon)" />
|
|
9
|
+
<span class="message-category__name">{{ detail.category_name }}</span>
|
|
10
|
+
</span>
|
|
11
|
+
<span>{{ detail.sender_name }}</span>
|
|
12
|
+
<span>{{ detail.received_at }}</span>
|
|
13
|
+
</div>
|
|
14
|
+
<RichTextPreview
|
|
15
|
+
v-if="detail.content_format === MessageContentFormat.MESSAGE_CONTENT_FORMAT_RICH_TEXT"
|
|
16
|
+
class="message-content"
|
|
17
|
+
:model-value="detail.content"
|
|
18
|
+
/>
|
|
19
|
+
<pre v-else class="message-content">{{ detail.content }}</pre>
|
|
20
|
+
<el-button
|
|
21
|
+
v-if="detail.action_type === MessageActionType.MESSAGE_ACTION_TYPE_VIEW_KEY && actionRouteName"
|
|
22
|
+
class="message-action"
|
|
23
|
+
type="primary"
|
|
24
|
+
@click="openAction"
|
|
25
|
+
>
|
|
26
|
+
{{ t("common.action.view") }}
|
|
27
|
+
</el-button>
|
|
28
|
+
</div>
|
|
29
|
+
</ProDialog>
|
|
30
|
+
</div>
|
|
31
|
+
</template>
|
|
32
|
+
|
|
33
|
+
<script setup lang="ts">
|
|
34
|
+
import { computed, h, onMounted, ref } from "vue";
|
|
35
|
+
import { useRouter } from "vue-router";
|
|
36
|
+
import ProTable from "@liujitcn/kratos-admin-core/components/ProTable";
|
|
37
|
+
import ProDialog from "@liujitcn/kratos-admin-core/components/Dialog/ProDialog.vue";
|
|
38
|
+
import type { ColumnProps, HeaderActionProps, ProTableInstance } from "@liujitcn/kratos-admin-core/components/ProTable/interface";
|
|
39
|
+
import type { ProFormOption } from "@liujitcn/kratos-admin-core/components/ProForm/interface";
|
|
40
|
+
import RichTextPreview from "@liujitcn/kratos-admin-core/components/RichTextPreview/index.vue";
|
|
41
|
+
import { buildPageRequest } from "@liujitcn/kratos-admin-core/table";
|
|
42
|
+
import { t } from "@liujitcn/kratos-admin-core";
|
|
43
|
+
import { defNotificationService } from "@liujitcn/kratos-admin-system/api/base/v1/notification";
|
|
44
|
+
import type {
|
|
45
|
+
Notification,
|
|
46
|
+
NotificationCategory,
|
|
47
|
+
PageNotificationRequest
|
|
48
|
+
} from "@liujitcn/kratos-admin-system/rpc/base/v1/notification";
|
|
49
|
+
import {
|
|
50
|
+
MessageActionType,
|
|
51
|
+
MessageContentFormat,
|
|
52
|
+
NotificationView
|
|
53
|
+
} from "@liujitcn/kratos-admin-system/rpc/base/v1/notification";
|
|
54
|
+
|
|
55
|
+
defineOptions({ name: "NotificationInbox", inheritAttrs: false });
|
|
56
|
+
|
|
57
|
+
const proTable = ref<ProTableInstance>();
|
|
58
|
+
const router = useRouter();
|
|
59
|
+
const detailVisible = ref(false);
|
|
60
|
+
const detail = ref<Notification>();
|
|
61
|
+
const categoryOptions = ref<NotificationCategory[]>([]);
|
|
62
|
+
const actionRouteName = computed(() => {
|
|
63
|
+
const viewKey = detail.value?.action_target;
|
|
64
|
+
if (!viewKey) return "";
|
|
65
|
+
return ({ MESSAGE_INBOX: "NotificationInbox", PROFILE: "Profile", AI: "AiChat" } as Record<string, string>)[viewKey] ?? "";
|
|
66
|
+
});
|
|
67
|
+
const notificationIcons = {
|
|
68
|
+
Bell,
|
|
69
|
+
Calendar,
|
|
70
|
+
ChatDotRound,
|
|
71
|
+
CircleCheckFilled,
|
|
72
|
+
CollectionTag,
|
|
73
|
+
DataAnalysis,
|
|
74
|
+
InfoFilled,
|
|
75
|
+
List,
|
|
76
|
+
Lock,
|
|
77
|
+
Message,
|
|
78
|
+
Promotion,
|
|
79
|
+
Setting,
|
|
80
|
+
User,
|
|
81
|
+
WarningFilled
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const viewOptions = computed<ProFormOption[]>(() => [
|
|
85
|
+
{ label: t("system.notification.view.inbox"), value: NotificationView.NOTIFICATION_VIEW_INBOX },
|
|
86
|
+
{ label: t("system.notification.view.unread"), value: NotificationView.NOTIFICATION_VIEW_UNREAD },
|
|
87
|
+
{ label: t("system.notification.view.archived"), value: NotificationView.NOTIFICATION_VIEW_ARCHIVED }
|
|
88
|
+
]);
|
|
89
|
+
|
|
90
|
+
const categoryFilterOptions = computed<ProFormOption[]>(() =>
|
|
91
|
+
categoryOptions.value.map(item => ({ label: item.name, value: item.id }))
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
onMounted(() => void loadCategoryOptions());
|
|
95
|
+
|
|
96
|
+
const columns = computed<ColumnProps[]>(() => [
|
|
97
|
+
{ prop: "title", label: t("system.base.message.field.title"), minWidth: 240 },
|
|
98
|
+
{
|
|
99
|
+
prop: "category_name",
|
|
100
|
+
label: t("system.base.message.field.category"),
|
|
101
|
+
minWidth: 150,
|
|
102
|
+
search: { el: "select", key: "category_id", enum: categoryFilterOptions },
|
|
103
|
+
render: scope => {
|
|
104
|
+
const row = scope.row as Notification;
|
|
105
|
+
return h("span", { class: "message-category", style: { color: row.category_color || undefined } }, [
|
|
106
|
+
h(resolveNotificationIcon(row.category_icon)),
|
|
107
|
+
h("span", { class: "message-category__name" }, row.category_name)
|
|
108
|
+
]);
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
prop: "read_at",
|
|
113
|
+
label: t("system.notification.field.read_status"),
|
|
114
|
+
width: 110,
|
|
115
|
+
search: { el: "select", key: "view", enum: viewOptions.value },
|
|
116
|
+
render: scope =>
|
|
117
|
+
(scope.row as Notification).read_at ? t("system.notification.status.read") : t("system.notification.status.unread")
|
|
118
|
+
},
|
|
119
|
+
{ prop: "sender_name", label: t("system.notification.field.sender"), minWidth: 130 },
|
|
120
|
+
{ prop: "received_at", label: t("system.notification.field.received_at"), minWidth: 180 },
|
|
121
|
+
{
|
|
122
|
+
prop: "operation",
|
|
123
|
+
label: t("common.field.operation"),
|
|
124
|
+
width: 250,
|
|
125
|
+
fixed: "right",
|
|
126
|
+
cellType: "actions",
|
|
127
|
+
actions: [
|
|
128
|
+
{ label: t("common.action.view"), link: true, icon: View, onClick: scope => openDetail(scope.row as Notification) },
|
|
129
|
+
{
|
|
130
|
+
label: t("system.notification.action.mark_unread"),
|
|
131
|
+
link: true,
|
|
132
|
+
icon: RefreshLeft,
|
|
133
|
+
hidden: scope => !(scope.row as Notification).read_at,
|
|
134
|
+
onClick: scope => markUnread(scope.row as Notification)
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
label: t("system.notification.action.archive"),
|
|
138
|
+
link: true,
|
|
139
|
+
icon: Folder,
|
|
140
|
+
hidden: scope => Boolean((scope.row as Notification).archived_at) || !(scope.row as Notification).allow_archive,
|
|
141
|
+
onClick: scope => archive(scope.row as Notification)
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
label: t("system.notification.action.restore"),
|
|
145
|
+
link: true,
|
|
146
|
+
icon: RefreshLeft,
|
|
147
|
+
hidden: scope => !(scope.row as Notification).archived_at,
|
|
148
|
+
onClick: scope => restore(scope.row as Notification)
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
label: t("common.action.delete"),
|
|
152
|
+
type: "danger",
|
|
153
|
+
link: true,
|
|
154
|
+
icon: Delete,
|
|
155
|
+
hidden: scope => !(scope.row as Notification).allow_delete,
|
|
156
|
+
onClick: scope => remove(scope.row as Notification)
|
|
157
|
+
}
|
|
158
|
+
]
|
|
159
|
+
}
|
|
160
|
+
]);
|
|
161
|
+
|
|
162
|
+
const headerActions = computed<HeaderActionProps[]>(() => [
|
|
163
|
+
{ label: t("system.notification.action.mark_all_read"), type: "primary", icon: Finished, onClick: () => markAllRead() }
|
|
164
|
+
]);
|
|
165
|
+
|
|
166
|
+
/** 请求当前用户收件箱。 */
|
|
167
|
+
async function requestTable(params: Record<string, unknown>) {
|
|
168
|
+
const request = buildPageRequest<PageNotificationRequest>(params as unknown as PageNotificationRequest);
|
|
169
|
+
request.view = Number(params.view ?? NotificationView.NOTIFICATION_VIEW_INBOX) as NotificationView;
|
|
170
|
+
const data = await defNotificationService.PageNotification(request);
|
|
171
|
+
return { data: { list: data.notifications ?? [], total: data.total } };
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/** 加载消息分类筛选项。 */
|
|
175
|
+
async function loadCategoryOptions() {
|
|
176
|
+
const result = await defNotificationService.ListNotificationCategories({});
|
|
177
|
+
categoryOptions.value = result.categories ?? [];
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/** 打开消息详情并标记已读。 */
|
|
181
|
+
async function openDetail(row: Notification) {
|
|
182
|
+
detail.value = await defNotificationService.GetNotification({ id: row.id });
|
|
183
|
+
detailVisible.value = true;
|
|
184
|
+
if (!row.read_at) {
|
|
185
|
+
await defNotificationService.MarkNotificationRead({ ids: [row.id] });
|
|
186
|
+
proTable.value?.getTableList();
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/** 执行通知携带的稳定 viewKey 动作。 */
|
|
191
|
+
function openAction() {
|
|
192
|
+
if (!actionRouteName.value) return;
|
|
193
|
+
void router.push({ name: actionRouteName.value });
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/** 标记消息为未读。 */
|
|
197
|
+
async function markUnread(row: Notification) {
|
|
198
|
+
await defNotificationService.MarkNotificationUnread({ ids: [row.id] });
|
|
199
|
+
proTable.value?.getTableList();
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/** 标记全部消息为已读。 */
|
|
203
|
+
async function markAllRead() {
|
|
204
|
+
const summary = await defNotificationService.GetNotificationSummary({});
|
|
205
|
+
if (!summary.latest_delivery_id) return;
|
|
206
|
+
await defNotificationService.MarkAllNotificationRead({ before_delivery_id: summary.latest_delivery_id });
|
|
207
|
+
ElMessage.success(t("common.message.operation_success"));
|
|
208
|
+
proTable.value?.getTableList();
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/** 归档消息。 */
|
|
212
|
+
async function archive(row: Notification) {
|
|
213
|
+
await defNotificationService.ArchiveNotification({ id: row.id });
|
|
214
|
+
proTable.value?.getTableList();
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/** 恢复已归档消息。 */
|
|
218
|
+
async function restore(row: Notification) {
|
|
219
|
+
await defNotificationService.RestoreNotification({ id: row.id });
|
|
220
|
+
proTable.value?.getTableList();
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/** 从个人收件箱删除消息。 */
|
|
224
|
+
async function remove(row: Notification) {
|
|
225
|
+
await ElMessageBox.confirm(t("common.confirm.delete"), t("common.title.warning"), { type: "warning" });
|
|
226
|
+
await defNotificationService.DeleteNotification({ id: row.id });
|
|
227
|
+
proTable.value?.getTableList();
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/** 解析收件箱分类图标,未知图标使用默认图标。 */
|
|
231
|
+
function resolveNotificationIcon(icon: string) {
|
|
232
|
+
return notificationIcons[icon as keyof typeof notificationIcons] ?? CollectionTag;
|
|
233
|
+
}
|
|
234
|
+
</script>
|
|
235
|
+
|
|
236
|
+
<style scoped lang="scss">
|
|
237
|
+
.message-meta {
|
|
238
|
+
display: flex;
|
|
239
|
+
flex-wrap: wrap;
|
|
240
|
+
gap: 16px;
|
|
241
|
+
margin-bottom: 18px;
|
|
242
|
+
color: var(--el-text-color-secondary);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
:deep(.message-category) {
|
|
246
|
+
display: inline-flex;
|
|
247
|
+
gap: 6px;
|
|
248
|
+
align-items: center;
|
|
249
|
+
line-height: 18px;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
:deep(.message-category > svg) {
|
|
253
|
+
flex: 0 0 18px;
|
|
254
|
+
width: 18px;
|
|
255
|
+
height: 18px;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
:deep(.message-category__name) {
|
|
259
|
+
white-space: nowrap;
|
|
260
|
+
color: var(--el-text-color-primary);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.message-content {
|
|
264
|
+
min-height: 180px;
|
|
265
|
+
margin: 0;
|
|
266
|
+
white-space: pre-wrap;
|
|
267
|
+
overflow-wrap: anywhere;
|
|
268
|
+
color: var(--el-text-color-primary);
|
|
269
|
+
font-family: inherit;
|
|
270
|
+
line-height: 1.7;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.message-content.core-rich-text-preview {
|
|
274
|
+
white-space: normal;
|
|
275
|
+
}
|
|
276
|
+
</style>
|