国际化调整

This commit is contained in:
fan 2019-08-22 09:06:48 +08:00
parent 8553a9dcdc
commit 614aae8be0
30 changed files with 396 additions and 203 deletions

View File

@ -58,5 +58,10 @@ export default {
updateOperateStepFailed: 'The update action step failed',
packagePermissionFailed: 'Packaging authority failed',
acquisitionTimeFailed: 'Acquisition Time Failed',
getProductListFailed: 'Failed to get product list'
getProductListFailed: 'Failed to get product list',
obtainChapterDataFailed: 'Failed to obtain chapter data',
obtainCourseDetailsFailed: 'Failed to obtain course details',
obtainCourseInformationFailed: 'Failed to obtain course information',
obtainStepDataFailed: 'Failed to obtain step data'
};

16
src/i18n/langs/en/exam.js Normal file
View File

@ -0,0 +1,16 @@
export default {
testSystem: '城市轨道交通考试系统',
testSystemDescription: ' 该系统具有自定义考试规则、自动生成考卷、学员成绩统计、数据曲线分析及题库管理等功能,从实战操作、业务流程、故障模拟及考试规则等多角度出发,力求打造最符合用户需求的城市轨道交通在线交互实操类考试系统',
examResultsDetails: '考试结果详情',
testQuestionsName: '试题名称',
testScores: '考试得分',
points: '分',
whetherThrough: '是否通过',
didNotCalculate: '未计算',
pass: '通过',
notPass: '未通过',
examTime: '考试用时',
trainingName: '实训名称',
trainingScore: '实训得分',
returnToExamList: '返回考试列表'
};

View File

@ -103,5 +103,8 @@ export default {
mapList: 'Map list',
updateTime: 'Update time:',
line: 'Line:',
permissionList: 'Permissions list:'
permissionList: 'Permissions list:',
remove: 'remove',
append: 'append',
release: 'release'
};

View File

