线路:宁波一,南京2

问题:
a.南京2现地实训进入后,视图有的站没有拆分成两列
b.修改宁波一,设置通过dialog的title提示
c.恢复showStationContent函数的加入位置
d.删除代码中的一些无用注释代码
This commit is contained in:
lVAL 2021-02-26 16:23:16 +08:00
parent 24a4d74adb
commit 1580a89770
15 changed files with 79 additions and 113 deletions

View File

@ -200,9 +200,7 @@ class Jlmap {
this.setOptions(dcenter);
}
} else {
setTimeout(() => {
this.setCenter(deviceCode);
}, 60);
setTimeout(() => { this.setCenter(deviceCode); }, 60);
}
}
setRevoverBigScreen() {
@ -269,18 +267,8 @@ class Jlmap {
list.forEach(elem => {
const code = elem.code;
const type = elem._type;
// const oDevice = this.mapDevice[code] || deviceFactory(type, elem, this.showConfig);
const oDevice = deviceFactory(type, elem, this.showConfig);
// const nDevice = deepAssign(oDevice || {}, elem);
// if (this.mapDevice[code]) {
// nDevice.instance = this.mapDevice[code].instance; // 保持相同 instance
// }
// this.$painter.delete(oDevice);
// delete this.mapDevice[code];
// if (!elem._dispose) {
// this.mapDevice[code] = nDevice;
// this.$painter.add(nDevice); // 重新赋值instance
// }
if (this.mapDevice[code]) {
this.$painter.delete(this.mapDevice[code]);
delete this.mapDevice[code];
@ -291,15 +279,14 @@ class Jlmap {
}
});
const prdType2ShowMode = { '01': '03', '02': '02'};
const showMode = prdType2ShowMode[this.showConfig.prdType];
const stationCode = this.stationCode;
this.updateShowMode(list, showMode);
this.updateShowStation(list, stationCode);
if (this.methods.viewUpdate instanceof Function) { this.methods.viewUpdate(list); }
const prdType2ShowMode = {
'01': '03',
'02': '02'
}
this.updateShowMode(list, prdType2ShowMode[this.showConfig.prdType]);
this.updateShowStation(list, this.stationCode);
}
// 中间处理
@ -342,33 +329,6 @@ class Jlmap {
getShowConfig() {
return this.showConfig;
}
updateShowStation(list = [], stationCode = false) {
this.stationCode = stationCode;
store.dispatch('map/setShowCentralizedStationCode', stationCode || '');
list.forEach(elem => {
const code = elem.code;
const type = elem._type;
const oDevice = this.mapDevice[code] || deviceFactory(type, elem, this.showConfig);
if (oDevice._type === deviceType.Station) {
this.showStationHandleStation(oDevice, stationCode);
} else if (oDevice._type === deviceType.Section) {
this.$painter.updateShowStation(oDevice, stationCode);
this.showStationHandleSection(oDevice, stationCode);
} else if (oDevice._type === deviceType.TrainWindow) {
// 不处理车次窗 勿删
} else if (oDevice._type === deviceType.Psd) {
this.showStationHandlePsd(oDevice, stationCode);
} else {
this.$painter.updateShowStation(oDevice, stationCode);
}
});
this.$painter.$transformHandle.revisibleAll();
if (stationCode) {
this.$painter.$transformHandle.setFoldLines(store.state.map.foldLineMap[stationCode]);
} else {
this.$painter.$transformHandle.setFoldLines([]);
}
}
showStationHandlePsd(oDevice, stationCode) {
const standDevice = this.mapDevice[oDevice.standCode];
if (standDevice && standDevice.deviceStationCode === stationCode || !stationCode) {
@ -399,6 +359,34 @@ class Jlmap {
this.$painter.updateSpecialShowStation(staDevice, false);
});
}
}
updateShowStation(list = [], stationCode = '') {
this.stationCode = stationCode;
store.dispatch('map/setShowCentralizedStationCode', stationCode);
list.forEach(elem => {
const code = elem.code;
const type = elem._type;
const oDevice = this.mapDevice[code] || deviceFactory(type, elem, this.showConfig);
if (oDevice._type === deviceType.Station) {
this.showStationHandleStation(oDevice, stationCode);
} else if (oDevice._type === deviceType.Section) {
this.$painter.updateShowStation(oDevice, stationCode);
this.showStationHandleSection(oDevice, stationCode);
} else if (oDevice._type === deviceType.TrainWindow) {
// 不处理车次窗 勿删
} else if (oDevice._type === deviceType.Psd) {
this.showStationHandlePsd(oDevice, stationCode);
} else {
this.$painter.updateShowStation(oDevice, stationCode);
}
});
this.$painter.$transformHandle.revisibleAll();
if (stationCode) {
this.$painter.$transformHandle.setFoldLines(store.state.map.foldLineMap[stationCode]);
} else {
this.$painter.$transformHandle.setFoldLines([]);
}
}
// 模式选择 -> 更新
updateShowMode(list = [], showMode = '03') {
@ -597,11 +585,13 @@ class Jlmap {
const zrHeight = this.$zr.getHeight();
const originX = payload.originX || zrWidth / 2;
const originY = payload.originY || zrHeight / 2;
const x = (this.$options.offsetX + originX) / this.$options.scaleRate;
const y = (this.$options.offsetY + originY) / this.$options.scaleRate;
const newScaleRate = this.$options.getScaleRate(payload.scale);
const dx = originX - (x * newScaleRate - this.$options.offsetX);
const dy = originY - (y * newScaleRate - this.$options.offsetY);
payload.dx = dx;
payload.dy = dy;
}

View File

@ -65,7 +65,9 @@ class EHorizontal2Door extends Group {
// 开门
if (style.Psd.horizontal2Door.special) {
const stationStand = store.getters['map/getDeviceByCode'](this.model.modelData.standCode);
stationStand && stationStand.instance.setState({screenDoorOpenStatus:0});
stationStand &&
stationStand.instance &&
stationStand.instance.setState({screenDoorOpenStatus:0});
}
this.stand1.setStyle('fill', style.transparentColor);
this.stand2.setStyle('fill', style.transparentColor);
@ -73,7 +75,9 @@ class EHorizontal2Door extends Group {
// 关门
if (style.Psd.horizontal2Door.special) {
const stationStand = store.getters['map/getDeviceByCode'](this.model.modelData.standCode);
stationStand && stationStand.instance.setState({screenDoorOpenStatus:1});
stationStand &&
stationStand.instance &&
stationStand.instance.setState({screenDoorOpenStatus:1});
}
this.stand1.setStyle('fill', style.Psd.horizontal2Door.defaultColor);
this.stand2.setStyle('fill', style.Psd.horizontal2Door.defaultColor);

View File

@ -50,8 +50,6 @@ class EStationPlatform extends Group {
this.stationPlatform && this.stationPlatform.setStyle({fill:color});
}
recover() {
// console.log(this.model.modelData, 22222222222);
// console.log(this.model.modelData.code, 111111111);
const style = this.model.style;
this.setColor(style.StationStand.stationPlatform.defaultColor);
}
@ -59,7 +57,6 @@ class EStationPlatform extends Group {
setState(model) {
const style = this.model.style;
if (model.stationHoldTrain || model.centerHoldTrain) {
// console.log(model.code, model.stationHoldTrain, model.centerHoldTrain);
this.setColor(style.StationStand.stationPlatform.detainColor);
}
if (model.assignSkip || model.allSkip) {

View File

@ -4,7 +4,7 @@
class="ningbo-01__systerm confirm-control-speed"
:title="title"
:visible.sync="show"
width="340px"
width="390px"
:before-close="doClose"
:z-index="2000"
:modal="false"
@ -24,9 +24,10 @@
</template>
<script>
import {commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { commitOperate } from '@/jmapNew/theme/components/utils/menuOperate';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'ConfirmTip',
data() {
@ -69,8 +70,11 @@ export default {
this.message = operate.message || '';
this.dialogShow = true;
this.operation = operate.operation;
const title = this.$store.state.map.mapName;
const station = this.$store.getters['map/getDeviceByCode'](this.$store.state.map.showCentralizedStationCode);
this.title = '宁波一号线-' + station.name;
this.title = title + '-' + station.name;
this.$nextTick(function () {
setTimeout(e => {
this.$store.dispatch('training/emitTipFresh');

View File

@ -79,7 +79,6 @@ export default {
return this.$store.state.menuOperation.selected;
},
isBlock() {
console.log(this.selected && this.selected.blockade, 2222222);
return this.selected && this.selected.blockade;
},
domIdClose() {

View File

@ -137,19 +137,3 @@ Vue.prototype.$str2number = function(str) {
Vue.prototype.$asc2chart = function(ascii) {
return String.fromCharCode(ascii);
};
// 测试相关接口
/**
* trace
* @param [int] [count=10]
*/
Vue.prototype.$trace = function (count=10) {
var caller = arguments.callee.caller;
var i = 0;
while (caller && i < count) {
console.log(caller.toString());
caller = caller.caller;
i++;
}
}

View File

@ -8,7 +8,6 @@ const exam = {
usedTime: 0, // 考试当前所用时间
totalTime: 0, // 考试总时间
timeInterval: null, // 计时器
// suspend: false, // 暂停
ruleList: [], // 考试规则列表
courseDetail: {}, // 课程详情
courseList: [] // 课程列表
@ -23,17 +22,11 @@ const exam = {
totalTime: (state) => {
return state.totalTime;
}
// suspend: (state) => {
// return state.suspend;
// }
},
mutations: {
setStarted: (state, started) => {
state.started = started;
},
// setSuspend: (state, suspend) => {
// state.suspend = suspend;
// },
setUsedTime: (state, usedTime) => {
state.usedTime = usedTime;
},
@ -87,9 +80,6 @@ const exam = {
return true;
}
},
// setSuspend({ commit }, suspend) {
// commit('setSuspend', suspend);
// },
setUsedTime({ commit }, usedTime) {
commit('setUsedTime', usedTime || 0);
},

View File

@ -208,6 +208,7 @@ const map = {
signalApproachSectionData: {}, // 信号机接近区段数据
signalApproachSectionList: [], // 信号机接近区段list
stepData: [], // 缓存数据
mapName: '', //地图名称
mapConfig: [], // 地图所属线路配置
recoverStepData: [], // 缓存恢复数据
seclectDeviceList: [], // 包围框选中元素列表
@ -661,6 +662,10 @@ const map = {
state.map.trainWindowList = [...state.map.trainWindowList || []];
}
},
// 设置地图名称
setMapName: (state, name) => {
state.mapName = name;
},
// 设置地图数据
setMapData: (state, map) => {
if (map && map.skinVO) {
@ -940,6 +945,8 @@ const map = {
item._type = 'OverAp';
});
mapData.graphDataNew.overlapList = overlapData;
commit('setMapName', mapData.name);
commit('setMapData', mapData.graphDataNew);
commit('setRouteData', mapData.logicDataNew.routeList);
commit('setOverlapData', overlapData);

View File

@ -330,7 +330,6 @@ const training = {
commit('resetScore');
// 设置其他属性状态
commit('setOffsetStationCode', null);
// commit('changeMode', null);
},
/**
@ -481,7 +480,6 @@ const training = {
commit('setSteps', steps);
const offsetStationCode = trainingData.locateDeviceCode;
commit('setOffsetStationCode', offsetStationCode);
// commit('setMapDefaultState');
},
/**

View File

@ -25,12 +25,9 @@ import MenuDemon from './menuDemon';
import MenuExam from './exam/index';
import MenuScript from './scriptDisplay/scriptRecord/index';
import MenuDispatherContest from './dispatherContest/index';
import MenuTrainList from '@/views/newMap/displayNew/menuTrainList';
import MenuSystemTime from '@/views/newMap/displayNew/menuSystemTime';
import { clearSimulation, getSimulationInfoNew, ranAsPlan, exitRunPlan } from '@/api/simulation';
// loadNewMapDataByGroup,
import { loadMapDataById } from '@/utils/loaddata';
import { EventBus } from '@/scripts/event-bus';
@ -82,9 +79,6 @@ export default {
isScript() {
return this.mode === 'script';
},
// isPlan() {
// return this.mode === 'plan';
// },
mapId() {
return this.$route.query.mapId;
},
@ -104,6 +98,7 @@ export default {
}
});
},
// menuSchema
'$store.state.training.prdType':function(val) {
if (val == '01') { this.switchModeInner('01'); } else { this.switchModeInner('02'); }
},
@ -222,6 +217,7 @@ export default {
this.dataError = resp.data.dataError;
}
},
// showMode
switchModeInner(swch) {
let showMode = '03';
if (swch == '01') {
@ -229,6 +225,7 @@ export default {
} else if (swch == '02') {
showMode = '02';
}
const nameList = Object.keys(this.$store.state.map.map || {});
let list = [];
nameList.forEach(item => {
@ -239,11 +236,13 @@ export default {
}
}
});
if (swch == '01') {
this.$emit('switchStationMode', this.showStationContent); //
this.$jlmap.updateShowStation(list, this.$store.state.training.centerStationCode); //
} else {
this.$jlmap.updateShowStation(list, ''); //
}
this.$jlmap.updateShowMode(list, showMode); //
},
//

View File

@ -156,10 +156,10 @@ export default {
}
},
setTrainingData(resp) {
this.trainingObj = resp.data;
this.$store.dispatch('exam/setCenter', resp.data.locateDeviceCode);
this.$store.dispatch('training/setTrainingData', this.trainingObj); //
const detail = resp.data;
this.trainingObj = detail;
this.$store.dispatch('exam/setCenter', detail.locateDeviceCode);
this.$store.dispatch('training/setTrainingData', this.trainingObj); //
this.$store.dispatch('training/setPrdType', this.prdTypeMap[detail.prdType]);
},
resetTraining() {

View File

@ -116,9 +116,6 @@ export default {
this.swch = '01';
}
},
'showStation':function(val) {
this.showStationContent = val;
},
'$store.state.map.mapDataLoadedCount': function () {
this.loadRunData();
},
@ -184,9 +181,6 @@ export default {
this.$emit('selectQuest', {row, id, mapLocation, roleName});
},
runPlanEditShow() {
// this.$refs.runPlanEdit.doShow();
// const query = { lineCode: lineCode, mapId: this.$route.params.mapId, planId: planId, planName: planName };
// this.$router.push({ path: `/plan/tool`, query: query });
const routeData = this.$router.resolve({
path:'/plan/newTool',
query:{

View File

@ -386,7 +386,6 @@ export default {
const width = this.width;
const height = this.height;
this.$store.dispatch('config/resize', { width, height });
// this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: this.offsetStationCode });
});
},
changeScriptMode(scriptMode) {

View File

@ -78,6 +78,7 @@ export default {
}
}
});
this.$jlmap.updateShowStation(list, showStationCode);
this.setCenter(showStationCode);
}

View File

@ -176,14 +176,15 @@ export default {
if (deviceModel.centralized) {
stationModel = deviceModel;
} else {
this.$store.state.map.map.stationList || [].forEach(item => {
item.chargeStationCodeList || [].forEach(it => {
if (it === deviceModel.code) {
stationModel = item;
this.$store.state.map.map.stationList.forEach(it => {
(it.chargeStationCodeList||[]).forEach(code => {
if (code === deviceModel.code) {
stationModel = it;
}
});
});
}
this.setShowStation(stationModel.code, true);
this.$store.dispatch('training/setCenterStationCode', stationModel.code);
}
@ -236,10 +237,8 @@ export default {
this.previewOrMapDraw = true;
}
const prdType = this.$store.state.training.prdType;
let showMode = '';
if (prdType === '01') {
showMode = '03';
} else if (prdType === '02') { showMode = '02'; }
const showMode = { '01': '03', '02': '02'}[prdType]||'';
Vue.prototype.$theme = new Theme();
Vue.prototype.$jlmap = new Jlmap({
dom: document.getElementById(this.canvasId),
@ -511,6 +510,7 @@ export default {
}
}
});
this.$jlmap.updateShowStation(list, stationCode);
!setCenter && this.setCenter(stationCode);
}