From 442a454d6e08076839c586b6404b393a8c6e5e81 Mon Sep 17 00:00:00 2001 From: ann Date: Wed, 28 Feb 2024 17:32:53 +0800 Subject: [PATCH] add bilangual text --- public/locales/en.json | 21 +++++++++------- public/locales/zh.json | 12 +++++++++- src/views/adapterManagement/list.vue | 1 - .../taskList/components/applicationForm.vue | 24 ++++++++++--------- src/views/taskManagement/taskList/create.vue | 22 ++++++++--------- .../virtualMachine/virtualMachine/list.vue | 1 - 6 files changed, 48 insertions(+), 33 deletions(-) diff --git a/public/locales/en.json b/public/locales/en.json index 721e0c2..922caa4 100644 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -2,9 +2,10 @@ "message": { "china": "中文", "english": "English", - "login": "登录", - "logout": "退出登录", + "login": "登录r", + "logout": "退出登录r", "back": "Back", + "save": "Save", "cancel": "Cancel", "to": "To", "startDate": "Start Date", @@ -18,11 +19,11 @@ "menu": { "taskManagement": "Task Management", "taskList": "Task List", - "strategyManagement": "策略管理", - "schedulingStrategy": "调度策略", - "warnStrategy": "告警策略", - "adapterManagement": "驱动器管理", - "adapterList": "驱动器列表" + "strategyManagement": "策略管理r", + "schedulingStrategy": "调度策略r", + "warnStrategy": "告警策略r", + "adapterManagement": "驱动器管理r", + "adapterList": "驱动器列表r" }, "page": { "cloud": "cloud", @@ -40,6 +41,10 @@ "cluster": "Cluster", "startTime": "Start Time", "more": "More", - "viewDetail": "View Detail" + "viewDetail": "View Detail", + "cpType": "计算类型r", + "taskType": "任务类型r", + "createApplication": "创建容器应用r", + "createJob": "创建容器定时任务r" } } \ No newline at end of file diff --git a/public/locales/zh.json b/public/locales/zh.json index 0d09316..3a52723 100644 --- a/public/locales/zh.json +++ b/public/locales/zh.json @@ -5,6 +5,7 @@ "login": "登录", "logout": "退出登录", "back": "返回", + "save": "保存", "cancel": "取消", "to": "至", "startDate": "开始日期", @@ -24,6 +25,11 @@ "adapterManagement": "驱动器管理", "adapterList": "驱动器列表" }, + "check": { + "input": "请输入", + "select": "请选择", + "inputInvalid": "名称格式不合法。字母开头,仅能包含小写字母、数字和-。" + }, "page": { "cloud": "云算", "hpc": "超算", @@ -40,6 +46,10 @@ "cluster": "集群", "startTime": "作业开始时间", "more": "更多操作", - "viewDetail": "查看详情" + "viewDetail": "查看详情", + "cpType": "计算类型", + "taskType": "任务类型", + "createApplication": "创建容器应用", + "createJob": "创建容器定时任务" } } \ No newline at end of file diff --git a/src/views/adapterManagement/list.vue b/src/views/adapterManagement/list.vue index 82ed897..219b397 100644 --- a/src/views/adapterManagement/list.vue +++ b/src/views/adapterManagement/list.vue @@ -21,7 +21,6 @@ tooltip-effect="dark" > diff --git a/src/views/taskManagement/taskList/components/applicationForm.vue b/src/views/taskManagement/taskList/components/applicationForm.vue index ab76747..ad566a5 100644 --- a/src/views/taskManagement/taskList/components/applicationForm.vue +++ b/src/views/taskManagement/taskList/components/applicationForm.vue @@ -347,17 +347,6 @@ export default { amount: 1 } }, - formDataRules: { - appName: [ - { required: true, message: '请输入名称' }, - { - pattern: /^[a-z]([-a-z0-9]*[a-z0-9])?$/, - message: '名称格式不合法。字母开头,仅能包含小写字母、数字和-。' - }, - { validator: this.nameValidator } - ], - imageName: [{ required: true, message: '必选项', trigger: 'change' }] - }, // confirmLoading: false, minReplicasMarks: { 0: '0', @@ -393,6 +382,19 @@ export default { gpuAmount: this.formData.gpu.amount }) } + }, + formDataRules() { + return { + appName: [ + { required: true, message: this.$t('check.input') + this.$t('message.name') }, + { + pattern: /^[a-z]([-a-z0-9]*[a-z0-9])?$/, + message: this.$t('check.inputInvalid') + }, + { validator: this.nameValidator } + ], + imageName: [{ required: true, message: '必选项', trigger: 'change' }] + } } }, methods: { diff --git a/src/views/taskManagement/taskList/create.vue b/src/views/taskManagement/taskList/create.vue index cfea1f8..6d538ce 100644 --- a/src/views/taskManagement/taskList/create.vue +++ b/src/views/taskManagement/taskList/create.vue @@ -1,7 +1,7 @@