@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
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
:fields="formFields"
|
|
22
22
|
:rules="tableRules"
|
|
23
23
|
:confirm-loading="saving"
|
|
24
|
-
label-width="116px"
|
|
25
24
|
:gutter="16"
|
|
26
25
|
:col-span="12"
|
|
27
26
|
@confirm="handleSubmit"
|
|
@@ -82,7 +81,8 @@ import type {
|
|
|
82
81
|
} from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/code_gen_table";
|
|
83
82
|
import type { BaseMenu } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_menu";
|
|
84
83
|
import type { OptionBaseDictResponse_BaseDictItem } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_dict";
|
|
85
|
-
import { BaseMenuType
|
|
84
|
+
import { BaseMenuType } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/common";
|
|
85
|
+
import { CodeGenTableStatus } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/code_gen_table";
|
|
86
86
|
import { buildPageRequest, normalizeSelectedIds } from "@liujitcn/kratos-admin-core/table";
|
|
87
87
|
import { t } from "@liujitcn/kratos-admin-core";
|
|
88
88
|
import CodeGenProgressDialog from "../components/CodeGenProgressDialog.vue";
|
|
@@ -118,7 +118,7 @@ type CodeGenTableFormState = Omit<CodeGenTableForm, "parent_menu_id"> & {
|
|
|
118
118
|
const codeGenTaskStorageKey = "code-gen-progress-task-id";
|
|
119
119
|
const codeGenProgressDialogVisibleStorageKey = "code-gen-progress-dialog-visible";
|
|
120
120
|
const codeGenProgressSelectedTableIdsStorageKey = "code-gen-progress-selected-table-ids";
|
|
121
|
-
const codeGenStatusDisabled = CodeGenTableStatus.
|
|
121
|
+
const codeGenStatusDisabled = CodeGenTableStatus.CODE_GEN_TABLE_STATUS_DISABLED;
|
|
122
122
|
|
|
123
123
|
const { BUTTONS } = useAuthButtons();
|
|
124
124
|
const router = useRouter();
|
|
@@ -143,7 +143,7 @@ const progressSelectedTableIds = ref<Array<string | number>>(readProgressSelecte
|
|
|
143
143
|
const dialog = reactive({ editing: false, visible: false });
|
|
144
144
|
|
|
145
145
|
const formData = reactive<CodeGenTableFormState>({ ...createDefaultCodeGenTableForm(), parent_menu_id: undefined });
|
|
146
|
-
const dialogTitle = computed(() => t(dialog.editing ? "system.
|
|
146
|
+
const dialogTitle = computed(() => t(dialog.editing ? "system.code.gen.table.title.edit" : "system.code.gen.table.title.create"));
|
|
147
147
|
const tableRules = computed(() => codeGenTableRules());
|
|
148
148
|
const pageTypeOptions = computed(() => codeGenPageTypeOptions());
|
|
149
149
|
|
|
@@ -169,7 +169,7 @@ const businessModuleOptions = computed<ProFormOption[]>(() => {
|
|
|
169
169
|
const options: ProFormOption[] = businessModuleItems.value.map(item => ({ label: item.label, value: item.value }));
|
|
170
170
|
if (formData.business_module && !options.some(item => item.value === formData.business_module)) {
|
|
171
171
|
options.push({
|
|
172
|
-
label: t("system.
|
|
172
|
+
label: t("system.code.gen.table.value.disabled_module", { module: formData.business_module }),
|
|
173
173
|
value: formData.business_module,
|
|
174
174
|
disabled: true
|
|
175
175
|
});
|
|
@@ -188,13 +188,13 @@ const formFields = computed<ProFormField[]>(() => [
|
|
|
188
188
|
// 标签提示与当前生成器的实际读写逻辑保持一致,方便配置时判断影响范围。
|
|
189
189
|
{
|
|
190
190
|
prop: "name",
|
|
191
|
-
label: t("system.
|
|
191
|
+
label: t("system.code.gen.table.field.name"),
|
|
192
192
|
component: "select",
|
|
193
193
|
options: databaseTableOptions.value,
|
|
194
194
|
colSpan: 24,
|
|
195
|
-
labelTooltip: t("system.
|
|
195
|
+
labelTooltip: t("system.code.gen.table.tooltip.name"),
|
|
196
196
|
props: {
|
|
197
|
-
placeholder: t("system.
|
|
197
|
+
placeholder: t("system.code.gen.table.placeholder.database_table"),
|
|
198
198
|
clearable: true,
|
|
199
199
|
filterable: true,
|
|
200
200
|
style: { width: "100%" },
|
|
@@ -203,36 +203,36 @@ const formFields = computed<ProFormField[]>(() => [
|
|
|
203
203
|
},
|
|
204
204
|
{
|
|
205
205
|
prop: "comment",
|
|
206
|
-
label: t("system.
|
|
206
|
+
label: t("system.code.gen.table.field.comment"),
|
|
207
207
|
component: "input",
|
|
208
208
|
colSpan: 24,
|
|
209
|
-
labelTooltip: t("system.
|
|
210
|
-
props: { placeholder: t("system.
|
|
209
|
+
labelTooltip: t("system.code.gen.table.tooltip.comment"),
|
|
210
|
+
props: { placeholder: t("system.code.gen.table.placeholder.comment") }
|
|
211
211
|
},
|
|
212
212
|
{
|
|
213
213
|
prop: "i18n_config",
|
|
214
|
-
label: t("system.
|
|
214
|
+
label: t("system.code.gen.i18n.field.translations"),
|
|
215
215
|
component: "slot",
|
|
216
216
|
slotName: "tableI18nConfig",
|
|
217
217
|
colSpan: 24,
|
|
218
|
-
labelTooltip: t("system.
|
|
218
|
+
labelTooltip: t("system.code.gen.i18n.tooltip.table")
|
|
219
219
|
},
|
|
220
220
|
{
|
|
221
221
|
prop: "business_module",
|
|
222
|
-
label: t("system.
|
|
222
|
+
label: t("system.code.gen.table.field.business_module"),
|
|
223
223
|
component: "select",
|
|
224
224
|
options: businessModuleOptions.value,
|
|
225
|
-
labelTooltip: t("system.
|
|
226
|
-
props: { placeholder: t("system.
|
|
225
|
+
labelTooltip: t("system.code.gen.table.tooltip.business_module"),
|
|
226
|
+
props: { placeholder: t("system.code.gen.table.placeholder.business_module"), filterable: true, style: { width: "100%" } }
|
|
227
227
|
},
|
|
228
228
|
{
|
|
229
229
|
prop: "parent_menu_id",
|
|
230
|
-
label: t("system.
|
|
230
|
+
label: t("system.code.gen.table.field.parent_menu"),
|
|
231
231
|
component: "tree-select",
|
|
232
232
|
options: parentMenuOptions.value,
|
|
233
|
-
labelTooltip: t("system.
|
|
233
|
+
labelTooltip: t("system.code.gen.table.tooltip.parent_menu"),
|
|
234
234
|
props: {
|
|
235
|
-
placeholder: t("system.
|
|
235
|
+
placeholder: t("system.code.gen.table.placeholder.parent_menu"),
|
|
236
236
|
clearable: true,
|
|
237
237
|
filterable: true,
|
|
238
238
|
checkStrictly: true,
|
|
@@ -242,20 +242,20 @@ const formFields = computed<ProFormField[]>(() => [
|
|
|
242
242
|
},
|
|
243
243
|
{
|
|
244
244
|
prop: "page_type",
|
|
245
|
-
label: t("system.
|
|
245
|
+
label: t("system.code.gen.table.field.page_type"),
|
|
246
246
|
component: "segmented",
|
|
247
247
|
options: pageTypeOptions.value,
|
|
248
|
-
labelTooltip: t("system.
|
|
248
|
+
labelTooltip: t("system.code.gen.table.tooltip.page_type"),
|
|
249
249
|
props: { onChange: handlePageTypeChange }
|
|
250
250
|
},
|
|
251
251
|
{
|
|
252
252
|
prop: "parent_column",
|
|
253
|
-
label: t("system.
|
|
253
|
+
label: t("system.code.gen.table.field.parent_column"),
|
|
254
254
|
component: "select",
|
|
255
255
|
options: databaseColumnOptions.value,
|
|
256
|
-
labelTooltip: t("system.
|
|
256
|
+
labelTooltip: t("system.code.gen.table.tooltip.parent_column"),
|
|
257
257
|
props: {
|
|
258
|
-
placeholder: t("system.
|
|
258
|
+
placeholder: t("system.code.gen.table.placeholder.parent_column"),
|
|
259
259
|
clearable: true,
|
|
260
260
|
filterable: true,
|
|
261
261
|
style: { width: "100%" }
|
|
@@ -264,12 +264,12 @@ const formFields = computed<ProFormField[]>(() => [
|
|
|
264
264
|
},
|
|
265
265
|
{
|
|
266
266
|
prop: "tree_label_column",
|
|
267
|
-
label: t("system.
|
|
267
|
+
label: t("system.code.gen.table.field.tree_label_column"),
|
|
268
268
|
component: "select",
|
|
269
269
|
options: databaseColumnOptions.value,
|
|
270
|
-
labelTooltip: t("system.
|
|
270
|
+
labelTooltip: t("system.code.gen.table.tooltip.tree_label_column"),
|
|
271
271
|
props: {
|
|
272
|
-
placeholder: t("system.
|
|
272
|
+
placeholder: t("system.code.gen.table.placeholder.tree_label_column"),
|
|
273
273
|
clearable: true,
|
|
274
274
|
filterable: true,
|
|
275
275
|
style: { width: "100%" }
|
|
@@ -278,12 +278,12 @@ const formFields = computed<ProFormField[]>(() => [
|
|
|
278
278
|
},
|
|
279
279
|
{
|
|
280
280
|
prop: "left_tree_config.table_name",
|
|
281
|
-
label: t("system.
|
|
281
|
+
label: t("system.code.gen.table.field.left_tree_table"),
|
|
282
282
|
component: "select",
|
|
283
283
|
options: leftTreeTableOptions.value,
|
|
284
|
-
labelTooltip: t("system.
|
|
284
|
+
labelTooltip: t("system.code.gen.table.tooltip.left_tree_table"),
|
|
285
285
|
props: {
|
|
286
|
-
placeholder: t("system.
|
|
286
|
+
placeholder: t("system.code.gen.table.placeholder.left_tree_table"),
|
|
287
287
|
clearable: true,
|
|
288
288
|
filterable: true,
|
|
289
289
|
style: { width: "100%" },
|
|
@@ -293,20 +293,20 @@ const formFields = computed<ProFormField[]>(() => [
|
|
|
293
293
|
},
|
|
294
294
|
{
|
|
295
295
|
prop: "left_tree_config.comment",
|
|
296
|
-
label: t("system.
|
|
296
|
+
label: t("system.code.gen.table.field.left_tree_comment"),
|
|
297
297
|
component: "input",
|
|
298
|
-
labelTooltip: t("system.
|
|
299
|
-
props: { placeholder: t("system.
|
|
298
|
+
labelTooltip: t("system.code.gen.table.tooltip.left_tree_comment"),
|
|
299
|
+
props: { placeholder: t("system.code.gen.table.placeholder.left_tree_comment") },
|
|
300
300
|
visible: model => model.page_type === "left_tree"
|
|
301
301
|
},
|
|
302
302
|
{
|
|
303
303
|
prop: "left_tree_config.filter_column",
|
|
304
|
-
label: t("system.
|
|
305
|
-
labelTooltip: t("system.
|
|
304
|
+
label: t("system.code.gen.table.field.filter_column"),
|
|
305
|
+
labelTooltip: t("system.code.gen.table.tooltip.filter_column"),
|
|
306
306
|
component: "select",
|
|
307
307
|
options: databaseColumnOptions.value,
|
|
308
308
|
props: {
|
|
309
|
-
placeholder: t("system.
|
|
309
|
+
placeholder: t("system.code.gen.table.placeholder.filter_column"),
|
|
310
310
|
clearable: true,
|
|
311
311
|
filterable: true,
|
|
312
312
|
style: { width: "100%" }
|
|
@@ -315,12 +315,12 @@ const formFields = computed<ProFormField[]>(() => [
|
|
|
315
315
|
},
|
|
316
316
|
{
|
|
317
317
|
prop: "left_tree_config.parent_column",
|
|
318
|
-
label: t("system.
|
|
318
|
+
label: t("system.code.gen.table.field.left_tree_parent_column"),
|
|
319
319
|
component: "select",
|
|
320
320
|
options: leftTreeColumnOptions.value,
|
|
321
|
-
labelTooltip: t("system.
|
|
321
|
+
labelTooltip: t("system.code.gen.table.tooltip.left_tree_parent_column"),
|
|
322
322
|
props: {
|
|
323
|
-
placeholder: t("system.
|
|
323
|
+
placeholder: t("system.code.gen.table.placeholder.left_tree_parent_column"),
|
|
324
324
|
clearable: true,
|
|
325
325
|
filterable: true,
|
|
326
326
|
style: { width: "100%" }
|
|
@@ -329,12 +329,12 @@ const formFields = computed<ProFormField[]>(() => [
|
|
|
329
329
|
},
|
|
330
330
|
{
|
|
331
331
|
prop: "left_tree_config.label_column",
|
|
332
|
-
label: t("system.
|
|
332
|
+
label: t("system.code.gen.table.field.left_tree_label_column"),
|
|
333
333
|
component: "select",
|
|
334
334
|
options: leftTreeColumnOptions.value,
|
|
335
|
-
labelTooltip: t("system.
|
|
335
|
+
labelTooltip: t("system.code.gen.table.tooltip.left_tree_label_column"),
|
|
336
336
|
props: {
|
|
337
|
-
placeholder: t("system.
|
|
337
|
+
placeholder: t("system.code.gen.table.placeholder.left_tree_label_column"),
|
|
338
338
|
clearable: true,
|
|
339
339
|
filterable: true,
|
|
340
340
|
style: { width: "100%" }
|
|
@@ -343,12 +343,12 @@ const formFields = computed<ProFormField[]>(() => [
|
|
|
343
343
|
},
|
|
344
344
|
{
|
|
345
345
|
prop: "left_tree_config.value_column",
|
|
346
|
-
label: t("system.
|
|
346
|
+
label: t("system.code.gen.table.field.left_tree_value_column"),
|
|
347
347
|
component: "select",
|
|
348
348
|
options: leftTreeColumnOptions.value,
|
|
349
|
-
labelTooltip: t("system.
|
|
349
|
+
labelTooltip: t("system.code.gen.table.tooltip.left_tree_value_column"),
|
|
350
350
|
props: {
|
|
351
|
-
placeholder: t("system.
|
|
351
|
+
placeholder: t("system.code.gen.table.placeholder.left_tree_value_column"),
|
|
352
352
|
clearable: true,
|
|
353
353
|
filterable: true,
|
|
354
354
|
style: { width: "100%" }
|
|
@@ -357,64 +357,64 @@ const formFields = computed<ProFormField[]>(() => [
|
|
|
357
357
|
},
|
|
358
358
|
{
|
|
359
359
|
prop: "left_tree_config.lazy",
|
|
360
|
-
label: t("system.
|
|
360
|
+
label: t("system.code.gen.table.field.left_tree_lazy"),
|
|
361
361
|
component: "switch",
|
|
362
|
-
labelTooltip: t("system.
|
|
363
|
-
props: { activeText: t("system.
|
|
362
|
+
labelTooltip: t("system.code.gen.table.tooltip.left_tree_lazy"),
|
|
363
|
+
props: { activeText: t("system.code.gen.value.lazy"), inactiveText: t("system.code.gen.value.eager") },
|
|
364
364
|
visible: model => model.page_type === "left_tree"
|
|
365
365
|
},
|
|
366
366
|
{
|
|
367
367
|
prop: "gen_backend",
|
|
368
|
-
label: t("system.
|
|
368
|
+
label: t("system.code.gen.table.field.gen_backend"),
|
|
369
369
|
component: "switch",
|
|
370
|
-
labelTooltip: t("system.
|
|
370
|
+
labelTooltip: t("system.code.gen.table.tooltip.gen_backend"),
|
|
371
371
|
// 三个生成开关始终从新行开始并排展示。
|
|
372
372
|
rowBreakBefore: true,
|
|
373
373
|
colSpan: 8,
|
|
374
|
-
props: { activeText: t("system.
|
|
374
|
+
props: { activeText: t("system.code.gen.value.generate"), inactiveText: t("system.code.gen.value.skip") }
|
|
375
375
|
},
|
|
376
376
|
{
|
|
377
377
|
prop: "gen_frontend",
|
|
378
|
-
label: t("system.
|
|
378
|
+
label: t("system.code.gen.table.field.gen_frontend"),
|
|
379
379
|
component: "switch",
|
|
380
|
-
labelTooltip: t("system.
|
|
380
|
+
labelTooltip: t("system.code.gen.table.tooltip.gen_frontend"),
|
|
381
381
|
colSpan: 8,
|
|
382
|
-
props: { activeText: t("system.
|
|
382
|
+
props: { activeText: t("system.code.gen.value.generate"), inactiveText: t("system.code.gen.value.skip") }
|
|
383
383
|
},
|
|
384
384
|
{
|
|
385
385
|
prop: "gen_sql",
|
|
386
|
-
label: t("system.
|
|
386
|
+
label: t("system.code.gen.table.field.gen_sql"),
|
|
387
387
|
component: "switch",
|
|
388
388
|
colSpan: 8,
|
|
389
|
-
labelTooltip: t("system.
|
|
390
|
-
props: { activeText: t("system.
|
|
389
|
+
labelTooltip: t("system.code.gen.table.tooltip.gen_sql"),
|
|
390
|
+
props: { activeText: t("system.code.gen.value.generate"), inactiveText: t("system.code.gen.value.skip") }
|
|
391
391
|
},
|
|
392
392
|
{
|
|
393
393
|
prop: "status",
|
|
394
|
-
label: t("system.
|
|
394
|
+
label: t("system.code.gen.table.field.status"),
|
|
395
395
|
component: "dict",
|
|
396
396
|
colSpan: 24,
|
|
397
397
|
props: { code: "code_gen_table_status", codeType: "number", type: "radio" },
|
|
398
|
-
labelTooltip: t("system.
|
|
398
|
+
labelTooltip: t("system.code.gen.table.tooltip.status")
|
|
399
399
|
},
|
|
400
400
|
{
|
|
401
401
|
prop: "remark",
|
|
402
|
-
label: t("system.
|
|
402
|
+
label: t("system.code.gen.table.field.remark"),
|
|
403
403
|
component: "textarea",
|
|
404
404
|
colSpan: 24,
|
|
405
|
-
labelTooltip: t("system.
|
|
406
|
-
props: { placeholder: t("system.
|
|
405
|
+
labelTooltip: t("system.code.gen.table.tooltip.remark"),
|
|
406
|
+
props: { placeholder: t("system.code.gen.table.placeholder.remark"), rows: 3 }
|
|
407
407
|
}
|
|
408
408
|
]);
|
|
409
409
|
|
|
410
410
|
/** 代码生成表配置列表列。 */
|
|
411
411
|
const columns = computed<ColumnProps[]>(() => [
|
|
412
412
|
{ type: "selection", width: 55 },
|
|
413
|
-
{ prop: "name", label: t("system.
|
|
414
|
-
{ prop: "comment", label: t("system.
|
|
413
|
+
{ prop: "name", label: t("system.code.gen.table.field.name"), minWidth: 160, search: { el: "input" } },
|
|
414
|
+
{ prop: "comment", label: t("system.code.gen.table.field.comment"), minWidth: 160, showOverflowTooltip: true },
|
|
415
415
|
{
|
|
416
416
|
prop: "business_module",
|
|
417
|
-
label: t("system.
|
|
417
|
+
label: t("system.code.gen.table.field.business_module"),
|
|
418
418
|
minWidth: 140,
|
|
419
419
|
dictCode: "business_module",
|
|
420
420
|
dictValueType: "string",
|
|
@@ -422,20 +422,20 @@ const columns = computed<ColumnProps[]>(() => [
|
|
|
422
422
|
},
|
|
423
423
|
{
|
|
424
424
|
prop: "page_type",
|
|
425
|
-
label: t("system.
|
|
425
|
+
label: t("system.code.gen.table.field.page_type"),
|
|
426
426
|
minWidth: 120,
|
|
427
427
|
enum: pageTypeOptions.value,
|
|
428
428
|
search: { el: "select" }
|
|
429
429
|
},
|
|
430
430
|
{
|
|
431
431
|
prop: "status",
|
|
432
|
-
label: t("system.
|
|
432
|
+
label: t("system.code.gen.table.field.status"),
|
|
433
433
|
width: 100,
|
|
434
434
|
dictCode: "code_gen_table_status",
|
|
435
435
|
search: { el: "select" }
|
|
436
436
|
},
|
|
437
|
-
{ prop: "remark", label: t("system.
|
|
438
|
-
{ prop: "created_at", label: t("system.
|
|
437
|
+
{ prop: "remark", label: t("system.code.gen.table.field.remark"), minWidth: 180, showOverflowTooltip: true },
|
|
438
|
+
{ prop: "created_at", label: t("system.code.gen.table.field.created_at"), minWidth: 180 },
|
|
439
439
|
{
|
|
440
440
|
prop: "operation",
|
|
441
441
|
label: t("common.field.operation"),
|
|
@@ -444,7 +444,7 @@ const columns = computed<ColumnProps[]>(() => [
|
|
|
444
444
|
cellType: "actions",
|
|
445
445
|
actions: [
|
|
446
446
|
{
|
|
447
|
-
label: t("system.
|
|
447
|
+
label: t("system.code.gen.table.action.columns"),
|
|
448
448
|
type: "success",
|
|
449
449
|
link: true,
|
|
450
450
|
icon: SetUp,
|
|
@@ -452,7 +452,7 @@ const columns = computed<ColumnProps[]>(() => [
|
|
|
452
452
|
onClick: scope => handleOpenColumnConfig((scope.row as CodeGenTable).id)
|
|
453
453
|
},
|
|
454
454
|
{
|
|
455
|
-
label: t("system.
|
|
455
|
+
label: t("system.code.gen.table.action.proto"),
|
|
456
456
|
type: "warning",
|
|
457
457
|
link: true,
|
|
458
458
|
icon: Connection,
|
|
@@ -460,7 +460,7 @@ const columns = computed<ColumnProps[]>(() => [
|
|
|
460
460
|
onClick: scope => handleOpenProtoConfig((scope.row as CodeGenTable).id)
|
|
461
461
|
},
|
|
462
462
|
{
|
|
463
|
-
label: t("system.
|
|
463
|
+
label: t("system.code.gen.table.action.page_preview"),
|
|
464
464
|
type: "primary",
|
|
465
465
|
link: true,
|
|
466
466
|
icon: View,
|
|
@@ -468,7 +468,7 @@ const columns = computed<ColumnProps[]>(() => [
|
|
|
468
468
|
onClick: scope => handleOpenPreview((scope.row as CodeGenTable).id)
|
|
469
469
|
},
|
|
470
470
|
{
|
|
471
|
-
label: t("system.
|
|
471
|
+
label: t("system.code.gen.table.action.code_preview"),
|
|
472
472
|
type: "primary",
|
|
473
473
|
link: true,
|
|
474
474
|
icon: Document,
|
|
@@ -476,7 +476,7 @@ const columns = computed<ColumnProps[]>(() => [
|
|
|
476
476
|
onClick: scope => handleOpenCodePreview((scope.row as CodeGenTable).id)
|
|
477
477
|
},
|
|
478
478
|
{
|
|
479
|
-
label: t("system.
|
|
479
|
+
label: t("system.code.gen.action.generate"),
|
|
480
480
|
type: "success",
|
|
481
481
|
link: true,
|
|
482
482
|
icon: Promotion,
|
|
@@ -485,7 +485,7 @@ const columns = computed<ColumnProps[]>(() => [
|
|
|
485
485
|
onClick: scope => handleGenerate(scope.row as CodeGenTable)
|
|
486
486
|
},
|
|
487
487
|
{
|
|
488
|
-
label: t("system.
|
|
488
|
+
label: t("system.code.gen.action.restore"),
|
|
489
489
|
type: "warning",
|
|
490
490
|
link: true,
|
|
491
491
|
icon: RefreshRight,
|
|
@@ -538,7 +538,7 @@ const headerActions = computed<HeaderActionProps[]>(() => [
|
|
|
538
538
|
onClick: () => handleOpenDialog()
|
|
539
539
|
},
|
|
540
540
|
{
|
|
541
|
-
label: t("system.
|
|
541
|
+
label: t("system.code.gen.action.batch_generate"),
|
|
542
542
|
type: "primary",
|
|
543
543
|
icon: Promotion,
|
|
544
544
|
hidden: () => !BUTTONS.value["tool:code-gen-table:generate"],
|
|
@@ -546,7 +546,7 @@ const headerActions = computed<HeaderActionProps[]>(() => [
|
|
|
546
546
|
onClick: scope => handleGenerate(scope.selectedList as CodeGenTable[])
|
|
547
547
|
},
|
|
548
548
|
{
|
|
549
|
-
label: t("system.
|
|
549
|
+
label: t("system.code.gen.action.batch_restore"),
|
|
550
550
|
type: "warning",
|
|
551
551
|
icon: RefreshRight,
|
|
552
552
|
hidden: () => !BUTTONS.value["tool:code-gen-table:restore"],
|
|
@@ -554,7 +554,7 @@ const headerActions = computed<HeaderActionProps[]>(() => [
|
|
|
554
554
|
onClick: scope => handleRestore(scope.selectedList as CodeGenTable[])
|
|
555
555
|
},
|
|
556
556
|
{
|
|
557
|
-
label: t("system.
|
|
557
|
+
label: t("system.code.gen.action.recent_task"),
|
|
558
558
|
icon: Clock,
|
|
559
559
|
hidden: () => !BUTTONS.value["tool:code-gen-table:generate"],
|
|
560
560
|
disabled: () => !progressTaskAvailable.value,
|
|
@@ -579,18 +579,18 @@ async function handleOpenCodePreview(tableId: number) {
|
|
|
579
579
|
async function handleGenerate(selected: CodeGenGenerateTarget) {
|
|
580
580
|
const tables = Array.isArray(selected) ? selected : [selected];
|
|
581
581
|
if (!tables.length) {
|
|
582
|
-
ElMessage.warning(t("system.
|
|
582
|
+
ElMessage.warning(t("system.code.gen.table.message.select_generate"));
|
|
583
583
|
return;
|
|
584
584
|
}
|
|
585
585
|
const disabledTable = tables.find(table => table.status === codeGenStatusDisabled);
|
|
586
586
|
if (disabledTable) {
|
|
587
|
-
ElMessage.warning(t("system.
|
|
587
|
+
ElMessage.warning(t("system.code.gen.table.message.disabled", { name: disabledTable.name }));
|
|
588
588
|
return;
|
|
589
589
|
}
|
|
590
590
|
const message =
|
|
591
591
|
tables.length === 1
|
|
592
|
-
? t("system.
|
|
593
|
-
: t("system.
|
|
592
|
+
? t("system.code.gen.table.dialog.generate_one", { name: tables[0].name })
|
|
593
|
+
: t("system.code.gen.table.dialog.generate_batch", { count: tables.length });
|
|
594
594
|
try {
|
|
595
595
|
await ElMessageBox.confirm(message, t("common.title.notice"), {
|
|
596
596
|
confirmButtonText: t("common.action.confirm"),
|
|
@@ -622,16 +622,16 @@ async function handleRestore(selected: CodeGenRestoreTarget) {
|
|
|
622
622
|
const tables = Array.isArray(selected) ? selected : [selected];
|
|
623
623
|
const restorableTables = tables.filter(table => table.restore_available);
|
|
624
624
|
if (!restorableTables.length) {
|
|
625
|
-
ElMessage.warning(t("system.
|
|
625
|
+
ElMessage.warning(t("system.code.gen.table.message.select_restore"));
|
|
626
626
|
return;
|
|
627
627
|
}
|
|
628
628
|
const message =
|
|
629
629
|
restorableTables.length === 1
|
|
630
|
-
? t("system.
|
|
631
|
-
: t("system.
|
|
630
|
+
? t("system.code.gen.table.dialog.restore_one", { name: restorableTables[0].name })
|
|
631
|
+
: t("system.code.gen.table.dialog.restore_batch", { count: restorableTables.length });
|
|
632
632
|
try {
|
|
633
633
|
await ElMessageBox.confirm(message, t("common.title.warning"), {
|
|
634
|
-
confirmButtonText: t("system.
|
|
634
|
+
confirmButtonText: t("system.code.gen.action.confirm_restore"),
|
|
635
635
|
cancelButtonText: t("common.action.cancel"),
|
|
636
636
|
type: "warning"
|
|
637
637
|
});
|
|
@@ -639,7 +639,7 @@ async function handleRestore(selected: CodeGenRestoreTarget) {
|
|
|
639
639
|
return;
|
|
640
640
|
}
|
|
641
641
|
await defCodeGenService.RestoreCodeGen({ table_ids: restorableTables.map(table => table.id) });
|
|
642
|
-
ElMessage.success(t("system.
|
|
642
|
+
ElMessage.success(t("system.code.gen.table.message.restore_success"));
|
|
643
643
|
progressSelectedTableIds.value = [];
|
|
644
644
|
proTable.value?.clearSelection();
|
|
645
645
|
refreshTable();
|
|
@@ -801,10 +801,10 @@ async function handleSubmit() {
|
|
|
801
801
|
try {
|
|
802
802
|
if (formData.id) {
|
|
803
803
|
await defCodeGenTableService.UpdateCodeGenTable({ id: formData.id, code_gen_table: payload });
|
|
804
|
-
ElMessage.success(t("system.
|
|
804
|
+
ElMessage.success(t("system.code.gen.table.message.update_success"));
|
|
805
805
|
} else {
|
|
806
806
|
await defCodeGenTableService.CreateCodeGenTable({ code_gen_table: payload });
|
|
807
|
-
ElMessage.success(t("system.
|
|
807
|
+
ElMessage.success(t("system.code.gen.table.message.create_success"));
|
|
808
808
|
}
|
|
809
809
|
handleCloseDialog();
|
|
810
810
|
refreshTable();
|
|
@@ -824,13 +824,13 @@ async function handleDelete(selected?: CodeGenDeleteTarget) {
|
|
|
824
824
|
tableList.length ? tableList.map(item => item.id) : normalizeSelectedIds(selected as number | string | Array<number | string>)
|
|
825
825
|
).join(",");
|
|
826
826
|
if (!tableIds) {
|
|
827
|
-
ElMessage.warning(t("system.
|
|
827
|
+
ElMessage.warning(t("system.code.gen.table.message.select_delete"));
|
|
828
828
|
return;
|
|
829
829
|
}
|
|
830
830
|
const confirmMessage =
|
|
831
831
|
tableList.length === 1
|
|
832
|
-
? t("system.
|
|
833
|
-
: t("system.
|
|
832
|
+
? t("system.code.gen.table.dialog.delete_one", { name: tableList[0].name })
|
|
833
|
+
: t("system.code.gen.table.dialog.delete_batch", { count: tableList.length });
|
|
834
834
|
try {
|
|
835
835
|
await ElMessageBox.confirm(confirmMessage, t("common.title.warning"), {
|
|
836
836
|
confirmButtonText: t("common.action.confirm"),
|
|
@@ -838,11 +838,11 @@ async function handleDelete(selected?: CodeGenDeleteTarget) {
|
|
|
838
838
|
type: "warning"
|
|
839
839
|
});
|
|
840
840
|
} catch {
|
|
841
|
-
ElMessage.info(t("system.
|
|
841
|
+
ElMessage.info(t("system.code.gen.table.message.delete_canceled"));
|
|
842
842
|
return;
|
|
843
843
|
}
|
|
844
844
|
await defCodeGenTableService.DeleteCodeGenTable({ ids: tableIds });
|
|
845
|
-
ElMessage.success(t("system.
|
|
845
|
+
ElMessage.success(t("system.code.gen.table.message.delete_success"));
|
|
846
846
|
refreshTable();
|
|
847
847
|
}
|
|
848
848
|
|
|
@@ -884,7 +884,7 @@ function resolveDefaultColumn(columns: CodeGenDatabaseColumn[], columnName: stri
|
|
|
884
884
|
/** 转换菜单树为 ProForm 树形选择项。 */
|
|
885
885
|
function convertMenuOptions(options: BaseMenu[]): ProFormOption[] {
|
|
886
886
|
return options
|
|
887
|
-
.filter(item => item.type === BaseMenuType.
|
|
887
|
+
.filter(item => item.type === BaseMenuType.BASE_MENU_TYPE_FOLDER)
|
|
888
888
|
.map(item => ({
|
|
889
889
|
label: item.meta?.title || item.name || item.path,
|
|
890
890
|
value: item.id,
|