@ -16,6 +16,7 @@ import replay from './replay';
import planMonitor from './planMonitor';
import screenMonitor from './screenMonitor';
import demonstration from './demonstration';
import exam from './exam';
export default {
...enLocale,
@ -35,5 +36,6 @@ export default {
replay,
planMonitor,
screenMonitor,
demonstration
demonstration,
exam
};

View File

@ -48,5 +48,44 @@ export default {
eidtStepInfo: 'Edit Step Information',
product: 'Product',
remarks: 'Remarks',
operateSuccess: 'Operation successfully'
operateSuccess: 'Operation successfully',
createChapter: 'Create chapter',
contentSorting: 'Content sorting',
courseList: 'Course list',
createNewCoursesFromRelease: 'Create new courses from release',
courseName: 'Course name',
parentChapter: 'Parent chapter',
chapterName: 'Chapter name',
chapterInstructions: 'Chapter instructions',
associatedTraining: 'Associated training',
updateChapter: 'Update chapter',
automaticOrManual: 'Auto/Manual',
automatic: 'Automatic',
manual: 'Manual',
publishCourseName: 'Publish course name',
draftCourseName: 'Draft course name',
associatedSkin: 'Associated skin',
associatedProducts: 'Associated products',
courseDescription: 'Course description',
editCourse: 'Edit course',
createCourse: 'Create course',
courseRelease: 'Course release',
releaseAssociatedCity: 'Release associated city',
releaseAssociatedMap: 'Release associated map',
trainingSequence: 'Training sequence',
creationTime: 'Creation time',
finishTime: 'Finish time',
createResults: 'Create results',
start: 'start',
toPerform: 'To perform',
productType: 'Product type:',
minTime: 'Minimum time:',
maxTime: 'Largest time:',
trainingDescription: 'Training description:',
generateTraining: 'Generate training',
updateTraining: 'Update training',
deleteTraining: 'Delete training',
automaticGenerationOfTraining: 'Automatic generation of training',
modifyTrainingByCategory: 'Modify training by category',
deleteAutoGeneratedTraining: 'Delete auto-generated training'
};

View File

@ -222,6 +222,20 @@ export default {
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'
permissionNumberGreater0: 'The number of permissions must be greater than 0',
enterChapterName: 'Please enter chapter name',
enterChapterInstructions: 'Please enter chapter instructions',
selectCourseName: 'Please select the course name',
enterCourseName: 'Please enter the course name',
selectAssociatedProduct: 'Please select the associated product',
enterCourseDescription: 'Please enter the course description',
courseIdIsEmpty: 'Course Id is empty',
selectCity: 'Please select city',
enterStandardTime: 'Please enter standard time',
enterNumericValue: 'Please enter a numeric value',
greaterThanMinTime: 'Must be greater than the minimum time',
selectTrainingType: 'Please select training type',
selectOneTrainingType: 'Only one training type can be selected',
enterProductType: 'Please enter product type',
selectAssociatedStation: 'Please select the associated station'
};

View File

@ -106,5 +106,21 @@ export default {
permissionsNumber: 'Please enter the number of valid permissions',
purchaseMonth: 'Please enter a valid purchase month',
createRoomFailedHint: 'Each user can only create one comprehensive drill room. Do you want to enter the room?',
noPermissionHint: 'You do not have permission, please go to purchase products'
noPermissionHint: 'You do not have permission, please go to purchase products',
coursePublishSuccessful: 'Successful course release',
coursePublishFailed: 'Course launch failed',
startOperationHint: 'This operation will start the task. Do you want to continue?',
cancelsTaskHint: 'This action cancels the task. Do you want to continue?',
automaticGenerationTrainingSuccess: 'Automatic generation of training success',
automaticGenerationTrainingFailure: 'Automatic generation of training failure',
updateAutomaticGenerationTrainingSuccess: 'Update automatically generated training successfully',
updateAutomaticGenerationTrainingFailure: 'Update automatically generated training failure',
deleteAutomaticGenerationTrainingSuccess: 'Delete automatic generation training successfully',
deleteAutomaticGenerationTrainingFailure: 'Delete automatic generation training failure',
addTrainingSuccessfully: 'Add training successfully!',
addTrainingFailed: 'Failed to add training',
updateTrainingSuccessfully: 'Update training successfully!',
updateTrainingFailed: 'Failed to update training',
savedStepDataSuccessfully: 'Saved step data successfully',
savedStepDataFailed: 'Failed to save step data'
};

View File

@ -58,6 +58,9 @@ export default {
updateOperateStepFailed: '更新操作步骤失败',
packagePermissionFailed: '打包权限失败',
acquisitionTimeFailed: '获取时间失败',
getProductListFailed: '获取产品列表失败'
getProductListFailed: '获取产品列表失败',
obtainChapterDataFailed: '获取章节数据失败',
obtainCourseDetailsFailed: '获取课程详情失败',
obtainCourseInformationFailed: '获取课程信息失败',
obtainStepDataFailed: '获取步骤数据失败'
};

16
src/i18n/langs/zh/exam.js Normal file
View File

@ -0,0 +1,16 @@
export default {
testSystem: '城市轨道交通考试系统',
testSystemDescription: ' 该系统具有自定义考试规则、自动生成考卷、学员成绩统计、数据曲线分析及题库管理等功能,从实战操作、业务流程、故障模拟及考试规则等多角度出发,力求打造最符合用户需求的城市轨道交通在线交互实操类考试系统',
examResultsDetails: '考试结果详情',
testQuestionsName: '试题名称',
testScores: '考试得分',
points: '分',
whetherThrough: '是否通过',
didNotCalculate: '未计算',
pass: '通过',
notPass: '未通过',
examTime: '考试用时',
trainingName: '实训名称',
trainingScore: '实训得分',
returnToExamList: '返回考试列表'
};

View File

@ -128,5 +128,8 @@ export default {
mapList: '地图列表',
updateTime: '更新时间:',
line: '线路:',
permissionList: '权限列表:'
permissionList: '权限列表:',
remove: '移除',
append: '添加',
release: '发布'
};

View File

@ -16,6 +16,7 @@ import replay from './replay';
import planMonitor from './planMonitor';
import screenMonitor from './screenMonitor';
import demonstration from './demonstration';
import exam from './exam';
export default {
...cnLocale,
@ -35,5 +36,6 @@ export default {
replay,
planMonitor,
screenMonitor,
demonstration
demonstration,
exam
};

View File

@ -45,9 +45,48 @@ export default {
stepReturn: '步骤返回值',
stepTips: '步骤提示信息',
createStepInfo: '创建步骤信息',
eidtStepInfo: '编辑步骤信息',
editStepInfo: '编辑步骤信息',
product: '产品',
remarks: '描述',
operateSuccess: '操作成功'
operateSuccess: '操作成功',
createChapter: '创建章节',
contentSorting: '内容排序',
courseList: '课程列表',
createNewCoursesFromRelease: '从发布课程新建',
courseName: '课程名称:',
parentChapter: '父级章节:',
chapterName: '章节名称:',
chapterInstructions: '章节说明:',
associatedTraining: '关联实训:',
updateChapter: '更新章节',
automaticOrManual: '自动/人工',
automatic: '自动',
manual: '人工',
publishCourseName: '发布课程名称:',
draftCourseName: '草稿课程名称:',
associatedSkin: '关联皮肤:',
associatedProducts: '关联产品:',
courseDescription: '课程说明:',
editCourse: '编辑课程',
createCourse: '创建课程',
courseRelease: '课程发布',
releaseAssociatedCity: '发布关联城市:',
releaseAssociatedMap: '发布关联地图:',
trainingSequence: '实训排序',
creationTime: '创建时间',
finishTime: '完成时间',
createResults: '创建结果',
start: '开始',
toPerform: '重新执行',
productType: '产品类型:',
minTime: '最小用时:',
maxTime: '最大用时:',
trainingDescription: '实训描述:',
generateTraining: '生成实训',
updateTraining: '修改实训',
deleteTraining: '删除实训',
automaticGenerationOfTraining: '自动生成实训',
modifyTrainingByCategory: '按类别修改实训',
deleteAutoGeneratedTraining: '删除自动生成实训'
};

View File

@ -232,6 +232,21 @@ export default {
selectMapProductName: '请选择地图产品名称',
inputTime: '请输入时间',
inputPermissionNumber: '请输入权限个数',
permissionNumberGreater0: '权限个数必须大于0'
permissionNumberGreater0: '权限个数必须大于0',
enterChapterName: '请输入章节名称',
enterChapterInstructions: '请输入章节说明',
selectCourseName: '请选择课程名称',
enterCourseName: '请输入课程名称',
selectAssociatedProduct: '请选择关联产品',
enterCourseDescription: '请输入课程说明',
courseIdIsEmpty: '课程Id为空',
selectCity: '请选择城市',
enterStandardTime: '请输入标准用时',
enterNumericValue: '请输入数字值',
greaterThanMinTime: '必须大于最小时间',
selectTrainingType: '请选择实训类型',
selectOneTrainingType: '只能选择一个实训类型',
enterProductType: '请输入产品类型',
selectAssociatedStation: '请选择关联的车站'
};

View File

@ -106,5 +106,21 @@ export default {
permissionsNumber: '请输入有效的权限个数',
purchaseMonth: '请输入有效的购买月数',
createRoomFailedHint: '每个用户只能创建一个综合演练房间, 是否进入房间?',
noPermissionHint: '您没有权限,请前往购买产品'
noPermissionHint: '您没有权限,请前往购买产品',
coursePublishSuccessful: '课程发布成功',
coursePublishFailed: '课程发布失败',
startOperationHint: '此操作将开始任务, 是否继续?',
cancelsTaskHint: '此操作将取消任务, 是否继续?',
automaticGenerationTrainingSuccess: '自动生成实训成功',
automaticGenerationTrainingFailure: '自动生成实训失败',
updateAutomaticGenerationTrainingSuccess: '更新自动生成实训成功',
updateAutomaticGenerationTrainingFailure: '更新自动生成实训失败',
deleteAutomaticGenerationTrainingSuccess: '删除自动生成实训成功',
deleteAutomaticGenerationTrainingFailure: '删除自动生成实训失败',
addTrainingSuccessfully: '添加实训成功!',
addTrainingFailed: '添加实训失败',
updateTrainingSuccessfully: '更新实训成功!',
updateTrainingFailed: '更新实训失败',
savedStepDataSuccessfully: '保存步骤数据成功',
savedStepDataFailed: '保存步骤数据失败'
};

View File

@ -3,7 +3,7 @@
<div class="home-box" :style="{height: height+'px'}">
<el-scrollbar wrap-class="scrollbar-wrapper" style="margin-top:5px;">
<h1 class="title">
城市轨道交通考试系统
{{$t('exam.testSystem')}}
<img :src="logo" alt="" class="logo-img">
</h1>
<div class="card-box">
@ -14,7 +14,7 @@
</el-carousel>
</div>
<div class="brief-box">
该系统具有自定义考试规则自动生成考卷学员成绩统计数据曲线分析及题库管理等功能从实战操作业务流程故障模拟及考试规则等多角度出发力求打造最符合用户需求的城市轨道交通在线交互实操类考试系统
{{$t('exam.testSystemDescription')}}
</div>
</el-scrollbar>
</div>

View File

@ -33,17 +33,17 @@
menu: [],
lessonMenu: [
{
label: '创建章节',
label: this.$t('lesson.createChapter'),
handler: this.addSection,
},
{
label: '内容排序',
label: this.$t('lesson.contentSorting'),
handler: this.treeSort,
}
],
chapterMenu: [
{
label: '创建章节',
label: this.$t('lesson.createChapter'),
handler: this.addSection,
}
]
@ -101,13 +101,13 @@
},
deleteObj() {
let _that = this;
this.$confirm('是否确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
this.$confirm(this.$('tip.confirmDeletion'), this.$('global.tips'), {
confirmButtonText: this.$('global.confirm'),
cancelButtonText: this.$('global.cancel'),
type: 'warning'
}).then(() => {
}).catch(() => {
this.$messageBox('已取消删除');
this.$messageBox(this.$('tip.cancelledDelete'));
});
}
}

View File

@ -1,10 +1,10 @@
<template>
<el-card class="map-list-main" v-loading="loading">
<div slot="header" class="clearfix">
<span>课程列表</span>
<el-button type="text" @click="publishCreate" style="float: right; padding: 3px 0">从发布课程新建</el-button>
<span>{{$t('lesson.courseList')}}</span>
<el-button type="text" @click="publishCreate" style="float: right; padding: 3px 0">{{$t('lesson.createNewCoursesFromRelease')}}</el-button>
</div>
<el-input placeholder="输入关键字进行过滤" v-model="filterText" clearable> </el-input>
<el-input :placeholder="this.$t('global.filteringKeywords')" v-model="filterText" clearable> </el-input>
<el-scrollbar wrapClass="scrollbar-wrapper" :style="{height: (height - 55) + 'px'}">
<el-tree ref="lessonTree" :data="treeData" :props="defaultProps" :filter-node-method="filterNode"
@node-contextmenu="showContextMenu" draggable :allow-drop="allowDrop" :allow-drag="allowDrag"
@ -156,7 +156,7 @@
this.treeData = this.convertTreeData(response.data);
this.$nextTick(() => { this.loading = false; });
}).catch(error => {
this.$messageBox('刷新失败');
this.$messageBox(this.$t('error.refreshFailed'));
this.loading = false;
});
}

