修改国际化

This commit is contained in:
ival 2019-08-21 13:48:06 +08:00
parent 09af43a690
commit b5a93f7ce1
16 changed files with 185 additions and 120 deletions

View File

@ -55,6 +55,7 @@ export default {
batchCreateFailed: 'Batch build operation definition failed',
createOperateRuleFailed: 'Failed to create operation definition',
createOperateStepFailed: 'The create action step failed',
updateOperateStepFailed: 'The update action step failed'
updateOperateStepFailed: 'The update action step failed',
packagePermissionFailed: 'Packaging authority failed'
};

View File

@ -96,5 +96,8 @@ export default {
distributePermission: 'Distribute permission',
transferQRCode: 'Transfer QRCode',
minutes: 'minutes',
minute: 'minute'
minute: 'minute',
totoal: 'Totoal',
publishPermission: 'The public authority',
specialPermission: 'Special permission'
};

View File

@ -488,6 +488,8 @@ export default {
switchBCode: 'Switch number 2',
switchACodeNum: 'Switch ID 1:',
switchBCodeNum: 'Switch ID 2:'
switchBCodeNum: 'Switch ID 2:',
wellDelTrianModel: 'Deleting the train model will delete the associated class cars together, please confirm whether to continue?'
};

View File

@ -15,5 +15,17 @@ export default {
startTime: 'Start Time',
endTime: 'End Time',
belonger: 'Owner',
userList: 'User List'
userList: 'User List',
customPackageRules: 'Custom packaging rules',
addRules: 'Add rules',
package: 'Pack',
getQrcode: 'Get qr code',
hasExitRule: 'This type rule already exists',
pleaseAddRule: 'Please add rules',
selectDate: 'Select time',
addPermissionPackageRule: 'Add authority packaging rules',
editPermissionPackageRule: 'edit authority packaging rule',
restPermissionMaxNumber: '(maximum number of remaining permissions: {0})',
pleaseSelectTransferPermission: 'Select transfer permissions'
};

View File

@ -217,5 +217,11 @@ export default {
inputSkinType: 'Please select skin type',
inputOperateCode: 'Please enter the step code',
inputStepNo: 'Please enter the step number',
inputStepTips: 'Please enter step number. Please enter step prompt'
inputStepTips: 'Please enter step number. Please enter step prompt',
selectMapName: 'Please select a map name',
selectMapProductName: 'Please select map product name',
inputTime: 'Please enter time',
inputPermissionNumber: 'Please enter the number of permissions',
permissionNumberGreater0: 'The number of permissions must be greater than 0'
};

View File

@ -5,7 +5,7 @@ export default {
creatingFailed: 'Create a failure',
confirmDeletion: 'Confirm deletion?',
confirmBatchGeneration: 'Is batch generation confirmed?',
hint: 'hint',
hint: 'Tips',
cancelledDelete: 'Cancelled delete',
cancelGeneration: 'Batch generation has been cancelled',

View File

@ -55,6 +55,7 @@ export default {
batchCreateFailed: '批量生成操作定义失败',
createOperateRuleFailed: '创建操作定义失败',
createOperateStepFailed: '创建操作步骤失败',
updateOperateStepFailed: '更新操作步骤失败'
updateOperateStepFailed: '更新操作步骤失败',
packagePermissionFailed: '打包权限失败'
};

View File

@ -97,5 +97,8 @@ export default {
distributePermission: '权限分发',
transferQRCode: '权限转赠',
minutes: '分钟',
minute: '分钟'
minute: '分钟',
totoal: '总数',
publishPermission: '公用权限',
specialPermission: '专用权限'
};

View File

@ -490,6 +490,8 @@ export default {
switchBCode: '道岔2编号',
switchACodeNum: '道岔ID 1:',
switchBCodeNum: '道岔ID 2:'
switchBCodeNum: '道岔ID 2:',
wellDelTrianModel: '删除车模型会将关联的类车一起删除,请确认是否继续?'
};

View File

@ -15,5 +15,17 @@ export default {
startTime: '开始时间',
endTime: '结束时间',
belonger: '归属人',
userList: '用户列表'
userList: '用户列表',
customPackageRules: '定制打包规则',
addRules: '添加规则',
package: '打包',
getQrcode: '获取二维码',
hasExitRule: '已存在此类型规则',
pleaseAddRule: '请添加规则',
selectDate: '选择时间',
addPermissionPackageRule: '增加权限打包规则',
editPermissionPackageRule: '编辑权限打包规则',
restPermissionMaxNumber: '(剩余最大权限个数:{0}',
pleaseSelectTransferPermission: '选择转赠权限'
};

View File

@ -224,6 +224,11 @@ export default {
inputTrainingRemark: '请输入实训说明',
inputOperateCode: '请输入步骤操作码',
inputStepNo: '请输入步骤序号',
inputStepTips: '请输入步骤提示信息'
inputStepTips: '请输入步骤提示信息',
selectMapName: '请选择地图名称',
selectMapProductName: '请选择地图产品名称',
inputTime: '请输入时间',
inputPermissionNumber: '请输入权限个数',
permissionNumberGreater0: '权限个数必须大于0'
};

View File

@ -109,6 +109,8 @@ export default {
this.$emit('dispatch', { callback: 'delTrainMode', params: code});
},
handleConfirm() {
this.$refs['form'].validate((valid) => {
if (valid) {
const list = [];
switch (this.mode) {
@ -135,6 +137,8 @@ export default {
this.$emit('dispatch', { callback: 'create', params: list});
this.doClose();
}
});
}
}
};
</script>

View File

@ -156,7 +156,13 @@ export default {
} else if (this.isUpt) {
this.operateTrainModel({ model: this.formModel, type: 'UPT' });
} else if (this.isDel) {
this.$confirm(this.$t('map.wellDelTrianModel'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
this.operateTrainModel({ model: this.formModel, type: 'DEL'});
}).catch(() => { });
}
this.doClose();
}

