@liujitcn/kratos-admin-system 0.0.20 → 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.
Files changed (118) hide show
  1. package/README.md +51 -50
  2. package/dist/package/declarations/src/api/system/base_language.d.ts +52 -0
  3. package/dist/package/declarations/src/api/system/base_translation.d.ts +10 -0
  4. package/dist/package/declarations/src/api/system/code_gen_i18n.d.ts +8 -0
  5. package/dist/package/declarations/src/api/system/ops_monitoring.d.ts +19 -0
  6. package/dist/package/declarations/src/api/system/ops_monitoring_sse.d.ts +12 -0
  7. package/dist/package/declarations/src/components/DynamicTranslationCell.vue.d.ts +16 -0
  8. package/dist/package/declarations/src/components/DynamicTranslationEditor.vue.d.ts +20 -0
  9. package/dist/package/declarations/src/components/dynamicTranslation.d.ts +38 -0
  10. package/dist/package/declarations/src/locales/generated.d.ts +6536 -0
  11. package/dist/package/declarations/src/rpc/base/v1/ai_session.d.ts +12 -2
  12. package/dist/package/declarations/src/rpc/base/v1/ai_tool.d.ts +9 -1
  13. package/dist/package/declarations/src/rpc/base/v1/config.d.ts +35 -0
  14. package/dist/package/declarations/src/rpc/system/admin/v1/auth.d.ts +1 -1
  15. package/dist/package/declarations/src/rpc/system/admin/v1/base_config.d.ts +23 -2
  16. package/dist/package/declarations/src/rpc/system/admin/v1/base_dict.d.ts +9 -0
  17. package/dist/package/declarations/src/rpc/system/admin/v1/base_job.d.ts +9 -1
  18. package/dist/package/declarations/src/rpc/system/admin/v1/base_language.d.ts +119 -0
  19. package/dist/package/declarations/src/rpc/system/admin/v1/base_menu.d.ts +6 -1
  20. package/dist/package/declarations/src/rpc/system/admin/v1/base_migration.d.ts +6 -6
  21. package/dist/package/declarations/src/rpc/system/admin/v1/base_role.d.ts +13 -1
  22. package/dist/package/declarations/src/rpc/system/admin/v1/base_translation.d.ts +75 -0
  23. package/dist/package/declarations/src/rpc/system/admin/v1/base_user.d.ts +11 -1
  24. package/dist/package/declarations/src/rpc/system/admin/v1/code_gen.d.ts +13 -11
  25. package/dist/package/declarations/src/rpc/system/admin/v1/code_gen_column.d.ts +7 -0
  26. package/dist/package/declarations/src/rpc/system/admin/v1/code_gen_table.d.ts +24 -1
  27. package/dist/package/declarations/src/rpc/system/admin/v1/common.d.ts +13 -0
  28. package/dist/package/declarations/src/rpc/system/admin/v1/ops_monitoring.d.ts +222 -0
  29. package/dist/package/declarations/src/views/base/language/index.vue.d.ts +3 -0
  30. package/dist/package/declarations/src/views/tool/code-gen/components/CodeGenLocaleEditor.vue.d.ts +23 -0
  31. package/dist/package/declarations/src/views/tool/code-gen/config.d.ts +7 -7
  32. package/dist/package/declarations/src/views/tool/ops-monitoring/index.vue.d.ts +3 -0
  33. package/dist/package/src/api/base/ai_message.ts +7 -12
  34. package/dist/package/src/api/base/sse.ts +3 -1
  35. package/dist/package/src/api/system/base_language.ts +135 -0
  36. package/dist/package/src/api/system/base_translation.ts +33 -0
  37. package/dist/package/src/api/system/code_gen_column.ts +17 -3
  38. package/dist/package/src/api/system/code_gen_i18n.ts +18 -0
  39. package/dist/package/src/api/system/code_gen_table.ts +12 -4
  40. package/dist/package/src/api/system/ops_monitoring.ts +88 -0
  41. package/dist/package/src/api/system/ops_monitoring_sse.ts +49 -0
  42. package/dist/package/src/components/DynamicTranslationCell.vue +249 -0
  43. package/dist/package/src/components/DynamicTranslationEditor.vue +197 -0
  44. package/dist/package/src/components/dynamicTranslation.ts +66 -0
  45. package/dist/package/src/locales/README.md +30 -0
  46. package/dist/package/src/locales/en-US.json +933 -0
  47. package/dist/package/src/locales/es-ES.json +933 -0
  48. package/dist/package/src/locales/fr-FR.json +933 -0
  49. package/dist/package/src/locales/generated.ts +22 -0
  50. package/dist/package/src/locales/ja-JP.json +933 -0
  51. package/dist/package/src/locales/ko-KR.json +933 -0
  52. package/dist/package/src/locales/zh-CN.json +933 -0
  53. package/dist/package/src/locales/zh-TW.json +933 -0
  54. package/dist/package/src/module.ts +6 -2
  55. package/dist/package/src/rpc/base/v1/ai_session.ts +13 -2
  56. package/dist/package/src/rpc/base/v1/ai_tool.ts +10 -1
  57. package/dist/package/src/rpc/base/v1/config.ts +47 -0
  58. package/dist/package/src/rpc/system/admin/v1/auth.ts +1 -1
  59. package/dist/package/src/rpc/system/admin/v1/base_config.ts +24 -2
  60. package/dist/package/src/rpc/system/admin/v1/base_dict.ts +9 -0
  61. package/dist/package/src/rpc/system/admin/v1/base_job.ts +10 -1
  62. package/dist/package/src/rpc/system/admin/v1/base_language.ts +141 -0
  63. package/dist/package/src/rpc/system/admin/v1/base_menu.ts +6 -1
  64. package/dist/package/src/rpc/system/admin/v1/base_migration.ts +8 -8
  65. package/dist/package/src/rpc/system/admin/v1/base_role.ts +14 -1
  66. package/dist/package/src/rpc/system/admin/v1/base_translation.ts +90 -0
  67. package/dist/package/src/rpc/system/admin/v1/base_user.ts +12 -1
  68. package/dist/package/src/rpc/system/admin/v1/code_gen.ts +16 -12
  69. package/dist/package/src/rpc/system/admin/v1/code_gen_column.ts +8 -0
  70. package/dist/package/src/rpc/system/admin/v1/code_gen_table.ts +27 -1
  71. package/dist/package/src/rpc/system/admin/v1/common.ts +21 -0
  72. package/dist/package/src/rpc/system/admin/v1/ops_monitoring.ts +255 -0
  73. package/dist/package/src/views/ai/chat/components/AiMarkdown.vue +1 -6
  74. package/dist/package/src/views/ai/chat/components/ChatPanel.vue +75 -58
  75. package/dist/package/src/views/ai/chat/components/SessionPanel.vue +20 -9
  76. package/dist/package/src/views/ai/chat/components/XSender.vue +36 -23
  77. package/dist/package/src/views/ai/chat/index.vue +58 -41
  78. package/dist/package/src/views/ai/chat/message.ts +29 -27
  79. package/dist/package/src/views/base/api/index.vue +121 -84
  80. package/dist/package/src/views/base/area/index.vue +81 -32
  81. package/dist/package/src/views/base/config/index.vue +300 -96
  82. package/dist/package/src/views/base/dept/index.vue +110 -62
  83. package/dist/package/src/views/base/dict/index.vue +145 -62
  84. package/dist/package/src/views/base/dict/item.vue +155 -64
  85. package/dist/package/src/views/base/job/index.vue +134 -82
  86. package/dist/package/src/views/base/job/log.vue +24 -25
  87. package/dist/package/src/views/base/language/index.vue +260 -0
  88. package/dist/package/src/views/base/log/index.vue +68 -46
  89. package/dist/package/src/views/base/menu/index.vue +344 -200
  90. package/dist/package/src/views/base/migration/index.vue +49 -29
  91. package/dist/package/src/views/base/post/index.vue +128 -60
  92. package/dist/package/src/views/base/role/index.vue +145 -79
  93. package/dist/package/src/views/base/tenant/index.vue +132 -64
  94. package/dist/package/src/views/base/user/components/dept-tree.vue +2 -1
  95. package/dist/package/src/views/base/user/index.vue +194 -116
  96. package/dist/package/src/views/profile/components/base.vue +45 -28
  97. package/dist/package/src/views/profile/components/password.vue +45 -30
  98. package/dist/package/src/views/profile/components/security.vue +90 -54
  99. package/dist/package/src/views/profile/index.vue +10 -9
  100. package/dist/package/src/views/tool/api-doc/index.vue +6 -2
  101. package/dist/package/src/views/tool/code-gen/code-preview/index.vue +32 -16
  102. package/dist/package/src/views/tool/code-gen/columns/index.vue +382 -273
  103. package/dist/package/src/views/tool/code-gen/columns/option-copy.ts +1 -6
  104. package/dist/package/src/views/tool/code-gen/components/CodeGenLocaleEditor.vue +118 -0
  105. package/dist/package/src/views/tool/code-gen/components/CodeGenProgressDialog.vue +65 -36
  106. package/dist/package/src/views/tool/code-gen/components/CodePreviewPane.vue +8 -5
  107. package/dist/package/src/views/tool/code-gen/config.ts +116 -79
  108. package/dist/package/src/views/tool/code-gen/preview/data.ts +19 -17
  109. package/dist/package/src/views/tool/code-gen/preview/index.vue +96 -59
  110. package/dist/package/src/views/tool/code-gen/proto/index.vue +110 -62
  111. package/dist/package/src/views/tool/code-gen/table/index.vue +201 -121
  112. package/dist/package/src/views/tool/ops-monitoring/index.vue +1175 -0
  113. package/dist/package/src/views/tool/project-doc/index.vue +17 -15
  114. package/package.json +6 -2
  115. package/dist/package/declarations/src/rpc/base/v1/enum.d.ts +0 -43
  116. package/dist/package/declarations/src/rpc/system/common/v1/enum.d.ts +0 -67
  117. package/dist/package/src/rpc/base/v1/enum.ts +0 -54
  118. package/dist/package/src/rpc/system/common/v1/enum.ts +0 -80
