fix: 修复 select 占位符,未国际化

This commit is contained in:
@changcode
2021-10-13 15:47:56 +08:00
parent fb75689518
commit 6838c990c6
4 changed files with 8 additions and 7 deletions

View File

@@ -26,6 +26,7 @@
class="right-box__select" class="right-box__select"
popper-class="right-box-select-top right-public-box-dropdown-top prevent-clickoutside" popper-class="right-box-select-top right-public-box-dropdown-top prevent-clickoutside"
size="small" size="small"
:placeholder="$t('el.select.placeholder')"
value-key="id"> value-key="id">
<el-option v-for="p in options.parentAssetOptions" :key="p.id" :label="p.name" :value="p.id"></el-option> <el-option v-for="p in options.parentAssetOptions" :key="p.id" :label="p.name" :value="p.id"></el-option>
</el-select> </el-select>
@@ -108,7 +109,7 @@
</el-checkbox-group> </el-checkbox-group>
</template> </template>
<template v-else-if="label.type.toUpperCase() === assetConstants.labelTypeData.SELECT"> <template v-else-if="label.type.toUpperCase() === assetConstants.labelTypeData.SELECT">
<el-select v-model="label.value[0]" class="right-box__select" popper-class="right-box-select-top right-public-box-dropdown-top prevent-clickoutside" size="small"> <el-select v-model="label.value[0]" class="right-box__select" :placeholder="$t('el.select.placeholder')" popper-class="right-box-select-top right-public-box-dropdown-top prevent-clickoutside" size="small">
<el-option v-for="item in JSON.parse(label.param).items" :key="item.name" :label="item.name" :value="item.name"></el-option> <el-option v-for="item in JSON.parse(label.param).items" :key="item.name" :label="item.name" :value="item.name"></el-option>
</el-select> </el-select>
</template> </template>
@@ -177,7 +178,7 @@
<template v-if="editAsset.type && editAsset.type.authProtocol === assetConstants.authProtocolData.ssh"> <template v-if="editAsset.type && editAsset.type.authProtocol === assetConstants.authProtocolData.ssh">
<div class="form__sub-title">SSH</div> <div class="form__sub-title">SSH</div>
<el-form-item :label="$t('asset.authType')" prop="authType"> <el-form-item :label="$t('asset.authType')" prop="authType">
<el-select v-model="editAsset.authType" class="right-box__select" popper-class="right-box-select-top right-public-box-dropdown-top prevent-clickoutside" size="small" value-key="value"> <el-select v-model="editAsset.authType" class="right-box__select" :placeholder="$t('el.select.placeholder')" popper-class="right-box-select-top right-public-box-dropdown-top prevent-clickoutside" size="small" value-key="value">
<el-option v-for="type in assetConstants.authTypeOptions" :key="type.value" :label="type.label" :value="type.value"/> <el-option v-for="type in assetConstants.authTypeOptions" :key="type.value" :label="type.label" :value="type.value"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
@@ -220,7 +221,7 @@
<template v-if="editAsset.type && editAsset.type.snmpEnable === 1"> <template v-if="editAsset.type && editAsset.type.snmpEnable === 1">
<div class="form__sub-title">SNMP</div> <div class="form__sub-title">SNMP</div>
<el-form-item :label="$t('asset.snmpCredential')" prop="snmpCredentialId"> <el-form-item :label="$t('asset.snmpCredential')" prop="snmpCredentialId">
<el-select v-model="editAsset.snmpCredentialId" class="right-box__select" popper-class="right-box-select-top right-public-box-dropdown-top prevent-clickoutside" size="small" value-key="id"> <el-select v-model="editAsset.snmpCredentialId" class="right-box__select" :placeholder="$t('el.select.placeholder')" popper-class="right-box-select-top right-public-box-dropdown-top prevent-clickoutside" size="small" value-key="id">
<el-option v-for="snmp in options.snmpCredentialOptions" :key="snmp.id" :label="snmp.name" :value="snmp.id"></el-option> <el-option v-for="snmp in options.snmpCredentialOptions" :key="snmp.id" :label="snmp.name" :value="snmp.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>

View File

