Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
This commit is contained in:
commit
26487c0dd8
@ -94,7 +94,12 @@
|
||||
<!--</el-form-item>-->
|
||||
<el-form-item :label="$t('map.trafficSegmentData')" prop="parkSectionCodeList">
|
||||
<el-button type="primary" size="small" :loading="generating" style="margin-bottom:10px" @click.native.prevent="generateParkSection">生成交路区段</el-button>
|
||||
<el-table :data="addModel.parkSectionCodeList" border style="width: 97%">
|
||||
<el-table
|
||||
:data="addModel.parkSectionCodeList"
|
||||
border
|
||||
style="width: 97%"
|
||||
class="el-parkSectionCode-table"
|
||||
>
|
||||
<el-table-column prop="sectionCode" :label="$t('map.stationName')">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ formatName(scope.row.stationCode) }}</span>
|
||||
@ -108,7 +113,7 @@
|
||||
<el-table-column fixed="right" :label="$t('map.operation')" width="50">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
v-if="scope.$index!=0&&scope.$index!=addModel.parkSectionCodeList.length-1"
|
||||
v-show="scope.$index!=0&&scope.$index!=addModel.parkSectionCodeList.length-1"
|
||||
type="text"
|
||||
size="small"
|
||||
@click.native.prevent="deleteSection(addModel.parkSectionCodeList, scope.$index)"
|
||||
@ -288,12 +293,25 @@ export default {
|
||||
// 行拖拽
|
||||
rowDrop() {
|
||||
const that = this;
|
||||
const tbody = document.querySelector('.el-table__body-wrapper tbody');
|
||||
const tbody = document.querySelector('.el-parkSectionCode-table tbody', {filter:'.ignoreDrag'});
|
||||
if (tbody) {
|
||||
Sortable.create(tbody, {
|
||||
onEnd({ newIndex, oldIndex }) {
|
||||
const currRow = that.addModel.mapRouteUnitRelList.splice(oldIndex, 1)[0];
|
||||
that.addModel.mapRouteUnitRelList.splice(newIndex, 0, currRow);
|
||||
const length = that.addModel.parkSectionCodeList.length - 1;
|
||||
if (newIndex != 0 && oldIndex != 0 && newIndex != length && oldIndex != length) {
|
||||
that.addModel.parkSectionCodeList.splice(newIndex, 0, that.addModel.parkSectionCodeList.splice(oldIndex, 1)[0]);
|
||||
const newArray = that.addModel.parkSectionCodeList.slice(0);
|
||||
that.addModel.parkSectionCodeList = [];
|
||||
that.$nextTick(function () {
|
||||
that.addModel.parkSectionCodeList = newArray;
|
||||
});
|
||||
} else {
|
||||
const newArray = that.addModel.parkSectionCodeList.slice(0);
|
||||
that.addModel.parkSectionCodeList = [];
|
||||
that.$nextTick(function () {
|
||||
that.addModel.parkSectionCodeList = newArray;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user