add bilangual text

This commit is contained in:
ann 2024-02-28 17:32:53 +08:00
parent 6c1f9e0390
commit 442a454d6e
6 changed files with 48 additions and 33 deletions

View File

@ -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"
}
}

View File

@ -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": "创建容器定时任务"
}
}

View File

@ -21,7 +21,6 @@
tooltip-effect="dark"
>
<template v-slot:filterBtns>
<span>总条数<span>{{ num }}</span></span>
<el-button size="medium" type="primary" @click="createItem">新增配置</el-button>
</template>
</List>

View File

@ -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: {

View File

@ -1,7 +1,7 @@
<template>
<el-card v-loading="loading" class="list-detail">
<el-page-header :content="'创建'" @back="goBack" />
<h2>任务创建</h2>
<el-page-header :content="$t('message.create')" @back="goBack" />
<h2>{{ $t('page.task') + $t('message.create') }}</h2>
<div class="formcontainer">
<el-form ref="formData" :rules="rules" :model="formData" label-position="top">
<el-row :gutter="10">
@ -25,19 +25,19 @@
</el-form-item>
</el-col> -->
<el-col :span="10">
<el-form-item label="计算类型" prop="cpType">
<el-radio v-model="formData.cpType" label="1">数算任务</el-radio>
<el-radio v-model="formData.cpType" label="2">智算任务</el-radio>
<el-radio v-model="formData.cpType" label="3">超算任务</el-radio>
<el-form-item :label="$t('page.cpType')" prop="cpType">
<el-radio v-model="formData.cpType" label="1">{{ $t('page.cloud') + $t('page.task') }}</el-radio>
<el-radio v-model="formData.cpType" label="2">{{ $t('page.hpc') + $t('page.task') }}</el-radio>
<el-radio v-model="formData.cpType" label="3">{{ $t('page.ai') + $t('page.task') }}</el-radio>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="任务类型" prop="taskType">
<el-form-item :label="$t('page.taskType')" prop="taskType">
<el-select v-model="formData.taskType" :disabled="isEdit" :hide-required-asterisk="true" class="selectPro" placeholder="请选择">
<el-option
v-for="(item, key) in taskTypeList"
:key="key"
:label="item"
:label="$t('page.'+ item)"
:value="key"
>
<!-- {{ item }} -->
@ -55,7 +55,7 @@
<el-row type="flex" justify="end">
<el-col :span="2.5">
<el-button size="medium" @click="goBack">{{ $t("message.cancel") }}</el-button>
<el-button size="medium" type="primary" @click="saveForm">保存</el-button>
<el-button size="medium" type="primary" @click="saveForm">{{ $t("message.save") }}</el-button>
</el-col>
</el-row>
</el-card>
@ -79,8 +79,8 @@ export default {
taskType: 'application'
},
taskTypeList: {
'application': '创建容器应用',
'intervalTask': '创建容器定时任务'
'application': 'createApplication',
'intervalTask': 'createJob'
},
orginFormData: {},
rules: {

View File

@ -11,7 +11,6 @@
tooltip-effect="dark"
>
<template v-slot:filterBtns>
<span>总条数<span>{{ num }}</span></span>
<el-button size="medium" type="primary" @click="createVirtualMachine">创建</el-button>
</template>
</List>