调整格式
This commit is contained in:
parent
bc00f1660a
commit
7992a2e11e
@ -15,14 +15,11 @@
|
||||
:filter-node-method="filterNode"
|
||||
:default-expanded-keys="expandList"
|
||||
@node-click="clickEvent"
|
||||
@node-contextmenu="showContextMenu"
|
||||
@node-expand="nodeExpand"
|
||||
@node-collapse="nodeCollapse"
|
||||
>
|
||||
<span slot-scope="{ node }">
|
||||
<span
|
||||
class="el-icon-tickets"
|
||||
/>
|
||||
<span class="el-icon-tickets" />
|
||||
<span v-if="node.data.id ==='Simulation'"> 仿真系统</span>
|
||||
<span v-else> {{ node.data.name }}</span>
|
||||
</span>
|
||||
@ -32,8 +29,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getSubSystemInfo } from '@/api/trainingPlatform';
|
||||
import { UrlConfig } from '@/scripts/ConstDic';
|
||||
import localStore from 'storejs';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
|
||||
@ -42,16 +37,11 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
defaultShowKeys: [],
|
||||
filterText: '',
|
||||
treeList: [],
|
||||
selected: {},
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'name'
|
||||
},
|
||||
node: {
|
||||
},
|
||||
mapId: '',
|
||||
expandList: [],
|
||||
filterSelect: ''
|
||||
@ -66,9 +56,6 @@ export default {
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
filterText(val) {
|
||||
this.$refs.tree.filter(val);
|
||||
}
|
||||
},
|
||||
beforeDestroy () {
|
||||
},
|
||||
@ -80,12 +67,6 @@ export default {
|
||||
if (!value) return true;
|
||||
return data.name.indexOf(value) !== -1;
|
||||
},
|
||||
showContextMenu(e, obj, node, vueElem) {
|
||||
if (obj) {
|
||||
this.node = node;
|
||||
this.selected = obj;
|
||||
}
|
||||
},
|
||||
clickEvent(obj, data, ele) {
|
||||
localStore.set('trainingPlatformCheckId' + this.filterSelect + this.userId, obj.id);
|
||||
while (data) {
|
||||
@ -100,14 +81,6 @@ export default {
|
||||
setLocalRoute(path) {
|
||||
localStore.set('trainingPlatformRoute' + this.userId, path);
|
||||
},
|
||||
forTree(item) {
|
||||
item.children && item.children.forEach(childrenItem => {
|
||||
childrenItem.key = item.id + childrenItem.id + childrenItem.type;
|
||||
if (childrenItem.children && childrenItem.children.length) {
|
||||
this.forTree(childrenItem);
|
||||
}
|
||||
});
|
||||
},
|
||||
nodeExpand(obj, node, ele) {
|
||||
const key = obj.id + obj.type;
|
||||
this.expandList = this.expandList.filter(item => item !== key);
|
||||
@ -118,13 +91,6 @@ export default {
|
||||
const key = obj.id + obj.type;
|
||||
this.expandList = this.expandList.filter(item => item !== key);
|
||||
localStore.set('trainIngPlatformExpandList' + this.filterSelect + this.userId, this.expandList);
|
||||
},
|
||||
getExpandList(filterSelect) {
|
||||
let expand = localStore.get('trainIngPlatformExpandList' + filterSelect + this.userId);
|
||||
expand = expand ? (expand + '').split(',') : '';
|
||||
if (expand instanceof Array) {
|
||||
this.expandList = expand;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -450,7 +450,7 @@ export default {
|
||||
isSwitchSection: true,
|
||||
relSwitchCode: elem.code,
|
||||
points: [{ x: 0, y: 0 }, { x: 0, y: 0 }],
|
||||
logicSectionNum: [0],
|
||||
logicSectionNum: 0,
|
||||
logicSectionShow: false,
|
||||
sepTypeLeft: '00',
|
||||
offsetLeft: 0,
|
||||
|
@ -252,8 +252,7 @@ export default {
|
||||
|
||||
if (collection && collection.length) {
|
||||
collection.forEach(elem => {
|
||||
if (elem.type !== '03' && !elem.isSwitchSection && (
|
||||
elem.logicSectionNum.length == 0 || elem.logicSectionNum.length == 1 && elem.logicSectionNum[0] == 0)) {
|
||||
if (elem.type !== '03' && !elem.isSwitchSection && (Number(elem.logicSectionNum) == 0)) {
|
||||
const triangle = new JTriangle(elem.points[0], elem.points[elem.points.length - 1]);
|
||||
models.push(this.createModel({
|
||||
triangle: triangle,
|
||||
|
@ -3,31 +3,17 @@
|
||||
<el-tab-pane class="view-control" :label="$t('map.property')" name="first" :lazy="lazy">
|
||||
<div style="height: calc(100% - 46px);">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||
<config-list
|
||||
ref="dataform"
|
||||
:form="form"
|
||||
:form-model="editModel"
|
||||
:rules="rules"
|
||||
/>
|
||||
<config-list ref="dataform" :form="form" :form-model="editModel" :rules="rules" />
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
<div class="button_box">
|
||||
<el-button-group class="map-draft-group">
|
||||
<el-button type="primary" size="small" @click="edit">{{ $t('map.updateObj') }}</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
size="small"
|
||||
@click="deleteObj"
|
||||
>{{ $t('map.deleteObj') }}</el-button>
|
||||
<el-button type="danger" size="small" @click="deleteObj">{{ $t('map.deleteObj') }}</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane
|
||||
class="view-control"
|
||||
:label="$t('map.newConstruction')"
|
||||
name="second"
|
||||
:lazy="lazy"
|
||||
>
|
||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
||||
<create-section
|
||||
ref="create"
|
||||
:field="field"
|
||||
@ -193,511 +179,84 @@ export default {
|
||||
draw: {
|
||||
name: this.$t('map.drawData'),
|
||||
item: [
|
||||
{
|
||||
prop: 'code',
|
||||
label: this.$t('map.blockCoding'),
|
||||
type: 'select',
|
||||
mode: false,
|
||||
optionLabel: 'name&&code',
|
||||
optionValue: 'code',
|
||||
options: this.sectionList,
|
||||
change: true,
|
||||
deviceChange: this.deviceChange
|
||||
},
|
||||
{
|
||||
prop: 'name',
|
||||
label: this.$t('map.sectionNameColon'),
|
||||
type: 'input'
|
||||
},
|
||||
{
|
||||
prop: 'namePosition',
|
||||
label: this.$t('map.sectionNameOffset'),
|
||||
type: 'coordinate',
|
||||
width: '150px',
|
||||
children: [
|
||||
{
|
||||
prop: 'namePosition.x',
|
||||
firstLevel: 'namePosition',
|
||||
secondLevel: 'x',
|
||||
label: 'x:',
|
||||
type: 'number',
|
||||
labelWidth: '25px'
|
||||
},
|
||||
{
|
||||
prop: 'namePosition.y',
|
||||
firstLevel: 'namePosition',
|
||||
secondLevel: 'y',
|
||||
label: 'y:',
|
||||
type: 'number',
|
||||
labelWidth: '25px'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
prop: 'type',
|
||||
label: this.$t('map.sectionType'),
|
||||
type: 'select',
|
||||
optionLabel: 'name',
|
||||
optionValue: 'code',
|
||||
options: this.SectionTypeList
|
||||
}, // 区段类型
|
||||
{
|
||||
prop: 'roadType',
|
||||
label: '线路类型:',
|
||||
type: 'select',
|
||||
optionLabel: 'name',
|
||||
optionValue: 'code',
|
||||
options: this.sectionRoadTypeList,
|
||||
clearable: true,
|
||||
isHidden: !this.isSwitchSectionType,
|
||||
change: true,
|
||||
deviceChange: this.roadTypeChange
|
||||
},
|
||||
{
|
||||
prop: 'leftSectionCode',
|
||||
label: this.$t('map.leftAssociatedSection'),
|
||||
type: 'selectHover',
|
||||
optionLabel: 'name&&code',
|
||||
optionValue: 'code',
|
||||
clearable: true,
|
||||
options: this.switchAndPhySicalSectionList,
|
||||
hover: this.hover,
|
||||
buttonType: 'leftSection',
|
||||
buttonShowType: this.isLeftSectionButtonShow,
|
||||
isHidden: !this.hasAssociatedSection
|
||||
}, // 左关联区段
|
||||
{
|
||||
prop: 'rightSectionCode',
|
||||
label: this.$t('map.rightAssociatedSection'),
|
||||
type: 'selectHover',
|
||||
optionLabel: 'name&&code',
|
||||
optionValue: 'code',
|
||||
clearable: true,
|
||||
options: this.switchAndPhySicalSectionList,
|
||||
hover: this.hover,
|
||||
buttonType: 'rightSection',
|
||||
buttonShowType: this.isRightSectionButtonShow,
|
||||
isHidden: !this.hasAssociatedSection
|
||||
}, // 右关联区段
|
||||
{
|
||||
prop: 'parentCode',
|
||||
label: this.$t('map.associatedSection'),
|
||||
type: 'select',
|
||||
mode: true,
|
||||
optionLabel: 'name&&code',
|
||||
optionValue: 'code',
|
||||
disabled: true,
|
||||
options: this.sectionList,
|
||||
isHidden: !this.isParentCode
|
||||
}, // 所属物理/道岔区段code
|
||||
{
|
||||
prop: 'sepTypeLeft',
|
||||
label: this.$t('map.sepTypeLeft'),
|
||||
type: 'select',
|
||||
optionLabel: 'name',
|
||||
optionValue: 'code',
|
||||
options: this.SectionSepTypeList,
|
||||
isHidden: !this.isSwitchSectionType
|
||||
},
|
||||
{
|
||||
prop: 'sepTypeRight',
|
||||
label: this.$t('map.sepTypeRight'),
|
||||
type: 'select',
|
||||
optionLabel: 'name',
|
||||
optionValue: 'code',
|
||||
options: this.SectionSepTypeList,
|
||||
isHidden: !this.isSwitchSectionType
|
||||
},
|
||||
{
|
||||
prop: 'points',
|
||||
label: this.$t('map.segmentCoordinates'),
|
||||
type: 'points',
|
||||
width: '100px',
|
||||
isHidden: !this.isPointsShow,
|
||||
addPoint: this.addPoint,
|
||||
delPoint: this.delPoint,
|
||||
lastDisabled: true
|
||||
},
|
||||
{
|
||||
prop: 'logicSectionStartOffset',
|
||||
label: this.$t('map.logicalSectionStartOffset'),
|
||||
type: 'number',
|
||||
min: 0,
|
||||
width: '150px',
|
||||
isHidden: !this.isStationCodeDisabled,
|
||||
disabled: true
|
||||
},
|
||||
{
|
||||
prop: 'logicSectionEndOffset',
|
||||
label: this.$t('map.logicalSectionEndOffset'),
|
||||
type: 'number',
|
||||
min: 0,
|
||||
width: '150px',
|
||||
isHidden: !this.isStationCodeDisabled,
|
||||
disabled: true
|
||||
},
|
||||
{
|
||||
prop: 'standTrack',
|
||||
label: this.$t('map.isStandTrack'),
|
||||
type: 'checkbox',
|
||||
isHidden: !this.isLogicSectionNameSort
|
||||
}, // 是否站台轨
|
||||
{ prop: 'code', label: this.$t('map.blockCoding'), type: 'select', mode: false, optionLabel: 'name&&code', optionValue: 'code', options: this.sectionList, change: true, deviceChange: this.deviceChange },
|
||||
{ prop: 'name', label: this.$t('map.sectionNameColon'), type: 'input' },
|
||||
{ prop: 'namePosition', label: this.$t('map.sectionNameOffset'), type: 'coordinate', width: '150px', children: [
|
||||
{ prop: 'namePosition.x', firstLevel: 'namePosition', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
|
||||
{ prop: 'namePosition.y', firstLevel: 'namePosition', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
|
||||
] },
|
||||
{ prop: 'type', label: this.$t('map.sectionType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SectionTypeList }, // 区段类型
|
||||
{ prop: 'roadType', label: '线路类型:', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.sectionRoadTypeList, clearable: true, isHidden: !this.isSwitchSectionType, change: true, deviceChange: this.roadTypeChange },
|
||||
{ prop: 'leftSectionCode', label: this.$t('map.leftAssociatedSection'), type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', clearable: true, options: this.switchAndPhySicalSectionList, hover: this.hover, buttonType: 'leftSection', buttonShowType: this.isLeftSectionButtonShow, isHidden: !this.hasAssociatedSection }, // 左关联区段
|
||||
{ prop: 'rightSectionCode', label: this.$t('map.rightAssociatedSection'), type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', clearable: true, options: this.switchAndPhySicalSectionList, hover: this.hover, buttonType: 'rightSection', buttonShowType: this.isRightSectionButtonShow, isHidden: !this.hasAssociatedSection }, // 右关联区段
|
||||
{ prop: 'parentCode', label: this.$t('map.associatedSection'), type: 'select', mode: true, optionLabel: 'name&&code', optionValue: 'code', disabled: true, options: this.sectionList, isHidden: !this.isParentCode }, // 所属物理/道岔区段code
|
||||
{ prop: 'sepTypeLeft', label: this.$t('map.sepTypeLeft'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SectionSepTypeList, isHidden: !this.isSwitchSectionType },
|
||||
{ prop: 'sepTypeRight', label: this.$t('map.sepTypeRight'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SectionSepTypeList, isHidden: !this.isSwitchSectionType },
|
||||
{ prop: 'points', label: this.$t('map.segmentCoordinates'), type: 'points', width: '100px', isHidden: !this.isPointsShow, addPoint: this.addPoint, delPoint: this.delPoint, lastDisabled: true },
|
||||
{ prop: 'logicSectionStartOffset', label: this.$t('map.logicalSectionStartOffset'), type: 'number', min: 0, width: '150px', isHidden: !this.isStationCodeDisabled, disabled: true },
|
||||
{ prop: 'logicSectionEndOffset', label: this.$t('map.logicalSectionEndOffset'), type: 'number', min: 0, width: '150px', isHidden: !this.isStationCodeDisabled, disabled: true },
|
||||
{ prop: 'standTrack', label: this.$t('map.isStandTrack'), type: 'checkbox', isHidden: !this.isLogicSectionNameSort }, // 是否站台轨
|
||||
|
||||
{
|
||||
prop: 'standTrackName',
|
||||
label: this.$t('map.standTrackName'),
|
||||
type: 'input',
|
||||
isHidden: !this.isstandTrackNameShow
|
||||
},
|
||||
{
|
||||
prop: 'standTrackNamePosition',
|
||||
label: this.$t('map.standTrackNamePosition'),
|
||||
type: 'coordinate',
|
||||
width: '150px',
|
||||
isHidden: !this.isstandTrackNameShow,
|
||||
children: [
|
||||
{
|
||||
prop: 'standTrackNamePosition.x',
|
||||
firstLevel: 'standTrackNamePosition',
|
||||
secondLevel: 'x',
|
||||
label: 'x:',
|
||||
type: 'number',
|
||||
labelWidth: '20px'
|
||||
},
|
||||
{
|
||||
prop: 'standTrackNamePosition.y',
|
||||
firstLevel: 'standTrackNamePosition',
|
||||
secondLevel: 'y',
|
||||
label: 'y:',
|
||||
type: 'number',
|
||||
labelWidth: '20px'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
prop: 'reentryTrack',
|
||||
label: this.$t('map.isReentryTrack'),
|
||||
type: 'checkbox',
|
||||
isHidden: !this.isReentryTrackShow
|
||||
}, // 是否折返轨
|
||||
{
|
||||
prop: 'firstTurnBack',
|
||||
label: '是否优先折返:',
|
||||
type: 'checkbox',
|
||||
isHidden: !this.isreentryTrackName
|
||||
},
|
||||
{
|
||||
prop: 'reentryTrackName',
|
||||
label: this.$t('map.reentryTrackName'),
|
||||
type: 'input',
|
||||
isHidden: !this.isreentryTrackName
|
||||
}, // 折返轨名称
|
||||
{
|
||||
prop: 'reentryTrackNamePosition',
|
||||
label: this.$t('map.reentryTrackNamePosition'),
|
||||
type: 'coordinate',
|
||||
width: '150px',
|
||||
isHidden: !this.isreentryTrackName,
|
||||
children: [
|
||||
{
|
||||
prop: 'reentryTrackNamePosition.x',
|
||||
firstLevel: 'reentryTrackNamePosition',
|
||||
secondLevel: 'x',
|
||||
label: 'x:',
|
||||
type: 'number',
|
||||
labelWidth: '20px'
|
||||
},
|
||||
{
|
||||
prop: 'reentryTrackNamePosition.y',
|
||||
firstLevel: 'reentryTrackNamePosition',
|
||||
secondLevel: 'y',
|
||||
label: 'y:',
|
||||
type: 'number',
|
||||
labelWidth: '20px'
|
||||
}
|
||||
]
|
||||
}, // 折返轨名称坐标
|
||||
{ prop: 'standTrackName', label: this.$t('map.standTrackName'), type: 'input', isHidden: !this.isstandTrackNameShow },
|
||||
{ prop: 'standTrackNamePosition', label: this.$t('map.standTrackNamePosition'), type: 'coordinate', width: '150px', isHidden: !this.isstandTrackNameShow, children: [
|
||||
{ prop: 'standTrackNamePosition.x', firstLevel: 'standTrackNamePosition', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px' },
|
||||
{ prop: 'standTrackNamePosition.y', firstLevel: 'standTrackNamePosition', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px' }
|
||||
] },
|
||||
{ prop: 'reentryTrack', label: this.$t('map.isReentryTrack'), type: 'checkbox', isHidden: !this.isReentryTrackShow }, // 是否折返轨
|
||||
{ prop: 'firstTurnBack', label: '是否优先折返:', type: 'checkbox', isHidden: !this.isreentryTrackName },
|
||||
{ prop: 'reentryTrackName', label: this.$t('map.reentryTrackName'), type: 'input', isHidden: !this.isreentryTrackName }, // 折返轨名称
|
||||
{ prop: 'reentryTrackNamePosition', label: this.$t('map.reentryTrackNamePosition'), type: 'coordinate', width: '150px', isHidden: !this.isreentryTrackName, children: [
|
||||
{ prop: 'reentryTrackNamePosition.x', firstLevel: 'reentryTrackNamePosition', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px' },
|
||||
{ prop: 'reentryTrackNamePosition.y', firstLevel: 'reentryTrackNamePosition', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px' }
|
||||
] }, // 折返轨名称坐标
|
||||
|
||||
{
|
||||
prop: 'transferTrack',
|
||||
label: this.$t('map.isTransferTrack'),
|
||||
type: 'checkbox',
|
||||
isHidden: !this.isTransferTrackShow
|
||||
}, // 是否转换轨
|
||||
{ prop: 'transferTrack', label: this.$t('map.isTransferTrack'), type: 'checkbox', isHidden: !this.isTransferTrackShow }, // 是否转换轨
|
||||
|
||||
{
|
||||
prop: 'transferTrackName',
|
||||
label: this.$t('map.transferTrackName'),
|
||||
type: 'input',
|
||||
isHidden: !this.istransferTrackName
|
||||
}, // 转换轨名称
|
||||
{
|
||||
prop: 'transferTrackNamePosition',
|
||||
label: this.$t('map.transferTrackNamePosition'),
|
||||
type: 'coordinate',
|
||||
width: '150px',
|
||||
isHidden: !this.istransferTrackName,
|
||||
children: [
|
||||
{
|
||||
prop: 'transferTrackNamePosition.x',
|
||||
firstLevel: 'transferTrackNamePosition',
|
||||
secondLevel: 'x',
|
||||
label: 'x:',
|
||||
type: 'number',
|
||||
labelWidth: '20px'
|
||||
},
|
||||
{
|
||||
prop: 'transferTrackNamePosition.y',
|
||||
firstLevel: 'transferTrackNamePosition',
|
||||
secondLevel: 'y',
|
||||
label: 'y:',
|
||||
type: 'number',
|
||||
labelWidth: '20px'
|
||||
}
|
||||
]
|
||||
}, // 转换轨名称坐标
|
||||
{
|
||||
prop: 'destinationCode',
|
||||
label: this.$t('map.destinationCode'),
|
||||
type: 'input',
|
||||
isHidden: !this.isdestinationCode
|
||||
}, // 目的地码
|
||||
{
|
||||
prop: 'destinationCodePoint',
|
||||
label: this.$t('map.destinationCodePoint'),
|
||||
type: 'coordinate',
|
||||
width: '150px',
|
||||
isHidden: !this.isdestinationCode,
|
||||
children: [
|
||||
{
|
||||
prop: 'destinationCodePoint.x',
|
||||
firstLevel: 'destinationCodePoint',
|
||||
secondLevel: 'x',
|
||||
label: 'x:',
|
||||
type: 'number',
|
||||
labelWidth: '20px'
|
||||
},
|
||||
{
|
||||
prop: 'destinationCodePoint.y',
|
||||
firstLevel: 'destinationCodePoint',
|
||||
secondLevel: 'y',
|
||||
label: 'y:',
|
||||
type: 'number',
|
||||
labelWidth: '20px'
|
||||
}
|
||||
]
|
||||
}, // 目的地码坐标
|
||||
{ prop: 'transferTrackName', label: this.$t('map.transferTrackName'), type: 'input', isHidden: !this.istransferTrackName }, // 转换轨名称
|
||||
{ prop: 'transferTrackNamePosition', label: this.$t('map.transferTrackNamePosition'), type: 'coordinate', width: '150px', isHidden: !this.istransferTrackName, children: [
|
||||
{ prop: 'transferTrackNamePosition.x', firstLevel: 'transferTrackNamePosition', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px' },
|
||||
{ prop: 'transferTrackNamePosition.y', firstLevel: 'transferTrackNamePosition', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px' }
|
||||
] }, // 转换轨名称坐标
|
||||
{ prop: 'destinationCode', label: this.$t('map.destinationCode'), type: 'input', isHidden: !this.isdestinationCode }, // 目的地码
|
||||
{ prop: 'destinationCodePoint', label: this.$t('map.destinationCodePoint'), type: 'coordinate', width: '150px', isHidden: !this.isdestinationCode, children: [
|
||||
{ prop: 'destinationCodePoint.x', firstLevel: 'destinationCodePoint', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px' },
|
||||
{ prop: 'destinationCodePoint.y', firstLevel: 'destinationCodePoint', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px' }
|
||||
] }, // 目的地码坐标
|
||||
|
||||
{
|
||||
prop: 'switchSection',
|
||||
label: this.$t('map.isSwitchSection'),
|
||||
type: 'checkbox',
|
||||
disabled: true
|
||||
}, // 是否关联道岔
|
||||
{
|
||||
prop: 'relSwitchCode',
|
||||
label: this.$t('map.relSwitchCode'),
|
||||
type: 'select',
|
||||
optionLabel: 'name&&code',
|
||||
optionValue: 'code',
|
||||
options: this.switchList,
|
||||
isHidden: !this.isRelevanceSwitchShow,
|
||||
disabled: true
|
||||
}, // 关联道岔
|
||||
{ prop: 'switchSection', label: this.$t('map.isSwitchSection'), type: 'checkbox', disabled: true }, // 是否关联道岔
|
||||
{ prop: 'relSwitchCode', label: this.$t('map.relSwitchCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.switchList, isHidden: !this.isRelevanceSwitchShow, disabled: true }, // 关联道岔
|
||||
|
||||
{
|
||||
prop: 'logicSectionShow',
|
||||
label: this.$t('map.displayLogicalExtents'),
|
||||
type: 'checkbox',
|
||||
isHidden: !this.isSwitchSectionType
|
||||
}, // 1
|
||||
{
|
||||
prop: 'logicSectionNameSort',
|
||||
label: this.$t('map.logicSectionNameSort'),
|
||||
type: 'radio',
|
||||
optionLabel: 'label',
|
||||
optionValue: 'value',
|
||||
isHidden: !this.isLogicSectionNameSort,
|
||||
radioList: [
|
||||
{
|
||||
value: true,
|
||||
label: this.$t('map.fromSmallToLarge')
|
||||
},
|
||||
{
|
||||
value: false,
|
||||
label: this.$t('map.fromLargeToSmall')
|
||||
}
|
||||
]
|
||||
}, // 1
|
||||
{
|
||||
prop: 'curve',
|
||||
label: this.$t('map.isCurve'),
|
||||
type: 'checkbox',
|
||||
isHidden: !this.isSwitchSectionType
|
||||
},
|
||||
{
|
||||
prop: 'relevanceSectionList',
|
||||
label: this.$t('map.associateSwitchSection'),
|
||||
type: 'multiSelect',
|
||||
optionLabel: 'name&&code',
|
||||
optionValue: 'code',
|
||||
options: this.switchSectionList,
|
||||
isHidden: this.isSwitchSectionType,
|
||||
disabled: true
|
||||
},
|
||||
{
|
||||
prop: 'leftAxlePosition',
|
||||
label: '左侧计轴:',
|
||||
type: 'select',
|
||||
optionLabel: 'label',
|
||||
optionValue: 'value',
|
||||
options: this.axlePositionList,
|
||||
isHidden: !this.hasAssociatedSection
|
||||
},
|
||||
{
|
||||
prop: 'leftAxleOffset',
|
||||
label: '左侧计轴偏移:',
|
||||
type: 'coordinate',
|
||||
width: '150px',
|
||||
isHidden: !this.hasAssociatedSection,
|
||||
children: [
|
||||
{
|
||||
prop: 'leftAxleOffset.x',
|
||||
firstLevel: 'leftAxleOffset',
|
||||
secondLevel: 'x',
|
||||
label: 'x:',
|
||||
type: 'number',
|
||||
labelWidth: '20px'
|
||||
},
|
||||
{
|
||||
prop: 'leftAxleOffset.y',
|
||||
firstLevel: 'leftAxleOffset',
|
||||
secondLevel: 'y',
|
||||
label: 'y:',
|
||||
type: 'number',
|
||||
labelWidth: '20px'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
prop: 'rightAxlePosition',
|
||||
label: '右侧计轴:',
|
||||
type: 'select',
|
||||
optionLabel: 'label',
|
||||
optionValue: 'value',
|
||||
options: this.axlePositionList,
|
||||
isHidden: !this.hasAssociatedSection
|
||||
},
|
||||
{
|
||||
prop: 'rightAxleOffset',
|
||||
label: '右侧计轴偏移:',
|
||||
type: 'coordinate',
|
||||
width: '150px',
|
||||
isHidden: !this.hasAssociatedSection,
|
||||
children: [
|
||||
{
|
||||
prop: 'rightAxleOffset.x',
|
||||
firstLevel: 'rightAxleOffset',
|
||||
secondLevel: 'x',
|
||||
label: 'x:',
|
||||
type: 'number',
|
||||
labelWidth: '20px'
|
||||
},
|
||||
{
|
||||
prop: 'rightAxleOffset.y',
|
||||
firstLevel: 'rightAxleOffset',
|
||||
secondLevel: 'y',
|
||||
label: 'y:',
|
||||
type: 'number',
|
||||
labelWidth: '20px'
|
||||
}
|
||||
]
|
||||
}
|
||||
{ prop: 'logicSectionShow', label: this.$t('map.displayLogicalExtents'), type: 'checkbox', isHidden: !this.isSwitchSectionType }, // 1
|
||||
{ prop: 'logicSectionNameSort', label: this.$t('map.logicSectionNameSort'), type: 'radio', optionLabel: 'label', optionValue: 'value', isHidden: !this.isLogicSectionNameSort, radioList: [
|
||||
{ value: true, label: this.$t('map.fromSmallToLarge') },
|
||||
{ value: false, label: this.$t('map.fromLargeToSmall') }
|
||||
] }, // 1
|
||||
{ prop: 'curve', label: this.$t('map.isCurve'), type: 'checkbox', isHidden: !this.isSwitchSectionType },
|
||||
{ prop: 'relevanceSectionList', label: this.$t('map.associateSwitchSection'), type: 'multiSelect', optionLabel: 'name&&code', optionValue: 'code', options: this.switchSectionList, isHidden: this.isSwitchSectionType, disabled: true },
|
||||
{ prop: 'leftAxlePosition', label: '左侧计轴:', type: 'select', optionLabel: 'label', optionValue: 'value', options: this.axlePositionList, isHidden: !this.hasAssociatedSection },
|
||||
{ prop: 'leftAxleOffset', label: '左侧计轴偏移:', type: 'coordinate', width: '150px', isHidden: !this.hasAssociatedSection, children: [
|
||||
{ prop: 'leftAxleOffset.x', firstLevel: 'leftAxleOffset', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px' },
|
||||
{ prop: 'leftAxleOffset.y', firstLevel: 'leftAxleOffset', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px' }
|
||||
] },
|
||||
{ prop: 'rightAxlePosition', label: '右侧计轴:', type: 'select', optionLabel: 'label', optionValue: 'value', options: this.axlePositionList, isHidden: !this.hasAssociatedSection },
|
||||
{ prop: 'rightAxleOffset', label: '右侧计轴偏移:', type: 'coordinate', width: '150px', isHidden: !this.hasAssociatedSection, children: [
|
||||
{ prop: 'rightAxleOffset.x', firstLevel: 'rightAxleOffset', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px' },
|
||||
{ prop: 'rightAxleOffset.y', firstLevel: 'rightAxleOffset', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px' }
|
||||
] }
|
||||
]
|
||||
},
|
||||
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.centralizedStationList,
|
||||
isHidden: this.isStationCodeDisabled
|
||||
},
|
||||
{
|
||||
prop: 'belongStation',
|
||||
label: '所属车站:',
|
||||
type: 'select',
|
||||
mode: true,
|
||||
optionLabel: 'name&&code',
|
||||
optionValue: 'code',
|
||||
options: this.stationList,
|
||||
isHidden:
|
||||
!this.editModel.standTrack &&
|
||||
!this.editModel.reentryTrack &&
|
||||
!this.editModel.transferTrack
|
||||
},
|
||||
{
|
||||
prop: 'lengthFact',
|
||||
label: this.$t('map.actualLength') + ':',
|
||||
type: 'number',
|
||||
min: 0,
|
||||
placeholder: this.$t('map.meter'),
|
||||
isHidden: !this.isSwitchSectionType
|
||||
},
|
||||
{
|
||||
prop: 'leftStopPointOffset',
|
||||
label: this.$t('map.leftStopPointOffset'),
|
||||
type: 'number',
|
||||
min: 0,
|
||||
max: this.maxLengthFact,
|
||||
// disabled: true,
|
||||
isHidden: !this.isStopPointOffset
|
||||
}, // 左向停车点偏移量
|
||||
{
|
||||
prop: 'rightStopPointOffset',
|
||||
label: this.$t('map.rightStopPointOffset'),
|
||||
type: 'number',
|
||||
min: 0,
|
||||
max: this.maxLengthFact,
|
||||
// disabled: true,
|
||||
isHidden: !this.isStopPointOffset
|
||||
}, // 右向停车点偏移量
|
||||
{
|
||||
prop: 'region',
|
||||
label: this.$t('map.sectionColon'),
|
||||
type: 'select',
|
||||
optionLabel: 'label',
|
||||
optionValue: 'value',
|
||||
options: this.regionList,
|
||||
isHidden: !this.sectionColonShow
|
||||
},
|
||||
{
|
||||
prop: 'trainWindowCode',
|
||||
label: '关联车次窗',
|
||||
type: 'input',
|
||||
disabled: true,
|
||||
isHidden: !this.isSwitchSectionShow
|
||||
},
|
||||
{
|
||||
prop: 'kmRangeLeft',
|
||||
label: this.$t('map.leftKilometerMark'),
|
||||
type: 'number',
|
||||
min: 0,
|
||||
placeholder: this.$t('map.meter')
|
||||
},
|
||||
{
|
||||
prop: 'kmRangeRight',
|
||||
label: this.$t('map.rightKilometerMark'),
|
||||
type: 'number',
|
||||
min: 0,
|
||||
placeholder: this.$t('map.meter')
|
||||
}
|
||||
{ prop: 'stationCode', label: this.$t('map.equipmentStation') + ':', type: 'select', mode: true, optionLabel: 'name&&code', optionValue: 'code', disabled: this.isStationCodeDisabled, options: this.centralizedStationList, isHidden: this.isStationCodeDisabled },
|
||||
{ prop: 'belongStation', label: '所属车站:', type: 'select', mode: true, optionLabel: 'name&&code', optionValue: 'code', options: this.stationList, isHidden: !this.editModel.standTrack && !this.editModel.reentryTrack && !this.editModel.transferTrack },
|
||||
{ prop: 'lengthFact', label: this.$t('map.actualLength') + ':', type: 'number', min: 0, placeholder: this.$t('map.meter'), isHidden: !this.isSwitchSectionType },
|
||||
{ prop: 'leftStopPointOffset', label: this.$t('map.leftStopPointOffset'), type: 'number', min: 0, max: this.maxLengthFact, isHidden: !this.isStopPointOffset }, // 左向停车点偏移量
|
||||
{ prop: 'rightStopPointOffset', label: this.$t('map.rightStopPointOffset'), type: 'number', min: 0, max: this.maxLengthFact, isHidden: !this.isStopPointOffset }, // 右向停车点偏移量
|
||||
{ prop: 'region', label: this.$t('map.sectionColon'), type: 'select', optionLabel: 'label', optionValue: 'value', options: this.regionList, isHidden: !this.sectionColonShow },
|
||||
{ prop: 'trainWindowCode', label: '关联车次窗', type: 'input', disabled: true, isHidden: !this.isSwitchSectionShow },
|
||||
{ prop: 'kmRangeLeft', label: this.$t('map.leftKilometerMark'), type: 'number', min: 0, placeholder: this.$t('map.meter') },
|
||||
{ prop: 'kmRangeRight', label: this.$t('map.rightKilometerMark'), type: 'number', min: 0, placeholder: this.$t('map.meter') }
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -854,11 +413,7 @@ export default {
|
||||
return this.editModel.type == '01' && this.editModel.standTrack;
|
||||
},
|
||||
isreentryTrackName() {
|
||||
return (
|
||||
this.editModel.type != '02' &&
|
||||
this.editModel.type != '03' &&
|
||||
this.editModel.reentryTrack
|
||||
);
|
||||
return this.editModel.type != '02' && this.editModel.type != '03' && this.editModel.reentryTrack;
|
||||
},
|
||||
istransferTrackName() {
|
||||
return this.editModel.type == '01' && this.editModel.transferTrack;
|
||||
@ -867,26 +422,13 @@ export default {
|
||||
return this.editModel.type == '01' && !this.editModel.reentryTrack;
|
||||
},
|
||||
isReentryTrackShow() {
|
||||
return (
|
||||
this.editModel.type != '02' &&
|
||||
this.editModel.type != '03' &&
|
||||
!this.editModel.transferTrack
|
||||
);
|
||||
return this.editModel.type != '02' && this.editModel.type != '03' && !this.editModel.transferTrack;
|
||||
},
|
||||
isdestinationCode() {
|
||||
return (
|
||||
this.editModel.type != '02' &&
|
||||
this.editModel.type != '03' &&
|
||||
(this.editModel.reentryTrack || this.editModel.transferTrack)
|
||||
);
|
||||
return this.editModel.type != '02' && this.editModel.type != '03' && (this.editModel.reentryTrack || this.editModel.transferTrack);
|
||||
},
|
||||
isStopPointOffset() {
|
||||
return (
|
||||
this.editModel.type !== '04' &&
|
||||
(this.editModel.reentryTrack ||
|
||||
this.editModel.standTrack ||
|
||||
this.editModel.transferTrack)
|
||||
);
|
||||
return this.editModel.type !== '04' && (this.editModel.reentryTrack || this.editModel.standTrack || this.editModel.transferTrack);
|
||||
},
|
||||
|
||||
isLeftSectionButtonShow() {
|
||||
@ -910,15 +452,10 @@ export default {
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
// '$store.state.menuOperation.mapDrawSelectCount': function(val) {
|
||||
// this.deviceSelect(this.selected);
|
||||
// },
|
||||
activeName(val) {
|
||||
if (val === 'four') {
|
||||
if (val == 'four') {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.logicBlock.computedLogicSectionNumList(
|
||||
this.editModel.logicSectionCodeList
|
||||
);
|
||||
this.$refs.logicBlock.computedLogicSectionNumList(this.editModel.logicSectionCodeList);
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -944,10 +481,7 @@ export default {
|
||||
},
|
||||
deviceSelect(selected) {
|
||||
// 判断是否激活选择站台
|
||||
if (
|
||||
selected &&
|
||||
selected._type.toUpperCase() === 'Section'.toUpperCase()
|
||||
) {
|
||||
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
|
||||
if (this.field === 'leftSection') {
|
||||
if (selected.type === '01' || selected.type === '03') {
|
||||
this.editModel.leftSectionCode = selected.code;
|
||||
@ -968,76 +502,46 @@ export default {
|
||||
this.clear();
|
||||
this.activeName = 'first';
|
||||
this.editModel = deepAssign(this.editModel, selected);
|
||||
this.editModel.points = JSON.parse(
|
||||
JSON.stringify(selected.points)
|
||||
);
|
||||
this.editModel.points = JSON.parse(JSON.stringify(selected.points));
|
||||
this.editModel.lengthFact = selected.lengthFact || 0; // 过滤非正常数值
|
||||
this.oldPoint = JSON.parse(JSON.stringify(selected.points));
|
||||
this.oldLeftSectionCode = selected.leftSectionCode;
|
||||
this.oldRightSectionCode = selected.rightSectionCode;
|
||||
this.editModel.leftAxlePosition =
|
||||
selected.leftAxlePosition || 0; // 重置计轴显示
|
||||
this.editModel.rightAxlePosition =
|
||||
selected.rightAxlePosition || 0; // 重置计轴显示
|
||||
this.editModel.leftAxlePosition = selected.leftAxlePosition || 0; // 重置计轴显示
|
||||
this.editModel.rightAxlePosition = selected.rightAxlePosition || 0; // 重置计轴显示
|
||||
this.editModel.belongStation = selected.belongStation || '';
|
||||
if (this.field.toUpperCase() === 'splitSection'.toUpperCase()) {
|
||||
this.$refs.splitOrMerge.addModel.splitOffsetMax = Math.sqrt(
|
||||
new JTriangle(
|
||||
selected.points[0],
|
||||
selected.points[selected.points.length - 1]
|
||||
).abspowz
|
||||
);
|
||||
this.$refs.splitOrMerge.addModel.splitOffset =
|
||||
this.$refs.splitOrMerge.addModel.splitOffsetMax / 2;
|
||||
this.$refs.splitOrMerge.addModel.splitOffsetMax = Math.sqrt(new JTriangle(selected.points[0], selected.points[selected.points.length - 1]).abspowz);
|
||||
this.$refs.splitOrMerge.addModel.splitOffset = this.$refs.splitOrMerge.addModel.splitOffsetMax / 2;
|
||||
this.$refs.splitOrMerge.addModel.code = selected.code;
|
||||
this.activeName = 'three';
|
||||
this.field = '';
|
||||
this.$emit('fieldSelect', '');
|
||||
} else if (
|
||||
this.field.toUpperCase() === 'leftSectionCode'.toUpperCase()
|
||||
) {
|
||||
this.$refs.splitOrMerge.mergeModel.lsectioncode =
|
||||
selected.code;
|
||||
} else if (this.field.toUpperCase() === 'leftSectionCode'.toUpperCase()) {
|
||||
this.$refs.splitOrMerge.mergeModel.lsectioncode = selected.code;
|
||||
this.activeName = 'three';
|
||||
this.field = '';
|
||||
this.$emit('fieldSelect', '');
|
||||
} else if (
|
||||
this.field.toUpperCase() ===
|
||||
'rightSectionCode'.toUpperCase()
|
||||
) {
|
||||
this.$refs.splitOrMerge.mergeModel.rsectioncode =
|
||||
selected.code;
|
||||
} else if (this.field.toUpperCase() === 'rightSectionCode'.toUpperCase()) {
|
||||
this.$refs.splitOrMerge.mergeModel.rsectioncode = selected.code;
|
||||
this.activeName = 'three';
|
||||
this.field = '';
|
||||
this.$emit('fieldSelect', '');
|
||||
} else if (
|
||||
this.field.toUpperCase() === 'getSectionStart'.toUpperCase()
|
||||
) {
|
||||
this.$refs.create.createModel.leftSectionCode =
|
||||
selected.code;
|
||||
} else if (this.field.toUpperCase() === 'getSectionStart'.toUpperCase()) {
|
||||
this.$refs.create.createModel.leftSectionCode = selected.code;
|
||||
this.activeName = 'second';
|
||||
this.field = '';
|
||||
this.$emit('fieldSelect', '');
|
||||
} else if (
|
||||
this.field.toUpperCase() === 'getSectionEnd'.toUpperCase()
|
||||
) {
|
||||
this.$refs.create.createModel.rightSectionCode =
|
||||
selected.code;
|
||||
} else if (this.field.toUpperCase() === 'getSectionEnd'.toUpperCase()) {
|
||||
this.$refs.create.createModel.rightSectionCode = selected.code;
|
||||
this.activeName = 'second';
|
||||
this.field = '';
|
||||
this.$emit('fieldSelect', '');
|
||||
} else if (
|
||||
this.field.toUpperCase() === 'sectionTypeCode'.toUpperCase()
|
||||
) {
|
||||
this.$refs.batchSettings.formModel.modelList.push(
|
||||
selected.code
|
||||
);
|
||||
} else if (this.field.toUpperCase() === 'sectionTypeCode'.toUpperCase()) {
|
||||
this.$refs.batchSettings.formModel.modelList.push(selected.code);
|
||||
this.activeName = 'five';
|
||||
} else if (
|
||||
this.field.toUpperCase() === 'sectionRoadCode'.toUpperCase()
|
||||
) {
|
||||
this.$refs.batchSettings.roadModel.sectionCode =
|
||||
selected.code;
|
||||
} else if (this.field.toUpperCase() === 'sectionRoadCode'.toUpperCase()) {
|
||||
this.$refs.batchSettings.roadModel.sectionCode = selected.code;
|
||||
this.activeName = 'five';
|
||||
}
|
||||
}
|
||||
@ -1103,9 +607,7 @@ export default {
|
||||
if (copySection.code === model.leftSectionCode) {
|
||||
copySection.rightSectionCode = model.code;
|
||||
updataFlag = true;
|
||||
} else if (
|
||||
copySection.code === this.oldLeftSectionCode
|
||||
) {
|
||||
} else if (copySection.code === this.oldLeftSectionCode) {
|
||||
copySection.rightSectionCode = '';
|
||||
updataFlag = true;
|
||||
}
|
||||
@ -1114,9 +616,7 @@ export default {
|
||||
if (copySection.code === model.rightSectionCode) {
|
||||
copySection.leftSectionCode = model.code;
|
||||
updataFlag = true;
|
||||
} else if (
|
||||
copySection.code === this.oldRightSectionCode
|
||||
) {
|
||||
} else if (copySection.code === this.oldRightSectionCode) {
|
||||
copySection.leftSectionCode = '';
|
||||
updataFlag = true;
|
||||
}
|
||||
@ -1137,20 +637,10 @@ export default {
|
||||
}
|
||||
updataFlag = true;
|
||||
}
|
||||
if (
|
||||
this.checkPointsCoincide(
|
||||
this.oldPoint[0],
|
||||
section.points[section.points.length - 1]
|
||||
)
|
||||
) {
|
||||
if (this.checkPointsCoincide(this.oldPoint[0], section.points[section.points.length - 1])) {
|
||||
pointModel.push(copySection);
|
||||
}
|
||||
if (
|
||||
this.checkPointsCoincide(
|
||||
this.oldPoint[this.oldPoint.length - 1],
|
||||
section.points[0]
|
||||
)
|
||||
) {
|
||||
if (this.checkPointsCoincide(this.oldPoint[this.oldPoint.length - 1], section.points[0])) {
|
||||
pointModel.push(copySection);
|
||||
}
|
||||
if (updataFlag) {
|
||||
@ -1159,39 +649,17 @@ export default {
|
||||
}
|
||||
});
|
||||
pointModel.forEach(item => {
|
||||
const slope2 =
|
||||
(item.points[item.points.length - 1].y - item.points[0].y) /
|
||||
(item.points[item.points.length - 1].x - item.points[0].x);
|
||||
if (
|
||||
this.checkPointsCoincide(
|
||||
this.oldPoint[0],
|
||||
item.points[item.points.length - 1]
|
||||
)
|
||||
) {
|
||||
if (
|
||||
(slope1 >= 0 && slope2 >= 0) ||
|
||||
(slope1 <= 0 && slope2 <= 0)
|
||||
) {
|
||||
item.points[item.points.length - 1].x =
|
||||
model.points[0].x;
|
||||
item.points[item.points.length - 1].y =
|
||||
model.points[0].y;
|
||||
const slope2 = (item.points[item.points.length - 1].y - item.points[0].y) / (item.points[item.points.length - 1].x - item.points[0].x);
|
||||
if (this.checkPointsCoincide(this.oldPoint[0], item.points[item.points.length - 1])) {
|
||||
if ((slope1 >= 0 && slope2 >= 0) || (slope1 <= 0 && slope2 <= 0)) {
|
||||
item.points[item.points.length - 1].x = model.points[0].x;
|
||||
item.points[item.points.length - 1].y = model.points[0].y;
|
||||
}
|
||||
}
|
||||
if (
|
||||
this.checkPointsCoincide(
|
||||
this.oldPoint[this.oldPoint.length - 1],
|
||||
item.points[0]
|
||||
)
|
||||
) {
|
||||
if (
|
||||
(slope1 >= 0 && slope2 >= 0) ||
|
||||
(slope1 <= 0 && slope2 <= 0)
|
||||
) {
|
||||
item.points[0].x =
|
||||
model.points[model.points.length - 1].x;
|
||||
item.points[0].y =
|
||||
model.points[model.points.length - 1].y;
|
||||
if (this.checkPointsCoincide(this.oldPoint[this.oldPoint.length - 1], item.points[0])) {
|
||||
if ((slope1 >= 0 && slope2 >= 0) || (slope1 <= 0 && slope2 <= 0)) {
|
||||
item.points[0].x = model.points[model.points.length - 1].x;
|
||||
item.points[0].y = model.points[model.points.length - 1].y;
|
||||
}
|
||||
}
|
||||
models.push(item);
|
||||
@ -1202,10 +670,7 @@ export default {
|
||||
getSectionByCode(code) {
|
||||
// 根据sectionCode 获取深拷贝的section对象
|
||||
if (code) {
|
||||
const section = deepAssign(
|
||||
{},
|
||||
this.$store.getters['map/getDeviceByCode'](code) || {}
|
||||
);
|
||||
const section = deepAssign({}, this.$store.getters['map/getDeviceByCode'](code) || {});
|
||||
if (JSON.stringify(section) !== '{}') {
|
||||
return section;
|
||||
}
|
||||
@ -1219,48 +684,30 @@ export default {
|
||||
// 删除对象
|
||||
deleteObj() {
|
||||
let models = [];
|
||||
const selected = this.$store.getters['map/getDeviceByCode'](
|
||||
this.editModel.code
|
||||
);
|
||||
if (
|
||||
selected &&
|
||||
selected._type.toUpperCase() === 'Section'.toUpperCase()
|
||||
) {
|
||||
const _that = this;
|
||||
this.$confirm(
|
||||
this.$t('tip.confirmDeletion'),
|
||||
this.$t('tip.hint'),
|
||||
{
|
||||
confirmButtonText: this.$t('tip.confirm'),
|
||||
cancelButtonText: this.$t('tip.cancel'),
|
||||
type: 'warning'
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
models.push(deepAssign(selected, { _dispose: true }));
|
||||
const deleteObjAssociatedSection = this.handleDeleteSectionAssociatedSection(
|
||||
selected
|
||||
);
|
||||
models = [...models, ...deleteObjAssociatedSection];
|
||||
_that.$emit('updateMapModel', models);
|
||||
this.clear();
|
||||
_that.deviceSelect();
|
||||
})
|
||||
.catch(error => {
|
||||
console.log(error);
|
||||
_that.$message.info(this.$t('tip.cancelledDelete'));
|
||||
});
|
||||
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
|
||||
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
|
||||
this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
|
||||
confirmButtonText: this.$t('tip.confirm'),
|
||||
cancelButtonText: this.$t('tip.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
models.push(deepAssign(selected, { _dispose: true }));
|
||||
const deleteObjAssociatedSection = this.handleDeleteSectionAssociatedSection(selected);
|
||||
models = [...models, ...deleteObjAssociatedSection];
|
||||
this.$emit('updateMapModel', models);
|
||||
this.clear();
|
||||
this.deviceSelect();
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
this.$message.info(this.$t('tip.cancelledDelete'));
|
||||
});
|
||||
}
|
||||
},
|
||||
// 处理删除对象的左右关联区段
|
||||
handleDeleteSectionAssociatedSection(selected) {
|
||||
const models = [];
|
||||
const delLeftSection = this.getSectionByCode(
|
||||
selected.leftSectionCode
|
||||
);
|
||||
const delRightSection = this.getSectionByCode(
|
||||
selected.rightSectionCode
|
||||
);
|
||||
const delLeftSection = this.getSectionByCode(selected.leftSectionCode);
|
||||
const delRightSection = this.getSectionByCode(selected.rightSectionCode);
|
||||
if (delLeftSection) {
|
||||
delLeftSection.rightSectionCode = '';
|
||||
models.push(delLeftSection);
|
||||
@ -1280,23 +727,7 @@ export default {
|
||||
},
|
||||
checkSectionPointsHasCoincide(points1, points2) {
|
||||
// 校验两区段的左右点是否有重合
|
||||
return (
|
||||
points1.length &&
|
||||
points2.length &&
|
||||
(this.checkPointsCoincide(points1[0], points2[0]) ||
|
||||
this.checkPointsCoincide(
|
||||
points1[0],
|
||||
points2[points2.length - 1]
|
||||
) ||
|
||||
this.checkPointsCoincide(
|
||||
points1[points1.length - 1],
|
||||
points2[points2.length - 1]
|
||||
) ||
|
||||
this.checkPointsCoincide(
|
||||
points1[points1.length - 1],
|
||||
points2[0]
|
||||
))
|
||||
);
|
||||
return (points1.length && points2.length && (this.checkPointsCoincide(points1[0], points2[0]) || this.checkPointsCoincide(points1[0], points2[points2.length - 1]) || this.checkPointsCoincide(points1[points1.length - 1], points2[points2.length - 1]) || this.checkPointsCoincide(points1[points1.length - 1], points2[0])));
|
||||
},
|
||||
tipInfoHandle(list) {
|
||||
if (list.length) {
|
||||
@ -1322,7 +753,6 @@ export default {
|
||||
@import "src/styles/mixin.scss";
|
||||
.coordinate {
|
||||
overflow: hidden;
|
||||
|
||||
.title {
|
||||
text-align: right;
|
||||
font-size: 14px;
|
||||
|
@ -2,24 +2,6 @@
|
||||
<div style="height:100%">
|
||||
<div style="height: calc(100% - 46px);">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||
<!--<el-table :data="tableData" style="width: 80%; margin: 0 auto;">-->
|
||||
<!--<el-table-column :label="$t('map.sectionPolyline')" width="150">-->
|
||||
<!--<template slot-scope="scope">-->
|
||||
<!--<span style="margin-left: 10px">{{ $t('map.aux') }}{{ scope.row.index }}{{ $t('map.sectionLine') }}</span>-->
|
||||
<!--</template>-->
|
||||
<!--</el-table-column>-->
|
||||
<!--<el-table-column :label="$t('map.sectionLogicalNumber')" width="130">-->
|
||||
<!--<template slot-scope="scope">-->
|
||||
<!--<el-input v-model="scope.row.num" size="mini" />-->
|
||||
<!--</template>-->
|
||||
<!--</el-table-column>-->
|
||||
<!--<el-table-column :label="$t('map.operation')">-->
|
||||
<!--<template slot-scope="scope">-->
|
||||
<!--<el-button size="mini" type="danger" @click="handleDelete(scope.$index, scope.row)">{{ $t('map.empty') }}-->
|
||||
<!--</el-button>-->
|
||||
<!--</template>-->
|
||||
<!--</el-table-column>-->
|
||||
<!--</el-table>-->
|
||||
<el-form ref="showDelimiter" label-width="180px" size="mini">
|
||||
<el-form-item label="逻辑区段数量">
|
||||
<el-input-number v-model="logicNum" :min="0" />
|
||||
@ -48,12 +30,6 @@ import { mapGetters } from 'vuex';
|
||||
export default {
|
||||
name: 'LogicBlock',
|
||||
props: {
|
||||
selected: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {};
|
||||
}
|
||||
},
|
||||
editModel:{
|
||||
type:Object,
|
||||
default() {
|
||||
|
@ -351,7 +351,7 @@ export default {
|
||||
relSwitchCode: '',
|
||||
relevanceSectionList: elem.relevanceSectionList,
|
||||
points: [{ x: 0, y: 0 }, { x: 0, y: 0 }],
|
||||
logicSectionNum: [0],
|
||||
logicSectionNum: 0,
|
||||
logicSectionShow: false,
|
||||
sepTypeLeft: '00',
|
||||
offsetLeft: 0,
|
||||
|
Loading…
Reference in New Issue
Block a user