Merge branch 'dev' of https://git.code.tencent.com/lian-cbtc/jl-client into dev
This commit is contained in:
commit
6195338947
@ -199,16 +199,17 @@
|
||||
<el-form-item :label="$t('map.hostileApproachData') + ':'" prop="conflictingRouteList">
|
||||
<el-select v-model="addModel.conflictingRouteList" multiple clearable :filterable="true">
|
||||
<el-option
|
||||
v-for="item in sectionList"
|
||||
v-for="item in routeList"
|
||||
:key="item.code"
|
||||
:label="item.name + ' (' + item.code+ ')'"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button
|
||||
<!-- <el-button type="primary" @click="selectedConflictingRouteList">选择</el-button> -->
|
||||
<!-- <el-button
|
||||
:type=" field === 'conflictingRouteList' ? 'danger' : 'primary'"
|
||||
@click="hover('conflictingRouteList')"
|
||||
>{{ $t('map.activate') }}</el-button>
|
||||
>{{ $t('map.activate') }}</el-button> -->
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button-group>
|
||||
@ -219,19 +220,22 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-scrollbar>
|
||||
<protect-detail ref="routeDetail" :map-info="mapInfo" @setOverlapCode="setOverlapCode" />
|
||||
<protect-detail ref="protectDetail" :map-info="mapInfo" @setOverlapCode="setOverlapCode" />
|
||||
<route-detail ref="routeDetail" :map-info="mapInfo" @setRouteCode="setRouteCode" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { getUID } from '@/jmap/utils/Uid';
|
||||
import { postRouteNew, putRouteNew, getContinueProtectList } from '@/api/jmap/mapdraft';
|
||||
import { postRouteNew, putRouteNew, getContinueProtectList, getRouteNewList } from '@/api/jmap/mapdraft';
|
||||
import ProtectDetail from '../protectoperate/detail';
|
||||
import RouteDetail from './detail';
|
||||
|
||||
export default {
|
||||
name: 'RouteOperation',
|
||||
components: {
|
||||
ProtectDetail
|
||||
ProtectDetail,
|
||||
RouteDetail
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
@ -262,7 +266,7 @@ export default {
|
||||
routeCode: '',
|
||||
routeType: '',
|
||||
loading: false,
|
||||
interBlockStationList:[],
|
||||
// interBlockStationList:[],
|
||||
SwitchLocateTypeList: [
|
||||
{ name: '定位', code: true },
|
||||
{ name: '反位', code: false }
|
||||
@ -288,7 +292,8 @@ export default {
|
||||
overlapCode:'',
|
||||
conflictingRouteList: [] // 敌对进路
|
||||
},
|
||||
overlapName: ''
|
||||
overlapName: '',
|
||||
routeList: [] // 进路列表
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -337,6 +342,11 @@ export default {
|
||||
]
|
||||
};
|
||||
return baseRules;
|
||||
},
|
||||
interBlockStationList() { // 联锁车站列表
|
||||
return this.stationList.filter(station=>{
|
||||
return station.isCIStation;
|
||||
});
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -366,11 +376,13 @@ export default {
|
||||
// this.$Dictionary.normal().then(list => {
|
||||
// this.SwitchLocateTypeList = list;
|
||||
// });
|
||||
this.interBlockStationList = this.stationList.filter(station=>{
|
||||
return station.isCIStation;
|
||||
});
|
||||
this.getRouteList();
|
||||
},
|
||||
methods: {
|
||||
async getRouteList() {
|
||||
const response = await getRouteNewList(this.$route.params.mapId, { pageSize: 9999, pageNum: 1 });
|
||||
this.routeList = response.data.list;
|
||||
},
|
||||
swictchName(code) {
|
||||
let name = '';
|
||||
if (code) {
|
||||
@ -389,7 +401,7 @@ export default {
|
||||
this.overlapName = data.name;
|
||||
},
|
||||
selectedOverlapCode() {
|
||||
this.$refs.routeDetail.doShow('select');
|
||||
this.$refs.protectDetail.doShow('select');
|
||||
},
|
||||
hover(field) {
|
||||
this.field = field === this.field ? '' : field;
|
||||
@ -418,6 +430,7 @@ export default {
|
||||
postRouteNew(this.buildModel(getUID('Route'))).then(response => {
|
||||
this.$message.success('创建成功');
|
||||
this.loading = false;
|
||||
this.routeList.push(this.buildModel(getUID('Route')));
|
||||
this.clear();
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('tip.operationAbnormal'));
|
||||
@ -434,6 +447,7 @@ export default {
|
||||
this.$message.success(this.$t('map.updateSuccessfully'));
|
||||
this.loading = false;
|
||||
this.clear();
|
||||
this.getRouteList();
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('tip.operationAbnormal'));
|
||||
this.loading = false;
|
||||
@ -450,24 +464,35 @@ export default {
|
||||
this.addModel.routeFlankProtectionList = [];
|
||||
this.overlapName = '';
|
||||
this.addModel.overlapCode = '';
|
||||
if (this.selected && this.selected._type.toUpperCase() === 'Station'.toUpperCase()) {
|
||||
this.addModel.stationCode = this.selected.code;
|
||||
}
|
||||
// if (this.selected && this.selected._type.toUpperCase() === 'Station'.toUpperCase()) {
|
||||
// this.addModel.stationCode = this.selected.code;
|
||||
// }
|
||||
this.isSave = true;
|
||||
}
|
||||
},
|
||||
selectedConflictingRouteList() {
|
||||
this.$refs.routeDetail.doShow('select');
|
||||
},
|
||||
setRouteCode(data) {
|
||||
console.log(data);
|
||||
if (this.addModel.conflictingRouteList.indexOf(data.code) === -1) {
|
||||
this.addModel.conflictingRouteList.push(data.code);
|
||||
}
|
||||
},
|
||||
setSelected(selected) {
|
||||
if (selected) {
|
||||
if (selected._type.toUpperCase() === 'Station'.toUpperCase()) {
|
||||
this.addModel.stationCode = selected.code;
|
||||
} else if (selected._type.toUpperCase() === 'Signal'.toUpperCase() && this.field.toUpperCase() === 'startSignalCode'.toUpperCase()) {
|
||||
// if (selected._type.toUpperCase() === 'Station'.toUpperCase()) {
|
||||
// this.addModel.stationCode = selected.code;
|
||||
// } else
|
||||
// else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'conflictingRouteList'.toUpperCase()) {
|
||||
// if (this.addModel.conflictingRouteList.indexOf(selected.code) === -1) {
|
||||
// this.addModel.conflictingRouteList.push(selected.code);
|
||||
// }
|
||||
// }
|
||||
if (selected._type.toUpperCase() === 'Signal'.toUpperCase() && this.field.toUpperCase() === 'startSignalCode'.toUpperCase()) {
|
||||
this.addModel.startSignalCode = selected.code;
|
||||
} else if (selected._type.toUpperCase() === 'Signal'.toUpperCase() && this.field.toUpperCase() === 'endSignalCode'.toUpperCase()) {
|
||||
this.addModel.endSignalCode = selected.code;
|
||||
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'conflictingRouteList'.toUpperCase()) {
|
||||
if (this.addModel.conflictingRouteList.indexOf(selected.code) === -1) {
|
||||
this.addModel.conflictingRouteList.push(selected.code);
|
||||
}
|
||||
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'routeSectionList'.toUpperCase()) {
|
||||
if (this.addModel.routeSectionList.indexOf(selected.code) === -1) {
|
||||
this.addModel.routeSectionList.push(selected.code);
|
||||
|
@ -180,8 +180,8 @@ export default {
|
||||
edit() {
|
||||
this.$refs.dataform.validate((valid) => {
|
||||
if (valid) {
|
||||
// const data = Object.assign({_type: 'Esp'}, this.editModel);
|
||||
// console.log(data);
|
||||
const data = Object.assign({_type: 'Esp'}, this.editModel);
|
||||
this.$emit('updateMapModel', data);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
@ -442,7 +442,7 @@ export default {
|
||||
map: {
|
||||
name: this.$t('map.mapData'),
|
||||
item: [
|
||||
{ prop: 'stationCode', label: this.$t('map.equipmentStation') + ':', type: 'select', mode: true, optionLabel: 'name&&code', optionValue: 'code', disabled: this.isStationCodeDisabled, options: this.stationList },
|
||||
{ prop: 'stationCode', label: this.$t('map.equipmentStation') + ':', type: 'select', mode: true, optionLabel: 'name&&code', optionValue: 'code', disabled: this.isStationCodeDisabled, options: this.centralizedStationList },
|
||||
{ prop: 'lengthFact', label: this.$t('map.actualLength') + ':', type: 'number', min: 0, placeholder: this.$t('map.meter') },
|
||||
{ prop: 'leftStopPointOffset', label: this.$t('map.leftStopPointOffset'), type: 'number', min: 0, isHidden: !this.isStopPointOffset },
|
||||
{ prop: 'rightStopPointOffset', label: this.$t('map.rightStopPointOffset'), type: 'number', min: 0, isHidden: !this.isStopPointOffset },
|
||||
@ -618,6 +618,13 @@ export default {
|
||||
},
|
||||
isLSectionOffsetShow() {
|
||||
return this.editModel.type === '02';
|
||||
},
|
||||
centralizedStationList() {
|
||||
let list = [];
|
||||
list = this.stationList.filter(station=>{
|
||||
return station.centralized;
|
||||
});
|
||||
return list;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
@ -93,10 +93,11 @@ export default {
|
||||
activeName: 'first',
|
||||
// field: '',
|
||||
chargeStation:[],
|
||||
controlled:false,
|
||||
editModel: {
|
||||
centralized: false,
|
||||
concentrateStationCode: '', // 所属集中站
|
||||
isCIStation:false, // 是否联锁站
|
||||
// concentrateStationCode: '', // 所属集中站
|
||||
isCIStation: false, // 是否联锁站
|
||||
number:'', // 编号
|
||||
code: '',
|
||||
zcCode: '',
|
||||
@ -119,7 +120,7 @@ export default {
|
||||
chargeStationCodeList:[],
|
||||
position: { x: 0, y: 0 },
|
||||
kilometerPosition: { x: 0, y: 0 }, // 公里标偏移坐标
|
||||
controlled:false,
|
||||
// controlled:false,
|
||||
isCreateControlMode:false,
|
||||
isCreateTurnBack:false,
|
||||
turnBackPoint: {x: 0, y: 0}, // 按图折返坐标
|
||||
@ -198,7 +199,7 @@ export default {
|
||||
name: this.$t('map.mapData'),
|
||||
item: [
|
||||
{ prop: 'isCIStation', label: this.$t('map.isCIStation'), type: 'checkbox'},
|
||||
{ prop: 'centralized', label: this.$t('map.centralized'), type: 'checkbox', disabled:this.editModel.controlled, change:true, deviceChange:this.changeCentralized },
|
||||
{ prop: 'centralized', label: this.$t('map.centralized'), type: 'checkbox', disabled:this.controlled, change:true, deviceChange:this.changeCentralized },
|
||||
{ prop: 'zcCode', label: this.$t('map.zcCode'), type: 'select', optionLabel: 'code&&name', optionValue: 'code', options: this.zcList, isHidden: !this.isZcCode },
|
||||
{ prop: 'chargeStationCodeList', label: this.$t('map.chargeStationList'), type: 'multiSelect', optionLabel: 'name', optionValue: 'code', options: this.chargeStation, isHidden: !this.isZcCode, deviceChange:this.changeChargeStation},
|
||||
{ prop: 'runPlanName', label: this.$t('map.stationRunPlanName'), type: 'input' }
|
||||
@ -261,10 +262,25 @@ export default {
|
||||
this.activeName = 'first';
|
||||
this.editModel = deepAssign(this.editModel, selected);
|
||||
this.editModel.runPlanName = selected.runPlanName || '';
|
||||
let beCentralizedStation={};
|
||||
this.stationList.forEach(data=>{
|
||||
if(data.centralized){
|
||||
data.chargeStationCodeList.forEach(charge=>{
|
||||
let object={};
|
||||
beCentralizedStation[charge]=data.code;
|
||||
})
|
||||
}
|
||||
});
|
||||
// 被控制的车站数据
|
||||
// 筛选数据 去掉已经是集中站的数据,去掉自己本身,去掉被别的集中站选中的数据
|
||||
this.chargeStation = this.stationList.filter(data=>{
|
||||
return !data.centralized && data.code != this.editModel.code && !(data.controlled && data.concentrateStationCode != this.editModel.code);
|
||||
console.log(beCentralizedStation[data.code]);
|
||||
return !data.centralized && data.code != this.editModel.code && !(beCentralizedStation[data.code] && beCentralizedStation[data.code] != this.editModel.code);
|
||||
});
|
||||
this.controlled= !!beCentralizedStation[selected.code];
|
||||
// this.chargeStation = this.stationList.filter(data=>{
|
||||
// return !data.centralized && data.code != this.editModel.code && !(data.controlled && data.concentrateStationCode != this.editModel.code);
|
||||
// });
|
||||
}
|
||||
},
|
||||
changeControlMode(data) {
|
||||
@ -286,14 +302,14 @@ export default {
|
||||
if (data.length > 0) {
|
||||
this.chargeStation.forEach(station=>{
|
||||
const newModal = Object.assign({}, station);
|
||||
newModal.controlled = false;
|
||||
newModal.concentrateStationCode = '';
|
||||
// newModal.controlled = false;
|
||||
// newModal.concentrateStationCode = '';
|
||||
this.setStationStand(station, '');
|
||||
data.forEach(each=>{
|
||||
switch (each) {
|
||||
case station.code: {
|
||||
newModal.controlled = true;
|
||||
newModal.concentrateStationCode = this.editModel.code;
|
||||
// newModal.controlled = true;
|
||||
// newModal.concentrateStationCode = this.editModel.code;
|
||||
this.setStationStand(station, this.editModel.code);
|
||||
break;
|
||||
}
|
||||
@ -321,8 +337,8 @@ export default {
|
||||
modifyChargeStation() {
|
||||
this.chargeStation.forEach(station=>{
|
||||
const newModal = Object.assign({}, station);
|
||||
newModal.controlled = false;
|
||||
newModal.concentrateStationCode = '';
|
||||
// newModal.controlled = false;
|
||||
// newModal.concentrateStationCode = '';
|
||||
|
||||
// 将原来被控制的车站下的站台,属性{所属设备集中站}设置为空
|
||||
this.setStationStand(station, '');
|
||||
@ -368,8 +384,8 @@ export default {
|
||||
kmPostFontColor: '#FFFFFF',
|
||||
kilometerPosition: { x: 0, y: 0 },
|
||||
centralized: false,
|
||||
concentrateStationCode: '',
|
||||
controlled: false,
|
||||
// concentrateStationCode: '',
|
||||
// controlled: false,
|
||||
chargeStationCodeList:[],
|
||||
isCreateControlMode: item.control,
|
||||
isCreateTurnBack: false,
|
||||
|
@ -254,16 +254,16 @@ export default {
|
||||
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
|
||||
this.edit();
|
||||
},
|
||||
changeStation(data) {
|
||||
const station = this.stationList.find(elem => { return elem.code == data; });
|
||||
if (station) {
|
||||
if (station.centralized) {
|
||||
this.addModel.deviceStationCode = station.code;
|
||||
} else {
|
||||
this.addModel.deviceStationCode = station.concentrateStationCode;
|
||||
}
|
||||
}
|
||||
},
|
||||
// changeStation(data) {
|
||||
// const station = this.stationList.find(elem => { return elem.code == data; });
|
||||
// if (station) {
|
||||
// if (station.centralized) {
|
||||
// this.addModel.deviceStationCode = station.code;
|
||||
// } else {
|
||||
// this.addModel.deviceStationCode = station.concentrateStationCode;
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
hover(field) {
|
||||
this.field = field === this.field ? '' : field;
|
||||
this.$emit('standStationCode', this.field);
|
||||
@ -297,6 +297,8 @@ export default {
|
||||
const models = [];
|
||||
const space = 8;
|
||||
const Standuid = getUID('PF', this.stationStandList);
|
||||
// 创建新站台的时候,判断该站台是否集中站,如果不是集中站,判断该站台是否被控制
|
||||
// 未实现
|
||||
const model = {
|
||||
_type: 'StationStand',
|
||||
code: Standuid,
|
||||
|
@ -122,7 +122,7 @@ export default {
|
||||
map: {
|
||||
name: this.$t('map.mapData'),
|
||||
item: [
|
||||
{ prop: 'stationCode', label: this.$t('map.equipmentStation'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList },
|
||||
{ prop: 'stationCode', label: this.$t('map.equipmentStation'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.centralizedStationList },
|
||||
{ prop: 'turnTime', label: this.$t('map.turnTime'), type: 'number', min: 0, max: 1000, placeholder: 's' }
|
||||
]
|
||||
}
|
||||
@ -168,7 +168,14 @@ export default {
|
||||
'switchList',
|
||||
'stationList',
|
||||
'lineCode'
|
||||
])
|
||||
]),
|
||||
centralizedStationList() {
|
||||
let list = [];
|
||||
list = this.stationList.filter(station=>{
|
||||
return station.centralized;
|
||||
});
|
||||
return list;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
selected: function (val, oldVal) {
|
||||
|
@ -45,6 +45,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { getUID } from '@/jmapNew/utils/Uid';
|
||||
|
||||
export default {
|
||||
@ -70,6 +71,9 @@ export default {
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'trainList'
|
||||
]),
|
||||
rules() {
|
||||
return {
|
||||
range: [
|
||||
|
@ -102,7 +102,7 @@ export default {
|
||||
}
|
||||
},
|
||||
create(list) {
|
||||
this.$emit('addOrUpdateMapModel', list);
|
||||
this.$emit('updateMapModel', list);
|
||||
},
|
||||
// 修改对象
|
||||
edit(elem) {
|
||||
|
@ -118,8 +118,8 @@ export default {
|
||||
field: '',
|
||||
addModel: {
|
||||
pointY: '',
|
||||
width: '',
|
||||
height: '',
|
||||
width: 40,
|
||||
height: 15,
|
||||
modelList: []
|
||||
},
|
||||
mergeRules: {
|
||||
@ -289,6 +289,13 @@ export default {
|
||||
_dispose: true
|
||||
});
|
||||
});
|
||||
this.sectionList.forEach(elem => {
|
||||
if (elem.trainWindowCode) {
|
||||
const section = deepAssign({}, elem);
|
||||
section.trainWindowCode = '';
|
||||
remove.push(section);
|
||||
}
|
||||
});
|
||||
this.$emit('updateMapModel', remove);
|
||||
}
|
||||
}).catch(() => {
|
||||
@ -298,24 +305,10 @@ export default {
|
||||
// 一键创建车次窗
|
||||
createTrainWindow() {
|
||||
const models = [];
|
||||
const switchSectionList = [];
|
||||
// const PhysicalSectionList = [];
|
||||
this.addList = [];
|
||||
const remove = []; // 清空所有车次窗
|
||||
if (this.trainWindowList && this.trainWindowList.length) {
|
||||
this.trainWindowList.forEach(elem => {
|
||||
remove.push({
|
||||
_type: 'TrainWindow',
|
||||
code: elem.code,
|
||||
_dispose: true
|
||||
});
|
||||
});
|
||||
this.$emit('updateMapModel', remove);
|
||||
}
|
||||
|
||||
this.addList = []; // 为生成名字 code需要list
|
||||
if (this.sectionList && this.sectionList.length) {
|
||||
this.sectionList.forEach(elem => {
|
||||
if (elem.type !== '04' && !elem.isSwitchSection && (elem.logicSectionNum.length == 0 || elem.logicSectionNum.length == 1 && elem.logicSectionNum[0] == 0)) {
|
||||
if (elem.type !== '04' && !elem.isSwitchSection && !elem.trainWindowCode && (elem.logicSectionNum.length == 0 || elem.logicSectionNum.length == 1 && elem.logicSectionNum[0] == 0)) {
|
||||
const triangle = new JTriangle(elem.points[0], elem.points[elem.points.length - 1]);
|
||||
const param = this.createModel({
|
||||
triangle: triangle,
|
||||
@ -323,36 +316,19 @@ export default {
|
||||
});
|
||||
models.push(param);
|
||||
const section = deepAssign(elem, { trainWindowCode: param.code });
|
||||
// if (section.type == '02') {
|
||||
// if (!switchSectionList.find(ele => { return ele.code == section.parentCode; })) {
|
||||
// const sectionParent = deepAssign({}, this.$store.getters['map/getDeviceByCode'](section.parentCode));
|
||||
// sectionParent['trainWindowCode'] = section.trainWindowCode;
|
||||
// switchSectionList.push(sectionParent);
|
||||
// }
|
||||
// }
|
||||
switchSectionList.push(section);
|
||||
models.push(section);
|
||||
this.addList.push(param);
|
||||
} else if (elem.type === '04') {
|
||||
} else if (elem.type === '04' && !elem.trainWindowCode) {
|
||||
const param = this.createModel({
|
||||
section: elem
|
||||
});
|
||||
models.push(param);
|
||||
const section = deepAssign(elem, { trainWindowCode: param.code });
|
||||
switchSectionList.push(section);
|
||||
models.push(section);
|
||||
this.addList.push(param);
|
||||
}
|
||||
});
|
||||
}
|
||||
switchSectionList.forEach(elem => {
|
||||
if (elem.type === '04') {
|
||||
elem.relevanceSectionList.forEach(item => {
|
||||
const section = deepAssign({}, this.$store.getters['map/getDeviceByCode'](item));
|
||||
section['trainWindowCode'] = elem.trainWindowCode;
|
||||
models.push(section);
|
||||
});
|
||||
}
|
||||
models.push(elem);
|
||||
});
|
||||
|
||||
this.$emit('updateMapModel', models);
|
||||
},
|
||||
@ -375,7 +351,17 @@ export default {
|
||||
cancelButtonText: this.$t('tip.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
_that.$emit('updateMapModel', {...selected, _dispose: true});
|
||||
const models = [];
|
||||
this.sectionList.forEach(elem => {
|
||||
if (elem.trainWindowCode == selected.code) {
|
||||
const section = deepAssign({}, elem);
|
||||
section.trainWindowCode = '';
|
||||
models.push(section);
|
||||
}
|
||||
});
|
||||
models.push(deepAssign(selected, { _dispose: true }));
|
||||
console.log(models);
|
||||
_that.$emit('updateMapModel', models);
|
||||
_that.deviceSelect();
|
||||
}).catch(() => {
|
||||
_that.$message.info(this.$t('tip.cancelledDelete'));
|
||||
|
Loading…
Reference in New Issue
Block a user