@@ -12,12 +12,11 @@
12
12
  <FormDialog
13
13
  v-model="dialog.visible"
14
14
  ref="formDialogRef"
15
- :title="dialog.title"
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
  />
@@ -25,7 +24,7 @@
25
24
  </template>
26
25
 
27
26
  <script setup lang="ts">
28
- import { reactive, ref } from "vue";
27
+ import { computed, reactive, ref } from "vue";
29
28
  import { ElMessage, ElMessageBox } from "element-plus";
30
29
  import { CirclePlus, Delete, EditPen } from "@element-plus/icons-vue";
31
30
  import type { ColumnProps, HeaderActionProps, ProTableInstance } from "@liujitcn/kratos-admin-core/components/ProTable/interface";
@@ -34,9 +33,14 @@ import FormDialog from "@liujitcn/kratos-admin-core/components/Dialog/FormDialog
34
33
  import type { ProFormField, ProFormOption } from "@liujitcn/kratos-admin-core/components/ProForm/interface";
35
34
  import { useAuthButtons } from "@liujitcn/kratos-admin-core/auth";
36
35
  import { defBaseTenantService } from "@liujitcn/kratos-admin-system/api/system/base_tenant";
37
- import type { BaseTenant, BaseTenantForm, PageBaseTenantRequest } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_tenant";
36
+ import type {
37
+ BaseTenant,
38
+ BaseTenantForm,
39
+ PageBaseTenantRequest
40
+ } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_tenant";
38
41
  import { Status } from "@liujitcn/kratos-admin-system/rpc/common/v1/enum";
