@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
|
@@ -12,23 +12,22 @@
|
|
|
12
12
|
<FormDialog
|
|
13
13
|
v-model="dialog.visible"
|
|
14
14
|
ref="formDialogRef"
|
|
15
|
-
:title="t(dialog.editing ? 'system.role.action.edit' : 'system.role.action.create')"
|
|
15
|
+
:title="t(dialog.editing ? 'system.base.role.action.edit' : 'system.base.role.action.create')"
|
|
16
16
|
width="500px"
|
|
17
17
|
:model="formData"
|
|
18
18
|
:fields="formFields"
|
|
19
19
|
:rules="rules"
|
|
20
|
-
label-width="100px"
|
|
21
20
|
@confirm="handleSubmit"
|
|
22
21
|
@close="handleCloseDialog"
|
|
23
22
|
/>
|
|
24
23
|
|
|
25
24
|
<el-drawer
|
|
26
25
|
v-model="assignPermDialogVisible"
|
|
27
|
-
:title="t('system.role.title.
|
|
26
|
+
:title="t('system.base.role.title.assign_permission', { name: checkedBaseRole.name || '' })"
|
|
28
27
|
size="500"
|
|
29
28
|
>
|
|
30
29
|
<div class="perm-toolbar">
|
|
31
|
-
<el-input v-model="permKeywords" clearable class="perm-search" :placeholder="t('system.role.placeholder.
|
|
30
|
+
<el-input v-model="permKeywords" clearable class="perm-search" :placeholder="t('system.base.role.placeholder.menu_permission')">
|
|
32
31
|
<template #prefix>
|
|
33
32
|
<Search />
|
|
34
33
|
</template>
|
|
@@ -36,21 +35,21 @@
|
|
|
36
35
|
|
|
37
36
|
<div class="perm-toolbar__actions">
|
|
38
37
|
<div class="perm-toolbar__group">
|
|
39
|
-
<span class="perm-toolbar__label">{{ t("system.role.field.
|
|
38
|
+
<span class="perm-toolbar__label">{{ t("system.base.role.field.tree_operation") }}</span>
|
|
40
39
|
<el-button type="primary" size="small" plain class="perm-toolbar__button" @click="togglePermTree">
|
|
41
40
|
<template #icon>
|
|
42
41
|
<Switch />
|
|
43
42
|
</template>
|
|
44
|
-
{{ t(isExpanded ? "system.role.action.
|
|
43
|
+
{{ t(isExpanded ? "system.base.role.action.collapse_nodes" : "system.base.role.action.expand_nodes") }}
|
|
45
44
|
</el-button>
|
|
46
45
|
</div>
|
|
47
46
|
<div class="perm-toolbar__group perm-toolbar__group--linkage">
|
|
48
|
-
<span class="perm-toolbar__label">{{ t("system.role.field.
|
|
47
|
+
<span class="perm-toolbar__label">{{ t("system.base.role.field.selection_mode") }}</span>
|
|
49
48
|
<el-checkbox v-model="parentChildLinked" @change="handelParentChildLinkedChange">{{
|
|
50
|
-
t("system.role.field.
|
|
49
|
+
t("system.base.role.field.parent_child_linked")
|
|
51
50
|
}}</el-checkbox>
|
|
52
51
|
<el-tooltip placement="bottom">
|
|
53
|
-
<template #content>{{ t("system.role.message.
|
|
52
|
+
<template #content>{{ t("system.base.role.message.parent_child_linked_tip") }}</template>
|
|
54
53
|
<el-icon class="perm-linkage__icon">
|
|
55
54
|
<QuestionFilled />
|
|
56
55
|
</el-icon>
|
|
@@ -164,52 +163,52 @@ const rules = computed(() => ({
|
|
|
164
163
|
tenant_id: [
|
|
165
164
|
{
|
|
166
165
|
required: true,
|
|
167
|
-
message: t("
|
|
166
|
+
message: t("common.validation.required_select", { field: t("system.base.role.field.tenant") }),
|
|
168
167
|
trigger: "change"
|
|
169
168
|
}
|
|
170
169
|
],
|
|
171
170
|
name: [
|
|
172
171
|
{
|
|
173
172
|
required: true,
|
|
174
|
-
message: t("
|
|
173
|
+
message: t("common.validation.required_input", { field: t("system.base.role.field.name") }),
|
|
175
174
|
trigger: "blur"
|
|
176
175
|
},
|
|
177
176
|
{
|
|
178
177
|
max: 30,
|
|
179
|
-
message: t("
|
|
178
|
+
message: t("common.validation.max_length", { field: t("system.base.role.field.name"), max: 30 }),
|
|
180
179
|
trigger: "blur"
|
|
181
180
|
}
|
|
182
181
|
],
|
|
183
182
|
code: [
|
|
184
183
|
{
|
|
185
184
|
required: true,
|
|
186
|
-
message: t("
|
|
185
|
+
message: t("common.validation.required_input", { field: t("system.base.role.field.code") }),
|
|
187
186
|
trigger: "blur"
|
|
188
187
|
},
|
|
189
188
|
{
|
|
190
189
|
max: 20,
|
|
191
|
-
message: t("
|
|
190
|
+
message: t("common.validation.max_length", { field: t("system.base.role.field.code"), max: 20 }),
|
|
192
191
|
trigger: "blur"
|
|
193
192
|
}
|
|
194
193
|
],
|
|
195
194
|
data_scope: [
|
|
196
195
|
{
|
|
197
196
|
required: true,
|
|
198
|
-
message: t("
|
|
197
|
+
message: t("common.validation.required_select", { field: t("system.base.role.field.data_scope") }),
|
|
199
198
|
trigger: "change"
|
|
200
199
|
}
|
|
201
200
|
],
|
|
202
201
|
menus: [
|
|
203
202
|
{
|
|
204
203
|
required: true,
|
|
205
|
-
message: t("
|
|
204
|
+
message: t("common.validation.required_select", { field: t("system.base.role.field.menu_permission") }),
|
|
206
205
|
trigger: "change"
|
|
207
206
|
},
|
|
208
207
|
{
|
|
209
208
|
validator: (_rule: unknown, value: unknown, callback: (error?: Error) => void) => {
|
|
210
209
|
const menuIds = Array.isArray(value) ? value : [];
|
|
211
210
|
if (new Set(menuIds).size !== menuIds.length) {
|
|
212
|
-
callback(new Error(t("system.role.validation.
|
|
211
|
+
callback(new Error(t("system.base.role.validation.menu_duplicate")));
|
|
213
212
|
return;
|
|
214
213
|
}
|
|
215
214
|
callback();
|
|
@@ -220,14 +219,14 @@ const rules = computed(() => ({
|
|
|
220
219
|
status: [
|
|
221
220
|
{
|
|
222
221
|
required: true,
|
|
223
|
-
message: t("
|
|
222
|
+
message: t("common.validation.required_select", { field: t("common.field.status") }),
|
|
224
223
|
trigger: "change"
|
|
225
224
|
}
|
|
226
225
|
],
|
|
227
226
|
remark: [
|
|
228
227
|
{
|
|
229
228
|
max: 500,
|
|
230
|
-
message: t("
|
|
229
|
+
message: t("common.validation.max_length", { field: t("common.field.remark"), max: 500 }),
|
|
231
230
|
trigger: "blur"
|
|
232
231
|
}
|
|
233
232
|
]
|
|
@@ -246,10 +245,10 @@ const isDefaultTenant = computed(() => userStore.userInfo.tenant_code === DEFAUL
|
|
|
246
245
|
const formFields = computed<ProFormField[]>(() => [
|
|
247
246
|
{
|
|
248
247
|
prop: "tenant_id",
|
|
249
|
-
label: t("system.role.field.tenant"),
|
|
248
|
+
label: t("system.base.role.field.tenant"),
|
|
250
249
|
component: "select",
|
|
251
250
|
props: {
|
|
252
|
-
placeholder: t("system.role.placeholder.tenant"),
|
|
251
|
+
placeholder: t("system.base.role.placeholder.tenant"),
|
|
253
252
|
filterable: true,
|
|
254
253
|
disabled: Boolean(formData.id),
|
|
255
254
|
onChange: handleFormTenantChange
|
|
@@ -259,20 +258,20 @@ const formFields = computed<ProFormField[]>(() => [
|
|
|
259
258
|
},
|
|
260
259
|
{
|
|
261
260
|
prop: "name",
|
|
262
|
-
label: t("system.role.field.name"),
|
|
261
|
+
label: t("system.base.role.field.name"),
|
|
263
262
|
component: "input",
|
|
264
|
-
props: { placeholder: t("system.role.placeholder.name") }
|
|
263
|
+
props: { placeholder: t("system.base.role.placeholder.name") }
|
|
265
264
|
},
|
|
266
265
|
{
|
|
267
266
|
prop: "code",
|
|
268
|
-
label: t("system.role.field.code"),
|
|
267
|
+
label: t("system.base.role.field.code"),
|
|
269
268
|
component: "input",
|
|
270
|
-
props: { placeholder: t("system.role.placeholder.code"), disabled: Boolean(formData.id && formData.code === "tenant") }
|
|
269
|
+
props: { placeholder: t("system.base.role.placeholder.code"), disabled: Boolean(formData.id && formData.code === "tenant") }
|
|
271
270
|
},
|
|
272
|
-
{ prop: "data_scope", label: t("system.role.field.
|
|
271
|
+
{ prop: "data_scope", label: t("system.base.role.field.data_scope"), component: "dict", props: { code: "base_role_data_scope" } },
|
|
273
272
|
{
|
|
274
273
|
prop: "menus",
|
|
275
|
-
label: t("system.role.field.
|
|
274
|
+
label: t("system.base.role.field.menu_permission"),
|
|
276
275
|
component: "tree-select",
|
|
277
276
|
options: menuPermOptions.value as unknown as ProFormOption[],
|
|
278
277
|
props: {
|
|
@@ -287,13 +286,13 @@ const formFields = computed<ProFormField[]>(() => [
|
|
|
287
286
|
},
|
|
288
287
|
{
|
|
289
288
|
prop: "remark",
|
|
290
|
-
label: t("
|
|
289
|
+
label: t("common.field.remark"),
|
|
291
290
|
component: "textarea",
|
|
292
|
-
props: { placeholder: t("
|
|
291
|
+
props: { placeholder: t("common.placeholder.remark") }
|
|
293
292
|
},
|
|
294
293
|
{
|
|
295
294
|
prop: "status",
|
|
296
|
-
label: t("
|
|
295
|
+
label: t("common.field.status"),
|
|
297
296
|
component: "radio-group",
|
|
298
297
|
options: statusOptions.value,
|
|
299
298
|
props: { disabled: isRoleProtected(formData.code) }
|
|
@@ -307,7 +306,7 @@ const columns = computed<ColumnProps[]>(() => [
|
|
|
307
306
|
? ([
|
|
308
307
|
{
|
|
309
308
|
prop: "tenant_id",
|
|
310
|
-
label: t("system.role.field.
|
|
309
|
+
label: t("system.base.role.field.tenant_short"),
|
|
311
310
|
minWidth: 140,
|
|
312
311
|
showOverflowTooltip: true,
|
|
313
312
|
search: { el: "select", key: "tenant_id", props: { filterable: true }, order: 1 },
|
|
@@ -315,19 +314,19 @@ const columns = computed<ColumnProps[]>(() => [
|
|
|
315
314
|
}
|
|
316
315
|
] satisfies ColumnProps[])
|
|
317
316
|
: []),
|
|
318
|
-
{ prop: "name", label: t("system.role.field.name"), minWidth: 140, search: { el: "input" } },
|
|
319
|
-
{ prop: "code", label: t("system.role.field.code"), minWidth: 160, search: { el: "input" } },
|
|
317
|
+
{ prop: "name", label: t("system.base.role.field.name"), minWidth: 140, search: { el: "input" } },
|
|
318
|
+
{ prop: "code", label: t("system.base.role.field.code"), minWidth: 160, search: { el: "input" } },
|
|
320
319
|
{
|
|
321
320
|
prop: "data_scope",
|
|
322
|
-
label: t("system.role.field.
|
|
321
|
+
label: t("system.base.role.field.data_scope"),
|
|
323
322
|
minWidth: 120,
|
|
324
323
|
dictCode: "base_role_data_scope",
|
|
325
324
|
search: { el: "select" }
|
|
326
325
|
},
|
|
327
|
-
{ prop: "remark", label: t("
|
|
326
|
+
{ prop: "remark", label: t("common.field.remark"), minWidth: 160 },
|
|
328
327
|
{
|
|
329
328
|
prop: "status",
|
|
330
|
-
label: t("
|
|
329
|
+
label: t("common.field.status"),
|
|
331
330
|
minWidth: 100,
|
|
332
331
|
search: { el: "select" },
|
|
333
332
|
cellType: "status",
|
|
@@ -340,17 +339,17 @@ const columns = computed<ColumnProps[]>(() => [
|
|
|
340
339
|
beforeChange: scope => handleBeforeSetStatus(scope.row as BaseRole)
|
|
341
340
|
}
|
|
342
341
|
},
|
|
343
|
-
{ prop: "created_at", label: t("
|
|
344
|
-
{ prop: "updated_at", label: t("
|
|
342
|
+
{ prop: "created_at", label: t("common.field.created_at"), minWidth: 180 },
|
|
343
|
+
{ prop: "updated_at", label: t("common.field.updated_at"), minWidth: 180 },
|
|
345
344
|
{
|
|
346
345
|
prop: "operation",
|
|
347
|
-
label: t("
|
|
346
|
+
label: t("common.field.action"),
|
|
348
347
|
width: 280,
|
|
349
348
|
fixed: "right",
|
|
350
349
|
cellType: "actions",
|
|
351
350
|
actions: [
|
|
352
351
|
{
|
|
353
|
-
label: t("system.role.action.
|
|
352
|
+
label: t("system.base.role.action.assign_permission"),
|
|
354
353
|
type: "primary",
|
|
355
354
|
link: true,
|
|
356
355
|
icon: Position,
|
|
@@ -504,7 +503,7 @@ function handleSubmit() {
|
|
|
504
503
|
? defBaseRoleService.UpdateBaseRole({ base_role: submitData })
|
|
505
504
|
: defBaseRoleService.CreateBaseRole({ base_role: submitData });
|
|
506
505
|
request.then(() => {
|
|
507
|
-
ElMessage.success(t(submitData.id ? "system.role.message.
|
|
506
|
+
ElMessage.success(t(submitData.id ? "system.base.role.message.update_success" : "system.base.role.message.create_success"));
|
|
508
507
|
handleCloseDialog();
|
|
509
508
|
refreshTable();
|
|
510
509
|
});
|
|
@@ -538,7 +537,7 @@ function canDeleteRole(row?: BaseRole) {
|
|
|
538
537
|
*/
|
|
539
538
|
async function handleBeforeSetStatus(row: BaseRole) {
|
|
540
539
|
if (!canChangeRoleStatus(row)) {
|
|
541
|
-
ElMessage.warning(t("system.role.message.
|
|
540
|
+
ElMessage.warning(t("system.base.role.message.protected_status"));
|
|
542
541
|
return false;
|
|
543
542
|
}
|
|
544
543
|
|
|
@@ -546,13 +545,13 @@ async function handleBeforeSetStatus(row: BaseRole) {
|
|
|
546
545
|
const action = t(nextStatus === Status.ENABLE ? "common.status.enabled" : "common.status.disabled");
|
|
547
546
|
const roleName = row.name || row.code || `ID:${row.id}`;
|
|
548
547
|
try {
|
|
549
|
-
await ElMessageBox.confirm(t("system.role.message.
|
|
548
|
+
await ElMessageBox.confirm(t("system.base.role.message.confirm_status", { action, name: roleName }), t("common.title.notice"), {
|
|
550
549
|
confirmButtonText: t("common.action.confirm"),
|
|
551
550
|
cancelButtonText: t("common.action.cancel"),
|
|
552
551
|
type: "warning"
|
|
553
552
|
});
|
|
554
553
|
await defBaseRoleService.SetBaseRoleStatus({ id: row.id, status: nextStatus });
|
|
555
|
-
ElMessage.success(t("
|
|
554
|
+
ElMessage.success(t("common.message.status_success", { action }));
|
|
556
555
|
refreshTable();
|
|
557
556
|
return true;
|
|
558
557
|
} catch {
|
|
@@ -570,7 +569,7 @@ function handleDelete(selected?: number | string | Array<number | string> | Base
|
|
|
570
569
|
? [selected as BaseRole]
|
|
571
570
|
: [];
|
|
572
571
|
if (roleList.some(role => !canDeleteRole(role))) {
|
|
573
|
-
ElMessage.warning(t("system.role.message.
|
|
572
|
+
ElMessage.warning(t("system.base.role.message.protected_delete"));
|
|
574
573
|
return;
|
|
575
574
|
}
|
|
576
575
|
|
|
@@ -578,15 +577,15 @@ function handleDelete(selected?: number | string | Array<number | string> | Base
|
|
|
578
577
|
roleList.length ? roleList.map(item => item.id) : normalizeSelectedIds(selected as number | string | Array<number | string>)
|
|
579
578
|
).join(",");
|
|
580
579
|
if (!roleIds) {
|
|
581
|
-
ElMessage.warning(t("
|
|
580
|
+
ElMessage.warning(t("common.message.select_delete_item"));
|
|
582
581
|
return;
|
|
583
582
|
}
|
|
584
583
|
|
|
585
584
|
const confirmMessage = roleList.length
|
|
586
585
|
? roleList.length === 1
|
|
587
|
-
? t("system.role.message.
|
|
588
|
-
: t("system.role.message.
|
|
589
|
-
: t("system.role.message.
|
|
586
|
+
? t("system.base.role.message.confirm_delete_single", { name: roleList[0].name || roleList[0].code || `ID:${roleList[0].id}` })
|
|
587
|
+
: t("system.base.role.message.confirm_delete_batch", { count: roleList.length })
|
|
588
|
+
: t("system.base.role.message.confirm_delete_selected");
|
|
590
589
|
|
|
591
590
|
ElMessageBox.confirm(confirmMessage, t("common.title.warning"), {
|
|
592
591
|
confirmButtonText: t("common.action.confirm"),
|
|
@@ -595,12 +594,12 @@ function handleDelete(selected?: number | string | Array<number | string> | Base
|
|
|
595
594
|
}).then(
|
|
596
595
|
() => {
|
|
597
596
|
defBaseRoleService.DeleteBaseRole({ id: roleIds }).then(() => {
|
|
598
|
-
ElMessage.success(t("system.role.message.
|
|
597
|
+
ElMessage.success(t("system.base.role.message.delete_success"));
|
|
599
598
|
refreshTable();
|
|
600
599
|
});
|
|
601
600
|
},
|
|
602
601
|
() => {
|
|
603
|
-
ElMessage.info(t("system.role.message.
|
|
602
|
+
ElMessage.info(t("system.base.role.message.delete_canceled"));
|
|
604
603
|
}
|
|
605
604
|
);
|
|
606
605
|
}
|
|
@@ -611,7 +610,7 @@ function handleDelete(selected?: number | string | Array<number | string> | Base
|
|
|
611
610
|
async function handleOpenAssignPermDialog(row: BaseRole) {
|
|
612
611
|
if (!row.id) return;
|
|
613
612
|
if (!canManageRole(row)) {
|
|
614
|
-
ElMessage.warning(t("system.role.message.
|
|
613
|
+
ElMessage.warning(t("system.base.role.message.protected_permission"));
|
|
615
614
|
return;
|
|
616
615
|
}
|
|
617
616
|
checkedBaseRole.value = { id: row.id, name: row.name };
|
|
@@ -632,15 +631,15 @@ function handleAssignPermSubmit() {
|
|
|
632
631
|
const checkedNodes = (permTreeRef.value?.getCheckedNodes(false, true) as Array<{ value: number }> | undefined) ?? [];
|
|
633
632
|
const checkedMenuIds = checkedNodes.map(node => Number(node.value));
|
|
634
633
|
if (!checkedMenuIds.length) {
|
|
635
|
-
ElMessage.warning(t("
|
|
634
|
+
ElMessage.warning(t("common.validation.required_select", { field: t("system.base.role.field.menu_permission") }));
|
|
636
635
|
return;
|
|
637
636
|
}
|
|
638
637
|
if (new Set(checkedMenuIds).size !== checkedMenuIds.length) {
|
|
639
|
-
ElMessage.warning(t("system.role.validation.
|
|
638
|
+
ElMessage.warning(t("system.base.role.validation.menu_duplicate"));
|
|
640
639
|
return;
|
|
641
640
|
}
|
|
642
641
|
defBaseRoleService.SetBaseRoleMenu({ id: roleId, menus: checkedMenuIds }).then(() => {
|
|
643
|
-
ElMessage.success(t("system.role.message.
|
|
642
|
+
ElMessage.success(t("system.base.role.message.assign_success"));
|
|
644
643
|
assignPermDialogVisible.value = false;
|
|
645
644
|
refreshTable();
|
|
646
645
|
});
|
|
@@ -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.tenant.resource') })"
|
|
15
|
+
:title="t(dialog.titleKey, { resource: t('system.base.tenant.resource') })"
|
|
16
16
|
width="780px"
|
|
17
17
|
:model="formData"
|
|
18
18
|
:fields="formFields"
|
|
19
19
|
:rules="rules"
|
|
20
|
-
label-width="100px"
|
|
21
20
|
@confirm="handleSubmit"
|
|
22
21
|
@close="handleCloseDialog"
|
|
23
22
|
/>
|
|
@@ -53,7 +52,7 @@ const proTable = ref<ProTableInstance>();
|
|
|
53
52
|
const formDialogRef = ref<InstanceType<typeof FormDialog>>();
|
|
54
53
|
|
|
55
54
|
const dialog = reactive({
|
|
56
|
-
titleKey: "
|
|
55
|
+
titleKey: "common.action.create_resource",
|
|
57
56
|
visible: false
|
|
58
57
|
});
|
|
59
58
|
|
|
@@ -79,41 +78,41 @@ const rules = computed(() => ({
|
|
|
79
78
|
name: [
|
|
80
79
|
{
|
|
81
80
|
required: true,
|
|
82
|
-
message: t("
|
|
81
|
+
message: t("common.validation.required_input", { field: t("system.base.tenant.field.name") }),
|
|
83
82
|
trigger: "blur"
|
|
84
83
|
},
|
|
85
84
|
{
|
|
86
85
|
max: 100,
|
|
87
|
-
message: t("
|
|
86
|
+
message: t("common.validation.max_length", { field: t("system.base.tenant.field.name"), max: 100 }),
|
|
88
87
|
trigger: "blur"
|
|
89
88
|
}
|
|
90
89
|
],
|
|
91
90
|
contact_name: [
|
|
92
91
|
{
|
|
93
92
|
max: 50,
|
|
94
|
-
message: t("
|
|
93
|
+
message: t("common.validation.max_length", { field: t("system.base.tenant.field.contact_name"), max: 50 }),
|
|
95
94
|
trigger: "blur"
|
|
96
95
|
}
|
|
97
96
|
],
|
|
98
97
|
contact_phone: [
|
|
99
98
|
{
|
|
100
99
|
max: 20,
|
|
101
|
-
message: t("
|
|
100
|
+
message: t("common.validation.max_length", { field: t("system.base.tenant.field.contact_phone"), max: 20 }),
|
|
102
101
|
trigger: "blur"
|
|
103
102
|
},
|
|
104
|
-
{ pattern: /^1[3-9]\d{9}$/, message: t("system.tenant.message.
|
|
103
|
+
{ pattern: /^1[3-9]\d{9}$/, message: t("system.base.tenant.message.phone_invalid"), trigger: "blur" }
|
|
105
104
|
],
|
|
106
105
|
status: [
|
|
107
106
|
{
|
|
108
107
|
required: true,
|
|
109
|
-
message: t("
|
|
108
|
+
message: t("common.validation.required_select", { field: t("common.field.status") }),
|
|
110
109
|
trigger: "change"
|
|
111
110
|
}
|
|
112
111
|
],
|
|
113
112
|
remark: [
|
|
114
113
|
{
|
|
115
114
|
max: 500,
|
|
116
|
-
message: t("
|
|
115
|
+
message: t("common.validation.max_length", { field: t("common.field.remark"), max: 500 }),
|
|
117
116
|
trigger: "blur"
|
|
118
117
|
}
|
|
119
118
|
]
|
|
@@ -128,35 +127,35 @@ const statusOptions = computed<ProFormOption[]>(() => [
|
|
|
128
127
|
const formFields = computed<ProFormField[]>(() => [
|
|
129
128
|
{
|
|
130
129
|
prop: "code",
|
|
131
|
-
label: t("system.tenant.field.code"),
|
|
130
|
+
label: t("system.base.tenant.field.code"),
|
|
132
131
|
component: "input",
|
|
133
132
|
props: { disabled: true },
|
|
134
133
|
visible: model => Boolean(model.id)
|
|
135
134
|
},
|
|
136
135
|
{
|
|
137
136
|
prop: "name",
|
|
138
|
-
label: t("system.tenant.field.name"),
|
|
137
|
+
label: t("system.base.tenant.field.name"),
|
|
139
138
|
component: "input",
|
|
140
|
-
props: { placeholder: t("
|
|
139
|
+
props: { placeholder: t("common.validation.required_input", { field: t("system.base.tenant.field.name") }) }
|
|
141
140
|
},
|
|
142
141
|
{
|
|
143
142
|
prop: "contact_name",
|
|
144
|
-
label: t("system.tenant.field.
|
|
143
|
+
label: t("system.base.tenant.field.contact_name"),
|
|
145
144
|
component: "input",
|
|
146
|
-
props: { placeholder: t("
|
|
145
|
+
props: { placeholder: t("common.validation.required_input", { field: t("system.base.tenant.field.contact_name") }) }
|
|
147
146
|
},
|
|
148
147
|
{
|
|
149
148
|
prop: "contact_phone",
|
|
150
|
-
label: t("system.tenant.field.
|
|
149
|
+
label: t("system.base.tenant.field.contact_phone"),
|
|
151
150
|
component: "input",
|
|
152
|
-
props: { placeholder: t("
|
|
151
|
+
props: { placeholder: t("common.validation.required_input", { field: t("system.base.tenant.field.contact_phone") }) }
|
|
153
152
|
},
|
|
154
|
-
{ prop: "status", label: t("
|
|
153
|
+
{ prop: "status", label: t("common.field.status"), component: "radio-group", options: statusOptions.value },
|
|
155
154
|
{
|
|
156
155
|
prop: "remark",
|
|
157
|
-
label: t("
|
|
156
|
+
label: t("common.field.remark"),
|
|
158
157
|
component: "textarea",
|
|
159
|
-
props: { placeholder: t("
|
|
158
|
+
props: { placeholder: t("common.placeholder.remark"), rows: 3 },
|
|
160
159
|
colSpan: 24
|
|
161
160
|
}
|
|
162
161
|
]);
|
|
@@ -164,13 +163,13 @@ const formFields = computed<ProFormField[]>(() => [
|
|
|
164
163
|
/** 租户表格列配置。 */
|
|
165
164
|
const columns = computed<ColumnProps[]>(() => [
|
|
166
165
|
{ type: "selection", width: 55, selectable: row => !isProtectedManagementTenant(row as BaseTenant) },
|
|
167
|
-
{ prop: "code", label: t("system.tenant.field.code"), minWidth: 140, search: { el: "input", order: 1 } },
|
|
168
|
-
{ prop: "name", label: t("system.tenant.field.name"), minWidth: 160, search: { el: "input", order: 2 } },
|
|
169
|
-
{ prop: "contact_name", label: t("system.tenant.field.
|
|
170
|
-
{ prop: "contact_phone", label: t("system.tenant.field.
|
|
166
|
+
{ prop: "code", label: t("system.base.tenant.field.code"), minWidth: 140, search: { el: "input", order: 1 } },
|
|
167
|
+
{ prop: "name", label: t("system.base.tenant.field.name"), minWidth: 160, search: { el: "input", order: 2 } },
|
|
168
|
+
{ prop: "contact_name", label: t("system.base.tenant.field.contact_name"), minWidth: 120 },
|
|
169
|
+
{ prop: "contact_phone", label: t("system.base.tenant.field.contact_phone"), minWidth: 140 },
|
|
171
170
|
{
|
|
172
171
|
prop: "status",
|
|
173
|
-
label: t("
|
|
172
|
+
label: t("common.field.status"),
|
|
174
173
|
minWidth: 100,
|
|
175
174
|
search: { el: "select" },
|
|
176
175
|
cellType: "status",
|
|
@@ -183,11 +182,11 @@ const columns = computed<ColumnProps[]>(() => [
|
|
|
183
182
|
beforeChange: scope => handleBeforeSetStatus(scope.row as BaseTenant)
|
|
184
183
|
}
|
|
185
184
|
},
|
|
186
|
-
{ prop: "created_at", label: t("
|
|
187
|
-
{ prop: "updated_at", label: t("
|
|
185
|
+
{ prop: "created_at", label: t("common.field.created_at"), minWidth: 180 },
|
|
186
|
+
{ prop: "updated_at", label: t("common.field.updated_at"), minWidth: 180 },
|
|
188
187
|
{
|
|
189
188
|
prop: "operation",
|
|
190
|
-
label: t("
|
|
189
|
+
label: t("common.field.operation"),
|
|
191
190
|
width: 150,
|
|
192
191
|
fixed: "right",
|
|
193
192
|
cellType: "actions",
|
|
@@ -259,7 +258,7 @@ function isProtectedManagementTenant(row?: BaseTenant) {
|
|
|
259
258
|
*/
|
|
260
259
|
async function handleOpenDialog(tenantId?: number) {
|
|
261
260
|
resetForm();
|
|
262
|
-
dialog.titleKey = tenantId ? "
|
|
261
|
+
dialog.titleKey = tenantId ? "common.action.edit_resource" : "common.action.create_resource";
|
|
263
262
|
dialog.visible = true;
|
|
264
263
|
if (!tenantId) return;
|
|
265
264
|
|
|
@@ -303,8 +302,8 @@ function handleSubmit() {
|
|
|
303
302
|
: defBaseTenantService.CreateBaseTenant({ base_tenant: submitData });
|
|
304
303
|
request.then(() => {
|
|
305
304
|
ElMessage.success(
|
|
306
|
-
t(submitData.id ? "
|
|
307
|
-
resource: t("system.tenant.resource")
|
|
305
|
+
t(submitData.id ? "common.message.update_success" : "common.message.create_success", {
|
|
306
|
+
resource: t("system.base.tenant.resource")
|
|
308
307
|
})
|
|
309
308
|
);
|
|
310
309
|
handleCloseDialog();
|
|
@@ -318,7 +317,7 @@ function handleSubmit() {
|
|
|
318
317
|
*/
|
|
319
318
|
async function handleBeforeSetStatus(row: BaseTenant) {
|
|
320
319
|
if (isProtectedManagementTenant(row)) {
|
|
321
|
-
ElMessage.warning(t("system.tenant.message.
|
|
320
|
+
ElMessage.warning(t("system.base.tenant.message.protected_status"));
|
|
322
321
|
return false;
|
|
323
322
|
}
|
|
324
323
|
|
|
@@ -326,10 +325,10 @@ async function handleBeforeSetStatus(row: BaseTenant) {
|
|
|
326
325
|
const text = t(nextStatus === Status.ENABLE ? "common.status.enabled" : "common.status.disabled");
|
|
327
326
|
try {
|
|
328
327
|
await ElMessageBox.confirm(
|
|
329
|
-
t("
|
|
328
|
+
t("common.dialog.status_change", {
|
|
330
329
|
action: text,
|
|
331
|
-
resource: t("system.tenant.resource"),
|
|
332
|
-
field: t("system.tenant.field.name"),
|
|
330
|
+
resource: t("system.base.tenant.resource"),
|
|
331
|
+
field: t("system.base.tenant.field.name"),
|
|
333
332
|
value: row.name || `ID:${row.id}`
|
|
334
333
|
}),
|
|
335
334
|
t("common.title.notice"),
|
|
@@ -340,7 +339,7 @@ async function handleBeforeSetStatus(row: BaseTenant) {
|
|
|
340
339
|
}
|
|
341
340
|
);
|
|
342
341
|
await defBaseTenantService.SetBaseTenantStatus({ id: row.id, status: nextStatus });
|
|
343
|
-
ElMessage.success(t("
|
|
342
|
+
ElMessage.success(t("common.message.status_success", { action: text }));
|
|
344
343
|
refreshTable();
|
|
345
344
|
return true;
|
|
346
345
|
} catch {
|
|
@@ -358,7 +357,7 @@ function handleDelete(selected?: number | string | Array<number | string> | Base
|
|
|
358
357
|
? [selected as BaseTenant]
|
|
359
358
|
: [];
|
|
360
359
|
if (tenantList.some(isProtectedManagementTenant)) {
|
|
361
|
-
ElMessage.warning(t("system.tenant.message.
|
|
360
|
+
ElMessage.warning(t("system.base.tenant.message.protected_delete"));
|
|
362
361
|
return;
|
|
363
362
|
}
|
|
364
363
|
|
|
@@ -368,15 +367,15 @@ function handleDelete(selected?: number | string | Array<number | string> | Base
|
|
|
368
367
|
: normalizeSelectedIds(selected as number | string | Array<number | string>)
|
|
369
368
|
).join(",");
|
|
370
369
|
if (!tenantIds) {
|
|
371
|
-
ElMessage.warning(t("
|
|
370
|
+
ElMessage.warning(t("common.message.select_delete_item"));
|
|
372
371
|
return;
|
|
373
372
|
}
|
|
374
373
|
|
|
375
374
|
const confirmMessage = tenantList.length
|
|
376
375
|
? tenantList.length === 1
|
|
377
|
-
? `${t("
|
|
378
|
-
: t("
|
|
379
|
-
: t("
|
|
376
|
+
? `${t("common.dialog.delete_single", { resource: t("system.base.tenant.resource") })}\n${t("common.dialog.resource_field", { field: t("system.base.tenant.field.name"), value: tenantList[0].name || `ID:${tenantList[0].id}` })}`
|
|
377
|
+
: t("common.dialog.delete_batch", { count: tenantList.length, unit: "", resource: t("system.base.tenant.resource") })
|
|
378
|
+
: t("common.dialog.delete_selected", { resource: t("system.base.tenant.resource") });
|
|
380
379
|
|
|
381
380
|
ElMessageBox.confirm(confirmMessage, t("common.title.warning"), {
|
|
382
381
|
confirmButtonText: t("common.action.confirm"),
|
|
@@ -385,12 +384,12 @@ function handleDelete(selected?: number | string | Array<number | string> | Base
|
|
|
385
384
|
}).then(
|
|
386
385
|
() => {
|
|
387
386
|
defBaseTenantService.DeleteBaseTenant({ id: tenantIds }).then(() => {
|
|
388
|
-
ElMessage.success(t("
|
|
387
|
+
ElMessage.success(t("common.message.delete_success", { resource: t("system.base.tenant.resource") }));
|
|
389
388
|
refreshTable();
|
|
390
389
|
});
|
|
391
390
|
},
|
|
392
391
|
() => {
|
|
393
|
-
ElMessage.info(t("
|
|
392
|
+
ElMessage.info(t("common.dialog.cancel_delete", { resource: t("system.base.tenant.resource") }));
|
|
394
393
|
}
|
|
395
394
|
);
|
|
396
395
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!-- 部门树 -->
|
|
2
2
|
<template>
|
|
3
3
|
<el-card shadow="never">
|
|
4
|
-
<el-input v-model="name" :placeholder="t('system.dept.field.name')" clearable>
|
|
4
|
+
<el-input v-model="name" :placeholder="t('system.base.dept.field.name')" clearable>
|
|
5
5
|
<template #prefix>
|
|
6
6
|
<el-icon><Search /></el-icon>
|
|
7
7
|
</template>
|