diff --git a/src/jmapNew/config/skinCode/datie_ksk.js b/src/jmapNew/config/skinCode/datie_ksk.js
index 92baa8010..96a9d916d 100644
--- a/src/jmapNew/config/skinCode/datie_ksk.js
+++ b/src/jmapNew/config/skinCode/datie_ksk.js
@@ -264,7 +264,9 @@ class SkinCode extends defaultStyle {
showName: true,
selectColor: '#0000ff',
flashingColor: '#ffff00',
- countOffset: { x: 0, y: -15 }
+ countOffset: { x: 0, y: -15 },
+ typeList: ['PICK_ASSIST', 'DEPART_ASSIST', 'ASSIST', 'GUIDELOCK', 'SECTION_FAULT_UNLOCK', 'LOCATE', 'REVERSE', 'CANCEL', 'HUMAN_RELEASE_ROUTE', 'MONOLOCK',
+ 'UNLOCK', 'BLOCK', 'UNBLOCK', 'CHANGE_DIRECTION', 'ACCIDENT', 'RECOVERY', 'OCCLUSION', 'FAULT_NOTICE', 'GUIDE']
};
this[deviceType.SwitchFault] = {
text: {
@@ -1186,6 +1188,10 @@ class SkinCode extends defaultStyle {
lineWidth: 3
}
};
+ this[deviceType.Counter] = {
+ fontSize: 11,
+ defaultColor: '#fff'
+ };
}
}
diff --git a/src/jmapNew/constant/deviceRender.js b/src/jmapNew/constant/deviceRender.js
index 25cd04bd1..19d6604bc 100644
--- a/src/jmapNew/constant/deviceRender.js
+++ b/src/jmapNew/constant/deviceRender.js
@@ -343,4 +343,8 @@ deviceRender[deviceType.NoStatusLamp] = {
_type: deviceType.NoStatusLamp,
zlevel: 1
};
+deviceRender[deviceType.Counter] = {
+ _type: deviceType.Counter,
+ zlevel: 1
+};
export default deviceRender;
diff --git a/src/jmapNew/constant/deviceType.js b/src/jmapNew/constant/deviceType.js
index 05ec80d13..acbf522e8 100644
--- a/src/jmapNew/constant/deviceType.js
+++ b/src/jmapNew/constant/deviceType.js
@@ -62,6 +62,7 @@ const deviceType = {
AssistStatus: 'AssistStatus',
SectionOccupied: 'SectionOccupied',
ThroatRoute: 'ThroatRoute',
- NoStatusLamp: 'NoStatusLamp'
+ NoStatusLamp: 'NoStatusLamp',
+ Counter: 'Counter'
};
export default deviceType;
diff --git a/src/jmapNew/options.js b/src/jmapNew/options.js
index b8840f9a2..1e4fb43a2 100644
--- a/src/jmapNew/options.js
+++ b/src/jmapNew/options.js
@@ -1,26 +1,29 @@
class Options {
constructor(opts, trigger) {
this.scaleIndex = 0;
- this.scaleList = [
- 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9,
- 1, 1.2, 1.4, 1.6, 1.8,
- 2, 2.2, 2.4, 2.6, 2.8,
- 3, 3.2, 3.4, 3.6, 3.8,
- 4, 4.2, 4.4, 4.6, 4.8,
- 5, 5.2, 5.4, 5.6, 5.8,
- 6, 6.2, 6.4, 6.6, 6.8,
- 7, 7.2, 7.4, 7.6, 7.8,
- 8
- ];
+ // this.scaleList = [
+ // 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9,
+ // 1, 1.2, 1.4, 1.6, 1.8,
+ // 2, 2.2, 2.4, 2.6, 2.8,
+ // 3, 3.2, 3.4, 3.6, 3.8,
+ // 4, 4.2, 4.4, 4.6, 4.8,
+ // 5, 5.2, 5.4, 5.6, 5.8,
+ // 6, 6.2, 6.4, 6.6, 6.8,
+ // 7, 7.2, 7.4, 7.6, 7.8,
+ // 8
+ // ];
+ this.minScale = 0.1;
+ this.maxScale = 10;
if (Number.isFinite(opts.scaleRate)) {
- const idx = this.scaleList.indexOf(opts.scaleRate);
+ // const idx = this.scaleList.indexOf(opts.scaleRate);
+ const idx = opts.scaleRate * 20;
if (idx >= 0) {
this.scaleIndex = idx;
}
}
- this.scaleRate = opts.scaleRate || this.scaleList[this.scaleIndex]; // 缩放比例
+ this.scaleRate = opts.scaleRate || this.scaleIndex * 0.05; // 缩放比例
this.offsetX = opts.offsetX || 0; // x偏移
@@ -56,16 +59,19 @@ class Options {
if (Number.isFinite(payload.scale)) {
if (Number.isFinite(payload.scale)) {
- if ((this.scaleIndex + payload.scale) >= 0 && (this.scaleIndex + payload.scale) < this.scaleList.length) {
- this.scaleIndex = this.scaleIndex + payload.scale;
+ // if ((this.scaleIndex + payload.scale) >= 0 && (this.scaleIndex + payload.scale) < this.scaleList.length) {
+ // this.scaleIndex = this.scaleIndex + payload.scale;
+ // }
+ if ((payload.scale + this.scaleIndex >= 2) && (payload.scale + this.scaleIndex <= 200)) {
+ this.scaleIndex = payload.scale + this.scaleIndex;
}
}
- this.scaleRate = this.scaleList[this.scaleIndex];
+ this.scaleRate = (this.scaleIndex * 0.05).toFixed(2);
}
if (Number.isFinite(payload.scaleRate)) {
- const idx = this.scaleList.indexOf(payload.scaleRate);
- if (idx < 0) {
+ const idx = payload.scaleRate * 20;
+ if (idx < 2 || idx > 200) {
return;
}
this.scaleIndex = idx;
@@ -89,11 +95,11 @@ class Options {
getScaleRate(scale) {
if (Number.isFinite(scale)) {
- if ((this.scaleIndex + scale) >= 0 && (this.scaleIndex + scale) < this.scaleList.length) {
- return this.scaleList[this.scaleIndex + scale];
+ if (( scale + this.scaleIndex) >= 2 && (scale + this.scaleIndex) <= 200) {
+ return ((scale + this.scaleIndex) * 0.05).toFixed(2);
}
}
- return this.scaleList[this.scaleIndex];
+ return (this.scaleIndex * 0.05).toFixed(2);
}
}
diff --git a/src/jmapNew/parser/parser-graph.js b/src/jmapNew/parser/parser-graph.js
index fe47dd3f2..a1fdfc591 100644
--- a/src/jmapNew/parser/parser-graph.js
+++ b/src/jmapNew/parser/parser-graph.js
@@ -361,6 +361,7 @@ export function updateMapData(state, model) {
case deviceType.SectionOccupied: updateForList(model, state, 'indicatorLightList'); break;
case deviceType.ThroatRoute: updateForList(model, state, 'indicatorLightList'); break;
case deviceType.NoStatusLamp: updateForList(model, state, 'indicatorLightList'); break;
+ case deviceType.Counter: updateForList(model, state, 'indicatorLightList'); break;
case deviceType.SplitStation: updateForList(model, state, 'splitStationList'); break;
case deviceType.Arrow: updateForList(model, state, 'arrowList'); break;
case deviceType.Power: updateForList(model, state, 'powerLineList'); break;
diff --git a/src/jmapNew/shape/graph/SaidLamp/ECounter.js b/src/jmapNew/shape/graph/SaidLamp/ECounter.js
new file mode 100644
index 000000000..3c171a877
--- /dev/null
+++ b/src/jmapNew/shape/graph/SaidLamp/ECounter.js
@@ -0,0 +1,57 @@
+import Group from 'zrender/src/container/Group';
+import Text from 'zrender/src/graphic/Text';
+
+export default class ECounter extends Group {
+ constructor(model) {
+ super();
+ this.model = model;
+ this.zlevel = model.zlevel;
+ this._subType = model._subType;
+ this.z = model.z;
+ this.onmouseover = model.mouseover;
+ this.onmouseout = model.mouseout;
+ this.create(model);
+ }
+ create(model) {
+ const style = model.style;
+ this.counter = new Text({
+ zlevel: this.zlevel,
+ z: this.z,
+ style: {
+ x: model.x,
+ y: model.y,
+ fontWeight: style.textStyle.fontWeight,
+ fontSize: style.Counter.fontSize,
+ fontFamily: style.fontFamily,
+ text: '000',
+ textFill: style.Counter.defaultColor,
+ textAlign: style.textStyle.textAlign,
+ textVerticalAlign: style.textStyle.textVerticalAlign
+ }
+ });
+ this.name = new Text({
+ zlevel: this.zlevel,
+ z: this.z,
+ style: {
+ x: model.x,
+ y: model.y + 20,
+ fontWeight: style.textStyle.fontWeight,
+ fontSize: style.Counter.fontSize,
+ fontFamily: style.fontFamily,
+ text: model.text,
+ textFill: style.Counter.defaultColor,
+ textAlign: style.textStyle.textAlign,
+ textVerticalAlign: style.textStyle.textVerticalAlign
+ }
+ });
+ this.add(this.counter);
+ this.add(this.name);
+ }
+
+ recover() {
+ }
+ show() {}
+ setCount(count) {
+ this.counter && this.counter.setStyle({ text: count || '000' });
+ }
+}
diff --git a/src/jmapNew/shape/graph/SaidLamp/index.js b/src/jmapNew/shape/graph/SaidLamp/index.js
index bd850cfce..41d36541d 100644
--- a/src/jmapNew/shape/graph/SaidLamp/index.js
+++ b/src/jmapNew/shape/graph/SaidLamp/index.js
@@ -11,6 +11,7 @@ import EUnmanned from './EUnmanned';
import EAxle from './EAxle';
import EIndicatorLight from './EIndicatorLight';
import EPickOrDepartArrow from './EPickOrDepartArrow';
+import ECounter from './ECounter';
import store from '@/store/index';
export default class SaidLamp extends Group {
@@ -199,6 +200,17 @@ export default class SaidLamp extends Group {
_subType: this._type
});
this.add(this.control);
+ } else if (this._type === 'Counter' && this.style.Counter) {
+ this.control = new ECounter({
+ zlevel: this.zlevel,
+ z: this.z,
+ x: this.computedPosition.x,
+ y: this.computedPosition.y,
+ text: model.name,
+ style: this.style,
+ _subType: this._type
+ });
+ this.add(this.control);
}
}
@@ -284,6 +296,8 @@ export default class SaidLamp extends Group {
}
}
}
+ } else if (model._type === deviceType.Counter) {
+ this.control && this.control.setCount(model.count);
}
}
}
diff --git a/src/jmapNew/shape/graph/SignalButton/index.js b/src/jmapNew/shape/graph/SignalButton/index.js
index 71910d656..ed276163e 100644
--- a/src/jmapNew/shape/graph/SignalButton/index.js
+++ b/src/jmapNew/shape/graph/SignalButton/index.js
@@ -42,6 +42,7 @@ export default class SignalButton extends Group {
this.model = model;
this.style = style;
this.pressed = false;
+ this.typeList = this.style.SignalButton.typeList || typeList;
// Line
this.create();
this.setState(model);
@@ -51,7 +52,7 @@ export default class SignalButton extends Group {
const model = this.model;
const computedPosition = this.computedPosition;
const fillColor = this.getTypeColor();
- if (this.style.SignalButton && this.style.SignalButton.shape === 'roundWithDock' && typeList.includes(model.type)) {
+ if (this.style.SignalButton && this.style.SignalButton.shape === 'roundWithDock' && this.typeList.includes(model.type)) {
const circle1 = new Circle({
zlevel: this.zlevel,
z: this.z + 2,
@@ -277,7 +278,7 @@ export default class SignalButton extends Group {
this.rectButton && this.rectButton.stopAnimation(true);
}
getTypeColor() {
- if (this.style.SignalButton && this.style.SignalButton.fillColor && typeList.includes(this.model.type)) {
+ if (this.style.SignalButton && this.style.SignalButton.fillColor && this.typeList.includes(this.model.type)) {
return this.style.SignalButton.fillColor;
}
let color = '';
diff --git a/src/jmapNew/shape/graph/index.js b/src/jmapNew/shape/graph/index.js
index 074095aa1..0ce89fc8f 100644
--- a/src/jmapNew/shape/graph/index.js
+++ b/src/jmapNew/shape/graph/index.js
@@ -89,6 +89,7 @@ mapShape[deviceType.AssistStatus] = SaidLamp;
mapShape[deviceType.SectionOccupied] = SaidLamp;
mapShape[deviceType.ThroatRoute] = SaidLamp;
mapShape[deviceType.NoStatusLamp] = SaidLamp;
+mapShape[deviceType.Counter] = SaidLamp;
mapShape[deviceType.SplitStation] = SplitStation;
mapShape[deviceType.Arrow] = Arrow;
mapShape[deviceType.Power] = Power;
diff --git a/src/jmapNew/theme/datie_ksk/menus/menuButton.vue b/src/jmapNew/theme/datie_ksk/menus/menuButton.vue
index 9eab7b5c7..da8ee8a77 100644
--- a/src/jmapNew/theme/datie_ksk/menus/menuButton.vue
+++ b/src/jmapNew/theme/datie_ksk/menus/menuButton.vue
@@ -36,7 +36,7 @@
按钮
-