@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.
Files changed (332) hide show
  1. package/README.md +46 -15
  2. package/dist/package/declarations/src/api/base/v1/notification.d.ts +26 -0
  3. package/dist/package/declarations/src/api/system/admin/v1/base_api_log.d.ts +10 -0
  4. package/dist/package/declarations/src/api/system/{base_area.d.ts → admin/v1/base_area.d.ts} +1 -1
  5. package/dist/package/declarations/src/api/system/{base_config.d.ts → admin/v1/base_config.d.ts} +5 -1
  6. package/dist/package/declarations/src/api/system/admin/v1/base_dashboard.d.ts +14 -0
  7. package/dist/package/declarations/src/api/system/admin/v1/base_data_access_log.d.ts +10 -0
  8. package/dist/package/declarations/src/api/system/admin/v1/base_dict.d.ts +20 -0
  9. package/dist/package/declarations/src/api/system/admin/v1/base_dict_item.d.ts +18 -0
  10. package/dist/package/declarations/src/api/system/admin/v1/base_file.d.ts +13 -0
  11. package/dist/package/declarations/src/api/system/{base_job.d.ts → admin/v1/base_job.d.ts} +4 -5
  12. package/dist/package/declarations/src/api/system/admin/v1/base_job_log.d.ts +9 -0
  13. package/dist/package/declarations/src/api/system/{base_language.d.ts → admin/v1/base_language.d.ts} +3 -3
  14. package/dist/package/declarations/src/api/system/admin/v1/base_log.d.ts +8 -0
  15. package/dist/package/declarations/src/api/system/admin/v1/base_login_log.d.ts +10 -0
  16. package/dist/package/declarations/src/api/system/admin/v1/base_login_policy.d.ts +19 -0
  17. package/dist/package/declarations/src/api/system/admin/v1/base_message.d.ts +24 -0
  18. package/dist/package/declarations/src/api/system/admin/v1/base_message_category.d.ts +21 -0
  19. package/dist/package/declarations/src/api/system/admin/v1/base_operation_log.d.ts +10 -0
  20. package/dist/package/declarations/src/api/system/admin/v1/base_permission_log.d.ts +10 -0
  21. package/dist/package/declarations/src/api/system/admin/v1/base_policy_evaluation_log.d.ts +10 -0
  22. package/dist/package/declarations/src/api/system/admin/v1/base_session.d.ts +11 -0
  23. package/dist/package/declarations/src/api/system/admin/v1/base_table_archive.d.ts +20 -0
  24. package/dist/package/declarations/src/api/system/admin/v1/base_table_archive_record.d.ts +11 -0
  25. package/dist/package/declarations/src/api/system/admin/v1/base_table_archive_restore.d.ts +14 -0
  26. package/dist/package/declarations/src/api/system/admin/v1/base_table_backup.d.ts +20 -0
  27. package/dist/package/declarations/src/api/system/admin/v1/base_table_backup_record.d.ts +11 -0
  28. package/dist/package/declarations/src/api/system/admin/v1/base_table_backup_restore.d.ts +14 -0
  29. package/dist/package/declarations/src/api/system/admin/v1/base_table_source.d.ts +11 -0
  30. package/dist/package/declarations/src/api/system/admin/v1/cache.d.ts +7 -0
  31. package/dist/package/declarations/src/api/system/admin/v1/oauth_client.d.ts +24 -0
  32. package/dist/package/declarations/src/api/system/base_redact_field.d.ts +20 -0
  33. package/dist/package/declarations/src/api/system/base_redact_policy.d.ts +19 -0
  34. package/dist/package/declarations/src/api/system/base_redact_rule.d.ts +22 -0
  35. package/dist/package/declarations/src/components/DynamicI18nCell.vue.d.ts +5 -1
  36. package/dist/package/declarations/src/components/ForcedPasswordDialog.vue.d.ts +3 -0
  37. package/dist/package/declarations/src/components/LogTable.vue.d.ts +52 -0
  38. package/dist/package/declarations/src/components/Notification.vue.d.ts +3 -0
  39. package/dist/package/declarations/src/components/dynamicI18n.d.ts +4 -7
  40. package/dist/package/declarations/src/components/log.d.ts +20 -0
  41. package/dist/package/declarations/src/config/base-log-fallback.d.ts +7 -0
  42. package/dist/package/declarations/src/config/database-backup.d.ts +12 -0
  43. package/dist/package/declarations/src/config/index.d.ts +7 -0
  44. package/dist/package/declarations/src/config/types.d.ts +56 -0
  45. package/dist/package/declarations/src/locales/generated.d.ts +1968 -88
  46. package/dist/package/declarations/src/rpc/base/v1/login.d.ts +151 -0
  47. package/dist/package/declarations/src/rpc/base/v1/notification.d.ts +306 -0
  48. package/dist/package/declarations/src/rpc/base/v1/oauth.d.ts +25 -0
  49. package/dist/package/declarations/src/rpc/base/v1/oauth_client.d.ts +23 -0
  50. package/dist/package/declarations/src/rpc/system/admin/v1/auth.d.ts +13 -0
  51. package/dist/package/declarations/src/rpc/system/admin/v1/base_api.d.ts +2 -0
  52. package/dist/package/declarations/src/rpc/system/admin/v1/base_api_log.d.ts +84 -0
  53. package/dist/package/declarations/src/rpc/system/admin/v1/base_config.d.ts +38 -0
  54. package/dist/package/declarations/src/rpc/system/admin/v1/base_dashboard.d.ts +60 -0
  55. package/dist/package/declarations/src/rpc/system/admin/v1/base_data_access_log.d.ts +112 -0
  56. package/dist/package/declarations/src/rpc/system/admin/v1/base_dict.d.ts +0 -101
  57. package/dist/package/declarations/src/rpc/system/admin/v1/base_dict_item.d.ts +107 -0
  58. package/dist/package/declarations/src/rpc/system/admin/v1/base_file.d.ts +73 -0
  59. package/dist/package/declarations/src/rpc/system/admin/v1/base_i18n.d.ts +10 -6
  60. package/dist/package/declarations/src/rpc/system/admin/v1/base_job.d.ts +10 -56
  61. package/dist/package/declarations/src/rpc/system/admin/v1/base_job_log.d.ts +60 -0
  62. package/dist/package/declarations/src/rpc/system/admin/v1/base_log.d.ts +66 -76
  63. package/dist/package/declarations/src/rpc/system/admin/v1/base_login_log.d.ts +92 -0
  64. package/dist/package/declarations/src/rpc/system/admin/v1/base_login_policy.d.ts +179 -0
  65. package/dist/package/declarations/src/rpc/system/admin/v1/base_message.d.ts +193 -0
  66. package/dist/package/declarations/src/rpc/system/admin/v1/base_message_category.d.ts +125 -0
  67. package/dist/package/declarations/src/rpc/system/admin/v1/base_operation_log.d.ts +106 -0
  68. package/dist/package/declarations/src/rpc/system/admin/v1/base_permission_log.d.ts +118 -0
  69. package/dist/package/declarations/src/rpc/system/admin/v1/base_policy_evaluation_log.d.ts +119 -0
  70. package/dist/package/declarations/src/rpc/system/admin/v1/base_redact_common.d.ts +9 -0
  71. package/dist/package/declarations/src/rpc/system/admin/v1/base_redact_field.d.ts +161 -0
  72. package/dist/package/declarations/src/rpc/system/admin/v1/base_redact_policy.d.ts +150 -0
  73. package/dist/package/declarations/src/rpc/system/admin/v1/base_redact_rule.d.ts +111 -0
  74. package/dist/package/declarations/src/rpc/system/admin/v1/base_session.d.ts +33 -0
  75. package/dist/package/declarations/src/rpc/system/admin/v1/base_table_archive.d.ts +90 -0
  76. package/dist/package/declarations/src/rpc/system/admin/v1/base_table_archive_record.d.ts +82 -0
  77. package/dist/package/declarations/src/rpc/system/admin/v1/base_table_archive_restore.d.ts +76 -0
  78. package/dist/package/declarations/src/rpc/system/admin/v1/base_table_backup.d.ts +74 -0
  79. package/dist/package/declarations/src/rpc/system/admin/v1/base_table_backup_record.d.ts +69 -0
  80. package/dist/package/declarations/src/rpc/system/admin/v1/base_table_backup_restore.d.ts +76 -0
  81. package/dist/package/declarations/src/rpc/system/admin/v1/base_table_source.d.ts +16 -0
  82. package/dist/package/declarations/src/rpc/system/admin/v1/base_user.d.ts +18 -3
  83. package/dist/package/declarations/src/rpc/system/admin/v1/cache.d.ts +47 -0
  84. package/dist/package/declarations/src/rpc/system/admin/v1/code_gen_column.d.ts +2 -0
  85. package/dist/package/declarations/src/rpc/system/admin/v1/code_gen_table.d.ts +8 -0
  86. package/dist/package/declarations/src/rpc/system/admin/v1/oauth_client.d.ts +145 -0
  87. package/dist/package/declarations/src/rpc/system/common/v1/common.d.ts +26 -0
  88. package/dist/package/declarations/src/rpc/system/config/v1/system_config.d.ts +8 -0
  89. package/dist/package/declarations/src/{api/system → utils}/code_gen_i18n.d.ts +1 -2
  90. package/dist/package/declarations/src/{api/system → utils}/code_gen_sse.d.ts +1 -1
  91. package/dist/package/declarations/src/utils/notification-response.d.ts +5 -0
  92. package/dist/package/declarations/src/{api/system → utils}/ops_monitoring_sse.d.ts +1 -1
  93. package/dist/package/declarations/src/{api/system → utils}/runtime_log_sse.d.ts +1 -1
  94. package/dist/package/declarations/src/views/base/api-log/index.vue.d.ts +3 -0
  95. package/dist/package/declarations/src/views/base/backup-management/archive-config/index.vue.d.ts +3 -0
  96. package/dist/package/declarations/src/views/base/backup-management/archive-record/index.vue.d.ts +3 -0
  97. package/dist/package/declarations/src/views/base/backup-management/archive-restore/index.vue.d.ts +3 -0
  98. package/dist/package/declarations/src/views/base/backup-management/backup-config/index.vue.d.ts +3 -0
  99. package/dist/package/declarations/src/views/base/backup-management/backup-record/index.vue.d.ts +3 -0
  100. package/dist/package/declarations/src/views/base/backup-management/backup-restore/index.vue.d.ts +3 -0
  101. package/dist/package/declarations/src/views/base/dashboard/index.vue.d.ts +3 -0
  102. package/dist/package/declarations/src/views/base/data-access-log/index.vue.d.ts +3 -0
  103. package/dist/package/declarations/src/views/base/file/index.vue.d.ts +3 -0
  104. package/dist/package/declarations/src/views/base/login-log/index.vue.d.ts +3 -0
  105. package/dist/package/declarations/src/views/base/login-policy/format.d.ts +2 -0
  106. package/dist/package/declarations/src/views/base/login-policy/index.vue.d.ts +3 -0
  107. package/dist/package/declarations/src/views/base/message/index.vue.d.ts +3 -0
  108. package/dist/package/declarations/src/views/base/message-category/index.vue.d.ts +3 -0
  109. package/dist/package/declarations/src/views/base/oauth-client/index.vue.d.ts +3 -0
  110. package/dist/package/declarations/src/views/base/operation-log/index.vue.d.ts +3 -0
  111. package/dist/package/declarations/src/views/base/permission-log/index.vue.d.ts +3 -0
  112. package/dist/package/declarations/src/views/base/policy-evaluation-log/index.vue.d.ts +3 -0
  113. package/dist/package/declarations/src/views/base/redact-field/index.vue.d.ts +3 -0
  114. package/dist/package/declarations/src/views/base/redact-policy/index.vue.d.ts +3 -0
  115. package/dist/package/declarations/src/views/base/redact-rule/index.vue.d.ts +3 -0
  116. package/dist/package/declarations/src/views/base/runtime-config/index.vue.d.ts +3 -0
  117. package/dist/package/declarations/src/views/message/inbox/index.vue.d.ts +3 -0
  118. package/dist/package/declarations/src/views/profile/components/session.vue.d.ts +3 -0
  119. package/dist/package/declarations/src/views/tool/cache/index.vue.d.ts +3 -0
  120. package/dist/package/src/api/base/v1/notification.ts +99 -0
  121. package/dist/package/src/api/base/{sse.ts → v1/sse.ts} +4 -4
  122. package/dist/package/src/api/system/{auth.ts → admin/v1/auth.ts} +1 -0
  123. package/dist/package/src/api/system/admin/v1/base_api_log.ts +33 -0
  124. package/dist/package/src/api/system/{base_area.ts → admin/v1/base_area.ts} +1 -1
  125. package/dist/package/src/api/system/{base_config.ts → admin/v1/base_config.ts} +20 -0
  126. package/dist/package/src/api/system/admin/v1/base_dashboard.ts +55 -0
  127. package/dist/package/src/api/system/admin/v1/base_data_access_log.ts +33 -0
  128. package/dist/package/src/api/system/{base_dict.ts → admin/v1/base_dict.ts} +0 -60
  129. package/dist/package/src/api/system/admin/v1/base_dict_item.ts +72 -0
  130. package/dist/package/src/api/system/admin/v1/base_file.ts +43 -0
  131. package/dist/package/src/api/system/{base_job.ts → admin/v1/base_job.ts} +11 -22
  132. package/dist/package/src/api/system/admin/v1/base_job_log.ts +32 -0
  133. package/dist/package/src/api/system/{base_language.ts → admin/v1/base_language.ts} +3 -3
  134. package/dist/package/src/api/system/admin/v1/base_log.ts +23 -0
  135. package/dist/package/src/api/system/admin/v1/base_login_log.ts +33 -0
  136. package/dist/package/src/api/system/admin/v1/base_login_policy.ts +67 -0
  137. package/dist/package/src/api/system/admin/v1/base_message.ts +90 -0
  138. package/dist/package/src/api/system/admin/v1/base_message_category.ts +80 -0
  139. package/dist/package/src/api/system/admin/v1/base_operation_log.ts +33 -0
  140. package/dist/package/src/api/system/admin/v1/base_permission_log.ts +33 -0
  141. package/dist/package/src/api/system/admin/v1/base_policy_evaluation_log.ts +33 -0
  142. package/dist/package/src/api/system/admin/v1/base_session.ts +33 -0
  143. package/dist/package/src/api/system/admin/v1/base_table_archive.ts +70 -0
  144. package/dist/package/src/api/system/admin/v1/base_table_archive_record.ts +33 -0
  145. package/dist/package/src/api/system/admin/v1/base_table_archive_restore.ts +44 -0
  146. package/dist/package/src/api/system/admin/v1/base_table_backup.ts +70 -0
  147. package/dist/package/src/api/system/admin/v1/base_table_backup_record.ts +33 -0
  148. package/dist/package/src/api/system/admin/v1/base_table_backup_restore.ts +44 -0
  149. package/dist/package/src/api/system/admin/v1/base_table_source.ts +33 -0
  150. package/dist/package/src/api/system/admin/v1/cache.ts +22 -0
  151. package/dist/package/src/api/system/{code_gen_column.ts → admin/v1/code_gen_column.ts} +19 -3
  152. package/dist/package/src/api/system/{code_gen_table.ts → admin/v1/code_gen_table.ts} +13 -4
  153. package/dist/package/src/api/system/admin/v1/oauth_client.ts +102 -0
  154. package/dist/package/src/api/system/base_redact_field.ts +25 -0
  155. package/dist/package/src/api/system/base_redact_policy.ts +24 -0
  156. package/dist/package/src/api/system/base_redact_rule.ts +27 -0
  157. package/dist/package/src/components/Ai.vue +1 -1
  158. package/dist/package/src/components/ChangePasswordForm.vue +143 -0
  159. package/dist/package/src/components/DynamicI18nCell.vue +28 -8
  160. package/dist/package/src/components/DynamicI18nEditor.vue +1 -1
  161. package/dist/package/src/components/ForcedPasswordDialog.vue +40 -0
  162. package/dist/package/src/components/LogTable.vue +190 -0
  163. package/dist/package/src/components/Notification.vue +301 -0
  164. package/dist/package/src/components/dynamicI18n.ts +5 -9
  165. package/dist/package/src/components/log.ts +87 -0
  166. package/dist/package/src/config/base-log-fallback.ts +26 -0
  167. package/dist/package/src/config/database-backup.ts +57 -0
  168. package/dist/package/src/config/index.ts +26 -0
  169. package/dist/package/src/config/types.ts +59 -0
  170. package/dist/package/src/locales/README.md +6 -3
  171. package/dist/package/src/locales/en-US.json +511 -29
  172. package/dist/package/src/locales/ja-JP.json +515 -33
  173. package/dist/package/src/locales/zh-CN.json +511 -29
  174. package/dist/package/src/locales/zh-TW.json +514 -32
  175. package/dist/package/src/module.ts +7 -2
  176. package/dist/package/src/rpc/base/v1/login.ts +174 -0
  177. package/dist/package/src/rpc/base/v1/notification.ts +343 -0
  178. package/dist/package/src/rpc/base/v1/oauth.ts +25 -0
  179. package/dist/package/src/rpc/base/v1/oauth_client.ts +33 -0
  180. package/dist/package/src/rpc/system/admin/v1/auth.ts +13 -0
  181. package/dist/package/src/rpc/system/admin/v1/base_api.ts +2 -0
  182. package/dist/package/src/rpc/system/admin/v1/base_api_log.ts +102 -0
  183. package/dist/package/src/rpc/system/admin/v1/base_config.ts +42 -0
  184. package/dist/package/src/rpc/system/admin/v1/base_dashboard.ts +81 -0
  185. package/dist/package/src/rpc/system/admin/v1/base_data_access_log.ts +135 -0
  186. package/dist/package/src/rpc/system/admin/v1/base_dict.ts +0 -112
  187. package/dist/package/src/rpc/system/admin/v1/base_dict_item.ts +126 -0
  188. package/dist/package/src/rpc/system/admin/v1/base_file.ts +88 -0
  189. package/dist/package/src/rpc/system/admin/v1/base_i18n.ts +10 -6
  190. package/dist/package/src/rpc/system/admin/v1/base_job.ts +10 -62
  191. package/dist/package/src/rpc/system/admin/v1/base_job_log.ts +75 -0
  192. package/dist/package/src/rpc/system/admin/v1/base_log.ts +67 -78
  193. package/dist/package/src/rpc/system/admin/v1/base_login_log.ts +113 -0
  194. package/dist/package/src/rpc/system/admin/v1/base_login_policy.ts +212 -0
  195. package/dist/package/src/rpc/system/admin/v1/base_message.ts +236 -0
  196. package/dist/package/src/rpc/system/admin/v1/base_message_category.ts +149 -0
  197. package/dist/package/src/rpc/system/admin/v1/base_operation_log.ts +127 -0
  198. package/dist/package/src/rpc/system/admin/v1/base_permission_log.ts +142 -0
  199. package/dist/package/src/rpc/system/admin/v1/base_policy_evaluation_log.ts +143 -0
  200. package/dist/package/src/rpc/system/admin/v1/base_redact_common.ts +17 -0
  201. package/dist/package/src/rpc/system/admin/v1/base_redact_field.ts +182 -0
  202. package/dist/package/src/rpc/system/admin/v1/base_redact_policy.ts +174 -0
  203. package/dist/package/src/rpc/system/admin/v1/base_redact_rule.ts +131 -0
  204. package/dist/package/src/rpc/system/admin/v1/base_session.ts +44 -0
  205. package/dist/package/src/rpc/system/admin/v1/base_table_archive.ts +109 -0
  206. package/dist/package/src/rpc/system/admin/v1/base_table_archive_record.ts +95 -0
  207. package/dist/package/src/rpc/system/admin/v1/base_table_archive_restore.ts +93 -0
  208. package/dist/package/src/rpc/system/admin/v1/base_table_backup.ts +91 -0
  209. package/dist/package/src/rpc/system/admin/v1/base_table_backup_record.ts +82 -0
  210. package/dist/package/src/rpc/system/admin/v1/base_table_backup_restore.ts +91 -0
  211. package/dist/package/src/rpc/system/admin/v1/base_table_source.ts +26 -0
  212. package/dist/package/src/rpc/system/admin/v1/base_user.ts +18 -3
  213. package/dist/package/src/rpc/system/admin/v1/cache.ts +59 -0
  214. package/dist/package/src/rpc/system/admin/v1/code_gen_column.ts +2 -0
  215. package/dist/package/src/rpc/system/admin/v1/code_gen_table.ts +8 -0
  216. package/dist/package/src/rpc/system/admin/v1/oauth_client.ts +174 -0
  217. package/dist/package/src/rpc/system/common/v1/common.ts +35 -0
  218. package/dist/package/src/rpc/system/config/v1/system_config.ts +16 -0
  219. package/dist/package/src/{api/system → utils}/code_gen_i18n.ts +1 -1
  220. package/dist/package/src/{api/system → utils}/code_gen_sse.ts +1 -1
  221. package/dist/package/src/utils/notification-response.ts +22 -0
  222. package/dist/package/src/{api/system → utils}/ops_monitoring_sse.ts +1 -1
  223. package/dist/package/src/{api/system → utils}/runtime_log_sse.ts +1 -1
  224. package/dist/package/src/views/ai/chat/components/AiMarkdown.vue +1 -1
  225. package/dist/package/src/views/ai/chat/components/ChatPanel.vue +4 -6
  226. package/dist/package/src/views/ai/chat/components/XSender.vue +1 -1
  227. package/dist/package/src/views/ai/chat/index.vue +3 -3
  228. package/dist/package/src/views/ai/chat/message.ts +2 -3
  229. package/dist/package/src/views/base/api/index.vue +4 -4
  230. package/dist/package/src/views/base/api-log/index.vue +94 -0
  231. package/dist/package/src/views/base/area/index.vue +1 -1
  232. package/dist/package/src/views/base/backup-management/archive-config/index.vue +151 -0
  233. package/dist/package/src/views/base/backup-management/archive-record/index.vue +44 -0
  234. package/dist/package/src/views/base/backup-management/archive-restore/index.vue +59 -0
  235. package/dist/package/src/views/base/backup-management/backup-config/index.vue +119 -0
  236. package/dist/package/src/views/base/backup-management/backup-record/index.vue +41 -0
  237. package/dist/package/src/views/base/backup-management/backup-restore/index.vue +66 -0
  238. package/dist/package/src/views/base/config/index.vue +19 -28
  239. package/dist/package/src/views/base/dashboard/index.vue +202 -0
  240. package/dist/package/src/views/base/data-access-log/index.vue +96 -0
  241. package/dist/package/src/views/base/dept/index.vue +11 -11
  242. package/dist/package/src/views/base/dict/index.vue +7 -7
  243. package/dist/package/src/views/base/dict/item.vue +14 -14
  244. package/dist/package/src/views/base/file/index.vue +323 -0
  245. package/dist/package/src/views/base/job/index.vue +63 -8
  246. package/dist/package/src/views/base/job/log.vue +38 -11
  247. package/dist/package/src/views/base/language/index.vue +3 -2
  248. package/dist/package/src/views/base/login-log/index.vue +96 -0
  249. package/dist/package/src/views/base/login-policy/format.ts +4 -0
  250. package/dist/package/src/views/base/login-policy/index.vue +530 -0
  251. package/dist/package/src/views/base/menu/index.vue +19 -19
  252. package/dist/package/src/views/base/message/index.vue +712 -0
  253. package/dist/package/src/views/base/message-category/index.vue +387 -0
  254. package/dist/package/src/views/base/migration/index.vue +2 -2
  255. package/dist/package/src/views/base/oauth-client/index.vue +421 -0
  256. package/dist/package/src/views/base/operation-log/index.vue +86 -0
  257. package/dist/package/src/views/base/permission-log/index.vue +90 -0
  258. package/dist/package/src/views/base/policy-evaluation-log/index.vue +93 -0
  259. package/dist/package/src/views/base/post/index.vue +11 -11
  260. package/dist/package/src/views/base/redact-field/index.vue +59 -0
  261. package/dist/package/src/views/base/redact-policy/index.vue +92 -0
  262. package/dist/package/src/views/base/redact-rule/index.vue +51 -0
  263. package/dist/package/src/views/base/role/index.vue +9 -9
  264. package/dist/package/src/views/base/runtime-config/index.vue +479 -0
  265. package/dist/package/src/views/base/tenant/index.vue +9 -9
  266. package/dist/package/src/views/base/user/components/dept-tree.vue +1 -1
  267. package/dist/package/src/views/base/user/index.vue +86 -47
  268. package/dist/package/src/views/message/inbox/index.vue +276 -0
  269. package/dist/package/src/views/profile/components/base.vue +90 -13
  270. package/dist/package/src/views/profile/components/password.vue +3 -229
  271. package/dist/package/src/views/profile/components/security.vue +477 -64
  272. package/dist/package/src/views/profile/components/session.vue +161 -0
  273. package/dist/package/src/views/profile/index.vue +45 -31
  274. package/dist/package/src/views/tool/api-doc/index.vue +3 -3
  275. package/dist/package/src/views/tool/cache/index.vue +352 -0
  276. package/dist/package/src/views/tool/code-gen/code-preview/index.vue +4 -4
  277. package/dist/package/src/views/tool/code-gen/columns/index.vue +16 -16
  278. package/dist/package/src/views/tool/code-gen/components/CodeGenLocaleEditor.vue +2 -2
  279. package/dist/package/src/views/tool/code-gen/components/CodeGenProgressDialog.vue +2 -2
  280. package/dist/package/src/views/tool/code-gen/config.ts +3 -0
  281. package/dist/package/src/views/tool/code-gen/preview/index.vue +9 -9
  282. package/dist/package/src/views/tool/code-gen/proto/index.vue +10 -12
  283. package/dist/package/src/views/tool/code-gen/table/index.vue +71 -15
  284. package/dist/package/src/views/tool/ops-monitoring/index.vue +55 -116
  285. package/dist/package/src/views/tool/project-doc/index.vue +2 -2
  286. package/dist/package/src/views/tool/runtime-log/index.vue +6 -6
  287. package/package.json +7 -2
  288. package/dist/package/declarations/src/api/system/base_dict.d.ts +0 -32
  289. package/dist/package/declarations/src/api/system/base_log.d.ts +0 -9
  290. package/dist/package/src/api/system/base_log.ts +0 -32
  291. package/dist/package/src/views/base/log/index.vue +0 -339
  292. /package/dist/package/declarations/src/api/base/{ai_message.d.ts → v1/ai_message.d.ts} +0 -0
  293. /package/dist/package/declarations/src/api/base/{ai_session.d.ts → v1/ai_session.d.ts} +0 -0
  294. /package/dist/package/declarations/src/api/base/{ai_tool.d.ts → v1/ai_tool.d.ts} +0 -0
  295. /package/dist/package/declarations/src/api/base/{oauth.d.ts → v1/oauth.d.ts} +0 -0
  296. /package/dist/package/declarations/src/api/base/{sse.d.ts → v1/sse.d.ts} +0 -0
  297. /package/dist/package/declarations/src/api/system/{auth.d.ts → admin/v1/auth.d.ts} +0 -0
  298. /package/dist/package/declarations/src/api/system/{base_api.d.ts → admin/v1/base_api.d.ts} +0 -0
  299. /package/dist/package/declarations/src/api/system/{base_dept.d.ts → admin/v1/base_dept.d.ts} +0 -0
  300. /package/dist/package/declarations/src/api/system/{base_i18n.d.ts → admin/v1/base_i18n.d.ts} +0 -0
  301. /package/dist/package/declarations/src/api/system/{base_menu.d.ts → admin/v1/base_menu.d.ts} +0 -0
  302. /package/dist/package/declarations/src/api/system/{base_migration.d.ts → admin/v1/base_migration.d.ts} +0 -0
  303. /package/dist/package/declarations/src/api/system/{base_post.d.ts → admin/v1/base_post.d.ts} +0 -0
  304. /package/dist/package/declarations/src/api/system/{base_role.d.ts → admin/v1/base_role.d.ts} +0 -0
  305. /package/dist/package/declarations/src/api/system/{base_tenant.d.ts → admin/v1/base_tenant.d.ts} +0 -0
  306. /package/dist/package/declarations/src/api/system/{base_user.d.ts → admin/v1/base_user.d.ts} +0 -0
  307. /package/dist/package/declarations/src/api/system/{code_gen.d.ts → admin/v1/code_gen.d.ts} +0 -0
  308. /package/dist/package/declarations/src/api/system/{code_gen_column.d.ts → admin/v1/code_gen_column.d.ts} +0 -0
  309. /package/dist/package/declarations/src/api/system/{code_gen_proto.d.ts → admin/v1/code_gen_proto.d.ts} +0 -0
  310. /package/dist/package/declarations/src/api/system/{code_gen_table.d.ts → admin/v1/code_gen_table.d.ts} +0 -0
  311. /package/dist/package/declarations/src/api/system/{ops_monitoring.d.ts → admin/v1/ops_monitoring.d.ts} +0 -0
  312. /package/dist/package/declarations/src/api/system/{project_document.d.ts → admin/v1/project_document.d.ts} +0 -0
  313. /package/dist/package/declarations/src/api/system/{runtime_log.d.ts → admin/v1/runtime_log.d.ts} +0 -0
  314. /package/dist/package/declarations/src/{views/base/log/index.vue.d.ts → components/ChangePasswordForm.vue.d.ts} +0 -0
  315. /package/dist/package/src/api/base/{ai_message.ts → v1/ai_message.ts} +0 -0
  316. /package/dist/package/src/api/base/{ai_session.ts → v1/ai_session.ts} +0 -0
  317. /package/dist/package/src/api/base/{ai_tool.ts → v1/ai_tool.ts} +0 -0
  318. /package/dist/package/src/api/base/{oauth.ts → v1/oauth.ts} +0 -0
  319. /package/dist/package/src/api/system/{base_api.ts → admin/v1/base_api.ts} +0 -0
  320. /package/dist/package/src/api/system/{base_dept.ts → admin/v1/base_dept.ts} +0 -0
  321. /package/dist/package/src/api/system/{base_i18n.ts → admin/v1/base_i18n.ts} +0 -0
  322. /package/dist/package/src/api/system/{base_menu.ts → admin/v1/base_menu.ts} +0 -0
  323. /package/dist/package/src/api/system/{base_migration.ts → admin/v1/base_migration.ts} +0 -0
  324. /package/dist/package/src/api/system/{base_post.ts → admin/v1/base_post.ts} +0 -0
  325. /package/dist/package/src/api/system/{base_role.ts → admin/v1/base_role.ts} +0 -0
  326. /package/dist/package/src/api/system/{base_tenant.ts → admin/v1/base_tenant.ts} +0 -0
  327. /package/dist/package/src/api/system/{base_user.ts → admin/v1/base_user.ts} +0 -0
  328. /package/dist/package/src/api/system/{code_gen.ts → admin/v1/code_gen.ts} +0 -0
  329. /package/dist/package/src/api/system/{code_gen_proto.ts → admin/v1/code_gen_proto.ts} +0 -0
  330. /package/dist/package/src/api/system/{ops_monitoring.ts → admin/v1/ops_monitoring.ts} +0 -0
  331. /package/dist/package/src/api/system/{project_document.ts → admin/v1/project_document.ts} +0 -0
  332. /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 { defBaseDeptService } from "@liujitcn/kratos-admin-system/api/system/base_dept";
