增加删除范围,调整退出仿真发送取消订阅
This commit is contained in:
parent
407d1d421b
commit
9ede8ad97d
@ -7,7 +7,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import MapCommon from './common/index';
|
import MapCommon from './common/index';
|
||||||
import { getToken } from '@/utils/auth';
|
import { getToken } from '@/utils/auth';
|
||||||
import { creatSubscribe, clearSubscribe, displayTopic} from '@/utils/stomp';
|
import { creatSubscribe, clearSubscribe, displayTopic } from '@/utils/stomp';
|
||||||
import { checkLoginLine } from '@/api/login';
|
import { checkLoginLine } from '@/api/login';
|
||||||
import { getSimulationMemberList, getAllSimulationUser } from '@/api/simulation';
|
import { getSimulationMemberList, getAllSimulationUser } from '@/api/simulation';
|
||||||
import { mapGetters } from 'vuex';
|
import { mapGetters } from 'vuex';
|
||||||
@ -27,7 +27,8 @@ export default {
|
|||||||
mouseNum: 1,
|
mouseNum: 1,
|
||||||
mouseNumTime: 0,
|
mouseNumTime: 0,
|
||||||
mapBoxP: null,
|
mapBoxP: null,
|
||||||
mode: ''
|
mode: '',
|
||||||
|
groupModel: ''
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -71,6 +72,7 @@ export default {
|
|||||||
window.onbeforeunload = this.clearSubscribe;
|
window.onbeforeunload = this.clearSubscribe;
|
||||||
this.mode = this.$route.params.mode || '';
|
this.mode = this.$route.params.mode || '';
|
||||||
this.currentMap = this.$refs.mapCommon;
|
this.currentMap = this.$refs.mapCommon;
|
||||||
|
this.groupModel = this.$route.query.group;
|
||||||
this.checkLoginLineTimer(); // 心跳发送
|
this.checkLoginLineTimer(); // 心跳发送
|
||||||
this.checkMouseStatusTimer(); // 鼠标样式变化检测
|
this.checkMouseStatusTimer(); // 鼠标样式变化检测
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
@ -112,7 +114,7 @@ export default {
|
|||||||
await this.$store.dispatch('training/setHasSubscribed');
|
await this.$store.dispatch('training/setHasSubscribed');
|
||||||
},
|
},
|
||||||
clearSubscribe() {
|
clearSubscribe() {
|
||||||
clearSubscribe(`${displayTopic}\/${this.$route.query.group}`);
|
clearSubscribe(`${displayTopic}\/${this.groupModel}`);
|
||||||
},
|
},
|
||||||
setCenter(code) {
|
setCenter(code) {
|
||||||
this.$refs.mapCommon && this.$refs.mapCommon.setCenter(code);
|
this.$refs.mapCommon && this.$refs.mapCommon.setCenter(code);
|
||||||
|
@ -24,6 +24,11 @@
|
|||||||
</el-button-group>
|
</el-button-group>
|
||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
<el-tab-pane class="view-control" label="批量操作" name="three" :lazy="lazy">
|
||||||
|
<div class="view-control-content">
|
||||||
|
<el-button type="primary" style="margin: 0 auto;display: block;" @click="handleDelete">一键删除无效数据</el-button>
|
||||||
|
</div>
|
||||||
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -448,6 +453,25 @@ export default {
|
|||||||
}
|
}
|
||||||
return idPrefix;
|
return idPrefix;
|
||||||
},
|
},
|
||||||
|
handleDelete() {
|
||||||
|
this.$confirm('您是否确定一键删除无用数据?', this.$t('tip.hint'), {
|
||||||
|
confirmButtonText: this.$t('tip.confirm'),
|
||||||
|
cancelButtonText: this.$t('tip.cancel'),
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
const models = [];
|
||||||
|
this.indicatorLightList.forEach(item => {
|
||||||
|
const model = this.$store.getters['map/getDeviceByCode'](item.stationCode);
|
||||||
|
if (!model) {
|
||||||
|
models.push(deepAssign(item, { _dispose: true }));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
models.length && this.$emit('updateMapModel', models);
|
||||||
|
this.$message.success('删除成功!');
|
||||||
|
}).catch(() => {
|
||||||
|
this.$message.info('删除失败');
|
||||||
|
});
|
||||||
|
},
|
||||||
changeBelongStation(code) {
|
changeBelongStation(code) {
|
||||||
if (code) {
|
if (code) {
|
||||||
this.stationList.forEach(item => {
|
this.stationList.forEach(item => {
|
||||||
|
@ -125,7 +125,7 @@ export default {
|
|||||||
{label: this.$t('map.trainWindow'), name:'TrainWindow', menus:TrainWindowDraft},
|
{label: this.$t('map.trainWindow'), name:'TrainWindow', menus:TrainWindowDraft},
|
||||||
{label: this.$t('map.zcZoneControl'), name:'ZcControl', menus:ZcControlDraft},
|
{label: this.$t('map.zcZoneControl'), name:'ZcControl', menus:ZcControlDraft},
|
||||||
{label: this.$t('map.functionButton'), name:'ControlDraft', menus:ControlDraft},
|
{label: this.$t('map.functionButton'), name:'ControlDraft', menus:ControlDraft},
|
||||||
{label: this.$t('map.saidLamp'), name:'ControlLamp', menus:ControlLamp},
|
{label: this.$t('map.saidLamp'), name:'ControlLamp', menus:ControlLamp}, // 表示状态
|
||||||
{label: this.$t('map.train'), name:'Train', menus:TrainDraft},
|
{label: this.$t('map.train'), name:'Train', menus:TrainDraft},
|
||||||
{label: this.$t('map.line'), name:'Line', menus:LineDraft},
|
{label: this.$t('map.line'), name:'Line', menus:LineDraft},
|
||||||
{label: '供电线', name:'Power', menus:PowerDraft},
|
{label: '供电线', name:'Power', menus:PowerDraft},
|
||||||
|
@ -406,7 +406,7 @@ export default {
|
|||||||
models.push(deepAssign(item, { _dispose: true }));
|
models.push(deepAssign(item, { _dispose: true }));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const arrList = ['signalList', 'stationList', 'psdList', 'axleCounterResetButtonList', 'tbStrategyList', 'zcList', 'cycleButtonList', 'totalGuideLockButtonVOList', 'automaticRouteButtonList', 'outerFrameList', 'directionRodList', 'textList'];
|
const arrList = ['signalList', 'stationList', 'psdList', 'axleCounterResetButtonList', 'tbStrategyList', 'zcList', 'cycleButtonList', 'totalGuideLockButtonVOList', 'automaticRouteButtonList', 'outerFrameList', 'directionRodList', 'textList', 'indicatorLightList', 'splitStationList'];
|
||||||
arrList.forEach(itemName => {
|
arrList.forEach(itemName => {
|
||||||
map[itemName] && map[itemName].forEach(item => {
|
map[itemName] && map[itemName].forEach(item => {
|
||||||
const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
|
const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
|
||||||
@ -423,85 +423,6 @@ export default {
|
|||||||
esp && models.push(deepAssign(esp, { _dispose: true }));
|
esp && models.push(deepAssign(esp, { _dispose: true }));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// map.signalList.forEach(item => {
|
|
||||||
// const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
|
|
||||||
// if (flag) {
|
|
||||||
// models.push(deepAssign(item, { _dispose: true }));
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// map.stationList.forEach(item => {
|
|
||||||
// const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
|
|
||||||
// if (flag) {
|
|
||||||
// models.push(deepAssign(item, { _dispose: true }));
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// map.psdList && map.psdList.forEach(item => {
|
|
||||||
// const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
|
|
||||||
// if (flag) {
|
|
||||||
// models.push(deepAssign(item, { _dispose: true }));
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// // 计轴复位列表
|
|
||||||
// map.axleCounterResetButtonList && map.axleCounterResetButtonList.forEach(item => {
|
|
||||||
// const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
|
|
||||||
// if (flag) {
|
|
||||||
// models.push(deepAssign(item, { _dispose: true }));
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// // GQX折返:变通
|
|
||||||
// map.tbStrategyList && map.tbStrategyList.forEach(item => {
|
|
||||||
// const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
|
|
||||||
// if (flag) {
|
|
||||||
// models.push(deepAssign(item, { _dispose: true }));
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// map.zcList && map.zcList.forEach(item => {
|
|
||||||
// const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
|
|
||||||
// if (flag) {
|
|
||||||
// models.push(deepAssign(item, { _dispose: true }));
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// // 折返按钮列表
|
|
||||||
// map.cycleButtonList && map.cycleButtonList.forEach(item => {
|
|
||||||
// const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
|
|
||||||
// if (flag) {
|
|
||||||
// models.push(deepAssign(item, { _dispose: true }));
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// // 引导总锁列表
|
|
||||||
// map.totalGuideLockButtonVOList && map.totalGuideLockButtonVOList.forEach(item => {
|
|
||||||
// const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
|
|
||||||
// if (flag) {
|
|
||||||
// models.push(deepAssign(item, { _dispose: true }));
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// // 自动进路
|
|
||||||
// map.automaticRouteButtonList && map.automaticRouteButtonList.forEach(item => {
|
|
||||||
// const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
|
|
||||||
// if (flag) {
|
|
||||||
// models.push(deepAssign(item, { _dispose: true }));
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// // 矩形框
|
|
||||||
// map.outerFrameList && map.outerFrameList.forEach(item => {
|
|
||||||
// const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
|
|
||||||
// if (flag) {
|
|
||||||
// models.push(deepAssign(item, { _dispose: true }));
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// // 方向杆列表
|
|
||||||
// map.directionRodList && map.directionRodList.forEach(item => {
|
|
||||||
// const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
|
|
||||||
// if (flag) {
|
|
||||||
// models.push(deepAssign(item, { _dispose: true }));
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// map.textList && map.textList.forEach(item => {
|
|
||||||
// const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
|
|
||||||
// if (flag) {
|
|
||||||
// models.push(deepAssign(item, { _dispose: true }));
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
if (this.fromModel.right && section.rightSectionCode) {
|
if (this.fromModel.right && section.rightSectionCode) {
|
||||||
section.rightSectionCode = '';
|
section.rightSectionCode = '';
|
||||||
}
|
}
|
||||||
|
@ -63,24 +63,26 @@ export default {
|
|||||||
watch: {
|
watch: {
|
||||||
'$store.state.runPlan.selected': function (select) {
|
'$store.state.runPlan.selected': function (select) {
|
||||||
this.stationListConfig.data = [];
|
this.stationListConfig.data = [];
|
||||||
const serviceObj = this.$store.state.runPlan.editData[select.serviceNumber];
|
if (select) {
|
||||||
if (serviceObj) {
|
const serviceObj = this.$store.state.runPlan.editData[select.serviceNumber];
|
||||||
const trainMap = serviceObj.trainMap;
|
if (serviceObj) {
|
||||||
if (trainMap) {
|
const trainMap = serviceObj.trainMap;
|
||||||
const trainObj = trainMap[select.tripNumber];
|
if (trainMap) {
|
||||||
if (trainObj) {
|
const trainObj = trainMap[select.tripNumber];
|
||||||
const stationTimeList = trainObj.stationTimeList;
|
if (trainObj) {
|
||||||
if (stationTimeList && stationTimeList.length) {
|
const stationTimeList = trainObj.stationTimeList;
|
||||||
stationTimeList.forEach((elem, index) => {
|
if (stationTimeList && stationTimeList.length) {
|
||||||
const stationObj = {
|
stationTimeList.forEach((elem, index) => {
|
||||||
stationName: formatName(elem.stationCode),
|
const stationObj = {
|
||||||
startTime: formatTime(index == 0 ? null : stationTimeList[index - 1].secondTime),
|
stationName: formatName(elem.stationCode),
|
||||||
stopTime: formatTime(index == 0 ? null : elem.secondTime - stationTimeList[index - 1].secondTime),
|
startTime: formatTime(index == 0 ? null : stationTimeList[index - 1].secondTime),
|
||||||
endTime: formatTime(elem.secondTime),
|
stopTime: formatTime(index == 0 ? null : elem.secondTime - stationTimeList[index - 1].secondTime),
|
||||||
level: ''
|
endTime: formatTime(elem.secondTime),
|
||||||
};
|
level: ''
|
||||||
this.stationListConfig.data.push(stationObj);
|
};
|
||||||
});
|
this.stationListConfig.data.push(stationObj);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user