From 9e6cb0788db1e5d4ad689c26753bfb3bde5385e2 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Thu, 5 Aug 2021 16:33:31 +0800 Subject: [PATCH] =?UTF-8?q?IB=20=E5=BA=94=E7=AD=94=E5=99=A8=20=E6=94=BE?= =?UTF-8?q?=E5=BC=80=E5=85=B3=E8=81=94=E4=BF=A1=E5=8F=B7=E6=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapoperate/responder/responderCreate.vue | 34 +++++++------- .../mapoperate/responder/responderModel.vue | 44 +++++++++---------- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/src/views/newMap/newMapdraft/mapoperate/responder/responderCreate.vue b/src/views/newMap/newMapdraft/mapoperate/responder/responderCreate.vue index 41c6d6cd0..34f4a8466 100644 --- a/src/views/newMap/newMapdraft/mapoperate/responder/responderCreate.vue +++ b/src/views/newMap/newMapdraft/mapoperate/responder/responderCreate.vue @@ -34,11 +34,11 @@ export default { sectionList: { type: Array, required: true - }, - signalList: { + }, + signalList: { type: Array, required: true - }, + }, responderList: { type: Array, required: true @@ -49,8 +49,8 @@ export default { addModel: { type: '', name: '', - sectionCode: '', - signalCode: '' + sectionCode: '', + signalCode: '' }, rules: { name: [ @@ -61,20 +61,20 @@ export default { ], sectionCode: [ { required: true, message: '请关联物理区段', trigger: 'blur' } - ], - signalCode: [ + ], + signalCode: [ { required: true, message: '请关联信号机', trigger: 'blur' } - ] + ] } }; }, computed: { isSectionButtonType() { return this.field == 'RelSectionCode'; - }, - isSignalButtonType() { + }, + isSignalButtonType() { return this.field == 'RelSignalCode'; - }, + }, createForm() { const form = { labelWidth: '110px', @@ -84,8 +84,8 @@ export default { item: [ { prop: 'name', label: '应答器名称', type: 'input' }, { prop: 'type', label: `应答器类型`, type: 'select', optionLabel: 'name&&value', optionValue: 'value', options: this.responderTypeList }, - { prop: 'sectionCode', label: '关联区段', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.sectionList, buttonType: 'RelSectionCode', hover: this.hover, buttonShowType: this.isSectionButtonType }, - { prop: 'signalCode', label: '关联信号机', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.signalList, buttonType: 'RelSignalCode', hover: this.hover, buttonShowType: this.isSignalButtonType }, + { prop: 'sectionCode', label: '关联区段', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.sectionList, buttonType: 'RelSectionCode', hover: this.hover, buttonShowType: this.isSectionButtonType }, + { prop: 'signalCode', label: '关联信号机', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.signalList, buttonType: 'RelSignalCode', hover: this.hover, buttonShowType: this.isSignalButtonType } ] } } @@ -101,10 +101,10 @@ export default { this.addModel[prop] = selected.code; }, create() { - const section = this.$store.getters['map/getDeviceByCode'](this.addModel.sectionCode); - const length = section.points.length; - const x = (section.points[length - 1].x + section.points[0].x) / 2; - const y = (section.points[length - 1].y + section.points[0].y) / 2; + const section = this.$store.getters['map/getDeviceByCode'](this.addModel.sectionCode); + const length = section.points.length; + const x = (section.points[length - 1].x + section.points[0].x) / 2; + const y = (section.points[length - 1].y + section.points[0].y) / 2; const model = utils.buildModelBySection(section, {x, y}, this.addModel, this.responderList); this.$refs.createForm.resetForm(); this.$emit('updateMapModel', model); diff --git a/src/views/newMap/newMapdraft/mapoperate/responder/responderModel.vue b/src/views/newMap/newMapdraft/mapoperate/responder/responderModel.vue index b1f78e751..6f9ebfdea 100644 --- a/src/views/newMap/newMapdraft/mapoperate/responder/responderModel.vue +++ b/src/views/newMap/newMapdraft/mapoperate/responder/responderModel.vue @@ -37,11 +37,11 @@ export default { sectionList: { type: Array, required: true - }, - signalList: { - type: Array, - required: true - }, + }, + signalList: { + type: Array, + required: true + }, responderList: { type: Array, required: true @@ -69,8 +69,8 @@ export default { }, offset: 0, sectionCode: '', - stationCode: '', - signalCode: '' + stationCode: '', + signalCode: '' }, rules: { code: [ @@ -93,10 +93,10 @@ export default { ], sectionCode: [ { required: true, message: '请关联物理区段', trigger: 'blur' } - ], - signalCode: [ + ], + signalCode: [ { required: true, message: '请关联信号机', trigger: 'blur' } - ], + ], 'position.x': [ { required: true, message: '请输入应答器坐标x', trigger: 'blur' } ], @@ -113,10 +113,10 @@ export default { }; }, computed: { - isSectionButtonType() { + isSectionButtonType() { return this.field == 'RelModelSectionCode'; - }, - isSignalButtonType() { + }, + isSignalButtonType() { return this.field == 'RelModelSignalCode'; }, form() { @@ -144,9 +144,9 @@ export default { { prop: 'textOffset.y', firstLevel: 'textOffset', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px', disabled: false } ] }, { prop:'textRotate', label: '文字旋转', type: 'number' }, - { prop: 'sectionCode', label: '关联区段', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.sectionList, buttonType: 'RelModelSectionCode', hover: this.hover, buttonShowType: this.isSectionButtonType }, - this.editModel.type === 'VB'? { prop: 'signalCode', label: '关联信号机', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.signalList, buttonType: 'RelModelSignalCode', hover: this.hover, buttonShowType: this.isSignalButtonType } :'', - { prop: 'stationCode', label: '关联集中站' + ':', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.centralizedStationList } + { prop: 'sectionCode', label: '关联区段', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.sectionList, buttonType: 'RelModelSectionCode', hover: this.hover, buttonShowType: this.isSectionButtonType }, + this.editModel.type === 'VB' || this.editModel.type === 'IB' ? { prop: 'signalCode', label: '关联信号机', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.signalList, buttonType: 'RelModelSignalCode', hover: this.hover, buttonShowType: this.isSignalButtonType } : '', + { prop: 'stationCode', label: '关联集中站' + ':', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.centralizedStationList } ] }, map: { @@ -160,14 +160,14 @@ export default { } }, methods: { - hover(field) { + hover(field) { this.$emit('hover', field); - }, - setModelProp(selected, prop) { - this.editModel[prop] = selected.code; - }, + }, + setModelProp(selected, prop) { + this.editModel[prop] = selected.code; + }, setModel(selected) { - if (!selected.signalCode) selected.signalCode = ''; + if (!selected.signalCode) selected.signalCode = ''; this.editModel = deepAssign(this.editModel, selected); }, deviceChange(code) {