Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
This commit is contained in:
commit
388f9a14ca
@ -11,7 +11,7 @@ export function getPublishMapVersion(id) {
|
|||||||
/** 根据皮肤获取发布地图详细内容*/
|
/** 根据皮肤获取发布地图详细内容*/
|
||||||
export function getPublishMapDetail(id) {
|
export function getPublishMapDetail(id) {
|
||||||
const datad = request({
|
const datad = request({
|
||||||
url: `/api/map/${id}/details`,
|
url: `/api/map/${id}/graphData`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
return datad.then();
|
return datad.then();
|
||||||
|
@ -229,13 +229,13 @@ export function publisMapCityList(data) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 新版地图根据仿真mapId获取仿真地图数据 */
|
// /** 新版地图根据仿真mapId获取仿真地图数据 */
|
||||||
export function getNewMapDataByMapId(mapId) {
|
// export function getNewMapDataByMapId(mapId) {
|
||||||
return request({
|
// return request({
|
||||||
url: `/api/map/${mapId}/mapData`,
|
// url: `/api/map/${mapId}/mapData`,
|
||||||
method: 'get'
|
// method: 'get'
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
/** 发布地图根据id生成子系统及权限 */
|
/** 发布地图根据id生成子系统及权限 */
|
||||||
export function generateAncillaryData(mapId) {
|
export function generateAncillaryData(mapId) {
|
||||||
return request({
|
return request({
|
||||||
|
@ -25,6 +25,7 @@ export default {
|
|||||||
mapName: 'Map Name',
|
mapName: 'Map Name',
|
||||||
trainingName: 'Training Name',
|
trainingName: 'Training Name',
|
||||||
trainingUseTime: 'Training Time',
|
trainingUseTime: 'Training Time',
|
||||||
|
hour:'Hour',
|
||||||
minute: 'Minute',
|
minute: 'Minute',
|
||||||
second: 'Second',
|
second: 'Second',
|
||||||
createSimulationTitle: 'Create Simulation Information',
|
createSimulationTitle: 'Create Simulation Information',
|
||||||
|
@ -25,6 +25,7 @@ export default {
|
|||||||
mapName: '地图名称',
|
mapName: '地图名称',
|
||||||
trainingName: '实训名称',
|
trainingName: '实训名称',
|
||||||
trainingUseTime: '实训用时',
|
trainingUseTime: '实训用时',
|
||||||
|
hour:'时',
|
||||||
minute: '分',
|
minute: '分',
|
||||||
second: '秒',
|
second: '秒',
|
||||||
createSimulationTitle: '创建仿真信息',
|
createSimulationTitle: '创建仿真信息',
|
||||||
|
@ -31,12 +31,13 @@ export function TrainConnect(trafficTrain,deviceaction,toptrain,routegroup,passe
|
|||||||
const data = JSON.parse(Response.body);
|
const data = JSON.parse(Response.body);
|
||||||
|
|
||||||
if(data.type == "PFV"){
|
if(data.type == "PFV"){
|
||||||
console.log(data);
|
// console.log(data);
|
||||||
console.log(trafficTrain.trainList);
|
// console.log(trafficTrain.trainList);
|
||||||
for(let k in trafficTrain.trainList){
|
for(let k in trafficTrain.trainList){
|
||||||
if(trafficTrain.trainList[k].code == data.body){
|
if(trafficTrain.trainList[k].code == data.body){
|
||||||
updateValue(data.body);
|
updateValue(data.body);
|
||||||
trafficTrain.updateNowTrainCode(data.body);
|
trafficTrain.updateNowTrainCode(data.body);
|
||||||
|
trafficTrain.updateNowTrunk(0+'');
|
||||||
break;
|
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);
|
trafficTrain.updateTrainData(data.body);
|
||||||
|
|
||||||
|
|
||||||
|
@ -244,7 +244,9 @@ export function Jl3dTrafficTrain(dom,skinCode,routegroup,viewMap,initCode) {
|
|||||||
window.onresize = function () {
|
window.onresize = function () {
|
||||||
passerRender.reSize(scope.dom.offsetWidth,scope.dom.offsetHeight);
|
passerRender.reSize(scope.dom.offsetWidth,scope.dom.offsetHeight);
|
||||||
}
|
}
|
||||||
|
this.updateNowTrunk = function(newTrunkNum){
|
||||||
|
passerHuman.nowTrunk = newTrunkNum;
|
||||||
|
};
|
||||||
this.switchcamera = function(trunkNum){
|
this.switchcamera = function(trunkNum){
|
||||||
|
|
||||||
passerHuman.nowTrunk = trunkNum;
|
passerHuman.nowTrunk = trunkNum;
|
||||||
@ -316,10 +318,14 @@ export function Jl3dTrafficTrain(dom,skinCode,routegroup,viewMap,initCode) {
|
|||||||
|
|
||||||
|
|
||||||
this.updateTrainData = function(newData){
|
this.updateTrainData = function(newData){
|
||||||
if(scope.trainList.length > 0){
|
// console.log(scope.trainList);
|
||||||
for(let i=0;i<scope.trainList.length;i++){
|
// if(scope.trainList.length > 0){
|
||||||
if(newData.code == scope.trainList[i].code){
|
// for(let k in scope.trainList.length){
|
||||||
scope.trainList[i].num = scope.trainList[i].num + newData.in - newData.out;
|
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){
|
if(passerTrain.toptrain.nowcode == newData.code){
|
||||||
scope.humanWaitIn = getnum(newData.in,6);
|
scope.humanWaitIn = getnum(newData.in,6);
|
||||||
@ -330,15 +336,15 @@ export function Jl3dTrafficTrain(dom,skinCode,routegroup,viewMap,initCode) {
|
|||||||
// console.log("------------------");
|
// console.log("------------------");
|
||||||
passerHuman.initTrainRail(humanlist,scope.humanWaitIn,scope.humanWaitOut,nowLeaveDoor);
|
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;
|
// nowTrunk.code = newCode;
|
||||||
scope.nowTrunk.numList = trainDataList;
|
scope.nowTrunk.numList = trainDataList;
|
||||||
updateTrainNum(trainDataList);
|
updateTrainNum(trainDataList);
|
||||||
}
|
}
|
||||||
i = scope.trainList.length;
|
// i = scope.trainList.length;
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
this.updateNowTrainCode = function(newCode){
|
this.updateNowTrainCode = function(newCode){
|
||||||
|
@ -82,3 +82,15 @@ export function computationTime(time) {
|
|||||||
}
|
}
|
||||||
return hours + ':' + minutes + ':' + seconds;
|
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;
|
||||||
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import store from '@/store/index_APP_TARGET';
|
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';
|
// import { getNewMapDataByGroup } from '@/api/simulation';
|
||||||
|
|
||||||
// 获取地图版本数据,和store里面的map版本做比较,如果不同
|
// 获取地图版本数据,和store里面的map版本做比较,如果不同
|
||||||
@ -48,7 +49,7 @@ export function loadMapDataById(mapId, type = 'mapPreview') {
|
|||||||
|
|
||||||
export function loadNewMapDataByMapId(mapId) {
|
export function loadNewMapDataByMapId(mapId) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
getNewMapDataByMapId(mapId).then(resp => {
|
getPublishMapDetailById(mapId).then(resp => {
|
||||||
covertData(resp.data, 'mapId', resolve);
|
covertData(resp.data, 'mapId', resolve);
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
reject(error);
|
reject(error);
|
||||||
|
@ -31,10 +31,6 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// size: {
|
|
||||||
// width: document.documentElement.clientWidth - 400,
|
|
||||||
// height: document.documentElement.clientHeight - 80
|
|
||||||
// },
|
|
||||||
maskOpen: false,
|
maskOpen: false,
|
||||||
maskWidth: 'calc(100% - 450px)',
|
maskWidth: 'calc(100% - 450px)',
|
||||||
disPlay: false
|
disPlay: false
|
||||||
@ -173,8 +169,6 @@ export default {
|
|||||||
this.clearSubscribe();
|
this.clearSubscribe();
|
||||||
}
|
}
|
||||||
this.$store.dispatch('training/over').then(() => {
|
this.$store.dispatch('training/over').then(() => {
|
||||||
EventBus.$emit('runPlanStop');
|
|
||||||
EventBus.$emit('chatSubscribeStop');
|
|
||||||
history.go(-1);
|
history.go(-1);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -189,8 +183,7 @@ export default {
|
|||||||
this.clearSubscribe();
|
this.clearSubscribe();
|
||||||
const header = { group: this.$route.query.group || '', 'X-Token': getToken() };
|
const header = { group: this.$route.query.group || '', 'X-Token': getToken() };
|
||||||
creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header);
|
creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header);
|
||||||
|
// await this.$store.dispatch('training/setHasSubscribed');
|
||||||
await this.$store.dispatch('training/setHasSubscribed');
|
|
||||||
},
|
},
|
||||||
clearSubscribe() {
|
clearSubscribe() {
|
||||||
clearSubscribe(`${displayTopic}\/${this.$route.query.group}`);
|
clearSubscribe(`${displayTopic}\/${this.$route.query.group}`);
|
||||||
|
@ -180,8 +180,6 @@ export default {
|
|||||||
this.clearSubscribe();
|
this.clearSubscribe();
|
||||||
}
|
}
|
||||||
this.$store.dispatch('training/over').then(() => {
|
this.$store.dispatch('training/over').then(() => {
|
||||||
EventBus.$emit('runPlanStop');
|
|
||||||
EventBus.$emit('chatSubscribeStop');
|
|
||||||
history.go(-1);
|
history.go(-1);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -196,8 +194,7 @@ export default {
|
|||||||
this.clearSubscribe();
|
this.clearSubscribe();
|
||||||
const header = { group: this.$route.query.group || '', 'X-Token': getToken() };
|
const header = { group: this.$route.query.group || '', 'X-Token': getToken() };
|
||||||
creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header);
|
creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header);
|
||||||
|
// await this.$store.dispatch('training/setHasSubscribed');
|
||||||
await this.$store.dispatch('training/setHasSubscribed');
|
|
||||||
},
|
},
|
||||||
clearSubscribe() {
|
clearSubscribe() {
|
||||||
clearSubscribe(`${displayTopic}\/${this.$route.query.group}`);
|
clearSubscribe(`${displayTopic}\/${this.$route.query.group}`);
|
||||||
|
@ -133,8 +133,7 @@ export default {
|
|||||||
this.clearSubscribe();
|
this.clearSubscribe();
|
||||||
const header = { group: this.group || '', 'X-Token': getToken() };
|
const header = { group: this.group || '', 'X-Token': getToken() };
|
||||||
creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header);
|
creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header);
|
||||||
|
// await this.$store.dispatch('training/setHasSubscribed');
|
||||||
await this.$store.dispatch('training/setHasSubscribed');
|
|
||||||
},
|
},
|
||||||
clearSubscribe() {
|
clearSubscribe() {
|
||||||
clearSubscribe(`${displayTopic}\/${this.group}`);
|
clearSubscribe(`${displayTopic}\/${this.group}`);
|
||||||
|
@ -281,8 +281,7 @@ export default {
|
|||||||
this.clearSubscribe();
|
this.clearSubscribe();
|
||||||
const header = { group: this.$route.query.group || '', 'X-Token': getToken() };
|
const header = { group: this.$route.query.group || '', 'X-Token': getToken() };
|
||||||
creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header);
|
creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header);
|
||||||
|
// await this.$store.dispatch('training/setHasSubscribed');
|
||||||
await this.$store.dispatch('training/setHasSubscribed');
|
|
||||||
},
|
},
|
||||||
clearSubscribe() {
|
clearSubscribe() {
|
||||||
clearSubscribe(`${displayTopic}\/${this.$route.query.group}`);
|
clearSubscribe(`${displayTopic}\/${this.$route.query.group}`);
|
||||||
|
@ -345,8 +345,7 @@ export default {
|
|||||||
this.clearSubscribe();
|
this.clearSubscribe();
|
||||||
const header = { group: this.group || '', 'X-Token': getToken() };
|
const header = { group: this.group || '', 'X-Token': getToken() };
|
||||||
creatSubscribe(`${displayTopic}\/${this.group}`, header);
|
creatSubscribe(`${displayTopic}\/${this.group}`, header);
|
||||||
|
// await this.$store.dispatch('training/setHasSubscribed');
|
||||||
await this.$store.dispatch('training/setHasSubscribed');
|
|
||||||
},
|
},
|
||||||
clearSubscribe() {
|
clearSubscribe() {
|
||||||
clearSubscribe(`${displayTopic}\/${this.group}`);
|
clearSubscribe(`${displayTopic}\/${this.group}`);
|
||||||
|
@ -381,7 +381,7 @@ export default {
|
|||||||
this.clearSubscribe();
|
this.clearSubscribe();
|
||||||
const header = { group: this.group || '', 'X-Token': getToken() };
|
const header = { group: this.group || '', 'X-Token': getToken() };
|
||||||
creatSubscribe(`${displayTopic}\/${this.group}`, header);
|
creatSubscribe(`${displayTopic}\/${this.group}`, header);
|
||||||
await this.$store.dispatch('training/setHasSubscribed');
|
// await this.$store.dispatch('training/setHasSubscribed');
|
||||||
},
|
},
|
||||||
clearSubscribe() {
|
clearSubscribe() {
|
||||||
clearSubscribe(`${displayTopic}\/${this.group}`);
|
clearSubscribe(`${displayTopic}\/${this.group}`);
|
||||||
|
@ -170,7 +170,7 @@ export default {
|
|||||||
this.clearSubscribe();
|
this.clearSubscribe();
|
||||||
const header = { group: this.$route.query.group || '', 'X-Token': getToken() };
|
const header = { group: this.$route.query.group || '', 'X-Token': getToken() };
|
||||||
creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header);
|
creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header);
|
||||||
await this.$store.dispatch('training/setHasSubscribed');
|
// await this.$store.dispatch('training/setHasSubscribed');
|
||||||
this.$store.dispatch('app/animationsClose');
|
this.$store.dispatch('app/animationsClose');
|
||||||
},
|
},
|
||||||
clearSubscribe() {
|
clearSubscribe() {
|
||||||
|
@ -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-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" />
|
<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>
|
</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" />
|
<menu-system-time ref="menuSystemTime" :offset="offset" :group="group" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -82,9 +82,9 @@ export default {
|
|||||||
isScript() {
|
isScript() {
|
||||||
return this.mode === 'script';
|
return this.mode === 'script';
|
||||||
},
|
},
|
||||||
isPlan() {
|
// isPlan() {
|
||||||
return this.mode === 'plan';
|
// return this.mode === 'plan';
|
||||||
},
|
// },
|
||||||
mapId() {
|
mapId() {
|
||||||
return this.$route.query.mapId;
|
return this.$route.query.mapId;
|
||||||
},
|
},
|
||||||
@ -157,10 +157,6 @@ export default {
|
|||||||
await this.$refs.menuDispatherContest.back();
|
await this.$refs.menuDispatherContest.back();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 以某个设备居中显示
|
|
||||||
setCenter(code) {
|
|
||||||
this.$jlmap.setCenter(code);
|
|
||||||
},
|
|
||||||
// 设置各个按钮的定位
|
// 设置各个按钮的定位
|
||||||
setPosition() {
|
setPosition() {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
|
@ -1,10 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="menuTrainListOut" :class="{'xian_01' : lineCode == '11', 'active': drawer}">
|
<div class="menuTrainListOut" :class="{'xian_01' : lineCode == '11', 'active': drawer}">
|
||||||
<div class="menuTrainListBtn" @click="clickBtn">
|
<div class="menuTrainListBtn" @click="clickBtn">列车</div>
|
||||||
<!-- <i class="el-icon-more" /> -->
|
|
||||||
<p style="margin: 0;">列</p>
|
|
||||||
<p style="margin: 0;">车</p>
|
|
||||||
</div>
|
|
||||||
<div :show-close="false" class="menuTrainList_box" style="height: 100%;">
|
<div :show-close="false" class="menuTrainList_box" style="height: 100%;">
|
||||||
<div v-if="lineCode=='10'||lineCode=='11'" class="menuTrainList">
|
<div v-if="lineCode=='10'||lineCode=='11'" class="menuTrainList">
|
||||||
<div class="bottomTrainListInfo">下行列车详细信息</div>
|
<div class="bottomTrainListInfo">下行列车详细信息</div>
|
||||||
@ -113,11 +109,8 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
selectTrain(row, column, event) {
|
selectTrain(row, column, event) {
|
||||||
this.setCenter(row.code);
|
|
||||||
},
|
|
||||||
// 设置显示中心
|
// 设置显示中心
|
||||||
setCenter(code) {
|
this.$jlmap.setCenter(row.code);
|
||||||
this.$emit('setCenter', code);
|
|
||||||
},
|
},
|
||||||
covert(data) {
|
covert(data) {
|
||||||
const absData = Math.abs(data);
|
const absData = Math.abs(data);
|
||||||
@ -159,6 +152,7 @@ export default {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
padding: 7px 4px;
|
padding: 7px 4px;
|
||||||
|
width: 23px;
|
||||||
}
|
}
|
||||||
.menuTrainList_box{
|
.menuTrainList_box{
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
@ -161,19 +161,7 @@ export default {
|
|||||||
this.$store.dispatch('config/resize', { width, height });
|
this.$store.dispatch('config/resize', { width, height });
|
||||||
},
|
},
|
||||||
async back() {
|
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();
|
window.close();
|
||||||
// Notification.closeAll();
|
|
||||||
},
|
},
|
||||||
async statusMessage(list) {
|
async statusMessage(list) {
|
||||||
await this.$store.dispatch('training/updateMapState', list);
|
await this.$store.dispatch('training/updateMapState', list);
|
||||||
@ -182,13 +170,8 @@ export default {
|
|||||||
async subscribe() {
|
async subscribe() {
|
||||||
this.clearSubscribe();
|
this.clearSubscribe();
|
||||||
const header = { group: this.group || '', 'X-Token': getToken() };
|
const header = { group: this.group || '', 'X-Token': getToken() };
|
||||||
// creatSubscribe(`${jl3dTopic}\/${this.$route.query.group}`, header);
|
|
||||||
creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header);
|
creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header);
|
||||||
// setTimeout(()=>{
|
// await this.$store.dispatch('training/setHasSubscribed');
|
||||||
|
|
||||||
// }, 500);
|
|
||||||
// });
|
|
||||||
await this.$store.dispatch('training/setHasSubscribed');
|
|
||||||
},
|
},
|
||||||
clearSubscribe() {
|
clearSubscribe() {
|
||||||
clearSubscribe(`${jl3dTopic}\/${this.group}`);
|
clearSubscribe(`${jl3dTopic}\/${this.group}`);
|
||||||
|
@ -109,7 +109,6 @@ export default {
|
|||||||
this.clearSubscribe();
|
this.clearSubscribe();
|
||||||
const header = { group: this.$route.query.group || '', 'X-Token': getToken() };
|
const header = { group: this.$route.query.group || '', 'X-Token': getToken() };
|
||||||
creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header);
|
creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header);
|
||||||
|
|
||||||
await this.$store.dispatch('training/setHasSubscribed');
|
await this.$store.dispatch('training/setHasSubscribed');
|
||||||
},
|
},
|
||||||
clearSubscribe() {
|
clearSubscribe() {
|
||||||
|
@ -14,10 +14,6 @@ import { validateCharCode } from '@/utils/validate';
|
|||||||
export default {
|
export default {
|
||||||
name: 'DictionaryDetailEdit',
|
name: 'DictionaryDetailEdit',
|
||||||
props: {
|
props: {
|
||||||
type: {
|
|
||||||
type: String,
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
dicId: {
|
dicId: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true
|
required: true
|
||||||
@ -26,21 +22,22 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
|
isAdd:true,
|
||||||
formModel: {
|
formModel: {
|
||||||
code: '',
|
code: '',
|
||||||
name: '',
|
name: '',
|
||||||
status: '1',
|
status: '1',
|
||||||
remarks: ''
|
remarks: ''
|
||||||
}
|
},
|
||||||
|
title:''
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
form() {
|
form() {
|
||||||
const isAdd = this.type === 'ADD';
|
|
||||||
const form = {
|
const form = {
|
||||||
labelWidth: '60px',
|
labelWidth: '60px',
|
||||||
items: [
|
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: '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
|
prop: 'status', label: this.$t('system.status'), type: 'select', required: true, options: this.$ConstSelect.Status
|
||||||
@ -52,6 +49,11 @@ export default {
|
|||||||
},
|
},
|
||||||
rules() {
|
rules() {
|
||||||
const crules = {
|
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: [
|
name: [
|
||||||
{ required: true, message: this.$t('rules.pleaseInputName'), trigger: 'blur' },
|
{ required: true, message: this.$t('rules.pleaseInputName'), trigger: 'blur' },
|
||||||
{ min: 1, max: 25, message: this.$t('rules.strLength1To25'), trigger: 'blur' }
|
{ min: 1, max: 25, message: this.$t('rules.strLength1To25'), trigger: 'blur' }
|
||||||
@ -63,26 +65,9 @@ export default {
|
|||||||
{ max: 50, message: this.$t('rules.strLengthNotExceed50'), trigger: 'blur' }
|
{ 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;
|
return crules;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
title() {
|
|
||||||
if (this.type === 'ADD') {
|
|
||||||
return this.$t('system.createDetail');
|
|
||||||
} else {
|
|
||||||
return this.$t('system.editDetail');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
validateCode(rule, value, callback) {
|
validateCode(rule, value, callback) {
|
||||||
if (!validateCharCode(value)) {
|
if (!validateCharCode(value)) {
|
||||||
@ -100,18 +85,24 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
show(id) {
|
show(id) {
|
||||||
this.dialogVisible = true;
|
|
||||||
if (id) {
|
if (id) {
|
||||||
getData(this.dicId, id).then(response => {
|
getData(this.dicId, id).then(response => {
|
||||||
this.formModel = response.data;
|
this.formModel = response.data;
|
||||||
this.$refs.dataform.resetForm();
|
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() {
|
doSave() {
|
||||||
const self = this;
|
const self = this;
|
||||||
this.$refs.dataform.validateForm(() => {
|
this.$refs.dataform.validateForm(() => {
|
||||||
if (self.type === 'ADD') {
|
if (this.isAdd) {
|
||||||
self.create();
|
self.create();
|
||||||
} else {
|
} else {
|
||||||
self.update();
|
self.update();
|
||||||
|
@ -6,8 +6,7 @@
|
|||||||
<el-button type="primary" @click="turnback">{{ $t('global.back') }}</el-button>
|
<el-button type="primary" @click="turnback">{{ $t('global.back') }}</el-button>
|
||||||
</el-button-group>
|
</el-button-group>
|
||||||
</div>
|
</div>
|
||||||
<dictionary-detail-edit ref="create" type="ADD" :dic-id="dicId" @reloadTable="reloadTable" />
|
<dictionary-detail-edit ref="edit" :dic-id="dicId" @reloadTable="reloadTable" />
|
||||||
<dictionary-detail-edit ref="edit" type="EDIT" :dic-id="dicId" @reloadTable="reloadTable" />
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -118,7 +117,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.$refs.create.show();
|
this.$refs.edit.show();
|
||||||
},
|
},
|
||||||
|
|
||||||
handleBatchDelete() {
|
handleBatchDelete() {
|
||||||
|
@ -146,7 +146,6 @@ export default {
|
|||||||
// 获取地图
|
// 获取地图
|
||||||
this.mapList = [];
|
this.mapList = [];
|
||||||
const res = await getPublishMapListOnline();
|
const res = await getPublishMapListOnline();
|
||||||
this.allMapList = res.data;
|
|
||||||
res.data.forEach(elem => {
|
res.data.forEach(elem => {
|
||||||
this.queryForm.queryObject.mapId.config.data.push({ value: elem.id, label: elem.name });
|
this.queryForm.queryObject.mapId.config.data.push({ value: elem.id, label: elem.name });
|
||||||
this.mapList.push({ value: elem.id, label: elem.name });
|
this.mapList.push({ value: elem.id, label: elem.name });
|
||||||
|
@ -100,19 +100,11 @@ export default {
|
|||||||
currentModel: {}
|
currentModel: {}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
|
||||||
this.loadInitData();
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
loadInitData() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
// 编辑
|
// 编辑
|
||||||
edit(index, row) {
|
edit(index, row) {
|
||||||
this.$refs.edit.show(row);
|
this.$refs.edit.show(row);
|
||||||
},
|
},
|
||||||
|
|
||||||
// 删除
|
// 删除
|
||||||
handleDelete(index, row) {
|
handleDelete(index, row) {
|
||||||
this.$confirm(this.$t('system.wellDelExamResult'), this.$t('global.tips'), {
|
this.$confirm(this.$t('system.wellDelExamResult'), this.$t('global.tips'), {
|
||||||
@ -129,7 +121,6 @@ export default {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
reloadTable() {
|
reloadTable() {
|
||||||
this.queryList.reload();
|
this.queryList.reload();
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getSimulationList, deleteSimulationStats } from '@/api/simulation';
|
import { getSimulationList, deleteSimulationStats } from '@/api/simulation';
|
||||||
|
import {computationSeconds} from '@/utils/date';
|
||||||
import UsersTrainingEdit from './edit';
|
import UsersTrainingEdit from './edit';
|
||||||
import UsersTrainingAdd from './add';
|
import UsersTrainingAdd from './add';
|
||||||
export default {
|
export default {
|
||||||
@ -94,29 +94,17 @@ export default {
|
|||||||
currentModel: {}
|
currentModel: {}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
createTraining() {
|
createTraining() {
|
||||||
this.$refs.add.show();
|
this.$refs.add.show();
|
||||||
},
|
},
|
||||||
computation(fieldValue) {
|
computation(fieldValue) {
|
||||||
if (fieldValue) {
|
return computationSeconds(fieldValue, this.$t('system.hour'), this.$t('system.minute'), this.$t('system.second'));
|
||||||
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')}`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 编辑
|
// 编辑
|
||||||
edit(index, row) {
|
edit(index, row) {
|
||||||
this.$refs.edit.show(row);
|
this.$refs.edit.show(row);
|
||||||
},
|
},
|
||||||
|
|
||||||
// 删除
|
// 删除
|
||||||
handleDelete(index, row) {
|
handleDelete(index, row) {
|
||||||
this.$confirm(this.$t('system.wellDelUserSimulation'), this.$t('global.tips'), {
|
this.$confirm(this.$t('system.wellDelUserSimulation'), this.$t('global.tips'), {
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {computationSeconds} from '@/utils/date';
|
||||||
import { getTrainingListNew, deleteUserTrainingNew } from '@/api/jmap/training';
|
import { getTrainingListNew, deleteUserTrainingNew } from '@/api/jmap/training';
|
||||||
import UsersTrainingEdit from './edit';
|
import UsersTrainingEdit from './edit';
|
||||||
import UsersTrainingAdd from './add';
|
import UsersTrainingAdd from './add';
|
||||||
@ -92,28 +93,13 @@ export default {
|
|||||||
currentModel: {}
|
currentModel: {}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
|
||||||
this.loadInitData();
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
loadInitData() {
|
|
||||||
|
|
||||||
},
|
|
||||||
createTraining() {
|
createTraining() {
|
||||||
this.$refs.add.show();
|
this.$refs.add.show();
|
||||||
},
|
},
|
||||||
computation(fieldValue) {
|
computation(fieldValue) {
|
||||||
if (fieldValue) {
|
return computationSeconds(fieldValue, this.$t('system.hour'), this.$t('system.minute'), this.$t('system.second'));
|
||||||
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')}`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 编辑
|
// 编辑
|
||||||
edit(index, row) {
|
edit(index, row) {
|
||||||
this.$refs.edit.show(row);
|
this.$refs.edit.show(row);
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
:filter-node-method="filterNode"
|
:filter-node-method="filterNode"
|
||||||
:default-expanded-keys="expandList"
|
:default-expanded-keys="expandList"
|
||||||
@node-click="clickEvent"
|
@node-click="clickEvent"
|
||||||
@node-contextmenu="showContextMenu"
|
|
||||||
@node-expand="nodeExpand"
|
@node-expand="nodeExpand"
|
||||||
@node-collapse="nodeCollapse"
|
@node-collapse="nodeCollapse"
|
||||||
>
|
>
|
||||||
@ -54,9 +53,6 @@ export default {
|
|||||||
loading: true,
|
loading: true,
|
||||||
filterText: '',
|
filterText: '',
|
||||||
treeList: [],
|
treeList: [],
|
||||||
selected: {},
|
|
||||||
node: {
|
|
||||||
},
|
|
||||||
mapId: '',
|
mapId: '',
|
||||||
expandList: [],
|
expandList: [],
|
||||||
filterSelect: ''
|
filterSelect: ''
|
||||||
@ -79,8 +75,6 @@ export default {
|
|||||||
this.$refs.tree.filter(val);
|
this.$refs.tree.filter(val);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeDestroy () {
|
|
||||||
},
|
|
||||||
mounted() {
|
mounted() {
|
||||||
if (this.getMapByCode) {
|
if (this.getMapByCode) {
|
||||||
this.refresh();
|
this.refresh();
|
||||||
@ -91,12 +85,6 @@ export default {
|
|||||||
if (!value) return true;
|
if (!value) return true;
|
||||||
return data.name.includes(value);
|
return data.name.includes(value);
|
||||||
},
|
},
|
||||||
showContextMenu(e, obj, node, vueElem) {
|
|
||||||
if (obj) {
|
|
||||||
this.node = node;
|
|
||||||
this.selected = obj;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
clickEvent(obj, data, ele, isReplace = false) {
|
clickEvent(obj, data, ele, isReplace = false) {
|
||||||
localStore.set('trainingPlatformCheckId' + this.filterSelect + this.userId + this.project, obj.key);
|
localStore.set('trainingPlatformCheckId' + this.filterSelect + this.userId + this.project, obj.key);
|
||||||
while (data) {
|
while (data) {
|
||||||
@ -109,11 +97,8 @@ export default {
|
|||||||
}
|
}
|
||||||
if ( obj.type === 'Map') {
|
if ( obj.type === 'Map') {
|
||||||
this.mapId = obj.id;
|
this.mapId = obj.id;
|
||||||
if (isReplace) {
|
const router = { path: `${UrlConfig.trainingPlatform.permission}/${this.mapId}`};
|
||||||
this.$router.replace({ path: `${UrlConfig.trainingPlatform.permission}/${this.mapId}`});
|
this.toNextPage(isReplace, router);
|
||||||
} else {
|
|
||||||
this.$router.push({ path: `${UrlConfig.trainingPlatform.permission}/${this.mapId}`});
|
|
||||||
}
|
|
||||||
} else if ( obj.type === 'MapSystem') {
|
} else if ( obj.type === 'MapSystem') {
|
||||||
getSubSystemInfo(obj.id).then(resp => { // 查询子系统信息
|
getSubSystemInfo(obj.id).then(resp => { // 查询子系统信息
|
||||||
let router = '';
|
let router = '';
|
||||||
@ -121,44 +106,19 @@ export default {
|
|||||||
case 'Exam':
|
case 'Exam':
|
||||||
this.setLocalRoute(`${UrlConfig.trainingPlatform.examHome}/${obj.id}`);
|
this.setLocalRoute(`${UrlConfig.trainingPlatform.examHome}/${obj.id}`);
|
||||||
router = localStore.get('examDetail' + obj.id);
|
router = localStore.get('examDetail' + obj.id);
|
||||||
if (router) {
|
if (!router) { router = { path: `${UrlConfig.trainingPlatform.examHome}/${obj.id}`}; }
|
||||||
if (isReplace) {
|
this.toNextPage(isReplace, router);
|
||||||
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}`});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 'Lesson':
|
case 'Lesson':
|
||||||
this.setLocalRoute(`${UrlConfig.trainingPlatform.teachHome}/${obj.id}`);
|
this.setLocalRoute(`${UrlConfig.trainingPlatform.teachHome}/${obj.id}`);
|
||||||
router = localStore.get('teachDetail' + obj.id);
|
router = localStore.get('teachDetail' + obj.id);
|
||||||
if (router) {
|
if (!router) { router = { path: `${UrlConfig.trainingPlatform.teachHome}/${obj.id}`}; }
|
||||||
if (isReplace) {
|
this.toNextPage(isReplace, router);
|
||||||
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}`});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 'Simulation':
|
case 'Simulation':
|
||||||
this.setLocalRoute(`${UrlConfig.trainingPlatform.prodDetail}/${obj.id}?mapId=${this.mapId}`);
|
this.setLocalRoute(`${UrlConfig.trainingPlatform.prodDetail}/${obj.id}?mapId=${this.mapId}`);
|
||||||
if (isReplace) {
|
router = { path: `${UrlConfig.trainingPlatform.prodDetail}/${obj.id}`, query: { mapId: this.mapId}};
|
||||||
this.$router.replace({ path: `${UrlConfig.trainingPlatform.prodDetail}/${obj.id}`, query: { mapId: this.mapId}});
|
this.toNextPage(isReplace, router);
|
||||||
} else {
|
|
||||||
this.$router.push({ path: `${UrlConfig.trainingPlatform.prodDetail}/${obj.id}`, query: { mapId: this.mapId}});
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
@ -168,6 +128,9 @@ export default {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
toNextPage(isReplace, router) {
|
||||||
|
isReplace ? this.$router.replace(router) : this.$router.push(router);
|
||||||
|
},
|
||||||
setLocalRoute(path) {
|
setLocalRoute(path) {
|
||||||
localStore.set('trainingPlatformRoute' + this.userId + this.project, path);
|
localStore.set('trainingPlatformRoute' + this.userId + this.project, path);
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user