View File

@ -7,48 +7,48 @@
<el-card class="forms">
<el-scrollbar wrapClass="scrollbar-wrapper" :style="{height:height -160 + 'px'}" style="padding-top: 40px">
<el-form ref="form" :model="chapterModel" :rules="rules" label-width="135px">
<el-form-item label="课程名称:" prop="lessonName">
<el-form-item :label="this.$t('lesson.courseName')" prop="lessonName">
<el-input v-model="chapterModel.lessonName" :disabled="true"></el-input>
</el-form-item>
<el-form-item label="父级章节:" prop="parentName">
<el-form-item :label="this.$t('lesson.parentChapter')" prop="parentName">
<el-input v-model="chapterModel.parentName" :disabled="true"></el-input>
</el-form-item>
<el-form-item label="章节名称:" prop="name">
<el-form-item :label="this.$t('lesson.chapterName')" prop="name">
<el-input v-model="chapterModel.name"></el-input>
</el-form-item>
<el-form-item label="章节说明:" prop="remarks">
<el-input type="textarea" :autosize="{ minRows: 4, maxRows: 4}" placeholder="请输入内容"
<el-form-item :label="this.$t('lesson.chapterInstructions')" prop="remarks">
<el-input type="textarea" :autosize="{ minRows: 4, maxRows: 4}" :placeholder="this.$t('rules.pleaseEnterContent')"
v-model="chapterModel.remarks">
</el-input>
</el-form-item>
<el-form-item label="关联实训:">
<el-form-item :label="this.$t('lesson.associatedTraining')">
<el-table ref="singleTable" :data="chapterModel.trainings" border highlight-current-row
:height="237">
<el-table-column type="index" width="50">
</el-table-column>
<el-table-column property="trainingName" label="实训名称">
<el-table-column property="trainingName" :label="this.$t('lesson.trainingName')">
</el-table-column>
<el-table-column property="trial" label="是否试用" width="80">
<el-table-column property="trial" :label="this.$t('global.isTry')" width="80">
<template slot-scope="scope">
<el-checkbox v-model="scope.row.trial"></el-checkbox>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" width="70">
<el-table-column fixed="right" :label="this.$t('global.operate')" width="70">
<template slot-scope="scope">
<el-button @click.native.prevent="deleteRow(scope.$index, chapterModel.trainings)"
type="text" size="small">移除</el-button>
type="text" size="small">{{$t('global.remove')}}</el-button>
</template>
</el-table-column>
</el-table>
<el-button type="primary" style="margin-top: 20px" @click='pushTrain'>添加实训</el-button>
<el-button type="primary" style="margin-top: 20px" @click='pushTrain'>{{$t('lesson.addTraining')}}</el-button>
</el-form-item>
</el-form>
</el-scrollbar>
</el-card>
<div class="draft">
<el-button-group>
<el-button type="primary" @click="create" v-show="!isEdit">添加</el-button>
<el-button type="primary" @click="update" v-show="isEdit">更新</el-button>
<el-button type="primary" @click="create" v-show="!isEdit">{{$t('global.append')}}</el-button>
<el-button type="primary" @click="update" v-show="isEdit">{{$t('global.update')}}</el-button>
</el-button-group>
</div>
<train-list ref="pathRoute" :trainings="this.chapterModel.trainings" :detail="detail"
@ -95,15 +95,15 @@
},
computed: {
title() {
return this.isEdit ? '更新章节' : '创建章节';
return this.isEdit ? this.$t('lesson.updateChapter') : this.$t('lesson.createChapter');
},
rules() {
let baseRules = {
name: [
{ required: true, message: '请输入章节名称', trigger: 'change' }
{ required: true, message: this.$t('rules.enterChapterName'), trigger: 'change' }
],
remarks: [
{ required: true, message: '请输入章节说明', trigger: 'change' }
{ required: true, message: this.$t('rules.enterChapterInstructions'), trigger: 'change' }
],
}
return baseRules;
@ -135,7 +135,7 @@
getLessonChapterDetail(data).then(response => {
this.setChapterModel(response.data);
}).catch(error => {
this.$messageBox('获取章节数据失败')
this.$messageBox(this.$t('error.obtainChapterDataFailed'))
});
},
deleteRow(index, rows) {
@ -193,7 +193,7 @@
this.getChapter(node.data);
}
}).catch(error => {
this.$messageBox('获取课程详情失败');
this.$messageBox(this.$t('error.obtainCourseDetailsFailed'));
})
},
create() {
@ -201,9 +201,9 @@
if (valid) {
createLessonChapter(this.chapterModel).then(response => {
this.$emit('refresh');
this.$message.success('创建成功');
this.$message.success(this.$t('tip.createSuccess'));
}).catch(error => {
this.$messageBox('刷新失败')
this.$messageBox(this.$t('error.refreshFailed'))
});
}
});
@ -213,9 +213,9 @@
if (valid) {
updateLessonChapter(this.chapterModel).then(response => {
this.$emit('refresh');
this.$message.success('更新成功');
this.$message.success(this.$t('tip.updateSuccessfully'));
}).catch(error => {
this.$messageBox('刷新失败')
this.$messageBox(this.$t('error.refreshFailed'))
});
}
});

