Commit 223ee884 authored by dragondean@qq.com's avatar dragondean@qq.com

完善国际化

parent 235d5aad
import Vue from 'vue'
import VueI18n from './vue-i18n/vue-i18n.common'
import {getLocale} from '@/utils/db'
import enLocale from 'element-ui/lib/locale/lang/en'
import zhLocale from 'element-ui/lib/locale/lang/zh-CN'
Vue.use(VueI18n)
const i18n = new VueI18n({
locale: getLocale() || 'zh_CN',
formatFallbackMessages: true,
messages: {
'en_US': require('./languages/en_US.json'),
'zh_CN': require('./languages/zh_CN.json')
'en_US': Object.assign({}, enLocale, require('./languages/en_US.json')),
'zh_CN': Object.assign({}, zhLocale, require('./languages/zh_CN.json')),
}
})
......
......@@ -106,7 +106,8 @@ import '@/styles/index.scss'
*/
Vue.use(Element, {
size: Cookies.get('size') || 'medium' // set element-ui default size
size: Cookies.get('size') || 'medium', // set element-ui default size
i18n: (key, value) => i18n.t(key, value)
})
// 重定向路由(关闭当前标签)
Vue.prototype.$redirect = (path) =>{
......
......@@ -134,7 +134,7 @@
<!-- 列表 -->
<el-table v-loading="loading" :data="list" border>
<el-table-column label="优惠券ID" align="center" prop="couponId" />
<el-table-column :label="$t('优惠券ID')" align="center" prop="couponId" />
<el-table-column :label="$t('类型')" align="center" prop="type">
<template slot-scope="{row}">
<dict-tag :type="DICT_TYPE.ECW_COUPON_TYPE" :value="row.type" />
......@@ -146,7 +146,7 @@
{{$l(row, 'content')}}
</template>
</el-table-column> -->
<el-table-column label="发布人/发布时间" align="center" prop="startTime" width="180">
<el-table-column :label="$t('发布人') + '/' + $t('发布时间')" align="center" prop="startTime" width="180">
<template slot-scope="scope">
<div>{{ scope.row.creatorName }}</div>
<div>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</div>
......@@ -315,11 +315,11 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const couponId = row.couponId;
this.$modal.confirm('是否确认删除优惠券信息编号为"' + couponId + '"的数据项?').then(function() {
this.$confirm(this.$t('是否确认删除优惠券信息编号为{couponId}的数据项?', {couponId})).then(function() {
return deleteCoupon(couponId);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
this.$message.success(this.$t("删除成功"));
}).catch(() => {});
},
/** 导出按钮操作 */
......@@ -332,7 +332,7 @@ export default {
this.addBeginAndEndTime(params, this.dateRangeEndTime, 'endTime');
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
// 执行导出
this.$modal.confirm('是否确认导出所有优惠券信息数据项?').then(() => {
this.$confirm(this.$t('是否确认导出所有优惠券信息数据项?')).then(() => {
this.exportLoading = true;
return exportCouponExcel(params);
}).then(response => {
......
......@@ -89,7 +89,7 @@
<el-table-column prop="auditStatus" align="center" :label="$t('是否审核')" width="120">
<template slot-scope="scope">
<el-select v-model="scope.row.auditStatus" @change="handleStatusChange(scope.row, 'auditStatus')">
<el-option v-for="auditStatusItem in auditStatusDictDatas" :key="auditStatusItem.id" :label="auditStatusItem.label" :value="parseInt(auditStatusItem.value)" />
<el-option v-for="auditStatusItem in auditStatusDictDatas" :key="auditStatusItem.id" :label="$l(auditStatusItem, 'label')" :value="parseInt(auditStatusItem.value)" />
</el-select>
</template>
</el-table-column>
......@@ -310,7 +310,7 @@ export default {
for (let index in this.attrList) {
let attrItem = this.attrList[index];
if (attrItem.id == attrId) {
productAttrArray.push(attrItem.attrName);
productAttrArray.push(this.$l(attrItem, 'attrName'));
}
}
}
......
......@@ -29,7 +29,7 @@
<el-form-item :label="$t('商品特性')" prop="attrId">
<!-- <dict-selector form-type="checkbox" :type="DICT_TYPE.ECW_ORDER_ATTR" v-model="form.attrId" multiple /> -->
<el-checkbox-group v-model="attrIds">
<el-checkbox v-for="item in attrList" :label="item.id" :key="item.id">{{item.attrName}}</el-checkbox>
<el-checkbox v-for="item in attrList" :label="item.id" :key="item.id">{{$l(item, 'attrName')}}</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item :label="$t('商品材质')" prop="materialType">
......
......@@ -27,7 +27,11 @@
<el-table v-loading="loading" :data="list">
<el-table-column :label="$t('编号')" align="center" prop="id" />
<el-table-column :label="$t('排序')" align="center" prop="sort" />
<el-table-column :label="$t('属性名称')" align="center" prop="attrName" />
<el-table-column :label="$t('属性名称')" align="center">
<template slot-scope="{row}">
{{$l(row, 'attrName')}}
</template>
</el-table-column>
<el-table-column :label="$t('属性代码')" align="center" prop="attrCode" />
<el-table-column :label="$t('备注')" align="center" prop="remark" />
<el-table-column prop="status" :label="$t('状态')" width="100">
......
......@@ -4,26 +4,26 @@
<div slot="header" class="clearfix">
<el-button v-show="isShowDelete" style="float: right; padding: 3px 0" type="text" @click="$emit('delete')">{{ $t('删除') }}</el-button>
</div>
<el-form-item :label="'商标' + (index + 1)">
<el-form-item :label="$t('商标') + (index + 1)">
<el-input v-model="form.brandName" :placeholder="$t('商标')"></el-input>
</el-form-item>
<el-form-item :label="`商标${index + 1}分类`">
<el-select v-model="form.productTypeId" :placeholder="`请选择商标${index + 1}分类`" @change="form.productIds = [0], updateValue()">
<el-form-item :label="$t('商标{index}分类', {index: index + 1})">
<el-select v-model="form.productTypeId" :placeholder="$t('请选择商标{index}分类', {index: index + 1})" @change="form.productIds = [0], updateValue()">
<el-option
v-for="item in productTypeList"
:key="item.id"
:label="item.titleZh"
:label="$l(item, 'title')"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="`商标${index + 1}商品`">
<el-select v-model="form.productIds" :placeholder="`请选择商标${index + 1}商品`" multiple filterable clearable @change="updateValue">
<el-form-item :label="$t('商标{index}商品', {index: index+1})">
<el-select v-model="form.productIds" :placeholder="$t('请选择商标{index}商品', {index: index + 1})" multiple filterable clearable @change="updateValue">
<el-option
v-for="item in getProductListByTypeId(form.productTypeId)"
:key="item.id"
:label="item.titleZh"
:label="$l(item, 'title')"
:value="item.id"
>
</el-option>
......
......@@ -7,7 +7,7 @@
<el-option
v-for="type in productTypeList"
:key="type.id"
:label="type.titleZh"
:label="$l(type, 'title')"
:value="type.id"
></el-option>
</el-select>
......@@ -92,7 +92,7 @@
<el-link type="danger" @click.native="form.priceStepList.splice(index, 1)">{{$t('删除')}}</el-link>
</template>
</div>
<el-form-item :label="$t(`第{index}阶梯`, {index: index + 1})">
<el-form-item :label="$t('第{index}阶梯', {index: index + 1})">
<el-input v-model="item.startNum" type="number" placeholder="" class="w-100"></el-input>
-
<el-input v-model="item.endNum" type="number" placeholder="" class="w-100"></el-input>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment