diff --git a/src/views/newMap/jlmapNew/index.vue b/src/views/newMap/jlmapNew/index.vue index 5e1ace4dd..830b7cfb3 100644 --- a/src/views/newMap/jlmapNew/index.vue +++ b/src/views/newMap/jlmapNew/index.vue @@ -338,6 +338,7 @@ export default { case 'Delete': this.$store.dispatch('map/setDeleteCount'); break; case 'Update': + debugger; this.$refs.offsetX.focus(); this.$store.dispatch('map/setUpdateCount'); break; diff --git a/src/views/newMap/newMapdraft/mapoperate/ImageControl.vue b/src/views/newMap/newMapdraft/mapoperate/ImageControl.vue index 52628ea4d..6844d1f80 100644 --- a/src/views/newMap/newMapdraft/mapoperate/ImageControl.vue +++ b/src/views/newMap/newMapdraft/mapoperate/ImageControl.vue @@ -194,6 +194,10 @@ export default { }, deleteObj() { this.$refs.dataform.deleteObj(); + }, + // 修改对象 + edit() { + this.$refs.dataform.edit(); } } }; diff --git a/src/views/newMap/newMapdraft/mapoperate/arrow.vue b/src/views/newMap/newMapdraft/mapoperate/arrow.vue index d6fcac61b..7a3187c5a 100644 --- a/src/views/newMap/newMapdraft/mapoperate/arrow.vue +++ b/src/views/newMap/newMapdraft/mapoperate/arrow.vue @@ -79,10 +79,6 @@ export default { const form = { labelWidth: '120px', items: { - code: { - name: '', - item: [] - }, draw: { name: this.$t('map.drawData'), item: [ @@ -127,11 +123,6 @@ export default { return form; } }, - watch: { - '$store.state.map.deleteCount': function (val) { - this.deleteObj(); - } - }, methods: { deviceChange(code) { this.$emit('setCenter', code); @@ -158,6 +149,10 @@ export default { }, deleteObj() { this.$refs.dataform.deleteObj(); + }, + // 修改对象 + edit() { + this.$refs.dataform.edit(); } } }; diff --git a/src/views/newMap/newMapdraft/mapoperate/components/operateProperty.vue b/src/views/newMap/newMapdraft/mapoperate/components/operateProperty.vue index a5fa59a43..dd6dd7755 100644 --- a/src/views/newMap/newMapdraft/mapoperate/components/operateProperty.vue +++ b/src/views/newMap/newMapdraft/mapoperate/components/operateProperty.vue @@ -36,12 +36,20 @@ export default { required:true } }, + data() { + return { + isDeleteHide:true + }; + }, methods:{ // 修改对象 edit() { this.$refs['dataform'].validate((valid) => { if (valid) { const data = Object.assign({_type: this.type}, this.editModel); + if (this.type == 'Text') { + data.content = `${this.editModel.prepend}::${this.editModel.content}`; + } this.$emit('updateMapModel', data); } else { this.$message('还有属性未填写,修改未生效!'); @@ -51,16 +59,32 @@ export default { // 删除对象 deleteObj() { const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code); - if (selected) { + if (selected && this.isDeleteHide) { + this.isDeleteHide = false; this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), { confirmButtonText: this.$t('tip.confirm'), cancelButtonText: this.$t('tip.cancel'), type: 'warning' }).then(() => { - this.$emit('updateMapModel', {...selected, _dispose: true}); + switch (this.type) { + case 'Esp': { + this.$store.dispatch('map/delMapStandData', {models: [selected], type: 'espList'}); + break; + } + case 'StationStand': case 'TrainWindow': { + this.$emit('updateMapModel', selected, true); + break; + } + default : { + this.$emit('updateMapModel', {...selected, _dispose: true}); + break; + } + } this.$refs.dataform && this.$refs.dataform.resetFields(); + this.isDeleteHide = true; }).catch(() => { this.$message.info(this.$t('tip.cancelledDelete')); + this.isDeleteHide = true; }); } }, diff --git a/src/views/newMap/newMapdraft/mapoperate/controlLamp.vue b/src/views/newMap/newMapdraft/mapoperate/controlLamp.vue index bc246f793..65bdca927 100644 --- a/src/views/newMap/newMapdraft/mapoperate/controlLamp.vue +++ b/src/views/newMap/newMapdraft/mapoperate/controlLamp.vue @@ -471,6 +471,10 @@ export default { }, deleteObj() { this.$refs.dataform.deleteObj(); + }, + // 修改对象 + edit() { + this.$refs.dataform.edit(); } } }; diff --git a/src/views/newMap/newMapdraft/mapoperate/counter.vue b/src/views/newMap/newMapdraft/mapoperate/counter.vue index c9ad95e0b..694178c8b 100644 --- a/src/views/newMap/newMapdraft/mapoperate/counter.vue +++ b/src/views/newMap/newMapdraft/mapoperate/counter.vue @@ -191,6 +191,10 @@ export default { }, deleteObj() { this.$refs.dataform.deleteObj(); + }, + // 修改对象 + edit() { + this.$refs.dataform.edit(); } } }; diff --git a/src/views/newMap/newMapdraft/mapoperate/delayunlock.vue b/src/views/newMap/newMapdraft/mapoperate/delayunlock.vue index ac94a72d7..a0aeca576 100644 --- a/src/views/newMap/newMapdraft/mapoperate/delayunlock.vue +++ b/src/views/newMap/newMapdraft/mapoperate/delayunlock.vue @@ -186,6 +186,10 @@ export default { }, deleteObj() { this.$refs.dataform.deleteObj(); + }, + // 修改对象 + edit() { + this.$refs.dataform.edit(); } } }; diff --git a/src/views/newMap/newMapdraft/mapoperate/espDraft.vue b/src/views/newMap/newMapdraft/mapoperate/espDraft.vue index ce4d931a5..2072c3485 100644 --- a/src/views/newMap/newMapdraft/mapoperate/espDraft.vue +++ b/src/views/newMap/newMapdraft/mapoperate/espDraft.vue @@ -1,7 +1,7 @@