@liujitcn/kratos-admin-system 0.0.21 → 0.0.23
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/api/system/base_language.d.ts +5 -4
- package/dist/package/declarations/src/api/system/base_translation.d.ts +7 -4
- package/dist/package/declarations/src/api/system/ops_monitoring.d.ts +19 -0
- package/dist/package/declarations/src/api/system/ops_monitoring_sse.d.ts +12 -0
- package/dist/package/declarations/src/components/DynamicTranslationCell.vue.d.ts +9 -32
- package/dist/package/declarations/src/components/DynamicTranslationEditor.vue.d.ts +3 -6
- package/dist/package/declarations/src/components/dynamicTranslation.d.ts +11 -17
- package/dist/package/declarations/src/locales/generated.d.ts +6536 -0
- package/dist/package/declarations/src/rpc/base/v1/ai_session.d.ts +12 -2
- package/dist/package/declarations/src/rpc/base/v1/ai_tool.d.ts +9 -1
- package/dist/package/declarations/src/rpc/base/v1/config.d.ts +35 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/auth.d.ts +1 -1
- package/dist/package/declarations/src/rpc/system/admin/v1/base_config.d.ts +23 -7
- package/dist/package/declarations/src/rpc/system/admin/v1/base_dict.d.ts +7 -77
- package/dist/package/declarations/src/rpc/system/admin/v1/base_job.d.ts +9 -1
- package/dist/package/declarations/src/rpc/system/admin/v1/base_language.d.ts +7 -2
- package/dist/package/declarations/src/rpc/system/admin/v1/base_menu.d.ts +5 -40
- package/dist/package/declarations/src/rpc/system/admin/v1/base_migration.d.ts +6 -6
- package/dist/package/declarations/src/rpc/system/admin/v1/base_role.d.ts +13 -1
- package/dist/package/declarations/src/rpc/system/admin/v1/base_translation.d.ts +54 -81
- package/dist/package/declarations/src/rpc/system/admin/v1/base_user.d.ts +11 -1
- package/dist/package/declarations/src/rpc/system/admin/v1/code_gen.d.ts +11 -11
- package/dist/package/declarations/src/rpc/system/admin/v1/code_gen_table.d.ts +11 -1
- package/dist/package/declarations/src/rpc/system/admin/v1/common.d.ts +13 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/ops_monitoring.d.ts +222 -0
- package/dist/package/declarations/src/views/tool/ops-monitoring/index.vue.d.ts +3 -0
- package/dist/package/src/api/base/ai_message.ts +2 -2
- package/dist/package/src/api/system/base_language.ts +13 -15
- package/dist/package/src/api/system/base_translation.ts +17 -6
- package/dist/package/src/api/system/ops_monitoring.ts +88 -0
- package/dist/package/src/api/system/ops_monitoring_sse.ts +49 -0
- package/dist/package/src/components/DynamicTranslationCell.vue +199 -126
- package/dist/package/src/components/DynamicTranslationEditor.vue +109 -78
- package/dist/package/src/components/dynamicTranslation.ts +11 -31
- package/dist/package/src/locales/README.md +7 -5
- package/dist/package/src/locales/en-US.json +876 -872
- package/dist/package/src/locales/es-ES.json +900 -895
- package/dist/package/src/locales/fr-FR.json +896 -891
- package/dist/package/src/locales/generated.ts +22 -0
- package/dist/package/src/locales/ja-JP.json +876 -872
- package/dist/package/src/locales/ko-KR.json +881 -876
- package/dist/package/src/locales/zh-CN.json +876 -872
- package/dist/package/src/locales/zh-TW.json +876 -871
- package/dist/package/src/module.ts +3 -17
- package/dist/package/src/rpc/base/v1/ai_session.ts +13 -2
- package/dist/package/src/rpc/base/v1/ai_tool.ts +10 -1
- package/dist/package/src/rpc/base/v1/config.ts +47 -0
- package/dist/package/src/rpc/system/admin/v1/auth.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/base_config.ts +24 -7
- package/dist/package/src/rpc/system/admin/v1/base_dict.ts +7 -79
- package/dist/package/src/rpc/system/admin/v1/base_job.ts +10 -1
- package/dist/package/src/rpc/system/admin/v1/base_language.ts +8 -2
- package/dist/package/src/rpc/system/admin/v1/base_menu.ts +5 -41
- package/dist/package/src/rpc/system/admin/v1/base_migration.ts +8 -8
- package/dist/package/src/rpc/system/admin/v1/base_role.ts +14 -1
- package/dist/package/src/rpc/system/admin/v1/base_translation.ts +54 -81
- package/dist/package/src/rpc/system/admin/v1/base_user.ts +12 -1
- package/dist/package/src/rpc/system/admin/v1/code_gen.ts +11 -11
- package/dist/package/src/rpc/system/admin/v1/code_gen_table.ts +12 -1
- package/dist/package/src/rpc/system/admin/v1/common.ts +21 -0
- package/dist/package/src/rpc/system/admin/v1/ops_monitoring.ts +255 -0
- package/dist/package/src/views/ai/chat/components/ChatPanel.vue +36 -36
- package/dist/package/src/views/ai/chat/components/SessionPanel.vue +6 -6
- package/dist/package/src/views/ai/chat/components/XSender.vue +20 -20
- package/dist/package/src/views/ai/chat/index.vue +33 -32
- package/dist/package/src/views/ai/chat/message.ts +16 -15
- package/dist/package/src/views/base/api/index.vue +55 -56
- package/dist/package/src/views/base/area/index.vue +18 -19
- package/dist/package/src/views/base/config/index.vue +143 -133
- package/dist/package/src/views/base/dept/index.vue +42 -43
- package/dist/package/src/views/base/dict/index.vue +49 -45
- package/dist/package/src/views/base/dict/item.vue +54 -49
- package/dist/package/src/views/base/job/index.vue +51 -52
- package/dist/package/src/views/base/job/log.vue +18 -18
- package/dist/package/src/views/{tool → base}/language/index.vue +51 -47
- package/dist/package/src/views/base/log/index.vue +40 -40
- package/dist/package/src/views/base/menu/index.vue +220 -177
- package/dist/package/src/views/base/migration/index.vue +24 -24
- package/dist/package/src/views/base/post/index.vue +42 -43
- package/dist/package/src/views/base/role/index.vue +54 -55
- package/dist/package/src/views/base/tenant/index.vue +42 -43
- package/dist/package/src/views/base/user/components/dept-tree.vue +1 -1
- package/dist/package/src/views/base/user/index.vue +69 -71
- package/dist/package/src/views/profile/components/base.vue +9 -9
- package/dist/package/src/views/profile/components/password.vue +19 -20
- package/dist/package/src/views/profile/components/security.vue +20 -20
- package/dist/package/src/views/profile/index.vue +3 -3
- package/dist/package/src/views/tool/api-doc/index.vue +1 -1
- package/dist/package/src/views/tool/code-gen/code-preview/index.vue +13 -13
- package/dist/package/src/views/tool/code-gen/columns/index.vue +89 -89
- package/dist/package/src/views/tool/code-gen/components/CodeGenLocaleEditor.vue +5 -5
- package/dist/package/src/views/tool/code-gen/components/CodeGenProgressDialog.vue +21 -21
- package/dist/package/src/views/tool/code-gen/components/CodePreviewPane.vue +5 -5
- package/dist/package/src/views/tool/code-gen/config.ts +60 -60
- package/dist/package/src/views/tool/code-gen/preview/data.ts +2 -2
- package/dist/package/src/views/tool/code-gen/preview/index.vue +30 -31
- package/dist/package/src/views/tool/code-gen/proto/index.vue +43 -43
- package/dist/package/src/views/tool/code-gen/table/index.vue +95 -95
- package/dist/package/src/views/tool/ops-monitoring/index.vue +1175 -0
- package/dist/package/src/views/tool/project-doc/index.vue +7 -7
- package/package.json +2 -2
- package/dist/package/declarations/src/rpc/base/v1/enum.d.ts +0 -43
- package/dist/package/declarations/src/rpc/system/common/v1/enum.d.ts +0 -67
- package/dist/package/src/rpc/base/v1/enum.ts +0 -54
- package/dist/package/src/rpc/system/common/v1/enum.ts +0 -80
- /package/dist/package/declarations/src/views/{tool → base}/language/index.vue.d.ts +0 -0
|
@@ -3,27 +3,27 @@
|
|
|
3
3
|
<div v-loading="loading" class="table-box migration-page">
|
|
4
4
|
<main class="migration-content">
|
|
5
5
|
<el-form class="migration-filters" :model="filters" inline @submit.prevent="handleSearch">
|
|
6
|
-
<el-form-item :label="t('system.migration.field.module')">
|
|
6
|
+
<el-form-item :label="t('system.base.migration.field.module')">
|
|
7
7
|
<el-input
|
|
8
8
|
v-model="filters.module"
|
|
9
9
|
clearable
|
|
10
|
-
:placeholder="t('system.migration.placeholder.module')"
|
|
10
|
+
:placeholder="t('system.base.migration.placeholder.module')"
|
|
11
11
|
@keyup.enter="handleSearch"
|
|
12
12
|
/>
|
|
13
13
|
</el-form-item>
|
|
14
|
-
<el-form-item :label="t('system.migration.field.
|
|
14
|
+
<el-form-item :label="t('system.base.migration.field.data_source')">
|
|
15
15
|
<el-input
|
|
16
16
|
v-model="filters.data_source"
|
|
17
17
|
clearable
|
|
18
|
-
:placeholder="t('system.migration.placeholder.
|
|
18
|
+
:placeholder="t('system.base.migration.placeholder.data_source')"
|
|
19
19
|
@keyup.enter="handleSearch"
|
|
20
20
|
/>
|
|
21
21
|
</el-form-item>
|
|
22
|
-
<el-form-item :label="t('system.migration.field.version')">
|
|
22
|
+
<el-form-item :label="t('system.base.migration.field.version')">
|
|
23
23
|
<el-input
|
|
24
24
|
v-model="filters.version"
|
|
25
25
|
clearable
|
|
26
|
-
:placeholder="t('system.migration.placeholder.version')"
|
|
26
|
+
:placeholder="t('system.base.migration.placeholder.version')"
|
|
27
27
|
@keyup.enter="handleSearch"
|
|
28
28
|
/>
|
|
29
29
|
</el-form-item>
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
</el-form-item>
|
|
34
34
|
</el-form>
|
|
35
35
|
|
|
36
|
-
<el-empty v-if="!loading && !histories.length" :description="t('system.migration.message.
|
|
36
|
+
<el-empty v-if="!loading && !histories.length" :description="t('system.base.migration.message.empty_history')" />
|
|
37
37
|
|
|
38
|
-
<section v-else class="migration-workspace" :aria-label="t('system.migration.title.history')">
|
|
38
|
+
<section v-else class="migration-workspace" :aria-label="t('system.base.migration.title.history')">
|
|
39
39
|
<aside class="migration-list-panel">
|
|
40
|
-
<div class="migration-list-scroll" role="listbox" :aria-label="t('system.migration.title.list')">
|
|
40
|
+
<div class="migration-list-scroll" role="listbox" :aria-label="t('system.base.migration.title.list')">
|
|
41
41
|
<button
|
|
42
42
|
v-for="history in histories"
|
|
43
43
|
:key="history.id"
|
|
@@ -51,14 +51,14 @@
|
|
|
51
51
|
<strong>{{ history.version }}</strong>
|
|
52
52
|
</div>
|
|
53
53
|
<div class="migration-list-item__data-source">
|
|
54
|
-
{{ history.module || t("system.migration.value.
|
|
54
|
+
{{ history.module || t("system.base.migration.value.default_module") }} · {{ history.data_source || "default" }}
|
|
55
55
|
</div>
|
|
56
56
|
<time :datetime="history.created_at">{{ formatDate(history.created_at) }}</time>
|
|
57
57
|
</button>
|
|
58
58
|
</div>
|
|
59
59
|
|
|
60
60
|
<div v-if="pageable.total > pageable.page_size" class="migration-pagination">
|
|
61
|
-
<span class="migration-pagination__total">{{ t("system.migration.message.total", { total: pageable.total }) }}</span>
|
|
61
|
+
<span class="migration-pagination__total">{{ t("system.base.migration.message.total", { total: pageable.total }) }}</span>
|
|
62
62
|
<el-pagination
|
|
63
63
|
background
|
|
64
64
|
small
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
<header class="detail-header">
|
|
81
81
|
<div class="detail-header__title">
|
|
82
82
|
<span class="detail-header__data-source">
|
|
83
|
-
{{ selectedMigration.module || t("system.migration.value.
|
|
83
|
+
{{ selectedMigration.module || t("system.base.migration.value.default_module") }} ·
|
|
84
84
|
{{ selectedMigration.data_source || "default" }}
|
|
85
85
|
</span>
|
|
86
86
|
<div class="detail-header__version">
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
<section v-if="selectedMigration.description" class="detail-section">
|
|
98
98
|
<div class="detail-section__title">
|
|
99
99
|
<el-icon><Document /></el-icon>
|
|
100
|
-
<span>{{ t("system.migration.section.description") }}</span>
|
|
100
|
+
<span>{{ t("system.base.migration.section.description") }}</span>
|
|
101
101
|
</div>
|
|
102
102
|
<MarkdownPreview
|
|
103
103
|
class="migration-markdown"
|
|
@@ -110,26 +110,26 @@
|
|
|
110
110
|
<section v-if="selectedMigration.up_sql || selectedMigration.down_sql" class="detail-section">
|
|
111
111
|
<div class="detail-section__title">
|
|
112
112
|
<el-icon><Files /></el-icon>
|
|
113
|
-
<span>{{ t("system.migration.section.sql") }}</span>
|
|
113
|
+
<span>{{ t("system.base.migration.section.sql") }}</span>
|
|
114
114
|
</div>
|
|
115
115
|
<el-collapse class="release-sql">
|
|
116
116
|
<el-collapse-item v-if="selectedMigration.up_sql" name="up">
|
|
117
117
|
<template #title>
|
|
118
118
|
<span class="sql-title">
|
|
119
119
|
<el-icon><DocumentAdd /></el-icon>
|
|
120
|
-
<span>{{ t("system.migration.field.
|
|
120
|
+
<span>{{ t("system.base.migration.field.up_script") }}</span>
|
|
121
121
|
<code>up.sql</code>
|
|
122
122
|
</span>
|
|
123
123
|
</template>
|
|
124
124
|
<div class="sql-panel">
|
|
125
125
|
<pre class="sql-code"><code>{{ selectedMigration.up_sql }}</code></pre>
|
|
126
|
-
<el-tooltip :content="t('system.migration.action.
|
|
126
|
+
<el-tooltip :content="t('system.base.migration.action.copy_up_script')" placement="top">
|
|
127
127
|
<el-button
|
|
128
128
|
class="sql-copy"
|
|
129
129
|
text
|
|
130
130
|
circle
|
|
131
131
|
:icon="CopyDocument"
|
|
132
|
-
:aria-label="t('system.migration.action.
|
|
132
|
+
:aria-label="t('system.base.migration.action.copy_up_script')"
|
|
133
133
|
@click.stop="copySql(selectedMigration.up_sql)"
|
|
134
134
|
/>
|
|
135
135
|
</el-tooltip>
|
|
@@ -139,19 +139,19 @@
|
|
|
139
139
|
<template #title>
|
|
140
140
|
<span class="sql-title">
|
|
141
141
|
<el-icon><DocumentRemove /></el-icon>
|
|
142
|
-
<span>{{ t("system.migration.field.
|
|
142
|
+
<span>{{ t("system.base.migration.field.down_script") }}</span>
|
|
143
143
|
<code>down.sql</code>
|
|
144
144
|
</span>
|
|
145
145
|
</template>
|
|
146
146
|
<div class="sql-panel">
|
|
147
147
|
<pre class="sql-code"><code>{{ selectedMigration.down_sql }}</code></pre>
|
|
148
|
-
<el-tooltip :content="t('system.migration.action.
|
|
148
|
+
<el-tooltip :content="t('system.base.migration.action.copy_down_script')" placement="top">
|
|
149
149
|
<el-button
|
|
150
150
|
class="sql-copy"
|
|
151
151
|
text
|
|
152
152
|
circle
|
|
153
153
|
:icon="CopyDocument"
|
|
154
|
-
:aria-label="t('system.migration.action.
|
|
154
|
+
:aria-label="t('system.base.migration.action.copy_down_script')"
|
|
155
155
|
@click.stop="copySql(selectedMigration.down_sql)"
|
|
156
156
|
/>
|
|
157
157
|
</el-tooltip>
|
|
@@ -162,12 +162,12 @@
|
|
|
162
162
|
|
|
163
163
|
<div v-if="!hasDetailContent" class="detail-empty">
|
|
164
164
|
<el-icon><Document /></el-icon>
|
|
165
|
-
<span>{{ t("system.migration.message.
|
|
165
|
+
<span>{{ t("system.base.migration.message.empty_detail") }}</span>
|
|
166
166
|
</div>
|
|
167
167
|
</template>
|
|
168
168
|
</div>
|
|
169
169
|
</template>
|
|
170
|
-
<el-empty v-else :description="t('system.migration.message.
|
|
170
|
+
<el-empty v-else :description="t('system.base.migration.message.select_record')" />
|
|
171
171
|
</section>
|
|
172
172
|
</section>
|
|
173
173
|
</main>
|
|
@@ -316,9 +316,9 @@ function handleCurrentPageChange(page: number) {
|
|
|
316
316
|
async function copySql(sql: string) {
|
|
317
317
|
try {
|
|
318
318
|
await navigator.clipboard.writeText(sql);
|
|
319
|
-
ElMessage.success(t("system.migration.message.
|
|
319
|
+
ElMessage.success(t("system.base.migration.message.copy_success"));
|
|
320
320
|
} catch {
|
|
321
|
-
ElMessage.error(t("system.migration.message.
|
|
321
|
+
ElMessage.error(t("system.base.migration.message.copy_failed"));
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
324
|
|
|
@@ -12,12 +12,11 @@
|
|
|
12
12
|
<FormDialog
|
|
13
13
|
v-model="dialog.visible"
|
|
14
14
|
ref="formDialogRef"
|
|
15
|
-
:title="t(dialog.titleKey, { resource: t('system.post.resource') })"
|
|
15
|
+
:title="t(dialog.titleKey, { resource: t('system.base.post.resource') })"
|
|
16
16
|
width="560px"
|
|
17
17
|
:model="formData"
|
|
18
18
|
:fields="formFields"
|
|
19
19
|
:rules="rules"
|
|
20
|
-
label-width="90px"
|
|
21
20
|
@confirm="handleSubmit"
|
|
22
21
|
@close="handleCloseDialog"
|
|
23
22
|
/>
|
|
@@ -60,7 +59,7 @@ const proTable = ref<ProTableInstance>();
|
|
|
60
59
|
const formDialogRef = ref<InstanceType<typeof FormDialog>>();
|
|
61
60
|
|
|
62
61
|
const dialog = reactive({
|
|
63
|
-
titleKey: "
|
|
62
|
+
titleKey: "common.action.create_resource",
|
|
64
63
|
visible: false
|
|
65
64
|
});
|
|
66
65
|
const tenantOptions = ref<SelectOptionResponse_Option[]>([]);
|
|
@@ -88,46 +87,46 @@ const rules = computed(() => ({
|
|
|
88
87
|
tenant_id: [
|
|
89
88
|
{
|
|
90
89
|
required: true,
|
|
91
|
-
message: t("
|
|
90
|
+
message: t("common.validation.required_select", { field: t("common.field.tenant") }),
|
|
92
91
|
trigger: "change"
|
|
93
92
|
}
|
|
94
93
|
],
|
|
95
94
|
name: [
|
|
96
95
|
{
|
|
97
96
|
required: true,
|
|
98
|
-
message: t("
|
|
97
|
+
message: t("common.validation.required_input", { field: t("system.base.post.field.name") }),
|
|
99
98
|
trigger: "blur"
|
|
100
99
|
},
|
|
101
100
|
{
|
|
102
101
|
max: 30,
|
|
103
|
-
message: t("
|
|
102
|
+
message: t("common.validation.max_length", { field: t("system.base.post.field.name"), max: 30 }),
|
|
104
103
|
trigger: "blur"
|
|
105
104
|
}
|
|
106
105
|
],
|
|
107
106
|
code: [
|
|
108
107
|
{
|
|
109
108
|
required: true,
|
|
110
|
-
message: t("
|
|
109
|
+
message: t("common.validation.required_input", { field: t("system.base.post.field.code") }),
|
|
111
110
|
trigger: "blur"
|
|
112
111
|
},
|
|
113
112
|
{
|
|
114
113
|
max: 20,
|
|
115
|
-
message: t("
|
|
114
|
+
message: t("common.validation.max_length", { field: t("system.base.post.field.code"), max: 20 }),
|
|
116
115
|
trigger: "blur"
|
|
117
116
|
}
|
|
118
117
|
],
|
|
119
|
-
sort: [{ required: true, type: "number", min: 1, message: t("
|
|
118
|
+
sort: [{ required: true, type: "number", min: 1, message: t("common.validation.sort_positive"), trigger: "blur" }],
|
|
120
119
|
status: [
|
|
121
120
|
{
|
|
122
121
|
required: true,
|
|
123
|
-
message: t("
|
|
122
|
+
message: t("common.validation.required_select", { field: t("common.field.status") }),
|
|
124
123
|
trigger: "change"
|
|
125
124
|
}
|
|
126
125
|
],
|
|
127
126
|
remark: [
|
|
128
127
|
{
|
|
129
128
|
max: 500,
|
|
130
|
-
message: t("
|
|
129
|
+
message: t("common.validation.max_length", { field: t("common.field.remark"), max: 500 }),
|
|
131
130
|
trigger: "blur"
|
|
132
131
|
}
|
|
133
132
|
]
|
|
@@ -140,10 +139,10 @@ const isDefaultTenant = computed(() => userStore.userInfo.tenant_code === DEFAUL
|
|
|
140
139
|
const formFields = computed<ProFormField[]>(() => [
|
|
141
140
|
{
|
|
142
141
|
prop: "tenant_id",
|
|
143
|
-
label: t("
|
|
142
|
+
label: t("common.field.tenant"),
|
|
144
143
|
component: "select",
|
|
145
144
|
props: {
|
|
146
|
-
placeholder: t("
|
|
145
|
+
placeholder: t("common.validation.required_select", { field: t("common.field.tenant") }),
|
|
147
146
|
filterable: true,
|
|
148
147
|
disabled: Boolean(formData.id)
|
|
149
148
|
},
|
|
@@ -152,28 +151,28 @@ const formFields = computed<ProFormField[]>(() => [
|
|
|
152
151
|
},
|
|
153
152
|
{
|
|
154
153
|
prop: "name",
|
|
155
|
-
label: t("system.post.field.name"),
|
|
154
|
+
label: t("system.base.post.field.name"),
|
|
156
155
|
component: "input",
|
|
157
|
-
props: { placeholder: t("
|
|
156
|
+
props: { placeholder: t("common.validation.required_input", { field: t("system.base.post.field.name") }) }
|
|
158
157
|
},
|
|
159
158
|
{
|
|
160
159
|
prop: "code",
|
|
161
|
-
label: t("system.post.field.code"),
|
|
160
|
+
label: t("system.base.post.field.code"),
|
|
162
161
|
component: "input",
|
|
163
|
-
props: { placeholder: t("
|
|
162
|
+
props: { placeholder: t("common.validation.required_input", { field: t("system.base.post.field.code") }) }
|
|
164
163
|
},
|
|
165
164
|
{
|
|
166
165
|
prop: "sort",
|
|
167
|
-
label: t("
|
|
166
|
+
label: t("common.field.sort"),
|
|
168
167
|
component: "input-number",
|
|
169
168
|
props: { min: 1, precision: 0, step: 1, controlsPosition: "right", style: { width: "100%" } }
|
|
170
169
|
},
|
|
171
|
-
{ prop: "status", label: t("
|
|
170
|
+
{ prop: "status", label: t("common.field.status"), component: "radio-group", options: statusOptions.value },
|
|
172
171
|
{
|
|
173
172
|
prop: "remark",
|
|
174
|
-
label: t("
|
|
173
|
+
label: t("common.field.remark"),
|
|
175
174
|
component: "textarea",
|
|
176
|
-
props: { placeholder: t("
|
|
175
|
+
props: { placeholder: t("common.placeholder.remark") }
|
|
177
176
|
}
|
|
178
177
|
]);
|
|
179
178
|
|
|
@@ -184,7 +183,7 @@ const columns = computed<ColumnProps[]>(() => [
|
|
|
184
183
|
? ([
|
|
185
184
|
{
|
|
186
185
|
prop: "tenant_id",
|
|
187
|
-
label: t("
|
|
186
|
+
label: t("common.field.tenant"),
|
|
188
187
|
minWidth: 140,
|
|
189
188
|
showOverflowTooltip: true,
|
|
190
189
|
search: { el: "select", key: "tenant_id", props: { filterable: true }, order: 1 },
|
|
@@ -192,12 +191,12 @@ const columns = computed<ColumnProps[]>(() => [
|
|
|
192
191
|
}
|
|
193
192
|
] satisfies ColumnProps[])
|
|
194
193
|
: []),
|
|
195
|
-
{ prop: "name", label: t("system.post.field.name"), minWidth: 140, search: { el: "input" } },
|
|
196
|
-
{ prop: "code", label: t("system.post.field.code"), minWidth: 140, search: { el: "input" } },
|
|
197
|
-
{ prop: "sort", label: t("
|
|
194
|
+
{ prop: "name", label: t("system.base.post.field.name"), minWidth: 140, search: { el: "input" } },
|
|
195
|
+
{ prop: "code", label: t("system.base.post.field.code"), minWidth: 140, search: { el: "input" } },
|
|
196
|
+
{ prop: "sort", label: t("common.field.sort"), minWidth: 90, align: "right" },
|
|
198
197
|
{
|
|
199
198
|
prop: "status",
|
|
200
|
-
label: t("
|
|
199
|
+
label: t("common.field.status"),
|
|
201
200
|
minWidth: 100,
|
|
202
201
|
search: { el: "select" },
|
|
203
202
|
cellType: "status",
|
|
@@ -210,12 +209,12 @@ const columns = computed<ColumnProps[]>(() => [
|
|
|
210
209
|
beforeChange: scope => handleBeforeSetStatus(scope.row as BasePost)
|
|
211
210
|
}
|
|
212
211
|
},
|
|
213
|
-
{ prop: "remark", label: t("
|
|
214
|
-
{ prop: "created_at", label: t("
|
|
215
|
-
{ prop: "updated_at", label: t("
|
|
212
|
+
{ prop: "remark", label: t("common.field.remark"), minWidth: 160 },
|
|
213
|
+
{ prop: "created_at", label: t("common.field.created_at"), minWidth: 180 },
|
|
214
|
+
{ prop: "updated_at", label: t("common.field.updated_at"), minWidth: 180 },
|
|
216
215
|
{
|
|
217
216
|
prop: "operation",
|
|
218
|
-
label: t("
|
|
217
|
+
label: t("common.field.operation"),
|
|
219
218
|
width: 180,
|
|
220
219
|
fixed: "right",
|
|
221
220
|
cellType: "actions",
|
|
@@ -285,7 +284,7 @@ async function loadTenantOptions() {
|
|
|
285
284
|
async function handleOpenDialog(id?: number) {
|
|
286
285
|
resetForm();
|
|
287
286
|
await loadTenantOptions();
|
|
288
|
-
dialog.titleKey = id ? "
|
|
287
|
+
dialog.titleKey = id ? "common.action.edit_resource" : "common.action.create_resource";
|
|
289
288
|
dialog.visible = true;
|
|
290
289
|
if (id) Object.assign(formData, await defBasePostService.GetBasePost({ id }));
|
|
291
290
|
}
|
|
@@ -319,8 +318,8 @@ function handleSubmit() {
|
|
|
319
318
|
: defBasePostService.CreateBasePost({ base_post: submitData });
|
|
320
319
|
request.then(() => {
|
|
321
320
|
ElMessage.success(
|
|
322
|
-
t(submitData.id ? "
|
|
323
|
-
resource: t("system.post.resource")
|
|
321
|
+
t(submitData.id ? "common.message.update_success" : "common.message.create_success", {
|
|
322
|
+
resource: t("system.base.post.resource")
|
|
324
323
|
})
|
|
325
324
|
);
|
|
326
325
|
handleCloseDialog();
|
|
@@ -335,10 +334,10 @@ async function handleBeforeSetStatus(row: BasePost) {
|
|
|
335
334
|
const text = t(nextStatus === Status.ENABLE ? "common.status.enabled" : "common.status.disabled");
|
|
336
335
|
try {
|
|
337
336
|
await ElMessageBox.confirm(
|
|
338
|
-
t("
|
|
337
|
+
t("common.dialog.status_change", {
|
|
339
338
|
action: text,
|
|
340
|
-
resource: t("system.post.resource"),
|
|
341
|
-
field: t("system.post.field.name"),
|
|
339
|
+
resource: t("system.base.post.resource"),
|
|
340
|
+
field: t("system.base.post.field.name"),
|
|
342
341
|
value: row.name || row.code || `ID:${row.id}`
|
|
343
342
|
}),
|
|
344
343
|
t("common.title.notice"),
|
|
@@ -349,7 +348,7 @@ async function handleBeforeSetStatus(row: BasePost) {
|
|
|
349
348
|
}
|
|
350
349
|
);
|
|
351
350
|
await defBasePostService.SetBasePostStatus({ id: row.id, status: nextStatus });
|
|
352
|
-
ElMessage.success(t("
|
|
351
|
+
ElMessage.success(t("common.message.status_success", { action: text }));
|
|
353
352
|
refreshTable();
|
|
354
353
|
return true;
|
|
355
354
|
} catch {
|
|
@@ -368,15 +367,15 @@ function handleDelete(selected?: number | string | Array<number | string> | Base
|
|
|
368
367
|
postList.length ? postList.map(item => item.id) : normalizeSelectedIds(selected as number | string | Array<number | string>)
|
|
369
368
|
).join(",");
|
|
370
369
|
if (!postIds) {
|
|
371
|
-
ElMessage.warning(t("
|
|
370
|
+
ElMessage.warning(t("common.message.select_delete_item"));
|
|
372
371
|
return;
|
|
373
372
|
}
|
|
374
373
|
const confirmMessage =
|
|
375
374
|
postList.length === 1
|
|
376
|
-
? `${t("
|
|
375
|
+
? `${t("common.dialog.delete_single", { resource: t("system.base.post.resource") })}\n${t("common.dialog.resource_field", { field: t("system.base.post.field.name"), value: postList[0].name || postList[0].code || `ID:${postList[0].id}` })}`
|
|
377
376
|
: postList.length > 1
|
|
378
|
-
? t("
|
|
379
|
-
: t("
|
|
377
|
+
? t("common.dialog.delete_batch", { count: postList.length, unit: "", resource: t("system.base.post.resource") })
|
|
378
|
+
: t("common.dialog.delete_selected", { resource: t("system.base.post.resource") });
|
|
380
379
|
ElMessageBox.confirm(confirmMessage, t("common.title.warning"), {
|
|
381
380
|
confirmButtonText: t("common.action.confirm"),
|
|
382
381
|
cancelButtonText: t("common.action.cancel"),
|
|
@@ -384,10 +383,10 @@ function handleDelete(selected?: number | string | Array<number | string> | Base
|
|
|
384
383
|
}).then(
|
|
385
384
|
() =>
|
|
386
385
|
defBasePostService.DeleteBasePost({ id: postIds }).then(() => {
|
|
387
|
-
ElMessage.success(t("
|
|
386
|
+
ElMessage.success(t("common.message.delete_success", { resource: t("system.base.post.resource") }));
|
|
388
387
|
refreshTable();
|
|
389
388
|
}),
|
|
390
|
-
() => ElMessage.info(t("
|
|
389
|
+
() => ElMessage.info(t("common.dialog.cancel_delete", { resource: t("system.base.post.resource") }))
|
|
391
390
|
);
|
|
392
391
|
}
|
|
393
392
|
</script>
|