@liujitcn/kratos-admin-system 0.0.29 → 0.0.31

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 (112) hide show
  1. package/README.md +18 -1
  2. package/dist/package/declarations/src/api/base/notification.d.ts +24 -0
  3. package/dist/package/declarations/src/api/system/base_audit_log.d.ts +55 -0
  4. package/dist/package/declarations/src/api/system/base_dashboard.d.ts +14 -0
  5. package/dist/package/declarations/src/api/system/base_file.d.ts +13 -0
  6. package/dist/package/declarations/src/api/system/base_login_policy.d.ts +10 -0
  7. package/dist/package/declarations/src/api/system/base_message.d.ts +24 -0
  8. package/dist/package/declarations/src/api/system/base_message_category.d.ts +21 -0
  9. package/dist/package/declarations/src/api/system/base_session.d.ts +11 -0
  10. package/dist/package/declarations/src/api/system/oauth_client.d.ts +24 -0
  11. package/dist/package/declarations/src/components/AuditLogTable.vue.d.ts +45 -0
  12. package/dist/package/declarations/src/components/auditLog.d.ts +9 -0
  13. package/dist/package/declarations/src/locales/generated.d.ts +1312 -16
  14. package/dist/package/declarations/src/rpc/base/v1/login.d.ts +149 -0
  15. package/dist/package/declarations/src/rpc/base/v1/notification.d.ts +281 -0
  16. package/dist/package/declarations/src/rpc/base/v1/oauth.d.ts +25 -0
  17. package/dist/package/declarations/src/rpc/base/v1/oauth_client.d.ts +23 -0
  18. package/dist/package/declarations/src/rpc/system/admin/v1/base_audit_log.d.ts +640 -0
  19. package/dist/package/declarations/src/rpc/system/admin/v1/base_dashboard.d.ts +60 -0
  20. package/dist/package/declarations/src/rpc/system/admin/v1/base_file.d.ts +73 -0
  21. package/dist/package/declarations/src/rpc/system/admin/v1/base_i18n.d.ts +10 -6
  22. package/dist/package/declarations/src/rpc/system/admin/v1/base_job.d.ts +5 -0
  23. package/dist/package/declarations/src/rpc/system/admin/v1/base_login_policy.d.ts +51 -0
  24. package/dist/package/declarations/src/rpc/system/admin/v1/base_message.d.ts +193 -0
  25. package/dist/package/declarations/src/rpc/system/admin/v1/base_message_category.d.ts +125 -0
  26. package/dist/package/declarations/src/rpc/system/admin/v1/base_session.d.ts +33 -0
  27. package/dist/package/declarations/src/rpc/system/admin/v1/base_user.d.ts +3 -3
  28. package/dist/package/declarations/src/rpc/system/admin/v1/oauth_client.d.ts +145 -0
  29. package/dist/package/declarations/src/views/base/api-log/index.vue.d.ts +3 -0
  30. package/dist/package/declarations/src/views/base/dashboard/index.vue.d.ts +3 -0
  31. package/dist/package/declarations/src/views/base/data-access-log/index.vue.d.ts +3 -0
  32. package/dist/package/declarations/src/views/base/file/index.vue.d.ts +3 -0
  33. package/dist/package/declarations/src/views/base/login-log/index.vue.d.ts +3 -0
  34. package/dist/package/declarations/src/views/base/login-policy/index.vue.d.ts +3 -0
  35. package/dist/package/declarations/src/views/base/message/index.vue.d.ts +3 -0
  36. package/dist/package/declarations/src/views/base/message-category/index.vue.d.ts +3 -0
  37. package/dist/package/declarations/src/views/base/oauth-client/index.vue.d.ts +3 -0
  38. package/dist/package/declarations/src/views/base/operation-log/index.vue.d.ts +3 -0
  39. package/dist/package/declarations/src/views/base/permission-log/index.vue.d.ts +3 -0
  40. package/dist/package/declarations/src/views/base/policy-evaluation-log/index.vue.d.ts +3 -0
  41. package/dist/package/declarations/src/views/message/inbox/index.vue.d.ts +3 -0
  42. package/dist/package/declarations/src/views/profile/components/session.vue.d.ts +3 -0
  43. package/dist/package/src/api/base/notification.ts +69 -0
  44. package/dist/package/src/api/base/sse.ts +4 -4
  45. package/dist/package/src/api/system/auth.ts +1 -0
  46. package/dist/package/src/api/system/base_audit_log.ts +168 -0
  47. package/dist/package/src/api/system/base_dashboard.ts +55 -0
  48. package/dist/package/src/api/system/base_file.ts +43 -0
  49. package/dist/package/src/api/system/base_login_policy.ts +32 -0
  50. package/dist/package/src/api/system/base_message.ts +70 -0
  51. package/dist/package/src/api/system/base_message_category.ts +57 -0
  52. package/dist/package/src/api/system/base_session.ts +33 -0
  53. package/dist/package/src/api/system/oauth_client.ts +102 -0
  54. package/dist/package/src/components/AuditLogTable.vue +105 -0
  55. package/dist/package/src/components/Notification.vue +196 -0
  56. package/dist/package/src/components/auditLog.ts +46 -0
  57. package/dist/package/src/locales/README.md +4 -2
  58. package/dist/package/src/locales/en-US.json +334 -10
  59. package/dist/package/src/locales/ja-JP.json +338 -14
  60. package/dist/package/src/locales/zh-CN.json +334 -10
  61. package/dist/package/src/locales/zh-TW.json +337 -13
  62. package/dist/package/src/module.ts +5 -2
  63. package/dist/package/src/rpc/base/v1/login.ts +172 -0
  64. package/dist/package/src/rpc/base/v1/notification.ts +315 -0
  65. package/dist/package/src/rpc/base/v1/oauth.ts +25 -0
  66. package/dist/package/src/rpc/base/v1/oauth_client.ts +33 -0
  67. package/dist/package/src/rpc/system/admin/v1/base_audit_log.ts +737 -0
  68. package/dist/package/src/rpc/system/admin/v1/base_dashboard.ts +81 -0
  69. package/dist/package/src/rpc/system/admin/v1/base_file.ts +88 -0
  70. package/dist/package/src/rpc/system/admin/v1/base_i18n.ts +10 -6
  71. package/dist/package/src/rpc/system/admin/v1/base_job.ts +5 -0
  72. package/dist/package/src/rpc/system/admin/v1/base_login_policy.ts +63 -0
  73. package/dist/package/src/rpc/system/admin/v1/base_message.ts +236 -0
  74. package/dist/package/src/rpc/system/admin/v1/base_message_category.ts +149 -0
  75. package/dist/package/src/rpc/system/admin/v1/base_session.ts +44 -0
  76. package/dist/package/src/rpc/system/admin/v1/base_user.ts +3 -3
  77. package/dist/package/src/rpc/system/admin/v1/oauth_client.ts +174 -0
  78. package/dist/package/src/views/ai/chat/components/ChatPanel.vue +2 -2
  79. package/dist/package/src/views/ai/chat/message.ts +7 -3
  80. package/dist/package/src/views/base/api-log/index.vue +83 -0
  81. package/dist/package/src/views/base/config/index.vue +3 -3
  82. package/dist/package/src/views/base/dashboard/index.vue +200 -0
  83. package/dist/package/src/views/base/data-access-log/index.vue +84 -0
  84. package/dist/package/src/views/base/dict/index.vue +2 -2
  85. package/dist/package/src/views/base/dict/item.vue +2 -2
  86. package/dist/package/src/views/base/file/index.vue +119 -0
  87. package/dist/package/src/views/base/job/index.vue +62 -7
  88. package/dist/package/src/views/base/language/index.vue +2 -1
  89. package/dist/package/src/views/base/login-log/index.vue +92 -0
  90. package/dist/package/src/views/base/login-policy/index.vue +219 -0
  91. package/dist/package/src/views/base/menu/index.vue +2 -2
  92. package/dist/package/src/views/base/message/index.vue +582 -0
  93. package/dist/package/src/views/base/message-category/index.vue +356 -0
  94. package/dist/package/src/views/base/oauth-client/index.vue +411 -0
  95. package/dist/package/src/views/base/operation-log/index.vue +82 -0
  96. package/dist/package/src/views/base/permission-log/index.vue +85 -0
  97. package/dist/package/src/views/base/policy-evaluation-log/index.vue +82 -0
  98. package/dist/package/src/views/message/inbox/index.vue +249 -0
  99. package/dist/package/src/views/profile/components/base.vue +6 -5
  100. package/dist/package/src/views/profile/components/password.vue +2 -2
  101. package/dist/package/src/views/profile/components/security.vue +475 -62
  102. package/dist/package/src/views/profile/components/session.vue +153 -0
  103. package/dist/package/src/views/profile/index.vue +35 -22
  104. package/dist/package/src/views/tool/code-gen/config.ts +1 -0
  105. package/dist/package/src/views/tool/ops-monitoring/index.vue +25 -21
  106. package/package.json +2 -2
  107. package/dist/package/declarations/src/api/system/base_log.d.ts +0 -9
  108. package/dist/package/declarations/src/rpc/system/admin/v1/base_log.d.ts +0 -87
  109. package/dist/package/src/api/system/base_log.ts +0 -32
  110. package/dist/package/src/rpc/system/admin/v1/base_log.ts +0 -101
  111. package/dist/package/src/views/base/log/index.vue +0 -339
  112. /package/dist/package/declarations/src/{views/base/log/index.vue.d.ts → components/Notification.vue.d.ts} +0 -0