80
- import { defBaseRoleService } from "@liujitcn/kratos-admin-system/api/system/base_role";
81
- import { defBasePostService } from "@liujitcn/kratos-admin-system/api/system/base_post";
82
- import { defBaseTenantService } from "@liujitcn/kratos-admin-system/api/system/base_tenant";
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, validatePasswordStrengthValue } from "@liujitcn/kratos-admin-core/security";
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("system.base.user.field.tenant") }),
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("system.base.user.field.department") }),
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("system.base.user.field.role") }),
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]\d{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: true, message: t("core.password.required"), trigger: "blur" },
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("system.base.user.field.tenant"),
341
+ label: t("common.field.tenant"),
311
342
  component: "select",
312
343
  props: {
313
- placeholder: t("system.base.user.placeholder.tenant"),
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("system.base.user.field.role"),
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("system.base.user.field.department"),
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("system.base.user.placeholder.department"),
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("system.base.user.field.post"),
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("system.base.user.placeholder.post"), clearable: true, filterable: true }
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.password"), showPassword: true },
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("system.base.user.field.tenant_short"),
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("system.base.user.field.role"), minWidth: 140, enum: requestRoleOptions },
470
+ { prop: "role_id", label: t("common.field.role"), minWidth: 140, enum: requestRoleOptions },
421
471
  {
422
472
  prop: "dept_id",
423
- label: t("system.base.user.field.department_short"),
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("system.base.user.field.post_short"), minWidth: 120, enum: requestPostOptions },
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: submitData.id ? undefined : await encryptPassword(submitData.pwd, PASSWORD_CRYPTO_SCENE.PASSWORD_CRYPTO_SCENE_CREATE_BASE_USER)
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>