修改imagecontrol 为 resource

This commit is contained in:
joylink_cuiweidong 2019-12-23 10:53:25 +08:00
parent 882bb44fb2
commit 6d959b816b
8 changed files with 18 additions and 18 deletions

View File

@ -44,9 +44,9 @@ deviceRender[deviceType.StationControl] = {
zlevel: 1 zlevel: 1
}; };
/** ImageControl渲染配置*/ /** Resource渲染配置*/
deviceRender[deviceType.ImageControl] = { deviceRender[deviceType.Resource] = {
_type: deviceType.ImageControl, _type: deviceType.Resource,
zlevel: 1 zlevel: 1
}; };

View File

@ -5,7 +5,7 @@ const deviceType = {
ZcControl: 'ZcControl', ZcControl: 'ZcControl',
LcControl: 'LcControl', LcControl: 'LcControl',
LimitControl: 'LimitControl', LimitControl: 'LimitControl',
ImageControl: 'ImageControl', Resource: 'Resource',
Station: 'Station', Station: 'Station',
StationStand: 'StationStand', StationStand: 'StationStand',
Esp: 'Esp', Esp: 'Esp',

View File

@ -4,7 +4,7 @@
import Group from 'zrender/src/container/Group'; import Group from 'zrender/src/container/Group';
import Image from 'zrender/src/graphic/Image'; import Image from 'zrender/src/graphic/Image';
export default class ImageControl extends Group { export default class Resource extends Group {
constructor(model, style) { constructor(model, style) {
super(); super();
this._code = model.code; this._code = model.code;

View File

@ -2,7 +2,7 @@ import deviceType from '../constant/deviceType';
import Section from './Section/index.js'; import Section from './Section/index.js';
import Signal from './Signal/index.js'; import Signal from './Signal/index.js';
import Station from './Station/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 LcControl from './LcControl/index.js';
import LimitControl from './LimitControl/index.js'; import LimitControl from './LimitControl/index.js';
import Switch from './Switch/index.js'; import Switch from './Switch/index.js';
@ -22,7 +22,7 @@ const mapShape = {};
mapShape[deviceType.Section] = Section; mapShape[deviceType.Section] = Section;
mapShape[deviceType.Signal] = Signal; mapShape[deviceType.Signal] = Signal;
mapShape[deviceType.Station] = Station; mapShape[deviceType.Station] = Station;
mapShape[deviceType.ImageControl] = ImageControl; mapShape[deviceType.Resource] = Resource;
mapShape[deviceType.LcControl] = LcControl; mapShape[deviceType.LcControl] = LcControl;
mapShape[deviceType.LimitControl] = LimitControl; mapShape[deviceType.LimitControl] = LimitControl;
mapShape[deviceType.Switch] = Switch; mapShape[deviceType.Switch] = Switch;

View File

@ -100,7 +100,7 @@ export function parser(data, skinCode) {
}, this); }, this);
zrUtil.each(data.resourceList || [], elem => { zrUtil.each(data.resourceList || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.ImageControl, elem, propConvert); mapDevice[elem.code] = createDevice(deviceType.Resource, elem, propConvert);
}, this); }, this);
zrUtil.each(data.trainList || [], elem => { zrUtil.each(data.trainList || [], elem => {
@ -198,7 +198,7 @@ export function updateMapData(state, model) {
case deviceType.StationDelayUnlock:updateForList(model, state, 'stationDelayUnlockList'); break; case deviceType.StationDelayUnlock:updateForList(model, state, 'stationDelayUnlockList'); break;
case deviceType.LcControl: updateForList(model, state, 'lcControlList'); break; case deviceType.LcControl: updateForList(model, state, 'lcControlList'); break;
case deviceType.LimitControl: updateForList(model, state, 'tempSpeedLimitList'); 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.Train: updateForList(model, state, 'trainList'); break;
case deviceType.TrainWindow: updateForList(model, state, 'trainWindowList'); break; case deviceType.TrainWindow: updateForList(model, state, 'trainWindowList'); break;
case deviceType.Line: updateForList(model, state, 'lineList'); break; case deviceType.Line: updateForList(model, state, 'lineList'); break;

View File

@ -36,7 +36,7 @@ import ConfigData from './config/data';
import { deepAssign } from '@/utils/index'; import { deepAssign } from '@/utils/index';
export default { export default {
name: 'ImageControlDraft', name: 'ResourceDraft',
components: { components: {
ConfigList, ConfigList,
ConfigData ConfigData
@ -185,7 +185,7 @@ export default {
deviceSelect(selected) { deviceSelect(selected) {
this.$refs.form.resetFields(); this.$refs.form.resetFields();
this.$refs.make.resetFields(); this.$refs.make.resetFields();
if (selected && selected._type.toUpperCase() === 'ImageControl'.toUpperCase()) { if (selected && selected._type.toUpperCase() === 'Resource'.toUpperCase()) {
this.activeName = 'first'; this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected); this.editModel = deepAssign(this.editModel, selected);
} }
@ -193,9 +193,9 @@ export default {
create() { create() {
this.$refs.make.validate((valid) => { this.$refs.make.validate((valid) => {
if (valid) { if (valid) {
const uid = getUID('ImageControl', this.resourceList); const uid = getUID('Resource', this.resourceList);
const model = { const model = {
_type: 'ImageControl', _type: 'Resource',
code: uid, code: uid,
name: uid, name: uid,
width: this.addModel.width, width: this.addModel.width,
@ -216,7 +216,7 @@ export default {
edit() { edit() {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
const data = Object.assign({_type: 'ImageControl'}, this.editModel); const data = Object.assign({_type: 'Resource'}, this.editModel);
this.$emit('updateMapModel', data); this.$emit('updateMapModel', data);
} }
}); });
@ -224,7 +224,7 @@ export default {
// //
deleteObj() { deleteObj() {
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code); 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; const _that = this;
this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), { this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
confirmButtonText: this.$t('map.confirm'), confirmButtonText: this.$t('map.confirm'),

View File

@ -149,9 +149,9 @@
/> />
</el-tab-pane> --> </el-tab-pane> -->
<el-tab-pane :label="$t('map.image')" class="tab_pane_box" name="ImageControl"> <el-tab-pane :label="$t('map.image')" class="tab_pane_box" name="Resource">
<Image-control-draft <Image-control-draft
ref="ImageControl" ref="Resource"
:selected="selected" :selected="selected"
@updateMapModel="updateMapModel" @updateMapModel="updateMapModel"
@setCenter="setCenter" @setCenter="setCenter"

View File

@ -319,7 +319,7 @@ export default {
signalModel.sectionCode = section.code; signalModel.sectionCode = section.code;
} }
if (!section.code) { if (!section.code) {
this.questionList.push(`${item.name} 信号机位置可能不正确,请手动调试归属区段及偏移量.`); this.questionList.push(`${item.name}(${item.code}) 信号机位置可能不正确,请手动调试归属区段及偏移量.`);
} }
signalModel.sectionOffset = this.addModel.number; signalModel.sectionOffset = this.addModel.number;
if (signalModel.right) { if (signalModel.right) {