@liujitcn/kratos-admin-system 0.0.20 → 0.0.21
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/README.md +51 -50
- package/dist/package/declarations/src/api/system/base_language.d.ts +51 -0
- package/dist/package/declarations/src/api/system/base_translation.d.ts +7 -0
- package/dist/package/declarations/src/api/system/code_gen_i18n.d.ts +8 -0
- package/dist/package/declarations/src/components/DynamicTranslationCell.vue.d.ts +39 -0
- package/dist/package/declarations/src/components/DynamicTranslationEditor.vue.d.ts +23 -0
- package/dist/package/declarations/src/components/dynamicTranslation.d.ts +44 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_config.d.ts +5 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_dict.d.ts +79 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_language.d.ts +114 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_menu.d.ts +40 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_translation.d.ts +102 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/code_gen.d.ts +2 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/code_gen_column.d.ts +7 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/code_gen_table.d.ts +13 -0
- package/dist/package/declarations/src/views/tool/code-gen/components/CodeGenLocaleEditor.vue.d.ts +23 -0
- package/dist/package/declarations/src/views/tool/code-gen/config.d.ts +7 -7
- package/dist/package/declarations/src/views/tool/language/index.vue.d.ts +3 -0
- package/dist/package/src/api/base/ai_message.ts +7 -12
- package/dist/package/src/api/base/sse.ts +3 -1
- package/dist/package/src/api/system/base_language.ts +137 -0
- package/dist/package/src/api/system/base_translation.ts +22 -0
- package/dist/package/src/api/system/code_gen_column.ts +17 -3
- package/dist/package/src/api/system/code_gen_i18n.ts +18 -0
- package/dist/package/src/api/system/code_gen_table.ts +12 -4
- package/dist/package/src/components/DynamicTranslationCell.vue +176 -0
- package/dist/package/src/components/DynamicTranslationEditor.vue +166 -0
- package/dist/package/src/components/dynamicTranslation.ts +86 -0
- package/dist/package/src/locales/README.md +28 -0
- package/dist/package/src/locales/en-US.json +929 -0
- package/dist/package/src/locales/es-ES.json +928 -0
- package/dist/package/src/locales/fr-FR.json +928 -0
- package/dist/package/src/locales/ja-JP.json +929 -0
- package/dist/package/src/locales/ko-KR.json +928 -0
- package/dist/package/src/locales/zh-CN.json +929 -0
- package/dist/package/src/locales/zh-TW.json +928 -0
- package/dist/package/src/module.ts +19 -1
- package/dist/package/src/rpc/system/admin/v1/base_config.ts +5 -0
- package/dist/package/src/rpc/system/admin/v1/base_dict.ts +81 -0
- package/dist/package/src/rpc/system/admin/v1/base_language.ts +135 -0
- package/dist/package/src/rpc/system/admin/v1/base_menu.ts +41 -0
- package/dist/package/src/rpc/system/admin/v1/base_translation.ts +117 -0
- package/dist/package/src/rpc/system/admin/v1/code_gen.ts +5 -1
- package/dist/package/src/rpc/system/admin/v1/code_gen_column.ts +8 -0
- package/dist/package/src/rpc/system/admin/v1/code_gen_table.ts +15 -0
- package/dist/package/src/views/ai/chat/components/AiMarkdown.vue +1 -6
- package/dist/package/src/views/ai/chat/components/ChatPanel.vue +70 -53
- package/dist/package/src/views/ai/chat/components/SessionPanel.vue +20 -9
- package/dist/package/src/views/ai/chat/components/XSender.vue +36 -23
- package/dist/package/src/views/ai/chat/index.vue +55 -39
- package/dist/package/src/views/ai/chat/message.ts +18 -17
- package/dist/package/src/views/base/api/index.vue +121 -83
- package/dist/package/src/views/base/area/index.vue +81 -31
- package/dist/package/src/views/base/config/index.vue +272 -78
- package/dist/package/src/views/base/dept/index.vue +110 -61
- package/dist/package/src/views/base/dict/index.vue +137 -58
- package/dist/package/src/views/base/dict/item.vue +147 -61
- package/dist/package/src/views/base/job/index.vue +134 -81
- package/dist/package/src/views/base/job/log.vue +21 -22
- package/dist/package/src/views/base/log/index.vue +68 -46
- package/dist/package/src/views/base/menu/index.vue +257 -156
- package/dist/package/src/views/base/migration/index.vue +49 -29
- package/dist/package/src/views/base/post/index.vue +128 -59
- package/dist/package/src/views/base/role/index.vue +145 -78
- package/dist/package/src/views/base/tenant/index.vue +132 -63
- package/dist/package/src/views/base/user/components/dept-tree.vue +2 -1
- package/dist/package/src/views/base/user/index.vue +192 -112
- package/dist/package/src/views/profile/components/base.vue +44 -27
- package/dist/package/src/views/profile/components/password.vue +43 -27
- package/dist/package/src/views/profile/components/security.vue +89 -53
- package/dist/package/src/views/profile/index.vue +10 -9
- package/dist/package/src/views/tool/api-doc/index.vue +6 -2
- package/dist/package/src/views/tool/code-gen/code-preview/index.vue +30 -14
- package/dist/package/src/views/tool/code-gen/columns/index.vue +382 -273
- package/dist/package/src/views/tool/code-gen/columns/option-copy.ts +1 -6
- package/dist/package/src/views/tool/code-gen/components/CodeGenLocaleEditor.vue +118 -0
- package/dist/package/src/views/tool/code-gen/components/CodeGenProgressDialog.vue +65 -36
- package/dist/package/src/views/tool/code-gen/components/CodePreviewPane.vue +8 -5
- package/dist/package/src/views/tool/code-gen/config.ts +114 -77
- package/dist/package/src/views/tool/code-gen/preview/data.ts +19 -17
- package/dist/package/src/views/tool/code-gen/preview/index.vue +96 -58
- package/dist/package/src/views/tool/code-gen/proto/index.vue +110 -62
- package/dist/package/src/views/tool/code-gen/table/index.vue +197 -117
- package/dist/package/src/views/tool/language/index.vue +256 -0
- package/dist/package/src/views/tool/project-doc/index.vue +17 -15
- package/package.json +6 -2
|
@@ -6,24 +6,24 @@
|
|
|
6
6
|
<div class="code-gen-toolbar">
|
|
7
7
|
<!-- 展示当前 Proto 配置对应的业务表。 -->
|
|
8
8
|
<div class="code-gen-proto-toolbar__meta">
|
|
9
|
-
<span class="code-gen-proto-toolbar__table-name" :title="formData.name"
|
|
9
|
+
<span class="code-gen-proto-toolbar__table-name" :title="formData.name">
|
|
10
|
+
{{ t("system.codegen.column.value.tableName", { name: formData.name }) }}
|
|
11
|
+
</span>
|
|
10
12
|
<span class="code-gen-proto-toolbar__table-comment" :title="formData.comment || '--'">
|
|
11
|
-
|
|
13
|
+
{{ t("system.codegen.column.value.tableComment", { comment: formData.comment || "--" }) }}
|
|
12
14
|
</span>
|
|
13
15
|
</div>
|
|
14
|
-
<el-button type="primary" :icon="Document" :disabled="!canEdit" @click="handleSaveProtoMethods()"
|
|
16
|
+
<el-button type="primary" :icon="Document" :disabled="!canEdit" @click="handleSaveProtoMethods()">
|
|
17
|
+
{{ t("common.action.save") }}
|
|
18
|
+
</el-button>
|
|
15
19
|
</div>
|
|
16
20
|
|
|
17
|
-
<ProTable
|
|
18
|
-
row-key="sort"
|
|
19
|
-
:data="protoChecks"
|
|
20
|
-
:columns="protoColumns"
|
|
21
|
-
:pagination="false"
|
|
22
|
-
:tool-button="false"
|
|
23
|
-
>
|
|
21
|
+
<ProTable row-key="sort" :data="protoChecks" :columns="protoColumns" :pagination="false" :tool-button="false">
|
|
24
22
|
<template #exists="{ row }">
|
|
25
23
|
<div class="code-gen-proto-status">
|
|
26
|
-
<el-tag :type="row.exists ? 'success' : 'warning'">
|
|
24
|
+
<el-tag :type="row.exists ? 'success' : 'warning'">
|
|
25
|
+
{{ t(row.exists ? "system.codegen.proto.status.exists" : "system.codegen.proto.status.missing") }}
|
|
26
|
+
</el-tag>
|
|
27
27
|
<span class="code-gen-proto-cell__secondary" :title="row.message">{{ row.message }}</span>
|
|
28
28
|
</div>
|
|
29
29
|
</template>
|
|
@@ -38,23 +38,23 @@
|
|
|
38
38
|
</template>
|
|
39
39
|
<div class="code-gen-proto-capability-popover">
|
|
40
40
|
<div class="code-gen-proto-capability-popover__item">
|
|
41
|
-
<span
|
|
41
|
+
<span>{{ t("system.codegen.proto.field.methodComment") }}</span>
|
|
42
42
|
<span class="code-gen-proto-capability-popover__value">{{ row.method_comment || "--" }}</span>
|
|
43
43
|
</div>
|
|
44
44
|
<div class="code-gen-proto-capability-popover__item">
|
|
45
|
-
<span
|
|
45
|
+
<span>{{ t("system.codegen.proto.field.methodName") }}</span>
|
|
46
46
|
<code>{{ row.method_name || "--" }}</code>
|
|
47
47
|
</div>
|
|
48
48
|
<div class="code-gen-proto-capability-popover__item">
|
|
49
|
-
<span>
|
|
49
|
+
<span>{{ t("system.codegen.proto.field.protoPath") }}</span>
|
|
50
50
|
<code class="code-gen-proto-capability-popover__path">{{ row.proto_file_path || "--" }}</code>
|
|
51
51
|
</div>
|
|
52
52
|
<div class="code-gen-proto-capability-popover__item">
|
|
53
|
-
<span
|
|
53
|
+
<span>{{ t("system.codegen.proto.field.serviceComment") }}</span>
|
|
54
54
|
<span class="code-gen-proto-capability-popover__value">{{ row.service_comment || "--" }}</span>
|
|
55
55
|
</div>
|
|
56
56
|
<div class="code-gen-proto-capability-popover__item">
|
|
57
|
-
<span
|
|
57
|
+
<span>{{ t("system.codegen.proto.field.serviceName") }}</span>
|
|
58
58
|
<code>{{ row.service_name || "--" }}</code>
|
|
59
59
|
</div>
|
|
60
60
|
<pre class="code-gen-proto-capability-popover__preview"><code>{{ resolveProtoDefinition(row) }}</code></pre>
|
|
@@ -63,7 +63,9 @@
|
|
|
63
63
|
</template>
|
|
64
64
|
<template #generate_when_missing="{ row }">
|
|
65
65
|
<div class="code-gen-proto-generate">
|
|
66
|
-
<el-checkbox v-model="row.generate_when_missing" :disabled="row.exists || !canEdit"
|
|
66
|
+
<el-checkbox v-model="row.generate_when_missing" :disabled="row.exists || !canEdit">
|
|
67
|
+
{{ t("system.codegen.proto.action.generateApi") }}
|
|
68
|
+
</el-checkbox>
|
|
67
69
|
<el-button
|
|
68
70
|
v-if="showProtoConfigButton(row)"
|
|
69
71
|
type="primary"
|
|
@@ -73,18 +75,18 @@
|
|
|
73
75
|
:disabled="!canEdit"
|
|
74
76
|
@click="openProtoConfigDialog(row)"
|
|
75
77
|
>
|
|
76
|
-
|
|
78
|
+
{{ t("system.codegen.proto.action.configure") }}
|
|
77
79
|
</el-button>
|
|
78
80
|
</div>
|
|
79
81
|
</template>
|
|
80
82
|
</ProTable>
|
|
81
83
|
</template>
|
|
82
|
-
<el-empty v-else description="
|
|
84
|
+
<el-empty v-else :description="t('system.codegen.column.message.selectRecord')" />
|
|
83
85
|
</el-card>
|
|
84
86
|
|
|
85
87
|
<ProDialog
|
|
86
88
|
v-model="configDialog.visible"
|
|
87
|
-
:title="
|
|
89
|
+
:title="configDialogTitle"
|
|
88
90
|
width="min(520px, calc(100vw - 32px))"
|
|
89
91
|
destroy-on-close
|
|
90
92
|
:show-close="false"
|
|
@@ -96,16 +98,16 @@
|
|
|
96
98
|
<template #header="{ titleId, titleClass }">
|
|
97
99
|
<div class="code-gen-config-dialog__header">
|
|
98
100
|
<span :id="titleId" :class="titleClass">
|
|
99
|
-
{{
|
|
101
|
+
{{ configDialogTitle }}
|
|
100
102
|
</span>
|
|
101
103
|
<el-button
|
|
102
104
|
type="primary"
|
|
103
105
|
:icon="Document"
|
|
104
106
|
:disabled="!canEdit"
|
|
105
|
-
aria-label="
|
|
107
|
+
:aria-label="t('system.codegen.column.action.saveAndClose')"
|
|
106
108
|
@click="handleSaveProtoConfigDialog"
|
|
107
109
|
>
|
|
108
|
-
|
|
110
|
+
{{ t("common.action.save") }}
|
|
109
111
|
</el-button>
|
|
110
112
|
</div>
|
|
111
113
|
</template>
|
|
@@ -124,6 +126,7 @@
|
|
|
124
126
|
import { computed, onMounted, reactive, ref, watch } from "vue";
|
|
125
127
|
import { Document, Setting } from "@element-plus/icons-vue";
|
|
126
128
|
import { useRoute, useRouter } from "vue-router";
|
|
129
|
+
import { t } from "@liujitcn/kratos-admin-core";
|
|
127
130
|
import ProDialog from "@liujitcn/kratos-admin-core/components/Dialog/ProDialog.vue";
|
|
128
131
|
import ProForm from "@liujitcn/kratos-admin-core/components/ProForm/index.vue";
|
|
129
132
|
import type { ProFormField, ProFormOption } from "@liujitcn/kratos-admin-core/components/ProForm/interface";
|
|
@@ -134,7 +137,11 @@ import { useTabsStore } from "@liujitcn/kratos-admin-core/stores/runtime";
|
|
|
134
137
|
import { defCodeGenColumnService } from "@liujitcn/kratos-admin-system/api/system/code_gen_column";
|
|
135
138
|
import { defCodeGenProtoService } from "@liujitcn/kratos-admin-system/api/system/code_gen_proto";
|
|
136
139
|
import { defCodeGenTableService } from "@liujitcn/kratos-admin-system/api/system/code_gen_table";
|
|
137
|
-
import type {
|
|
140
|
+
import type {
|
|
141
|
+
CodeGenProto,
|
|
142
|
+
CodeGenProtoCheck,
|
|
143
|
+
CodeGenProtoConfig
|
|
144
|
+
} from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/code_gen_proto";
|
|
138
145
|
import type { CodeGenDatabaseTable, CodeGenTableForm } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/code_gen_table";
|
|
139
146
|
import { createDefaultCodeGenTableForm } from "../config";
|
|
140
147
|
|
|
@@ -155,21 +162,21 @@ const targetColumnOptions = reactive<Record<string, ProFormOption[]>>({});
|
|
|
155
162
|
const loadingTargetColumns = reactive(new Set<string>());
|
|
156
163
|
const formData = reactive<CodeGenTableForm>(createDefaultCodeGenTableForm());
|
|
157
164
|
|
|
158
|
-
const
|
|
159
|
-
crud: "
|
|
160
|
-
page_tree: "
|
|
161
|
-
left_tree: "
|
|
162
|
-
entity_option: "
|
|
163
|
-
field_option: "
|
|
164
|
-
field_status: "
|
|
165
|
+
const triggerTypeLabelKeys: Record<string, string> = {
|
|
166
|
+
crud: "system.codegen.proto.trigger.crud",
|
|
167
|
+
page_tree: "system.codegen.proto.trigger.pageTree",
|
|
168
|
+
left_tree: "system.codegen.proto.trigger.leftTree",
|
|
169
|
+
entity_option: "system.codegen.proto.trigger.entityOption",
|
|
170
|
+
field_option: "system.codegen.proto.trigger.fieldOption",
|
|
171
|
+
field_status: "system.codegen.proto.trigger.fieldStatus"
|
|
165
172
|
};
|
|
166
173
|
|
|
167
|
-
const
|
|
168
|
-
crud: "
|
|
169
|
-
list: "
|
|
170
|
-
option: "
|
|
171
|
-
tree: "
|
|
172
|
-
status: "
|
|
174
|
+
const apiKindLabelKeys: Record<string, string> = {
|
|
175
|
+
crud: "system.codegen.proto.apiKind.crud",
|
|
176
|
+
list: "system.codegen.proto.apiKind.list",
|
|
177
|
+
option: "system.codegen.proto.apiKind.option",
|
|
178
|
+
tree: "system.codegen.proto.apiKind.tree",
|
|
179
|
+
status: "system.codegen.proto.apiKind.status"
|
|
173
180
|
};
|
|
174
181
|
|
|
175
182
|
/** Proto 类型配置弹窗上下文。 */
|
|
@@ -193,57 +200,93 @@ const configDialog = reactive<CodeGenProtoConfigDialog>({
|
|
|
193
200
|
});
|
|
194
201
|
|
|
195
202
|
/** Proto 检查结果表格列配置。 */
|
|
196
|
-
const protoColumns
|
|
197
|
-
{
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
+
const protoColumns = computed<ColumnProps[]>(() => [
|
|
204
|
+
{
|
|
205
|
+
prop: "trigger_type",
|
|
206
|
+
label: t("system.codegen.proto.field.triggerType"),
|
|
207
|
+
minWidth: 150,
|
|
208
|
+
render: scope => resolveTriggerTypeLabel(String(scope.row.trigger_type))
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
prop: "api_kind",
|
|
212
|
+
label: t("system.codegen.proto.field.apiKind"),
|
|
213
|
+
minWidth: 150,
|
|
214
|
+
render: scope => resolveAPIKindLabel(String(scope.row.api_kind))
|
|
215
|
+
},
|
|
216
|
+
{ prop: "proto_info", label: t("system.codegen.proto.field.capability"), minWidth: 290 },
|
|
217
|
+
{ prop: "exists", label: t("system.codegen.table.field.status"), minWidth: 210 },
|
|
218
|
+
{ prop: "generate_when_missing", label: t("system.codegen.proto.field.generateSetting"), minWidth: 230 }
|
|
219
|
+
]);
|
|
203
220
|
|
|
204
221
|
/** 将 Proto 配置对象适配为 ProForm 所需的通用表单模型。 */
|
|
205
222
|
const protoConfigFormModel = computed<Record<string, any>>(() => configDialog.config as Record<string, any>);
|
|
223
|
+
const configDialogTitle = computed(() =>
|
|
224
|
+
t("system.codegen.proto.title.config", {
|
|
225
|
+
method: configDialog.methodName,
|
|
226
|
+
kind: resolveAPIKindLabel(configDialog.apiKind)
|
|
227
|
+
})
|
|
228
|
+
);
|
|
206
229
|
|
|
207
230
|
/** Proto 配置弹窗的动态表单字段。 */
|
|
208
231
|
const protoConfigFields = computed<ProFormField[]>(() => [
|
|
209
232
|
{
|
|
210
233
|
prop: "parent_column",
|
|
211
|
-
label: "
|
|
234
|
+
label: t("system.codegen.proto.field.parentColumn"),
|
|
212
235
|
component: "select",
|
|
213
236
|
options: () => configColumnOptions.value,
|
|
214
|
-
props: () => ({
|
|
237
|
+
props: () => ({
|
|
238
|
+
loading: configDialogLoading.value,
|
|
239
|
+
filterable: true,
|
|
240
|
+
clearable: true,
|
|
241
|
+
placeholder: t("system.codegen.proto.placeholder.parentColumn")
|
|
242
|
+
}),
|
|
215
243
|
visible: () => configDialog.apiKind === "tree"
|
|
216
244
|
},
|
|
217
245
|
{
|
|
218
246
|
prop: "label_column",
|
|
219
|
-
label: "
|
|
247
|
+
label: t("system.codegen.proto.field.labelColumn"),
|
|
220
248
|
component: "select",
|
|
221
249
|
options: () => configColumnOptions.value,
|
|
222
|
-
props: () => ({
|
|
250
|
+
props: () => ({
|
|
251
|
+
loading: configDialogLoading.value,
|
|
252
|
+
filterable: true,
|
|
253
|
+
clearable: true,
|
|
254
|
+
placeholder: t("system.codegen.proto.placeholder.labelColumn")
|
|
255
|
+
}),
|
|
223
256
|
visible: () => ["option", "tree"].includes(configDialog.apiKind)
|
|
224
257
|
},
|
|
225
258
|
{
|
|
226
259
|
prop: "value_column",
|
|
227
|
-
label: "
|
|
260
|
+
label: t("system.codegen.proto.field.valueColumn"),
|
|
228
261
|
component: "select",
|
|
229
262
|
options: () => configColumnOptions.value,
|
|
230
|
-
props: () => ({
|
|
263
|
+
props: () => ({
|
|
264
|
+
loading: configDialogLoading.value,
|
|
265
|
+
filterable: true,
|
|
266
|
+
clearable: true,
|
|
267
|
+
placeholder: t("system.codegen.proto.placeholder.valueColumn")
|
|
268
|
+
}),
|
|
231
269
|
visible: () => ["option", "tree"].includes(configDialog.apiKind)
|
|
232
270
|
},
|
|
233
271
|
{
|
|
234
272
|
prop: "lazy",
|
|
235
|
-
label: "
|
|
273
|
+
label: t("system.codegen.proto.field.loadMode"),
|
|
236
274
|
component: "checkbox",
|
|
237
|
-
checkboxLabel: "
|
|
275
|
+
checkboxLabel: t("system.codegen.column.value.lazyChildren"),
|
|
238
276
|
props: () => ({ disabled: configDialog.apiKind !== "tree" }),
|
|
239
277
|
visible: () => configDialog.apiKind === "tree"
|
|
240
278
|
},
|
|
241
279
|
{
|
|
242
280
|
prop: "status_column",
|
|
243
|
-
label: "
|
|
281
|
+
label: t("system.codegen.proto.field.statusColumn"),
|
|
244
282
|
component: "select",
|
|
245
283
|
options: () => configColumnOptions.value,
|
|
246
|
-
props: () => ({
|
|
284
|
+
props: () => ({
|
|
285
|
+
loading: configDialogLoading.value,
|
|
286
|
+
filterable: true,
|
|
287
|
+
clearable: true,
|
|
288
|
+
placeholder: t("system.codegen.proto.placeholder.statusColumn")
|
|
289
|
+
}),
|
|
247
290
|
visible: () => configDialog.apiKind === "status"
|
|
248
291
|
}
|
|
249
292
|
]);
|
|
@@ -305,7 +348,9 @@ async function handleQuery() {
|
|
|
305
348
|
*/
|
|
306
349
|
function syncWorkspaceTitle() {
|
|
307
350
|
const tableTitle = formData.comment || formData.name;
|
|
308
|
-
const title = tableTitle
|
|
351
|
+
const title = tableTitle
|
|
352
|
+
? t("system.codegen.proto.title.workspaceWithTable", { table: tableTitle })
|
|
353
|
+
: t("system.codegen.proto.title.workspace");
|
|
309
354
|
tabsStore.setTabsTitle(title);
|
|
310
355
|
document.title = `${title} - ${import.meta.env.VITE_GLOB_APP_TITLE}`;
|
|
311
356
|
}
|
|
@@ -337,12 +382,14 @@ function resolveColumnNameOptions(row: CodeGenProtoCheck) {
|
|
|
337
382
|
|
|
338
383
|
/** 返回触发来源的展示文案。 */
|
|
339
384
|
function resolveTriggerTypeLabel(triggerType: string) {
|
|
340
|
-
|
|
385
|
+
const key = triggerTypeLabelKeys[triggerType];
|
|
386
|
+
return key ? t(key) : triggerType;
|
|
341
387
|
}
|
|
342
388
|
|
|
343
389
|
/** 返回接口类型的展示文案。 */
|
|
344
390
|
function resolveAPIKindLabel(apiKind: string) {
|
|
345
|
-
|
|
391
|
+
const key = apiKindLabelKeys[apiKind];
|
|
392
|
+
return key ? t(key) : apiKind;
|
|
346
393
|
}
|
|
347
394
|
|
|
348
395
|
/** 返回生成 RPC 的请求与响应类型签名。 */
|
|
@@ -353,9 +400,10 @@ function resolveProtoRPCSignature(row: CodeGenProtoCheck) {
|
|
|
353
400
|
switch (row.api_kind) {
|
|
354
401
|
case "list":
|
|
355
402
|
case "tree":
|
|
356
|
-
responseType =
|
|
357
|
-
|
|
358
|
-
|
|
403
|
+
responseType =
|
|
404
|
+
row.api_kind === "tree" && ["entity_option", "field_option", "left_tree"].includes(row.trigger_type)
|
|
405
|
+
? ".common.v1.TreeOptionResponse"
|
|
406
|
+
: `${methodName}Response`;
|
|
359
407
|
break;
|
|
360
408
|
case "option":
|
|
361
409
|
responseType = ".common.v1.SelectOptionResponse";
|
|
@@ -475,7 +523,7 @@ function validateProtoConfigs() {
|
|
|
475
523
|
item => !item.exists && item.generate_when_missing && needsProtoConfig(item.api_kind) && !hasCompleteProtoConfig(item)
|
|
476
524
|
);
|
|
477
525
|
if (!row) return true;
|
|
478
|
-
ElMessage.warning(
|
|
526
|
+
ElMessage.warning(t("system.codegen.proto.message.configureFirst", { method: row.method_name }));
|
|
479
527
|
openProtoConfigDialog(row);
|
|
480
528
|
return false;
|
|
481
529
|
}
|
|
@@ -521,7 +569,7 @@ async function handleSaveProtoMethods(showMessage = true) {
|
|
|
521
569
|
table_id: formData.id,
|
|
522
570
|
code_gen_protos: codeGenProtos
|
|
523
571
|
});
|
|
524
|
-
if (showMessage) ElMessage.success("
|
|
572
|
+
if (showMessage) ElMessage.success(t("system.codegen.proto.message.saveSuccess"));
|
|
525
573
|
// 路由切换前保留当前页签地址,避免误删目标页签。
|
|
526
574
|
const currentPath = route.fullPath;
|
|
527
575
|
await router.push("/code/gen/table");
|