View File

@ -1,6 +1,6 @@
<template>
<el-dialog
title="实训列表"
:title="this.$t('lesson.trainingList')"
:visible.sync="show"
top="20px"
width="90%"
@ -46,7 +46,7 @@ export default {
queryObject: {
type: {
type: 'select',
label: '实训类型',
label: this.$t('lesson.trainingType'),
change: this.typeChoose,
config: {
data: []
@ -54,16 +54,16 @@ export default {
},
operateType: {
type: 'select',
label: '操作类型',
label: this.$t('lesson.operationType'),
config: {
data: []
}
},
generateType: {
type: 'select',
label: '自动/人工',
label: this.$t('lesson.automaticOrManual'),
config: {
data: [{ value: '02', label: '人工' }, { value: '01', label: '自动' }]
data: [{ value: '02', label: this.$t('lesson.automatic'), }, { value: '01', label: this.$t('lesson.manual'), }]
}
}
}
@ -74,32 +74,32 @@ export default {
indexShow: true,
columns: [
{
title: '实训名称',
title: this.$t('lesson.trainingName'),
prop: 'name'
},
{
title: '皮肤类型',
title: this.$t('lesson.skinType'),
prop: 'skinCode',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']); },
tagType: (row) => { return 'success'; }
},
{
title: '产品',
title: this.$t('lesson.product'),
prop: 'prdCode',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.prdCode, this.prdTypeList, ['code', 'name']); },
tagType: (row) => { return 'success'; }
},
{
title: '实训类型',
title: this.$t('lesson.trainingType'),
prop: 'type',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.type, this.trainingTypeList, ['code', 'name']); },
tagType: (row) => { return 'success'; }
},
{
title: '操作类型',
title: this.$t('lesson.operationType'),
prop: 'operateType',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.operateType, this.trainingOperateTypeMap[row.type], ['code', 'name']); },
@ -107,16 +107,16 @@ export default {
},
{
type: 'button',
title: '操作',
title: this.$t('global.operate'),
width: '200',
buttons: [
{
name: '添加',
name: this.$t('global.append'),
handleClick: this.addObj,
showControl: (row) => { return !row.isShow; }
},
{
name: '移除',
name: this.$t('global.remove'),
handleClick: this.delObj,
type: 'warning',
showControl: (row) => { return row.isShow; }

View File

@ -1,19 +1,19 @@
<template>
<el-dialog title="从发布课程创建" :visible.sync="dialogShow" width="600px" :before-close="doClose">
<el-dialog :title="this.$t('lesson.createNewCoursesFromRelease')" :visible.sync="dialogShow" width="600px" :before-close="doClose">
<el-form ref="form" :model="courseModel" :rules="rules" label-width="120px" size="mini">
<el-form-item label="发布课程名称:" prop="code">
<el-select v-model="courseModel.code" placeholder="请选择">
<el-form-item :label="this.$t('lesson.publishCourseName')" prop="code">
<el-select v-model="courseModel.code" :placeholder="this.$t('rules.pleaseSelect')">
<el-option v-for="item in lessonList" :key="item.code" :value="item.code" :label="item.name">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="草稿课程名称:" prop="name">
<el-form-item :label="this.$t('lesson.draftCourseName')" prop="name">
<el-input v-model="courseModel.name"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogShow = false"> </el-button>
<el-button type="primary" @click="create" :loading="loading"> </el-button>
<el-button @click="dialogShow = false">{{$t('global.cancel')}}</el-button>
<el-button type="primary" @click="create" :loading="loading">{{$t('global.confirm')}}</el-button>
</span>
</el-dialog>
@ -40,10 +40,10 @@
rules() {
let baseRules = {
code: [
{ required: true, message: '请选择课程名称', trigger: 'change' }
{ required: true, message: this.$t('rules.selectCourseName'), trigger: 'change' }
],
name: [
{ required: true, message: '请输入课程名称', trigger: 'change' }
{ required: true, message: this.$t('rules.enterCourseName'), trigger: 'change' }
]
}
return baseRules;
@ -54,7 +54,7 @@
getPublishLessonList().then(response => {
this.lessonList = response.data.map(elem => { return { code: elem.id, name: elem.name }; })
}).catch(error => {
this.$messageBox('刷新失败')
this.$messageBox(this.$t('error.refreshFailed'))
});
},
methods: {
@ -74,9 +74,9 @@
createLessonFromPublish(model).then(response => {
this.$emit('refresh');
this.doClose();
this.$message.success('创建成功');
this.$message.success(this.$t('tip.createSuccess'));
}).catch(error => {
this.$messageBox('创建失败')
this.$messageBox(this.$t('tip.creatingFailed'))
});
}
});

View File

@ -7,11 +7,11 @@
<el-card class="forms">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{height:height-160 + 'px'}" style="padding-top: 40px">
<el-form ref="form" :model="courseModel" :rules="rules" label-width="135px">
<el-form-item label="课程名称:" prop="name">
<el-form-item :label="this.$t('lesson.courseName')" prop="name">
<el-input v-model="courseModel.name" />
</el-form-item>
<el-form-item label="关联皮肤:" prop="skinCode">
<el-select v-model="courseModel.skinCode" placeholder="请选择" :disabled="true">
<el-form-item :label="this.$t('lesson.associatedSkin')" prop="skinCode">
<el-select v-model="courseModel.skinCode" :placeholder="this.$t('rules.pleaseSelect')" :disabled="true">
<el-option
v-for="(item,index) in skinCodeList"
:key="index"
@ -20,8 +20,8 @@
/>
</el-select>
</el-form-item>
<el-form-item label="关联产品:" prop="prdCode">
<el-select v-model="courseModel.prdCode" placeholder="请选择" :disabled="isEdit">
<el-form-item :label="this.$t('lesson.associatedProducts')" prop="prdCode">
<el-select v-model="courseModel.prdCode" :placeholder="this.$t('rules.pleaseSelect')" :disabled="isEdit">
<el-option
v-for="(item,index) in productList"
:key="index"
@ -30,12 +30,12 @@
/>
</el-select>
</el-form-item>
<el-form-item label="课程说明:" prop="remarks">
<el-form-item :label="this.$t('lesson.courseDescription')" prop="remarks">
<el-input
v-model="courseModel.remarks"
type="textarea"
:autosize="{ minRows: 6, maxRows: 6}"
placeholder="请输入内容"
:placeholder="this.$t('rules.pleaseEnterContent')"
/>
</el-form-item>
</el-form>
@ -44,12 +44,12 @@
<div class="draft">
<el-button-group>
<template v-if="!isEdit">
<el-button v-if="courseModel.skinCode" type="primary" @click="create">创建</el-button>
<el-button v-if="courseModel.skinCode" type="primary" @click="create">{{$t('global.create')}}</el-button>
</template>
<template v-else>
<el-button type="primary" @click="update">更新</el-button>
<el-button type="primary" @click="publish">发布</el-button>
<el-button type="danger" @click="deleteLesson">删除</el-button>
<el-button type="primary" @click="update">{{$t('global.update')}}</el-button>
<el-button type="primary" @click="publish">{{$t('global.release')}}</el-button>
<el-button type="danger" @click="deleteLesson">{{$t('global.delete')}}</el-button>
</template>
</el-button-group>
</div>
@ -92,21 +92,21 @@ export default {
},
computed: {
title() {
return this.isEdit ? '编辑课程' : '创建课程';
return this.isEdit ? this.$t('lesson.editCourse') : this.$t('lesson.createCourse');
},
rules() {
const baseRules = {
name: [
{ required: true, message: '请输入课程名称', trigger: 'change' }
{ required: true, message: this.$t('rules.enterCourseName'), trigger: 'change' }
],
skinCode: [
{ required: true, message: '请选择皮肤类型', trigger: 'change' }
{ required: true, message: this.$t('rules.inputSkinType'), trigger: 'change' }
],
prdCode: [
{ required: true, message: '请选择关联产品', trigger: 'change' }
{ required: true, message: this.$t('rules.selectAssociatedProduct'), trigger: 'change' }
],
remarks: [
{ required: true, message: '请输入课程说明', trigger: 'change' }
{ required: true, message: this.$t('rules.enterCourseDescription'), trigger: 'change' }
]
};
return baseRules;
@ -150,9 +150,9 @@ export default {
};
createLesson(model).then(response => {
this.$emit('refresh');
this.$message.success('创建成功');
this.$message.success(this.$t('tip.createSuccess'));
}).catch(error => {
this.$messageBox('创建失败');
this.$messageBox(this.$t('tip.creatingFailed'));
});
}
});
@ -169,9 +169,9 @@ export default {
};
updateLesson(model).then(response => {
this.$emit('refresh');
this.$message.success('更新成功');
this.$message.success(this.$t('tip.updateSuccessfully'));
}).catch(error => {
this.$messageBox('更新失败');
this.$messageBox(this.$t('tip.updateFailed'));
});
}
});
@ -181,12 +181,12 @@ export default {
},
deleteLesson() {
delLesson(this.courseModel).then(response => {
this.$message.success('删除成功');
this.$message.success(this.$t('tip.successfullyDelete'));
this.$refs.form.resetFields();
this.isEdit = false,
this.$emit('refresh');
}).catch(error => {
this.$messageBox('删除失败');
this.$messageBox(this.$t('tip.failDelete'));
});
},
getParentSkin(node) {
@ -212,7 +212,7 @@ export default {
remarks: data.remarks
};
}).catch(error => {
this.$messageBox('获取课程信息失败');
this.$messageBox(this.$t('error.obtainCourseInformationFailed'));
});
}
}