@@ -41,7 +41,7 @@
</template> </template>
<template v-if="item.prop == 'role'"> <template v-if="item.prop == 'role'">
<el-popover :content="rules.roleId.message" placement="top" trigger="manual" v-model="rules.roleId.switch" popper-class="small-pop warn-pop" @after-enter="popShow(rules.roleId)"> <el-popover :content="rules.roleId.message" placement="top" trigger="manual" v-model="rules.roleId.switch" popper-class="small-pop warn-pop" @after-enter="popShow(rules.roleId)">
<el-select v-model="scope.row[item.prop]" size="small" value-key="id" slot="reference" popper-class="api-select right-public-box-select-top right-public-box-dropdown-top role-system-table"> <el-select v-model="scope.row[item.prop]" size="small" :placeholder="$t('el.select.placeholder')" value-key="id" slot="reference" popper-class="api-select right-public-box-select-top right-public-box-dropdown-top role-system-table">
<template v-for="role in roles" > <template v-for="role in roles" >
<el-option :label="role.name" :value="role"></el-option> <el-option :label="role.name" :value="role"></el-option>
</template> </template>

View File

@@ -46,7 +46,7 @@
</template> </template>
<template v-if="item.prop == 'account'"> <template v-if="item.prop == 'account'">
<el-popover :content="rules.account.message" placement="top" trigger="manual" v-model="rules.account.switch" popper-class="small-pop warn-pop" @after-enter="popShow(rules.account)"> <el-popover :content="rules.account.message" placement="top" trigger="manual" v-model="rules.account.switch" popper-class="small-pop warn-pop" @after-enter="popShow(rules.account)">
<el-select slot="reference" v-model="scope.row[item.prop]" size="small" popper-class="right-public-box-select-top right-public-box-dropdown-top"> <el-select slot="reference" v-model="scope.row[item.prop]" :placeholder="$t('el.select.placeholder')" size="small" popper-class="right-public-box-select-top right-public-box-dropdown-top">
<template v-for="param in accountParams"> <template v-for="param in accountParams">
<el-option :label="param.label" :value="param.value"></el-option> <el-option :label="param.label" :value="param.value"></el-option>
</template> </template>

View File

@@ -11,12 +11,12 @@
clearable></el-cascader> clearable></el-cascader>
</el-form-item> </el-form-item>
<el-form-item :label="$t('dashboard.panel.chartForm.alertParam.alertRule')"> <el-form-item :label="$t('dashboard.panel.chartForm.alertParam.alertRule')">
<el-select class="form-item" size="small" popper-class="alert-form-pop right-public-box-dropdown-top right-public-box-select-top no-style-class" v-model="parameters.alertRule" clearable id="alert-param-alertrule"> <el-select class="form-item" size="small" :placeholder="$t('el.select.placeholder')" popper-class="alert-form-pop right-public-box-dropdown-top right-public-box-select-top no-style-class" v-model="parameters.alertRule" clearable id="alert-param-alertrule">
<el-option v-for="(rule, index) in alertRules" :key="index" :label="rule.name" :value="rule.id"></el-option> <el-option v-for="(rule, index) in alertRules" :key="index" :label="rule.name" :value="rule.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('dashboard.panel.chartForm.alertParam.level')" prop="level" class="severity-box"> <el-form-item :label="$t('dashboard.panel.chartForm.alertParam.level')" prop="level" class="severity-box">
<el-select class="form-item" size="small" popper-class="alert-form-pop right-public-box-select-top right-public-box-dropdown-top no-style-class" v-model="parameters.level" clearable id="alert-param-level"> <el-select class="form-item" size="small" :placeholder="$t('el.select.placeholder')" popper-class="alert-form-pop right-public-box-select-top right-public-box-dropdown-top no-style-class" v-model="parameters.level" clearable id="alert-param-level">
<el-option v-for="item in alertPriority" :id="'alert-severity-'+item.value" :key="item.id" :label="item.name" :value="item.id"> <el-option v-for="item in alertPriority" :id="'alert-severity-'+item.value" :key="item.id" :label="item.name" :value="item.id">
<span> <span>
<i class="nz-icon nz-icon-circle" :style="{color:item.color,'font-size':'12px'}"></i> {{item.name}} <i class="nz-icon nz-icon-circle" :style="{color:item.color,'font-size':'12px'}"></i> {{item.name}}