fix: fix error translate from website (#8688)

This commit is contained in:
CityFun 2025-05-16 11:57:18 +08:00 committed by GitHub
parent 9a0488628a
commit f9ccd10cc9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 6 deletions

View file

@ -380,7 +380,7 @@ export const Actions = [
},
];
export const Algorithms = [
export const getAlgorithms = () => [
{
label: i18n.global.t('commons.table.default'),
value: 'default',
@ -398,7 +398,7 @@ export const Algorithms = [
},
];
export const StatusStrategy = [
export const getStatusStrategy = () => [
{
label: i18n.global.t('website.strategyDown'),
value: 'down',

View file

@ -61,7 +61,7 @@ import { onMounted, ref } from 'vue';
import Operate from './operate/index.vue';
import i18n from '@/lang';
import { Website } from '@/api/interface/website';
import { Algorithms } from '@/global/mimetype';
import { getAlgorithms } from '@/global/mimetype';
import File from './file/index.vue';
const props = defineProps({
@ -76,6 +76,7 @@ const loading = ref(false);
const operateRef = ref();
const delRef = ref();
const fileRef = ref();
const Algorithms = getAlgorithms();
const buttons = [
{

View file

@ -70,7 +70,7 @@
>
<el-select v-model="item.servers[index].flag" clearable>
<el-option
v-for="flag in StatusStrategy"
v-for="flag in getStatusStrategy()"
:label="flag.label"
:key="flag.value"
:value="flag.value"
@ -112,7 +112,7 @@ import { FormInstance } from 'element-plus';
import { ref } from 'vue';
import { MsgSuccess } from '@/utils/message';
import { Rules, checkNumberRange } from '@/global/form-rules';
import { Algorithms, StatusStrategy } from '@/global/mimetype';
import { getAlgorithms, getStatusStrategy } from '@/global/mimetype';
import { Website } from '@/api/interface/website';
const rules = ref<any>({
@ -158,7 +158,7 @@ const handleClose = () => {
};
const helper = ref();
const Algorithms = getAlgorithms();
const getHelper = (key: string) => {
Algorithms.forEach((algorithm) => {
if (algorithm.value === key) {