View File

@ -1,28 +1,28 @@
<template>
<el-dialog title="课程发布" :visible.sync="dialogShow" width="30%" :before-doClose="doClose">
<el-dialog :title="this.$t('lesson.courseRelease')" :visible.sync="dialogShow" width="30%" :before-doClose="doClose">
<div>
<el-form label-position="right" ref="form" :rules="rules" :model="editModel" label-width="140px"
@submit.native.prevent>
<el-form-item label="发布关联城市:" prop="cityCode">
<el-select v-model="editModel.cityCode" @change="cityChange" placeholder="请选择">
<el-form-item :label="this.$t('lesson.releaseAssociatedCity')" prop="cityCode">
<el-select v-model="editModel.cityCode" @change="cityChange" :placeholder="this.$t('rules.pleaseSelect')">
<el-option v-for="item in cityList" :key="item.code" :label="item.name" :value="item.code">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="发布关联地图:" prop="mapId">
<el-select v-model="editModel.mapId" @change="mapChange" placeholder="请选择">
<el-form-item :label="this.$t('lesson.releaseAssociatedMap')" prop="mapId">
<el-select v-model="editModel.mapId" @change="mapChange" :placeholder="this.$t('rules.pleaseSelect')">
<el-option v-for="item in mapList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="发布课程名称:" prop="name">
<el-form-item :label="this.$t('lesson.publishCourseName')" prop="name">
<el-input v-model="editModel.name"></el-input>
</el-form-item>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogShow = false"> </el-button>
<el-button type="primary" @click="doSave" :loading="loading"> </el-button>
<el-button @click="dialogShow = false">{{$t('global.cancel')}}</el-button>
<el-button type="primary" @click="doSave" :loading="loading">{{$t('global.confirm')}}</el-button>
</span>
</el-dialog>
</template>
@ -54,16 +54,16 @@
rules() {
return {
id: [
{ required: true, message: '课程Id为空', trigger: 'change' }
{ required: true, message: this.$t('rules.courseIdIsEmpty'), trigger: 'change' }
],
cityCode: [
{ required: true, message: '请选择城市', trigger: 'change' }
{ required: true, message: this.$t('rules.selectCity'), trigger: 'change' }
],
mapId: [
{ required: true, message: '请选择地图名称', trigger: 'change' }
{ required: true, message: this.$t('rules.selectMapName'), trigger: 'change' }
],
name: [
{ required: true, message: '请输入地图名称', trigger: 'change' }
{ required: true, message: this.$t('rules.pleaseEnterMapName'), trigger: 'change' }
],
}
}
@ -119,11 +119,11 @@
if (valid) {
publishLesson(this.editModel).then(response => {
this.loading = false;
this.$message.success('发布课程成功');
this.$message.success(this.$t('tip.coursePublishSuccessful'));
this.doClose();
}).catch(error => {
this.loading = false;
this.$messageBox('发布课程失败');
this.$messageBox(this.$t('tip.coursePublishFailed'));
});
} else {
this.loading = false;

View File

@ -1,7 +1,7 @@
<template>
<div class="card-box">
<el-steps class="steps" :active="display">
<el-step title="实训排序" icon="el-icon-edit-outline"></el-step>
<el-step :title="this.$t('lesson.trainingSequence')" icon="el-icon-edit-outline"></el-step>
<el-step title="" icon="el-icon-upload"></el-step>
</el-steps>
<el-card class="forms">
@ -61,7 +61,7 @@
getLessonTree({ mapId: '' }).then(response => {
this.treeData = this.convertTreeData(response.data, node);
}).catch(error => {
this.$messageBox('刷新失败')
this.$messageBox(this.$t('error.refreshFailed'))
});
},
allowDrop(draggingNode, dropNode, type) {

View File

@ -2,8 +2,8 @@
<el-dialog :title="title" :visible.sync="dialogVisible" width="25%" :before-close="doClose" center>
<data-form ref="dataform" :form="form" :formModel="formModel" :rules="rules"></data-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="doSave"> </el-button>
<el-button @click="doClose"> </el-button>
<el-button type="primary" @click="doSave">{{$t('global.confirm')}}</el-button>
<el-button @click="doClose">{{$t('global.cancel')}}</el-button>
</span>
</el-dialog>
</template>
@ -35,7 +35,7 @@
let form = {
labelWidth: '120px',
items: [
{ prop: 'parameter', label: '皮肤类型', type: 'select', required: true, options: this.skinCodeList },
{ prop: 'parameter', label: this.$t('lesson.skinType'), type: 'select', required: true, options: this.skinCodeList },
]
}
return form
@ -43,13 +43,13 @@
rules() {
let crules = {
parameter: [
{ required: true, message: '请选择地图', trigger: 'change' },
{ required: true, message: this.$t('rules.mapInput'), trigger: 'change' },
]
}
return crules
},
title() {
return '自动生成操作'
return this.$t('lesson.generationOperation')
}
},
mounted() {
@ -92,7 +92,7 @@
self.doClose()
self.$emit('reloadTable'); //
} catch (error) {
this.$messageBox('创建失败');
this.$messageBox(this.$t('tip.creatingFailed'));
}
}
}

