大铁线路调整6 联锁数据调整

This commit is contained in:
fan 2022-04-21 15:10:43 +08:00
parent a90fbd6f67
commit c5d60323e2
5 changed files with 91 additions and 176 deletions

View File

@ -18,7 +18,7 @@ export function queryAssistById(id){
// 保存指示灯关联信息 // 保存指示灯关联信息
export function saveAssist(data, mapId) { export function saveAssist(data, mapId) {
return request({ return request({
url: `/api/assist/indicator/section/save${mapId}`, url: `/api/assist/indicator/section/save/${mapId}`,
method: 'post', method: 'post',
data data
}) })

View File

@ -30,6 +30,7 @@ export function handlerUrl(data) {
// BASE_API = 'http://192.168.8.172:9200'; // 旭强 // BASE_API = 'http://192.168.8.172:9200'; // 旭强
// BASE_API = 'http://192.168.8.109:9000'; // 张赛 // BASE_API = 'http://192.168.8.109:9000'; // 张赛
// BASE_API = 'http://192.168.8.140:9000'; // 杜康 // BASE_API = 'http://192.168.8.140:9000'; // 杜康
BASE_API = 'http://192.168.3.37:9000'; // 卫志宏
// BASE_API = 'http://b29z135112.zicp.vip'; // BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康 // BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
// BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛 // BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛

View File

@ -11,7 +11,8 @@
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import { getBigRouteList, deleteBigRoute } from '@/api/jmap/mapdraft'; import { getBigRouteList } from '@/api/jmap/mapdraft';
import { queryAssistListPaged, deleteAssist } from '@/api/assist';
export default { export default {
name:'BigRouteDetail', name:'BigRouteDetail',
props: { props: {
@ -31,96 +32,70 @@
}, },
filterRouteMap:{}, filterRouteMap:{},
queryForm: { queryForm: {
// labelWidth: '120px',
// queryObject: {
// }
show:false show:false
}, },
signalAspectList:[ modelTypeList: [{value: 'indicator', label: '指示灯'}, {value: 'button', label: '按钮'}],
{label:'红', value:1}, typeList: [
{label:'绿', value:2}, {value: 'receive', label:'接'},
{label:'黄', value:3}, {value: 'deliver', label: '发'},
{label:'黄红', value:4}, {value: 'section', label: '区间'},
{label:'绿绿', value:5}, {value: 'assist', label: '辅助'},
{label:'绿黄', value:6}, {value: 'main_assist', label: '总辅助'},
{label:'黄黄', value:7}, {value: 'receive_assist', label: '接辅助'},
{label:'黄闪黄', value:8}, {value: 'deliver_assist', label: '发辅助'},
{label:'白红', value:9}, {value: 'change_direction', label: '换方'}
{label:'蓝', value:10},
{label:'白', value:11},
{label:'红闪', value:12}
],
switchLocateTypeList: [
{ label: '定位', value: true },
{ label: '反位', value: false }
], ],
queryList: { queryList: {
// query: this.queryFunction, query: this.queryFunction,
data:[],
// afterQuery: this.afterQuery,
height:'500px', height:'500px',
selectCheckShow: false, selectCheckShow: false,
indexShow: true, indexShow: true,
paginationHiden:true,
columns: [ columns: [
{ {
title: '进路名称', title: '主设备',
prop: 'name' prop: 'code',
},
{
title: '始端信号机',
prop: 'startSignalCode',
width: 150, width: 150,
type: 'tag', type: 'tag',
columnValue: (row) => { return this.getSignalName(row.startSignalCode, row.multiRoute); }, columnValue: (row) => { return this.getMainDeviceName(row.code); },
tagType: (row) => { return ''; } tagType: (row) => { return ''; }
}, },
{ {
title: '信号显示', title: '设备分型',
prop: 'signalAspect', prop: 'modelType',
width: 150, width: 150,
type: 'tag', type: 'tag',
columnValue: (row) => { return this.getSignalAspect(row.signalAspect, row.multiRoute); }, columnValue: (row) => { return this.getModelType(row.modelType); },
tagType: (row) => { return ''; } tagType: (row) => { return ''; }
}, },
{ {
title: '起始区段', title: '类型',
prop: 'startSectionCode', prop: 'type',
width: 150, width: 150,
type: 'tag', type: 'tag',
columnValue: (row) => { return this.getSectionName(row.startSectionCode, row.multiRoute); }, columnValue: (row) => { return this.getType(row.type); },
tagType: (row) => { return ''; } tagType: (row) => { return ''; }
}, },
{ {
title: '终到区段', title: '关联区段列表',
prop: 'endSectionCode', prop: 'sectionList',
width: 150, type: 'tagMore',
type: 'tag', columnValue: (row) => { return this.getSectionName(row.sectionList); },
columnValue: (row) => { return this.getSectionName(row.endSectionCode, row.multiRoute); },
tagType: (row) => { return ''; } tagType: (row) => { return ''; }
}, },
{ {
title: '途经道岔位置', title: '关联进路',
prop: 'pathSwitchPosition', prop: 'routeCode',
width: 200, width: 200,
type: 'tag', type: 'tag',
columnValue: (row) => { return this.getPathSwitchPosition(row.pathSwitchPosition, row.multiRoute); }, columnValue: (row) => { return this.getRouteName(row.routeCode); },
tagType: (row) => { return ''; } tagType: (row) => { return ''; }
}, },
{ {
title: '多进路引用进路', title: '关联站台',
prop: 'routeAspectList', prop: 'standCode',
width: 300, width: 150,
type: 'tagMore', type: 'tag',
columnValue: (row) => { return this.getRouteAspectList(row.routeAspectList, row.multiRoute); }, columnValue: (row) => { return this.getStandName(row.standCode); },
tagType: (row) => { return ''; }
},
{
title: '排列进路按钮',
prop: 'btnCodeList',
width: 300,
type: 'tagMore',
columnValue: (row) => { return this.getBtnCodeList(row.btnCodeList); },
tagType: (row) => { return ''; } tagType: (row) => { return ''; }
}, },
{ {
@ -133,132 +108,75 @@
handleClick: this.deleteRoute, handleClick: this.deleteRoute,
type: 'danger' type: 'danger'
} }
// {
// name: this.$t('global.cancel'),
// handleClick: this.taskCancel,
// type: '',
// showControl: (row) => { return row.status == '04'; }
// },
// {
// name: this.$t('lesson.toPerform'),
// handleClick: this.taskStart,
// type: '',
// showControl: (row) => { return row.status == '03' || row.status == '05'; }
// }
] ]
} }
// multiRoute
] ]
} }
}; };
},
mounted() {
}, },
methods:{ methods:{
doShow() { doShow() {
this.show = true; this.show = true;
this.reloadData(); if (this.mapInfo && this.mapInfo.id) {
getBigRouteList(this.mapInfo.id).then(response => {
response.data.forEach(route=>{
this.filterRouteMap[route.code] = route.name;
});
this.reloadTable();
}).catch(()=>{});
}
}, },
doClose() { doClose() {
this.show = false; this.show = false;
}, },
// queryFunction(params) { reloadTable() {
// if (this.mapInfo && this.mapInfo.id) { if (this.queryList && this.queryList.reload) {
// debugger; this.queryList.reload();
// // this.queryList.query(this.queryData).then(response => { }
// return getBigRouteList(this.mapInfo.id); },
// } queryFunction(params) {
// },
// reloadTable() {
// if (this.queryList && this.queryList.reload) {
// this.queryList.reload();
// }
// },
reloadData() {
if (this.mapInfo && this.mapInfo.id) { if (this.mapInfo && this.mapInfo.id) {
this.queryList.data = []; return queryAssistListPaged(params, this.mapInfo.id);
getBigRouteList(this.mapInfo.id).then(response => {
this.queryList.data = response.data;
response.data.forEach(route=>{
if (!route.multiRoute) {
this.filterRouteMap[route.code] = route.name;
}
});
}).catch(()=>{
this.queryList.data = [];
});
} }
}, },
getSignalName(code, multiRoute) { getMainDeviceName(code) {
if (multiRoute) {
return '';
} else {
return this.formatName(code);
}
},
getSectionName(code, multiRoute) {
if (multiRoute) {
return '';
} else {
return this.formatName(code);
}
},
getSignalAspect(code, multiRoute) {
if (multiRoute) {
return '';
} else {
return this.$convertField(code, this.signalAspectList, ['value', 'label']);
}
},
getPathSwitchPosition(pathSwitchPosition, multiRoute) {
if (multiRoute) {
return '';
} else {
if (pathSwitchPosition) {
const position = this.$convertField(pathSwitchPosition.normal, this.switchLocateTypeList, ['value', 'label']);
return '' + this.formatName(pathSwitchPosition.switchCode) + ' (' + position + ')';
} else {
return '';
}
}
},
getBtnCodeList(btnCodeList) {
const nameList = [];
btnCodeList && btnCodeList.forEach(item => {
nameList.push(this.formatName(item));
});
return nameList;
},
formatName(code) {
let name = '';
const device = this.$store.getters['map/getDeviceByCode'](code); const device = this.$store.getters['map/getDeviceByCode'](code);
if (device) { return device.name + '[' + code + ']';
name = device.name || '';
}
return name;
}, },
getRouteAspectList(routeAspectList, multiRoute) { getModelType(modelType) {
const nameList = []; if (modelType === 'indicator') {
if (multiRoute) { return '指示灯';
routeAspectList.forEach(item => { } else if (modelType === 'button') {
const route = this.filterRouteMap[item.routeCode]; return '按钮';
if (route) {
const signalAspect = this.$convertField(item.signalAspect, this.signalAspectList, ['value', 'label']) || '';
nameList.push(route + '(' + signalAspect + ')');
}
});
} }
return nameList; },
getType(type) {
const typeElem = this.typeList.find(item => item.value === type);
return typeElem.label;
},
getRouteName(routeCode) {
return this.filterRouteMap[routeCode] + '[' + routeCode + ']'
},
getStandName(standCode) {
const device = this.$store.getters['map/getDeviceByCode'](standCode);
return device ? device.name : '';
},
getSectionName(sectionList) {
const sectionName = [];
sectionList.forEach(item => {
const device = this.$store.getters['map/getDeviceByCode'](item.code);
sectionName.push(device.name);
});
return sectionName;
}, },
deleteRoute(index, row) { deleteRoute(index, row) {
deleteBigRoute(this.mapInfo.id, row.code).then(res=>{ // this.mapInfo.id,
this.$message.success('删除进路成功'); deleteAssist( row.id).then(res=>{
this.$message.success('删除指示灯关联信息成功');
this.reloadData(); this.reloadData();
delete this.filterRouteMap[row.code];
this.$emit('refresh'); this.$emit('refresh');
}).catch(error=>{ }).catch(error=>{
this.$messageBox('删除进路失败:' + error.meessage); this.$messageBox('删除指示灯关联信息失败:' + error.meessage);
}); });
} }

View File

@ -22,7 +22,7 @@
>{{ $t('map.activate') }}</el-button> >{{ $t('map.activate') }}</el-button>
</el-form-item> </el-form-item>
<el-form-item label="设备分型:" prop="modelType"> <el-form-item label="设备分型:" prop="modelType">
<el-select v-model="addModel.modelType" :disabled="true"> <el-select v-model="addModel.modelType">
<el-option <el-option
v-for="item in modelTypeList" v-for="item in modelTypeList"
:key="item.value" :key="item.value"
@ -31,8 +31,8 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="设备类型:" prop="type" :disabled="true"> <el-form-item label="设备类型:" prop="type">
<el-select> <el-select v-model="addModel.type">
<el-option <el-option
v-for="item in typeList" v-for="item in typeList"
:key="item.value" :key="item.value"
@ -56,7 +56,7 @@
>{{ $t('map.activate') }}</el-button> >{{ $t('map.activate') }}</el-button>
</el-form-item> </el-form-item>
<el-form-item v-if="['assist', 'main_assist', 'receive_assist', 'deliver_assist', 'change_direction'].includes(addModel.type)" label="关联站台:" prop="standCode"> <el-form-item v-if="['assist', 'main_assist', 'receive_assist', 'deliver_assist', 'change_direction'].includes(addModel.type)" label="关联站台:" prop="standCode">
<el-select v-model="standCode" clearable filterable> <el-select v-model="addModel.standCode" clearable filterable>
<el-option <el-option
v-for="item in standList" v-for="item in standList"
:key="item.code" :key="item.code"
@ -70,7 +70,7 @@
>{{ $t('map.activate') }}</el-button> >{{ $t('map.activate') }}</el-button>
</el-form-item> </el-form-item>
<el-form-item v-if="addModel.type === 'receive' || addModel.type === 'deliver'" label="关联进路:" prop="routeCode"> <el-form-item v-if="addModel.type === 'receive' || addModel.type === 'deliver'" label="关联进路:" prop="routeCode">
<el-select v-model="routeCode" clearable filterable> <el-select v-model="addModel.routeCode" clearable filterable>
<el-option <el-option
v-for="item in routeList" v-for="item in routeList"
:key="item.code" :key="item.code"
@ -80,7 +80,6 @@
</el-select> </el-select>
<!--<el-button type="primary" @click="pushRouteAspect">查看</el-button>--> <!--<el-button type="primary" @click="pushRouteAspect">查看</el-button>-->
</el-form-item> </el-form-item>
</el-form> </el-form>
<div class="bigDraft"> <div class="bigDraft">
<el-button-group class="bigDraftBtn"> <el-button-group class="bigDraftBtn">
@ -186,16 +185,10 @@
setSelected(selected) { setSelected(selected) {
if (selected) { if (selected) {
const deviceTypeList = ['SectionOccupied'.toUpperCase(), 'AssistStatus'.toUpperCase(), 'TotalAssist'.toUpperCase(), 'DepartAssist'.toUpperCase(), const deviceTypeList = ['SectionOccupied'.toUpperCase(), 'AssistStatus'.toUpperCase(), 'TotalAssist'.toUpperCase(), 'DepartAssist'.toUpperCase(),
'PickAssist'.toUpperCase(), 'Recovery'.toUpperCase(), 'Accident'.toUpperCase(), 'Occlusion'.toUpperCase(), 'PickOrDepartArrow'.toUpperCase(), 'PickAssist'.toUpperCase(), 'PickOrDepartArrow'.toUpperCase(),
'SignalButton'.toUpperCase()]; 'SignalButton'.toUpperCase()];
if (deviceTypeList.includes(selected._type.toUpperCase()) && this.field.toUpperCase() === 'code'.toUpperCase()) { if (deviceTypeList.includes(selected._type.toUpperCase()) && this.field.toUpperCase() === 'code'.toUpperCase()) {
this.addModel.code = selected.code; this.addModel.code = selected.code;
switch (selected._type) {
case 'SectionOccupied':
this.addModel.type = 'section';
this.addModel.modelType = 'indicator';
break;
}
this.field = ''; this.field = '';
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'sectionList'.toUpperCase()) { } else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'sectionList'.toUpperCase()) {
this.addModel.sectionList.push(selected.code); this.addModel.sectionList.push(selected.code);

View File

@ -208,7 +208,10 @@ export default {
this.$emit('showMap'); this.$emit('showMap');
}, },
handleSelectControlPage(device) { handleSelectControlPage(device) {
const controlLampTypeList = ['AtsControl', 'CenterCommunication', 'ChainControl', 'IntersiteControl', 'LeuControl', 'LocalControl', 'Maintain', 'SwitchFault', 'PowerSupply', 'NoOneReturn', 'MaintenanceLamps', 'ZcCommunication', 'FaultStatusGroup', 'ModeStatusGroup', 'LampFilament', 'ReturnModeGroup', 'ControlSwitch', 'Axle', 'IndicatorLight']; const controlLampTypeList = ['AtsControl', 'CenterCommunication', 'ChainControl', 'IntersiteControl', 'LeuControl', 'LocalControl', 'Maintain',
'SwitchFault', 'PowerSupply', 'NoOneReturn', 'MaintenanceLamps', 'ZcCommunication', 'FaultStatusGroup', 'ModeStatusGroup', 'LampFilament',
'ReturnModeGroup', 'ControlSwitch', 'Axle', 'IndicatorLight', 'SectionOccupied', 'AssistStatus', 'TotalAssist', 'DepartAssist', 'PickAssist',
'Recovery', 'Accident', 'Occlusion', 'PickOrDepartArrow'];
const type = device._type; const type = device._type;
if (this.selectDevice) { if (this.selectDevice) {
this.enabledTab = this.selectDevice; this.enabledTab = this.selectDevice;