代码调整

This commit is contained in:
joylink_cuiweidong 2022-10-19 16:43:42 +08:00
parent a1035a4e1f
commit ae5f211154
6 changed files with 653 additions and 5 deletions

View File

@ -134,6 +134,16 @@ export default {
components: { components: {
InfoBroadcast InfoBroadcast
}, },
props: {
stationName: {
type: String,
default: ''
},
stationId: {
type: String,
default: ''
}
},
data() { data() {
return { return {
verticalHeader: [ verticalHeader: [
@ -158,10 +168,10 @@ export default {
}, },
computed: { computed: {
currentStation() { currentStation() {
return this.stationList.find(station => station.code === this.$route.query.stationId); return this.stationList.find(station => station.code === this.stationId);
}, },
isSingleStation() { isSingleStation() {
return this.$route.query.stationId.startsWith('Station'); return this.stationId.startsWith('Station');
} }
}, },
watch: { watch: {
@ -262,7 +272,7 @@ export default {
releaseBroadcast(voice, type) { releaseBroadcast(voice, type) {
const iscsDeviceCodes = []; const iscsDeviceCodes = [];
this.selectedAreaList.forEach(item => { this.selectedAreaList.forEach(item => {
if (this.isSingleStation && !item.startsWith(this.$route.query.stationId)) return; if (this.isSingleStation && !item.startsWith(this.stationId)) return;
if (this.deviceMap[item]) { if (this.deviceMap[item]) {
iscsDeviceCodes.push(this.deviceMap[item].code); iscsDeviceCodes.push(this.deviceMap[item].code);
} }

View File

@ -0,0 +1,105 @@
<template>
<div v-dialogDrag>
<div
v-show="show"
class="iscs_fuzhou-01__systerm route-detail el-dialog"
>
<div class="el-dialog__header">
<span class="el-dialog__title">报警浏览</span>
<button type="button" aria-label="Close" class="el-dialog__headerbtn" @click="doClose">
<i class="el-dialog__close el-icon el-icon-close" />
</button>
</div>
<div class="el-dialog__body">
<div style="height: 300px;overflow: auto; margin-bottom: 15px;">
<div v-for="(item, index) in alarmList" :key="index">
<div v-if="item.key == 'frame'">{{ item.station }} {{ item.name }}</div>
<div v-if="item.key != 'frame'">{{ item.station }} {{ item.name }} 执行了 {{ item[item.key] ? 'XX保护动作' : '' }} {{ item[item.key] ? list[item.key][0] : list[item.key][1] }}操作</div>
</div>
</div>
<el-row justify="center" class="button-group">
<el-col :span="4" :offset="10">
<el-button type="primary" @click="commit">确定</el-button>
</el-col>
</el-row>
</div>
</div>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
export default {
name: '',
data() {
return {
dialogShow: false,
elemList: [],
list: {
valve: ['控分', '控合']
}
};
},
computed: {
...mapGetters('iscs', [
'alarmList'
]),
show() {
return this.dialogShow;
}
},
methods: {
doShow() {
this.dialogShow = true;
this.elemList = [];
},
doClose() {
this.dialogShow = false;
this.$store.dispatch('iscs/setDelIncidentList');
},
commit() {
//
this.$store.commit('iscs/setCloseMusic', 1);
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.route-detail{
position: absolute;
left: calc(50% - 250px);
margin-top: 15vh;
width: 500px;
z-index: 2000;
box-sizing: border-box;
background: rgba(100, 100, 100, 0.3);
border: 2px solid rgba(144, 144, 144, 0.8);
border-radius: 6px;
color: #000;
font-size: 14px;
.el-dialog__header{
padding: 0px 8px;
height: 26px;
.el-dialog__headerbtn{
background: linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
border: 1px solid #fff;
border-radius: 4px;
top: 4px;
right: 12px;
line-height: 16px;
color: #fff;
.el-icon{
color: #fff;
}
}
}
.el-dialog__body{
background: #fff;
margin: 5px;
margin-top: 0;
padding: 10px;
padding-bottom: 0;
}
}
</style>

View File

@ -0,0 +1,63 @@
<template>
<div>
<el-dialog
v-dialogDrag
class="iscs_fuzhou-01__systerm route-detail"
title="事件浏览器"
:visible.sync="show"
width="800px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-table border :data="incidentList" style="width: 100%;" height="450px">
<el-table-column label="日期/时间" prop="times" />
<el-table-column label="站台" prop="station" />
<el-table-column label="开关名称" prop="name" />
<el-table-column label="值" width="120">
<template slot-scope="scope" style="padding: 0;">
<span v-if="scope.row.key == 'valve'">{{ scope.row[scope.row.key] ? list[scope.row.key][0] : list[scope.row.key][1] }}</span>
</template>
</el-table-column>
</el-table>
</el-dialog>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
export default {
name: '',
data() {
return {
dialogShow: false,
elemList: [],
list: {
valve: ['分位', '合位']
}
};
},
computed: {
...mapGetters('iscs', [
'incidentList'
]),
show() {
return this.dialogShow;
}
},
methods: {
doShow() {
this.dialogShow = true;
this.elemList = [];
},
doClose() {
this.dialogShow = false;
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
</style>

View File

@ -0,0 +1,390 @@
<template>
<div>
<el-dialog
v-dialogDrag
class="iscs_fuzhou-01__systerm route-detail"
:title="title"
:visible.sync="show"
width="300px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<!-- 设置故障 -->
<el-form ref="form" size="small" label-width="90px" :model="formModel" :rules="rules">
<el-form-item label="故障列表:" prop="value">
<el-select v-model="formModel.value" placeholder="请选择故障">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-form>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button type="primary" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button @click="cancel">取消</el-button>
</el-col>
</el-row>
</el-dialog>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { setNum } from '@/iscs/status/mapElement.js';
import mapElement from '@/iscs/status/mapElement.js';
import {deviceFactory} from '@/iscs/utils/parser';
export default {
name: '',
data() {
return {
dialogShow: false,
elemList: [],
formModel: {
value: ''
},
rules: {
value: [
{ required: true, message: '请选择故障', trigger: 'blur' }
]
},
options: [
{ label: '104A断路器故障', value: 'group_2' },
{ label: '104B断路器故障', value: 'group_52' },
{ label: '框架电流保护故障', value: 'frame_group' },
{ label: '闸机故障', value: 'gate_fault' }
],
list: {
valve: ['控分', '控合']
},
farmed: '',
type: ''
};
},
computed: {
...mapGetters('iscs', [
'alarmList'
]),
show() {
return this.dialogShow;
},
title() {
return this.type === 'CANCEL' ? '故障取消' : '故障设置';
}
},
methods: {
doShow(type) {
this.type = type;
if (type === 'CANCEL') {
this.options = [{ label: '闸机故障', value: 'gate_fault' }];
}
this.dialogShow = true;
this.elemList = [];
},
doClose() {
this.dialogShow = false;
this.$store.dispatch('iscs/setDelIncidentList');
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
this.farmed = '';
if (this.formModel.value == 'frame_group') {
this.setMalfunction();
} else if (this.formModel.value === 'gate_fault') {
if (this.$route.query.stationId && this.$route.params.mode === 'autoTicket') {
this.$store.dispatch('iscs/handlerGateFaultList', { type: this.type, stationCode: this.$route.query.stationId });
} else {
this.$message.error('请在车站自动售检票系统中设置或取消故障!');
}
} else {
this.setModelMalfunction(this.$iscs.iscsDevice[this.formModel.value].model);
}
this.dialogShow = false;
if (this.formModel.value == 'group_2') {
this.$message.success('104A断路器分位');
} else if (this.formModel.value == 'group_52') {
this.$message.success('104B断路器分位');
}
} else {
return false;
}
});
},
setModelMalfunction(model) {
model.valve = true;
this.handleModel(model, true);
this.relevance(model);
},
relevance(model) {
let time = 0;
let modelRelevance = {};
if (model.code == 'group_2' && model['valve']) {
modelRelevance = this.$iscs.iscsDevice['group_34'].model;
modelRelevance['valve'] = model['valve'];
} else if (model.code == 'group_52' && model['valve']) {
modelRelevance = this.$iscs.iscsDevice['group_22'].model;
modelRelevance['valve'] = model['valve'];
}
if (modelRelevance && modelRelevance.code) {
this.handleModel(modelRelevance, true);
time = 1500;
}
setTimeout(() => {
if ((model.code == 'group_2' && model['valve']) || (model.code == 'group_52' && model['valve'])) {
const model1 = this.$iscs.iscsDevice['group_9'].model;
model1['valve'] = model['valve'];
const model2 = this.$iscs.iscsDevice['group_21'].model;
model2['valve'] = model['valve'];
const model3 = this.$iscs.iscsDevice['group_19'].model;
model3['valve'] = model['valve'];
const model4 = this.$iscs.iscsDevice['group_8'].model;
model4['valve'] = model['valve'];
this.handleModel(model1, true);
this.handleModel(model2, true);
this.handleModel(model3, true);
this.handleModel(model4, true);
time = 1500;
}
setTimeout(() => {
let models = {};
// valve true 绿 false
if (model.code == 'group_2' || model.code == 'group_52') {
models = this.$iscs.iscsDevice['group_54'].model;
models['valve'] = false;
} else if (model.code == 'group_3' || model.code == 'group_16') {
models = this.$iscs.iscsDevice['group_15'].model;
models['valve'] = false;
}
if (models && models.code) {
this.handleModel(models, true);
}
}, time);
}, time);
},
//
handleModel(model, judge = true) {
const arr = [];
model.statusList.forEach(item => {
if (item.key == 'valve' && item.value == model.valve) {
item.childList.forEach(ele => {
Object.values(model.elemMap).forEach(elem => {
if (elem.type == ele.type) {
arr.push({
code: elem.code,
...mapElement[ele.type].stateMap[ele.status]
});
}
});
});
}
});
const models = [{...model, valve: model.valve}];
this.$store.dispatch('iscs/updateIscsDevices', models.map(el => {
const device = deviceFactory(el._type, el);
return device.model;
}));
if (model.lineCode) {
//
model.lineCode.forEach(item => {
arr.push({
code: item,
strokeColor: model.valve ? '#00FF1E' : '#FF0000'
});
});
}
//
arr.forEach(el => {
const device = this.$iscs.iscsDevice[el.code];
if (device && device.instance) {
device.instance.setState(el);
}
});
const textList = setNum(Object.values(model.elemMap), true);
textList.forEach(el => {
const device = this.$iscs.iscsDevice[el.code];
if (device && device.instance) {
device.instance.setState(el);
}
});
//
if (judge) {
const params = {
name: model.name + this.farmed,
times: this.filterTime(),
station: this.$route.query.stationName,
key: 'valve',
valve: model.valve
};
this.$store.dispatch('iscs/setAddAlarmList', params);
this.$store.dispatch('iscs/setAddIncidentList', params);
}
if (model.code == 'group_34' || model.code == 'group_22') {
const judge = !(this.$iscs.iscsDevice['group_34'].model['valve'] || this.$iscs.iscsDevice['group_22'].model['valve']);
['IscsText_112', 'IscsText_113', 'IscsText_114', 'IscsText_116', 'IscsText_117', 'IscsText_118', 'IscsText_119', 'IscsText_120'].forEach(code => {
const device = this.$iscs.iscsDevice[code];
if (device && device.instance) {
device.instance.setState({
gbColor: judge ? '#2aff00' : '#ff0000'
});
}
});
}
},
filterTime() {
const date = new Date();
const dateTime = this.dateFormat('YYYY-mm-dd HH:MM:SS', date);
return dateTime;
},
dateFormat(fmt, date) {
let ret;
const opt = {
'Y+': date.getFullYear().toString(), //
'm+': (date.getMonth() + 1).toString(), //
'd+': date.getDate().toString(), //
'H+': date.getHours().toString(), //
'M+': date.getMinutes().toString(), //
'S+': date.getSeconds().toString() //
};
for (const k in opt) {
ret = new RegExp('(' + k + ')').exec(fmt);
if (ret) {
fmt = fmt.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, '0')));
}
}
return fmt;
},
//
setMalfunction() {
// group_11 group_12 group_24 group_53 group_35 group_43 group_47 group_48
this.$iscs.iscsDevice['group_11'].model['valve'] = true;
this.$iscs.iscsDevice['group_12'].model['valve'] = true;
this.$iscs.iscsDevice['group_24'].model['valve'] = true;
this.$iscs.iscsDevice['group_53'].model['valve'] = true;
this.$iscs.iscsDevice['group_35'].model['valve'] = true;
this.$iscs.iscsDevice['group_43'].model['valve'] = true;
this.$iscs.iscsDevice['group_47'].model['valve'] = true;
this.$iscs.iscsDevice['group_48'].model['valve'] = true;
this.farmed = '';
this.handleModel(this.$iscs.iscsDevice['group_11'].model);
const promise1 = new Promise((resolve) => {
setTimeout(() => {
this.handleModel(this.$iscs.iscsDevice['group_24'].model);
setTimeout(() => {
this.handleModel(this.$iscs.iscsDevice['group_35'].model);
this.handleModel(this.$iscs.iscsDevice['group_43'].model);
resolve();
}, 500);
}, 500);
});
this.handleModel(this.$iscs.iscsDevice['group_12'].model);
const promise2 = new Promise((resolve) => {
setTimeout(() => {
this.handleModel(this.$iscs.iscsDevice['group_53'].model);
setTimeout(() => {
this.handleModel(this.$iscs.iscsDevice['group_47'].model);
this.handleModel(this.$iscs.iscsDevice['group_48'].model);
resolve();
}, 500);
}, 500);
});
const device = this.$iscs.iscsDevice['IscsButton_6'];
device.model['fault'] = true;
if (device && device.instance) {
device.instance.setState({
backgroundColor: '#FF0000'
});
}
this.$store.commit('iscs/setFaultList', [
{
stationName: '罗汉山站',
list: [
{ code: 'group_11', valve: true },
{ code: 'group_12', valve: true },
{ code: 'group_24', valve: true },
{ code: 'group_53', valve: true },
{ code: 'group_35', valve: true },
{ code: 'group_43', valve: true },
{ code: 'group_47', valve: true },
{ code: 'group_48', valve: true },
{ code: 'IscsButton_6', fault: true }
]
},
{
stationName: '象峰站',
list: [
{ code: 'group_31', valve: true },
{ code: 'group_33', valve: true }
]
},
{
stationName: '树兜站',
list: [
{ code: 'group_35', valve: true },
{ code: 'group_23', valve: true }
]
}
]);
Promise.all([promise1, promise2]).then(() => {
this.$message.success('105/106/201/202/211/212/213/214开关因为框架电流保护动作跳闸分位');
this.handleAlarm();
});
},
handleAlarm() {
const list = [
{
name: '211断路器',
times: this.filterTime(),
station: '象峰站'
},
{
name: '212断路器',
times: this.filterTime(),
station: '象峰站'
},
{
name: '211断路器',
times: this.filterTime(),
station: '树兜站'
},
{
name: '212断路器',
times: this.filterTime(),
station: '树兜站'
}
];
list.forEach(item => {
const params = {
name: item.name,
times: item.times,
station: item.station,
key: 'valve',
valve: true
};
this.$store.dispatch('iscs/setAddAlarmList', params); //
this.$store.dispatch('iscs/setAddIncidentList', params); //
});
},
cancel() {
this.dialogShow = false;
this.formModel = {
value: ''
};
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
</style>

View File

@ -13,7 +13,7 @@
<time-preview-pa v-else-if="mode === 'paPreview'" /> <time-preview-pa v-else-if="mode === 'paPreview'" />
<pids-emergency v-else-if="mode === 'pidsEmergency'" /> <pids-emergency v-else-if="mode === 'pidsEmergency'" />
<pids-lcd v-else-if="mode === 'pidsLcd'" /> <pids-lcd v-else-if="mode === 'pidsLcd'" />
<pids-main v-else-if="mode === 'pidsMain'" /> <pids-main v-else-if="mode === 'pidsMain'" :station-id="stationId" />
<pids-preview v-else-if="mode === 'pidsPreview'" /> <pids-preview v-else-if="mode === 'pidsPreview'" />
</div> </div>

View File

@ -56,7 +56,18 @@
</div> </div>
</div> </div>
</div> </div>
<!-- v-if="!noPreLogout" -->
<div class="bottom-back" @click="back">返回</div>
<div class="bottom-back" @click="handleAlarmInfo">
报警
</div>
<div class="bottom-back" @click="getIncidentList">事件</div>
<div class="bottom-back" @click="cancelMalfunction">故障取消</div>
<div class="bottom-back" @click="handleMalfunction">故障设置</div>
</div> </div>
<alarm-config ref="alarmConfig" />
<incident-config ref="incidentConfig" />
<malfunction ref="malfunction" />
</div> </div>
</template> </template>
<script> <script>
@ -68,8 +79,16 @@ import iscs_icon4 from '@/assets/iscs_system/iscs_icon4.png';
import iscs_icon5 from '@/assets/iscs_system/iscs_icon5.png'; import iscs_icon5 from '@/assets/iscs_system/iscs_icon5.png';
import iscs_icon6 from '@/assets/iscs_system/iscs_icon6.png'; import iscs_icon6 from '@/assets/iscs_system/iscs_icon6.png';
import iscs_icon7 from '@/assets/iscs_system/iscs_icon7.png'; import iscs_icon7 from '@/assets/iscs_system/iscs_icon7.png';
import alarmConfig from './stationConfig/dialog/alarm';
import incidentConfig from './stationConfig/dialog/incident';
import malfunction from './stationConfig/dialog/malfunction';
export default { export default {
name:'', name:'StationNav',
components: {
alarmConfig,
incidentConfig,
malfunction
},
data() { data() {
return { return {
selectStation: 'mainHouseOne', selectStation: 'mainHouseOne',
@ -363,6 +382,38 @@ export default {
this.buttonId = child.id; this.buttonId = child.id;
this.selectChildren(child.id); this.selectChildren(child.id);
} }
},
//
handleAlarmInfo() {
// if (!this.alarmInfo) {
this.$refs.alarmConfig.doShow();
// }
},
//
getIncidentList() {
this.$refs.incidentConfig.doShow();
},
//
handleMalfunction() {
this.$refs.malfunction.doShow('SET');
},
cancelMalfunction() {
this.$refs.malfunction.doShow('CANCEL');
},
back() {
history.go(-1);
// this.clearSubscribe();
// if (this.projectDevice) {
// this.$store.dispatch('LogOut').then(() => {
// location.reload();
// });
// } else {
// clearSimulation(this.$route.query.group).then(resp => {
// this.$router.push({ path: `/trainingPlatform` });
// }).catch(()=> {
// this.$message.error('仿');
// });
// }
} }
} }
}; };
@ -634,5 +685,34 @@ background:rgba(231,237,253,0.9);
border-left: 1px #e2e3e3 solid; border-left: 1px #e2e3e3 solid;
top: 5%; top: 5%;
} }
.bottom-back{
padding: 2px 10px;
background: #c0c0c0;
margin-top: 3px;
border-top: 2px #f7f7f7 solid;
border-left: 2px #f7f7f7 solid;
border-right: 2px #7e7e7e solid;
border-bottom: 2px #7e7e7e solid;
cursor: pointer;
font-size: 0.8vw;
float: right;
margin-right: 5px;
position: relative;
&.disable_box{
background: #7b7b7b;
}
&:active{
background: #7b7b7b;
}
.point_box{
position: absolute;
right: -4px;
top: -2px;
width: 9px;
height: 9px;
border-radius: 50%;
background: red;
}
}
</style> </style>