@@ -0,0 +1,102 @@
1
+ import service from "@liujitcn/kratos-admin-core/request";
2
+ import type {
3
+ CreateOauthClientRequest,
4
+ DeleteOauthClientRequest,
5
+ GetOauthClientCredentialsRequest,
6
+ GetOauthClientRequest,
7
+ OauthClientCredentials,
8
+ OauthClientForm,
9
+ OauthClientService,
10
+ OptionOauthClientApiRequest,
11
+ OptionOauthClientApiResponse,
12
+ PageOauthClientRequest,
13
+ PageOauthClientResponse,
14
+ RotateOauthClientCredentialsRequest,
15
+ SetOauthClientStatusRequest,
16
+ UpdateOauthClientRequest
17
+ } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/oauth_client";
18
+ import type { Empty } from "@liujitcn/kratos-admin-system/rpc/google/protobuf/empty";
19
+
20
+ const OAUTH_CLIENT_URL = "/v1/admin/base/oauth-client";
21
+
22
+ /** 开放授权客户端管理服务实现。 */
23
+ export class OauthClientServiceImpl implements OauthClientService {
24
+ /** 查询可授权的开发接口。 */
25
+ OptionOauthClientApi(request: OptionOauthClientApiRequest): Promise<OptionOauthClientApiResponse> {
26
+ return service<OptionOauthClientApiRequest, OptionOauthClientApiResponse>({
27
+ url: `${OAUTH_CLIENT_URL}/api`,
28
+ method: "get",
29
+ params: request
30
+ });
31
+ }
32
+
33
+ /** 查询开放授权客户端分页列表。 */
34
+ PageOauthClient(request: PageOauthClientRequest): Promise<PageOauthClientResponse> {
35
+ return service<PageOauthClientRequest, PageOauthClientResponse>({
36
+ url: OAUTH_CLIENT_URL,
37
+ method: "get",
38
+ params: request
39
+ });
40
+ }
41
+
42
+ /** 查询开放授权客户端详情。 */
43
+ GetOauthClient(request: GetOauthClientRequest): Promise<OauthClientForm> {
44
+ return service<GetOauthClientRequest, OauthClientForm>({
45
+ url: `${OAUTH_CLIENT_URL}/${request.id}`,
46
+ method: "get"
47
+ });
48
+ }
49
+
50
+ /** 查询开放授权客户端非敏感凭据元数据。 */
51
+ GetOauthClientCredentials(request: GetOauthClientCredentialsRequest): Promise<OauthClientCredentials> {
52
+ return service<GetOauthClientCredentialsRequest, OauthClientCredentials>({
53
+ url: `${OAUTH_CLIENT_URL}/${request.id}/credentials`,
54
+ method: "get"
55
+ });
56
+ }
57
+
58
+ /** 轮换开放授权客户端凭据并一次性返回新值。 */
59
+ RotateOauthClientCredentials(request: RotateOauthClientCredentialsRequest): Promise<OauthClientCredentials> {
60
+ return service<RotateOauthClientCredentialsRequest, OauthClientCredentials>({
61
+ url: `${OAUTH_CLIENT_URL}/${request.id}/credentials/rotate`,
62
+ method: "post"
63
+ });
64
+ }
65
+
66
+ /** 创建开放授权客户端。 */
67
+ CreateOauthClient(request: CreateOauthClientRequest): Promise<Empty> {
68
+ return service<OauthClientForm | undefined, Empty>({
69
+ url: OAUTH_CLIENT_URL,
70
+ method: "post",
71
+ data: request.oauth_client
72
+ });
73
+ }
74
+
75
+ /** 更新开放授权客户端。 */
76
+ UpdateOauthClient(request: UpdateOauthClientRequest): Promise<Empty> {
77
+ return service<OauthClientForm | undefined, Empty>({
78
+ url: `${OAUTH_CLIENT_URL}/${request.oauth_client?.id ?? ""}`,
79
+ method: "put",
80
+ data: request.oauth_client
81
+ });
82
+ }
83
+
84
+ /** 删除开放授权客户端。 */
85
+ DeleteOauthClient(request: DeleteOauthClientRequest): Promise<Empty> {
86
+ return service<DeleteOauthClientRequest, Empty>({
87
+ url: `${OAUTH_CLIENT_URL}/${request.id}`,
88
+ method: "delete"
89
+ });
90
+ }
91
+
92
+ /** 设置开放授权客户端状态。 */
93
+ SetOauthClientStatus(request: SetOauthClientStatusRequest): Promise<Empty> {
94
+ return service<SetOauthClientStatusRequest, Empty>({
95
+ url: `${OAUTH_CLIENT_URL}/${request.id}/status`,
96
+ method: "put",
97
+ data: request
98
+ });
99
+ }
100
+ }
101
+
102
+ export const defOauthClientService = new OauthClientServiceImpl();
@@ -0,0 +1,105 @@
1
+ <template>
2
+ <div class="table-box">
3
+ <ProTable ref="proTable" row-key="id" :columns="resolvedColumns" :request-api="requestTable" />
4
+
5
+ <ProDialog v-model="dialog.visible" :title="config.detailTitle" width="1280px" @close="handleCloseDialog">
6
+ <el-descriptions border :column="2" class="detail-container">
7
+ <el-descriptions-item v-for="field in config.detailFields" :key="field.key" :label="field.label" :span="field.span ?? 1">
8
+ <pre v-if="field.code" class="code-block">{{ formatField(field) }}</pre>
9
+ <span v-else>{{ formatField(field) }}</span>
10
+ </el-descriptions-item>
11
+ </el-descriptions>
12
+
13
+ <template #footer>
14
+ <el-button @click="handleCloseDialog">{{ config.closeText }}</el-button>
15
+ </template>
16
+ </ProDialog>
17
+ </div>
18
+ </template>
19
+
20
+ <script setup lang="ts">
21
+ import { computed, reactive, ref, unref } from "vue";
22
+ import type { ColumnProps, ProTableInstance } from "@liujitcn/kratos-admin-core/components/ProTable/interface";
23
+ import ProTable from "@liujitcn/kratos-admin-core/components/ProTable";
24
+ import ProDialog from "@liujitcn/kratos-admin-core/components/Dialog/ProDialog.vue";
25
+ import { buildPageRequest } from "@liujitcn/kratos-admin-core/table";
26
+ import { formatJson } from "@liujitcn/kratos-admin-core/format";
27
+
28
+ /** 审计详情字段配置。 */
29
+ export interface AuditLogDetailField {
30
+ /** 详情对象中对应的字段名。 */
31
+ key: string;
32
+ /** 字段在详情弹窗中的显示名称。 */
33
+ label: string;
34
+ /** 字段占用的描述列数,未设置时使用一列。 */
35
+ span?: number;
36
+ /** 是否按格式化 JSON 的代码块展示。 */
37
+ code?: boolean;
38
+ }
39
+
40
+ /** 审计列表页面配置。 */
41
+ export interface AuditLogTableConfig {
42
+ /** 审计列表表格的列定义。 */
43
+ columns: ColumnProps[];
44
+ /** 详情弹窗标题。 */
45
+ detailTitle: string;
46
+ /** 详情弹窗关闭按钮文案。 */
47
+ closeText: string;
48
+ /** 详情字段和展示格式定义。 */
49
+ detailFields: AuditLogDetailField[];
50
+ /** 分页查询函数,返回列表和总数。 */
51
+ request: (params: Record<string, unknown>) => Promise<{ list: Record<string, unknown>[]; total: number }>;
52
+ /** 按日志编号读取详情。 */
53
+ get: (id: number) => Promise<Record<string, unknown>>;
54
+ }
55
+
56
+ const props = defineProps<{ config: AuditLogTableConfig }>();
57
+ const proTable = ref<ProTableInstance>();
58
+ const detail = reactive<Record<string, unknown>>({});
59
+ const dialog = reactive({ visible: false });
60
+ const resolvedColumns = computed(() => unref(props.config.columns));
61
+
62
+ /** 请求审计日志分页数据。 */
63
+ async function requestTable(params: Record<string, unknown>) {
64
+ const result = await props.config.request(buildPageRequest(params));
65
+ return { data: { list: result.list, total: result.total } };
66
+ }
67
+
68
+ /** 打开审计详情弹窗。 */
69
+ async function handleOpenDialog(id: number) {
70
+ const value = await props.config.get(id);
71
+ Object.keys(detail).forEach(key => delete detail[key]);
72
+ Object.assign(detail, value);
73
+ dialog.visible = true;
74
+ }
75
+
76
+ /** 关闭并清理审计详情弹窗。 */
77
+ function handleCloseDialog() {
78
+ dialog.visible = false;
79
+ Object.keys(detail).forEach(key => delete detail[key]);
80
+ }
81
+
82
+ /** 格式化详情字段,JSON 内容使用统一脱敏展示格式。 */
83
+ function formatField(field: AuditLogDetailField) {
84
+ const value = detail[field.key];
85
+ if (value === undefined || value === null || value === "") return "--";
86
+ if (field.code) return formatJson(String(value));
87
+ return String(value);
88
+ }
89
+
90
+ defineExpose({ handleOpenDialog, proTable });
91
+ </script>
92
+
93
+ <style scoped>
94
+ .detail-container {
95
+ width: 100%;
96
+ }
97
+
98
+ .code-block {
99
+ max-height: 360px;
100
+ margin: 0;
101
+ overflow: auto;
102
+ white-space: pre-wrap;
103
+ word-break: break-word;
104
+ }
105
+ </style>
@@ -0,0 +1,196 @@
1
+ <template>
2
+ <el-popover placement="bottom-end" :width="360" trigger="click" @show="refresh">
3
+ <template #reference>
4
+ <el-badge class="notification-trigger" :value="badgeValue" :hidden="unreadTotal === 0" :max="99">
5
+ <el-icon :size="24"><Bell /></el-icon>
6
+ </el-badge>
7
+ </template>
8
+ <div class="notification-panel">
9
+ <div class="notification-header">
10
+ <strong>{{ t("system.notification.title") }}</strong>
11
+ <el-button link type="primary" @click="markAllRead">{{ t("system.notification.action.mark_all_read") }}</el-button>
12
+ </div>
13
+ <div class="notification-list">
14
+ <button
15
+ v-for="item in notifications"
16
+ :key="item.id"
17
+ class="notification-item"
18
+ :class="{ 'is-unread': !item.read_at }"
19
+ type="button"
20
+ @click="openInbox"
21
+ >
22
+ <span class="notification-category-icon" :style="{ color: item.category_color || undefined }" aria-hidden="true">
23
+ <component :is="resolveNotificationIcon(item.category_icon)" />
24
+ </span>
25
+ <span class="notification-status" :style="{ backgroundColor: item.category_color || undefined }" aria-hidden="true"></span>
26
+ <span class="notification-title">{{ item.title }}</span>
27
+ <span class="notification-time">{{ item.received_at }}</span>
28
+ </button>
29
+ <el-empty v-if="notifications.length === 0" :description="t('system.notification.empty')" :image-size="72" />
30
+ </div>
31
+ <el-button class="notification-more" text @click="openInbox">{{ t("system.notification.action.view_all") }}</el-button>
32
+ </div>
33
+ </el-popover>
34
+ </template>
35
+
36
+ <script setup lang="ts">
37
+ import { computed, onBeforeUnmount, onMounted, ref } from "vue";
38
+ import { useRouter } from "vue-router";
39
+ import { t } from "@liujitcn/kratos-admin-core";
40
+ import { defNotificationService } from "@liujitcn/kratos-admin-system/api/base/notification";
41
+ import { subscribeSseEvent, type SseStop } from "@liujitcn/kratos-admin-system/api/base/sse";
42
+ import type { Notification } from "@liujitcn/kratos-admin-system/rpc/base/v1/notification";
43
+ import { NotificationView } from "@liujitcn/kratos-admin-system/rpc/base/v1/notification";
44
+
45
+ const router = useRouter();
46
+ const unreadTotal = ref(0);
47
+ const latestDeliveryID = ref(0);
48
+ const notifications = ref<Notification[]>([]);
49
+ let stopSse: SseStop | undefined;
50
+
51
+ const badgeValue = computed(() => Math.min(unreadTotal.value, 99));
52
+ const notificationIcons = {
53
+ Bell,
54
+ Calendar,
55
+ ChatDotRound,
56
+ CircleCheckFilled,
57
+ CollectionTag,
58
+ DataAnalysis,
59
+ InfoFilled,
60
+ List,
61
+ Lock,
62
+ Message,
63
+ Promotion,
64
+ Setting,
65
+ User,
66
+ WarningFilled
67
+ };
68
+
69
+ onMounted(() => {
70
+ void refresh();
71
+ stopSse = subscribeSseEvent(
72
+ { stream: "base.notification", channel_id: undefined },
73
+ "inbox.changed",
74
+ raw => {
75
+ try {
76
+ return JSON.parse(raw) as Record<string, unknown>;
77
+ } catch {
78
+ return null;
79
+ }
80
+ },
81
+ () => void refresh()
82
+ );
83
+ });
84
+
85
+ onBeforeUnmount(() => stopSse?.());
86
+
87
+ /** 刷新未读汇总和最近消息。 */
88
+ async function refresh() {
89
+ const [summary, page] = await Promise.all([
90
+ defNotificationService.GetNotificationSummary({}),
91
+ defNotificationService.PageNotification({ view: NotificationView.NOTIFICATION_VIEW_INBOX, category_id: undefined, priority: undefined, cursor_id: 0, page_num: 1, page_size: 5 })
92
+ ]);
93
+ unreadTotal.value = summary.unread_total;
94
+ latestDeliveryID.value = summary.latest_delivery_id;
95
+ notifications.value = page.notifications;
96
+ }
97
+
98
+ /** 标记全部消息为已读。 */
99
+ async function markAllRead() {
100
+ if (!latestDeliveryID.value) return;
101
+ await defNotificationService.MarkAllNotificationRead({ before_delivery_id: latestDeliveryID.value });
102
+ await refresh();
103
+ }
104
+
105
+ /** 打开完整收件箱。 */
106
+ function openInbox() {
107
+ void router.push({ name: "NotificationInbox" });
108
+ }
109
+
110
+ /** 解析收件箱分类图标,兼容历史数据中的未知图标名。 */
111
+ function resolveNotificationIcon(icon: string) {
112
+ return notificationIcons[icon as keyof typeof notificationIcons] ?? CollectionTag;
113
+ }
114
+ </script>
115
+
116
+ <style scoped lang="scss">
117
+ .notification-trigger {
118
+ display: inline-flex;
119
+ width: 24px;
120
+ height: 24px;
121
+ align-items: center;
122
+ justify-content: center;
123
+ cursor: pointer;
124
+ }
125
+
126
+ .notification-panel {
127
+ min-height: 160px;
128
+ }
129
+
130
+ .notification-list {
131
+ max-height: min(440px, calc(100vh - 240px));
132
+ overflow-y: auto;
133
+ overscroll-behavior: contain;
134
+ }
135
+
136
+ .notification-header {
137
+ display: flex;
138
+ align-items: center;
139
+ justify-content: space-between;
140
+ margin-bottom: 8px;
141
+ }
142
+
143
+ .notification-item {
144
+ display: flex;
145
+ align-items: center;
146
+ gap: 8px;
147
+ width: 100%;
148
+ padding: 10px 0;
149
+ border: 0;
150
+ border-bottom: 1px solid var(--el-border-color-lighter);
151
+ background: transparent;
152
+ color: var(--el-text-color-primary);
153
+ cursor: pointer;
154
+ text-align: left;
155
+ }
156
+
157
+ .notification-status {
158
+ width: 7px;
159
+ height: 7px;
160
+ flex: 0 0 7px;
161
+ border-radius: 50%;
162
+ background: var(--el-color-primary);
163
+ visibility: hidden;
164
+ }
165
+
166
+ .notification-category-icon {
167
+ display: inline-flex;
168
+ flex: 0 0 18px;
169
+ align-items: center;
170
+ justify-content: center;
171
+ font-size: 17px;
172
+ }
173
+
174
+ .notification-item.is-unread .notification-status {
175
+ visibility: visible;
176
+ }
177
+
178
+ .notification-title {
179
+ min-width: 0;
180
+ flex: 1;
181
+ overflow: hidden;
182
+ text-overflow: ellipsis;
183
+ white-space: nowrap;
184
+ }
185
+
186
+ .notification-time {
187
+ margin-left: 12px;
188
+ color: var(--el-text-color-secondary);
189
+ font-size: 12px;
190
+ }
191
+
192
+ .notification-more {
193
+ width: 100%;
194
+ margin-top: 8px;
195
+ }
196
+ </style>
@@ -0,0 +1,46 @@
1
+ import type { ColumnProps, EnumProps, SearchProps } from "@liujitcn/kratos-admin-core/components/ProTable/interface";
2
+
3
+ /** 根据枚举值生成表格筛选项。 */
4
+ export function createAuditEnumOptions(items: Array<[number, string]>): EnumProps[] {
5
+ return items.map(([value, label]) => ({ value, label }));
6
+ }
7
+
8
+ /** 根据枚举值查找展示文案。 */
9
+ export function auditEnumLabel(options: EnumProps[], value: unknown): string {
10
+ return options.find(item => item.value === value)?.label ?? String(value ?? "--");
11
+ }
12
+
13
+ /** 创建审计日志时间范围筛选项。 */
14
+ export function auditDateSearch(t: (key: string) => string): SearchProps {
15
+ return {
16
+ el: "date-picker",
17
+ props: {
18
+ type: "daterange",
19
+ editable: false,
20
+ class: "!w-[240px]",
21
+ rangeSeparator: "~",
22
+ startPlaceholder: t("common.placeholder.start_date"),
23
+ endPlaceholder: t("common.placeholder.end_date"),
24
+ valueFormat: "YYYY-MM-DD"
25
+ }
26
+ };
27
+ }
28
+
29
+ /** 创建审计日志详情按钮列。 */
30
+ export function auditDetailColumn(label: string, onClick: (id: number) => void): ColumnProps {
31
+ return {
32
+ prop: "detailAction",
33
+ label,
34
+ width: 100,
35
+ fixed: "right",
36
+ cellType: "actions",
37
+ actions: [
38
+ {
39
+ label,
40
+ type: "primary",
41
+ link: true,
42
+ onClick: scope => onClick(Number(scope.row.id))
43
+ }
44
+ ]
45
+ };
46
+ }
@@ -1,12 +1,13 @@
1
1
  # 管理端 System 语言包
