@liujitcn/kratos-admin-system 0.0.31 → 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 +34 -20
- package/dist/package/declarations/src/api/base/{notification.d.ts → v1/notification.d.ts} +3 -1
- 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_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/{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_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_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/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/ChangePasswordForm.vue.d.ts +3 -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/{AuditLogTable.vue.d.ts → LogTable.vue.d.ts} +14 -7
- 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 +1084 -500
- package/dist/package/declarations/src/rpc/base/v1/login.d.ts +5 -3
- package/dist/package/declarations/src/rpc/base/v1/notification.d.ts +25 -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_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_job.d.ts +5 -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 +77 -0
- 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 +169 -41
- 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_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 +15 -0
- 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/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/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/login-policy/format.d.ts +2 -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/tool/cache/index.vue.d.ts +3 -0
- package/dist/package/src/api/base/v1/notification.ts +99 -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_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/{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/{base_message.ts → admin/v1/base_message.ts} +29 -9
- package/dist/package/src/api/system/{base_message_category.ts → admin/v1/base_message_category.ts} +30 -7
- 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_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/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 +112 -7
- 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 +2 -1
- package/dist/package/src/locales/en-US.json +285 -127
- package/dist/package/src/locales/ja-JP.json +285 -127
- package/dist/package/src/locales/zh-CN.json +285 -127
- package/dist/package/src/locales/zh-TW.json +285 -127
- package/dist/package/src/module.ts +3 -1
- package/dist/package/src/rpc/base/v1/login.ts +4 -2
- package/dist/package/src/rpc/base/v1/notification.ts +28 -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_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_job.ts +5 -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 +90 -0
- 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 +191 -42
- 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_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 +15 -0
- 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/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 +2 -4
- 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 +3 -8
- package/dist/package/src/views/base/api/index.vue +4 -4
- package/dist/package/src/views/base/api-log/index.vue +56 -45
- 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 +16 -25
- package/dist/package/src/views/base/dashboard/index.vue +68 -66
- package/dist/package/src/views/base/data-access-log/index.vue +64 -52
- package/dist/package/src/views/base/dept/index.vue +11 -11
- package/dist/package/src/views/base/dict/index.vue +5 -5
- package/dist/package/src/views/base/dict/item.vue +12 -12
- package/dist/package/src/views/base/file/index.vue +220 -16
- package/dist/package/src/views/base/job/index.vue +5 -5
- package/dist/package/src/views/base/job/log.vue +38 -11
- package/dist/package/src/views/base/language/index.vue +1 -1
- package/dist/package/src/views/base/login-log/index.vue +49 -45
- package/dist/package/src/views/base/login-policy/format.ts +4 -0
- package/dist/package/src/views/base/login-policy/index.vue +496 -185
- package/dist/package/src/views/base/menu/index.vue +17 -17
- package/dist/package/src/views/base/message/index.vue +149 -19
- package/dist/package/src/views/base/message-category/index.vue +41 -10
- package/dist/package/src/views/base/migration/index.vue +2 -2
- package/dist/package/src/views/base/oauth-client/index.vue +19 -9
- package/dist/package/src/views/base/operation-log/index.vue +54 -50
- package/dist/package/src/views/base/permission-log/index.vue +57 -52
- package/dist/package/src/views/base/policy-evaluation-log/index.vue +61 -50
- 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 +38 -11
- package/dist/package/src/views/profile/components/base.vue +84 -8
- package/dist/package/src/views/profile/components/password.vue +2 -228
- package/dist/package/src/views/profile/components/security.vue +3 -3
- package/dist/package/src/views/profile/components/session.vue +10 -2
- package/dist/package/src/views/profile/index.vue +10 -9
- 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 +2 -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 +31 -96
- 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_audit_log.d.ts +0 -55
- package/dist/package/declarations/src/api/system/base_dict.d.ts +0 -32
- package/dist/package/declarations/src/api/system/base_login_policy.d.ts +0 -10
- package/dist/package/declarations/src/components/auditLog.d.ts +0 -9
- package/dist/package/declarations/src/rpc/system/admin/v1/base_audit_log.d.ts +0 -640
- package/dist/package/src/api/base/notification.ts +0 -69
- package/dist/package/src/api/system/base_audit_log.ts +0 -168
- package/dist/package/src/api/system/base_login_policy.ts +0 -32
- package/dist/package/src/components/AuditLogTable.vue +0 -105
- package/dist/package/src/components/auditLog.ts +0 -46
- package/dist/package/src/rpc/system/admin/v1/base_audit_log.ts +0 -737
- /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_dashboard.d.ts → admin/v1/base_dashboard.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_file.d.ts → admin/v1/base_file.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_message.d.ts → admin/v1/base_message.d.ts} +0 -0
- /package/dist/package/declarations/src/api/system/{base_message_category.d.ts → admin/v1/base_message_category.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_session.d.ts → admin/v1/base_session.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/{oauth_client.d.ts → admin/v1/oauth_client.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/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/base/{sse.ts → v1/sse.ts} +0 -0
- /package/dist/package/src/api/system/{auth.ts → admin/v1/auth.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_dashboard.ts → admin/v1/base_dashboard.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_file.ts → admin/v1/base_file.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_session.ts → admin/v1/base_session.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/{oauth_client.ts → admin/v1/oauth_client.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
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="table-box page-box">
|
|
3
|
+
<ProTable ref="table" row-key="id" :columns="columns" :header-actions="headerActions" :request-api="requestTable" />
|
|
4
|
+
<FormDialog v-model="dialog.visible" ref="dialogRef" :title="t(dialog.titleKey)" width="560px" :model="form" :fields="fields" :rules="rules" @confirm="submit" @close="resetForm" />
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script setup lang="ts">
|
|
9
|
+
import { computed, reactive, ref, watch } from "vue";
|
|
10
|
+
import { ElMessage, ElMessageBox } from "element-plus";
|
|
11
|
+
import { CirclePlus, Delete, EditPen } from "@element-plus/icons-vue";
|
|
12
|
+
import type { ColumnProps, EnumProps, HeaderActionProps, ProTableInstance } from "@liujitcn/kratos-admin-core/components/ProTable/interface";
|
|
13
|
+
import ProTable from "@liujitcn/kratos-admin-core/components/ProTable";
|
|
14
|
+
import FormDialog from "@liujitcn/kratos-admin-core/components/Dialog/FormDialog.vue";
|
|
15
|
+
import type { ProFormField, ProFormOption } from "@liujitcn/kratos-admin-core/components/ProForm/interface";
|
|
16
|
+
import { useAuthButtons } from "@liujitcn/kratos-admin-core/auth";
|
|
17
|
+
import { buildPageRequest, normalizeSelectedIds } from "@liujitcn/kratos-admin-core/table";
|
|
18
|
+
import { t } from "@liujitcn/kratos-admin-core";
|
|
19
|
+
import { defBaseApiService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_api";
|
|
20
|
+
import { defBaseRedactFieldService } from "@liujitcn/kratos-admin-system/api/system/base_redact_field";
|
|
21
|
+
import { defBaseRedactPolicyService } from "@liujitcn/kratos-admin-system/api/system/base_redact_policy";
|
|
22
|
+
import { defBaseRedactRuleService } from "@liujitcn/kratos-admin-system/api/system/base_redact_rule";
|
|
23
|
+
import type { BaseApi } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_api";
|
|
24
|
+
import type { BaseRedactPolicy, BaseRedactPolicyForm, PageBaseRedactPolicyRequest } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_redact_policy";
|
|
25
|
+
import { BaseRedactPolicyMode } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_redact_policy";
|
|
26
|
+
import { BaseRedactDirection } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_redact_common";
|
|
27
|
+
import { Status } from "@liujitcn/kratos-admin-system/rpc/common/v1/enum";
|
|
28
|
+
|
|
29
|
+
defineOptions({ name: "BaseRedactPolicy", inheritAttrs: false });
|
|
30
|
+
const { BUTTONS } = useAuthButtons();
|
|
31
|
+
const table = ref<ProTableInstance>();
|
|
32
|
+
const dialogRef = ref<InstanceType<typeof FormDialog>>();
|
|
33
|
+
const apiOptions = ref<ProFormOption[]>([]);
|
|
34
|
+
const fieldOptions = ref<ProFormOption[]>([]);
|
|
35
|
+
const ruleOptions = ref<ProFormOption[]>([]);
|
|
36
|
+
const dialog = reactive({ visible: false, titleKey: "common.action.create_resource" });
|
|
37
|
+
const statusOptions = computed<ProFormOption[]>(() => [{ label: t("common.status.enabled"), value: Status.STATUS_ENABLE }, { label: t("common.status.disabled"), value: Status.STATUS_DISABLE }]);
|
|
38
|
+
const directionOptions = computed<ProFormOption[]>(() => [{ label: t("system.base.redact_policy.direction.response"), value: BaseRedactDirection.BASE_REDACT_DIRECTION_RESPONSE }]);
|
|
39
|
+
const modeOptions = computed<ProFormOption[]>(() => [{ label: t("system.base.redact_policy.mode.rule"), value: BaseRedactPolicyMode.BASE_REDACT_POLICY_MODE_RULE }, { label: t("system.base.redact_policy.mode.hide"), value: BaseRedactPolicyMode.BASE_REDACT_POLICY_MODE_HIDE }, { label: t("system.base.redact_policy.mode.full"), value: BaseRedactPolicyMode.BASE_REDACT_POLICY_MODE_FULL }]);
|
|
40
|
+
const form = reactive<BaseRedactPolicyForm>({ id: 0, field_id: 0, rule_id: 0, scene_code: "*", operation: "", direction: BaseRedactDirection.BASE_REDACT_DIRECTION_RESPONSE, mode: BaseRedactPolicyMode.BASE_REDACT_POLICY_MODE_RULE, priority: 0, status: Status.STATUS_ENABLE, version: 1, remark: "" });
|
|
41
|
+
const fields = computed<ProFormField[]>(() => [
|
|
42
|
+
{ prop: "operation", label: t("system.base.redact_policy.field.operation"), component: "select", props: { filterable: true }, options: apiOptions.value },
|
|
43
|
+
{ prop: "direction", label: t("system.base.redact_policy.field.direction"), component: "select", options: directionOptions.value },
|
|
44
|
+
{ prop: "field_id", label: t("system.base.redact_policy.field.field"), component: "select", props: { filterable: true }, options: fieldOptions.value },
|
|
45
|
+
{ prop: "rule_id", label: t("system.base.redact_policy.field.rule"), component: "select", props: { filterable: true, clearable: true }, options: ruleOptions.value, visible: () => form.mode === BaseRedactPolicyMode.BASE_REDACT_POLICY_MODE_RULE },
|
|
46
|
+
{ prop: "scene_code", label: t("system.base.redact_policy.field.scene_code"), component: "input", props: { disabled: true } },
|
|
47
|
+
{ prop: "mode", label: t("system.base.redact_policy.field.mode"), component: "select", options: modeOptions.value },
|
|
48
|
+
{ prop: "priority", label: t("system.base.redact_policy.field.priority"), component: "input-number", props: { min: 0, precision: 0, style: { width: "100%" } } },
|
|
49
|
+
{ prop: "version", label: t("system.base.redact_policy.field.version"), component: "input-number", props: { min: 1, precision: 0, style: { width: "100%" } } },
|
|
50
|
+
{ prop: "status", label: t("common.field.status"), component: "radio-group", options: statusOptions.value },
|
|
51
|
+
{ prop: "remark", label: t("common.field.remark"), component: "textarea" }
|
|
52
|
+
]);
|
|
53
|
+
const rules = computed(() => ({ operation: [{ required: true, message: t("system.base.redact_policy.validation.operation"), trigger: "change" }], direction: [{ required: true, message: t("system.base.redact_policy.validation.direction"), trigger: "change" }], field_id: [{ required: true, message: t("system.base.redact_policy.validation.field"), trigger: "change" }], scene_code: [{ required: true, message: t("system.base.redact_policy.validation.scene"), trigger: "blur" }] }));
|
|
54
|
+
const modeEnums = computed<EnumProps[]>(() => modeOptions.value);
|
|
55
|
+
const columns = computed<ColumnProps[]>(() => [
|
|
56
|
+
{ type: "selection", width: 55 },
|
|
57
|
+
{ prop: "operation", label: t("system.base.redact_policy.field.operation"), minWidth: 300, search: { el: "input" } },
|
|
58
|
+
{ prop: "direction", label: t("system.base.redact_policy.field.direction"), width: 110, enum: directionOptions.value, isFilterEnum: true, search: { el: "select", enum: directionOptions.value } },
|
|
59
|
+
{ prop: "message_ref", label: t("system.base.redact_policy.field.message_ref"), minWidth: 220, search: { el: "input" } },
|
|
60
|
+
{ prop: "field_path", label: t("system.base.redact_policy.field.field_path"), minWidth: 130, search: { el: "input" } },
|
|
61
|
+
{ prop: "scene_code", label: t("system.base.redact_policy.field.scene_code"), width: 110, search: { el: "input" } },
|
|
62
|
+
{ prop: "mode", label: t("system.base.redact_policy.field.mode"), width: 110, enum: modeEnums.value, isFilterEnum: true, search: { el: "select", enum: modeEnums.value } },
|
|
63
|
+
{ prop: "rule_code", label: t("system.base.redact_policy.field.rule"), width: 150 },
|
|
64
|
+
{ prop: "version", label: t("system.base.redact_policy.field.version"), width: 80 },
|
|
65
|
+
{ 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:redact-policy:status"], beforeChange: scope => changeStatus(scope.row as BaseRedactPolicy) } },
|
|
66
|
+
{ prop: "actions", label: t("common.field.operation"), width: 140, fixed: "right", cellType: "actions", actions: [{ label: t("common.action.edit"), type: "primary", link: true, icon: EditPen, hidden: () => !BUTTONS.value["base:redact-policy:update"], onClick: scope => openDialog((scope.row as BaseRedactPolicy).id) }, { label: t("common.action.delete"), type: "danger", link: true, icon: Delete, hidden: () => !BUTTONS.value["base:redact-policy:delete"], onClick: scope => deleteItems(scope.row as BaseRedactPolicy) }] }
|
|
67
|
+
]);
|
|
68
|
+
const headerActions = computed<HeaderActionProps[]>(() => [{ label: t("common.action.create"), type: "success", icon: CirclePlus, hidden: () => !BUTTONS.value["base:redact-policy:create"], onClick: () => openDialog() }, { label: t("common.action.delete"), type: "danger", icon: Delete, hidden: () => !BUTTONS.value["base:redact-policy:delete"], disabled: scope => !scope.selectedList.length, onClick: scope => deleteItems(scope.selectedList as BaseRedactPolicy[]) }]);
|
|
69
|
+
|
|
70
|
+
/** 请求策略分页列表。 */
|
|
71
|
+
async function requestTable(params: PageBaseRedactPolicyRequest) { const data = await defBaseRedactPolicyService.PageBaseRedactPolicy(buildPageRequest(params)); return { data: { list: data.base_redact_policies ?? [], total: data.total } }; }
|
|
72
|
+
/** 加载接口和规则选项。 */
|
|
73
|
+
async function loadOptions() { const [apisResult, rulesResult] = await Promise.all([defBaseApiService.OptionBaseApi({ include_public: true }), defBaseRedactRuleService.OptionBaseRedactRule({ keyword: "" })]); apiOptions.value = (apisResult.base_apis ?? []).map((item: BaseApi) => ({ label: `${item.service_name} / ${item.operation} (${item.method} ${item.path})`, value: item.operation })); ruleOptions.value = rulesResult.list ?? []; await loadFieldOptions(); }
|
|
74
|
+
/** 按当前接口和方向加载可选字段。 */
|
|
75
|
+
async function loadFieldOptions() { if (!form.operation) { fieldOptions.value = []; form.field_id = 0; return; } const result = await defBaseRedactFieldService.OptionBaseRedactField({ keyword: "", operation: form.operation, direction: form.direction }); fieldOptions.value = result.list ?? []; if (!fieldOptions.value.some(item => item.value === form.field_id)) form.field_id = 0; }
|
|
76
|
+
/** 打开策略编辑弹窗。 */
|
|
77
|
+
async function openDialog(id?: number) { resetForm(); await loadOptions(); dialog.titleKey = id ? "common.action.edit_resource" : "common.action.create_resource"; dialog.visible = true; if (id) Object.assign(form, await defBaseRedactPolicyService.GetBaseRedactPolicy({ id })); }
|
|
78
|
+
/** 重置策略表单。 */
|
|
79
|
+
function resetForm() { dialog.visible = false; dialogRef.value?.resetFields(); Object.assign(form, { id: 0, field_id: 0, rule_id: 0, scene_code: "*", operation: "", direction: BaseRedactDirection.BASE_REDACT_DIRECTION_RESPONSE, mode: BaseRedactPolicyMode.BASE_REDACT_POLICY_MODE_RULE, priority: 0, status: Status.STATUS_ENABLE, version: 1, remark: "" }); }
|
|
80
|
+
/** 提交策略表单。 */
|
|
81
|
+
function submit() { dialogRef.value?.validate()?.then(async valid => { if (!valid) return; const payload = JSON.parse(JSON.stringify(form)) as BaseRedactPolicyForm; if (payload.mode !== BaseRedactPolicyMode.BASE_REDACT_POLICY_MODE_RULE) payload.rule_id = 0; if (payload.id) await defBaseRedactPolicyService.UpdateBaseRedactPolicy({ base_redact_policy: payload }); else await defBaseRedactPolicyService.CreateBaseRedactPolicy({ base_redact_policy: payload }); ElMessage.success(t(payload.id ? "common.message.update_success" : "common.message.create_success", { resource: t("system.base.redact_policy.title") })); resetForm(); table.value?.getTableList(); }); }
|
|
82
|
+
/** 切换策略状态。 */
|
|
83
|
+
async function changeStatus(row: BaseRedactPolicy) { const next = row.status === Status.STATUS_ENABLE ? Status.STATUS_DISABLE : Status.STATUS_ENABLE; try { await ElMessageBox.confirm(t("common.dialog.status_change", { action: t(next === Status.STATUS_ENABLE ? "common.status.enabled" : "common.status.disabled"), resource: t("system.base.redact_policy.title"), field: t("system.base.redact_policy.field.message_ref"), value: row.message_ref })); await defBaseRedactPolicyService.SetBaseRedactPolicyStatus({ id: row.id, status: next }); table.value?.getTableList(); return true; } catch { return false; } }
|
|
84
|
+
/** 删除策略绑定。 */
|
|
85
|
+
function deleteItems(selected?: BaseRedactPolicy | BaseRedactPolicy[] | number | string | Array<number | string>) { const items = Array.isArray(selected) ? selected.filter((item): item is BaseRedactPolicy => typeof item === "object") : selected && typeof selected === "object" ? [selected] : []; const ids = items.length ? items.map(item => item.id) : normalizeSelectedIds(selected as number | string | Array<number | string>); if (!ids.length) { ElMessage.warning(t("common.message.select_delete_item")); return; } ElMessageBox.confirm(t("common.dialog.delete_selected", { resource: t("system.base.redact_policy.title") }), t("common.title.warning"), { type: "warning" }).then(async () => { await defBaseRedactPolicyService.DeleteBaseRedactPolicy({ id: ids.join(",") }); ElMessage.success(t("common.message.delete_success", { resource: t("system.base.redact_policy.title") })); table.value?.getTableList(); }); }
|
|
86
|
+
|
|
87
|
+
watch([() => form.operation, () => form.direction], () => { void loadFieldOptions(); });
|
|
88
|
+
</script>
|
|
89
|
+
|
|
90
|
+
<style scoped lang="scss">
|
|
91
|
+
.page-box { padding: 20px; }
|
|
92
|
+
</style>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="table-box page-box">
|
|
3
|
+
<ProTable ref="table" row-key="id" :columns="columns" :header-actions="headerActions" :request-api="requestTable" />
|
|
4
|
+
<FormDialog v-model="dialog.visible" ref="dialogRef" :title="t(dialog.titleKey)" width="620px" :model="form" :fields="fields" :rules="rules" @confirm="submit" @close="resetForm" />
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script setup lang="ts">
|
|
9
|
+
import { computed, reactive, ref } from "vue";
|
|
10
|
+
import { ElMessage, ElMessageBox } from "element-plus";
|
|
11
|
+
import { CirclePlus, Delete, EditPen } from "@element-plus/icons-vue";
|
|
12
|
+
import type { ColumnProps, HeaderActionProps, ProTableInstance } from "@liujitcn/kratos-admin-core/components/ProTable/interface";
|
|
13
|
+
import ProTable from "@liujitcn/kratos-admin-core/components/ProTable";
|
|
14
|
+
import FormDialog from "@liujitcn/kratos-admin-core/components/Dialog/FormDialog.vue";
|
|
15
|
+
import type { ProFormField, ProFormOption } from "@liujitcn/kratos-admin-core/components/ProForm/interface";
|
|
16
|
+
import { useAuthButtons } from "@liujitcn/kratos-admin-core/auth";
|
|
17
|
+
import { buildPageRequest, normalizeSelectedIds } from "@liujitcn/kratos-admin-core/table";
|
|
18
|
+
import { t } from "@liujitcn/kratos-admin-core";
|
|
19
|
+
import { defBaseRedactRuleService } from "@liujitcn/kratos-admin-system/api/system/base_redact_rule";
|
|
20
|
+
import type { BaseRedactRule, BaseRedactRuleForm, PageBaseRedactRuleRequest } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_redact_rule";
|
|
21
|
+
import { Status } from "@liujitcn/kratos-admin-system/rpc/common/v1/enum";
|
|
22
|
+
|
|
23
|
+
defineOptions({ name: "BaseRedactRule", inheritAttrs: false });
|
|
24
|
+
const { BUTTONS } = useAuthButtons();
|
|
25
|
+
const table = ref<ProTableInstance>();
|
|
26
|
+
const dialogRef = ref<InstanceType<typeof FormDialog>>();
|
|
27
|
+
const dialog = reactive({ visible: false, titleKey: "common.action.create_resource" });
|
|
28
|
+
const form = reactive<BaseRedactRuleForm>({ id: 0, code: "", name: "", rule_type: "MASK", rule: '{"mask":{"keep_first":3,"keep_last":4,"mask_char":"*"}}', status: Status.STATUS_ENABLE, version: 1, remark: "" });
|
|
29
|
+
const statusOptions = computed<ProFormOption[]>(() => [{ label: t("common.status.enabled"), value: Status.STATUS_ENABLE }, { label: t("common.status.disabled"), value: Status.STATUS_DISABLE }]);
|
|
30
|
+
const fields = computed<ProFormField[]>(() => [{ prop: "code", label: t("system.base.redact_policy.field.code"), component: "input" }, { prop: "name", label: t("system.base.redact_policy.field.name"), component: "input" }, { prop: "rule_type", label: t("system.base.redact_policy.field.rule_type"), component: "input" }, { prop: "rule", label: t("system.base.redact_policy.field.rule"), component: "textarea", props: { rows: 8 } }, { prop: "version", label: t("system.base.redact_policy.field.version"), component: "input-number", props: { min: 1, precision: 0, style: { width: "100%" } } }, { prop: "status", label: t("common.field.status"), component: "radio-group", options: statusOptions.value }, { prop: "remark", label: t("common.field.remark"), component: "textarea" }]);
|
|
31
|
+
const rules = computed(() => ({ code: [{ required: true, message: t("system.base.redact_policy.validation.code"), trigger: "blur" }], name: [{ required: true, message: t("system.base.redact_policy.validation.name"), trigger: "blur" }], rule_type: [{ required: true, message: t("system.base.redact_policy.validation.rule_type"), trigger: "blur" }], rule: [{ required: true, message: t("system.base.redact_policy.validation.rule"), trigger: "blur" }] }));
|
|
32
|
+
const columns = computed<ColumnProps[]>(() => [{ type: "selection", width: 55 }, { prop: "code", label: t("system.base.redact_policy.field.code"), minWidth: 160, search: { el: "input" } }, { prop: "name", label: t("system.base.redact_policy.field.name"), minWidth: 160, search: { el: "input" } }, { prop: "rule_type", label: t("system.base.redact_policy.field.rule_type"), width: 120, search: { el: "input" } }, { prop: "rule", label: t("system.base.redact_policy.field.rule"), minWidth: 240, showOverflowTooltip: true }, { prop: "version", label: t("system.base.redact_policy.field.version"), width: 80 }, { 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:redact-rule:status"], beforeChange: scope => changeStatus(scope.row as BaseRedactRule) } }, { prop: "operation", label: t("common.field.operation"), width: 140, fixed: "right", cellType: "actions", actions: [{ label: t("common.action.edit"), type: "primary", link: true, icon: EditPen, hidden: () => !BUTTONS.value["base:redact-rule:update"], onClick: scope => openDialog((scope.row as BaseRedactRule).id) }, { label: t("common.action.delete"), type: "danger", link: true, icon: Delete, hidden: () => !BUTTONS.value["base:redact-rule:delete"], onClick: scope => deleteItems(scope.row as BaseRedactRule) }] }]);
|
|
33
|
+
const headerActions = computed<HeaderActionProps[]>(() => [{ label: t("common.action.create"), type: "success", icon: CirclePlus, hidden: () => !BUTTONS.value["base:redact-rule:create"], onClick: () => openDialog() }, { label: t("common.action.delete"), type: "danger", icon: Delete, hidden: () => !BUTTONS.value["base:redact-rule:delete"], disabled: scope => !scope.selectedList.length, onClick: scope => deleteItems(scope.selectedList as BaseRedactRule[]) }]);
|
|
34
|
+
|
|
35
|
+
/** 请求规则分页列表。 */
|
|
36
|
+
async function requestTable(params: PageBaseRedactRuleRequest) { const data = await defBaseRedactRuleService.PageBaseRedactRule(buildPageRequest(params)); return { data: { list: data.base_redact_rules ?? [], total: data.total } }; }
|
|
37
|
+
/** 打开规则编辑弹窗。 */
|
|
38
|
+
async function openDialog(id?: number) { resetForm(); dialog.titleKey = id ? "common.action.edit_resource" : "common.action.create_resource"; dialog.visible = true; if (id) Object.assign(form, await defBaseRedactRuleService.GetBaseRedactRule({ id })); }
|
|
39
|
+
/** 重置规则表单。 */
|
|
40
|
+
function resetForm() { dialog.visible = false; dialogRef.value?.resetFields(); Object.assign(form, { id: 0, code: "", name: "", rule_type: "MASK", rule: '{"mask":{"keep_first":3,"keep_last":4,"mask_char":"*"}}', status: Status.STATUS_ENABLE, version: 1, remark: "" }); }
|
|
41
|
+
/** 提交规则表单。 */
|
|
42
|
+
function submit() { dialogRef.value?.validate()?.then(async valid => { if (!valid) return; const payload = JSON.parse(JSON.stringify(form)) as BaseRedactRuleForm; if (payload.id) await defBaseRedactRuleService.UpdateBaseRedactRule({ base_redact_rule: payload }); else await defBaseRedactRuleService.CreateBaseRedactRule({ base_redact_rule: payload }); ElMessage.success(t(payload.id ? "common.message.update_success" : "common.message.create_success", { resource: t("system.base.redact_policy.tabs.rule") })); resetForm(); table.value?.getTableList(); }); }
|
|
43
|
+
/** 切换规则状态。 */
|
|
44
|
+
async function changeStatus(row: BaseRedactRule) { const next = row.status === Status.STATUS_ENABLE ? Status.STATUS_DISABLE : Status.STATUS_ENABLE; try { await ElMessageBox.confirm(t("common.dialog.status_change", { action: t(next === Status.STATUS_ENABLE ? "common.status.enabled" : "common.status.disabled"), resource: t("system.base.redact_policy.tabs.rule"), field: t("system.base.redact_policy.field.code"), value: row.code })); await defBaseRedactRuleService.SetBaseRedactRuleStatus({ id: row.id, status: next }); table.value?.getTableList(); return true; } catch { return false; } }
|
|
45
|
+
/** 删除规则模板。 */
|
|
46
|
+
function deleteItems(selected?: BaseRedactRule | BaseRedactRule[] | number | string | Array<number | string>) { const items = Array.isArray(selected) ? selected.filter((item): item is BaseRedactRule => typeof item === "object") : selected && typeof selected === "object" ? [selected] : []; const ids = items.length ? items.map(item => item.id) : normalizeSelectedIds(selected as number | string | Array<number | string>); if (!ids.length) { ElMessage.warning(t("common.message.select_delete_item")); return; } ElMessageBox.confirm(t("common.dialog.delete_selected", { resource: t("system.base.redact_policy.tabs.rule") }), t("common.title.warning"), { type: "warning" }).then(async () => { await defBaseRedactRuleService.DeleteBaseRedactRule({ id: ids.join(",") }); ElMessage.success(t("common.message.delete_success", { resource: t("system.base.redact_policy.tabs.rule") })); table.value?.getTableList(); }); }
|
|
47
|
+
</script>
|
|
48
|
+
|
|
49
|
+
<style scoped lang="scss">
|
|
50
|
+
.page-box { padding: 20px; }
|
|
51
|
+
</style>
|
|
@@ -93,10 +93,10 @@ import ProTable from "@liujitcn/kratos-admin-core/components/ProTable";
|
|
|
93
93
|
import FormDialog from "@liujitcn/kratos-admin-core/components/Dialog/FormDialog.vue";
|
|
94
94
|
import type { ProFormField, ProFormOption } from "@liujitcn/kratos-admin-core/components/ProForm/interface";
|
|
95
95
|
import { useAuthButtons } from "@liujitcn/kratos-admin-core/auth";
|
|
96
|
-
import { defBaseRoleService } from "@liujitcn/kratos-admin-system/api/system/base_role";
|
|
96
|
+
import { defBaseRoleService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_role";
|
|
97
97
|
import type { BaseRole, BaseRoleForm, PageBaseRoleRequest } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_role";
|
|
98
|
-
import { defBaseMenuService } from "@liujitcn/kratos-admin-system/api/system/base_menu";
|
|
99
|
-
import { defBaseTenantService } from "@liujitcn/kratos-admin-system/api/system/base_tenant";
|
|
98
|
+
import { defBaseMenuService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_menu";
|
|
99
|
+
import { defBaseTenantService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_tenant";
|
|
100
100
|
import type { SelectOptionResponse_Option, TreeOptionResponse_Option } from "@liujitcn/kratos-admin-system/rpc/common/v1/common";
|
|
101
101
|
import { Status } from "@liujitcn/kratos-admin-system/rpc/common/v1/enum";
|
|
102
102
|
import { buildPageRequest, normalizeSelectedIds } from "@liujitcn/kratos-admin-core/table";
|
|
@@ -163,7 +163,7 @@ const rules = computed(() => ({
|
|
|
163
163
|
tenant_id: [
|
|
164
164
|
{
|
|
165
165
|
required: true,
|
|
166
|
-
message: t("common.validation.required_select", { field: t("
|
|
166
|
+
message: t("common.validation.required_select", { field: t("common.field.tenant") }),
|
|
167
167
|
trigger: "change"
|
|
168
168
|
}
|
|
169
169
|
],
|
|
@@ -245,10 +245,10 @@ const isDefaultTenant = computed(() => userStore.userInfo.tenant_code === DEFAUL
|
|
|
245
245
|
const formFields = computed<ProFormField[]>(() => [
|
|
246
246
|
{
|
|
247
247
|
prop: "tenant_id",
|
|
248
|
-
label: t("
|
|
248
|
+
label: t("common.field.tenant"),
|
|
249
249
|
component: "select",
|
|
250
250
|
props: {
|
|
251
|
-
placeholder: t("
|
|
251
|
+
placeholder: t("common.placeholder.select"),
|
|
252
252
|
filterable: true,
|
|
253
253
|
disabled: Boolean(formData.id),
|
|
254
254
|
onChange: handleFormTenantChange
|
|
@@ -306,7 +306,7 @@ const columns = computed<ColumnProps[]>(() => [
|
|
|
306
306
|
? ([
|
|
307
307
|
{
|
|
308
308
|
prop: "tenant_id",
|
|
309
|
-
label: t("
|
|
309
|
+
label: t("common.field.tenant"),
|
|
310
310
|
minWidth: 140,
|
|
311
311
|
showOverflowTooltip: true,
|
|
312
312
|
search: { el: "select", key: "tenant_id", props: { filterable: true }, order: 1 },
|
|
@@ -686,7 +686,7 @@ function handelParentChildLinkedChange(val: CheckboxValueType) {
|
|
|
686
686
|
padding: 14px;
|
|
687
687
|
background: linear-gradient(180deg, #f8fafc 0%, #f3f6fb 100%);
|
|
688
688
|
border: 1px solid #e4eaf3;
|
|
689
|
-
border-radius:
|
|
689
|
+
border-radius: var(--admin-page-radius);
|
|
690
690
|
}
|
|
691
691
|
.perm-search {
|
|
692
692
|
width: 100%;
|
|
@@ -706,7 +706,7 @@ function handelParentChildLinkedChange(val: CheckboxValueType) {
|
|
|
706
706
|
padding: 6px 10px;
|
|
707
707
|
background: rgb(255 255 255 / 94%);
|
|
708
708
|
border: 1px solid #e4eaf3;
|
|
709
|
-
border-radius:
|
|
709
|
+
border-radius: var(--admin-page-radius);
|
|
710
710
|
}
|
|
711
711
|
.perm-toolbar__group--linkage {
|
|
712
712
|
margin-left: auto;
|