View File

@ -1,10 +1,18 @@
<template>
<el-dialog :title="title" :visible.sync="show" width="360px" :before-close="doClose" :zIndex="2000" :modal="false"
:close-on-click-modal="false" v-dialogDrag>
<el-dialog
v-dialogDrag
:title="title"
:visible.sync="show"
width="360px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<div style="text-align:center">
<el-radio-group v-model="formModel.canDistribute">
<el-radio :label="true">公用权限</el-radio>
<el-radio :label="false">专用权限</el-radio>
<el-radio :label="true">{{ $t('global.publishPermission') }}</el-radio>
<el-radio :label="false">{{ $t('global.specialPermission') }}</el-radio>
</el-radio-group>
</div>
<span slot="footer" class="dialog-footer">
@ -14,22 +22,22 @@
</el-dialog>
</template>
<script>
export default {
export default {
name: 'CanTransfer',
data() {
return {
dialogShow: false,
formModel: {
canDistribute: true,
},
canDistribute: true
}
};
},
computed: {
show() {
return this.dialogShow;
},
title() { return '选择转赠权限'; }
title() { return this.$t('permission.pleaseSelectTransferPermission'); }
},
methods: {
doShow(data) {
@ -47,5 +55,5 @@
this.doClose();
}
}
}
};
</script>

View File

