fix: 修改i18n中文国际化

This commit is contained in:
v-hleihuai
2022-01-09 00:55:25 +08:00
committed by 老广
parent 8add1b7f92
commit def153cc42
5 changed files with 39 additions and 5 deletions

View File

@@ -1,8 +1,12 @@
<template>
<div>
<input type="file" @change="Onchange">
<input ref="upLoadFile" type="file" style="display: none" @change="Onchange">
<el-button size="mini" @click.native.stop="onUpLoad">
{{ this.$t('common.SelectFile') }}
</el-button>
<span>{{ fileName }}</span>
<div v-if="tip !== ''">{{ tip }}</div>
<input v-model="value" type="text" hidden v-on="$listeners">
<el-input v-model="value" type="text" hidden v-on="$listeners" />
<div>
<img :src="preview" v-bind="$attrs">
</div>
@@ -23,6 +27,7 @@ export default {
},
data() {
return {
fileName: '',
initial: this.value,
preview: this.value
}
@@ -34,16 +39,21 @@ export default {
}
},
methods: {
onUpLoad() {
this.$refs.upLoadFile.click()
},
onInput(val) {
this.$emit('input', val)
},
Onchange(e) {
if (e.target.files[0] === undefined) {
const upLoadFile = e.target.files[0]
this.fileName = upLoadFile?.name || ''
if (upLoadFile === undefined) {
this.$emit('input', this.initial)
return
}
this.$emit('fileChange', e.target.files[0])
this.$emit('input', this.getObjectURL(e.target.files[0]))
this.$emit('fileChange', upLoadFile)
this.$emit('input', this.getObjectURL(upLoadFile))
},
getObjectURL(file) {
let url = null

View File

@@ -1309,6 +1309,10 @@
"Name": "名称",
"NodeAmount": "节点数量",
"PasswordLength": "密码长度",
"ChangePassword": "更改密码",
"ModifySSHKey": "修改 SSH Key",
"Addressee": "收件人",
"OnlyMailSend": "当前只支持邮件发送",
"PasswordStrategy": "密码策略",
"SecretKeyStrategy": "密钥策略",
"RegularlyPerform": "定期执行",

View File

@@ -1266,6 +1266,10 @@
"Name": "Name",
"NodeAmount": "Node",
"PasswordLength": "Password length",
"ChangePassword": "Change password",
"ModifySSHKey": "Modify SSH Key",
"Addressee": "Addressee",
"OnlyMailSend": "Currently only mail sending is supported",
"PasswordStrategy": "Password strategy",
"SecretKeyStrategy": "Secret key strategy",
"RegularlyPerform": "Regularly perform",

View File

@@ -130,6 +130,8 @@ function getFields() {
}
const recipients = {
label: i18n.t('xpack.ChangeAuthPlan.Addressee'),
helpText: i18n.t('xpack.ChangeAuthPlan.OnlyMailSend'),
el: {
value: [],
ajax: {
@@ -155,10 +157,12 @@ function getFields() {
}
const is_password = {
label: i18n.t('xpack.ChangeAuthPlan.ChangePassword'),
type: 'switch'
}
const is_ssh_key = {
label: i18n.t('xpack.ChangeAuthPlan.ModifySSHKey'),
type: 'switch'
}

View File

@@ -10793,6 +10793,13 @@ vue-jest@^3.0.4:
tsconfig "^7.0.0"
vue-template-es2015-compiler "^1.6.0"
vue-json-editor@^1.4.3:
version "1.4.3"
resolved "https://registry.yarnpkg.com/vue-json-editor/-/vue-json-editor-1.4.3.tgz#004c9037ac91f16dd8fc558c9914e5f33a41d71c"
integrity sha512-st9HdXBgCnyEmmfWrZQiKzp4KuYXzmYVUNDn5h6Fa18MrrGS1amnyUFyv7hQFsNBDW27B7BKkdGOqszYT1srAg==
dependencies:
vue "^2.2.6"
vue-loader@^15.7.0:
version "15.9.1"
resolved "https://registry.yarnpkg.com/vue-loader/-/vue-loader-15.9.1.tgz#bd2ab8f3d281e51d7b81d15390a58424d142243e"
@@ -10850,6 +10857,11 @@ vue@2.6.11:
resolved "https://registry.npm.taobao.org/vue/download/vue-2.6.11.tgz?cache=0&sync_timestamp=1587135947786&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue%2Fdownload%2Fvue-2.6.11.tgz#76594d877d4b12234406e84e35275c6d514125c5"
integrity sha1-dllNh31LEiNEBuhONSdcbVFBJcU=
vue@^2.2.6:
version "2.6.14"
resolved "https://registry.yarnpkg.com/vue/-/vue-2.6.14.tgz#e51aa5250250d569a3fbad3a8a5a687d6036e235"
integrity sha512-x2284lgYvjOMj3Za7kqzRcUSxBboHqtgRE2zlos1qWaOye5yUmHn42LB1250NJBLRwEcdrB0JRwyPTEPhfQjiQ==
vuejs-logger@^1.5.4:
version "1.5.4"
resolved "https://registry.npm.taobao.org/vuejs-logger/download/vuejs-logger-1.5.4.tgz#c8bb12ed29ca90b8087144a44ad852d9bd170c6e"