39
42
  import { buildPageRequest, normalizeSelectedIds } from "@liujitcn/kratos-admin-core/table";
43
+ import { t } from "@liujitcn/kratos-admin-core";
40
44
 
41
45
  defineOptions({
42
46
  name: "BaseTenant",
@@ -48,7 +52,7 @@ const proTable = ref<ProTableInstance>();
48
52
  const formDialogRef = ref<InstanceType<typeof FormDialog>>();
49
53
 
50
54
  const dialog = reactive({
51
- title: "",
55
+ titleKey: "common.action.create_resource",
52
56
  visible: false
53
57
  });
54
58
 
@@ -70,74 +74,125 @@ const formData = reactive<BaseTenantForm>({
70
74
  });
71
75
 
72
76
  /** 租户表单校验规则。 */
73
- const rules = reactive({
77
+ const rules = computed(() => ({
74
78
  name: [
75
- { required: true, message: "请输入租户名称", trigger: "blur" },
76
- { max: 100, message: "租户名称不能超过 100 个字符", trigger: "blur" }
79
+ {
80
+ required: true,
81
+ message: t("common.validation.required_input", { field: t("system.base.tenant.field.name") }),
82
+ trigger: "blur"
83
+ },
84
+ {
85
+ max: 100,
86
+ message: t("common.validation.max_length", { field: t("system.base.tenant.field.name"), max: 100 }),
87
+ trigger: "blur"
88
+ }
89
+ ],
90
+ contact_name: [
91
+ {
92
+ max: 50,
93
+ message: t("common.validation.max_length", { field: t("system.base.tenant.field.contact_name"), max: 50 }),
94
+ trigger: "blur"
95
+ }
77
96
  ],
78
- contact_name: [{ max: 50, message: "联系人不能超过 50 个字符", trigger: "blur" }],
79
97
  contact_phone: [
80
- { max: 20, message: "联系电话不能超过 20 个字符", trigger: "blur" },
81
- { pattern: /^1[3-9]\d{9}$/, message: "请输入正确的联系电话", trigger: "blur" }
98
+ {
99
+ max: 20,
100
+ message: t("common.validation.max_length", { field: t("system.base.tenant.field.contact_phone"), max: 20 }),
101
+ trigger: "blur"
102
+ },
103
+ { pattern: /^1[3-9]\d{9}$/, message: t("system.base.tenant.message.phone_invalid"), trigger: "blur" }
82
104
  ],
83
- status: [{ required: true, message: "请选择状态", trigger: "change" }],
84
- remark: [{ max: 500, message: "备注不能超过 500 个字符", trigger: "blur" }]
85
- });
105
+ status: [
106
+ {
107
+ required: true,
108
+ message: t("common.validation.required_select", { field: t("common.field.status") }),
109
+ trigger: "change"
110
+ }
111
+ ],
112
+ remark: [
113
+ {
114
+ max: 500,
115
+ message: t("common.validation.max_length", { field: t("common.field.remark"), max: 500 }),
116
+ trigger: "blur"
117
+ }
118
+ ]
119
+ }));
86
120
 
87
- const statusOptions: ProFormOption[] = [
88
- { label: "启用", value: Status.ENABLE },
89
- { label: "禁用", value: Status.DISABLE }
90
- ];
121
+ const statusOptions = computed<ProFormOption[]>(() => [
122
+ { label: t("common.status.enabled"), value: Status.ENABLE },
123
+ { label: t("common.status.disabled"), value: Status.DISABLE }
124
+ ]);
91
125
 
92
126
  /** 租户表单字段配置。 */
93
- const formFields: ProFormField[] = [
127
+ const formFields = computed<ProFormField[]>(() => [
94
128
  {
95
129
  prop: "code",
96
- label: "租户编号",
130
+ label: t("system.base.tenant.field.code"),
97
131
  component: "input",
98
132
  props: { disabled: true },
99
133
  visible: model => Boolean(model.id)
100
134
  },
101
- { prop: "name", label: "租户名称", component: "input", props: { placeholder: "请输入租户名称" } },
102
- { prop: "contact_name", label: "联系人", component: "input", props: { placeholder: "请输入联系人" } },
103
- { prop: "contact_phone", label: "联系电话", component: "input", props: { placeholder: "请输入联系电话" } },
104
- { prop: "status", label: "状态", component: "radio-group", options: statusOptions },
105
- { prop: "remark", label: "备注", component: "textarea", props: { placeholder: "请输入备注", rows: 3 }, colSpan: 24 }
106
- ];
135
+ {
136
+ prop: "name",
137
+ label: t("system.base.tenant.field.name"),
138
+ component: "input",
139
+ props: { placeholder: t("common.validation.required_input", { field: t("system.base.tenant.field.name") }) }
140
+ },
141
+ {
142
+ prop: "contact_name",
143
+ label: t("system.base.tenant.field.contact_name"),
144
+ component: "input",
145
+ props: { placeholder: t("common.validation.required_input", { field: t("system.base.tenant.field.contact_name") }) }
146
+ },
147
+ {
148
+ prop: "contact_phone",
149
+ label: t("system.base.tenant.field.contact_phone"),
150
+ component: "input",
151
+ props: { placeholder: t("common.validation.required_input", { field: t("system.base.tenant.field.contact_phone") }) }
152
+ },
153
+ { prop: "status", label: t("common.field.status"), component: "radio-group", options: statusOptions.value },
154
+ {
155
+ prop: "remark",
156
+ label: t("common.field.remark"),
157
+ component: "textarea",
158
+ props: { placeholder: t("common.placeholder.remark"), rows: 3 },
159
+ colSpan: 24
160
+ }
161
+ ]);
107
162
 
108
163
  /** 租户表格列配置。 */
109
- const columns: ColumnProps[] = [
164
+ const columns = computed<ColumnProps[]>(() => [
110
165
  { type: "selection", width: 55, selectable: row => !isProtectedManagementTenant(row as BaseTenant) },
111
- { prop: "code", label: "租户编号", minWidth: 140, search: { el: "input", order: 1 } },
112
- { prop: "name", label: "租户名称", minWidth: 160, search: { el: "input", order: 2 } },
113
- { prop: "contact_name", label: "联系人", minWidth: 120 },
114
- { prop: "contact_phone", label: "联系电话", minWidth: 140 },
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 },
115
170
  {
116
171
  prop: "status",
117
- label: "状态",
172
+ label: t("common.field.status"),
118
173
  minWidth: 100,
119
174
  search: { el: "select" },
120
175
  cellType: "status",
121
176
  statusProps: {
122
177
  activeValue: Status.ENABLE,
123
178
  inactiveValue: Status.DISABLE,
124
- activeText: "启用",
125
- inactiveText: "禁用",
179
+ activeText: t("common.status.enabled"),
180
+ inactiveText: t("common.status.disabled"),
126
181
  disabled: scope => isProtectedManagementTenant(scope.row as BaseTenant) || !BUTTONS.value["base:tenant:status"],
127
182
  beforeChange: scope => handleBeforeSetStatus(scope.row as BaseTenant)
128
183
  }
129
184
  },
130
- { prop: "created_at", label: "创建时间", minWidth: 180 },
131
- { prop: "updated_at", label: "更新时间", minWidth: 180 },
185
+ { prop: "created_at", label: t("common.field.created_at"), minWidth: 180 },
186
+ { prop: "updated_at", label: t("common.field.updated_at"), minWidth: 180 },
132
187
  {
133
188
  prop: "operation",
134
- label: "操作",
189
+ label: t("common.field.operation"),
135
190
  width: 150,
136
191
  fixed: "right",
137
192
  cellType: "actions",
138
193
  actions: [
139
194
  {
140
- label: "编辑",
195
+ label: t("common.action.edit"),
141
196
  type: "primary",
142
197
  link: true,
143
198
  icon: EditPen,
@@ -146,7 +201,7 @@ const columns: ColumnProps[] = [
146
201
  onClick: (scope, params) => handleOpenDialog((params?.tenantId as number | undefined) ?? (scope.row as BaseTenant).id)
147
202
  },
148
203
  {
149
- label: "删除",
204
+ label: t("common.action.delete"),
150
205
  type: "danger",
151
206
  link: true,
152
207
  icon: Delete,
@@ -155,26 +210,26 @@ const columns: ColumnProps[] = [
155
210
  }
156
211
  ]
157
212
  }
158
- ];
213
+ ]);
159
214
 
160
215
  /** 租户顶部按钮配置。 */
161
- const headerActions: HeaderActionProps[] = [
216
+ const headerActions = computed<HeaderActionProps[]>(() => [
162
217
  {
163
- label: "新增",
218
+ label: t("common.action.create"),
164
219
  type: "success",
165
220
  icon: CirclePlus,
166
221
  hidden: () => !BUTTONS.value["base:tenant:create"],
167
222
  onClick: () => handleOpenDialog()
168
223
  },
169
224
  {
170
- label: "删除",
225
+ label: t("common.action.delete"),
171
226
  type: "danger",
172
227
  icon: Delete,
173
228
  hidden: () => !BUTTONS.value["base:tenant:delete"],
174
229
  disabled: scope => !scope.selectedList.length,
175
230
  onClick: scope => handleDelete(scope.selectedList as BaseTenant[])
176
231
  }
177
- ];
232
+ ]);
178
233
 
179
234
  /**
180
235
  * 请求租户列表,并由 ProTable 统一维护分页与搜索参数。
@@ -203,7 +258,7 @@ function isProtectedManagementTenant(row?: BaseTenant) {
203
258
  */
204
259
  async function handleOpenDialog(tenantId?: number) {
205
260
  resetForm();
206
- dialog.title = tenantId ? "修改租户" : "新增租户";
261
+ dialog.titleKey = tenantId ? "common.action.edit_resource" : "common.action.create_resource";
207
262
  dialog.visible = true;
208
263
  if (!tenantId) return;
209
264
 
@@ -246,7 +301,11 @@ function handleSubmit() {
246
301
  ? defBaseTenantService.UpdateBaseTenant({ base_tenant: submitData })
247
302
  : defBaseTenantService.CreateBaseTenant({ base_tenant: submitData });
248
303
  request.then(() => {
249
- ElMessage.success(submitData.id ? "修改租户成功" : "新增租户成功");
304
+ ElMessage.success(
305
+ t(submitData.id ? "common.message.update_success" : "common.message.create_success", {
306
+ resource: t("system.base.tenant.resource")
307
+ })
308
+ );
250
309
  handleCloseDialog();
251
310
  refreshTable();
252
311
  });
@@ -258,20 +317,29 @@ function handleSubmit() {
258
317
  */
259
318
  async function handleBeforeSetStatus(row: BaseTenant) {
260
319
  if (isProtectedManagementTenant(row)) {
261
- ElMessage.warning("默认租户不能修改状态");
320
+ ElMessage.warning(t("system.base.tenant.message.protected_status"));
262
321
  return false;
263
322
  }
264
323
 
265
324
  const nextStatus = row.status === Status.ENABLE ? Status.DISABLE : Status.ENABLE;
266
- const text = nextStatus === Status.ENABLE ? "启用" : "禁用";
325
+ const text = t(nextStatus === Status.ENABLE ? "common.status.enabled" : "common.status.disabled");
267
326
  try {
268
- await ElMessageBox.confirm(`是否确定${text}租户?\n租户名称:${row.name || `ID:${row.id}`}`, "提示", {
269
- confirmButtonText: "确认",
270
- cancelButtonText: "取消",
271
- type: "warning"
272
- });
327
+ await ElMessageBox.confirm(
328
+ t("common.dialog.status_change", {
329
+ action: text,
330
+ resource: t("system.base.tenant.resource"),
331
+ field: t("system.base.tenant.field.name"),
332
+ value: row.name || `ID:${row.id}`
333
+ }),
334
+ t("common.title.notice"),
335
+ {
336
+ confirmButtonText: t("common.action.confirm"),
337
+ cancelButtonText: t("common.action.cancel"),
338
+ type: "warning"
339
+ }
340
+ );
273
341
  await defBaseTenantService.SetBaseTenantStatus({ id: row.id, status: nextStatus });
274
- ElMessage.success(`${text}成功`);
342
+ ElMessage.success(t("common.message.status_success", { action: text }));
275
343
  refreshTable();
276
344
  return true;
277
345
  } catch {
@@ -289,7 +357,7 @@ function handleDelete(selected?: number | string | Array<number | string> | Base
289
357
  ? [selected as BaseTenant]
290
358
  : [];
291
359
  if (tenantList.some(isProtectedManagementTenant)) {
292
- ElMessage.warning("默认租户不能删除");
360
+ ElMessage.warning(t("system.base.tenant.message.protected_delete"));
293
361
  return;
294
362
  }
295
363
 
@@ -299,29 +367,29 @@ function handleDelete(selected?: number | string | Array<number | string> | Base
299
367
  : normalizeSelectedIds(selected as number | string | Array<number | string>)
300
368
  ).join(",");
301
369
  if (!tenantIds) {
302
- ElMessage.warning("请勾选删除项");
370
+ ElMessage.warning(t("common.message.select_delete_item"));
303
371
  return;
304
372
  }
305
373
 
306
374
  const confirmMessage = tenantList.length
307
375
  ? tenantList.length === 1
308
- ? `是否确定删除租户?\n租户名称:${tenantList[0].name || `ID:${tenantList[0].id}`}`
309
- : `确认删除已选中的 ${tenantList.length} 项租户吗?`
310
- : "确认删除已选中的租户吗?";
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") });
311
379
 
312
- ElMessageBox.confirm(confirmMessage, "警告", {
313
- confirmButtonText: "确定",
314
- cancelButtonText: "取消",
380
+ ElMessageBox.confirm(confirmMessage, t("common.title.warning"), {
381
+ confirmButtonText: t("common.action.confirm"),
382
+ cancelButtonText: t("common.action.cancel"),
315
383
  type: "warning"
316
384
  }).then(
317
385
  () => {
318
386
  defBaseTenantService.DeleteBaseTenant({ id: tenantIds }).then(() => {
319
- ElMessage.success("删除租户成功");
387
+ ElMessage.success(t("common.message.delete_success", { resource: t("system.base.tenant.resource") }));
320
388
  refreshTable();
321
389
  });
322
390
  },
323
391
  () => {
324
- ElMessage.info("已取消删除租户");
392
+ ElMessage.info(t("common.dialog.cancel_delete", { resource: t("system.base.tenant.resource") }));
325
393
  }
326
394
  );
327
395
  }
@@ -1,7 +1,7 @@
1
1
  <!-- 部门树 -->
2
2
  <template>
3
3
  <el-card shadow="never">
4
- <el-input v-model="name" placeholder="部门名称" 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>
@@ -27,6 +27,7 @@ import { useVModel } from "@vueuse/core";
27
27
  import { ElTree } from "element-plus";
28
28
  import { defBaseDeptService } from "@liujitcn/kratos-admin-system/api/system/base_dept";
29
29
  import { TreeOptionResponse_Option } from "@liujitcn/kratos-admin-system/rpc/common/v1/common";
30
+ import { t } from "@liujitcn/kratos-admin-core";
30
31
  const props = defineProps({
31
32
  modelValue: {
32
33
  type: [Number],