Merge branch 'dev' of https://git.code.tencent.com/lian-cbtc/jl-client into dev
This commit is contained in:
commit
949b265e6b
@ -62,13 +62,23 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-if="checkFieldType(item, 'input')">
|
<template v-if="checkFieldType(item, 'input')">
|
||||||
<el-form-item v-if="!item.isHidden" :key="item.prop" :label="item.label" :prop="item.prop" :required="item.required">
|
<el-form-item v-if="!item.isHidden" :key="item.prop" :label="item.label" :prop="item.prop" :required="item.required">
|
||||||
|
<template v-if="item.change">
|
||||||
|
<el-input v-model="formModel[item.prop]" type="text" :disabled="item.disabled" maxlength="30" :show-word-limit="true" @input="item.deviceChange" />
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
<el-input v-model="formModel[item.prop]" type="text" :disabled="item.disabled" maxlength="30" :show-word-limit="true" />
|
<el-input v-model="formModel[item.prop]" type="text" :disabled="item.disabled" maxlength="30" :show-word-limit="true" />
|
||||||
|
</template>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="checkFieldType(item, 'number')">
|
<template v-if="checkFieldType(item, 'number')">
|
||||||
<el-form-item v-if="!item.isHidden" :key="item.prop" :label="item.label" :prop="item.prop" :required="item.required">
|
<el-form-item v-if="!item.isHidden" :key="item.prop" :label="item.label" :prop="item.prop" :required="item.required">
|
||||||
<div v-if="!item.firstLevel">
|
<div v-if="!item.firstLevel">
|
||||||
|
<template v-if="item.change">
|
||||||
|
<el-input-number v-model="formModel[item.prop]" :min="item.min" :max="item.max" :label="item.label" :disabled="item.disabled" style="width: 140px" @change="item.deviceChange" />
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
<el-input-number v-model="formModel[item.prop]" :min="item.min" :max="item.max" :label="item.label" :disabled="item.disabled" style="width: 140px" />
|
<el-input-number v-model="formModel[item.prop]" :min="item.min" :max="item.max" :label="item.label" :disabled="item.disabled" style="width: 140px" />
|
||||||
|
</template>
|
||||||
<span style="padding-left: 1px;">{{ item.placeholder }}</span>
|
<span style="padding-left: 1px;">{{ item.placeholder }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
@ -95,7 +105,12 @@
|
|||||||
<span class="title" :style="{width: item.width}">{{ item.label }}</span>
|
<span class="title" :style="{width: item.width}">{{ item.label }}</span>
|
||||||
<div v-for="opt in item.children" :key="opt.code" class="listWidth">
|
<div v-for="opt in item.children" :key="opt.code" class="listWidth">
|
||||||
<el-form-item :label="opt.label" :prop="opt.prop" :label-width="opt.labelWidth">
|
<el-form-item :label="opt.label" :prop="opt.prop" :label-width="opt.labelWidth">
|
||||||
|
<template v-if="opt.change">
|
||||||
|
<el-input-number v-model="formModel[opt.firstLevel][opt.secondLevel]" :label="opt.label" :disabled="opt.disabled" @change="opt.deviceChange" />
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
<el-input-number v-model="formModel[opt.firstLevel][opt.secondLevel]" :label="opt.label" :disabled="opt.disabled" />
|
<el-input-number v-model="formModel[opt.firstLevel][opt.secondLevel]" :label="opt.label" :disabled="opt.disabled" />
|
||||||
|
</template>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -149,10 +164,17 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="checkFieldType(item, 'checkbox')">
|
<template v-if="checkFieldType(item, 'checkbox')">
|
||||||
|
<template v-if="item.change">
|
||||||
|
<el-form-item v-if="!item.isHidden" :key="item.prop" :label="item.label" :prop="item.prop" :required="item.required">
|
||||||
|
<el-checkbox v-model="formModel[item.prop]" :disabled="item.disabled" @change="item.deviceChange" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
<el-form-item v-if="!item.isHidden" :key="item.prop" :label="item.label" :prop="item.prop" :required="item.required">
|
<el-form-item v-if="!item.isHidden" :key="item.prop" :label="item.label" :prop="item.prop" :required="item.required">
|
||||||
<el-checkbox v-model="formModel[item.prop]" :disabled="item.disabled" />
|
<el-checkbox v-model="formModel[item.prop]" :disabled="item.disabled" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
|
</template>
|
||||||
<template v-if="checkFieldType(item, 'font')">
|
<template v-if="checkFieldType(item, 'font')">
|
||||||
<el-form-item v-if="!item.isHidden" :key="item.prop" :label="item.label" :prop="item.prop" :required="item.required">
|
<el-form-item v-if="!item.isHidden" :key="item.prop" :label="item.label" :prop="item.prop" :required="item.required">
|
||||||
<el-font v-model="formModel[item.prop]" :disabled="item.disabled" :placeholder="item.placeholder" />
|
<el-font v-model="formModel[item.prop]" :disabled="item.disabled" :placeholder="item.placeholder" />
|
||||||
|
@ -224,19 +224,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
var validateLeftSection = (rule, value, callback) => {
|
|
||||||
if (value === '') {
|
|
||||||
callback(new Error('请选择做关联区段'));
|
|
||||||
} else {
|
|
||||||
const leftSection = this.$store.getters['map/getDeviceByCode'](value);
|
|
||||||
if (leftSection.point[0] !== this.selected.point[0]) {
|
|
||||||
callback(new Error('所选择关联区段不相邻!'));
|
|
||||||
} else {
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
return {
|
return {
|
||||||
questionList: [],
|
questionList: [],
|
||||||
activeName: 'first',
|
activeName: 'first',
|
||||||
@ -395,9 +382,9 @@ export default {
|
|||||||
{ prop: 'namePosition.x', firstLevel: 'namePosition', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
|
{ 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: '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: 'leftSection', label: '左关联区段', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.PhysicalSectionList},
|
{ prop: 'leftSection', label: '左关联区段', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.PhysicalSectionList},
|
||||||
{ prop: 'rightSection', label: '右关联区段', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.PhysicalSectionList},
|
{ prop: 'rightSection', label: '右关联区段', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.PhysicalSectionList},
|
||||||
{ prop: 'type', label: this.$t('map.sectionType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SectionTypeList},
|
|
||||||
{ prop: 'parentCode', label: this.$t('map.associatedSection'), type: 'select', mode: true, optionLabel: 'name&&code', optionValue: 'code', disabled: true, options: this.sectionList, isHidden: !this.isParentCode },
|
{ prop: 'parentCode', label: this.$t('map.associatedSection'), type: 'select', mode: true, optionLabel: 'name&&code', optionValue: 'code', disabled: true, options: this.sectionList, isHidden: !this.isParentCode },
|
||||||
|
|
||||||
{ prop: 'isStandTrack', label: this.$t('map.isStandTrack'), type: 'checkbox', isHidden: !this.isStandTrackShow }, // 1
|
{ prop: 'isStandTrack', label: this.$t('map.isStandTrack'), type: 'checkbox', isHidden: !this.isStandTrackShow }, // 1
|
||||||
@ -467,6 +454,22 @@ export default {
|
|||||||
return form;
|
return form;
|
||||||
},
|
},
|
||||||
rules() {
|
rules() {
|
||||||
|
var validateLeftSection = (rule, value, callback) => {
|
||||||
|
const leftSection = this.$store.getters['map/getDeviceByCode'](value);
|
||||||
|
if (leftSection && (leftSection.points[1].x !== this.selected.points[0].x || leftSection.points[1].y !== this.selected.points[0].y )) {
|
||||||
|
callback(new Error('所选择关联区段不相邻!'));
|
||||||
|
} else {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var validateRightSection = (rule, value, callback) => {
|
||||||
|
const rightSection = this.$store.getters['map/getDeviceByCode'](value);
|
||||||
|
if (rightSection && (rightSection.points[0].x !== this.selected.points[1].x || rightSection.points[0].y !== this.selected.points[1].y )) {
|
||||||
|
callback(new Error('所选择关联区段不相邻!'));
|
||||||
|
} else {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
};
|
||||||
const rules = {
|
const rules = {
|
||||||
code: [
|
code: [
|
||||||
{ required: true, message: this.$t('rules.selectEquipment'), trigger: 'change' }
|
{ required: true, message: this.$t('rules.selectEquipment'), trigger: 'change' }
|
||||||
@ -517,10 +520,10 @@ export default {
|
|||||||
{ required: true, message: this.$t('rules.pleaseSelectTrainDir'), trigger: 'change' }
|
{ required: true, message: this.$t('rules.pleaseSelectTrainDir'), trigger: 'change' }
|
||||||
],
|
],
|
||||||
leftSection: [
|
leftSection: [
|
||||||
{ required: this.editModel.type === '01', message: '请选择左关联区段', trigger: 'change' }
|
{ required: this.editModel.type === '01', validator: validateLeftSection, trigger: 'change' }
|
||||||
],
|
],
|
||||||
rightSection: [
|
rightSection: [
|
||||||
{ required: this.editModel.type === '01', message: '请选择右关联区段', trigger: 'change'}
|
{ required: this.editModel.type === '01', validator: validateRightSection, trigger: 'change'}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
return rules;
|
return rules;
|
||||||
@ -530,7 +533,6 @@ export default {
|
|||||||
if (this.sectionList && this.sectionList.length) {
|
if (this.sectionList && this.sectionList.length) {
|
||||||
list = this.sectionList.filter(elem => { return elem.type === '01'; });
|
list = this.sectionList.filter(elem => { return elem.type === '01'; });
|
||||||
}
|
}
|
||||||
list.unshift({code: '', name: '无'});
|
|
||||||
return list;
|
return list;
|
||||||
},
|
},
|
||||||
ReverseSectionList() {
|
ReverseSectionList() {
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="button_box">
|
<div class="button_box">
|
||||||
<el-button-group class="map-draft-group">
|
<el-button-group class="map-draft-group">
|
||||||
<el-button type="primary" size="small" @click="edit">{{ $t('map.updateObj') }}</el-button>
|
<!-- <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>
|
</el-button-group>
|
||||||
</div>
|
</div>
|
||||||
@ -133,24 +133,24 @@ export default {
|
|||||||
name: this.$t('map.drawData'),
|
name: this.$t('map.drawData'),
|
||||||
item: [
|
item: [
|
||||||
{ prop: 'code', label: this.$t('map.relStandCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationStandList, change: true, deviceChange: this.deviceChange },
|
{ prop: 'code', label: this.$t('map.relStandCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationStandList, change: true, deviceChange: this.deviceChange },
|
||||||
{ prop: 'name', label: this.$t('map.stationstandNameColon'), type: 'input' },
|
{ prop: 'name', label: this.$t('map.stationstandNameColon'), type: 'input', change:true, deviceChange:this.updateView },
|
||||||
{ prop: 'position', label: this.$t('map.stationstandPosition'), type: 'coordinate', width: '120px', children: [
|
{ prop: 'position', label: this.$t('map.stationstandPosition'), type: 'coordinate', width: '120px', children: [
|
||||||
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
|
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px', change:true, deviceChange:this.updateView },
|
||||||
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
|
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px', change:true, deviceChange:this.updateView }
|
||||||
] },
|
] },
|
||||||
{ prop: 'direction', label: this.$t('map.stationstandTopBottom'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.RunDirectionTypeList },
|
{ prop: 'direction', label: this.$t('map.stationstandTopBottom'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.RunDirectionTypeList, change: true, deviceChange:this.updateView },
|
||||||
{ prop: 'visible', label: this.$t('map.stationVisible'), type: 'checkbox' },
|
{ prop: 'visible', label: this.$t('map.stationVisible'), type: 'checkbox', change: true, deviceChange: this.updateView},
|
||||||
{ prop: 'doorLocationType', label: this.$t('map.stationstandDirection'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.DoorLocationTypeList },
|
{ prop: 'doorLocationType', label: this.$t('map.stationstandDirection'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.DoorLocationTypeList, change: true, deviceChange:this.updateView },
|
||||||
{ prop: 'hasDoor', label: this.$t('map.stationstandHasDoor'), type: 'checkbox' },
|
{ prop: 'hasDoor', label: this.$t('map.stationstandHasDoor'), type: 'checkbox', change: true, deviceChange:this.updateView },
|
||||||
{ prop: 'width', label: this.$t('map.stationstandWidth'), type: 'number', min: 0, max: 2000, placeholder: 'px' },
|
{ prop: 'width', label: this.$t('map.stationstandWidth'), type: 'number', min: 0, max: 2000, placeholder: 'px', change:true, deviceChange:this.updateView},
|
||||||
{ prop: 'height', label: this.$t('map.stationstandHeight'), type: 'number', min: 0, max: 2000, placeholder: 'px' }
|
{ prop: 'height', label: this.$t('map.stationstandHeight'), type: 'number', min: 0, max: 2000, placeholder: 'px', change:true, deviceChange:this.updateView}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
map: {
|
map: {
|
||||||
name: this.$t('map.mapData'),
|
name: this.$t('map.mapData'),
|
||||||
item: [
|
item: [
|
||||||
{ prop: 'deviceStationCode', label: this.$t('map.equipmentStation'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.stationList },
|
{ prop: 'deviceStationCode', label: this.$t('map.equipmentStation'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.stationList, change: true, deviceChange:this.updateView },
|
||||||
{ prop: 'stationCode', label: this.$t('map.belongsStation'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList }
|
{ prop: 'stationCode', label: this.$t('map.belongsStation'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList, change: true, deviceChange:this.updateView }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -229,6 +229,10 @@ export default {
|
|||||||
deviceChange(code) {
|
deviceChange(code) {
|
||||||
this.$emit('setCenter', code);
|
this.$emit('setCenter', code);
|
||||||
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
|
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
|
||||||
|
this.edit();
|
||||||
|
},
|
||||||
|
updateView() {
|
||||||
|
this.edit();
|
||||||
},
|
},
|
||||||
deviceSelect(selected) {
|
deviceSelect(selected) {
|
||||||
this.$refs.dataform.resetFields();
|
this.$refs.dataform.resetFields();
|
||||||
|
Loading…
Reference in New Issue
Block a user