2
2
 
3
- 本目录提供 System 管理业务模块的页面、AI、个人中心、基础资料和代码生成等业务文案。语言包由同级 `../module.ts` 导入,随 `systemAdminModule` 注册;管理端启动时由 core 的 `registerLocaleMessages` 合并,System 页面和组件通过 `t()` 或 `useLocaleStore()` 使用 `system.*` 键。
3
+ 本目录提供 System 管理业务模块的页面、AI、个人中心安全设置、开放授权客户端、基础资料和代码生成等业务文案。语言包由同级 `../module.ts` 导入,随 `systemAdminModule` 注册;管理端启动时由 core 的 `registerLocaleMessages` 合并,System 页面和组件通过 `t()` 或 `useLocaleStore()` 使用 `system.*` 键。
4
4
 
5
5
  | 文件 | 用途 | 使用位置 |
6
6
  | --- | --- | --- |
7
7
  | `zh-CN.json` | System 模块简体中文固定 UI 默认语言包,也是所有语言键集合和占位符校验基准。 | 管理端固定文案默认语言及缺失翻译回退。 |
8
8
  | `zh-TW.json` | System 模块繁体中文语言包。 | 管理端切换为繁体中文时由 Vue I18n 使用。 |
9
9
  | `en-US.json` | System 模块英文语言包。 | 管理端切换为英文时由 Vue I18n 使用。 |