View File

@ -54,7 +54,7 @@
tagType: (row) => { return '' }
},
{
title: '创建时间',
title: this.$t('lesson.creationTime'),
prop: 'createTime'
},
{
@ -65,15 +65,15 @@
tagType: (row) => { if (row.status != '03') { return 'warning' } else { return 'success' } }
},
{
title: '开始时间',
title: this.$t('global.startTime'),
prop: 'startTime'
},
{
title: '完成时间',
title: this.$t('lesson.finishTime'),
prop: 'finishTime'
},
{
title: '创建结果',
title: this.$t('lesson.createResults'),
prop: 'result',
width: '400px'
},
@ -83,19 +83,19 @@
width: '250',
buttons: [
{
name: '开始',
name: this.$t('lesson.start'),
handleClick: this.taskStart,
type: '',
showControl: (row) => { return row.status == '01' }
},
{
name: '取消',
name: this.$t('global.cancel'),
handleClick: this.taskCancel,
type: '',
showControl: (row) => { return row.status == '04' }
},
{
name: '重新执行',
name: this.$t('lesson.toPerform'),
handleClick: this.taskStart,
type: '',
showControl: (row) => { return row.status == '03' || row.status == '05' }
@ -104,7 +104,7 @@
}
],
actions: [
{ text: '创建', btnCode: 'employee_insert', handler: this.createTask }
{ text: this.$t('global.create'), btnCode: 'employee_insert', handler: this.createTask }
]
},
@ -130,7 +130,7 @@
})
},
taskStart(index, node) {
this.$confirm('此操作将开始任务, 是否继续?', this.$t('global.tips'), {
this.$confirm( this.$t('tip.startOperationHint'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
@ -145,7 +145,7 @@
})
},
taskCancel(index, node) {
this.$confirm('此操作将取消任务, 是否继续?', this.$t('global.tips'), {
this.$confirm( this.$t('tip.startOperationHint'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'

View File

@ -1,7 +1,7 @@
<template>
<el-dialog :title="operation.title" :visible.sync="dialogShow" width="500px" :before-close="close">
<el-form ref="form" :model="operateModel" label-width="100px" :rules="rules" size="mini">
<el-form-item label="皮肤类型:" prop="skinCode">
<el-form ref="form" :model="operateModel" label-width="auto" :rules="rules" size="mini" label-position="right" class="dialog-form">
<el-form-item :label="this.$t('lesson.skinType') + ':'" prop="skinCode">
<el-select v-model="operateModel.skinCode" @change="skinCodeChoose">
<el-option
v-for="option in skinCodeList"
@ -11,7 +11,7 @@
/>
</el-select>
</el-form-item>
<el-form-item label="产品类型:" prop="prdCode">
<el-form-item :label="this.$t('lesson.productType')" prop="prdCode">
<el-select v-model="operateModel.prdCode" @change="prdChange">
<el-option
v-for="option in productList"
@ -21,7 +21,7 @@
/>
</el-select>
</el-form-item>
<el-form-item label="实训类型:" prop="type">
<el-form-item :label="this.$t('lesson.trainingType') + ':'" prop="type">
<el-select v-model="operateModel.type" @change="typeChange">
<el-option
v-for="option in trainingTypeLists"
@ -31,7 +31,7 @@
/>
</el-select>
</el-form-item>
<el-form-item label="操作类型:" prop="operateType">
<el-form-item :label="this.$t('lesson.operationType') + ':'" prop="operateType">
<el-select v-model="operateModel.operateType" multiple>
<el-option
v-for="option in trainingTypeMap[operateModel.type]"
@ -41,19 +41,19 @@
/>
</el-select>
</el-form-item>
<el-form-item v-if="isUpdate" label="最小用时:" prop="minDuration">
<el-form-item v-if="isUpdate" :label="this.$t('lesson.minTime')" prop="minDuration">
<el-input-number v-model="operateModel.minDuration" :min="0" :max="10000" />s
</el-form-item>
<el-form-item v-if="isUpdate" label="最大用时:" prop="maxDuration">
<el-form-item v-if="isUpdate" :label="this.$t('lesson.maxTime')" prop="maxDuration">
<el-input-number v-model="operateModel.maxDuration" :min="0" :max="10000" />s
</el-form-item>
<el-form-item v-if="isUpdate" label="实训描述:" prop="remarks">
<el-form-item v-if="isUpdate" :label="this.$t('lesson.trainingDescription')" prop="remarks">
<el-input v-model="operateModel.remarks" type="textarea" />
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose"> </el-button>
<el-button type="primary" :loading="loading" @click="handleDeal"> </el-button>
<el-button @click="handleClose">{{$t('global.cancel')}}</el-button>
<el-button type="primary" :loading="loading" @click="handleDeal">{{$t('global.confirm')}}</el-button>
</span>
</el-dialog>
</template>
@ -82,11 +82,11 @@ export default {
data() {
var minDurations = (rule, value, callback) => {
if (!value) {
return callback(new Error('请输入标准用时'));
return callback(new Error(this.$t('rules.enterStandardTime')));
}
setTimeout(() => {
if (!Number.isInteger(value)) {
callback(new Error('请输入数字值'));
callback(new Error(this.$t('rules.enterNumericValue')));
} else {
callback();
}
@ -94,14 +94,14 @@ export default {
};
var maxDurations = (rule, value, callback) => {
if (!value) {
return callback(new Error('请输入标准用时'));
return callback(new Error(this.$t('rules.enterStandardTime')));
}
setTimeout(() => {
if (!Number.isInteger(value)) {
callback(new Error('请输入数字值'));
callback(new Error(this.$t('rules.enterNumericValue')));
} else {
if (value < this.operateModel.minDuration) {
callback(new Error('必须大于最小时间'));
callback(new Error(this.$t('rules.greaterThanMinTime')));
} else {
callback();
}
@ -111,9 +111,9 @@ export default {
var checkOperateType = (rule, value, callback) => {
if (value.length <= 0) {
return callback(new Error('请选择实训类型'));
return callback(new Error(this.$t('rules.selectTrainingType')));
} else if (this.operation.event == '02' && value.length !== 1) {
return callback(new Error('只能选择一个实训类型'));
return callback(new Error(this.$t('rules.selectOneTrainingType')));
} else {
callback();
}
@ -151,13 +151,13 @@ export default {
},
rules: {
skinCode: [
{ required: true, message: '请输入地图名称', trigger: 'change' }
{ required: true, message: this.$t('rules.pleaseEnterMapName'), trigger: 'change' }
],
prdCode: [
{ required: true, message: '请输入产品类型', trigger: 'change' }
{ required: true, message: this.$t('rules.enterProductType'), trigger: 'change' }
],
type: [
{ required: true, message: '请输入实训类型', trigger: 'change' }
{ required: true, message: this.$t('rules.inputTrainingType'), trigger: 'change' }
],
operateType: [
{ required: true, validator: checkOperateType, trigger: 'change' }
@ -266,11 +266,11 @@ export default {
};
addAutoTraining(data).then(response => {
this.$message.success('自动生成实训成功!');
this.$message.success(this.$t('tip.automaticGenerationTrainingSuccess'));
this.$emit('refresh');
this.close();
}).catch(() => {
this.$messageBox('生成实训失败');
this.$messageBox(this.$t('tip.automaticGenerationTrainingFailure'));
this.loading = false;
});
} else if (this.operation.event == '02') { // edit
@ -287,11 +287,11 @@ export default {
};
updateAutoTraining(data).then(response => {
this.$message.success('更新自动生成实训成功!');
this.$message.success(this.$t('tip.updateAutomaticGenerationTrainingSuccess'));
this.$emit('refresh');
this.close();
}).catch(() => {
this.$messageBox('更新自动生成实训失败');
this.$messageBox(this.$t('tip.updateAutomaticGenerationTrainingFailure'));
this.loading = false;
});
} else if (this.operation.event == '03') { // delete
@ -305,11 +305,11 @@ export default {
};
deleteAutoTraining(data).then(response => {
this.$message.success('删除自动生成实训成功!');
this.$message.success(this.$t('tip.deleteAutomaticGenerationTrainingSuccess'));
this.$emit('refresh');
this.close();
}).catch(() => {
this.$messageBox('删除自动生成实训失败');
this.$messageBox(this.$t('tip.deleteAutomaticGenerationTrainingFailure'));
this.loading = false;
});
}
@ -324,4 +324,8 @@ export default {
.el-checkbox {
margin-left: 20px;
}
.dialog-form {
position: relative;
left: 15px;
}
</style>

View File

@ -37,7 +37,7 @@ export default {
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '80px',
labelWidth: '120px',
initLoadCallback: this.loadInitQueryList,
queryObject: {
skinCode: {
@ -50,7 +50,7 @@ export default {
},
prdCode: {
type: 'select',
label: '产品',
label: this.$t('lesson.product'),
change: this.prdChoose,
config: {
data: []
@ -73,9 +73,9 @@ export default {
},
generateType: {
type: 'select',
label: '自动/人工',
label: this.$t('lesson.automaticOrManual'),
config: {
data: [{ value: '02', label: '人工' }, { value: '01', label: '自动' }]
data: [{ value: '02', label: this.$t('lesson.manual') }, { value: '01', label: this.$t('lesson.automatic') }]
}
},
name: {
@ -147,9 +147,9 @@ export default {
}
],
actions: [
{ text: '生成实训', btnCode: 'employee_insert', handler: this.autoMaticTrainging },
{ text: '修改实训', btnCode: 'employee_insert', handler: this.editTrainingByType, type: 'warning' },
{ text: '删除实训', btnCode: 'employee_insert', handler: this.delAutoMaticTrainging, type: 'danger' }
{ text: this.$t('lesson.generateTraining'), btnCode: 'employee_insert', handler: this.autoMaticTrainging },
{ text: this.$t('lesson.updateTraining'), btnCode: 'employee_insert', handler: this.editTrainingByType, type: 'warning'},
{ text: this.$t('lesson.deleteTraining'), btnCode: 'employee_insert', handler: this.delAutoMaticTrainging, type: 'danger'}
]
},
@ -249,13 +249,13 @@ export default {
}
},
autoMaticTrainging() {
this.$refs.draftTrain.show({ event: '01', title: '自动生成实训' });
this.$refs.draftTrain.show({ event: '01', title: this.$t('lesson.automaticGenerationOfTraining') });
},
editTrainingByType() {
this.$refs.draftTrain.show({ event: '02', title: '按类别修改实训' });
this.$refs.draftTrain.show({ event: '02', title: this.$t('lesson.modifyTrainingByCategory') });
},
delAutoMaticTrainging() {
this.$refs.draftTrain.show({ event: '03', title: '删除自动生成实训' });
this.$refs.draftTrain.show({ event: '03', title: this.$t('lesson.deleteAutoGeneratedTraining') });
},
demoDisplay(index, node) {
trainingNotify({ trainingId: node.id }).then(resp => {
@ -264,7 +264,7 @@ export default {
this.$router.push({ path: `${UrlConfig.display}/manage`, query: query });
launchFullscreen();
}).catch(error => {
this.$messageBox(`创建仿真失败: ${error.message}`);
this.$messageBox(this.$t('error.createSimulationFailed') +error.message);
});
},

View File

@ -1,10 +1,10 @@
<template>
<el-dialog :title="operation.title" :visible.sync="dialogShow" width="30%" :before-close="close">
<el-form ref="form" :model="operateModel" label-width="120px" :rules="rules" size="mini">
<el-form-item label="实训名称:" prop="name">
<el-form-item :label="this.$t('lesson.trainingName')+':'" prop="name">
<el-input v-model="operateModel.name" />
</el-form-item>
<el-form-item label="产品类型:" prop="prdCode">
<el-form-item :label="this.$t('lesson.productType')" prop="prdCode">
<el-select v-model="operateModel.prdCode" placeholder="" :disabled="true">
<el-option
v-for="option in productTypesList"
@ -14,7 +14,7 @@
/>
</el-select>
</el-form-item>
<el-form-item label="实训类型:" prop="type">
<el-form-item :label="this.$t('lesson.trainingType')+':'" prop="type">
<el-select v-model="operateModel.type" placeholder="" :disabled="true">
<el-option
v-for="option in trainTypesList"
@ -24,7 +24,7 @@
/>
</el-select>
</el-form-item>
<el-form-item label="操作类型:">
<el-form-item :label="this.$t('lesson.operationType')+':'">
<el-select v-model="operateModel.operateType">
<el-option
v-for="(option, index) in operationList"
@ -34,24 +34,24 @@
/>
</el-select>
</el-form-item>
<el-form-item label="最小用时:" prop="minDuration">
<el-form-item :label="this.$t('lesson.minTime')" prop="minDuration">
<el-input-number v-model="operateModel.minDuration" :min="0" :max="10000" />s
</el-form-item>
<el-form-item label="最大用时:" prop="maxDuration">
<el-form-item :label="this.$t('lesson.maxTime')" prop="maxDuration">
<el-input-number v-model="operateModel.maxDuration" :min="0" :max="10000" />s
</el-form-item>
<el-form-item label="实训说明:" prop="remarks">
<el-form-item :label="this.$t('lesson.trainingDescription')" prop="remarks">
<el-input
v-model="operateModel.remarks"
type="textarea"
:autosize="{ minRows: 4, maxRows: 4}"
placeholder="请输入内容"
:placeholder="this.$t('rules.pleaseEnterContent')"
/>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose"> </el-button>
<el-button type="primary" @click="handleDeal"> </el-button>
<el-button @click="handleClose">{{$t('global.cancel')}}</el-button>
<el-button type="primary" @click="handleDeal">{{$t('global.confirm')}}</el-button>
</span>
</el-dialog>
</template>
@ -71,11 +71,11 @@ export default {
data() {
var minDurations = (rule, value, callback) => {
if (!value) {
return callback(new Error('请输入标准用时'));
return callback(new Error(this.$t('rules.enterStandardTime')));
}
setTimeout(() => {
if (!Number.isInteger(value)) {
callback(new Error('请输入数字值'));
callback(new Error(this.$t('rules.enterNumericValue')));
} else {
callback();
}
@ -83,14 +83,14 @@ export default {
};
var maxDurations = (rule, value, callback) => {
if (!value) {
return callback(new Error('请输入标准用时'));
return callback(new Error(this.$t('rules.enterStandardTime')));
}
setTimeout(() => {
if (!Number.isInteger(value)) {
callback(new Error('请输入数字值'));
callback(new Error(this.$t('rules.enterNumericValue')));
} else {
if (value < this.operateModel.minDuration) {
callback(new Error('必须大于最小时间'));
callback(new Error(this.$t('rules.greaterThanMinTime')));
} else {
callback();
}
@ -120,7 +120,7 @@ export default {
},
rules: {
name: [
{ required: true, message: '请输入实训名称', trigger: 'change' }
{ required: true, message: this.$t('rules.inputTrainingName'), trigger: 'change' }
],
minDuration: [
{ required: true, validator: minDurations, trigger: 'blur' }
@ -129,7 +129,7 @@ export default {
{ required: true, validator: maxDurations, trigger: 'blur' }
],
remarks: [
{ required: true, message: '请输入实训说明', trigger: 'change' }
{ required: true, message: this.$t('rules.inputTrainingRemark'), trigger: 'change' }
]
}
};
@ -216,7 +216,7 @@ export default {
this.operateModel.operateType = response.data.operateType;
this.operateModel.remarks = response.data.remarks;
}).catch(() => {
this.$messageBox('获取骤数据失败');
this.$messageBox(this.$t('error.obtainStepDataFailed'));
});
break;
}
@ -271,9 +271,9 @@ export default {
addTraining(data).then(response => {
this.$emit('refresh', [localStore.get('cityCode') || '', localStore.get('skinCode') || '']);
this.close();
this.$message.success('添加实训成功!');
this.$message.success(this.$t('tip.addTrainingSuccessfully'));
}).catch(() => {
this.$messageBox('新增实训失败');
this.$messageBox(this.$t('tip.addTrainingFailed'));
});
}
});
@ -295,9 +295,9 @@ export default {
updateTraining(data).then(response => {
this.$emit('refresh', [localStore.get('cityCode') || '', localStore.get('skinCode') || '']);
this.close();
this.$message.success('更新实训成功!');
this.$message.success(this.$t('tip.updateTrainingSuccessfully'));
}).catch(() => {
this.$messageBox('更新实训失败');
this.$messageBox(this.$t('tip.updateTrainingFailed'));
});
}
});

View File

@ -217,14 +217,14 @@ export default {
saveTrainingStepsData(model).then(response => {
this.$refs.form.resetFields();
this.$store.dispatch('training/emitTipFresh');
this.$message.success('保存步骤数据成功');
this.$message.success(this.$t('tip.savedStepDataSuccessfully'));
this.saveDisabled = false;
}).catch(() => {
this.saveDisabled = false;
this.$messageBox('保存步骤数据失败');
this.$messageBox(this.$t('tip.savedStepDataFailed'));
});
} else {
this.$messageBox('请选择关联的车站');
this.$messageBox(this.$t('rules.selectAssociatedStation'));
}
});
}

View File

@ -179,7 +179,7 @@
launchFullscreen();
}).catch(error => {
this.$messageBox(`创建仿真失败: ${error.message}`);
this.$messageBox(this.$t('error.createSimulationFailed') + error.message);
})
},
start() {
@ -187,9 +187,9 @@
this.selectBeginTime();
} else {
if (this.tryTime <= 0) {
this.$confirm('您没有权限,请前往购买产品', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
this.$confirm(this.$('tip.noPermissionHint'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
this.buy();