设计平台 用户实训管理 用户仿真管理 代码调整
This commit is contained in:
parent
572dc1b3bd
commit
19d1a6e0b1
@ -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',
|
||||
|
@ -25,6 +25,7 @@ export default {
|
||||
mapName: '地图名称',
|
||||
trainingName: '实训名称',
|
||||
trainingUseTime: '实训用时',
|
||||
hour:'时',
|
||||
minute: '分',
|
||||
second: '秒',
|
||||
createSimulationTitle: '创建仿真信息',
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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'), {
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user