10
+ | `ja-JP.json` | System 模块日文语言包。 | 管理端切换为日文时由 Vue I18n 使用。 |
10
11
 
11
12
  ## 命名空间与使用位置
12
13
 
@@ -16,6 +17,7 @@
16
17
  | `system.ai.*` | AI 会话、消息流、重试和错误提示。 | `src/views/ai/**`、`src/api/base/ai_message.ts`。 |
17
18
  | `system.profile.*` | 个人资料、安全设置和用户中心导航。 | `src/views/profile/**`、`src/module.ts` 的用户菜单。 |
18
19
  | `system.base.*` | 区域、配置、部门、字典、岗位、角色、租户、用户等基础管理页面。 | `src/views/base/**`。 |
20
+ | `system.base.oauth_client.*` | 开放授权客户端字段、凭据和 API 选择。 | `src/views/base/oauth-client/**`。 |
19
21
  | `system.code.gen.*` | 代码生成配置、预览、列配置和多语言编辑。 | `src/views/tool/code-gen/**`。 |
20
22
  | `system.i18n.*` | 动态翻译编辑、草稿生成和语言包状态。 | `src/components/DynamicI18nEditor.vue`、代码生成语言编辑组件。 |
21
23
 
@@ -23,4 +25,4 @@
23
25
 
24
26
  语言键按文案归属使用 `common.` 或 `system.` 命名空间;语言包保持标准 JSON,不在文件内写注释。
25
27
 
26
- 新增语言的完整文件清单和迁移流程见[国际化语言扩展指南](../../../../../../docs/国际化语言扩展指南.md)。
28
+ 新增语言的完整文件清单和迁移流程见[国际化语言扩展指南](../../../../../../../docs/国际化语言扩展指南.md)。