From 50e95b985a72fcec4a93a2470e9efdfb2620148a Mon Sep 17 00:00:00 2001
From: zhou zhou <3272660260@qq.com>
Date: 星期四, 02 四月 2026 15:46:09 +0800
Subject: [PATCH] #i18n
---
rsf-design/src/views/system/ai-param/modules/ai-param-dialog.vue | 126 ++++++++++++++++++++++++++---------------
1 files changed, 80 insertions(+), 46 deletions(-)
diff --git a/rsf-design/src/views/system/ai-param/modules/ai-param-dialog.vue b/rsf-design/src/views/system/ai-param/modules/ai-param-dialog.vue
index e48a405..67d71ef 100644
--- a/rsf-design/src/views/system/ai-param/modules/ai-param-dialog.vue
+++ b/rsf-design/src/views/system/ai-param/modules/ai-param-dialog.vue
@@ -19,14 +19,21 @@
:show-submit="false"
/>
- <div v-if="showRuntimeSection" class="mt-2 rounded-2xl border border-[var(--art-border-color)] px-5 py-4">
+ <div
+ v-if="showRuntimeSection"
+ class="mt-2 rounded-2xl border border-[var(--art-border-color)] px-5 py-4"
+ >
<div class="mb-3 flex items-center justify-between gap-4">
<div>
- <h4 class="text-base font-semibold text-[var(--art-gray-900)]">杩愯鏃剁姸鎬�</h4>
- <p class="mt-1 text-sm text-[var(--art-gray-500)]">淇濆瓨鍓嶅彲鍏堟墽琛岃崏绋挎牎楠岋紝杩愯鏃剁姸鎬佺敱鍚庣鐪熷疄杩斿洖銆�</p>
+ <h4 class="text-base font-semibold text-[var(--art-gray-900)]">
+ {{ t('pages.system.aiParam.dialog.runtimeTitle') }}
+ </h4>
+ <p class="mt-1 text-sm text-[var(--art-gray-500)]">
+ {{ t('pages.system.aiParam.dialog.runtimeDescription') }}
+ </p>
</div>
<ElButton v-if="!isReadonly" :loading="validateLoading" @click="handleValidateDraft">
- 鑽夌鏍¢獙
+ {{ t('pages.system.aiParam.dialog.validateDraft') }}
</ElButton>
</div>
@@ -39,14 +46,29 @@
/>
<ElDescriptions :column="2" border>
- <ElDescriptionsItem label="鏍¢獙鐘舵��">{{ form.validateStatus || '--' }}</ElDescriptionsItem>
- <ElDescriptionsItem label="鏈�杩戞牎楠岃�楁椂">
- {{ form.lastValidateElapsedMs !== null && form.lastValidateElapsedMs !== undefined ? `${form.lastValidateElapsedMs} ms` : '--' }}
+ <ElDescriptionsItem :label="t('pages.system.aiParam.dialog.labels.validateStatus')">
+ {{ form.validateStatus || '--' }}
</ElDescriptionsItem>
- <ElDescriptionsItem label="鏈�杩戞牎楠屾椂闂�">{{ form['lastValidateTime$'] || '--' }}</ElDescriptionsItem>
- <ElDescriptionsItem label="鏈�杩戞洿鏂颁汉">{{ form.updateBy || '--' }}</ElDescriptionsItem>
- <ElDescriptionsItem label="鏈�杩戞洿鏂版椂闂�" :span="2">{{ form['updateTime$'] || '--' }}</ElDescriptionsItem>
- <ElDescriptionsItem label="鏈�杩戞牎楠屼俊鎭�" :span="2">
+ <ElDescriptionsItem :label="t('pages.system.aiParam.dialog.labels.lastValidateElapsedMs')">
+ {{
+ form.lastValidateElapsedMs !== null && form.lastValidateElapsedMs !== undefined
+ ? `${form.lastValidateElapsedMs} ms`
+ : '--'
+ }}
+ </ElDescriptionsItem>
+ <ElDescriptionsItem :label="t('pages.system.aiParam.dialog.labels.lastValidateTime')">
+ {{ form['lastValidateTime$'] || '--' }}
+ </ElDescriptionsItem>
+ <ElDescriptionsItem :label="t('pages.system.aiParam.dialog.labels.updateBy')">
+ {{ form.updateBy || '--' }}
+ </ElDescriptionsItem>
+ <ElDescriptionsItem :label="t('pages.system.aiParam.dialog.labels.updateTime')" :span="2">
+ {{ form['updateTime$'] || '--' }}
+ </ElDescriptionsItem>
+ <ElDescriptionsItem
+ :label="t('pages.system.aiParam.dialog.labels.lastValidateMessage')"
+ :span="2"
+ >
<div class="whitespace-pre-wrap break-all text-sm leading-6 text-[var(--art-gray-700)]">
{{ form.lastValidateMessage || '--' }}
</div>
@@ -56,14 +78,19 @@
<template #footer>
<span class="dialog-footer">
- <ElButton @click="handleCancel">{{ isReadonly ? '鍏抽棴' : '鍙栨秷' }}</ElButton>
- <ElButton v-if="!isReadonly" type="primary" @click="handleSubmit">纭畾</ElButton>
+ <ElButton @click="handleCancel">
+ {{ isReadonly ? t('common.actions.close') : t('common.cancel') }}
+ </ElButton>
+ <ElButton v-if="!isReadonly" type="primary" @click="handleSubmit">
+ {{ t('common.confirm') }}
+ </ElButton>
</span>
</template>
</ElDialog>
</template>
<script setup>
+ import { useI18n } from 'vue-i18n'
import ArtForm from '@/components/core/forms/art-form/index.vue'
import { fetchValidateAiParamDraft } from '@/api/ai-config'
import {
@@ -81,6 +108,7 @@
})
const emit = defineEmits(['submit', 'update:visible'])
+ const { t } = useI18n()
const formRef = ref()
const form = reactive(createAiParamFormState())
const validateLoading = ref(false)
@@ -89,9 +117,9 @@
const isReadonly = computed(() => props.mode === 'show')
const showRuntimeSection = computed(() => Boolean(form.id) || props.mode !== 'create')
const dialogTitle = computed(() => {
- if (props.mode === 'edit') return '缂栬緫 AI 鍙傛暟'
- if (props.mode === 'show') return 'AI 鍙傛暟璇︽儏'
- return '鏂板缓 AI 鍙傛暟'
+ if (props.mode === 'edit') return t('pages.system.aiParam.dialog.titleEdit')
+ if (props.mode === 'show') return t('pages.system.aiParam.dialog.titleDetail')
+ return t('pages.system.aiParam.dialog.titleCreate')
})
const validateAlertType = computed(() =>
@@ -112,69 +140,75 @@
})
const rules = computed(() => ({
- name: [{ required: true, message: '璇疯緭鍏ュ弬鏁板悕绉�', trigger: 'blur' }],
- providerType: [{ required: true, message: '璇烽�夋嫨鎻愪緵鏂圭被鍨�', trigger: 'change' }],
- baseUrl: [{ required: true, message: '璇疯緭鍏ュ熀纭�鍦板潃', trigger: 'blur' }],
- apiKey: [{ required: true, message: '璇疯緭鍏� API Key', trigger: 'blur' }],
- model: [{ required: true, message: '璇疯緭鍏ユā鍨嬪悕绉�', trigger: 'blur' }]
+ name: [{ required: true, message: t('pages.system.aiParam.dialog.validation.name'), trigger: 'blur' }],
+ providerType: [
+ {
+ required: true,
+ message: t('pages.system.aiParam.dialog.validation.providerType'),
+ trigger: 'change'
+ }
+ ],
+ baseUrl: [{ required: true, message: t('pages.system.aiParam.dialog.validation.baseUrl'), trigger: 'blur' }],
+ apiKey: [{ required: true, message: t('pages.system.aiParam.dialog.validation.apiKey'), trigger: 'blur' }],
+ model: [{ required: true, message: t('pages.system.aiParam.dialog.validation.model'), trigger: 'blur' }]
}))
const formItems = computed(() => [
{
- label: '鍙傛暟鍚嶇О',
+ label: t('pages.system.aiParam.dialog.labels.name'),
key: 'name',
type: 'input',
props: {
clearable: true,
- placeholder: '璇疯緭鍏ュ弬鏁板悕绉�',
+ placeholder: t('pages.system.aiParam.dialog.placeholders.name'),
disabled: isReadonly.value
}
},
{
- label: '鎻愪緵鏂圭被鍨�',
+ label: t('pages.system.aiParam.dialog.labels.providerType'),
key: 'providerType',
type: 'select',
props: {
options: getAiParamProviderOptions(),
disabled: isReadonly.value,
- placeholder: '璇烽�夋嫨鎻愪緵鏂圭被鍨�'
+ placeholder: t('pages.system.aiParam.dialog.placeholders.providerType')
}
},
{
- label: '鍩虹鍦板潃',
+ label: t('pages.system.aiParam.dialog.labels.baseUrl'),
key: 'baseUrl',
type: 'input',
span: 24,
props: {
clearable: true,
- placeholder: '璇疯緭鍏ュ吋瀹� OpenAI 鐨勫熀纭�鍦板潃',
+ placeholder: t('pages.system.aiParam.dialog.placeholders.baseUrl'),
disabled: isReadonly.value
}
},
{
- label: 'API Key',
+ label: t('pages.system.aiParam.dialog.labels.apiKey'),
key: 'apiKey',
type: 'input',
props: {
clearable: true,
- placeholder: '璇疯緭鍏� API Key',
+ placeholder: t('pages.system.aiParam.dialog.placeholders.apiKey'),
disabled: isReadonly.value,
type: isReadonly.value ? 'text' : 'password',
showPassword: !isReadonly.value
}
},
{
- label: '妯″瀷鍚嶇О',
+ label: t('pages.system.aiParam.dialog.labels.model'),
key: 'model',
type: 'input',
props: {
clearable: true,
- placeholder: '璇疯緭鍏ユā鍨嬪悕绉�',
+ placeholder: t('pages.system.aiParam.dialog.placeholders.model'),
disabled: isReadonly.value
}
},
{
- label: 'Temperature',
+ label: t('pages.system.aiParam.dialog.labels.temperature'),
key: 'temperature',
type: 'number',
props: {
@@ -182,12 +216,12 @@
max: 2,
step: 0.1,
precision: 2,
- placeholder: '璇疯緭鍏� temperature',
+ placeholder: t('pages.system.aiParam.dialog.placeholders.temperature'),
disabled: isReadonly.value
}
},
{
- label: 'Top P',
+ label: t('pages.system.aiParam.dialog.labels.topP'),
key: 'topP',
type: 'number',
props: {
@@ -195,54 +229,54 @@
max: 1,
step: 0.1,
precision: 2,
- placeholder: '璇疯緭鍏� topP',
+ placeholder: t('pages.system.aiParam.dialog.placeholders.topP'),
disabled: isReadonly.value
}
},
{
- label: '鏈�澶� Token',
+ label: t('pages.system.aiParam.dialog.labels.maxTokens'),
key: 'maxTokens',
type: 'number',
props: {
min: 1,
step: 1,
- placeholder: '璇疯緭鍏ユ渶澶� token',
+ placeholder: t('pages.system.aiParam.dialog.placeholders.maxTokens'),
disabled: isReadonly.value
}
},
{
- label: '瓒呮椂鏃堕棿(ms)',
+ label: t('pages.system.aiParam.dialog.labels.timeoutMs'),
key: 'timeoutMs',
type: 'number',
props: {
min: 1000,
step: 1000,
- placeholder: '璇疯緭鍏ヨ秴鏃舵椂闂�',
+ placeholder: t('pages.system.aiParam.dialog.placeholders.timeoutMs'),
disabled: isReadonly.value
}
},
{
- label: '娴佸紡鍝嶅簲',
+ label: t('pages.system.aiParam.dialog.labels.streamingEnabled'),
key: 'streamingEnabled',
type: 'switch',
props: {
disabled: isReadonly.value,
- activeText: '寮�鍚�',
- inactiveText: '鍏抽棴'
+ activeText: t('common.status.enabled'),
+ inactiveText: t('common.status.disabled')
}
},
{
- label: '榛樿鐘舵��',
+ label: t('pages.system.aiParam.dialog.labels.status'),
key: 'status',
type: 'select',
props: {
disabled: isReadonly.value,
options: getAiParamStatusOptions(),
- placeholder: '璇烽�夋嫨榛樿鐘舵��'
+ placeholder: t('pages.system.aiParam.dialog.placeholders.status')
}
},
{
- label: '澶囨敞',
+ label: t('pages.system.aiParam.dialog.labels.memo'),
key: 'memo',
type: 'input',
span: 24,
@@ -250,7 +284,7 @@
disabled: isReadonly.value,
type: 'textarea',
rows: 3,
- placeholder: '璇疯緭鍏ュ娉�'
+ placeholder: t('pages.system.aiParam.dialog.placeholders.memo')
}
}
])
--
Gitblit v1.9.1