设计平台 用户实训管理 用户仿真管理 代码调整

This commit is contained in:
joylink_cuiweidong 2020-11-30 13:56:42 +08:00
parent 572dc1b3bd
commit 19d1a6e0b1
5 changed files with 18 additions and 30 deletions

View File

@ -25,6 +25,7 @@ export default {
mapName: 'Map Name',
trainingName: 'Training Name',
trainingUseTime: 'Training Time',
hour:'Hour',
minute: 'Minute',
second: 'Second',
createSimulationTitle: 'Create Simulation Information',

View File

@ -25,6 +25,7 @@ export default {
mapName: '地图名称',
trainingName: '实训名称',
trainingUseTime: '实训用时',
hour:'时',
minute: '分',
second: '秒',
createSimulationTitle: '创建仿真信息',

View File

@ -82,3 +82,15 @@ export function computationTime(time) {
}
return hours + ':' + minutes + ':' + seconds;
}
export function computationSeconds(seconds, hourUnit, minuteUnit, secondUnit) {
if (seconds) {
const h = parseInt(seconds / 3600);
const m = parseInt((seconds - h * 3600) / 60);
const s = (seconds - h * 3600) % 60;
return h ? `${h} ${hourUnit} ${m} ${minuteUnit} ${s} ${secondUnit}`
: m ? `${m} ${minuteUnit} ${s} ${secondUnit}`
: `${s} ${secondUnit}`;
}
return null;
}

View File

@ -8,7 +8,7 @@
<script>
import { getSimulationList, deleteSimulationStats } from '@/api/simulation';
import {computationSeconds} from '@/utils/date';
import UsersTrainingEdit from './edit';
import UsersTrainingAdd from './add';
export default {
@ -94,29 +94,17 @@ export default {
currentModel: {}
};
},
created() {
},
methods: {
createTraining() {
this.$refs.add.show();
},
computation(fieldValue) {
if (fieldValue) {
const f = parseInt(fieldValue / 60);
const s = fieldValue % 60;
if (f > 0) {
return `${f} ${this.$t('system.minute')} ${s} ${this.$t('system.second')}`;
} else {
return `${s} ${this.$t('system.second')}`;
}
}
return computationSeconds(fieldValue, this.$t('system.hour'), this.$t('system.minute'), this.$t('system.second'));
},
//
edit(index, row) {
this.$refs.edit.show(row);
},
//
handleDelete(index, row) {
this.$confirm(this.$t('system.wellDelUserSimulation'), this.$t('global.tips'), {

View File

@ -7,6 +7,7 @@
</template>
<script>
import {computationSeconds} from '@/utils/date';
import { getTrainingListNew, deleteUserTrainingNew } from '@/api/jmap/training';
import UsersTrainingEdit from './edit';
import UsersTrainingAdd from './add';
@ -92,28 +93,13 @@ export default {
currentModel: {}
};
},
created() {
this.loadInitData();
},
methods: {
loadInitData() {
},
createTraining() {
this.$refs.add.show();
},
computation(fieldValue) {
if (fieldValue) {
const f = parseInt(fieldValue / 60);
const s = fieldValue % 60;
if (f > 0) {
return `${f} ${this.$t('system.minute')} ${s} ${this.$t('system.second')}`;
} else {
return `${s} ${this.$t('system.second')}`;
}
}
return computationSeconds(fieldValue, this.$t('system.hour'), this.$t('system.minute'), this.$t('system.second'));
},
//
edit(index, row) {
this.$refs.edit.show(row);