From 94f3659cf39961ebb05ba34357f1b2efec6eb40e Mon Sep 17 00:00:00 2001 From: ival <610568032@qq.com> Date: Mon, 19 Aug 2019 15:19:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9B=BD=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/jmap/training.js | 11 ------ src/i18n/langs/en/system.js | 23 ++++++++---- src/i18n/langs/zh/system.js | 11 +++++- src/utils/loaddata.js | 2 +- src/views/display/index.vue | 8 +++-- src/views/display/menuExam.vue | 2 +- .../lesson/trainingrecord/manage/index.vue | 17 +++++---- .../management/existingSimulation/index.vue | 36 +++++++++---------- 8 files changed, 61 insertions(+), 49 deletions(-) diff --git a/src/api/jmap/training.js b/src/api/jmap/training.js index 58d5b4dde..4b4b16e5c 100644 --- a/src/api/jmap/training.js +++ b/src/api/jmap/training.js @@ -60,17 +60,6 @@ export function getTrainingDetail(args) { }); } -/** 获取实训详细内容*/ -export function getTrainingMapDetail(args) { - return request({ - url: `/api/training/${args.id}/map`, - method: 'get', - params: { - group: args.group - } - }); -} - /** 添加实训*/ export function addTraining(data) { return request({ diff --git a/src/i18n/langs/en/system.js b/src/i18n/langs/en/system.js index 21190899d..ada9a3241 100644 --- a/src/i18n/langs/en/system.js +++ b/src/i18n/langs/en/system.js @@ -1,8 +1,8 @@ export default { - code: 'code', - name: 'name', - status: 'status', - remarks: 'remarks', + code: 'Code', + name: 'Name', + status: 'Status', + remarks: 'Remarks', createDirectory: 'Create dictionary', editDictionary: 'Edit dictionary', deleteSuccess: 'Successful deletion', @@ -10,7 +10,16 @@ export default { createSuccess: 'Create successful', updateSuccess: 'Update successful', destory: 'Destory', - simulationGroup: 'Simulation group', - username: 'User name', - phoneNumber: 'Cell-phone number' + simulationGroup: 'Simulation Group', + username: 'User Name', + phoneNumber: 'Cell-phone Number', + skinCode: 'Skin Code', + prdType: 'Product Type', + simulationType: 'Simulation Type', + simulationGroupId: 'Simulation Member ID', + productName: 'Product Name', + isError: 'Is Error', + isSuspend: 'Is Suspend', + isDrivingAsplanned: 'Whether to drive as planned', + delUserSimulationIsContinue: 'This operation will delete the user simulation data. Do you want to continue?' }; diff --git a/src/i18n/langs/zh/system.js b/src/i18n/langs/zh/system.js index 9e46c7b99..b92e9f29b 100644 --- a/src/i18n/langs/zh/system.js +++ b/src/i18n/langs/zh/system.js @@ -12,5 +12,14 @@ export default { destory: '销 毁', simulationGroup: '仿真Group', username: '用户名', - phoneNumber: '手机号' + phoneNumber: '手机号', + skinCode: '皮肤编号', + prdType: '产品类型', + simulationType: '仿真类型', + simulationGroupId: '仿真成员ID', + productName: '产品名称', + isError: '是否错误', + isSuspend: '是否暂停', + isDrivingAsplanned: '是否按计划行车', + delUserSimulationIsContinue: '此操作将删除此用户仿真数据, 是否继续?' }; diff --git a/src/utils/loaddata.js b/src/utils/loaddata.js index beb95541b..81ce9aad7 100644 --- a/src/utils/loaddata.js +++ b/src/utils/loaddata.js @@ -35,7 +35,7 @@ export function loadMapData(skinCode) { }); } -export function loadMapDataById(mapId) { +export function loadMapDataById(mapId) { return new Promise((resolve, reject) => { getPublishMapVersionById(mapId).then(resp => { var version = resp.data; diff --git a/src/views/display/index.vue b/src/views/display/index.vue index bc7e503e4..1e705151f 100644 --- a/src/views/display/index.vue +++ b/src/views/display/index.vue @@ -169,6 +169,9 @@ export default { }, isDrive() { return this.$route.query.prdType == '04'; + }, + trainingId() { + return this.$route.query.trainingId; } }, watch: { @@ -343,11 +346,10 @@ export default { this.$store.dispatch('training/end', null); this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // 默认为正常模式 - const trainingId = this.$route.query.trainingId; - if (parseInt(trainingId)) { + if (parseInt(this.trainingId)) { // 设置地图数据 // 设置实训数据 - const resp = await getTrainingStepsDetail(trainingId, { group: this.group }); + const resp = await getTrainingStepsDetail(this.trainingId, { group: this.group }); if (resp && resp.code == 200) { const stepdData = this.trainingObj = resp.data; const rest = await getProductDetail(stepdData.prdCode); diff --git a/src/views/display/menuExam.vue b/src/views/display/menuExam.vue index 2c76dc749..448dc57c2 100644 --- a/src/views/display/menuExam.vue +++ b/src/views/display/menuExam.vue @@ -65,7 +65,7 @@ export default { if (opt && opt.hasOwnProperty('color') && opt.hasOwnProperty('message')) { const h = this.$createElement; this.$notify({ - title: '提示', + title: this.$t('global.tips'), message: h('i', { style: 'color:' + opt.color }, '请点击开始考试操作') }); } diff --git a/src/views/lesson/trainingrecord/manage/index.vue b/src/views/lesson/trainingrecord/manage/index.vue index 151f160c6..ef87ee053 100644 --- a/src/views/lesson/trainingrecord/manage/index.vue +++ b/src/views/lesson/trainingrecord/manage/index.vue @@ -38,7 +38,13 @@ export default { ...mapGetters('map', [ 'mapData', 'mapDeviceStatus' - ]) + ]), + group() { + return this.$route.query.group; + }, + trainingId() { + return this.$route.params.trainingId; + } }, watch: { $route(newVal) { @@ -66,15 +72,12 @@ export default { this.$store.dispatch('training/reset'); this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // 默认为正常模式 - const trainingId = this.$route.params.trainingId; - const group = this.$route.query.group; - if (parseInt(trainingId)) { - this.trainingObj = { id: trainingId, name: this.$route.params.trainingName }; + if (parseInt(this.trainingId)) { + this.trainingObj = { id: this.trainingId, name: this.$route.params.trainingName }; // 获取实训的详细数据 // 加载地图数据 // 设置实训数据 - - getTrainingStepsDetail(trainingId, { group }).then(response => { + getTrainingStepsDetail(this.trainingId, { group: this.group }).then(response => { const stepdData = response.data; getProductDetail(stepdData.prdCode).then(res => { loadMapData(stepdData.skinCode).then(() => { diff --git a/src/views/management/existingSimulation/index.vue b/src/views/management/existingSimulation/index.vue index d38dd9510..c8275dc98 100644 --- a/src/views/management/existingSimulation/index.vue +++ b/src/views/management/existingSimulation/index.vue @@ -19,7 +19,7 @@ export default { pageIndex: 'pageNum' }, queryForm: { - labelWidth: '100px', + labelWidth: '130px', reset: true, queryObject: { group: { @@ -36,21 +36,21 @@ export default { }, skinCode: { type: 'select', - label: '皮肤编号', + label: this.$t('system.skinCode'), config: { data: this.$ConstSelect.skinCode } }, prdType: { type: 'select', - label: '产品类型', + label: this.$t('system.prdType'), config: { data: [] } }, type: { type: 'select', - label: '仿真类型', + label: this.$t('system.simulationType'), config: { data: this.$ConstSelect.SimulationType } @@ -64,11 +64,11 @@ export default { indexShow: true, columns: [ { - title: '用户名称', + title: this.$t('system.username'), prop: 'creator.name' }, { - title: '用户电话', + title: this.$t('system.phoneNumber'), prop: 'creator.mobile' }, { @@ -76,7 +76,7 @@ export default { prop: 'group' }, { - title: '是否错误', + title: this.$t('system.isError'), prop: 'error', type: 'tag', columnValue: (row) => { return this.$ConstSelect.translate(row.error, 'Whether'); }, @@ -88,11 +88,11 @@ export default { } }, { - title: '产品', + title: this.$t('system.productName'), prop: 'mapPrdVO.name' }, { - title: '是否暂停', + title: this.$t('system.isSuspend'), prop: 'pause', type: 'tag', columnValue: (row) => { return this.$ConstSelect.translate(row.pause, 'Whether'); }, @@ -104,7 +104,7 @@ export default { } }, { - title: '是否按计划行车', + title: this.$t('system.isDrivingAsplanned'), prop: 'runAsPlan', type: 'tag', columnValue: (row) => { return this.$ConstSelect.translate(row.runAsPlan, 'Whether'); }, @@ -116,21 +116,21 @@ export default { } }, { - title: '皮肤编号', + title: this.$t('system.skinCode'), prop: 'skinCode', type: 'tag', columnValue: (row) => { return this.$convertField(row.skinCode, this.$ConstSelect.skinCode, ['value', 'label']); }, tagType: (row) => { return 'success'; } }, { - title: '仿真类型', + title: this.$t('system.simulationType'), prop: 'type', type: 'tag', columnValue: (row) => { return this.$convertField(row.type, this.$ConstSelect.SimulationType, ['value', 'label']); }, tagType: (row) => { return 'success'; } }, { - title: '仿真成员ID', + title: this.$t('system.simulationGroupId'), prop: 'sessionList', type: 'basicText', columnValue: (row) => { return this.listJoiningTogether(row.sessionList); } @@ -170,17 +170,17 @@ export default { return sessionId; }, handleDelete(index, row) { - this.$confirm('此操作将删除此用户仿真数据, 是否继续?', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', + this.$confirm(this.$t('global.delUserSimulationIsContinue'), this.$t('global.tips'), { + confirmButtonText: this.$t('global.confirm'), + cancelButtonText: this.$t('global.cancel'), type: 'warning' }).then(() => { deleteExistingSimulation(row.group).then(response => { - this.$message.success('删除成功'); + this.$message.success(this.$t('system.deleteSuccess')); this.reloadTable(); }).catch(() => { this.reloadTable(); - this.$messageBox('删除失败'); + this.$messageBox(this.$t('error.deleteFailed')); }); }); },