Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
This commit is contained in:
commit
150eeaaaba
@ -133,6 +133,25 @@ export function listRoutingData(mapId, params) {
|
||||
});
|
||||
}
|
||||
|
||||
/** 分页查询公共的交路数据(新版)*/
|
||||
export function listPublicRoutingData(mapId, params) {
|
||||
return request({
|
||||
// url: `/api/mapBuild/${mapId}/routingData`,
|
||||
url: `/api/runPlan/userData/${mapId}/default/routing/page`,
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
/** 用户拉取公共的交路数据(新版)*/
|
||||
export function pullPublicRoutingData(mapId, data) {
|
||||
return request({
|
||||
url: `/api/runPlan/userData/${mapId}/default/routing/pull`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 创建交路(新版)*/
|
||||
export function addRoutingData(data) {
|
||||
return request({
|
||||
|
@ -165,14 +165,6 @@
|
||||
</el-table-column>
|
||||
</template>
|
||||
</el-table>
|
||||
<div v-if="queryList.selectCheckShow" style="margin-top: 8px; margin-left: 8px;">
|
||||
<el-button
|
||||
size="mini"
|
||||
:type="'primary'"
|
||||
:disabled="!queryList.selection.length"
|
||||
@click="queryList.selectAllClick(queryList.selection)"
|
||||
>{{ $t('global.selectAdd') }}</el-button>
|
||||
</div>
|
||||
<div v-if="!queryList.paginationHiden" class="page-container " style="text-align: center; margin: 10px 0; height: 40px;">
|
||||
<el-pagination
|
||||
:current-page="pageIndex"
|
||||
@ -184,6 +176,15 @@
|
||||
@current-change="changePage"
|
||||
/>
|
||||
</div>
|
||||
<div v-if="queryList.selectCheckShow" :class="queryList.selectCheckClass?queryList.selectCheckClass:'defaultCheckClass'">
|
||||
<el-button
|
||||
:size="queryList.selectCheckSize?queryList.selectCheckSize:'mini'"
|
||||
:type="'primary'"
|
||||
:disabled="!queryList.selection.length"
|
||||
:loading="queryList.selectCheckLoading?queryList.selectCheckLoading:false"
|
||||
@click="queryList.selectAllClick(queryList.selection)"
|
||||
>{{ queryList.selectCheckText?queryList.selectCheckText:$t('global.selectAdd') }}</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
@ -594,4 +595,8 @@ export default {
|
||||
z-index: 100;
|
||||
}
|
||||
}
|
||||
.defaultCheckClass{
|
||||
margin-top: 8px;
|
||||
margin-left: 8px;
|
||||
}
|
||||
</style>
|
||||
|
@ -0,0 +1,267 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag title="导入公共交路" :visible.sync="show" width="80%" :before-do-close="doClose" append-to-body>
|
||||
<div>
|
||||
<QueryListPage
|
||||
ref="queryListPage"
|
||||
:pager-config="pagerConfig"
|
||||
:query-form="queryForm"
|
||||
:query-list="queryList"
|
||||
/>
|
||||
</div>
|
||||
<pre-view-field ref="previewField" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { listPublicRoutingData, pullPublicRoutingData} from '@/api/jmap/mapdraft';
|
||||
import PreViewField from './preview';
|
||||
|
||||
export default {
|
||||
name: 'ImportRouteDetail',
|
||||
components: {
|
||||
PreViewField
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '120px',
|
||||
queryObject: {
|
||||
startStationCode: {
|
||||
type: 'select',
|
||||
label: this.$t('map.startStation'),
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
},
|
||||
endStationCode: {
|
||||
type: 'select',
|
||||
label: this.$t('map.endStation'),
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
},
|
||||
startSectionCode: {
|
||||
type: 'select',
|
||||
label: '起始区段',
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
},
|
||||
endSectionCode: {
|
||||
type: 'select',
|
||||
label: '终到区段',
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
afterQuery: this.afterQuery,
|
||||
selectCheckShow: true,
|
||||
selectCheckClass:'selectCheckClass',
|
||||
selectCheckSize:'medium',
|
||||
selectAllClick:this.selectAllClick,
|
||||
selectCheckText:'导入',
|
||||
selectCheckLoading:false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '交路名称',
|
||||
prop: 'name',
|
||||
width:'260'
|
||||
},
|
||||
{
|
||||
title: this.$t('map.startStation'),
|
||||
prop: 'startStationCode'
|
||||
|
||||
},
|
||||
{
|
||||
title: '起始区段',
|
||||
prop: 'startSectionCode'
|
||||
},
|
||||
{
|
||||
title: this.$t('map.endStation'),
|
||||
prop: 'endStationCode'
|
||||
},
|
||||
{
|
||||
title: '终到区段',
|
||||
prop: 'endSectionCode'
|
||||
},
|
||||
{
|
||||
title: this.$t('map.routingDirection'),
|
||||
prop: 'right',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { if (row.right) { return '右行'; } else { return '左行'; } },
|
||||
tagType: (row) => { if (row.right) { return 'primary'; } else { return 'success'; } }
|
||||
},
|
||||
// {
|
||||
// title: this.$t('map.destination'),
|
||||
// prop: 'destinationCode'
|
||||
// },
|
||||
// {
|
||||
// title: this.$t('map.remarks'),
|
||||
// prop: 'remarks'
|
||||
// },
|
||||
{
|
||||
type: 'button',
|
||||
title: this.$t('map.sectionData'),
|
||||
buttons: [
|
||||
{
|
||||
name: this.$t('map.preview'),
|
||||
handleClick: this.sectionDetail
|
||||
}
|
||||
]
|
||||
}
|
||||
// {
|
||||
// type: 'button',
|
||||
// title: this.$t('map.operation'),
|
||||
// width: '300',
|
||||
// buttons: [
|
||||
// {
|
||||
// name: this.$t('map.compile'),
|
||||
// handleClick: this.editObj
|
||||
// },
|
||||
// {
|
||||
// name: this.$t('map.deleteObj'),
|
||||
// type: 'danger',
|
||||
// handleClick: this.deleteObj
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'sectionList',
|
||||
'stationList'
|
||||
])
|
||||
},
|
||||
mounted() {
|
||||
// this.acquireMapList();
|
||||
this.initQueryObject();
|
||||
},
|
||||
methods: {
|
||||
doShow() {
|
||||
this.show = true;
|
||||
this.reloadTable();
|
||||
},
|
||||
initQueryObject() {
|
||||
const stationList = [];
|
||||
if (this.stationList && this.stationList.length) {
|
||||
this.stationList.forEach(elem => {
|
||||
stationList.push({ label: this.formatName(elem.code), value: elem.code });
|
||||
});
|
||||
this.queryForm.queryObject.startStationCode.config.data = stationList;
|
||||
this.queryForm.queryObject.endStationCode.config.data = stationList;
|
||||
}
|
||||
const sectionList = [];
|
||||
if (this.sectionList && this.sectionList.length) {
|
||||
this.sectionList.forEach(elem => {
|
||||
if (elem.standTrack || elem.reentryTrack || elem.transferTrack) {
|
||||
sectionList.push({ label: this.formatName(elem.code), value: elem.code });
|
||||
}
|
||||
});
|
||||
this.queryForm.queryObject.startSectionCode.config.data = sectionList;
|
||||
this.queryForm.queryObject.endSectionCode.config.data = sectionList;
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
this.show = false;
|
||||
},
|
||||
formatName(code) {
|
||||
let name = '';
|
||||
const device = this.$store.getters['map/getDeviceByCode'](code);
|
||||
if (device) {
|
||||
name = device.name;
|
||||
}
|
||||
|
||||
return name;
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.$route.query.mapId) {
|
||||
return listPublicRoutingData(this.$route.query.mapId, params);
|
||||
}
|
||||
},
|
||||
afterQuery(data) {
|
||||
if (data && data.list) {
|
||||
const that = this;
|
||||
const list = data.list;
|
||||
if (list) {
|
||||
list.map(elem => {
|
||||
elem.startStationCode = that.formatName(elem.startStationCode);
|
||||
elem.startSectionCode = that.formatName(elem.startSectionCode);
|
||||
elem.endStationCode = that.formatName(elem.endStationCode);
|
||||
elem.endSectionCode = that.formatName(elem.endSectionCode);
|
||||
});
|
||||
}
|
||||
}
|
||||
return data;
|
||||
},
|
||||
sectionDetail(index, row) {
|
||||
const sectionDict = {};
|
||||
const stationDict = {};
|
||||
this.sectionList.forEach(elem => { sectionDict[elem.code] = elem.name; });
|
||||
this.stationList.forEach(elem => { stationDict[elem.code] = elem.name; });
|
||||
|
||||
const fieldList = {
|
||||
id: row.id,
|
||||
mapId: this.$route.params.mapId,
|
||||
title: '区段列表',
|
||||
name: row.name,
|
||||
model: {
|
||||
field: 'parkSectionCodeList',
|
||||
items: [
|
||||
{ prop: 'stationCode', label: this.$t('map.stationCodeClomn'), type: 'text' },
|
||||
{
|
||||
prop: 'stationCode', label: '车站名称', type: 'select', options: stationDict
|
||||
},
|
||||
{ prop: 'sectionCode', label: this.$t('map.blockCodingClomn'), type: 'text' },
|
||||
{
|
||||
prop: 'sectionCode', label: this.$t('map.sectionName'), type: 'select', options: sectionDict
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
this.$refs.previewField.doShow(fieldList, row.parkSectionCodeList);
|
||||
},
|
||||
reloadTable() {
|
||||
if (this.queryList && this.queryList.reload) {
|
||||
this.queryList.reload();
|
||||
}
|
||||
},
|
||||
selectAllClick(selection) {
|
||||
const routeList = [];
|
||||
selection.forEach(each=>{
|
||||
routeList.push(each.id);
|
||||
});
|
||||
if (routeList.length > 0) {
|
||||
this.queryList.selectCheckLoading = true;
|
||||
pullPublicRoutingData(this.$route.query.mapId, routeList ).then(res=>{
|
||||
this.queryList.selectCheckLoading = false;
|
||||
this.$message.success('导入公共交路成功');
|
||||
this.doClose();
|
||||
}).catch((error) => {
|
||||
this.$messageBox('导入公共交路失败' + ':' + error.message);
|
||||
this.queryList.selectCheckLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.selectCheckClass{
|
||||
text-align: center;
|
||||
padding: 14px 0px 20px 0px;
|
||||
}
|
||||
</style>
|
@ -1,11 +1,12 @@
|
||||
<template>
|
||||
<div class="routeConfig">
|
||||
<div>
|
||||
<div class="clearfix" style="padding-right: 20px;">
|
||||
<!-- <div style="position:relative"> -->
|
||||
<div class="routeConfigTop">
|
||||
<el-button type="text" class="mapEdit_box" @click="previewRouteEvent">{{ $t('map.preview') }}</el-button>
|
||||
<el-button type="text" class="mapEdit_box" @click="createRouteEvent">{{ $t('map.newConstruction') }}</el-button>
|
||||
<el-button type="text" class="mapEdit_box" @click="importRouteEvent">导入公共交路</el-button>
|
||||
</div>
|
||||
<el-form ref="form" :model="addModel" :rules="rules" label-width="120px" size="mini">
|
||||
<el-form ref="form" :model="addModel" :rules="rules" label-width="120px" size="mini" style="height:100%">
|
||||
<div class="definition">
|
||||
<el-form-item :label="$t('map.routingName')" prop="name">
|
||||
<el-input v-model="addModel.name" />
|
||||
@ -148,22 +149,25 @@
|
||||
</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button-group style="padding-bottom:10px">
|
||||
</div>
|
||||
<el-form-item class="buttonGroup">
|
||||
<el-button-group>
|
||||
<el-button v-if="isSave" type="primary" size="small" :loading="loading" @click="save">{{ $t('map.save') }}
|
||||
</el-button>
|
||||
<el-button v-else type="warning" size="small" :loading="loading" @click="update">{{ $t('map.updata') }}
|
||||
</el-button>
|
||||
</el-button-group>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
<route-operate ref="routeOperate" @routingSelected="routingSelected" />
|
||||
<import-route-operate ref="importRouteOperate" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import RouteOperate from './routeOperate';
|
||||
import ImportRouteOperate from './importRouteOperate';
|
||||
import { setUID } from '@/jmapNew/utils/Uid';
|
||||
import { addRoutingData, updateRoutingData, gernateRoutingSectionInRunplan } from '@/api/jmap/mapdraft';
|
||||
import { mapGetters } from 'vuex';
|
||||
@ -172,7 +176,8 @@ import Sortable from 'sortablejs';
|
||||
export default {
|
||||
name:'RouteConfig',
|
||||
components: {
|
||||
RouteOperate
|
||||
RouteOperate,
|
||||
ImportRouteOperate
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -308,6 +313,9 @@ export default {
|
||||
previewRouteEvent() {
|
||||
this.$refs.routeOperate.doShow();
|
||||
},
|
||||
importRouteEvent() {
|
||||
this.$refs.importRouteOperate.doShow();
|
||||
},
|
||||
createRouteEvent() {
|
||||
this.clear();
|
||||
},
|
||||
@ -697,4 +705,57 @@ export default {
|
||||
padding: 3px 0;
|
||||
margin-right: 5px;
|
||||
}
|
||||
.routeConfig{
|
||||
height:100%;
|
||||
position: relative;
|
||||
}
|
||||
.routeConfigTop{
|
||||
padding: 7px 20px 7px 0px;
|
||||
position: absolute;
|
||||
background: #fff;
|
||||
width: 100%;
|
||||
z-index: 2;
|
||||
height: 35px;
|
||||
font-size: 16px;
|
||||
display: inline-block;
|
||||
-webkit-box-shadow: 0px 1px 3px #ccc;
|
||||
box-shadow: 0px 1px 3px #ccc;
|
||||
right: 0;
|
||||
top: 0;
|
||||
}
|
||||
.routeConfigTop button{
|
||||
display:inline-block;
|
||||
}
|
||||
.definition{
|
||||
padding: 45px 30px 45px 0px;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
&::-webkit-scrollbar {
|
||||
width: 4px;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb {
|
||||
border-radius: 10px;
|
||||
background: #c3c3c3;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-track {
|
||||
border-radius: 0;
|
||||
background: #f0f0f0;
|
||||
|
||||
}
|
||||
}
|
||||
.buttonGroup{
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
bottom: 0;
|
||||
background: #fff;
|
||||
margin-bottom: 0px;
|
||||
box-shadow: 0px -2px 5px #ccc;
|
||||
z-index: 2;
|
||||
text-align: right;
|
||||
padding-right: 26px;
|
||||
padding-top: 4px;
|
||||
}
|
||||
</style>
|
||||
|
@ -14,7 +14,6 @@
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { listMap } from '@/api/jmap/mapdraft';
|
||||
import { listRoutingData, deleteRoutingData, getRoutingData } from '@/api/jmap/mapdraft';
|
||||
import PreViewField from './preview';
|
||||
|
||||
@ -26,7 +25,6 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
mapList: [],
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
@ -71,8 +69,9 @@ export default {
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('map.routingCode'),
|
||||
prop: 'code'
|
||||
title: '交路名称',
|
||||
prop: 'name',
|
||||
width:'260'
|
||||
},
|
||||
{
|
||||
title: this.$t('map.startStation'),
|
||||
@ -127,8 +126,8 @@ export default {
|
||||
},
|
||||
{
|
||||
name: this.$t('map.deleteObj'),
|
||||
handleClick: this.deleteObj,
|
||||
type: 'danger'
|
||||
type: 'danger',
|
||||
handleClick: this.deleteObj
|
||||
}
|
||||
// {
|
||||
// name: '生成站间运行数据',
|
||||
@ -148,7 +147,6 @@ export default {
|
||||
])
|
||||
},
|
||||
mounted() {
|
||||
this.acquireMapList();
|
||||
this.initQueryObject();
|
||||
},
|
||||
methods: {
|
||||
@ -193,19 +191,12 @@ export default {
|
||||
return listRoutingData(this.$route.query.mapId, params);
|
||||
}
|
||||
},
|
||||
acquireMapList() {
|
||||
// 地图名称列表
|
||||
listMap({drawWay: true}).then(response => {
|
||||
this.mapList = response.data;
|
||||
});
|
||||
},
|
||||
afterQuery(data) {
|
||||
if (data && data.list) {
|
||||
const that = this;
|
||||
const list = data.list;
|
||||
if (list) {
|
||||
list.map(elem => {
|
||||
that.$convertSpecifiedField(elem, that.mapList, 'id', 'name', ['mapId']);
|
||||
elem.startStationCode = that.formatName(elem.startStationCode);
|
||||
elem.startSectionCode = that.formatName(elem.startSectionCode);
|
||||
elem.endStationCode = that.formatName(elem.endStationCode);
|
||||
|
Loading…
Reference in New Issue
Block a user