# Conflicts:
#	src/iscs/shape/stateTable.js
This commit is contained in:
joylink_cuiweidong 2020-10-12 18:35:00 +08:00
commit 24d93e9c64
21 changed files with 436 additions and 336 deletions

View File

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

View File

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -41,6 +41,7 @@ export default class Tick extends Group {
this.iscsRect = new Polygon({
zlevel: model.zlevel,
z: model.z,
z2: model.z2 || 0,
shape: {
points: points
},

View File

@ -20,8 +20,8 @@ import blowerRedRight from '@/assets/iscs_picture/gufengji-red-r.png';
import blowerGrayRight from '@/assets/iscs_picture/gufengji-gray-r.png';
import iscsAPF from '@/assets/iscs_picture/iscs_APF.png';
import drum from '@/assets/iscs_picture/drum.png';
import exhaustFanGray from '@/assets/iscs_picture/exhaustFan-gray.png'
import exhaustFanGreen from '@/assets/iscs_picture/exhaustFan-green.png'
import exhaustFanGray from '@/assets/iscs_picture/exhaustFan-gray.png';
import exhaustFanGreen from '@/assets/iscs_picture/exhaustFan-green.png';
import waterCooler from '@/assets/iscs_picture/ZSDF533.png';
import textBgBluePoint from '@/assets/iscs_picture/textBgBluePoint.png';
import kongzhixiang from '@/assets/iscs_picture/iscs_kongzhixiang.png';
@ -30,9 +30,18 @@ import escalator from '@/assets/iscs_picture/escalator.png';
import toUp from '@/assets/iscs_picture/to-up.png';
import toDown from '@/assets/iscs_picture/to-down.png';
import lift from '@/assets/iscs_picture/lift.png';
import dewateringBlue from '@/assets/iscs_picture/dewatering-blue.png'
import dewateringGray from '@/assets/iscs_picture/dewatering-gray.png'
import dewateringPurple from '@/assets/iscs_picture/dewatering-purple.png'
import dewateringBlue from '@/assets/iscs_picture/dewatering-blue.png';
import dewateringGray from '@/assets/iscs_picture/dewatering-gray.png';
import dewateringPurple from '@/assets/iscs_picture/dewatering-purple.png';
import exhaustFanLeft from '@/assets/iscs_picture/exhaustFan-left.png';
import exhaustFanRight from '@/assets/iscs_picture/exhaustFan-right.png';
import iscsMD from '@/assets/iscs_picture/iscs_MD.png';
import iscsMDRect from '@/assets/iscs_picture/iscs-MD-rect.png';
import iscsRAFEAFGreen from '@/assets/iscs_picture/iscs-RAF-EAF_green.png';
import iscsRAFEAFGray from '@/assets/iscs_picture/iscs-RAF-EAF_gray.png';
import iscsSEF from '@/assets/iscs_picture/iscs-SEF.png';
import iscsValue from '@/assets/iscs_picture/iscs-value.png';
import fanCoil from '@/assets/iscs_picture/fanCoil.png';
const pictureObj = {
'psdLeft': psdLeft,
@ -41,32 +50,41 @@ const pictureObj = {
'APF': iscsAPF,
'envPersonDoor': envPersonDoor,
's': fireBlue,
'a': fireRed,
hand,
fmBlue,
fmGray,
fmGreen,
airCond,
airCondMul,
setting,
blowerRedLeft,
blowerGrayLeft,
blowerRedRight,
blowerGrayRight,
drum,
exhaustFanGray,
exhaustFanGreen,
waterCooler,
textBgBluePoint,
ventilationFan,
escalator,
toUp,
toDown,
lift,
dewateringBlue,
dewateringGray,
dewateringPurple,
kongzhixiang
'a': fireRed,
hand,
fmBlue,
fmGray,
fmGreen,
airCond,
airCondMul,
setting,
blowerRedLeft,
blowerGrayLeft,
blowerRedRight,
blowerGrayRight,
drum,
exhaustFanGray,
exhaustFanGreen,
waterCooler,
textBgBluePoint,
ventilationFan,
escalator,
toUp,
toDown,
lift,
dewateringBlue,
dewateringGray,
dewateringPurple,
kongzhixiang,
exhaustFanLeft,
exhaustFanRight,
iscsMD,
iscsMDRect,
iscsRAFEAFGreen,
iscsRAFEAFGray,
iscsSEF,
iscsValue,
fanCoil
};
export default class Picture extends Group {
constructor(device) {
@ -87,10 +105,10 @@ export default class Picture extends Group {
});
this.imageButton = new Image({
zlevel: model.zlevel,
z: model.z,
z2: model.z2||0,
origin: [model.width/2, model.height/2],
rotation: (model.rotation||0)*Math.PI/180,
z: model.z,
z2: model.z2 || 0,
origin: [model.width / 2, model.height / 2],
rotation: (model.rotation || 0) * Math.PI / 180,
style: {
x: 0,
y: 0,

View File

@ -1,9 +1,9 @@
import Group from 'zrender/src/container/Group';
import Rect from 'zrender/src/graphic/shape/Rect';
import Line from 'zrender/src/graphic/shape/Line';
// import Line from 'zrender/src/graphic/shape/Line';
import Text from 'zrender/src/graphic/Text';
import Circle from 'zrender/src/graphic/shape/Circle';
import { merge } from 'lodash';
// import { merge } from 'lodash';
const stateMap = {
slidingDoorEmergencyDoorOpenMalfunction : '滑动门&应急门开门故障',
slidingDoorEmergencyDoorCloseMalfunction: '滑动门&应急门关门故障',
@ -167,75 +167,75 @@ export default class StateTable extends Group {
this.create();
}
create() {
const model = this.model;
const sumWidth = model.columnWidthList.reduce((a,b) => {return a+b;})
const model = this.model;
const sumWidth = model.columnWidthList.reduce((a, b) => { return a + b; });
this.rectsArr = [];
this.contextsArr = [];
this.rectsArr = [];
this.contextsArr = [];
this.grouper = new Group({
id: model.code,
position: [model.point.x, model.point.y]
});
});
let rowNum = model.rowNum;
let contentIndex = 2;
// let rowNum = model.rowNum;
// let contentIndex = 2;
if (model.headerType === 'none') {
rowNum = model.rowNum - 1;
contentIndex = 1;
}
// rowNum = model.rowNum - 1;
// contentIndex = 1;
}
if (model.rowHeight||!model.rowHeightList) {
model.rowHeightList = new Array(model.rowNum).fill(model.rowHeight);
}
if (model.rowHeight || !model.rowHeightList) {
model.rowHeightList = new Array(model.rowNum).fill(model.rowHeight);
}
let sumRowSize = 0;
model.rowHeightList.forEach((height,i) => {
const rects = [];
let sumColumnSize = 0;
let isMegerHeader = model.headerType === 'merge' && i == 0;
let sumRowSize = 0;
model.rowHeightList.forEach((height, i) => {
const rects = [];
let sumColumnSize = 0;
const isMegerHeader = model.headerType === 'merge' && i == 0;
if (model.headerType === 'none' && i == 0) {
return;
}
if (model.headerType === 'none' && i == 0) {
return;
}
model.columnWidthList.forEach((width,j) => {
const defBg = model.bgColor||'rgba(0,0,0,0)'
const rect = new Rect({
zlevel: this.zlevel,
z: this.z,
shape: {
x: isMegerHeader? 0: sumColumnSize,
y: sumRowSize,
width: isMegerHeader? sumWidth: width,
height
},
style: {
stroke: model.borderColor || '#FFF',
lineWidth: 1,
fill: model.tableData[i-1]? model.tableData[i-1]['bg'+(j+1)]||defBg : defBg
}
});
rects.push(rect);
this.grouper.add(rect);
sumColumnSize += width;
});
this.rectsArr.push(rects);
sumRowSize += height;
})
model.columnWidthList.forEach((width, j) => {
const defBg = model.bgColor || 'rgba(0,0,0,0)';
const rect = new Rect({
zlevel: this.zlevel,
z: this.z,
z2: model.z2 || 0,
shape: {
x: isMegerHeader ? 0 : sumColumnSize,
y: sumRowSize,
width: isMegerHeader ? sumWidth : width,
height
},
style: {
stroke: model.borderColor || '#FFF',
lineWidth: 1,
fill: model.tableData[i - 1] ? model.tableData[i - 1]['bg' + (j + 1)] || defBg : defBg
}
});
rects.push(rect);
this.grouper.add(rect);
sumColumnSize += width;
});
this.rectsArr.push(rects);
sumRowSize += height;
});
this.header = [];
if (model.headerType === 'merge') {
const header = new Text({
zlevel: model.zlevel,
z: model.z + 1,
z2: model.z2 || 0,
style: {
x: sumWidth / 2,
y: model.rowHeightList[0] / 2,
fontWeight: model.headerFontWeight||'normal',
fontWeight: model.headerFontWeight || 'normal',
fontSize: model.headerFontSize,
fontFamily: 'consolas',
text: model.headerContextList[0],
@ -254,10 +254,11 @@ export default class StateTable extends Group {
const header = new Text({
zlevel: model.zlevel,
z: model.z + 1,
z2: model.z2 || 0,
style: {
x: item / 2 + width,
y: model.rowHeightList[0] / 2,
fontWeight: model.headerFontWeight||'normal',
fontWeight: model.headerFontWeight || 'normal',
fontSize: model.headerFontSize,
fontFamily: 'consolas',
text: model.headerContextList[i],
@ -272,100 +273,103 @@ export default class StateTable extends Group {
this.grouper.add(header);
this.header.push(header);
});
}
}
model.tableData.forEach((item, i)=> {
const index = model.headerType === 'none'? i: i+1;
const rects = this.rectsArr[index] || [];
const contexts = [];
const index = model.headerType === 'none' ? i : i + 1;
const rects = this.rectsArr[index] || [];
const contexts = [];
model.columnWidthList.forEach((elem, j) => {
const rect = rects[j];
if (rect) {
if (stateMap[item['column' + (j + 1)]] &&
const rect = rects[j];
if (rect) {
if (stateMap[item['column' + (j + 1)]] &&
stateMap[item['column' + (j + 1)]].type === 'Circle') {
const contextColor = stateMap[item['column' + (j + 1)]].color||item['color'+(j + 1)]||'#4CCDE4';
const circle = new Circle({
zlevel: model.zlevel,
z: model.z + 1,
_subType: stateMap[item['column' + (j + 1)]],
shape: {
cx: rect.shape.x + rect.shape.width / 2,
cy: rect.shape.y + rect.shape.height / 2,
r: model.rowHeightList[index] / 3
},
style: {
fill: contextColor
}
});
this.grouper.add(circle);
contexts.push(circle);
} else {
const bg = stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].background : null;
const textPadding = stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].textPadding : 0;
const context = stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].default : item['column' + (j + 1)];
const contextColor = stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].color : item['color'+(j + 1)]||(this.model.textColor ? this.model.textColor : '#4CCDE4');
const contextWeight = stateMap[item['column' + (j + 1)]] ? 'normal': item['weight'+(j + 1)]||this.model.fontWeight||'normal';
const unit = stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].unit : '';
const unitColor = stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].unitColor : item['color'+(j + 1)]||(this.model.textColor ? this.model.textColor : '#4CCDE4')
const contextColor = stateMap[item['column' + (j + 1)]].color || item['color' + (j + 1)] || '#4CCDE4';
const circle = new Circle({
zlevel: model.zlevel,
z: model.z + 1,
z2: model.z2 || 0,
_subType: stateMap[item['column' + (j + 1)]],
shape: {
cx: rect.shape.x + rect.shape.width / 2,
cy: rect.shape.y + rect.shape.height / 2,
r: model.rowHeightList[index] / 3
},
style: {
fill: contextColor
}
});
this.grouper.add(circle);
contexts.push(circle);
} else {
const bg = stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].background : null;
const textPadding = stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].textPadding : 0;
const context = stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].default : item['column' + (j + 1)];
const contextColor = stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].color : item['color' + (j + 1)] || (this.model.textColor ? this.model.textColor : '#4CCDE4');
const contextWeight = stateMap[item['column' + (j + 1)]] ? 'normal' : item['weight' + (j + 1)] || this.model.fontWeight || 'normal';
const unit = stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].unit : '';
const unitColor = stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].unitColor : item['color' + (j + 1)] || (this.model.textColor ? this.model.textColor : '#4CCDE4');
let text = null;
if (stateMap[item['column' + (j + 1)]] && stateMap[item['column' + (j + 1)]].unit) {
text = new Text({
zlevel: model.zlevel,
z: model.z + 1,
_subType: stateMap[item['column' + (j + 1)]],
style:{
x: rect.shape.x + rect.shape.width / 2,
y: rect.shape.y + rect.shape.height / 2,
fontWeight: contextWeight,
fontFamily: 'consolas',
fontSize: model.fontSize,
text: `{context|${context}} {unit|${unit}}`,
rich: {
context: {
textFill: contextColor,
},
unit: {
textFill: unitColor,
}
},
textBackgroundColor: bg,
textLineHeight: model.fontSize,
textAlign: 'center',
textPosition: 'inside',
textVerticalAlign: 'center',
textPadding
}
});
} else {
text = new Text({
zlevel: model.zlevel,
z: model.z + 1,
_subType: stateMap[item['column' + (j + 1)]],
style:{
x: rect.shape.x + rect.shape.width / 2,
y: rect.shape.y + rect.shape.height / 2,
fontWeight: contextWeight,
fontFamily: 'consolas',
fontSize: model.fontSize,
text: context,
textFill: contextColor,
textBackgroundColor: bg,
textLineHeight: model.fontSize,
textAlign: 'center',
textPosition: 'inside',
textVerticalAlign: 'center',
textPadding
}
});
}
this.grouper.add(text);
contexts.push(text);
}
}
let text = null;
if (stateMap[item['column' + (j + 1)]] && stateMap[item['column' + (j + 1)]].unit) {
text = new Text({
zlevel: model.zlevel,
z: model.z + 1,
z2: model.z2 || 0,
_subType: stateMap[item['column' + (j + 1)]],
style:{
x: rect.shape.x + rect.shape.width / 2,
y: rect.shape.y + rect.shape.height / 2,
fontWeight: contextWeight,
fontFamily: 'consolas',
fontSize: model.fontSize,
text: `{context|${context}} {unit|${unit}}`,
rich: {
context: {
textFill: contextColor
},
unit: {
textFill: unitColor
}
},
textBackgroundColor: bg,
textLineHeight: model.fontSize,
textAlign: 'center',
textPosition: 'inside',
textVerticalAlign: 'center',
textPadding
}
});
} else {
text = new Text({
zlevel: model.zlevel,
z: model.z + 1,
z2: model.z2 || 0,
_subType: stateMap[item['column' + (j + 1)]],
style:{
x: rect.shape.x + rect.shape.width / 2,
y: rect.shape.y + rect.shape.height / 2,
fontWeight: contextWeight,
fontFamily: 'consolas',
fontSize: model.fontSize,
text: context,
textFill: contextColor,
textBackgroundColor: bg,
textLineHeight: model.fontSize,
textAlign: 'center',
textPosition: 'inside',
textVerticalAlign: 'center',
textPadding
}
});
}
this.grouper.add(text);
contexts.push(text);
}
}
});
this.contextsArr.push(contexts)
});
this.contextsArr.push(contexts);
});
this.add(this.grouper);
}
setModel(dx, dy) {

View File

@ -125,7 +125,9 @@ class Status {
this.statusObj = { };
}
handleDirectionRod(device) {
this.statusObj = { };
this.statusObj = {
reverse: device.reverse
};
}
getStatus() {
return this.statusObj;

View File

@ -54,7 +54,7 @@ class Jlmap {
this.previewOrMapDraw = opts.showConfig.previewOrMapDraw;
this.$zr = zrender.init(opts.dom, deepAssign({ renderer, devicePixelRatio, width, height }, opts.config));
this.$zr.dom.setAttribute('tabIndex', -1);
this.$zr.dom.setAttribute('tabIndex', -1);
this.$options = new Options(deepAssign({ scaleRate: 1, offsetX: 0, offsetY: 0 }, opts.options || {}), (dataZoom) => { this.$mouseController.trigger(this.events.DataZoom, dataZoom); }); // 缩放
this.$painter = new Painter(this);
@ -501,6 +501,13 @@ class Jlmap {
psdDevice.fault = elem.fault;
this.$painter.update(psdDevice);
}
} else if (elem.deviceType === 'DIRECTION_ROD' && elem.uniqueCode) {
store.state.map.map.directionRodList.forEach(item => {
console.log(item, '====', elem.uniqueCode === `${item.startStationCode}-${item.endStationCode}-${item.right}`);
if (elem.uniqueCode === `${item.startStationCode}-${item.endStationCode}-${item.right}`) {
this.$painter.update(elem);
}
});
}
const oDevice = this.mapDevice[code] || deviceFactory(type, elem, this.showConfig);
if (elem.dispose) {

View File

@ -13,6 +13,7 @@ export default class DirectionRod extends Group {
this.model = model;
this.style = style;
this.isShowShape = true;
this.recoverValue = false;
if (isShowThePrdType(model.prdType, style.DirectionRod.displayCondition) || model.previewOrMapDraw) {
this.create();
this.createMouseEvent();
@ -73,8 +74,10 @@ export default class DirectionRod extends Group {
}
// 设置状态
setState(model) {
console.log(model, this.model, '888888');
// if (!this.isShowShape) return;
// this.recover();
this.recoverValue = model.reverse;
if (model.reverse && this.model.right) {
this.rod.attr('rotation', 0);
} else if (!model.reverse && this.model.right) {
@ -97,6 +100,9 @@ export default class DirectionRod extends Group {
} else {
this.hideMode();
}
}
drawSelected() {
}
setShowStation(stationCode) {
if (!stationCode || this.model.stationCode === stationCode) {

View File

@ -103,7 +103,8 @@ export default {
signalParamList: [],
stationParamList: [],
standParamList: [],
routeParamList: []
routeParamList: [],
directionRodParamList: []
};
},
computed: {
@ -153,6 +154,9 @@ export default {
case 'StationStand':
this.handleStandMenu();
break;
case 'DirectionRod':
this.handleDirectionRodMenu();
break;
}
}
}).catch((error) => {
@ -368,6 +372,32 @@ export default {
speedLimitValue: '5'
};
},
handleDirectionRodMenu() {
this.clearAllMenuShow();
this.deviceHighLight(this.oldDevice, false);
this.deviceHighLight(this.selectedObj, true);
this.oldDevice = this.selectedObj;
this.centralizedStationList = new Array(15).fill({});
this.directionRodParamList.forEach((directionRod, index) => {
if (this.selectedObj.right && this.selectedObj.recoverValue && directionRod.name === '切换左向') {
directionRod['disabled'] = true;
} else if (!this.selectedObj.right && this.selectedObj.recoverValue && directionRod.name === '切换右向') {
directionRod['disabled'] = true;
} else if (this.selectedObj.right && !this.selectedObj.recoverValue && directionRod.name === '切换右向') {
directionRod['disabled'] = true;
} else if (!this.selectedObj.right && !this.selectedObj.recoverValue && directionRod.name === '切换左向') {
directionRod['disabled'] = true;
} else {
directionRod['disabled'] = false;
}
this.centralizedStationList[index] = directionRod;
});
this.tempData = [];
this.tempData.push(this.selectedObj);
this.param = {
code: `${this.selectedObj.startStationCode}-${this.selectedObj.endStationCode}-${this.selectedObj.right}`
};
},
handleBasicMenu() {
this.deviceHighLight(this.oldDevice, false);
if (this.oldClickObj) {
@ -479,7 +509,7 @@ export default {
this.clearAllMenuShow();
},
initMenus() {
this.basicParamList = this.$store.state.training.prdType === '01' ? [
this.basicParamList = [
{ name: '接收控制', cmdType: CMD.ControlConvertMenu.CMD_CM_RECEIVE_CONTROL, operate: OperationEvent.StationControl.requestStationControl.menu, show: false, disabledName: 'controlMode', mode: 'Center' },
{ name: '交出控制', cmdType: CMD.ControlConvertMenu.CMD_CM_SURRENDER_CONTROL, operate: OperationEvent.StationControl.requestCentralControl.menu, show: false, disabledName: 'controlMode', mode: 'None' },
{ name: '强行站控', cmdType: CMD.ControlConvertMenu.CMD_CM_FORCE_STATION_CONTROL, operate: OperationEvent.StationControl.forcedStationControl.menu, show:false, securityCommand: true },
@ -489,17 +519,15 @@ export default {
{ name: '关区信号', cmdType: CMD.Station.CMD_STATION_CIAREA_CLOSE_ALLSIGNAL, operate: OperationEvent.Station.ciAreaCloseAllSignal.menu, show: false },
{ name: '自排全开', cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING, operate: OperationEvent.Station.atsAutoControlALL.menu, show: false },
{ name: '自排全关', cmdType: CMD.Station.CMD_STATION_CLOSE_AUTO_SETTING, operate: OperationEvent.Station.humanControlALL.menu, show: false }
] : [];
this.sectionParamList = this.$store.state.training.prdType === '01' ? [
];
this.sectionParamList = [
{ name: '封锁区段', cmdType: CMD.Section.CMD_SECTION_BLOCK, operate: OperationEvent.Section.lock.menuButton, show: false },
{ name: '解封区段', cmdType: CMD.Section.CMD_SECTION_UNBLOCK, operate: OperationEvent.Section.unlock.menuButton, show: false, securityCommand: true },
{ name: '轨区消限', cmdType: CMD.Section.CMD_SECTION_CANCEL_LIMIT_SPEED, operate: OperationEvent.Section.cancelSpeed.menuButton, show: false, securityCommand: true },
{ name: '轨区设限', cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED, operate: OperationEvent.Section.setSpeed.menuButton, show: false, securityCommand: true },
{ name: '强解区段', cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK, operate: OperationEvent.Section.fault.menuButton, show: false, securityCommand: true }
] : [
{ name: '封锁区段', cmdType: CMD.Section.CMD_SECTION_BLOCK, operate: OperationEvent.Section.lock.menuButton, show: false }
];
this.switchParamList = this.$store.state.training.prdType === '01' ? [
this.switchParamList = [
{ name: '封锁道岔', cmdType: CMD.Switch.CMD_SWITCH_BLOCK, operate: OperationEvent.Switch.block.menuButton, show: false },
{ name: '解封道岔', cmdType: CMD.Switch.CMD_SWITCH_UNBLOCK, operate: OperationEvent.Switch.unblock.menuButton, show: false, securityCommand: true },
{ name: '取消锁定', cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK, operate: OperationEvent.Switch.unlock.menuButton, show: false, securityCommand: true },
@ -511,12 +539,6 @@ export default {
{ name: '轨区消限', cmdType: CMD.Switch.CMD_SWITCH_CANCEL_LIMIT_SPEED, operate: OperationEvent.Switch.cancelSpeed.menuButton, show: false, securityCommand: true },
{ name: '轨区设限', cmdType: CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED, operate: OperationEvent.Switch.setSpeed.menuButton, show: false, securityCommand: true},
{ name: '强解区段', cmdType: CMD.Switch.CMD_SWITCH_FAULT_UNLOCK, operate: OperationEvent.Section.fault.menuButton, show: false, securityCommand: true }
] : [
{ name: '封锁道岔', cmdType: CMD.Switch.CMD_SWITCH_BLOCK, operate: OperationEvent.Switch.block.menuButton, show: false },
{ name: '单锁道岔', cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK, operate: OperationEvent.Switch.lock.menuButton, show: false },
{ name: '转换定位', cmdType: CMD.Switch.CMD_SWITCH_NORMAL_POSITION, operate: OperationEvent.Switch.locate.menuButton, show: false, disabledName: 'normalPosition' },
{ name: '转换反位', cmdType: CMD.Switch.CMD_SWITCH_REVERSE_POSITION, operate: OperationEvent.Switch.reverse.menuButton, show: false, disabledName: 'reversePosition' }
// { name: '', cmdType: CMD.Switch.CMD_SWITCH_SECTION_BLOCK, operate: OperationEvent.Section.lock.menu, show: false }
];
this.signalParamList = this.$store.state.training.prdType === '01' ? [
{ name: '追踪单开', cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO_TRIGGER, operate: OperationEvent.Signal.setAutoTrigger.menuButton, show: false, disabledName: 'ciControl' },
@ -557,6 +579,10 @@ export default {
{ name: '越站', cmdType: CMD.Stand.CMD_STAND_SET_JUMP_STOP, operate: OperationEvent.StationStand.setJumpStop.menuButton, show: false, securityCommand: true },
{ name: '取消越站', cmdType: CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP, operate: OperationEvent.StationStand.cancelJumpStop.menuButton, show: false, securityCommand: true }
];
this.directionRodParamList = [
{ name: '切换左向', cmdType: CMD.DirectionRod.CMD_DIRECTION_CHANGE, operate: OperationEvent.StationStand.setDetainTrain.menuButton, show: false },
{ name: '切换右向', cmdType: CMD.DirectionRod.CMD_DIRECTION_CHANGE, operate: OperationEvent.StationStand.setDetainTrain.menuButton, show: false }
];
},
initRouteMenus() {
this.routeParamList = [];

View File

@ -1,6 +1,9 @@
<template>
<div style="overflow-y: scroll;height: calc(100% - 46px); width: 100%;">
<el-form ref="form" :rules="rules" :model="form" label-width="80px" style="width: 100%;padding: 10px 50px;">
<el-form-item label="图层:" prop="z2">
<el-input-number v-model="form.z2" controls-position="right" size="small" />
</el-form-item>
<el-form-item label="箭头大小:" prop="fontSize">
<el-input-number v-model="form.fontSize" controls-position="right" :min="1" size="small" />
</el-form-item>
@ -57,6 +60,7 @@ export default {
showDeleteButton: false,
form: {
code: '',
z2: '',
fillColor: '#fff',
borderWidth: 0,
fontSize: 10,
@ -91,6 +95,7 @@ export default {
this.showDeleteButton = true;
this.isUpdate = true;
this.form.code = model.code;
this.form.z2 = model.z2;
this.form.fillColor = model.fillColor;
this.form.borderWidth = model.borderWidth;
this.form.fontSize = model.fontSize;
@ -114,8 +119,9 @@ export default {
x: this.form.x,
y: this.form.y
},
code: this.isUpdate ? this.form.code : getUID('IscsArrow', this.iscs.iscsRectList),
code: this.isUpdate ? this.form.code : getUID('IscsArrow', this.iscs.iscsArrowList),
_type: 'IscsArrow',
z2: this.form.z2,
fillColor: this.form.fillColor,
borderWidth: this.form.borderWidth,
fontSize: this.form.fontSize,
@ -152,6 +158,7 @@ export default {
this.showDeleteButton = false;
this.form = {
code: '',
z2: '',
fillColor: '',
borderWidth: 1,
fontSize: 10,

View File

@ -1,9 +1,9 @@
<template>
<div style="overflow-y: scroll;height: calc(100% - 46px); width: 100%;">
<el-form ref="form" :rules="rules" :model="form" label-width="80px" style="width: 100%;padding: 10px 50px;">
<el-form-item label="图层:" prop="z2">
<el-input-number v-model="form.z2" controls-position="right" size="small" />
</el-form-item>
<el-form-item label="图层:" prop="z2">
<el-input-number v-model="form.z2" controls-position="right" size="small" />
</el-form-item>
<el-form-item label="图片类型:" prop="type">
<el-select v-model="form.type" placeholder="请选择类型" size="small">
<el-option v-for="(item, index) in typeList" :key="index" :label="item.name" :value="item.value" />
@ -47,8 +47,8 @@ export default {
showDeleteButton: false,
form: {
code: '',
type: '',
z2: 0,
type: '',
z2: 0,
width: 50,
height: 50,
rotation: 0,
@ -58,37 +58,46 @@ export default {
typeList: [
{ name: '车头', value: 'psdLeft' },
{ name: '车尾', value: 'psdRight' },
{ name: '车厢', value: 'psdSystem' },
{ name: '人防门', value: 'envPersonDoor'},
{ name: '蓝色FIRE', value: 's'},
{ name: '红色FIRE', value: 'a'},
{ name: 'APF', value: 'APF'},
{ name: '手动阀', value: 'hand'},
{ name: '蓝色-阀门', value: 'fmBlue'},
{ name: '灰色-阀门', value: 'fmGray'},
{ name: '绿色-阀门', value: 'fmGreen'},
{ name: '空调', value: 'airCond'},
{ name: '多联空调', value: 'airCondMul'},
{ name: '管件', value: 'setting'},
{ name: '汽包', value: 'drum' },
{ name: '红色-左侧-鼓风机', value: 'blowerRedLeft'},
{ name: '灰色-左侧-鼓风机', value: 'blowerGrayLeft'},
{ name: '红色-右侧-鼓风机', value: 'blowerRedRight'},
{ name: '灰色-右侧-鼓风机', value: 'blowerGrayRight'},
{ name: '灰色-排风机', value: 'exhaustFanGray' },
{ name: '绿色-排风机', value: 'exhaustFanGreen' },
{ name: '冷水机', value: 'waterCooler'},
{ name: '顶部排风机', value: 'ventilationFan'},
{ name: '文字蓝色背景', value: 'textBgBluePoint'},
{ name: '扶梯', value: 'escalator'},
{ name: '扶梯-朝上指示', value: 'toUp'},
{ name: '扶梯-朝下执行', value: 'toDown'},
{ name: '电梯', value: 'lift' },
{ name: '蓝色-排水', value: 'dewateringBlue' },
{ name: '灰色-电梯', value: 'dewateringGray' },
{ name: '紫色-电梯', value: 'dewateringPurple' },
{ name: '活塞风井', value: 'kongzhixiang'}
],
{ name: '车厢', value: 'psdSystem' },
{ name: '人防门', value: 'envPersonDoor'},
{ name: '蓝色FIRE', value: 's'},
{ name: '红色FIRE', value: 'a'},
{ name: 'APF', value: 'APF'},
{ name: '手动阀', value: 'hand'},
{ name: '蓝色-阀门', value: 'fmBlue'},
{ name: '灰色-阀门', value: 'fmGray'},
{ name: '绿色-阀门', value: 'fmGreen'},
{ name: '空调', value: 'airCond'},
{ name: '多联空调', value: 'airCondMul'},
{ name: '管件', value: 'setting'},
{ name: '汽包', value: 'drum' },
{ name: '红色-左侧-鼓风机', value: 'blowerRedLeft'},
{ name: '灰色-左侧-鼓风机', value: 'blowerGrayLeft'},
{ name: '红色-右侧-鼓风机', value: 'blowerRedRight'},
{ name: '灰色-右侧-鼓风机', value: 'blowerGrayRight'},
{ name: '灰色-排风机', value: 'exhaustFanGray' },
{ name: '绿色-排风机', value: 'exhaustFanGreen' },
{ name: '排风机左侧', value: 'exhaustFanLeft' },
{ name: '排风机右侧', value: 'exhaustFanRight' },
{ name: '冷水机', value: 'waterCooler'},
{ name: '顶部排风机', value: 'ventilationFan'},
{ name: '文字蓝色背景', value: 'textBgBluePoint'},
{ name: '扶梯', value: 'escalator'},
{ name: '扶梯-朝上指示', value: 'toUp'},
{ name: '扶梯-朝下执行', value: 'toDown'},
{ name: '电梯', value: 'lift' },
{ name: '蓝色-排水', value: 'dewateringBlue' },
{ name: '灰色-电梯', value: 'dewateringGray' },
{ name: '紫色-电梯', value: 'dewateringPurple' },
{ name: '活塞风井', value: 'kongzhixiang'},
{ name: 'MD风阀', value: 'iscsMD' },
{ name: '排烟风阀', value: 'iscsMDRect' },
{ name: '排烟风机(箭头)-灰色', value: 'iscsRAFEAFGray' },
{ name: '排烟风机(箭头)-绿色', value: 'iscsRAFEAFGreen' },
{ name: '排烟风机', value: 'iscsSEF' },
{ name: '阀门', value: 'iscsValue' },
{ name: '风扇机', value: 'fanCoil'}
],
rules: {
strokeColor: [
@ -114,8 +123,8 @@ export default {
this.isUpdate = true;
this.form.code = model.code;
this.form.type = model.type;
this.form.z2 = model.z2;
this.form.rotation = model.rotation;
this.form.z2 = model.z2;
this.form.rotation = model.rotation;
this.form.width = model.width;
this.form.height = model.height;
this.form.x = model.point.x;
@ -136,8 +145,8 @@ export default {
code: this.isUpdate ? this.form.code : getUID('IscsPicture', this.iscs.iscsPictureList),
_type: 'IscsPicture',
type: this.form.type,
z2: this.form.z2,
rotation: this.form.rotation,
z2: this.form.z2,
rotation: this.form.rotation,
width: this.form.width,
height: this.form.height
};
@ -157,8 +166,8 @@ export default {
code: this.form.code,
_type: 'IscsPicture',
type: this.form.type,
z2: this.form.z2,
rotation: this.form.rotation,
z2: this.form.z2,
rotation: this.form.rotation
};
this.$emit('deleteDataModel', rectModel);
},
@ -169,8 +178,8 @@ export default {
this.form = {
code: '',
type: '',
z2: 0,
rotation: 0,
z2: 0,
rotation: 0,
width: 50,
height: 50,
x: 10,

View File

@ -1,6 +1,9 @@
<template>
<div style="overflow-y: scroll;height: calc(100% - 46px); width: 100%;">
<el-form ref="form" :rule="rules" :model="addModel" label-width="120px" size="small" style="width: 100%;padding: 10px 50px;">
<el-form-item label="图层:" prop="z2">
<el-input-number v-model="addModel.z2" controls-position="right" :min="0" size="small" />
</el-form-item>
<el-form-item v-if="isUpdate" label="表格编号:" prop="code">
<el-input v-model="addModel.code" :disabled="true" />
</el-form-item>
@ -10,7 +13,7 @@
<el-form-item label="y坐标:" prop="y">
<el-input-number v-model="addModel.y" controls-position="right" :min="1" size="small" />
</el-form-item>
<el-form-item label="背景颜色:">
<el-form-item label="背景颜色:">
<el-color-picker v-model="addModel.bgColor" size="small" show-alpha />
</el-form-item>
<el-form-item label="文字颜色:">
@ -30,7 +33,7 @@
<el-form-item label="行数:" prop="rowNum">
<el-input-number v-model="addModel.rowNum" controls-position="right" :min="1" size="small" @change="changeRowNum" />
</el-form-item>
<el-form-item label="行高:" prop="height">
<el-form-item label="行高:" prop="height">
<template v-for="(item, index) in addModel.rowHeightList">
<el-input-number :key="index" v-model="addModel.rowHeightList[index]" style="display: block; margin-bottom: 5px" controls-position="right" :min="1" size="small" />
</template>
@ -58,13 +61,13 @@
<el-form-item label="表头字体大小:" prop="headerFontSize">
<el-input-number v-model="addModel.headerFontSize" controls-position="right" :min="1" size="small" />
</el-form-item>
<el-form-item label="表头字体加粗:" prop="headerFontWeight">
<el-form-item label="表头字体加粗:" prop="headerFontWeight">
<el-input-number v-model="addModel.headerFontWeight" controls-position="right" :min="400" size="small" />
</el-form-item>
<el-form-item label="表格字体大小:" prop="fontSize">
<el-input-number v-model="addModel.fontSize" controls-position="right" :min="1" size="small" />
</el-form-item>
<el-form-item label="表格字体加粗:" prop="fontWeight">
<el-form-item label="表格字体加粗:" prop="fontWeight">
<el-input-number v-model="addModel.fontWeight" controls-position="right" :min="400" size="small" />
</el-form-item>
<el-form-item label="表格内容:" prop="tableData">
@ -72,19 +75,19 @@
<template v-for="(item, i) in addModel.columnWidthList">
<el-table-column :key="i" :label="'列'+(i + 1)" :prop="'column'+ (i + 1)" width="140px">
<template slot-scope="scope">
<el-input v-model="addModel.tableData[scope.$index]['column'+ (i + 1)]" size="small"/>
<div style="display:flex;justify-content:space-around;align-items: center;">
<div>背景</div>
<el-color-picker v-model="addModel.tableData[scope.$index]['bg'+(i+1)]" size="small" show-alpha />
</div>
<div style="display:flex;justify-content:space-around;align-items: center;">
<div>颜色</div>
<el-color-picker v-model="addModel.tableData[scope.$index]['color'+(i+1)]" size="small" />
</div>
<div style="display:flex;justify-content:space-around;align-items: center;">
<div>加粗</div>
<el-input-number v-model="addModel.tableData[scope.$index]['weight'+(i+1)]" :min="400" size="small" />
</div>
<el-input v-model="addModel.tableData[scope.$index]['column'+ (i + 1)]" size="small" />
<div style="display:flex;justify-content:space-around;align-items: center;">
<div>背景</div>
<el-color-picker v-model="addModel.tableData[scope.$index]['bg'+(i+1)]" size="small" show-alpha />
</div>
<div style="display:flex;justify-content:space-around;align-items: center;">
<div>颜色</div>
<el-color-picker v-model="addModel.tableData[scope.$index]['color'+(i+1)]" size="small" />
</div>
<div style="display:flex;justify-content:space-around;align-items: center;">
<div>加粗</div>
<el-input-number v-model="addModel.tableData[scope.$index]['weight'+(i+1)]" :min="400" size="small" />
</div>
</template>
</el-table-column>
</template>
@ -108,23 +111,24 @@ export default {
data() {
return {
addModel:{
z2: '',
code: '',
x: 10,
y: 10,
y: 10,
columnNum: 2,
rowNum: 2,
columnWidthList: [50, 50],
rowHeightList: [25, 25],
bgColor: '',
columnWidthList: [50, 50],
rowHeightList: [25, 25],
bgColor: '',
textColor: '',
borderColor: '',
headerType: 'normal',
tableData: [{}],
tableData: [{}],
headerContextList: [],
headerFontSize: 14,
headerFontWeight: 450,
fontSize: 12,
fontWeight: 450,
headerFontWeight: 450,
fontSize: 12,
fontWeight: 450
},
headerTypeList: [
@ -195,26 +199,27 @@ export default {
this.showDeleteButton = true;
this.isUpdate = true;
this.addModel.code = model.code;
this.addModel.z2 = model.z2;
this.addModel.x = model.point.x;
this.addModel.y = model.point.y;
this.addModel.columnNum = model.columnNum;
this.addModel.rowNum = model.rowNum;
this.addModel.bgColor = model.bgColor;
this.addModel.rowNum = model.rowNum;
this.addModel.bgColor = model.bgColor;
this.addModel.textColor = model.textColor;
this.addModel.borderColor = model.borderColor;
this.addModel.columnWidthList = model.columnWidthList;
this.addModel.rowHeightList = model.rowHeightList;
this.addModel.headerType = model.headerType;
this.addModel.columnWidthList = model.columnWidthList;
this.addModel.rowHeightList = model.rowHeightList;
this.addModel.headerType = model.headerType;
this.addModel.tableData = model.tableData;
this.addModel.headerFontSize = model.headerFontSize;
this.addModel.headerFontWeight = model.headerFontWeight,
this.addModel.fontSize = model.fontSize;
this.addModel.fontWeight = model.fontWeight,
this.addModel.headerContextList = model.headerContextList;
if (model.rowHeight||!model.rowHeightList) {
this.addModel.rowHeightList = new Array(model.rowNum).fill(model.rowHeight);
this.addModel.rowHeight = model.rowHeight = 0;
}
this.addModel.headerFontSize = model.headerFontSize;
this.addModel.headerFontWeight = model.headerFontWeight;
this.addModel.fontSize = model.fontSize;
this.addModel.fontWeight = model.fontWeight;
this.addModel.headerContextList = model.headerContextList;
if (model.rowHeight || !model.rowHeightList) {
this.addModel.rowHeightList = new Array(model.rowNum).fill(model.rowHeight);
this.addModel.rowHeight = model.rowHeight = 0;
}
}
}
@ -237,20 +242,21 @@ export default {
},
columnNum: this.addModel.columnNum,
rowNum: this.addModel.rowNum,
columnWidthList: this.addModel.columnWidthList,
rowHeightList: this.addModel.rowHeightList,
columnWidthList: this.addModel.columnWidthList,
rowHeightList: this.addModel.rowHeightList,
headerType: this.addModel.headerType,
tableData: this.addModel.tableData,
_type: 'StateTable',
bgColor: this.addModel.bgColor,
_type: 'StateTable',
bgColor: this.addModel.bgColor,
textColor: this.addModel.textColor,
borderColor: this.addModel.borderColor,
headerFontSize: this.addModel.headerFontSize,
headerFontWeight: this.addModel.headerFontWeight,
fontSize: this.addModel.fontSize,
fontWeight: this.addModel.fontWeight,
headerFontSize: this.addModel.headerFontSize,
headerFontWeight: this.addModel.headerFontWeight,
fontSize: this.addModel.fontSize,
fontWeight: this.addModel.fontWeight,
headerContextList: this.addModel.headerContextList,
code: this.isUpdate ? this.addModel.code : getUID('StateTable', this.iscs.stateTableList)
code: this.isUpdate ? this.addModel.code : getUID('StateTable', this.iscs.stateTableList),
z2: this.addModel.z2
};
this.$emit('createDataModel', model);
this.initPage();
@ -268,14 +274,14 @@ export default {
code: this.addModel.code,
columnNum: this.addModel.columnNum,
rowNum: this.addModel.rowNum,
columnWidthList: this.addModel.columnWidthList,
rowHeightList: this.addModel.rowHeightList,
columnWidthList: this.addModel.columnWidthList,
rowHeightList: this.addModel.rowHeightList,
headerType: this.addModel.headerType,
tableData: this.addModel.tableData,
headerFontSize: this.addModel.headerFontSize,
headerFontWeight: this.addModel.headerFontWeight,
fontSize: this.addModel.fontSize,
fontWeight: this.addModel.fontWeight,
headerFontSize: this.addModel.headerFontSize,
headerFontWeight: this.addModel.headerFontWeight,
fontSize: this.addModel.fontSize,
fontWeight: this.addModel.fontWeight,
headerContextList: this.addModel.headerContextList,
_type: 'StateTable'
};
@ -287,6 +293,7 @@ export default {
this.buttonText = '立即创建';
this.showDeleteButton = false;
this.addModel = {
z2: '',
code: '',
x: 10,
y: 10,
@ -294,14 +301,14 @@ export default {
borderColor: '',
columnNum: 2,
rowNum: 2,
columnWidthList: [50, 50],
rowHeightList: [25, 25],
columnWidthList: [50, 50],
rowHeightList: [25, 25],
headerType: 'normal',
tableData: [{}, {}],
headerFontSize: 14,
headerFontWeight: 450,
fontSize: 12,
fontWeight: 450,
headerFontSize: 14,
headerFontWeight: 450,
fontSize: 12,
fontWeight: 450,
headerContextList: []
};
},
@ -323,17 +330,17 @@ export default {
}
},
changeRowNum(num) {
const len = this.addModel.rowHeightList.length;
const length = this.addModel.tableData.length;
const len = this.addModel.rowHeightList.length;
const length = this.addModel.tableData.length;
if (length + 1 > num) {
this.addModel.rowHeightList.splice(num - 1, len - num);
this.addModel.rowHeightList.splice(num - 1, len - num);
this.addModel.tableData.splice(num - 2, length + 1 - num);
} else if (length + 1 < num) {
for (let i = 0; i < num - length - 1; i++) {
this.addModel.rowHeightList.push(25);
for (let i = 0; i < num - length - 1; i++) {
this.addModel.rowHeightList.push(25);
this.addModel.tableData.push({});
}
}
}
}
}

View File

@ -42,7 +42,7 @@
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="圆形" name="IscsCircle">
<el-tab-pane label="圆形" name="IscsCircle">
<iscs-circle
ref="iscsCircle"
style="width: 100%;height: 100%;"
@ -50,7 +50,7 @@
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="三角形" name="IscsTriangle">
<el-tab-pane label="三角形" name="IscsTriangle">
<iscs-triangle
ref="iscsTriangle"
style="width: 100%;height: 100%;"
@ -58,7 +58,7 @@
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="图片" name="IscsPicture">
<el-tab-pane label="图片" name="IscsPicture">
<iscs-picture
ref="iscsPicture"
style="width: 100%;height: 100%;"
@ -66,7 +66,7 @@
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="表格" name="StateTable">
<el-tab-pane label="表格" name="StateTable">
<state-table
ref="stateTable"
style="width: 100%;height: 100%;"
@ -74,6 +74,14 @@
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="箭头" name="IscsArrow">
<iscs-arrow
ref="iscsArrow"
style="width: 100%;height: 100%;"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
</el-tabs>
</el-card>
</div>
@ -86,22 +94,23 @@ import IscsText from '../icscComponents/text';
import IscsRect from '../icscComponents/rect';
import IscsButton from '../icscComponents/button';
import IscsCircle from '../icscComponents/circle';
import IscsArrow from '../icscComponents/arrow';
import IscsTriangle from '../icscComponents/triangle';
import IscsPicture from '../icscComponents/picture';
import StateTable from '../icscComponents/stateTable';
export default {
name: 'IscsOperate',
components: {
IscsRect,
IscsLine,
IscsText,
IscsButton,
IscsCircle,
IscsTriangle,
IscsPicture,
StateTable
IscsButton,
IscsArrow,
IscsCircle,
IscsTriangle,
IscsPicture,
StateTable
},
mixins: [
],

View File

@ -16,14 +16,14 @@
<span>{{ covertFaultType(scope.row) }}</span>
</template>
</el-table-column>
<el-table-column prop="condition" label="触发方式">
<template slot-scope="scope">
<span>{{ scope.row.condition.type === 'DEVICE'?'设备':'时间' }}</span>
</template>
</el-table-column>
<!--<el-table-column prop="condition" label="触发方式">-->
<!--<template slot-scope="scope">-->
<!--<span>{{ scope.row.condition.type === 'DEVICE'?'设备':'时间' }}</span>-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column prop="condition" label="触发设备" width="150">
<template slot-scope="scope">
<span>{{ `${deviceMap[scope.row.condition.triggerDeviceType]}${formatNameByCode(scope.row.condition.triggerDeviceCode)}` }}</span>
<span>{{ `${deviceMap[scope.row.condition.triggerDeviceType] || ''}${formatNameByCode(scope.row.condition.triggerDeviceCode)}` }}</span>
</template>
</el-table-column>
<el-table-column prop="condition" label="触发状态">
@ -36,7 +36,7 @@
<span>{{ `${formatNameByCode(scope.row.condition.triggerAssociatedDeviceCode)}` }}</span>
</template>
</el-table-column>
<el-table-column prop="condition.triggeringTime" label="触发时间" />
<el-table-column prop="condition.triggerTime" label="触发时间" width="180" />
<el-table-column prop="triggeringTime" label="故障状态">
<template slot-scope="scope">
<span>{{ scope.row.triggeringTime? '已触发': '未触发' }}</span>
@ -61,16 +61,16 @@
<el-input v-model="targetDevice.name || targetDevice.code" disabled size="small" class="inputModelClass" style="width: 200px;" />
<!--<el-button :type="field === 'targetActive' ? 'danger' : 'primary'" size="small" @click="hover('targetActive')">{{ $t('map.activate') }}</el-button>-->
</el-form-item>
<el-form-item label="触发方式">
<el-select v-model="triggerMode" size="small" style="width: 200px;" @change="changeTriggerMode">
<el-option
v-for="item in triggerModeList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<!--<el-form-item label="触发方式">-->
<!--<el-select v-model="triggerMode" size="small" style="width: 200px;" @change="changeTriggerMode">-->
<!--<el-option-->
<!--v-for="item in triggerModeList"-->
<!--:key="item.value"-->
<!--:label="item.label"-->
<!--:value="item.value"-->
<!--/>-->
<!--</el-select>-->
<!--</el-form-item>-->
<el-form-item label="故障类型">
<el-select v-model="faultRule.faultType" placeholder="请选择" class="inputModelClass" size="small" style="width: 200px;">
<el-option
@ -97,13 +97,13 @@
/>
</el-select>
</el-form-item>
<el-form-item v-if="triggerMode === 'DEVICE' && faultRule.condition.triggerDeviceType === 'TRAIN' && faultRule.condition.triggerDeviceStatus === 'Section'" label="关联设备">
<el-form-item v-if="triggerMode === 'DEVICE'" label="关联设备">
<el-input v-model="triggerAssociatedDevice" size="small" disabled class="inputModelClass" style="width: 140px;" />
<el-button :type="field === 'triggerAssociated'? 'danger': 'primary'" size="small" @click="hover('triggerAssociated')">{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item v-if="triggerMode === 'TIME'" label="触发时间">
<el-date-picker
v-model="faultRule.condition.triggeringTime"
v-model="faultRule.condition.triggerTime"
size="small"
format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss"
@ -155,7 +155,7 @@ export default {
triggerDeviceStatus:'',
triggerDeviceType :'',
type:'DEVICE',
triggeringTime: '',
triggerTime: '',
triggerAssociatedDeviceCode: ''
}
},
@ -232,6 +232,9 @@ export default {
return name;
},
formatTriggerStatus(condition) {
if (!condition.triggerDeviceType) {
return '';
}
const faultStatus = FaultStatusEnum[condition.triggerDeviceType];
return faultStatus[condition.triggerDeviceStatus];
},
@ -314,6 +317,7 @@ export default {
this.faultTypeList = deviceFaultType[this.targetDevice._type];
this.faultRule.targetDeviceCode = this.targetDevice.code;
this.faultRule.targetDeviceType = this.covertType(this.targetDevice._type);
this.faultRule.faultType = (this.faultTypeList[0] || {}).value;
this.$nextTick(()=>{
this.dragEvent();
});
@ -332,7 +336,7 @@ export default {
triggerDeviceStatus:'',
triggerDeviceType :'',
type:'DEVICE',
triggeringTime: '',
triggerTime: '',
triggerAssociatedDeviceCode: ''
}
};
@ -391,7 +395,7 @@ export default {
this.$messageBox('请选择故障类型');
return;
}
if (this.triggerMode === 'TIME' && this.faultRule.condition.triggeringTime == '') {
if (this.triggerMode === 'TIME' && this.faultRule.condition.triggerTime == '') {
this.$messageBox('请选择触发时间');
return;
}
@ -408,7 +412,7 @@ export default {
triggerDeviceStatus:this.faultRule.condition.triggerDeviceStatus || null,
triggerDeviceType :this.faultRule.condition.triggerDeviceType || null,
type:this.faultRule.condition.type,
triggeringTime: this.faultRule.condition.triggeringTime || null,
triggerTime: this.faultRule.condition.triggerTime || null,
triggerAssociatedDeviceCode: this.faultRule.condition.triggerAssociatedDeviceCode || null
}
};
@ -420,7 +424,7 @@ export default {
});
},
deviceSelect(em) {
if (this.field.toUpperCase() === 'triggerAssociated'.toUpperCase()) {
if (this.field.toUpperCase() === 'triggerAssociated'.toUpperCase() && em._type.toUpperCase() === 'Section'.toUpperCase()) {
// if (em._type == 'Station') {
// em = this.$store.getters['map/getDeviceByCode'](em.zcCode);
// }
@ -432,7 +436,7 @@ export default {
this.triggerAssociatedDevice = em._type + '-' + em.name;
}
this.faultRule.condition.triggerAssociatedDeviceCode = em.code;
} else if (this.field.toUpperCase() === 'triggerActive'.toUpperCase()) {
} else if (this.field.toUpperCase() === 'triggerActive'.toUpperCase() && em._type.toUpperCase() === 'Train'.toUpperCase()) {
this.faultRule.condition.triggerDeviceType = this.covertType(em._type);
this.faultRule.condition.triggerDeviceCode = em.code;
if (em._type.toUpperCase() === 'Section'.toUpperCase() && em.parentName) {
@ -451,7 +455,7 @@ export default {
});
}
this.field = '';
this.faultRule.condition.triggerDeviceStatus = '';
this.faultRule.condition.triggerDeviceStatus = (this.triggerStatusList[0] || {}).value;
}
},
dragEvent() {