This commit is contained in:
joylink_cuiweidong 2020-07-20 16:46:55 +08:00
commit b1821d8274
10 changed files with 118 additions and 37 deletions

View File

@ -84,6 +84,14 @@ export function setIbpConfig(id, data) {
data: data
});
}
/** 添加/修改psc控制柜网关映射配置 */
export function setPscConfig(id, data) {
return request({
url: `/api/device/${id}/config/psc`,
method: 'put',
data: data
});
}
/** 查询项目下的所有设备 */
export function getAllDeviceInProject(params) {
return request({

View File

@ -231,7 +231,8 @@ export default {
{label: '车辆段终端', value: 'DEPOT'},
{label: '虚拟CCTV', value: 'CCTV'},
{label: 'PLC网关', value: 'PLC_GATEWAY'},
{label: '端头控制盒', value: 'PSL'}
{label: '端头控制盒', value: 'PSL'},
{label: 'PSC控制柜', value: 'PSC'}
]
}
};

View File

@ -2,9 +2,9 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
// BASE_API = 'http://b29z135112.zicp.vip';

View File

@ -79,6 +79,7 @@
<el-checkbox v-model="isAutoLogin">{{ $t('login.autoLogin') }}</el-checkbox>
</div>
<el-popover
v-if="!project.endsWith('heb')"
placement="right"
title=""
width="200"

View File

@ -59,6 +59,7 @@
:conversition-member-list="conversitionMemberList"
:message-list="messageList"
:simulation-users="simulationUsers"
:common-conversation="commonConversation"
:user-role="userRole"
@changeMessageList="changeMessageList"
/>

View File

@ -46,6 +46,10 @@ export default {
userRole: {
type: String,
required: true
},
commonConversation: {
type: Boolean,
required: true
}
},
data() {
@ -76,7 +80,7 @@ export default {
}
}
this.scrollTop();
} else if (this.userRole === 'AUDIENCE') {
} else if (this.userRole === 'AUDIENCE' || this.commonConversation) {
this.$emit('changeMessageList', conversationInfo.message);
if (member && member.userId != this.$store.state.user.id) {
this.currentAudioList.push(this.baseUrl + '/audio/' + conversationInfo.message.audioPath);

View File

@ -37,7 +37,6 @@ import SetTime from '@/views/newMap/displayNew/demon/setTime';
import { ranAsPlan, exitRunPlan, clearSimulation } from '@/api/simulation';
import { exitFullscreen } from '@/utils/screen';
import { getSimulationQrcode } from '@/api/jointSimulation';
// import { EventBus } from '@/scripts/event-bus';
import { getSessionStorage } from '@/utils/auth';
import RealDevice from './menuDraft/realDevice';
import { refereeExitSimulation, quitCurrentRace, startPracticalCompetition, submitPracticalCompetition } from '@/api/competition';

View File

@ -1,7 +1,7 @@
<template>
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="60%" :before-close="handleClose" center :close-on-click-modal="false">
<data-form ref="datatop" :form="formTop" :inline="inline" :form-model="formModel" :rules="topRules" />
<el-form v-if="data.type === 'PSL'" ref="form" :model="formModel" label-width="220px" :rules="topRules" :inline="inline">
<el-form v-if="data.type === 'PSL' || data.type === 'PSC'" ref="form" :model="formModel" label-width="220px" :rules="topRules" :inline="inline">
<el-form-item label="关联地图:" prop="mapId">
<el-select v-model="mapId" placeholder="请选择" size="small" style="width: 180px" @change="mapIdChange">
<el-option
@ -44,17 +44,17 @@
</el-form-item>
</el-form>
<el-row :gutter="20">
<el-col :span="12">
<el-col :span="data.type !== 'PSC'?12:24">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>输入配置:</span>
</div>
<div style="margin-top: 20px">
<data-form ref="dataleft" :form="formLeft" :form-model="formModel" :rules="leftRules" />
<data-form ref="dataleft" :form="formLeft" :form-model="formModel" :rules="leftRules" :inline="data.type === 'PSC'" />
</div>
</el-card>
</el-col>
<el-col :span="12">
<el-col v-if="data.type !== 'PSC'" :span="12">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>输出配置:</span>
@ -73,7 +73,7 @@
</template>
<script>
import { getDeviceDetail, setPsdConfig, setSignalConfig, setSwitchConfig, setPslConfig } from '@/api/project';
import { getDeviceDetail, setPsdConfig, setSignalConfig, setSwitchConfig, setPslConfig, setPscConfig } from '@/api/project';
import { getAllMapOnline, getStationListNeedAttendant, getPsdListByStandCode, getStandListByStationCode } from '@/api/jmap/map';
export default {
@ -90,7 +90,7 @@ export default {
setDeviceConfigFunction: null,
addrName: '',
data: {},
titleMap: { SWITCH: '道岔', PSD:'屏蔽门', SIGNAL: '信号机', PSL:'端头控制盒' },
titleMap: { SWITCH: '道岔', PSD:'屏蔽门', SIGNAL: '信号机', PSL:'端头控制盒', PSC: 'PSC控制柜' },
psdLeftValue: [
{label: '输入-是否关门位', value: 'i_c'},
{label: '输入-PSL关门按钮位', value: 'i_dc_b'},
@ -112,11 +112,11 @@ export default {
],
switchValue: [
{label: '网关地址', value: 'addr'},
{label: '输入-定位表示', value: 'rnp'},
{label: '输入-反位表示', value: 'rrp'},
{label: '输入-锁闭表示位', value: 'rl'},
{label: '输出-定操(normal)控制位', value: 'wnp'},
{label: '输出-反操(reverse)控制位', value: 'wrp'}
{label: '定位表示', value: 'rnp'},
{label: '反位表示', value: 'rrp'},
{label: '定位控制', value: 'wnp'},
{label: '反位控制', value: 'wrp'},
{label: '锁闭控制', value: 'wl'}
],
signalLeftValue: [
{label: '输入-故障表示位', value: 'i_f'},
@ -377,39 +377,39 @@ export default {
this.formLeft = {
labelWidth: '220px',
items: [
{ prop: 'rnp', label: '输入-定位表示位:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0},
{ prop: 'rrp', label: '输入-反位表示位:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0},
{ prop: 'rl', label: '输入-锁闭表示位:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0}
{ prop: 'rnp', label: '定位表示:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0},
{ prop: 'rrp', label: '反位表示:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0}
]
};
this.leftRules = {
rnp: [
{ required: true, message: '请填写\'输入-定位表示位\'', trigger: 'blur' },
{ required: true, message: '请填写-定位表示', trigger: 'blur' },
{ validator: validateDevice, list: this.switchValue, trigger: ['blur', 'change'] }
],
rrp: [
{ required: true, message: '请填写\'输入-反位表示位\'', trigger: 'blur' },
{ validator: validateDevice, list: this.switchValue, trigger: ['blur', 'change'] }
],
rl: [
{ required: true, message: '请填写\'输入-锁闭表示位\'', trigger: 'blur' },
{ required: true, message: '请填写反位表示', trigger: 'blur' },
{ validator: validateDevice, list: this.switchValue, trigger: ['blur', 'change'] }
]
};
this.formRight = {
labelWidth: '160px',
items: [
{ prop: 'wnp', label: '输出-定操控制位:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0},
{ prop: 'wrp', label: '输出-反操控制位:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0}
{ prop: 'wnp', label: '定位控制:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0},
{ prop: 'wrp', label: '反位控制:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0},
{ prop: 'wl', label: '锁闭控制:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0}
]
};
this.rightRules = {
wnp: [
{ required: true, message: '请填写\'输出-定操(normal)控制位\'', trigger: 'blur' },
{ required: true, message: '请填写定位控制', trigger: 'blur' },
{ validator: validateDevice, list: this.switchValue, trigger: ['blur', 'change'] }
],
wrp: [
{ required: true, message: '请填写\'输出-反操(reverse)控制位\'', trigger: 'blur' },
{ required: true, message: '请填写反位控制', trigger: 'blur' },
{ validator: validateDevice, list: this.switchValue, trigger: ['blur', 'change'] }
],
wl: [
{ required: true, message: '请填写锁闭控制', trigger: 'blur' },
{ validator: validateDevice, list: this.switchValue, trigger: ['blur', 'change'] }
]
};
@ -494,6 +494,55 @@ export default {
};
break;
}
case 'PSC': {
this.setDeviceConfigFunction = setPscConfig;
this.addrName = '网关位地址:';
this.formLeft = {
labelWidth: '220px',
items: [
{ prop: 'wpslsn', label: 'PSL使能:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0},
{ prop: 'wpslkm', label: 'PSL开门:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0},
{ prop: 'wpslgm', label: 'PSL关门:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0},
{ prop: 'wpslhsjc', label: 'PSL互锁解除:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0},
{ prop: 'wibpsn', label: 'IBP使能:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0},
{ prop: 'wibpkm', label: 'IBP开门', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0},
{ prop: 'wibpgm', label: 'IBP关门', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0}
]
};
this.leftRules = {
wpslsn: [
{ required: true, message: '请填写PSL使能', trigger: 'blur' },
{ validator: validateDevice, list: this.pslLeftValue, trigger: ['blur', 'change'] }
],
wpslkm: [
{ required: true, message: '请填写PSL开门', trigger: 'blur' },
{ validator: validateDevice, list: this.pslLeftValue, trigger: ['blur', 'change'] }
],
wpslgm: [
{ required: true, message: '请填写PSL关门', trigger: 'blur' },
{ validator: validateDevice, list: this.pslLeftValue, trigger: ['blur', 'change'] }
],
wpslhsjc: [
{ required: true, message: '请填写PSL互锁解除', trigger: 'blur' },
{ validator: validateDevice, list: this.pslLeftValue, trigger: ['blur', 'change'] }
],
wibpsn: [
{ required: true, message: '请填写IBP使能', trigger: 'blur' },
{ validator: validateDevice, list: this.pslLeftValue, trigger: ['blur', 'change'] }
],
wibpkm: [
{ required: true, message: '请填写IBP开门', trigger: 'blur' },
{ validator: validateDevice, list: this.pslLeftValue, trigger: ['blur', 'change'] }
],
wibpgm: [
{ required: true, message: '请填写IBP关门', trigger: 'blur' },
{ validator: validateDevice, list: this.pslLeftValue, trigger: ['blur', 'change'] }
]
};
this.formRight = {};
this.rightRules = {};
break;
}
}
},
initData(row) {
@ -504,7 +553,7 @@ export default {
}).catch(()=> {
this.$message.error('获取项目设备详情失败!');
});
if (row.type === 'PSL') {
if (row.type === 'PSL' || row.type === 'PSC') {
getAllMapOnline().then(resp => {
if (resp.data && resp.data.length) {
this.mapList = resp.data;
@ -532,7 +581,7 @@ export default {
}
this.$refs.datatop.validateForm(() => {
self.$refs.dataleft.validateForm(()=> {
self.$refs.dataright.validateForm(()=> {
if (this.data.type === 'PSC') {
flag && self.setDeviceConfigFunction(this.data.id, this.formModel).then(response => {
self.$message.success('设置设备网关映射配置成功');
self.handleClose();
@ -540,7 +589,17 @@ export default {
}).catch(error => {
self.$message.error(this.$t('tip.modifyTheFailure') + error.message);
});
});
} else {
self.$refs.dataright.validateForm(()=> {
flag && self.setDeviceConfigFunction(this.data.id, this.formModel).then(response => {
self.$message.success('设置设备网关映射配置成功');
self.handleClose();
self.$emit('reloadTable');
}).catch(error => {
self.$message.error(this.$t('tip.modifyTheFailure') + error.message);
});
});
}
});
});
},
@ -561,7 +620,7 @@ export default {
this.dialogVisible = false;
this.$refs.datatop.resetForm();
this.$refs.dataleft.resetForm();
this.$refs.dataright.resetForm();
this.$refs.dataright && this.$refs.dataright.resetForm();
this.$refs.form && this.$refs.form.resetFields();
},
mapIdChange(mapId) {

View File

@ -190,7 +190,7 @@ export default {
deviceCode: this.formData.deviceCode,
quadrant: this.formData.quadrant
};
setLswConfig(this.data.id, param).then(response => {
setLswConfig(this.data.id, param).then(() => {
self.$message.success('设置大屏工作站配置成功');
self.handleClose();
self.$emit('reloadTable');
@ -203,7 +203,7 @@ export default {
const param = {
deviceCode: this.formData.deviceCode
};
setCctvConfig(this.data.id, param).then(response => {
setCctvConfig(this.data.id, param).then(() => {
self.$message.success('设置CCTV工作站配置成功');
self.handleClose();
self.$emit('reloadTable');
@ -217,7 +217,7 @@ export default {
deviceCode: this.formData.deviceCode,
psdCode: this.formData.psdCode
};
setVrPsdConfig(this.data.id, param).then(response => {
setVrPsdConfig(this.data.id, param).then(() => {
self.$message.success('设置虚拟屏蔽门工作站配置成功');
self.handleClose();
self.$emit('reloadTable');
@ -230,6 +230,14 @@ export default {
handleClose() {
this.dialogVisible = false;
this.data = {};
this.mapList = [];
this.stationList = [];
this.standList = [];
this.psdList = [];
this.mapId = '';
this.stationCode = '';
this.standCode = '';
this.deviceList = [];
this.$refs.form.resetFields();
}
}

View File

@ -181,7 +181,7 @@ export default {
editConfig(index, row) {
if (row.type === 'LW' || row.type === 'VR_IBP' || row.type === 'ISCS_LW' || row.type === 'ISCS_CW') {
this.$refs.editConfig.doShow(row);
} else if (row.type === 'SWITCH' || row.type === 'SIGNAL' || row.type === 'PSD' || row.type === 'PSL') {
} else if (row.type === 'SWITCH' || row.type === 'SIGNAL' || row.type === 'PSD' || row.type === 'PSL' || row.type === 'PSC') {
this.$refs.editConfigGateway.doShow(row);
} else if (row.type == 'LSW' || row.type == 'CCTV' || row.type == 'VR_PSD') {
this.$refs.editConfigScreen.doShow(row);