This commit is contained in:
joylink_cuiweidong 2020-09-03 18:17:40 +08:00
commit b6c39918e0
11 changed files with 246 additions and 96 deletions

View File

@ -646,7 +646,7 @@ export function generateCI (mapId) {
/** 创建目的码 */
export function createStationDestination(data) {
return request({
url: `/api/mapBuild/stationParkTime`,
url: `/api/mapBuild/${data.mapId}/operationDefinition`,
method: 'post',
data
});
@ -655,8 +655,33 @@ export function createStationDestination(data) {
/** 更新目的码 */
export function updateStationDestination(data) {
return request({
url: `/api/mapBuild/stationParkTime`,
method: 'post',
url: `/api/mapBuild/${data.mapId}/operationDefinition`,
method: 'put',
data
});
}
/** 目的码列表分页查询 */
export function getStationDestinationList(mapId, params) {
return request({
url: `/api/mapBuild/${mapId}/operationDefinition`,
method: 'get',
params
});
}
/** 目的码查询 */
export function getStationDestinationDetail(mapId, code) {
return request({
url: `/api/mapBuild/${mapId}/${code}/operationDefinition`,
method: 'get'
});
}
/** 目的码查询 */
export function deleteStationDestination(mapId, code) {
return request({
url: `/api/mapBuild/${mapId}/${code}/operationDefinition`,
method: 'delete'
});
}

View File

@ -250,7 +250,6 @@ export default {
markPointData: []
}, Object.assign({ color: hexColor.toCreate() }, lineStyle)));
}
/** 添加数据*/
series.forEach(serie => {
/** 找到服务号所在图数据的位置*/
@ -259,7 +258,6 @@ export default {
if (!runPlanData[elem.serviceNumber][elem.tripNumber]) {
runPlanData[elem.serviceNumber][elem.tripNumber] = [];
}
runPlanData[elem.serviceNumber][elem.tripNumber].push(elem);
runPlanData[elem.serviceNumber][elem.tripNumber].sort((a, b) => {
return parseInt(a.secondTime) - parseInt(b.secondTime);

View File

@ -411,19 +411,19 @@ export default {
children: [
{
title: '开放',
click: this.undeveloped
click: this.handleOpenSection
},
{
title: '关闭',
click: this.undeveloped
click: this.handleCloseSection
},
{
title: '临时限速',
click: this.undeveloped
click: this.handleLimitSpeed
},
{
title: '显示',
click: this.undeveloped
click: this.handleSectionShow
}
]
},
@ -433,23 +433,23 @@ export default {
children: [
{
title: '取消转换锁闭',
click: this.undeveloped
click: this.handleLock
},
{
title: '取消过岔锁闭',
click: this.undeveloped
click: this.handleUnLock
},
{
title: '远程预复位使能',
click: this.undeveloped
click: this.handleRestoration
},
{
title: '复位',
click: this.undeveloped
click: this.handleSectionRestoration
},
{
title: '显示',
click: this.undeveloped
click: this.handleSectionStopShow
}
]
},
@ -855,11 +855,11 @@ export default {
},
{
title: '复位',
click: this.undeveloped
click: this.handleSectionRestoration
},
{
title: '显示',
click: this.undeveloped
click: this.handleSectionStopShow
}
]
},
@ -1472,6 +1472,19 @@ export default {
}
});
},
handleSectionRestoration() {
const operate = {
type: 'bar',
operation: ''
};
this.$store.dispatch('training/nextNew', operate).then(({valid}) => {
if (valid) {
this.closeMenu(true);
this.$store.dispatch('menuOperation/handleBreakFlag', {break: true});
this.$refs.sectionLock.doShow();
}
});
},
setSignalModel() {
const operate = {
type: 'bar',
@ -1485,6 +1498,19 @@ export default {
}
});
},
handleSectionStopShow() {
const operate = {
type: 'bar',
operation: ''
};
this.$store.dispatch('training/nextNew', operate).then(({valid}) => {
if (valid) {
this.closeMenu(true);
this.$store.dispatch('menuOperation/handleBreakFlag', {break: true});
this.$refs.sectionLock.doShow();
}
});
},
setSignalBlock() {
const operate = {
type: 'bar',

View File

@ -67,7 +67,7 @@ export default {
tempData: [],
radio: '1',
spanCol: 24,
lock: false,
lock: true,
restoration: false
};
},

View File

@ -101,7 +101,8 @@ export default {
seriesMap: {},
staticSeries: [],
runSeries: [],
selectSeries: []
selectSeries: [],
runPlanData: {}
};
},
computed: {
@ -128,7 +129,7 @@ export default {
'$store.state.runPlan.planLoadedCount': async function () {
try {
await this.loadChartPage();
this.selectSeries = []; this.runSeries = [];
this.selectSeries = []; this.runSeries = []; this.runPlanData = {};
if (this.dialogShow) {
await this.loadInitData();
}
@ -138,6 +139,12 @@ export default {
this.loading = false;
}
},
'$store.state.socket.simulationReset': function (val) {
this.selectSeries = []; this.runSeries = [];
if (this.dialogShow) {
this.loadInitData();
}
},
'$store.state.runPlan.planSizeCount': function () {
this.reSize({ width: this.$store.state.runPlan.width, height: this.$store.state.runPlan.height });
},
@ -148,8 +155,9 @@ export default {
}
},
mounted() {
this.staticSeries = []; this.selectSeries = []; this.runSeries = [];
this.staticSeries = []; this.selectSeries = []; this.runSeries = []; this.runPlanData = {};
this.PlanConvert = this.$theme.loadPlanConvert(this.$route.query.lineCode);
this.loadChartPage();
EventBus.$on('clearRunSeries', () => {
this.runSeries = [];
});
@ -221,7 +229,6 @@ export default {
},
updateRunPlanData(data) {
const stations = this.$store.state.runPlan.stations;
const planData = this.$store.state.runPlan.planData;
const initialPlanData = this.$store.state.runPlan.initialPlanData;
data.forEach(item => {
if (item && initialPlanData[item.serviceNumber]) {
@ -235,7 +242,7 @@ export default {
});
this.kmRangeCoordMap = this.PlanConvert.convertStationsToMap(stations);
this.runSeries = this.PlanConvert.updateDataToModels(data, stations, this.kmRangeCoordMap,
planData, this.runSeries, { color: '#FF00DE', width: 2 }
this.runPlanData, this.runSeries, { color: '#FF00DE', width: 2 }
);
const series = [...this.staticSeries, ...this.runSeries, ... this.selectSeries];
this.myChart && this.myChart.setOption({series: series});

View File

@ -107,16 +107,16 @@ export default {
}
},
watch: {
'$store.state.training.switchcount': async function () {
if (this.group) {
if (this.$store.state.training.started && !this.firstLoad) {
await this.loadRunData();
} else if (this.firstLoad) {
await this.loadRunData(this.$route.query);
}
this.firstLoad = false;
}
},
// '$store.state.training.switchcount': async function () {
// if (this.group) {
// if (this.$store.state.training.started && !this.firstLoad) {
// await this.loadRunData();
// } else if (this.firstLoad) {
// await this.loadRunData(this.$route.query);
// }
// this.firstLoad = false;
// }
// },
'$store.state.scriptRecord.bgSet':function (val) {
this.isScriptCommand = val;
if (!val) {
@ -128,6 +128,9 @@ export default {
},
'$store.state.training.prdType':function(val) {
if (val == '01') { this.switchModeInner('01'); } else { this.switchModeInner('02'); }
},
'$store.state.map.mapDataLoadedCount': function () {
this.loadRunData();
}
},
methods: {

View File

@ -105,17 +105,6 @@ export default {
},
'$store.state.app.windowSizeCount': function() {
this.setWindowSize();
},
'$store.state.training.switchcount': async function () {
if (this.group && this.firstLoad) {
await this.loadRunData();
// if (this.$store.state.training.started && !this.firstLoad) {
// } else if (this.firstLoad) {
// await this.loadRunData(this.$route.query);
// }
}
this.firstLoad = false;
}
},
async mounted() {
@ -163,6 +152,7 @@ export default {
if (this.group) {
await this.loadNewMapDataByGroup(this.group);
await this.getDraftScriptByGroupNew(this.group);
await this.loadRunData();
this.$store.dispatch('training/setPrdType', '02');
} else {
this.endViewLoading();

View File

@ -355,6 +355,7 @@ export default {
async simulationReset() {
await this.$store.dispatch('map/clearJlmapTrainView');
await this.$store.dispatch('map/setTrainWindowShow', false);
await this.$store.dispatch('training/over');
await this.$store.dispatch('map/resetActiveTrainList');
await this.$store.dispatch('socket/setSimulationReset'); //
await this.$store.dispatch('socket/setSimulationStart');

View File

@ -107,15 +107,18 @@ export default {
}
},
watch: {
'$store.state.training.switchcount': async function () {
if (this.group) {
const started = this.$store.state.training.started;
if (started && !this.firstLoad) {
await this.loadRunData(this.$route.query);
} else if (this.firstLoad) {
await this.loadRunData(this.$route.query);
}
}
// '$store.state.training.switchcount': async function () {
// if (this.group) {
// const started = this.$store.state.training.started;
// if (started && !this.firstLoad) {
// await this.loadRunData(this.$route.query);
// } else if (this.firstLoad) {
// await this.loadRunData(this.$route.query);
// }
// }
// }
'$store.state.map.mapDataLoadedCount': function () {
this.loadRunData(this.$route.query);
}
},
async mounted() {

View File

@ -13,7 +13,7 @@
<script>
import { mapGetters } from 'vuex';
import { getStationParkTimeList, deleteStationParkTime, getStationParkTime } from '@/api/jmap/mapdraft';
import { getStationDestinationList, deleteStationDestination, getStationDestinationDetail } from '@/api/jmap/mapdraft';
export default {
name: 'RouteDetail',
@ -32,6 +32,11 @@ export default {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
typeList: [
{ name: '正常运营(环路)', value: 'NORMAL_OPERATION' },
{ name: '末班运营(交路)', value: 'LAST_OPERATION' },
{ name: '非运营(交路)', value: 'NON_OPERATION' }
],
queryForm: {
labelWidth: '120px',
queryObject: {
@ -51,30 +56,73 @@ export default {
indexShow: true,
columns: [
{
title: '停站车站',
prop: 'stationCode',
type: 'tag',
columnValue: (row) => { return this.formatName(row.stationCode); },
tagType: (row) => { return ''; }
title: '编码',
prop: 'code'
},
{
title: '停站时间',
prop: 'parkingTimeVOList',
type: 'tagMore',
columnValue: (row) => { return this.handelParkingTime(row.parkingTimeVOList); },
tagType: (row) => { return ''; }
title: '描述',
prop: 'description'
},
{
title: '运营类型',
prop: 'type',
type: 'tag',
columnValue: (row) => { return this.translate(row.type, this.typeList); },
tagType: (row) => { return 'success'; }
},
{
title: '目标区段',
prop: 'sectionCode',
type: 'tag',
columnValue: (row) => { return this.translateSection(row.sectionCode, this.sectionList); },
tagType: (row) => { return 'success'; }
},
{
title: '车站A',
prop: 'stationACode',
type: 'tag',
columnValue: (row) => { return this.translateSection(row.stationACode, this.stationList, false); },
tagType: (row) => { return 'success'; }
},
{
title: '是否折返至车站A',
prop: 'stationAFrontTurnBack',
type: 'tag',
columnValue: (row) => { return this.translateTurn(row.stationAFrontTurnBack); },
tagType: (row) => { return 'success'; }
},
{
title: '车站B',
prop: 'stationBCode',
type: 'tag',
columnValue: (row) => { return this.translateSection(row.stationBCode, this.stationList, false); },
tagType: (row) => { return 'success'; }
},
{
title: '是否折返至车站B',
prop: 'stationBFrontTurnBack',
type: 'tag',
columnValue: (row) => { return this.translateTurn(row.stationBFrontTurnBack); },
tagType: (row) => { return 'success'; }
},
// {
// title: '',
// prop: 'sectionCode',
// type: 'tagMore',
// columnValue: (row) => { return this.handelParkingTime(row.parkingTimeVOList); },
// tagType: (row) => { return ''; }
// },
{
type: 'button',
title: this.$t('map.operation'),
width: '200',
buttons: [
{
name: this.$t('map.compile'),
name: '编辑',
handleClick: this.editObj
},
{
name: this.$t('map.deleteObj'),
name: '删除',
handleClick: this.deleteObj,
type: 'danger'
}
@ -86,7 +134,8 @@ export default {
},
computed: {
...mapGetters('map', [
'stationList'
'stationList',
'sectionList'
])
},
mounted() {
@ -119,16 +168,44 @@ export default {
if (device) {
name = device.uniqueName || device.name;
}
console.log(code, name, device);
return name;
},
translate(type, list) {
let name = '';
list.forEach(item => {
if (item.value == type) {
name = item.name;
}
});
return name;
},
translateSection(code, list, flag = true) {
let name = '';
list.forEach(item => {
if (item.code == code) {
if (flag) {
name = `${item.name}(${code})`;
} else {
name = `${item.name}`;
}
}
});
return name;
},
translateTurn(data) {
if (data) {
return '是';
} else {
return '否';
}
},
queryFunction(params) {
if (this.mapInfo && this.mapInfo.id) {
return getStationParkTimeList(this.mapInfo.id, params);
return getStationDestinationList(this.mapInfo.id, params);
}
},
editObj(index, row) {
getStationParkTime(row.id).then(response => {
getStationDestinationDetail(this.mapInfo.id, row.code).then(response => {
const data = response.data;
this.$emit('autoMaticoSelected', data);
this.doClose();
@ -137,7 +214,7 @@ export default {
deleteObj(index, row) {
if (this.mapInfo && this.mapInfo.id && row) {
//
deleteStationParkTime(row.id).then(response => {
deleteStationDestination(this.mapInfo.id, row.code).then(response => {
this.$message.success(this.$t('map.successfullyDelete'));
this.reloadTable();
}).catch(() => {

View File

@ -7,7 +7,7 @@
<el-input v-model="addModel.code" style="width: 180px;" />
</el-form-item>
<el-form-item label="运营类型" prop="type">
<el-select v-model="addModel.type" clearable :filterable="true" :disabled="editShow">
<el-select v-model="addModel.type" clearable :filterable="true">
<el-option
v-for="item in typeList"
:key="item.value"
@ -20,7 +20,7 @@
<el-input v-model="addModel.description" type="textarea" style="width: 330px;" />
</el-form-item>
<el-form-item label="目标区段" prop="sectionCode">
<el-select v-model="addModel.sectionCode" clearable :filterable="true" :disabled="editShow">
<el-select v-model="addModel.sectionCode" clearable :filterable="true">
<el-option
v-for="item in sectionList"
:key="item.code"
@ -29,13 +29,22 @@
/>
</el-select>
<el-button
:disabled="editShow"
:type=" field === 'sectionCode1' ? 'danger' : 'primary'"
@click="hover('sectionCode1')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item label="是否右行" prop="right">
<el-select v-model="addModel.right" clearable :filterable="true">
<el-option
v-for="item in directionList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="途径区段" prop="runPath">
<el-select v-model="addModel.runPath" clearable multiple :filterable="true" :disabled="editShow">
<el-select v-model="addModel.runPath" clearable multiple :filterable="true">
<el-option
v-for="item in sectionList"
:key="item.code"
@ -44,13 +53,12 @@
/>
</el-select>
<el-button
:disabled="editShow"
:type=" field === 'sectionCode2' ? 'danger' : 'primary'"
@click="hover('sectionCode2')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item label="车站A" prop="stationACode">
<el-select v-model="addModel.stationACode" clearable :filterable="true" :disabled="editShow">
<el-select v-model="addModel.stationACode" clearable :filterable="true">
<el-option
v-for="item in stationList"
:key="item.code"
@ -59,7 +67,6 @@
/>
</el-select>
<el-button
:disabled="editShow"
:type=" field === 'stationCode1' ? 'danger' : 'primary'"
@click="hover('stationCode1')"
>{{ $t('map.activate') }}</el-button>
@ -68,7 +75,7 @@
<el-checkbox v-model="addModel.stationAFrontTurnBack" />
</el-form-item>
<el-form-item label="车站B" prop="stationBCode">
<el-select v-model="addModel.stationBCode" clearable :filterable="true" :disabled="editShow">
<el-select v-model="addModel.stationBCode" clearable :filterable="true">
<el-option
v-for="item in stationList"
:key="item.code"
@ -77,7 +84,6 @@
/>
</el-select>
<el-button
:disabled="editShow"
:type=" field === 'stationCode2' ? 'danger' : 'primary'"
@click="hover('stationCode2')"
>{{ $t('map.activate') }}</el-button>
@ -134,33 +140,45 @@ export default {
isSave: true,
loading: false,
addModel: {
mapId: '',
id: '',
code: '',
description: '',
type: '',
sectionCode: '',
runPath: [],
right: '',
stationACode: '',
stationBCode: '',
stationAFrontTurnBack: false,
stationBFrontTurnBack: false
},
editShow: false,
rules: {
code: [
{ required: true, message: '请输入编号', trigger: 'change' }
],
sectionACode: [
type: [
{ required: true, message: '请选择运营类型', trigger: 'change' }
],
sectionCode: [
{ required: true, message: '请选择目标区段', trigger: 'change' }
],
stationACode: [
{ required: true, message: '请选择车站A', trigger: 'change' }
],
sectionBCode: [
stationBCode: [
{ required: true, message: '请选择车站B', trigger: 'change' }
]
},
typeList: [
{ name: '正常运营(环路)', value: 'NORMAL_OPERATION' },
{ name: '末班运营(交路)', value: 'LAST_OPERATION' },
{ name: '非运营(交路)', value: 'NON_OPERATION' }
{ name: '非运营(交路)', value: 'NON_OPERATION' },
{ name: '末班非运营(交路)', value: 'LAST_NON_OPERATION' }
],
directionList: [
{label: '右行', value: true},
{label: '左行', value: false}
]
};
},
@ -171,13 +189,22 @@ export default {
])
},
watch: {
// mapInfo(val) {
// if (val) {
// this.addModel.mapId = val.id;
// }
// },
mapInfo(val) {
if (val) {
this.addModel.mapId = val.id;
}
},
routeData(val, old) {
if (val) {
this.addModel = val;
this.addModel.mapId = this.mapInfo.id;
}
}
},
mounted() {
if (this.mapInfo.id) {
this.addModel.mapId = this.mapInfo.id;
}
},
methods: {
hover(field) {
@ -188,15 +215,12 @@ export default {
},
editData() {
this.isSave = false;
this.editShow = true;
},
setSelected(selected) {
if (selected) {
if (selected._type == 'Section' && this.field == 'sectionCode1') {
console.log(selected);
this.addModel.sectionCode = selected.code;
} else if (selected._type == 'Section' && this.field == 'sectionCode2') {
console.log(this.addModel.runPath, selected);
if (!this.addModel.runPath.includes(selected.code)) {
this.addModel.runPath.push(selected.code);
}
@ -245,12 +269,8 @@ export default {
if (this.$refs && this.$refs.form && this.mapInfo) {
delete this.addModel.id;
this.$refs.form.resetFields();
// this.addModel.mapId = this.mapInfo.id;
// this.addModel.stationCode = '';
// this.addModel.parkingTimeVOList = [];
// this.addModel.code = '';
this.addModel.mapId = this.mapInfo.id;
this.isSave = true;
this.editShow = false;
}
}
}