修改区段创建

This commit is contained in:
zyy 2019-12-03 18:54:20 +08:00
parent 252b0c4cc6
commit 2640a5546f

View File

@ -41,19 +41,9 @@
</el-form-item>
</div>
</div>
<div v-if="createModel.type == '01'" class="coordinate">
<span class="title" style="width: 120px">{{ this.$t('map.endingPoint') }}</span>
<div class="listWidth">
<el-form-item label="x" prop="endPoint.x" label-width="25px">
<el-input-number v-model="createModel.endPoint.x" />
</el-form-item>
</div>
<div class="listWidth">
<el-form-item label="y" prop="endPoint.y" label-width="25px">
<el-input-number v-model="createModel.endPoint.y" />
</el-form-item>
</div>
</div>
<el-form-item v-if="createModel.type == '01'" label="距离长度:" prop="length">
<el-input-number v-model="createModel.length" />
</el-form-item>
<el-form-item v-if="createModel.type == '02'" :label="$t('map.leftAssociatedSection')" prop="leftSectionCode">
<el-select v-model="createModel.leftSectionCode" filterable>
<el-option
@ -330,7 +320,7 @@ export default {
createModel: {
type: '01',
startPoint: { x: 0, y: 0 },
endPoint: { x: 0, y: 0 },
length: 0,
leftSectionCode: '',
rightSectionCode: ''
},
@ -341,11 +331,8 @@ export default {
'startPoint.y': [
{ required: true, message: this.$t('rules.destinationCodePointY'), trigger: 'blur' }
],
'endPoint.x': [
{ required: true, message: this.$t('rules.destinationCodePointX'), trigger: 'blur' }
],
'endPoint.y': [
{ required: true, message: this.$t('rules.destinationCodePointY'), trigger: 'blur' }
'length': [
{ required: true, message: '请填写距离值', trigger: 'blur' }
]
},
typeOptions: [{
@ -822,7 +809,7 @@ export default {
this.editModel.points.splice(index, 1);
this.logicSectionNums.splice(index, 1);
},
//
//
create() {
const uid = getUID('Section');
const model = {
@ -868,7 +855,7 @@ export default {
if (this.createModel.type == '01') {
model.points = [
{ x: this.createModel.startPoint.x, y: this.createModel.startPoint.y },
{ x: this.createModel.endPoint.x, y: this.createModel.endPoint.y }
{ x: this.createModel.startPoint.x + this.createModel.length, y: this.createModel.startPoint.y }
];
} else if (this.createModel.type == '02') {
const startModel = this.$store.getters['map/getDeviceByCode'](this.createModel.leftSectionCode);