ISCS调整

This commit is contained in:
fan 2021-04-06 17:48:33 +08:00
parent a8ec3f1d79
commit 9a84b61e5a
10 changed files with 155 additions and 94 deletions

View File

@ -116,6 +116,13 @@ class Iscs {
// loadStyle(lineCode) {
// return selectLineCode(lineCode);
// }
hideShowElementType(deviceType, subType) {
for (const val in this.iscsDevice) {
if (this.iscsDevice[val].model._type === deviceType && this.iscsDevice[val].model.type.includes(subType)) {
this.$painter.hideShowElement(this.iscsDevice[val]);
}
}
}
setCenter(deviceCode) {
const device = this.iscsDevice[deviceCode];

View File

@ -53,7 +53,10 @@ class Painter {
this.add(device);
});
}
/** 视图显影控制 */
hideShowElement(device) {
device.instance.hideShowElement();
}
/**
* 添加视图
* @param {*} device

View File

@ -112,28 +112,28 @@ export default class Button extends Group {
this.grouper.add(this.textButtonRect);
this.grouper.add(this.lineLeftTop);
this.grouper.add(this.lineBottomRight);
if (this.model.function == 'ElementShow') {
this.textButtonRectSmall = new Rect({
zlevel: model.zlevel,
z: model.z,
z2: model.z2 || 0,
shape: {
x: textRect.x - model.levelPadding + 6,
y: textRect.y - model.verticalPadding + 6,
width: textRect.width + 2 * model.levelPadding - 12,
height: textRect.height + 2 * model.verticalPadding - 12,
},
style: {
lineWidth: model.isTransparent ? 0: 2,
fill: model.fillColor||'rgba(0,0,0,0)',
stroke: '#908A90'
}
});
this.grouper.add(this.textButtonRectSmall);
this.textButtonRect.setStyle({fill: model.fillColor||'#D1C2C2'});
this.lineLeftTop.setStyle({stroke: '#ffffff'});
this.lineBottomRight.setStyle({stroke: '#948390'});
} else {
// if (this.model.function == 'ElementShow') {
// this.textButtonRectSmall = new Rect({
// zlevel: model.zlevel,
// z: model.z,
// z2: model.z2 || 0,
// shape: {
// x: textRect.x - model.levelPadding + 6,
// y: textRect.y - model.verticalPadding + 6,
// width: textRect.width + 2 * model.levelPadding - 12,
// height: textRect.height + 2 * model.verticalPadding - 12,
// },
// style: {
// lineWidth: model.isTransparent ? 0: 2,
// fill: model.fillColor||'rgba(0,0,0,0)',
// stroke: '#908A90'
// }
// });
// this.grouper.add(this.textButtonRectSmall);
// this.textButtonRect.setStyle({fill: model.fillColor||'#D1C2C2'});
// this.lineLeftTop.setStyle({stroke: '#ffffff'});
// this.lineBottomRight.setStyle({stroke: '#948390'});
// } else {
this.on('mousedown', (e) => {
this.textButtonRect.setStyle({fill: model.fillColorActive});
this.lineLeftTop.setStyle({stroke: '#696969'});
@ -144,8 +144,7 @@ export default class Button extends Group {
this.lineLeftTop.setStyle({stroke: '#FFFFFF'});
this.lineBottomRight.setStyle({stroke: '#696969'});
});
}
// }
}
this.grouper.add(this.buttonText);
this.add(this.grouper);

View File

@ -72,12 +72,12 @@ import fireDamperGreen from '@/assets/iscs_picture/fireDamper_green.png';
import alarmLampRed from '@/assets/iscs_picture/alarmLamp_red.png';
import alarmLampBlue from '@/assets/iscs_picture/alarmLamp_blue.png';
import alarmLampGreen from '@/assets/iscs_picture/alarmLamp_green.png';
import bgStationA from '@/assets/iscs_picture/bg-station-A.png'
import bgStationB from '@/assets/iscs_picture/bg-station-B.png'
import bgStationC from '@/assets/iscs_picture/bg-station-C.png'
import bgStationD from '@/assets/iscs_picture/bg-station-D.png'
import bgStationE from '@/assets/iscs_picture/bg-station-E.png'
import bgStationF from '@/assets/iscs_picture/bg-station-F.png'
import bgStationA from '@/assets/iscs_picture/bg-station-A.png';
import bgStationB from '@/assets/iscs_picture/bg-station-B.png';
import bgStationC from '@/assets/iscs_picture/bg-station-C.png';
import bgStationD from '@/assets/iscs_picture/bg-station-D.png';
import bgStationE from '@/assets/iscs_picture/bg-station-E.png';
import bgStationF from '@/assets/iscs_picture/bg-station-F.png';
import bgDoorStationA from '@/assets/iscs_picture/bg-door-station-A.png';
import bgDoorStandA from '@/assets/iscs_picture/bg-door-stand-A.png';
import littleStation from '@/assets/iscs_picture/little-station.png';
@ -89,8 +89,8 @@ const pictureObj = {
'psdRight': psdRight,
'APF': iscsAPF,
'envPersonDoor': envPersonDoor,
's': fireBlue,
'a': fireRed,
'alarmButtonBlue': fireBlue,
'alarmButtonRed': fireRed,
hand,
fmBlue,
fmGray,
@ -220,4 +220,11 @@ export default class Picture extends Group {
rect.y = rect.y + this.model.point.y;
return rect;
}
hideShowElement() {
if (this.imageButton && this.imageButton.ignore) {
this.imageButton.show();
} else {
this.imageButton && this.imageButton.hide();
}
}
}

View File

@ -41,6 +41,7 @@ export default {
},
handleSave() {
const data = JSON.stringify(this.$store.state.iscs.iscs);
console.log(data, '===');
this.$emit('handleSave', data);
}
}

View File

@ -50,6 +50,16 @@
/>
</el-select>
</el-form-item>
<el-form-item v-if="form.function=== 'ElementShow'" label="隐藏元素类型:" prop="hideType">
<el-select v-model="form.hideType" size="small">
<el-option
v-for="item in hideTypeList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" @click="onSubmit('form')">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" size="small" type="danger" @click="deleteDevice">删除</el-button>
@ -96,14 +106,26 @@ export default {
textColor: '',
textColorActive: '#000',
fillColor: 'rgba(0,0,0,0)',
fillColorActive: 'rgba(0,0,0,0)'
fillColorActive: 'rgba(0,0,0,0)',
hideType: ''
},
hideTypeList: [
{ label: '温感器', value: 'alarmLamp' },
{ label: '烟感器', value: 'smokeDetector' },
{ label: '防火阀', value: 'fireDamper' },
{ label: '报警按钮', value: 'alarmButton' }
// { label: '', value: 'zanwu' },
// { label: '', value: '' }
],
rules: {
context: [
{ required: true, message: '请填写按钮文字', trigger: 'blur' }
],
function: [
{ required: true, message: '请选择按钮功能', trigger: 'change'}
],
hideType: [
{ required: true, message: '请选择显隐元素类型', trigger: 'change' }
]
}
};
@ -134,6 +156,7 @@ export default {
this.form.textColorActive = model.textColorActive || '#000';
this.form.fillColor = model.fillColor;
this.form.fillColorActive = model.fillColorActive;
this.hideType = model.hideType;
}
}
},
@ -190,7 +213,8 @@ export default {
textColor: this.form.textColor,
textColorActive: this.form.textColorActive,
fillColor: this.form.fillColor,
fillColorActive: this.form.fillColorActive
fillColorActive: this.form.fillColorActive,
hideType: this.form.hideType
};
this.$emit('createDataModel', rectModel);
this.initPage();
@ -214,7 +238,8 @@ export default {
function: this.form.function,
fontSize: this.form.fontSize,
fillColor: this.form.fillColor,
fillColorActive: this.form.fillColorActive
fillColorActive: this.form.fillColorActive,
hideType: this.form.hideType
};
this.$emit('deleteDataModel', rectModel);
},
@ -236,7 +261,8 @@ export default {
isTransparent: false,
textColorActive: '#000',
fillColor: '',
fillColorActive: ''
fillColorActive: '',
hideType: ''
};
}
}

View File

@ -60,8 +60,8 @@ export default {
{ name: '车尾', value: 'psdRight' },
{ name: '车厢', value: 'psdSystem' },
{ name: '人防门', value: 'envPersonDoor'},
{ name: '报警按钮蓝', value: 's'},
{ name: '报警按钮红', value: 'a'},
{ name: '报警按钮蓝', value: 'alarmButtonBlue'},
{ name: '报警按钮红', value: 'alarmButtonRed'},
{ name: 'APF', value: 'APF'},
{ name: '手动阀', value: 'hand'},
{ name: '蓝色-阀门', value: 'fmBlue'},
@ -135,7 +135,7 @@ export default {
{ name: '门禁站厅A', value: 'bgDoorStationA' },
{ name: '门禁站台A', value: 'bgDoorStandA' },
{ name: '小站台', value: 'littleStand' },
{ name: '小站厅', value: 'littleStation' },
{ name: '小站厅', value: 'littleStation' }
],
rules: {

View File

@ -110,6 +110,7 @@ export default {
this.tableShow = !this.tableShow;
},
handleSave(data) {
const param = {
graphData: data,
mapId: this.$route.query.mapId,
@ -117,6 +118,7 @@ export default {
totalSystem: this.$route.query.mode,
userInterface: this.$route.query.part
};
// console.log(data.iscsPictureList, '===');
saveIscsElement(param).then(resp => {
this.$message.success('ISCS数据保存成功');
}).catch(() => {

View File

@ -90,7 +90,6 @@ import IscsTriangle from '../icscComponents/triangle';
import IscsPicture from '../icscComponents/picture';
import StateTable from '../icscComponents/stateTable';
export default {
name: 'IscsOperate',
components: {

View File

@ -112,9 +112,8 @@ export default {
mapId: this.$route.query.mapId,
lineCode:'02',
noPreLogout:this.$route.query.noPreLogout,
partId: '',
partId: ''
};
let type = '';
if (em.deviceType == 'IscsButton') {
if (em.deviceModel.function == 'goToStand') {
@ -122,15 +121,33 @@ export default {
} else if (em.deviceModel.function == 'goToStation') {
type = 'afcOne02';
} else if (em.deviceModel.function.includes('goFireStation-') ) {
type = 'stationHall'
query.partSign = em.deviceModel.function.replace("goFireStation-", '');
type = 'stationHall';
query.partSign = em.deviceModel.function.replace('goFireStation-', '');
} else if (em.deviceModel.function.includes('goFireStand-') ) {
type = 'platform'
query.partSign = em.deviceModel.function.replace("goFireStand-", '');
}
type = 'platform';
query.partSign = em.deviceModel.function.replace('goFireStand-', '');
} else if (em.deviceModel.function === 'ElementShow') {
type = '';
switch (em.deviceModel.hideType) {
case 'alarmLamp':
this.$iscs.hideShowElementType('IscsPicture', 'alarmLamp');
break;
case 'smokeDetector':
this.$iscs.hideShowElementType('IscsPicture', 'smokeDetector');
break;
case 'fireDamper':
this.$iscs.hideShowElementType('IscsPicture', 'fireDamper');
break;
case 'alarmButton':
this.$iscs.hideShowElementType('IscsPicture', 'alarmButton');
break;
}
}
if (type) {
this.$router.replace({ path: `/displayIscs/system/stationConfig/${type}`, query: query });
}
}
},
//