diff --git a/src/jmapNew/constant/deviceRender.js b/src/jmapNew/constant/deviceRender.js index 51dfb7f88..90ed42c7b 100644 --- a/src/jmapNew/constant/deviceRender.js +++ b/src/jmapNew/constant/deviceRender.js @@ -44,9 +44,9 @@ deviceRender[deviceType.StationControl] = { zlevel: 1 }; -/** ImageControl渲染配置*/ -deviceRender[deviceType.ImageControl] = { - _type: deviceType.ImageControl, +/** Resource渲染配置*/ +deviceRender[deviceType.Resource] = { + _type: deviceType.Resource, zlevel: 1 }; diff --git a/src/jmapNew/constant/deviceType.js b/src/jmapNew/constant/deviceType.js index 0ab40afc5..ca259fc90 100644 --- a/src/jmapNew/constant/deviceType.js +++ b/src/jmapNew/constant/deviceType.js @@ -5,7 +5,7 @@ const deviceType = { ZcControl: 'ZcControl', LcControl: 'LcControl', LimitControl: 'LimitControl', - ImageControl: 'ImageControl', + Resource: 'Resource', Station: 'Station', StationStand: 'StationStand', Esp: 'Esp', diff --git a/src/jmapNew/shape/ImageControl/index.js b/src/jmapNew/shape/Resource/index.js similarity index 97% rename from src/jmapNew/shape/ImageControl/index.js rename to src/jmapNew/shape/Resource/index.js index c00ba0664..27d37e290 100644 --- a/src/jmapNew/shape/ImageControl/index.js +++ b/src/jmapNew/shape/Resource/index.js @@ -4,7 +4,7 @@ import Group from 'zrender/src/container/Group'; import Image from 'zrender/src/graphic/Image'; -export default class ImageControl extends Group { +export default class Resource extends Group { constructor(model, style) { super(); this._code = model.code; diff --git a/src/jmapNew/shape/factory.js b/src/jmapNew/shape/factory.js index 005681284..56a2cc918 100644 --- a/src/jmapNew/shape/factory.js +++ b/src/jmapNew/shape/factory.js @@ -2,7 +2,7 @@ import deviceType from '../constant/deviceType'; import Section from './Section/index.js'; import Signal from './Signal/index.js'; import Station from './Station/index.js'; -import ImageControl from './ImageControl/index.js'; +import Resource from './Resource/index.js'; import LcControl from './LcControl/index.js'; import LimitControl from './LimitControl/index.js'; import Switch from './Switch/index.js'; @@ -22,7 +22,7 @@ const mapShape = {}; mapShape[deviceType.Section] = Section; mapShape[deviceType.Signal] = Signal; mapShape[deviceType.Station] = Station; -mapShape[deviceType.ImageControl] = ImageControl; +mapShape[deviceType.Resource] = Resource; mapShape[deviceType.LcControl] = LcControl; mapShape[deviceType.LimitControl] = LimitControl; mapShape[deviceType.Switch] = Switch; diff --git a/src/jmapNew/utils/parser.js b/src/jmapNew/utils/parser.js index bfd6778f0..b3be0c230 100644 --- a/src/jmapNew/utils/parser.js +++ b/src/jmapNew/utils/parser.js @@ -100,7 +100,7 @@ export function parser(data, skinCode) { }, this); zrUtil.each(data.resourceList || [], elem => { - mapDevice[elem.code] = createDevice(deviceType.ImageControl, elem, propConvert); + mapDevice[elem.code] = createDevice(deviceType.Resource, elem, propConvert); }, this); zrUtil.each(data.trainList || [], elem => { @@ -198,7 +198,7 @@ export function updateMapData(state, model) { case deviceType.StationDelayUnlock:updateForList(model, state, 'stationDelayUnlockList'); break; case deviceType.LcControl: updateForList(model, state, 'lcControlList'); break; case deviceType.LimitControl: updateForList(model, state, 'tempSpeedLimitList'); break; - case deviceType.ImageControl: updateForList(model, state, 'imageControl'); break; + case deviceType.Resource: updateForList(model, state, 'resourceList'); break; case deviceType.Train: updateForList(model, state, 'trainList'); break; case deviceType.TrainWindow: updateForList(model, state, 'trainWindowList'); break; case deviceType.Line: updateForList(model, state, 'lineList'); break; diff --git a/src/views/newMap/newMapdraft/mapoperate/ImageControl.vue b/src/views/newMap/newMapdraft/mapoperate/ImageControl.vue index dba2ffe0f..4d8c78a84 100644 --- a/src/views/newMap/newMapdraft/mapoperate/ImageControl.vue +++ b/src/views/newMap/newMapdraft/mapoperate/ImageControl.vue @@ -36,7 +36,7 @@ import ConfigData from './config/data'; import { deepAssign } from '@/utils/index'; export default { - name: 'ImageControlDraft', + name: 'ResourceDraft', components: { ConfigList, ConfigData @@ -185,7 +185,7 @@ export default { deviceSelect(selected) { this.$refs.form.resetFields(); this.$refs.make.resetFields(); - if (selected && selected._type.toUpperCase() === 'ImageControl'.toUpperCase()) { + if (selected && selected._type.toUpperCase() === 'Resource'.toUpperCase()) { this.activeName = 'first'; this.editModel = deepAssign(this.editModel, selected); } @@ -193,9 +193,9 @@ export default { create() { this.$refs.make.validate((valid) => { if (valid) { - const uid = getUID('ImageControl', this.resourceList); + const uid = getUID('Resource', this.resourceList); const model = { - _type: 'ImageControl', + _type: 'Resource', code: uid, name: uid, width: this.addModel.width, @@ -216,7 +216,7 @@ export default { edit() { this.$refs['form'].validate((valid) => { if (valid) { - const data = Object.assign({_type: 'ImageControl'}, this.editModel); + const data = Object.assign({_type: 'Resource'}, this.editModel); this.$emit('updateMapModel', data); } }); @@ -224,7 +224,7 @@ export default { // 删除对象 deleteObj() { const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code); - if (selected && selected._type.toUpperCase() === 'ImageControl'.toUpperCase()) { + if (selected && selected._type.toUpperCase() === 'Resource'.toUpperCase()) { const _that = this; this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), { confirmButtonText: this.$t('map.confirm'), diff --git a/src/views/newMap/newMapdraft/mapoperate/index.vue b/src/views/newMap/newMapdraft/mapoperate/index.vue index bcdab2a72..d4143dd55 100644 --- a/src/views/newMap/newMapdraft/mapoperate/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/index.vue @@ -149,9 +149,9 @@ /> --> - +