This commit is contained in:
fan 2020-11-30 18:25:41 +08:00
commit 388f9a14ca
27 changed files with 97 additions and 198 deletions

View File

@ -11,7 +11,7 @@ export function getPublishMapVersion(id) {
/** 根据皮肤获取发布地图详细内容*/
export function getPublishMapDetail(id) {
const datad = request({
url: `/api/map/${id}/details`,
url: `/api/map/${id}/graphData`,
method: 'get'
});
return datad.then();

View File

@ -229,13 +229,13 @@ export function publisMapCityList(data) {
});
}
/** 新版地图根据仿真mapId获取仿真地图数据 */
export function getNewMapDataByMapId(mapId) {
return request({
url: `/api/map/${mapId}/mapData`,
method: 'get'
});
}
// /** 新版地图根据仿真mapId获取仿真地图数据 */
// export function getNewMapDataByMapId(mapId) {
// return request({
// url: `/api/map/${mapId}/mapData`,
// method: 'get'
// });
// }
/** 发布地图根据id生成子系统及权限 */
export function generateAncillaryData(mapId) {
return request({

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

@ -247,7 +247,7 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) {
linklist = loadlinklist;
signallist = loadsignallist;
stationstandlist = loadstationstandlist;
trainlisttest = loadtrainlisttest;
realsectionlist = loadrealsectionlist;
rails = loadrails;

View File

@ -31,12 +31,13 @@ export function TrainConnect(trafficTrain,deviceaction,toptrain,routegroup,passe
const data = JSON.parse(Response.body);
if(data.type == "PFV"){
console.log(data);
console.log(trafficTrain.trainList);
// console.log(data);
// console.log(trafficTrain.trainList);
for(let k in trafficTrain.trainList){
if(trafficTrain.trainList[k].code == data.body){
updateValue(data.body);
trafficTrain.updateNowTrainCode(data.body);
trafficTrain.updateNowTrunk(0+'');
break;
}
}
@ -55,8 +56,9 @@ export function TrainConnect(trafficTrain,deviceaction,toptrain,routegroup,passe
}
}
if(data.type == "TRAIN_PFI_BL"){
if(data.type == "TRAIN_PFI_BL"){
// console.log(data);
trafficTrain.updateTrainData(data.body);

View File

@ -244,7 +244,9 @@ export function Jl3dTrafficTrain(dom,skinCode,routegroup,viewMap,initCode) {
window.onresize = function () {
passerRender.reSize(scope.dom.offsetWidth,scope.dom.offsetHeight);
}
this.updateNowTrunk = function(newTrunkNum){
passerHuman.nowTrunk = newTrunkNum;
};
this.switchcamera = function(trunkNum){
passerHuman.nowTrunk = trunkNum;
@ -316,10 +318,14 @@ export function Jl3dTrafficTrain(dom,skinCode,routegroup,viewMap,initCode) {
this.updateTrainData = function(newData){
if(scope.trainList.length > 0){
for(let i=0;i<scope.trainList.length;i++){
if(newData.code == scope.trainList[i].code){
scope.trainList[i].num = scope.trainList[i].num + newData.in - newData.out;
// console.log(scope.trainList);
// if(scope.trainList.length > 0){
// for(let k in scope.trainList.length){
let k = newData.code;
if(scope.trainList[k]){
// console.log(newData);
// console.log(scope.trainList[k].num);
scope.trainList[k].num = scope.trainList[k].num + newData.in - newData.out;
if(passerTrain.toptrain.nowcode == newData.code){
scope.humanWaitIn = getnum(newData.in,6);
@ -330,15 +336,15 @@ export function Jl3dTrafficTrain(dom,skinCode,routegroup,viewMap,initCode) {
// console.log("------------------");
passerHuman.initTrainRail(humanlist,scope.humanWaitIn,scope.humanWaitOut,nowLeaveDoor);
let trainDataList = getnum(scope.trainList[i].num,6);
let trainDataList = getnum(scope.trainList[k].num,6);
// nowTrunk.code = newCode;
scope.nowTrunk.numList = trainDataList;
updateTrainNum(trainDataList);
}
i = scope.trainList.length;
// i = scope.trainList.length;
}
}
}
// }
// }
}
this.updateNowTrainCode = function(newCode){

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

@ -1,5 +1,6 @@
import store from '@/store/index_APP_TARGET';
import { getPublishMapVersionById, getPublishMapDetailById, getNewMapDataByMapId} from '@/api/jmap/map';
import { getPublishMapVersionById, getPublishMapDetailById} from '@/api/jmap/map';
// getNewMapDataByMapId
// import { getNewMapDataByGroup } from '@/api/simulation';
// 获取地图版本数据和store里面的map版本做比较如果不同
@ -48,7 +49,7 @@ export function loadMapDataById(mapId, type = 'mapPreview') {
export function loadNewMapDataByMapId(mapId) {
return new Promise((resolve, reject) => {
getNewMapDataByMapId(mapId).then(resp => {
getPublishMapDetailById(mapId).then(resp => {
covertData(resp.data, 'mapId', resolve);
}).catch(error => {
reject(error);

View File

@ -31,10 +31,6 @@ export default {
},
data() {
return {
// size: {
// width: document.documentElement.clientWidth - 400,
// height: document.documentElement.clientHeight - 80
// },
maskOpen: false,
maskWidth: 'calc(100% - 450px)',
disPlay: false
@ -173,8 +169,6 @@ export default {
this.clearSubscribe();
}
this.$store.dispatch('training/over').then(() => {
EventBus.$emit('runPlanStop');
EventBus.$emit('chatSubscribeStop');
history.go(-1);
});
},
@ -189,8 +183,7 @@ export default {
this.clearSubscribe();
const header = { group: this.$route.query.group || '', 'X-Token': getToken() };
creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header);
await this.$store.dispatch('training/setHasSubscribed');
// await this.$store.dispatch('training/setHasSubscribed');
},
clearSubscribe() {
clearSubscribe(`${displayTopic}\/${this.$route.query.group}`);

View File

@ -180,8 +180,6 @@ export default {
this.clearSubscribe();
}
this.$store.dispatch('training/over').then(() => {
EventBus.$emit('runPlanStop');
EventBus.$emit('chatSubscribeStop');
history.go(-1);
});
},
@ -196,8 +194,7 @@ export default {
this.clearSubscribe();
const header = { group: this.$route.query.group || '', 'X-Token': getToken() };
creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header);
await this.$store.dispatch('training/setHasSubscribed');
// await this.$store.dispatch('training/setHasSubscribed');
},
clearSubscribe() {
clearSubscribe(`${displayTopic}\/${this.$route.query.group}`);

View File

@ -133,8 +133,7 @@ export default {
this.clearSubscribe();
const header = { group: this.group || '', 'X-Token': getToken() };
creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header);
await this.$store.dispatch('training/setHasSubscribed');
// await this.$store.dispatch('training/setHasSubscribed');
},
clearSubscribe() {
clearSubscribe(`${displayTopic}\/${this.group}`);

View File

@ -281,8 +281,7 @@ export default {
this.clearSubscribe();
const header = { group: this.$route.query.group || '', 'X-Token': getToken() };
creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header);
await this.$store.dispatch('training/setHasSubscribed');
// await this.$store.dispatch('training/setHasSubscribed');
},
clearSubscribe() {
clearSubscribe(`${displayTopic}\/${this.$route.query.group}`);

View File

@ -345,8 +345,7 @@ export default {
this.clearSubscribe();
const header = { group: this.group || '', 'X-Token': getToken() };
creatSubscribe(`${displayTopic}\/${this.group}`, header);
await this.$store.dispatch('training/setHasSubscribed');
// await this.$store.dispatch('training/setHasSubscribed');
},
clearSubscribe() {
clearSubscribe(`${displayTopic}\/${this.group}`);

View File

@ -381,7 +381,7 @@ export default {
this.clearSubscribe();
const header = { group: this.group || '', 'X-Token': getToken() };
creatSubscribe(`${displayTopic}\/${this.group}`, header);
await this.$store.dispatch('training/setHasSubscribed');
// await this.$store.dispatch('training/setHasSubscribed');
},
clearSubscribe() {
clearSubscribe(`${displayTopic}\/${this.group}`);

View File

@ -170,7 +170,7 @@ export default {
this.clearSubscribe();
const header = { group: this.$route.query.group || '', 'X-Token': getToken() };
creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header);
await this.$store.dispatch('training/setHasSubscribed');
// await this.$store.dispatch('training/setHasSubscribed');
this.$store.dispatch('app/animationsClose');
},
clearSubscribe() {

View File

@ -10,7 +10,7 @@
<menu-script v-if="isScript" ref="menuScript" :offset-bottom="offsetBottom" :offset="offset" :text-status-height="textStatusHeight" :data-error="dataError" @start="start" @end="end" />
<menu-dispather-contest v-if="isContest" ref="menuDispatherContest" :offset="offset" :offset-bottom="offsetBottom" :data-error="dataError" :text-status-height="textStatusHeight" @start="start" @end="end" />
</template>
<menu-train-list v-if="isDemon||isContest||isScript" @setCenter="setCenter" />
<menu-train-list v-if="isDemon||isContest||isScript" />
<menu-system-time ref="menuSystemTime" :offset="offset" :group="group" />
</div>
</template>
@ -82,9 +82,9 @@ export default {
isScript() {
return this.mode === 'script';
},
isPlan() {
return this.mode === 'plan';
},
// isPlan() {
// return this.mode === 'plan';
// },
mapId() {
return this.$route.query.mapId;
},
@ -157,10 +157,6 @@ export default {
await this.$refs.menuDispatherContest.back();
}
},
//
setCenter(code) {
this.$jlmap.setCenter(code);
},
//
setPosition() {
this.$nextTick(() => {

View File

@ -1,10 +1,6 @@
<template>
<div class="menuTrainListOut" :class="{'xian_01' : lineCode == '11', 'active': drawer}">
<div class="menuTrainListBtn" @click="clickBtn">
<!-- <i class="el-icon-more" /> -->
<p style="margin: 0;"></p>
<p style="margin: 0;"></p>
</div>
<div class="menuTrainListBtn" @click="clickBtn">列车</div>
<div :show-close="false" class="menuTrainList_box" style="height: 100%;">
<div v-if="lineCode=='10'||lineCode=='11'" class="menuTrainList">
<div class="bottomTrainListInfo">下行列车详细信息</div>
@ -113,11 +109,8 @@ export default {
}
},
selectTrain(row, column, event) {
this.setCenter(row.code);
},
//
setCenter(code) {
this.$emit('setCenter', code);
//
this.$jlmap.setCenter(row.code);
},
covert(data) {
const absData = Math.abs(data);
@ -159,6 +152,7 @@ export default {
text-align: center;
justify-content: center;
padding: 7px 4px;
width: 23px;
}
.menuTrainList_box{
height: 100%;

View File

@ -161,19 +161,7 @@ export default {
this.$store.dispatch('config/resize', { width, height });
},
async back() {
// if (this.group) {
// await clearSimulation(this.group);
// this.clearSubscribe();
// }
// this.$store.dispatch('map/setShowCentralizedStationCode', '');
// history.go(-1);
// await this.$store.dispatch('map/mapClear');
// if (this.group) {
// await clearSimulation(this.group);
// this.clearSubscribe();
// }
window.close();
// Notification.closeAll();
},
async statusMessage(list) {
await this.$store.dispatch('training/updateMapState', list);
@ -182,13 +170,8 @@ export default {
async subscribe() {
this.clearSubscribe();
const header = { group: this.group || '', 'X-Token': getToken() };
// creatSubscribe(`${jl3dTopic}\/${this.$route.query.group}`, header);
creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header);
// setTimeout(()=>{
// }, 500);
// });
await this.$store.dispatch('training/setHasSubscribed');
// await this.$store.dispatch('training/setHasSubscribed');
},
clearSubscribe() {
clearSubscribe(`${jl3dTopic}\/${this.group}`);

View File

@ -109,7 +109,6 @@ export default {
this.clearSubscribe();
const header = { group: this.$route.query.group || '', 'X-Token': getToken() };
creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header);
await this.$store.dispatch('training/setHasSubscribed');
},
clearSubscribe() {

View File

@ -14,10 +14,6 @@ import { validateCharCode } from '@/utils/validate';
export default {
name: 'DictionaryDetailEdit',
props: {
type: {
type: String,
required: true
},
dicId: {
type: String,
required: true
@ -26,21 +22,22 @@ export default {
data() {
return {
dialogVisible: false,
isAdd:true,
formModel: {
code: '',
name: '',
status: '1',
remarks: ''
}
},
title:''
};
},
computed: {
form() {
const isAdd = this.type === 'ADD';
const form = {
labelWidth: '60px',
items: [
{ prop: 'code', label: this.$t('system.code'), type: 'text', required: true, disabled: !isAdd },
{ prop: 'code', label: this.$t('system.code'), type: 'text', required: true, disabled: !this.isAdd },
{ prop: 'name', label: this.$t('system.name'), type: 'text', required: true },
{
prop: 'status', label: this.$t('system.status'), type: 'select', required: true, options: this.$ConstSelect.Status
@ -52,6 +49,11 @@ export default {
},
rules() {
const crules = {
code: [
{ required: true, message: this.$t('rules.pleaseInputCode'), trigger: 'blur' },
{ min: 1, max: 25, message: this.$t('rules.strLength1To25'), trigger: 'blur' },
{ validator: this.validateCode, trigger: 'blur' }
],
name: [
{ required: true, message: this.$t('rules.pleaseInputName'), trigger: 'blur' },
{ min: 1, max: 25, message: this.$t('rules.strLength1To25'), trigger: 'blur' }
@ -63,24 +65,7 @@ export default {
{ max: 50, message: this.$t('rules.strLengthNotExceed50'), trigger: 'blur' }
]
};
if (this.type === 'ADD') {
return Object.assign(crules, {
code: [
{ required: true, message: this.$t('rules.pleaseInputCode'), trigger: 'blur' },
{ min: 1, max: 25, message: this.$t('rules.strLength1To25'), trigger: 'blur' },
{ validator: this.validateCode, trigger: 'blur' }
]
});
} else {
return crules;
}
},
title() {
if (this.type === 'ADD') {
return this.$t('system.createDetail');
} else {
return this.$t('system.editDetail');
}
return crules;
}
},
methods: {
@ -100,18 +85,24 @@ export default {
}
},
show(id) {
this.dialogVisible = true;
if (id) {
getData(this.dicId, id).then(response => {
this.formModel = response.data;
this.$refs.dataform.resetForm();
this.isAdd = false;
this.title = this.$t('system.editDetail');
});
} else {
this.isAdd = true;
this.$refs.dataform.resetForm();
this.title = this.$t('system.createDetail');
}
this.dialogVisible = true;
},
doSave() {
const self = this;
this.$refs.dataform.validateForm(() => {
if (self.type === 'ADD') {
if (this.isAdd) {
self.create();
} else {
self.update();

View File

@ -6,8 +6,7 @@
<el-button type="primary" @click="turnback">{{ $t('global.back') }}</el-button>
</el-button-group>
</div>
<dictionary-detail-edit ref="create" type="ADD" :dic-id="dicId" @reloadTable="reloadTable" />
<dictionary-detail-edit ref="edit" type="EDIT" :dic-id="dicId" @reloadTable="reloadTable" />
<dictionary-detail-edit ref="edit" :dic-id="dicId" @reloadTable="reloadTable" />
</div>
</template>
@ -118,7 +117,7 @@ export default {
},
handleAdd() {
this.$refs.create.show();
this.$refs.edit.show();
},
handleBatchDelete() {

View File

@ -146,7 +146,6 @@ export default {
//
this.mapList = [];
const res = await getPublishMapListOnline();
this.allMapList = res.data;
res.data.forEach(elem => {
this.queryForm.queryObject.mapId.config.data.push({ value: elem.id, label: elem.name });
this.mapList.push({ value: elem.id, label: elem.name });

View File

@ -100,19 +100,11 @@ export default {
currentModel: {}
};
},
created() {
this.loadInitData();
},
methods: {
loadInitData() {
},
//
edit(index, row) {
this.$refs.edit.show(row);
},
//
handleDelete(index, row) {
this.$confirm(this.$t('system.wellDelExamResult'), this.$t('global.tips'), {
@ -129,7 +121,6 @@ export default {
});
});
},
reloadTable() {
this.queryList.reload();
}

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);

View File

@ -17,7 +17,6 @@
:filter-node-method="filterNode"
:default-expanded-keys="expandList"
@node-click="clickEvent"
@node-contextmenu="showContextMenu"
@node-expand="nodeExpand"
@node-collapse="nodeCollapse"
>
@ -54,9 +53,6 @@ export default {
loading: true,
filterText: '',
treeList: [],
selected: {},
node: {
},
mapId: '',
expandList: [],
filterSelect: ''
@ -79,8 +75,6 @@ export default {
this.$refs.tree.filter(val);
}
},
beforeDestroy () {
},
mounted() {
if (this.getMapByCode) {
this.refresh();
@ -91,12 +85,6 @@ export default {
if (!value) return true;
return data.name.includes(value);
},
showContextMenu(e, obj, node, vueElem) {
if (obj) {
this.node = node;
this.selected = obj;
}
},
clickEvent(obj, data, ele, isReplace = false) {
localStore.set('trainingPlatformCheckId' + this.filterSelect + this.userId + this.project, obj.key);
while (data) {
@ -109,11 +97,8 @@ export default {
}
if ( obj.type === 'Map') {
this.mapId = obj.id;
if (isReplace) {
this.$router.replace({ path: `${UrlConfig.trainingPlatform.permission}/${this.mapId}`});
} else {
this.$router.push({ path: `${UrlConfig.trainingPlatform.permission}/${this.mapId}`});
}
const router = { path: `${UrlConfig.trainingPlatform.permission}/${this.mapId}`};
this.toNextPage(isReplace, router);
} else if ( obj.type === 'MapSystem') {
getSubSystemInfo(obj.id).then(resp => { //
let router = '';
@ -121,44 +106,19 @@ export default {
case 'Exam':
this.setLocalRoute(`${UrlConfig.trainingPlatform.examHome}/${obj.id}`);
router = localStore.get('examDetail' + obj.id);
if (router) {
if (isReplace) {
this.$router.replace(router);
} else {
this.$router.push(router);
}
} else {
if (isReplace) {
this.$router.replace({ path: `${UrlConfig.trainingPlatform.examHome}/${obj.id}`});
} else {
this.$router.push({ path: `${UrlConfig.trainingPlatform.examHome}/${obj.id}`});
}
}
if (!router) { router = { path: `${UrlConfig.trainingPlatform.examHome}/${obj.id}`}; }
this.toNextPage(isReplace, router);
break;
case 'Lesson':
this.setLocalRoute(`${UrlConfig.trainingPlatform.teachHome}/${obj.id}`);
router = localStore.get('teachDetail' + obj.id);
if (router) {
if (isReplace) {
this.$router.replace(router);
} else {
this.$router.push(router);
}
} else {
if (isReplace) {
this.$router.replace({ path: `${UrlConfig.trainingPlatform.teachHome}/${obj.id}`});
} else {
this.$router.push({ path: `${UrlConfig.trainingPlatform.teachHome}/${obj.id}`});
}
}
if (!router) { router = { path: `${UrlConfig.trainingPlatform.teachHome}/${obj.id}`}; }
this.toNextPage(isReplace, router);
break;
case 'Simulation':
this.setLocalRoute(`${UrlConfig.trainingPlatform.prodDetail}/${obj.id}?mapId=${this.mapId}`);
if (isReplace) {
this.$router.replace({ path: `${UrlConfig.trainingPlatform.prodDetail}/${obj.id}`, query: { mapId: this.mapId}});
} else {
this.$router.push({ path: `${UrlConfig.trainingPlatform.prodDetail}/${obj.id}`, query: { mapId: this.mapId}});
}
router = { path: `${UrlConfig.trainingPlatform.prodDetail}/${obj.id}`, query: { mapId: this.mapId}};
this.toNextPage(isReplace, router);
break;
}
}).catch((error) => {
@ -168,6 +128,9 @@ export default {
});
}
},
toNextPage(isReplace, router) {
isReplace ? this.$router.replace(router) : this.$router.push(router);
},
setLocalRoute(path) {
localStore.set('trainingPlatformRoute' + this.userId + this.project, path);
},