@ -51,7 +51,7 @@ export default {
},
DatePicker: {
shortcuts: [{
text: '今天',
text: this.$t('global.today'),
onClick(picker) {
picker.$emit('pick', new Date());
}
@ -66,13 +66,13 @@ export default {
const form = {
labelWidth: '120px',
items: [
{ prop: 'permissionType', label: '权限类型', type: 'select', required: false, disabled: !this.isAdd, options: this.PermissionTypeList, change: true, onChange: this.permissionTypeChange },
{ prop: 'mapId', label: '地图名称', type: 'select', required: false, disabled: !this.isAdd, show: this.isShowMap, options: this.PublishMapList, change: true, onChange: this.mapChange },
{ prop: 'mapProductCode', label: '地图产品名称', type: 'select', required: false, disabled: !this.isAdd, show: this.isShowMapProduct, options: this.mapProductList, change: true, onChange: this.mapProductChange },
{ prop: 'lessonId', label: '课程名称', type: 'select', required: false, disabled: !this.isAdd, show: this.isShowLesson, options: this.filterPublisLessonList },
{ prop: 'roleName', label: '选择权限所有者', type: 'complete', required: false, disabled: !this.isAdd, show: this.isShowRole, querySearchAsync: this.querySearchAsync, handleSelect: this.prdSelect, placeholder: '请输入昵称/名字/手机号' },
{ prop: 'date', label: '选择时间', type: 'daterange', required: false, viewFormat: 'yyyy-MM-dd HH:mm:ss', valueFormat: 'yyyy-MM-dd HH:mm:ss' },
{ prop: 'amount', label: '权限个数', type: 'number', required: false, min: 0, max: this.maxTotal, message: this.numberMessage }
{ prop: 'permissionType', label: this.$t('permission.permissionType'), type: 'select', required: false, disabled: !this.isAdd, options: this.PermissionTypeList, change: true, onChange: this.permissionTypeChange },
{ prop: 'mapId', label: this.$t('permission.mapName'), type: 'select', required: false, disabled: !this.isAdd, show: this.isShowMap, options: this.PublishMapList, change: true, onChange: this.mapChange },
{ prop: 'mapProductCode', label: this.$t('permission.mapProductName'), type: 'select', required: false, disabled: !this.isAdd, show: this.isShowMapProduct, options: this.mapProductList, change: true, onChange: this.mapProductChange },
{ prop: 'lessonId', label: this.$t('permission.lessonName'), type: 'select', required: false, disabled: !this.isAdd, show: this.isShowLesson, options: this.filterPublisLessonList },
{ prop: 'roleName', label: this.$t('permission.belonger'), type: 'complete', required: false, disabled: !this.isAdd, show: this.isShowRole, querySearchAsync: this.querySearchAsync, handleSelect: this.prdSelect, placeholder: '请输入昵称/名字/手机号' },
{ prop: 'date', label: this.$t('permission.selectDate'), type: 'daterange', required: false, viewFormat: 'yyyy-MM-dd HH:mm:ss', valueFormat: 'yyyy-MM-dd HH:mm:ss' },
{ prop: 'amount', label: this.$t('permission.permissionTotal'), type: 'number', required: false, min: 0, max: this.maxTotal, message: this.numberMessage }
]
};
return form;
@ -80,28 +80,28 @@ export default {
rules() {
const crules = {
permissionType: [
{ required: true, message: '请选择权限类型', trigger: 'change' }
{ required: true, message: this.$t('rules.permissionTypeInput'), trigger: 'change' }
],
mapId: [
{ required: true, message: '请选择地图名称', trigger: 'change' }
{ required: true, message: this.$t('rules.selectMapName'), trigger: 'change' }
],
mapProductCode: [
{ required: true, message: '请选择地图产品名称', trigger: 'change' }
{ required: true, message: this.$t('rules.selectMapProductName'), trigger: 'change' }
],
lessonId: [
{ required: true, message: '请选择课程', trigger: 'change' }
{ required: true, message: this.$t('rules.lessonInput'), trigger: 'change' }
],
date: [
{ required: true, message: '请输入时间', trigger: 'blur' }
{ required: true, message: this.$t('rules.inputTime'), trigger: 'blur' }
],
amount: [
{ required: true, message: '请输入权限个数', trigger: 'change' },
{ required: true, message: this.$t('rules.inputPermissionNumber'), trigger: 'change' },
{
validator(rule, value, callback) {
if (Number.isInteger(Number(value)) && Number(value) > 0) {
callback();
} else {
callback(new Error('权限个数必须大于0'));
callback(new Error(this.$t('rules.permissionNumberGreater0')));
}
},
trigger: 'blur'
@ -112,9 +112,9 @@ export default {
},
title() {
if (this.isAdd) {
return '增加权限打包规则';
return this.$t('permission.addPermissionPackageRule');
} else {
return '编辑权限打包规则';
return this.$t('permission.editPermissionPackageRule');
}
},
disabled() {
@ -179,7 +179,7 @@ export default {
getTotalRemains(model).then(response => {
this.maxTotal = response.data;
this.numberMessage = `(剩余最大权限个数:${this.maxTotal}`;
this.numberMessage = this.$t('permission.restPermissionMaxNumber').replace('{0}', this.maxTotal);
}).catch(() => {
this.numberMessage = '';
});

View File

@ -3,11 +3,11 @@
<div class="pack-box" :style="{ height: height +'px' }">
<el-scrollbar wrap-class="scrollbar-wrapper" style="">
<el-steps class="steps" :active="display">
<el-step title="制定打包规则" icon="el-icon-edit" />
<el-step :title="$t('permission.customPackageRules')" icon="el-icon-edit" />
<el-step icon="el-icon-setting" />
</el-steps>
<el-card class="forms pack-rule">
<el-button class="addList" size="small" @click="dialogAdd">添加规则</el-button>
<el-button class="addList" size="small" @click="dialogAdd">{{ $t('permission.addRules') }}</el-button>
<el-table
:data="ruleList"
border
@ -16,41 +16,41 @@
style="width: 100%"
:height="height-300"
>
<el-table-column prop="permissionType" label="权限类型" width="80">
<el-table-column prop="permissionType" :label="$t('permission.permissionType')" width="80">
<template slot-scope="scope">
{{ computedName(PermissionTypeList, scope.row.permissionType) }}
</template>
</el-table-column>
<el-table-column prop="mapId" label="地图名称">
<el-table-column prop="mapId" :label="$t('permission.mapName')">
<template slot-scope="scope">
{{ computedName(PublishMapList, scope.row.mapId) }}
</template>
</el-table-column>
<el-table-column prop="mapProductCode" label="产品名称" width="80">
<el-table-column prop="mapProductCode" :label="$t('permission.mapProductName')" width="80">
<template slot-scope="scope">
{{ scope.row.mapProductCode }}
</template>
</el-table-column>
<el-table-column prop="lessonId" label="课程名称">
<el-table-column prop="lessonId" :label="$t('permission.lessonName')">
<template slot-scope="scope">
{{ computedName(PublisLessonList, scope.row.lessonId) }}
</template>
</el-table-column>
<el-table-column prop="startTime" label="起始时间" width="80" />
<el-table-column prop="endTime" label="结束时间" width="80" />
<el-table-column prop="amount" label="分配权限数量" width="110" />
<el-table-column label="操作" width="90">
<el-table-column prop="startTime" :label="$t('permission.startTime')" width="80" />
<el-table-column prop="endTime" :label="$t('permission.endTime')" width="80" />
<el-table-column prop="amount" :label="$t('permission.permissionTotal')" width="110" />
<el-table-column l:abel="$t('global.operate')" width="90">
<template slot-scope="scope">
<el-button type="text" size="small" @click="dialogEdit(scope.row)">修改</el-button>
<el-button type="text" size="small" @click="deleteForm(scope.row)">删除</el-button>
<el-button type="text" size="small" @click="dialogEdit(scope.row)">{{ $t('global.edit') }}</el-button>
<el-button type="text" size="small" @click="deleteForm(scope.row)">{{ $t('global.delete') }}</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<div class="draft">
<el-button-group>
<el-button v-if="!urlInfo.url" type="primary" @click="packForm">打包</el-button>
<el-button v-if="urlInfo.url" type="primary" @click="qrcodeShow">获取二维码</el-button>
<el-button v-if="!urlInfo.url" type="primary" @click="packForm">{{ $t('permission.package') }}</el-button>
<el-button v-if="urlInfo.url" type="primary" @click="qrcodeShow">{{ $t('permission.getQrcode') }}</el-button>
<el-button type="primary" @click="turnback">{{ $t('global.back') }}</el-button>
</el-button-group>
</div>
@ -109,7 +109,7 @@ export default {
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '总数';
sums[index] = this.$t('global.totoal');
return;
}
@ -212,7 +212,7 @@ export default {
if (index < 0) {
this.ruleList.push(item);
} else {
this.$message.warning('已存在此类型规则');
this.$message.warning(this.$t('permission.hasExitRule'));
}
},
editRuleForm(item) {
@ -231,7 +231,7 @@ export default {
if (this.ruleList.length) {
this.$refs.canDistribute.doShow();
} else {
this.$messageBox('请添加规则');
this.$messageBox(this.$t('permission.pleaseAddRule'));
}
},
distribute(data) {
@ -242,11 +242,11 @@ export default {
packagePermissionDistribute(this.ruleList).then(resp => {
this.urlInfo = {
url: resp.data,
title: '权限分发二维码'
title: this.$t('global.distributeQrcode')
};
this.qrcodeShow();
}).catch(() => {
this.$messageBox('打包权限失败');
this.$messageBox(this.$t('error.packagePermissionFailed'));
});
},
qrcodeShow() {