@@ -29,14 +28,14 @@ import ConstConfig from '@/scripts/ConstConfig';
import Cookies from 'js-cookie';
import { mapGetters } from 'vuex';
import { getUID } from '@/jmapNew/utils/Uid';
-import ConfigList from './config/list';
+import OperateProperty from './components/operateProperty';
import ConfigData from './config/data';
import { deepAssign } from '@/utils/index';
export default {
name: 'StationStandDraft',
components: {
- ConfigList,
+ OperateProperty,
ConfigData
},
props: {
@@ -150,7 +149,7 @@ export default {
deviceSelect(selected) {
this.$refs.form && this.$refs.form.resetFields();
this.$refs.createForm && this.$refs.createForm.resetFields();
- if (selected && selected._type.toUpperCase() === 'Line'.toUpperCase()) {
+ if (selected && selected._type.toUpperCase() === 'Arrow'.toUpperCase()) {
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
}
@@ -189,30 +188,11 @@ export default {
}
});
},
- // 修改对象
- edit() {
- this.$refs['form'].validate((valid) => {
- if (valid) {
- const data = Object.assign({_type: 'Line'}, this.editModel);
- this.$emit('updateMapModel', data);
- }
- });
+ updateMapModel(data) {
+ this.$emit('updateMapModel', data);
},
- // 删除对象
- deleteObj() {
- const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
- if (selected && selected._type.toUpperCase() === 'Line'.toUpperCase()) {
- 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});
- this.$refs.form && this.$refs.form.resetFields();
- }).catch(() => {
- this.$message.info(this.$t('tip.cancelledDelete'));
- });
- }
+ resetData() {
+ this.$refs.form && this.$refs.form.resetFields();
}
}
};
diff --git a/src/views/newMap/newMapdraft/mapoperate/components/operateProperty.vue b/src/views/newMap/newMapdraft/mapoperate/components/operateProperty.vue
new file mode 100644
index 000000000..a5064d8c9
--- /dev/null
+++ b/src/views/newMap/newMapdraft/mapoperate/components/operateProperty.vue
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+ {{ $t('map.updateObj') }}
+ {{ $t('map.deleteObj') }}
+
+
+
+
+
diff --git a/src/views/newMap/newMapdraft/mapoperate/controlLamp.vue b/src/views/newMap/newMapdraft/mapoperate/controlLamp.vue
index d98c3d005..54a22b25a 100644
--- a/src/views/newMap/newMapdraft/mapoperate/controlLamp.vue
+++ b/src/views/newMap/newMapdraft/mapoperate/controlLamp.vue
@@ -1,15 +1,14 @@
-
-
-
-
-
- {{ $t('map.updateObj') }}
- {{ $t('map.deleteObj') }}
-
-
+
@@ -30,14 +29,14 @@