20260721223033

This commit is contained in:
oneao committed 2026-07-21 22:30:33 +08:00
1 parent bab8e2972f
commit e9f099f044
26 files changed
+1687 -349

No files matched your search

@@ -1,11 +1,13 @@
<script setup>
import ModuleTranslationEditor from "./ModuleTranslationEditor.vue";
const props = defineProps({
directoryParentOptions: { type: Array, default: () => [] },
isNew: Boolean,
parentOptions: { type: Array, default: () => [] },
});
const emit = defineEmits(["update-module-id"]);
const emit = defineEmits(["update-module-code"]);
const module = defineModel("module", { type: Object, default: null });
const translations = defineModel("translations", { type: Object, default: () => ({}) });
function updateRoute(value) {
module.value.b_route = value || null;
@@ -18,7 +20,7 @@ function updateRoute(value) {
<a-form v-if="module.b_type === 'directory'" layout="vertical" class="directory-form">
<div class="directory-grid">
<a-form-item label="模块编码" required>
<a-input :value="module.b_id" disabled />
<a-input :value="module.b_code" @update:value="emit('update-module-code', $event)" />
</a-form-item>
<a-form-item label="模块名称" required>
<a-input v-model:value="module.b_name" />
@@ -33,7 +35,14 @@ function updateRoute(value) {
/>
</a-form-item>
<a-form-item label="多语言键">
<a-input v-model:value="module.b_i18n" />
<div class="i18n-editor-row">
<a-input v-model:value="module.b_i18n" />
<ModuleTranslationEditor
v-model:translations="translations"
:i18n-key="module.b_i18n"
:disabled="!module.b_i18n?.trim()"
/>
</div>
</a-form-item>
<a-form-item label="显示顺序">
<a-input-number v-model:value="module.b_xh" :min="0" />
@@ -44,11 +53,7 @@ function updateRoute(value) {
<a-form v-else layout="vertical" class="basic-form">
<div class="form-grid">
<a-form-item label="模块编码" required>
<a-input
:value="module.b_id"
:disabled="!isNew"
@update:value="emit('update-module-id', $event)"
/>
<a-input :value="module.b_code" @update:value="emit('update-module-code', $event)" />
</a-form-item>
<a-form-item label="模块名称" required>
<a-input v-model:value="module.b_name" />
@@ -70,7 +75,14 @@ function updateRoute(value) {
/>
</a-form-item>
<a-form-item label="多语言键">
<a-input v-model:value="module.b_i18n" />
<div class="i18n-editor-row">
<a-input v-model:value="module.b_i18n" />
<ModuleTranslationEditor
v-model:translations="translations"
:i18n-key="module.b_i18n"
:disabled="!module.b_i18n?.trim()"
/>
</div>
</a-form-item>
<a-form-item label="查询表或视图">
<a-input v-model:value="module.b_viewtable" />
@@ -81,12 +93,9 @@ function updateRoute(value) {
<a-form-item label="主键字段">
<a-input v-model:value="module.b_keyfield" />
</a-form-item>
<a-form-item label="排序字段">
<a-form-item label="排序条件">
<a-input v-model:value="module.b_orderfield" />
</a-form-item>
<a-form-item label="排序方向">
<a-segmented v-model:value="module.b_ordertype" :options="['ASC', 'DESC']" />
</a-form-item>
<a-form-item label="显示顺序">
<a-input-number v-model:value="module.b_xh" :min="0" />
</a-form-item>
@@ -100,7 +109,7 @@ function updateRoute(value) {
flex: 1 1 auto;
min-height: 0;
overflow: auto;
padding-top: 10px;
padding-top: 10px 0;
}
.directory-form {
@@ -124,6 +133,17 @@ function updateRoute(value) {
gap: 0 10px;
}
.i18n-editor-row {
display: flex;
align-items: center;
gap: 8px;
}
.i18n-editor-row :deep(.ant-input) {
min-width: 0;
flex: 1 1 auto;
}
:deep(.ant-form-item) {
margin-bottom: 8px;
}