修改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
};
/** ImageControl渲染配置*/
deviceRender[deviceType.ImageControl] = {
_type: deviceType.ImageControl,
/** Resource渲染配置*/
deviceRender[deviceType.Resource] = {
_type: deviceType.Resource,
zlevel: 1
};

View File

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

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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'),

View File

@ -149,9 +149,9 @@
/>
</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
ref="ImageControl"
ref="Resource"
:selected="selected"
@updateMapModel="updateMapModel"
@setCenter="setCenter"

View File

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