@liujitcn/kratos-admin-system 0.0.47 → 0.0.49
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/dist/package/declarations/src/components/LogTable.vue.d.ts +2 -0
- package/dist/package/declarations/src/components/log.d.ts +2 -0
- package/dist/package/src/components/LogTable.vue +14 -3
- package/dist/package/src/components/log.ts +6 -2
- package/dist/package/src/views/ai/chat/components/ChatPanel.vue +2 -9
- package/dist/package/src/views/base/api/index.vue +0 -2
- package/dist/package/src/views/base/api-log/index.vue +6 -5
- package/dist/package/src/views/base/area/index.vue +0 -2
- package/dist/package/src/views/base/backup-management/archive-config/index.vue +1 -1
- package/dist/package/src/views/base/backup-management/archive-record/index.vue +7 -6
- package/dist/package/src/views/base/backup-management/archive-restore/index.vue +2 -1
- package/dist/package/src/views/base/backup-management/backup-config/index.vue +1 -1
- package/dist/package/src/views/base/backup-management/backup-record/index.vue +4 -3
- package/dist/package/src/views/base/backup-management/backup-restore/index.vue +2 -1
- package/dist/package/src/views/base/config/index.vue +2 -4
- package/dist/package/src/views/base/data-access-log/index.vue +6 -5
- package/dist/package/src/views/base/dept/index.vue +4 -5
- package/dist/package/src/views/base/dict/index.vue +2 -4
- package/dist/package/src/views/base/dict/item.vue +2 -4
- package/dist/package/src/views/base/file/index.vue +3 -5
- package/dist/package/src/views/base/job/index.vue +2 -4
- package/dist/package/src/views/base/job/log.vue +4 -4
- package/dist/package/src/views/base/language/index.vue +3 -5
- package/dist/package/src/views/base/login-log/index.vue +5 -4
- package/dist/package/src/views/base/login-policy/index.vue +0 -2
- package/dist/package/src/views/base/menu/index.vue +3 -5
- package/dist/package/src/views/base/message/index.vue +8 -9
- package/dist/package/src/views/base/message-category/index.vue +1 -3
- package/dist/package/src/views/base/migration/index.vue +2 -14
- package/dist/package/src/views/base/oauth-client/index.vue +1 -2
- package/dist/package/src/views/base/online-session/index.vue +9 -3
- package/dist/package/src/views/base/operation-log/index.vue +6 -5
- package/dist/package/src/views/base/permission-log/index.vue +4 -3
- package/dist/package/src/views/base/policy-evaluation-log/index.vue +5 -4
- package/dist/package/src/views/base/post/index.vue +3 -4
- package/dist/package/src/views/base/redact-output-policy/index.vue +1 -1
- package/dist/package/src/views/base/redact-rule/index.vue +0 -2
- package/dist/package/src/views/base/redact-storage-policy/index.vue +1 -1
- package/dist/package/src/views/base/role/index.vue +3 -4
- package/dist/package/src/views/base/tenant/index.vue +2 -4
- package/dist/package/src/views/base/user/index.vue +3 -4
- package/dist/package/src/views/message/inbox/index.vue +0 -2
- package/dist/package/src/views/profile/components/base.vue +2 -1
- package/dist/package/src/views/profile/components/login-log.vue +2 -2
- package/dist/package/src/views/profile/components/session.vue +8 -1
- package/dist/package/src/views/tool/cache/index.vue +8 -11
- package/dist/package/src/views/tool/code-gen/components/CodeGenProgressDialog.vue +3 -3
- package/dist/package/src/views/tool/code-gen/preview/index.vue +0 -2
- package/dist/package/src/views/tool/code-gen/table/index.vue +1 -3
- package/dist/package/src/views/tool/ops-monitoring/index.vue +4 -4
- package/dist/package/src/views/tool/runtime-log/index.vue +2 -13
- package/package.json +3 -3
|
@@ -4,6 +4,8 @@ import type { BaseLogTraceItem } from "@liujitcn/kratos-admin-system/rpc/system/
|
|
|
4
4
|
export declare function createLogEnumOptions(items: Array<[number, string]>): EnumProps[];
|
|
5
5
|
/** 根据枚举值查找展示文案。 */
|
|
6
6
|
export declare function logEnumLabel(options: EnumProps[], value: unknown, fallback?: string): string;
|
|
7
|
+
/** 格式化审计日志时间,统一输出本地日期时间文本。 */
|
|
8
|
+
export declare function formatLogDateTime(value: unknown): string;
|
|
7
9
|
/** 格式化日志 HTTP 状态码并补充状态语义。 */
|
|
8
10
|
export declare function formatLogStatusCode(value: unknown, t: (key: string) => string): string;
|
|
9
11
|
/** 格式化日志耗时,零值表示未采集。 */
|
|
@@ -4,7 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
<ProDialog v-model="dialog.visible" :title="config.detailTitle" width="1280px" @close="handleCloseDialog">
|
|
6
6
|
<el-descriptions border :column="2" class="detail-container">
|
|
7
|
-
<el-descriptions-item
|
|
7
|
+
<el-descriptions-item
|
|
8
|
+
v-for="field in config.detailFields"
|
|
9
|
+
:key="field.key"
|
|
10
|
+
:label="field.label"
|
|
11
|
+
:span="field.span ?? 1"
|
|
12
|
+
:align="field.align"
|
|
13
|
+
>
|
|
8
14
|
<pre v-if="field.code" class="code-block">{{ formatField(field) }}</pre>
|
|
9
15
|
<span v-else>{{ formatField(field) }}</span>
|
|
10
16
|
</el-descriptions-item>
|
|
@@ -24,7 +30,9 @@
|
|
|
24
30
|
<el-table-column :label="t('system.base.log.trace.duration')" width="110" align="right">
|
|
25
31
|
<template #default="scope">{{ formatDuration(scope.row.duration_ms) }}</template>
|
|
26
32
|
</el-table-column>
|
|
27
|
-
<el-table-column
|
|
33
|
+
<el-table-column :label="t('system.base.log.field.occurred_at')" width="190" align="center">
|
|
34
|
+
<template #default="scope">{{ formatLogDateTime(scope.row.occurred_at) }}</template>
|
|
35
|
+
</el-table-column>
|
|
28
36
|
</el-table>
|
|
29
37
|
</section>
|
|
30
38
|
|
|
@@ -45,7 +53,7 @@ import { formatJson } from "@liujitcn/kratos-admin-core/format";
|
|
|
45
53
|
import { t } from "@liujitcn/kratos-admin-core";
|
|
46
54
|
import { BaseLogType, BaseLogResult } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_log";
|
|
47
55
|
import type { BaseLogTraceItem } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_log";
|
|
48
|
-
import { logEnumLabel } from "./log";
|
|
56
|
+
import { formatLogDateTime, logEnumLabel } from "./log";
|
|
49
57
|
|
|
50
58
|
/** 审计详情字段配置。 */
|
|
51
59
|
export interface LogDetailField {
|
|
@@ -53,6 +61,8 @@ export interface LogDetailField {
|
|
|
53
61
|
key: string;
|
|
54
62
|
/** 字段在详情弹窗中的显示名称。 */
|
|
55
63
|
label: string;
|
|
64
|
+
/** 字段内容在详情弹窗中的对齐方式。 */
|
|
65
|
+
align?: "left" | "center" | "right";
|
|
56
66
|
/** 字段占用的描述列数,未设置时使用一列。 */
|
|
57
67
|
span?: number;
|
|
58
68
|
/** 是否按格式化 JSON 的代码块展示。 */
|
|
@@ -130,6 +140,7 @@ function formatField(field: LogDetailField) {
|
|
|
130
140
|
if (field.enum) return logEnumLabel(field.enum, value, t("common.value.unknown"));
|
|
131
141
|
if (field.format) return field.format(value);
|
|
132
142
|
if (field.code) return formatJson(String(value));
|
|
143
|
+
if (field.key.endsWith("_at") || field.key.endsWith("_time")) return formatLogDateTime(value);
|
|
133
144
|
return String(value);
|
|
134
145
|
}
|
|
135
146
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ColumnProps, EnumProps, SearchProps } from "@liujitcn/kratos-admin-core/components/ProTable/interface";
|
|
2
|
+
import { formatDateTime } from "@liujitcn/kratos-admin-core/format";
|
|
2
3
|
import { defBaseLogService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_log";
|
|
3
4
|
import type { BaseLogTraceItem } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_log";
|
|
4
5
|
|
|
@@ -12,6 +13,11 @@ export function logEnumLabel(options: EnumProps[], value: unknown, fallback = ""
|
|
|
12
13
|
return options.find(item => item.value === value)?.label ?? (fallback || String(value ?? ""));
|
|
13
14
|
}
|
|
14
15
|
|
|
16
|
+
/** 格式化审计日志时间,统一输出本地日期时间文本。 */
|
|
17
|
+
export function formatLogDateTime(value: unknown): string {
|
|
18
|
+
return formatDateTime(typeof value === "string" || typeof value === "number" ? value : undefined);
|
|
19
|
+
}
|
|
20
|
+
|
|
15
21
|
/** 格式化日志 HTTP 状态码并补充状态语义。 */
|
|
16
22
|
export function formatLogStatusCode(value: unknown, t: (key: string) => string): string {
|
|
17
23
|
const code = Number(value);
|
|
@@ -66,8 +72,6 @@ export function logDetailColumn(label: string, onClick: (id: string) => void): C
|
|
|
66
72
|
return {
|
|
67
73
|
prop: "detailAction",
|
|
68
74
|
label,
|
|
69
|
-
width: 100,
|
|
70
|
-
fixed: "right",
|
|
71
75
|
cellType: "actions",
|
|
72
76
|
actions: [
|
|
73
77
|
{
|
|
@@ -334,6 +334,7 @@ import type { FilesCardProps } from "vue-element-plus-x/types/FilesCard";
|
|
|
334
334
|
import { Check, CopyDocument, DataAnalysis, Delete, EditPen, Link, Memo, PieChart, Refresh, User } from "@element-plus/icons-vue";
|
|
335
335
|
import { ElMessage } from "element-plus";
|
|
336
336
|
import { getCurrentLocale, t } from "@liujitcn/kratos-admin-core";
|
|
337
|
+
import { formatDateTime } from "@liujitcn/kratos-admin-core/format";
|
|
337
338
|
import type { AiAction } from "@liujitcn/kratos-admin-system/rpc/base/v1/ai_message";
|
|
338
339
|
import { type AiAttachment, type AiSession } from "@liujitcn/kratos-admin-system/rpc/base/v1/ai_session";
|
|
339
340
|
import type { AiShortcut, AiToolCall } from "@liujitcn/kratos-admin-system/rpc/base/v1/ai_tool";
|
|
@@ -737,15 +738,7 @@ function formatDurationMs(value?: number) {
|
|
|
737
738
|
function resolveMessageReplyTime(item: ChatMessageItem) {
|
|
738
739
|
const timestamp = resolveMessageCreatedAt(item);
|
|
739
740
|
if (!timestamp) return "";
|
|
740
|
-
return
|
|
741
|
-
year: "numeric",
|
|
742
|
-
month: "2-digit",
|
|
743
|
-
day: "2-digit",
|
|
744
|
-
hour: "2-digit",
|
|
745
|
-
minute: "2-digit",
|
|
746
|
-
second: "2-digit",
|
|
747
|
-
hour12: false
|
|
748
|
-
}).format(new Date(timestamp));
|
|
741
|
+
return formatDateTime(timestamp);
|
|
749
742
|
}
|
|
750
743
|
|
|
751
744
|
/** 解析消息创建时间戳,兼容 protobuf Timestamp 结构。 */
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import { computed, ref } from "vue";
|
|
7
7
|
import type { ColumnProps } from "@liujitcn/kratos-admin-core/components/ProTable/interface";
|
|
8
8
|
import { t } from "@liujitcn/kratos-admin-core";
|
|
9
|
+
import { formatLogDateTime } from "@liujitcn/kratos-admin-system/components/log";
|
|
9
10
|
import { buildPageRequest } from "@liujitcn/kratos-admin-core/table";
|
|
10
11
|
import LogTable, { type LogTableConfig } from "@liujitcn/kratos-admin-system/components/LogTable.vue";
|
|
11
12
|
import {
|
|
@@ -36,7 +37,7 @@ const resultOptions = computed(() =>
|
|
|
36
37
|
const columns = computed<ColumnProps[]>(() => [
|
|
37
38
|
{ prop: "operation", label: t("system.base.log.field.operation"), minWidth: 320, search: { el: "input" } },
|
|
38
39
|
{ prop: "method", label: t("system.base.log.field.method"), minWidth: 90 },
|
|
39
|
-
{ prop: "status_code", label: t("system.base.log.field.status_code"), minWidth: 100 },
|
|
40
|
+
{ prop: "status_code", label: t("system.base.log.field.status_code"), minWidth: 100, align: "right" },
|
|
40
41
|
{
|
|
41
42
|
prop: "result",
|
|
42
43
|
label: t("system.base.log.field.result"),
|
|
@@ -44,9 +45,9 @@ const columns = computed<ColumnProps[]>(() => [
|
|
|
44
45
|
search: { el: "select", enum: resultOptions.value },
|
|
45
46
|
render: scope => logEnumLabel(resultOptions.value, (scope.row as BaseApiLog).result)
|
|
46
47
|
},
|
|
47
|
-
{ prop: "latency_ms", label: t("system.base.log.field.latency_ms"), minWidth: 110 },
|
|
48
|
+
{ prop: "latency_ms", label: t("system.base.log.field.latency_ms"), minWidth: 110, align: "right" },
|
|
48
49
|
{ prop: "user_name", label: t("system.base.log.field.user_name"), minWidth: 130 },
|
|
49
|
-
{ prop: "occurred_at", label: t("system.base.log.field.occurred_at"), minWidth: 190, search: logDateSearch(t) },
|
|
50
|
+
{ prop: "occurred_at", label: t("system.base.log.field.occurred_at"), minWidth: 190, align: "center", search: logDateSearch(t) },
|
|
50
51
|
logDetailColumn(t("common.action.view"), id => page.value?.handleOpenDialog(id))
|
|
51
52
|
]);
|
|
52
53
|
|
|
@@ -76,8 +77,8 @@ const config = computed<LogTableConfig>(() => ({
|
|
|
76
77
|
{ key: "user_agent", label: t("system.base.log.field.user_agent"), span: 2 },
|
|
77
78
|
{ key: "request_id", label: t("system.base.log.field.request_id") },
|
|
78
79
|
{ key: "trace_id", label: t("system.base.log.field.trace_id") },
|
|
79
|
-
{ key: "occurred_at", label: t("system.base.log.field.occurred_at") },
|
|
80
|
-
{ key: "created_at", label: t("system.base.log.field.created_at") }
|
|
80
|
+
{ key: "occurred_at", format: formatLogDateTime, label: t("system.base.log.field.occurred_at") },
|
|
81
|
+
{ key: "created_at", format: formatLogDateTime, label: t("system.base.log.field.created_at") }
|
|
81
82
|
],
|
|
82
83
|
request: requestTable,
|
|
83
84
|
get: getDetail
|
|
@@ -71,7 +71,7 @@ const columns = computed<ColumnProps[]>(() => [
|
|
|
71
71
|
{ prop: "online_retention_days", label: t("system.backup.field.online_retention_days"), width: 120 },
|
|
72
72
|
{ prop: "archive_retention_days", label: t("system.backup.field.archive_retention_days"), width: 120 },
|
|
73
73
|
{ prop: "status", label: t("common.field.status"), width: 100, cellType: "status", statusProps: { activeValue: Status.STATUS_ENABLE, inactiveValue: Status.STATUS_DISABLE, activeText: t("common.status.enabled"), inactiveText: t("common.status.disabled"), disabled: () => !BUTTONS.value["base:table-archive:status"], beforeChange: scope => setStatus(scope.row as BaseTableArchiveForm) } },
|
|
74
|
-
{ prop: "operation", label: t("common.field.operation"),
|
|
74
|
+
{ prop: "operation", label: t("common.field.operation"), cellType: "actions", actions: [{ label: t("common.action.edit"), link: true, icon: EditPen, hidden: () => !BUTTONS.value["base:table-archive:update"], onClick: scope => openDialog((scope.row as BaseTableArchiveForm).id) }, { label: t("common.action.delete"), link: true, type: "danger", icon: Delete, hidden: () => !BUTTONS.value["base:table-archive:delete"], onClick: scope => remove(scope.row as BaseTableArchiveForm) }] }
|
|
75
75
|
]);
|
|
76
76
|
const headerActions = computed<HeaderActionProps[]>(() => [{ label: t("common.action.create"), type: "primary", icon: CirclePlus, hidden: !BUTTONS.value["base:table-archive:create"], onClick: () => openDialog() }, { label: t("common.action.delete"), type: "danger", icon: Delete, hidden: !BUTTONS.value["base:table-archive:delete"], disabled: scope => !scope.isSelected, onClick: scope => remove(scope.selectedListIds as number[]) }]);
|
|
77
77
|
|
|
@@ -10,6 +10,7 @@ import ProTable from "@liujitcn/kratos-admin-core/components/ProTable";
|
|
|
10
10
|
import type { ColumnProps, ProTableInstance } from "@liujitcn/kratos-admin-core/components/ProTable/interface";
|
|
11
11
|
import { buildPageRequest } from "@liujitcn/kratos-admin-core/table";
|
|
12
12
|
import { t } from "@liujitcn/kratos-admin-core";
|
|
13
|
+
import { formatDateTime } from "@liujitcn/kratos-admin-core/format";
|
|
13
14
|
import { defBaseTableArchiveRecordService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_table_archive_record";
|
|
14
15
|
import { BaseTableArchiveMode } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_table_archive";
|
|
15
16
|
import { BaseTableArchiveRecordStatus, type PageBaseTableArchiveRecordRequest } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_table_archive_record";
|
|
@@ -23,17 +24,17 @@ const statusOptions = computed(() => [
|
|
|
23
24
|
{ label: t("system.backup.status.deleted"), value: BaseTableArchiveRecordStatus.BASE_TABLE_ARCHIVE_RECORD_STATUS_DELETED }
|
|
24
25
|
]);
|
|
25
26
|
const columns = computed<ColumnProps[]>(() => [
|
|
26
|
-
{ prop: "id", label: t("system.backup.field.id"), width: 90 },
|
|
27
|
+
{ prop: "id", label: t("system.backup.field.id"), width: 90, align: "right" },
|
|
27
28
|
{ prop: "source_name", label: t("system.backup.field.source_name"), minWidth: 140 },
|
|
28
29
|
{ prop: "table_name", label: t("system.backup.field.table_name"), minWidth: 180 },
|
|
29
30
|
{ prop: "archive_mode", label: t("system.backup.field.archive_mode"), width: 130, render: scope => scope.row.archive_mode === BaseTableArchiveMode.BASE_TABLE_ARCHIVE_MODE_INTERNAL_DATABASE ? t("system.backup.archive.mode.internal") : t("system.backup.archive.mode.oss") },
|
|
30
|
-
{ prop: "cutoff_at", label: t("system.backup.field.cutoff_at"), minWidth: 170 },
|
|
31
|
-
{ prop: "archived_rows", label: t("system.backup.field.archived_rows"), width: 110 },
|
|
32
|
-
{ prop: "deleted_rows", label: t("system.backup.field.deleted_rows"), width: 110 },
|
|
31
|
+
{ prop: "cutoff_at", align: "center", label: t("system.backup.field.cutoff_at"), minWidth: 170, render: scope => formatDateTime(scope.row.cutoff_at) },
|
|
32
|
+
{ prop: "archived_rows", label: t("system.backup.field.archived_rows"), width: 110, align: "right" },
|
|
33
|
+
{ prop: "deleted_rows", label: t("system.backup.field.deleted_rows"), width: 110, align: "right" },
|
|
33
34
|
{ prop: "object_key", label: t("system.backup.field.object_key"), minWidth: 220 },
|
|
34
35
|
{ prop: "status", label: t("common.field.status"), width: 110, search: { el: "select", enum: statusOptions.value }, render: scope => statusOptions.value.find(item => item.value === scope.row.status)?.label ?? String(scope.row.status) },
|
|
35
|
-
{ prop: "started_at", label: t("system.backup.field.started_at"), minWidth: 170 },
|
|
36
|
-
{ prop: "finished_at", label: t("system.backup.field.finished_at"), minWidth: 170 }
|
|
36
|
+
{ prop: "started_at", align: "center", label: t("system.backup.field.started_at"), minWidth: 170, render: scope => formatDateTime(scope.row.started_at) },
|
|
37
|
+
{ prop: "finished_at", align: "center", label: t("system.backup.field.finished_at"), minWidth: 170, render: scope => formatDateTime(scope.row.finished_at) }
|
|
37
38
|
]);
|
|
38
39
|
|
|
39
40
|
/** 请求归档记录分页列表。 */
|
|
@@ -19,6 +19,7 @@ import type { ProFormField, ProFormInstance, ProFormOption } from "@liujitcn/kra
|
|
|
19
19
|
import { buildPageRequest } from "@liujitcn/kratos-admin-core/table";
|
|
20
20
|
import { useAuthButtons } from "@liujitcn/kratos-admin-core/auth";
|
|
21
21
|
import { t } from "@liujitcn/kratos-admin-core";
|
|
22
|
+
import { formatDateTime } from "@liujitcn/kratos-admin-core/format";
|
|
22
23
|
import { defBaseTableArchiveRestoreService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_table_archive_restore";
|
|
23
24
|
import { BaseTableArchiveRestoreMode, BaseTableArchiveRestoreStatus, type BaseTableArchiveRestore } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_table_archive_restore";
|
|
24
25
|
|
|
@@ -36,7 +37,7 @@ const formRules = computed(() => ({
|
|
|
36
37
|
{ type: "number", min: 1, message: t("system.backup.validation.archive_record_id_positive"), trigger: "change" }
|
|
37
38
|
]
|
|
38
39
|
}));
|
|
39
|
-
const columns = computed<ColumnProps[]>(() => [{ prop: "id", label: t("system.backup.field.id"), width: 90 }, { prop: "archive_record_id", label: t("system.backup.field.archive_record_id"), width: 130 }, { prop: "table_name", label: t("system.backup.field.table_name"), minWidth: 180 }, { prop: "restore_mode", label: t("system.backup.field.restore_mode"), width: 120, render: scope => modeOptions.value.find(item => item.value === scope.row.restore_mode)?.label ?? String(scope.row.restore_mode) }, { prop: "restored_rows", label: t("system.backup.field.restored_rows"), width: 110 }, { prop: "status", label: t("common.field.status"), width: 110 }, { prop: "error", label: t("system.backup.field.error"), minWidth: 220 }, { prop: "started_at", label: t("system.backup.field.started_at"), minWidth: 170 }, { prop: "finished_at", label: t("system.backup.field.finished_at"), minWidth: 170 }]);
|
|
40
|
+
const columns = computed<ColumnProps[]>(() => [{ prop: "id", label: t("system.backup.field.id"), width: 90 }, { prop: "archive_record_id", label: t("system.backup.field.archive_record_id"), width: 130 }, { prop: "table_name", label: t("system.backup.field.table_name"), minWidth: 180 }, { prop: "restore_mode", label: t("system.backup.field.restore_mode"), width: 120, render: scope => modeOptions.value.find(item => item.value === scope.row.restore_mode)?.label ?? String(scope.row.restore_mode) }, { prop: "restored_rows", label: t("system.backup.field.restored_rows"), width: 110 }, { prop: "status", label: t("common.field.status"), width: 110 }, { prop: "error", label: t("system.backup.field.error"), minWidth: 220 }, { prop: "started_at", align: "center", label: t("system.backup.field.started_at"), minWidth: 170, render: scope => formatDateTime(scope.row.started_at) }, { prop: "finished_at", align: "center", label: t("system.backup.field.finished_at"), minWidth: 170, render: scope => formatDateTime(scope.row.finished_at) }]);
|
|
40
41
|
|
|
41
42
|
/** 请求归档恢复记录分页列表。 */
|
|
42
43
|
async function requestTable(params: Record<string, unknown>) { const data = await defBaseTableArchiveRestoreService.PageBaseTableArchiveRestore(buildPageRequest(params)); return { data: { list: data.base_table_archive_restores ?? [], total: data.total } }; }
|
|
@@ -55,7 +55,7 @@ const columns = computed<ColumnProps[]>(() => [
|
|
|
55
55
|
{ prop: "oss_prefix", label: t("system.backup.field.oss_prefix"), minWidth: 180 },
|
|
56
56
|
{ prop: "retention_count", label: t("system.backup.field.retention_count"), width: 110 },
|
|
57
57
|
{ prop: "status", label: t("common.field.status"), width: 100, cellType: "status", statusProps: { activeValue: Status.STATUS_ENABLE, inactiveValue: Status.STATUS_DISABLE, activeText: t("common.status.enabled"), inactiveText: t("common.status.disabled"), disabled: () => !BUTTONS.value["base:table-backup:status"], beforeChange: scope => setStatus(scope.row as BaseTableBackupForm) } },
|
|
58
|
-
{ prop: "operation", label: t("common.field.operation"),
|
|
58
|
+
{ prop: "operation", label: t("common.field.operation"), cellType: "actions", actions: [{ label: t("common.action.edit"), link: true, icon: EditPen, hidden: () => !BUTTONS.value["base:table-backup:update"], onClick: scope => openDialog((scope.row as BaseTableBackupForm).id) }, { label: t("common.action.delete"), link: true, type: "danger", icon: Delete, hidden: () => !BUTTONS.value["base:table-backup:delete"], onClick: scope => remove(scope.row as BaseTableBackupForm) }] }
|
|
59
59
|
]);
|
|
60
60
|
const headerActions = computed<HeaderActionProps[]>(() => [{ label: t("common.action.create"), type: "primary", icon: CirclePlus, hidden: !BUTTONS.value["base:table-backup:create"], onClick: () => openDialog() }, { label: t("common.action.delete"), type: "danger", icon: Delete, hidden: !BUTTONS.value["base:table-backup:delete"], disabled: scope => !scope.isSelected, onClick: scope => remove(scope.selectedListIds as number[]) }]);
|
|
61
61
|
|
|
@@ -10,6 +10,7 @@ import ProTable from "@liujitcn/kratos-admin-core/components/ProTable";
|
|
|
10
10
|
import type { ColumnProps, ProTableInstance } from "@liujitcn/kratos-admin-core/components/ProTable/interface";
|
|
11
11
|
import { buildPageRequest } from "@liujitcn/kratos-admin-core/table";
|
|
12
12
|
import { t } from "@liujitcn/kratos-admin-core";
|
|
13
|
+
import { formatDateTime } from "@liujitcn/kratos-admin-core/format";
|
|
13
14
|
import { defBaseTableBackupRecordService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_table_backup_record";
|
|
14
15
|
import { BaseTableBackupRecordStatus, type PageBaseTableBackupRecordRequest } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_table_backup_record";
|
|
15
16
|
|
|
@@ -22,14 +23,14 @@ const statusOptions = computed(() => [
|
|
|
22
23
|
{ label: t("system.backup.status.deleted"), value: BaseTableBackupRecordStatus.BASE_TABLE_BACKUP_RECORD_STATUS_DELETED }
|
|
23
24
|
]);
|
|
24
25
|
const columns = computed<ColumnProps[]>(() => [
|
|
25
|
-
{ prop: "id", label: t("system.backup.field.id"), width: 90 },
|
|
26
|
+
{ prop: "id", label: t("system.backup.field.id"), width: 90, align: "right" },
|
|
26
27
|
{ prop: "source_name", label: t("system.backup.field.source_name"), minWidth: 140 },
|
|
27
28
|
{ prop: "database_name", label: t("system.backup.field.database_name"), minWidth: 160 },
|
|
28
29
|
{ prop: "object_key", label: t("system.backup.field.object_key"), minWidth: 260 },
|
|
29
30
|
{ prop: "size_bytes", label: t("system.backup.field.size_bytes"), width: 110 },
|
|
30
31
|
{ prop: "status", label: t("common.field.status"), width: 110, search: { el: "select", enum: statusOptions.value }, render: scope => statusOptions.value.find(item => item.value === scope.row.status)?.label ?? String(scope.row.status) },
|
|
31
|
-
{ prop: "started_at", label: t("system.backup.field.started_at"), minWidth: 170 },
|
|
32
|
-
{ prop: "finished_at", label: t("system.backup.field.finished_at"), minWidth: 170 },
|
|
32
|
+
{ prop: "started_at", align: "center", label: t("system.backup.field.started_at"), minWidth: 170, render: scope => formatDateTime(scope.row.started_at) },
|
|
33
|
+
{ prop: "finished_at", align: "center", label: t("system.backup.field.finished_at"), minWidth: 170, render: scope => formatDateTime(scope.row.finished_at) },
|
|
33
34
|
{ prop: "verified_at", label: t("system.backup.field.verified_at"), minWidth: 170 }
|
|
34
35
|
]);
|
|
35
36
|
|
|
@@ -19,6 +19,7 @@ import type { ProFormField, ProFormInstance, ProFormOption } from "@liujitcn/kra
|
|
|
19
19
|
import { buildPageRequest } from "@liujitcn/kratos-admin-core/table";
|
|
20
20
|
import { useAuthButtons } from "@liujitcn/kratos-admin-core/auth";
|
|
21
21
|
import { t } from "@liujitcn/kratos-admin-core";
|
|
22
|
+
import { formatDateTime } from "@liujitcn/kratos-admin-core/format";
|
|
22
23
|
import { defBaseTableBackupRestoreService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_table_backup_restore";
|
|
23
24
|
import { defBaseTableSourceService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_table_source";
|
|
24
25
|
import { BaseTableBackupRestoreMode, BaseTableBackupRestoreStatus, type BaseTableBackupRestore } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_table_backup_restore";
|
|
@@ -40,7 +41,7 @@ const formRules = computed(() => ({
|
|
|
40
41
|
target_source_name: [{ required: true, message: t("system.backup.validation.target_source_name"), trigger: "blur" }],
|
|
41
42
|
target_database: [{ required: true, message: t("system.backup.validation.target_database"), trigger: "blur" }]
|
|
42
43
|
}));
|
|
43
|
-
const columns = computed<ColumnProps[]>(() => [{ prop: "id", label: t("system.backup.field.id"), width: 90 }, { prop: "backup_record_id", label: t("system.backup.field.backup_record_id"), width: 130 }, { prop: "source_name", label: t("system.backup.field.source_name"), minWidth: 130 }, { prop: "target_source_name", label: t("system.backup.field.target_source_name"), minWidth: 130 }, { prop: "target_database", label: t("system.backup.field.target_database"), minWidth: 150 }, { prop: "restore_mode", label: t("system.backup.field.restore_mode"), width: 120, render: scope => modeOptions.value.find(item => item.value === scope.row.restore_mode)?.label ?? String(scope.row.restore_mode) }, { prop: "status", label: t("common.field.status"), width: 110 }, { prop: "error", label: t("system.backup.field.error"), minWidth: 220 }, { prop: "started_at", label: t("system.backup.field.started_at"), minWidth: 170 }, { prop: "finished_at", label: t("system.backup.field.finished_at"), minWidth: 170 }]);
|
|
44
|
+
const columns = computed<ColumnProps[]>(() => [{ prop: "id", label: t("system.backup.field.id"), width: 90 }, { prop: "backup_record_id", label: t("system.backup.field.backup_record_id"), width: 130 }, { prop: "source_name", label: t("system.backup.field.source_name"), minWidth: 130 }, { prop: "target_source_name", label: t("system.backup.field.target_source_name"), minWidth: 130 }, { prop: "target_database", label: t("system.backup.field.target_database"), minWidth: 150 }, { prop: "restore_mode", label: t("system.backup.field.restore_mode"), width: 120, render: scope => modeOptions.value.find(item => item.value === scope.row.restore_mode)?.label ?? String(scope.row.restore_mode) }, { prop: "status", label: t("common.field.status"), width: 110 }, { prop: "error", label: t("system.backup.field.error"), minWidth: 220 }, { prop: "started_at", align: "center", label: t("system.backup.field.started_at"), minWidth: 170, render: scope => formatDateTime(scope.row.started_at) }, { prop: "finished_at", align: "center", label: t("system.backup.field.finished_at"), minWidth: 170, render: scope => formatDateTime(scope.row.finished_at) }]);
|
|
44
45
|
|
|
45
46
|
/** 请求备份恢复记录分页列表。 */
|
|
46
47
|
async function requestTable(params: Record<string, unknown>) { const data = await defBaseTableBackupRestoreService.PageBaseTableBackupRestore(buildPageRequest(params)); return { data: { list: data.base_table_backup_restores ?? [], total: data.total } }; }
|
|
@@ -489,13 +489,11 @@ const columns = computed<ColumnProps[]>(() => [
|
|
|
489
489
|
beforeChange: scope => handleBeforeSetStatus(scope.row as BaseConfig)
|
|
490
490
|
}
|
|
491
491
|
},
|
|
492
|
-
{ prop: "created_at", label: t("common.field.created_at"), minWidth: 180 },
|
|
493
|
-
{ prop: "updated_at", label: t("common.field.updated_at"), minWidth: 180 },
|
|
492
|
+
{ prop: "created_at", align: "center", label: t("common.field.created_at"), minWidth: 180 },
|
|
493
|
+
{ prop: "updated_at", label: t("common.field.updated_at"), minWidth: 180, align: "center" },
|
|
494
494
|
{
|
|
495
495
|
prop: "operation",
|
|
496
496
|
label: t("common.field.operation"),
|
|
497
|
-
width: 150,
|
|
498
|
-
fixed: "right",
|
|
499
497
|
cellType: "actions",
|
|
500
498
|
actions: [
|
|
501
499
|
{
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import { computed, ref } from "vue";
|
|
7
7
|
import type { ColumnProps } from "@liujitcn/kratos-admin-core/components/ProTable/interface";
|
|
8
8
|
import { t } from "@liujitcn/kratos-admin-core";
|
|
9
|
+
import { formatLogDateTime } from "@liujitcn/kratos-admin-system/components/log";
|
|
9
10
|
import { buildPageRequest } from "@liujitcn/kratos-admin-core/table";
|
|
10
11
|
import LogTable, { type LogTableConfig } from "@liujitcn/kratos-admin-system/components/LogTable.vue";
|
|
11
12
|
import {
|
|
@@ -44,10 +45,10 @@ const columns = computed<ColumnProps[]>(() => [
|
|
|
44
45
|
{ prop: "resource_type", label: t("system.base.log.field.resource_type"), minWidth: 150, search: { el: "input" } },
|
|
45
46
|
{ prop: "table_name", label: t("system.base.log.field.table_name"), minWidth: 150 },
|
|
46
47
|
{ prop: "access_type", label: t("system.base.log.field.access_type"), minWidth: 120, search: { el: "select", enum: accessTypeOptions.value }, render: scope => logEnumLabel(accessTypeOptions.value, (scope.row as BaseDataAccessLog).access_type) },
|
|
47
|
-
{ prop: "affected_rows", label: t("system.base.log.field.affected_rows"), minWidth: 110 },
|
|
48
|
+
{ prop: "affected_rows", label: t("system.base.log.field.affected_rows"), minWidth: 110, align: "right" },
|
|
48
49
|
{ prop: "sensitive", label: t("system.base.log.field.sensitive"), minWidth: 110, search: { el: "switch" }, render: scope => (scope.row as BaseDataAccessLog).sensitive ? t("common.value.yes") : t("common.value.no") },
|
|
49
50
|
{ prop: "result", label: t("system.base.log.field.result"), minWidth: 110, search: { el: "select", enum: resultOptions.value }, render: scope => logEnumLabel(resultOptions.value, (scope.row as BaseDataAccessLog).result) },
|
|
50
|
-
{ prop: "occurred_at", label: t("system.base.log.field.occurred_at"), minWidth: 190, search: logDateSearch(t) },
|
|
51
|
+
{ prop: "occurred_at", label: t("system.base.log.field.occurred_at"), minWidth: 190, align: "center", search: logDateSearch(t) },
|
|
51
52
|
logDetailColumn(t("common.action.view"), id => page.value?.handleOpenDialog(id))
|
|
52
53
|
]);
|
|
53
54
|
|
|
@@ -63,7 +64,7 @@ const config = computed<LogTableConfig>(() => ({
|
|
|
63
64
|
{ key: "user_id", label: t("system.base.log.field.user_id") },
|
|
64
65
|
{ key: "user_name", label: t("system.base.log.field.user_name") },
|
|
65
66
|
{ key: "resource_type", label: t("system.base.log.field.resource_type") },
|
|
66
|
-
{ key: "resource_id", label: t("system.base.log.field.resource_id") },
|
|
67
|
+
{ key: "resource_id", label: t("system.base.log.field.resource_id"), align: "left" },
|
|
67
68
|
{ key: "access_type", label: t("system.base.log.field.access_type"), enum: accessTypeOptions.value },
|
|
68
69
|
{ key: "data_source", label: t("system.base.log.field.data_source") },
|
|
69
70
|
{ key: "table_name", label: t("system.base.log.field.table_name") },
|
|
@@ -78,8 +79,8 @@ const config = computed<LogTableConfig>(() => ({
|
|
|
78
79
|
{ key: "reason_code", label: t("system.base.log.field.reason_code") },
|
|
79
80
|
{ key: "request_id", label: t("system.base.log.field.request_id") },
|
|
80
81
|
{ key: "trace_id", label: t("system.base.log.field.trace_id") },
|
|
81
|
-
{ key: "occurred_at", label: t("system.base.log.field.occurred_at") },
|
|
82
|
-
{ key: "created_at", label: t("system.base.log.field.created_at") }
|
|
82
|
+
{ key: "occurred_at", format: formatLogDateTime, label: t("system.base.log.field.occurred_at") },
|
|
83
|
+
{ key: "created_at", format: formatLogDateTime, label: t("system.base.log.field.created_at") }
|
|
83
84
|
],
|
|
84
85
|
request: requestTable,
|
|
85
86
|
get: getDetail
|
|
@@ -190,13 +190,14 @@ const columns = computed<ColumnProps[]>(() => [
|
|
|
190
190
|
prop: "tenant_id",
|
|
191
191
|
label: t("common.field.tenant"),
|
|
192
192
|
minWidth: 140,
|
|
193
|
+
align: "left",
|
|
193
194
|
showOverflowTooltip: true,
|
|
194
195
|
search: { el: "select", key: "tenant_id", props: { filterable: true }, order: 1 },
|
|
195
196
|
enum: requestTenantOptions
|
|
196
197
|
}
|
|
197
198
|
] satisfies ColumnProps[])
|
|
198
199
|
: []),
|
|
199
|
-
{ prop: "name", label: t("system.base.dept.field.name"), minWidth: 140, align: "
|
|
200
|
+
{ prop: "name", label: t("system.base.dept.field.name"), minWidth: 140, align: "right", search: { el: "input" } },
|
|
200
201
|
{ prop: "remark", label: t("common.field.remark"), minWidth: 160, search: { el: "input" } },
|
|
201
202
|
{ prop: "sort", label: t("common.field.sort"), minWidth: 90, align: "right" },
|
|
202
203
|
{
|
|
@@ -214,13 +215,11 @@ const columns = computed<ColumnProps[]>(() => [
|
|
|
214
215
|
beforeChange: scope => handleBeforeSetStatus(scope.row as BaseDept)
|
|
215
216
|
}
|
|
216
217
|
},
|
|
217
|
-
{ prop: "created_at", label: t("common.field.created_at"), minWidth: 180 },
|
|
218
|
-
{ prop: "updated_at", label: t("common.field.updated_at"), minWidth: 180 },
|
|
218
|
+
{ prop: "created_at", align: "center", label: t("common.field.created_at"), minWidth: 180 },
|
|
219
|
+
{ prop: "updated_at", label: t("common.field.updated_at"), minWidth: 180, align: "center" },
|
|
219
220
|
{
|
|
220
221
|
prop: "operation",
|
|
221
222
|
label: t("common.field.operation"),
|
|
222
|
-
width: 220,
|
|
223
|
-
fixed: "right",
|
|
224
223
|
cellType: "actions",
|
|
225
224
|
actions: [
|
|
226
225
|
{
|
|
@@ -172,13 +172,11 @@ const columns = computed<ColumnProps[]>(() => [
|
|
|
172
172
|
beforeChange: scope => handleBeforeSetStatus(scope.row as BaseDict)
|
|
173
173
|
}
|
|
174
174
|
},
|
|
175
|
-
{ prop: "created_at", label: t("common.field.created_at"), minWidth: 180 },
|
|
176
|
-
{ prop: "updated_at", label: t("common.field.updated_at"), minWidth: 180 },
|
|
175
|
+
{ prop: "created_at", align: "center", label: t("common.field.created_at"), minWidth: 180 },
|
|
176
|
+
{ prop: "updated_at", label: t("common.field.updated_at"), minWidth: 180, align: "center" },
|
|
177
177
|
{
|
|
178
178
|
prop: "operation",
|
|
179
179
|
label: t("common.field.action"),
|
|
180
|
-
width: 240,
|
|
181
|
-
fixed: "right",
|
|
182
180
|
cellType: "actions",
|
|
183
181
|
actions: [
|
|
184
182
|
{
|
|
@@ -234,13 +234,11 @@ const columns = computed<ColumnProps[]>(() => [
|
|
|
234
234
|
beforeChange: scope => handleBeforeSetStatus(scope.row as BaseDictItem)
|
|
235
235
|
}
|
|
236
236
|
},
|
|
237
|
-
{ prop: "created_at", label: t("common.field.created_at"), minWidth: 180 },
|
|
238
|
-
{ prop: "updated_at", label: t("common.field.updated_at"), minWidth: 180 },
|
|
237
|
+
{ prop: "created_at", align: "center", label: t("common.field.created_at"), minWidth: 180 },
|
|
238
|
+
{ prop: "updated_at", label: t("common.field.updated_at"), minWidth: 180, align: "center" },
|
|
239
239
|
{
|
|
240
240
|
prop: "operation",
|
|
241
241
|
label: t("common.field.action"),
|
|
242
|
-
width: 180,
|
|
243
|
-
fixed: "right",
|
|
244
242
|
cellType: "actions",
|
|
245
243
|
actions: [
|
|
246
244
|
{
|
|
@@ -110,15 +110,13 @@ const columns = computed<ColumnProps[]>(() => [
|
|
|
110
110
|
{ prop: "file_name", label: t("system.base.file.field.name"), minWidth: 220, search: { el: "input" } },
|
|
111
111
|
{ prop: "extension", label: t("system.base.file.field.extension"), width: 100, search: { el: "input" } },
|
|
112
112
|
{ prop: "mime_type", label: t("system.base.file.field.mime"), minWidth: 180 },
|
|
113
|
-
{ prop: "size", label: t("system.base.file.field.size"), width: 120, render: scope => formatFileSize((scope.row as BaseFile).size) },
|
|
113
|
+
{ prop: "size", label: t("system.base.file.field.size"), width: 120, align: "right", render: scope => formatFileSize((scope.row as BaseFile).size) },
|
|
114
114
|
{ prop: "content_hash", label: t("system.base.file.field.hash"), minWidth: 220 },
|
|
115
|
-
{ prop: "tenant_id", label: t("system.base.file.field.tenant"), width: 100 },
|
|
116
|
-
{ prop: "created_at", label: t("common.field.created_at"), minWidth: 180 },
|
|
115
|
+
{ prop: "tenant_id", label: t("system.base.file.field.tenant"), width: 100, align: "left" },
|
|
116
|
+
{ prop: "created_at", align: "center", label: t("common.field.created_at"), minWidth: 180 },
|
|
117
117
|
{
|
|
118
118
|
prop: "operation",
|
|
119
119
|
label: t("common.field.operation"),
|
|
120
|
-
width: 150,
|
|
121
|
-
fixed: "right",
|
|
122
120
|
cellType: "actions",
|
|
123
121
|
actions: [
|
|
124
122
|
{
|
|
@@ -367,13 +367,11 @@ const columns = computed<ColumnProps[]>(() => [
|
|
|
367
367
|
beforeChange: scope => handleBeforeSetStatus(scope.row as BaseJob)
|
|
368
368
|
}
|
|
369
369
|
},
|
|
370
|
-
{ prop: "created_at", label: t("common.field.created_at"), minWidth: 180 },
|
|
371
|
-
{ prop: "updated_at", label: t("common.field.updated_at"), minWidth: 180 },
|
|
370
|
+
{ prop: "created_at", align: "center", label: t("common.field.created_at"), minWidth: 180 },
|
|
371
|
+
{ prop: "updated_at", label: t("common.field.updated_at"), minWidth: 180, align: "center" },
|
|
372
372
|
{
|
|
373
373
|
prop: "operation",
|
|
374
374
|
label: t("common.field.action"),
|
|
375
|
-
width: 380,
|
|
376
|
-
fixed: "right",
|
|
377
375
|
render: scope => renderOperationCell(scope as unknown as RenderScope<BaseJob>)
|
|
378
376
|
}
|
|
379
377
|
]);
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<DictLabel v-model="detail.status" code="base_job_log_status" />
|
|
10
10
|
</el-descriptions-item>
|
|
11
11
|
<el-descriptions-item :label="t('system.base.job.log.field.process_time')">{{ detail.process_time }}</el-descriptions-item>
|
|
12
|
-
<el-descriptions-item :label="t('system.base.job.log.field.execute_time')">{{ detail.execute_time }}</el-descriptions-item>
|
|
12
|
+
<el-descriptions-item :label="t('system.base.job.log.field.execute_time')">{{ formatDateTime(detail.execute_time) }}</el-descriptions-item>
|
|
13
13
|
</el-descriptions>
|
|
14
14
|
|
|
15
15
|
<el-descriptions :title="t('system.base.job.log.section.execution')" border :column="1" class="mt-4">
|
|
@@ -48,7 +48,7 @@ import ProDialog from "@liujitcn/kratos-admin-core/components/Dialog/ProDialog.v
|
|
|
48
48
|
import { defBaseJobService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_job";
|
|
49
49
|
import { defBaseJobLogService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_job_log";
|
|
50
50
|
import { buildPageRequest } from "@liujitcn/kratos-admin-core/table";
|
|
51
|
-
import { formatJson } from "@liujitcn/kratos-admin-core/format";
|
|
51
|
+
import { formatDateTime, formatJson } from "@liujitcn/kratos-admin-core/format";
|
|
52
52
|
import type { BaseJobLog, PageBaseJobLogRequest } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_job_log";
|
|
53
53
|
import { BaseJobLogStatus } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_job_log";
|
|
54
54
|
import { t } from "@liujitcn/kratos-admin-core";
|
|
@@ -96,6 +96,7 @@ const columns = computed<ColumnProps[]>(() => [
|
|
|
96
96
|
prop: "job_id",
|
|
97
97
|
label: t("system.base.job.field.name"),
|
|
98
98
|
minWidth: 180,
|
|
99
|
+
align: "left",
|
|
99
100
|
search: {
|
|
100
101
|
el: "select",
|
|
101
102
|
defaultValue: initialJobID > 0 ? initialJobID : undefined,
|
|
@@ -115,6 +116,7 @@ const columns = computed<ColumnProps[]>(() => [
|
|
|
115
116
|
prop: "execute_time",
|
|
116
117
|
label: t("system.base.job.log.field.execute_time"),
|
|
117
118
|
minWidth: 180,
|
|
119
|
+
align: "center",
|
|
118
120
|
search: {
|
|
119
121
|
el: "date-picker",
|
|
120
122
|
props: {
|
|
@@ -132,8 +134,6 @@ const columns = computed<ColumnProps[]>(() => [
|
|
|
132
134
|
{
|
|
133
135
|
prop: "detailAction",
|
|
134
136
|
label: t("common.field.action"),
|
|
135
|
-
width: 100,
|
|
136
|
-
fixed: "right",
|
|
137
137
|
cellType: "actions",
|
|
138
138
|
actions: [
|
|
139
139
|
{
|
|
@@ -85,7 +85,7 @@ const formFields = computed<ProFormField[]>(() => [
|
|
|
85
85
|
const columns = computed<ColumnProps[]>(() => [
|
|
86
86
|
{ prop: "native_name", label: t("system.base.language.field.native_name"), minWidth: 130 },
|
|
87
87
|
{ prop: "language_name", label: t("system.base.language.field.name"), minWidth: 130, search: { el: "input" } },
|
|
88
|
-
{ prop: "language_code", label: t("system.base.language.field.code"), minWidth: 120, search: { el: "input" } },
|
|
88
|
+
{ prop: "language_code", align: "center", label: t("system.base.language.field.code"), minWidth: 120, search: { el: "input" } },
|
|
89
89
|
{
|
|
90
90
|
prop: "is_primary",
|
|
91
91
|
label: t("system.base.language.field.primary"),
|
|
@@ -115,13 +115,11 @@ const columns = computed<ColumnProps[]>(() => [
|
|
|
115
115
|
beforeChange: scope => handleBeforeSetStatus(scope.row as BaseLanguage)
|
|
116
116
|
}
|
|
117
117
|
},
|
|
118
|
-
{ prop: "sort", label: t("system.base.language.field.sort"), width: 80 },
|
|
119
|
-
{ prop: "created_at", label: t("common.field.created_at"), minWidth: 180 },
|
|
118
|
+
{ prop: "sort", label: t("system.base.language.field.sort"), width: 80, align: "right" },
|
|
119
|
+
{ prop: "created_at", align: "center", label: t("common.field.created_at"), minWidth: 180 },
|
|
120
120
|
{
|
|
121
121
|
prop: "operation",
|
|
122
122
|
label: t("common.field.operation"),
|
|
123
|
-
width: 150,
|
|
124
|
-
fixed: "right",
|
|
125
123
|
cellType: "actions",
|
|
126
124
|
actions: [
|
|
127
125
|
{ label: t("common.action.edit"), type: "primary", link: true, icon: EditPen, hidden: () => !BUTTONS.value["base:language:update"], onClick: scope => handleOpenDialog((scope.row as BaseLanguage).id) },
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import { computed, ref } from "vue";
|
|
7
7
|
import type { ColumnProps } from "@liujitcn/kratos-admin-core/components/ProTable/interface";
|
|
8
8
|
import { t } from "@liujitcn/kratos-admin-core";
|
|
9
|
+
import { formatLogDateTime } from "@liujitcn/kratos-admin-system/components/log";
|
|
9
10
|
import { buildPageRequest } from "@liujitcn/kratos-admin-core/table";
|
|
10
11
|
import LogTable, { type LogTableConfig } from "@liujitcn/kratos-admin-system/components/LogTable.vue";
|
|
11
12
|
import { logDateSearch, logDetailColumn, logEnumLabel, createLogEnumOptions, requestLogTrace } from "@liujitcn/kratos-admin-system/components/log";
|
|
@@ -38,7 +39,7 @@ const loginTypeOptions = computed(() =>
|
|
|
38
39
|
|
|
39
40
|
const columns = computed<ColumnProps[]>(() => [
|
|
40
41
|
{ prop: "user_name", label: t("system.base.log.field.user_name"), minWidth: 130 },
|
|
41
|
-
{ prop: "tenant_code", label: t("system.base.log.field.tenant_code"), minWidth: 120 },
|
|
42
|
+
{ prop: "tenant_code", label: t("system.base.log.field.tenant_code"), minWidth: 120, align: "left" },
|
|
42
43
|
{
|
|
43
44
|
prop: "login_type",
|
|
44
45
|
label: t("system.base.log.field.login_type"),
|
|
@@ -54,7 +55,7 @@ const columns = computed<ColumnProps[]>(() => [
|
|
|
54
55
|
render: scope => logEnumLabel(resultOptions.value, (scope.row as BaseLoginLog).result)
|
|
55
56
|
},
|
|
56
57
|
{ prop: "client_ip", label: t("system.base.log.field.client_ip"), minWidth: 140 },
|
|
57
|
-
{ prop: "occurred_at", label: t("system.base.log.field.occurred_at"), minWidth: 190, search: logDateSearch(t) },
|
|
58
|
+
{ prop: "occurred_at", label: t("system.base.log.field.occurred_at"), minWidth: 190, align: "center", search: logDateSearch(t) },
|
|
58
59
|
logDetailColumn(t("common.action.view"), id => page.value?.handleOpenDialog(id))
|
|
59
60
|
]);
|
|
60
61
|
|
|
@@ -78,8 +79,8 @@ const config = computed<LogTableConfig>(() => ({
|
|
|
78
79
|
{ key: "user_agent", label: t("system.base.log.field.user_agent"), span: 2 },
|
|
79
80
|
{ key: "request_id", label: t("system.base.log.field.request_id") },
|
|
80
81
|
{ key: "trace_id", label: t("system.base.log.field.trace_id") },
|
|
81
|
-
{ key: "occurred_at", label: t("system.base.log.field.occurred_at") },
|
|
82
|
-
{ key: "created_at", label: t("system.base.log.field.created_at") }
|
|
82
|
+
{ key: "occurred_at", format: formatLogDateTime, label: t("system.base.log.field.occurred_at") },
|
|
83
|
+
{ key: "created_at", format: formatLogDateTime, label: t("system.base.log.field.created_at") }
|
|
83
84
|
],
|
|
84
85
|
request: requestTable,
|
|
85
86
|
get: getDetail
|