This commit is contained in:
fan 2019-08-19 15:47:07 +08:00
commit 30433bfcd0
8 changed files with 61 additions and 49 deletions

View File

@ -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) { export function addTraining(data) {
return request({ return request({

View File

@ -1,8 +1,8 @@
export default { export default {
code: 'code', code: 'Code',
name: 'name', name: 'Name',
status: 'status', status: 'Status',
remarks: 'remarks', remarks: 'Remarks',
createDirectory: 'Create dictionary', createDirectory: 'Create dictionary',
editDictionary: 'Edit dictionary', editDictionary: 'Edit dictionary',
deleteSuccess: 'Successful deletion', deleteSuccess: 'Successful deletion',
@ -10,7 +10,16 @@ export default {
createSuccess: 'Create successful', createSuccess: 'Create successful',
updateSuccess: 'Update successful', updateSuccess: 'Update successful',
destory: 'Destory', destory: 'Destory',
simulationGroup: 'Simulation group', simulationGroup: 'Simulation Group',
username: 'User name', username: 'User Name',
phoneNumber: 'Cell-phone number' 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?'
}; };

View File

@ -12,5 +12,14 @@ export default {
destory: '销 毁', destory: '销 毁',
simulationGroup: '仿真Group', simulationGroup: '仿真Group',
username: '用户名', username: '用户名',
phoneNumber: '手机号' phoneNumber: '手机号',
skinCode: '皮肤编号',
prdType: '产品类型',
simulationType: '仿真类型',
simulationGroupId: '仿真成员ID',
productName: '产品名称',
isError: '是否错误',
isSuspend: '是否暂停',
isDrivingAsplanned: '是否按计划行车',
delUserSimulationIsContinue: '此操作将删除此用户仿真数据, 是否继续?'
}; };

View File

@ -169,6 +169,9 @@ export default {
}, },
isDrive() { isDrive() {
return this.$route.query.prdType == '04'; return this.$route.query.prdType == '04';
},
trainingId() {
return this.$route.query.trainingId;
} }
}, },
watch: { watch: {
@ -343,11 +346,10 @@ export default {
this.$store.dispatch('training/end', null); this.$store.dispatch('training/end', null);
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
const trainingId = this.$route.query.trainingId; if (parseInt(this.trainingId)) {
if (parseInt(trainingId)) {
// //
// //
const resp = await getTrainingStepsDetail(trainingId, { group: this.group }); const resp = await getTrainingStepsDetail(this.trainingId, { group: this.group });
if (resp && resp.code == 200) { if (resp && resp.code == 200) {
const stepdData = this.trainingObj = resp.data; const stepdData = this.trainingObj = resp.data;
const rest = await getProductDetail(stepdData.prdCode); const rest = await getProductDetail(stepdData.prdCode);

View File

@ -65,7 +65,7 @@ export default {
if (opt && opt.hasOwnProperty('color') && opt.hasOwnProperty('message')) { if (opt && opt.hasOwnProperty('color') && opt.hasOwnProperty('message')) {
const h = this.$createElement; const h = this.$createElement;
this.$notify({ this.$notify({
title: '提示', title: this.$t('global.tips'),
message: h('i', { style: 'color:' + opt.color }, '请点击开始考试操作') message: h('i', { style: 'color:' + opt.color }, '请点击开始考试操作')
}); });
} }

View File

@ -38,7 +38,13 @@ export default {
...mapGetters('map', [ ...mapGetters('map', [
'mapData', 'mapData',
'mapDeviceStatus' 'mapDeviceStatus'
]) ]),
group() {
return this.$route.query.group;
},
trainingId() {
return this.$route.params.trainingId;
}
}, },
watch: { watch: {
$route(newVal) { $route(newVal) {
@ -66,15 +72,12 @@ export default {
this.$store.dispatch('training/reset'); this.$store.dispatch('training/reset');
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
const trainingId = this.$route.params.trainingId; if (parseInt(this.trainingId)) {
const group = this.$route.query.group; this.trainingObj = { id: this.trainingId, name: this.$route.params.trainingName };
if (parseInt(trainingId)) {
this.trainingObj = { id: trainingId, name: this.$route.params.trainingName };
// //
// //
// //
getTrainingStepsDetail(this.trainingId, { group: this.group }).then(response => {
getTrainingStepsDetail(trainingId, { group }).then(response => {
const stepdData = response.data; const stepdData = response.data;
getProductDetail(stepdData.prdCode).then(res => { getProductDetail(stepdData.prdCode).then(res => {
loadMapData(stepdData.skinCode).then(() => { loadMapData(stepdData.skinCode).then(() => {

View File

@ -19,7 +19,7 @@ export default {
pageIndex: 'pageNum' pageIndex: 'pageNum'
}, },
queryForm: { queryForm: {
labelWidth: '100px', labelWidth: '130px',
reset: true, reset: true,
queryObject: { queryObject: {
group: { group: {
@ -36,21 +36,21 @@ export default {
}, },
skinCode: { skinCode: {
type: 'select', type: 'select',
label: '皮肤编号', label: this.$t('system.skinCode'),
config: { config: {
data: this.$ConstSelect.skinCode data: this.$ConstSelect.skinCode
} }
}, },
prdType: { prdType: {
type: 'select', type: 'select',
label: '产品类型', label: this.$t('system.prdType'),
config: { config: {
data: [] data: []
} }
}, },
type: { type: {
type: 'select', type: 'select',
label: '仿真类型', label: this.$t('system.simulationType'),
config: { config: {
data: this.$ConstSelect.SimulationType data: this.$ConstSelect.SimulationType
} }
@ -64,11 +64,11 @@ export default {
indexShow: true, indexShow: true,
columns: [ columns: [
{ {
title: '用户名称', title: this.$t('system.username'),
prop: 'creator.name' prop: 'creator.name'
}, },
{ {
title: '用户电话', title: this.$t('system.phoneNumber'),
prop: 'creator.mobile' prop: 'creator.mobile'
}, },
{ {
@ -76,7 +76,7 @@ export default {
prop: 'group' prop: 'group'
}, },
{ {
title: '是否错误', title: this.$t('system.isError'),
prop: 'error', prop: 'error',
type: 'tag', type: 'tag',
columnValue: (row) => { return this.$ConstSelect.translate(row.error, 'Whether'); }, columnValue: (row) => { return this.$ConstSelect.translate(row.error, 'Whether'); },
@ -88,11 +88,11 @@ export default {
} }
}, },
{ {
title: '产品', title: this.$t('system.productName'),
prop: 'mapPrdVO.name' prop: 'mapPrdVO.name'
}, },
{ {
title: '是否暂停', title: this.$t('system.isSuspend'),
prop: 'pause', prop: 'pause',
type: 'tag', type: 'tag',
columnValue: (row) => { return this.$ConstSelect.translate(row.pause, 'Whether'); }, columnValue: (row) => { return this.$ConstSelect.translate(row.pause, 'Whether'); },
@ -104,7 +104,7 @@ export default {
} }
}, },
{ {
title: '是否按计划行车', title: this.$t('system.isDrivingAsplanned'),
prop: 'runAsPlan', prop: 'runAsPlan',
type: 'tag', type: 'tag',
columnValue: (row) => { return this.$ConstSelect.translate(row.runAsPlan, 'Whether'); }, columnValue: (row) => { return this.$ConstSelect.translate(row.runAsPlan, 'Whether'); },
@ -116,21 +116,21 @@ export default {
} }
}, },
{ {
title: '皮肤编号', title: this.$t('system.skinCode'),
prop: 'skinCode', prop: 'skinCode',
type: 'tag', type: 'tag',
columnValue: (row) => { return this.$convertField(row.skinCode, this.$ConstSelect.skinCode, ['value', 'label']); }, columnValue: (row) => { return this.$convertField(row.skinCode, this.$ConstSelect.skinCode, ['value', 'label']); },
tagType: (row) => { return 'success'; } tagType: (row) => { return 'success'; }
}, },
{ {
title: '仿真类型', title: this.$t('system.simulationType'),
prop: 'type', prop: 'type',
type: 'tag', type: 'tag',
columnValue: (row) => { return this.$convertField(row.type, this.$ConstSelect.SimulationType, ['value', 'label']); }, columnValue: (row) => { return this.$convertField(row.type, this.$ConstSelect.SimulationType, ['value', 'label']); },
tagType: (row) => { return 'success'; } tagType: (row) => { return 'success'; }
}, },
{ {
title: '仿真成员ID', title: this.$t('system.simulationGroupId'),
prop: 'sessionList', prop: 'sessionList',
type: 'basicText', type: 'basicText',
columnValue: (row) => { return this.listJoiningTogether(row.sessionList); } columnValue: (row) => { return this.listJoiningTogether(row.sessionList); }
@ -170,17 +170,17 @@ export default {
return sessionId; return sessionId;
}, },
handleDelete(index, row) { handleDelete(index, row) {
this.$confirm('此操作将删除此用户仿真数据, 是否继续?', '提示', { this.$confirm(this.$t('global.delUserSimulationIsContinue'), this.$t('global.tips'), {
confirmButtonText: '确定', confirmButtonText: this.$t('global.confirm'),
cancelButtonText: '取消', cancelButtonText: this.$t('global.cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
deleteExistingSimulation(row.group).then(response => { deleteExistingSimulation(row.group).then(response => {
this.$message.success('删除成功'); this.$message.success(this.$t('system.deleteSuccess'));
this.reloadTable(); this.reloadTable();
}).catch(() => { }).catch(() => {
this.reloadTable(); this.reloadTable();
this.$messageBox('删除失败'); this.$messageBox(this.$t('error.deleteFailed'));
}); });
}); });
}, },