会话调整&设备配置调整

This commit is contained in:
fan 2020-07-17 16:35:24 +08:00
parent 7368cd14ca
commit fefd4b53b6
7 changed files with 115 additions and 38 deletions

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

@ -562,6 +562,13 @@ export default {
},
handleSetting() {
this.$refs.chatSetting.doShow();
},
connectMember(val) {
this.conversitionMemberList.forEach(member => {
if (member.memberId == val.memberId) {
member.connect = true;
}
});
}
}
};

View File

@ -32,6 +32,9 @@ export default {
}
},
watch:{
'$store.state.socket.acceptConversionInvite':function(val) {
this.$emit('connectMember', val);
}
},
mounted() {
},

View File

@ -570,9 +570,27 @@ export default {
}
});
this.conversitionMemberList = [];
const temDispatcherList = [];
const temStationSupervisorList = [];
const temMaintainerList = [];
const temDriverList = [];
this.$store.state.training.memberList.forEach(item =>{
this.conversitionMemberList.push({memberId: item.id, connect:true });
switch (item.type) {
case 'DISPATCHER':
temDispatcherList.push({memberId: item.id, connect:true });
break;
case 'STATION_SUPERVISOR':
temStationSupervisorList.push({memberId: item.id, connect:true });
break;
case 'MAINTAINER':
temMaintainerList.push({memberId: item.id, connect:true });
break;
case 'DRIVER':
temDriverList.push({memberId: item.id, connect:true });
break;
}
});
this.conversitionMemberList = [...temDispatcherList, ...temStationSupervisorList, ...temMaintainerList, ...temDriverList];
},
changeMessageList(data) {
this.messageList.push(data);

View File

@ -4,14 +4,11 @@
<div v-for="(chatContent,index) in messageList" :key="index" class="chatContentInClass">
<div :class="chatContent.self?'rightUser':'leftUser'">
<div class="userHeader">
<!-- chatContent.all&& -->
<div v-if="!chatContent.self" class="userName">{{ covertName(chatContent,false) }}</div>
<div :class="chatContent.self?'userChatTime textRight':'userChatTime'">{{ chatContent.time }}</div>
</div>
<div class="userBubble" @click="playAudio(baseUrl+chatContent.src)">
<div class="userMessage">
<!-- chatContent.all&& -->
<!--<span>{{ covertName(chatContent,true) }}</span>-->
<span class="el-icon-video-play playicon" />
<span class="messageText">{{ chatContent.content }}</span>
</div>

View File

@ -67,12 +67,11 @@ export default {
{label: '输出-开门位', value: 'o_o'},
{label: '输出-PSL信号灯控制位', value: 'o_psl_s'}
],
switchLeftValue: [
switchValue: [
{label: '网关地址', value: 'addr'},
{label: '输入-定位表示位', value: 'rnp'},
{label: '输入-反位表示位', value: 'rrp'},
{label: '输入-锁闭表示位', value: 'rl'}
],
switchRightValue: [
{label: '输入-锁闭表示位', value: 'rl'},
{label: '输出-定操(normal)控制位', value: 'wnp'},
{label: '输出-反操(reverse)控制位', value: 'wrp'}
],
@ -136,9 +135,7 @@ export default {
var validateDevice = (rule, value, callback) => {
const list = [];
rule.list.forEach(item=> {
if (item.value !== rule.field && this.formModel[item.value] && this.formModel[item.value] === value) {
list.push(item.label);
} else if (item.value === rule.field) {
if (this.formModel[item.value] && this.formModel[item.value] === value) {
list.push(item.label);
}
});
@ -335,15 +332,15 @@ export default {
this.leftRules = {
rnp: [
{ required: true, message: '请填写\'输入-定位表示位\'', trigger: 'blur' },
{ validator: validateDevice, list: this.switchLeftValue, trigger: ['blur', 'change'] }
{ validator: validateDevice, list: this.switchValue, trigger: ['blur', 'change'] }
],
rrp: [
{ required: true, message: '请填写\'输入-反位表示位\'', trigger: 'blur' },
{ validator: validateDevice, list: this.switchLeftValue, trigger: ['blur', 'change'] }
{ validator: validateDevice, list: this.switchValue, trigger: ['blur', 'change'] }
],
rl: [
{ required: true, message: '请填写\'输入-锁闭表示位\'', trigger: 'blur' },
{ validator: validateDevice, list: this.switchLeftValue, trigger: ['blur', 'change'] }
{ validator: validateDevice, list: this.switchValue, trigger: ['blur', 'change'] }
]
};
this.formRight = {
@ -356,11 +353,11 @@ export default {
this.rightRules = {
wnp: [
{ required: true, message: '请填写\'输出-定操(normal)控制位\'', trigger: 'blur' },
{ validator: validateDevice, list: this.switchRightValue, trigger: ['blur', 'change'] }
{ validator: validateDevice, list: this.switchValue, trigger: ['blur', 'change'] }
],
wrp: [
{ required: true, message: '请填写\'输出-反操(reverse)控制位\'', trigger: 'blur' },
{ validator: validateDevice, list: this.switchRightValue, trigger: ['blur', 'change'] }
{ validator: validateDevice, list: this.switchValue, trigger: ['blur', 'change'] }
]
};
break;

View File

@ -1,6 +1,28 @@
<template>
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" top="10vh" 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 ref="formStation" :model="formModel" label-width="220px" :rules="rulesStation" :inline="inline">
<el-form-item label="关联地图:" prop="mapId">
<el-select v-model="mapId" placeholder="请选择" size="small" style="width: 180px" @change="mapIdChange">
<el-option
v-for="item in mapList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item label="关联车站:" prop="stationCode">
<el-select v-model="formModel.stationCode" placeholder="请选择" style="width: 180px" size="small">
<el-option
v-for="item in stationList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
</el-form>
<div style="height: 485px; overflow-y: auto;">
<el-collapse v-model="activeNames">
<el-collapse-item title="IBP盘AFC闸机配置对象" name="1">
@ -255,6 +277,7 @@
<script>
import { getDeviceDetail, setIbpConfig} from '@/api/project';
import { deepAssign } from '@/utils/index';
import { getAllMapOnline, getStationListNeedAttendant } from '@/api/jmap/map';
const propMap = {
addr: '网关位地址',
ribpsd: 'IBP盘试灯按钮',
@ -460,7 +483,7 @@ export default {
data() {
return {
title: '编辑IBP盘配置',
activeNames: '',
activeNames: [],
checkCount: 0,
data: null,
formModel: {
@ -490,6 +513,11 @@ export default {
{ required: true, message: '请填写IBP盘试灯指示灯位', trigger: 'blur'}
]
},
rulesStation: {
stationCode: [
{ required: true, message: '请选择关联设备', trigger: 'change' }
]
},
dialogVisible: false,
inline: true,
formAfc:{
@ -798,7 +826,10 @@ export default {
rulesSign: {},
rulesFh: {},
rulesEemPlatform:{},
rulesEemHall: {}
rulesEemHall: {},
mapId: '',
mapList: [],
stationList: []
};
},
computed: {
@ -854,6 +885,15 @@ export default {
doShow(row) {
this.initData(row);
this.data = row;
getAllMapOnline().then(res => {
if (res.data && res.data.length) {
this.mapList = res.data;
this.mapId = this.mapList[0].id;
this.mapIdChange(this.mapList[0].id);
}
}).catch(() => {
this.$message.error('获取地图列表失败!');
});
this.dialogVisible = true;
},
validateDevice(rule, value, callback) {
@ -864,23 +904,24 @@ export default {
if (this.formModel[config] && this.formModel[config] === value) {
list.push(propMap[config]);
}
}
for (const prop in propMap[config]) {
if (typeof propMap[config][prop] == 'string') {
if (prop === rule.field && config === rule.config[0] && JSON.stringify(this.formModel[config]) !== '{}' && JSON.stringify(this.formModel[config]) !== '{"pfConfig":{},"shfConfig":{}}' && !value) {
flag = true;
}
if (this.formModel[config][prop] && this.formModel[config][prop] === value) {
list.push(propMap[config][prop]);
}
} else {
for (const childProp in propMap[config][prop]) {
if (typeof propMap[config][prop][childProp] == 'string') {
if (childProp === rule.field && config === rule.config[0] && prop === rule.config[1] && JSON.stringify(this.formModel[config][prop]) !== '{}' && !value) {
flag = true;
}
if (this.formModel[config][prop][childProp] && this.formModel[config][prop][childProp] === value) {
list.push(propMap[config][prop][childProp]);
} else {
for (const prop in propMap[config]) {
if (typeof propMap[config][prop] == 'string') {
if (prop === rule.field && config === rule.config[0] && JSON.stringify(this.formModel[config]) !== '{}' && JSON.stringify(this.formModel[config]) !== '{"pfConfig":{},"shfConfig":{}}' && !value) {
flag = true;
}
if (this.formModel[config][prop] && this.formModel[config][prop] === value) {
list.push(propMap[config][prop]);
}
} else {
for (const childProp in propMap[config][prop]) {
if (typeof propMap[config][prop][childProp] == 'string') {
if (childProp === rule.field && config === rule.config[0] && prop === rule.config[1] && JSON.stringify(this.formModel[config][prop]) !== '{}' && !value) {
flag = true;
}
if (this.formModel[config][prop][childProp] && this.formModel[config][prop][childProp] === value) {
list.push(propMap[config][prop][childProp]);
}
}
}
}
@ -954,6 +995,7 @@ export default {
this.checkCount = 0;
const that = this;
this.$refs.dataTop.validateForm(() => { that.checkCount++; });
this.$refs.formStation.validate((valid) => { if (valid)that.checkCount++; });
this.$refs.dataAfcLeft.validateForm(() => { that.checkCount++; });
this.$refs.dataAfcRight.validateForm(() => { that.checkCount++; });
this.$refs.dataElevatorLeft.validateForm(() => { that.checkCount++; });
@ -972,7 +1014,7 @@ export default {
this.$refs.dataEemPlatformRight.validateForm(() => { that.checkCount++; });
this.$refs.dataEemHallLeft.validateForm(() => { that.checkCount++; });
this.$refs.dataEemHallRight.validateForm(() => { that.checkCount++; });
if (this.checkCount === 19) {
if (this.checkCount === 20) {
const model = deepAssign({}, this.formModel);
if (JSON.stringify(model.afczjConfig) === '{}') {
model.afczjConfig = null;
@ -1026,6 +1068,7 @@ export default {
xhsbConfig: {}
};
this.$refs.dataTop.resetForm();
this.$refs.formStation.resetFields();
this.$refs.dataAfcLeft.resetForm();
this.$refs.dataAfcRight.resetForm();
this.$refs.dataElevatorLeft.resetForm();
@ -1046,6 +1089,18 @@ export default {
this.$refs.dataEemHallRight.resetForm();
this.data = null;
this.dialogVisible = false;
},
mapIdChange(mapId) {
this.stationList = [];
if (mapId) {
getStationListNeedAttendant(mapId).then(resp => {
if (resp.data && resp.data.length) {
this.stationList = resp.data;
}
}).catch(() => {
this.$message.error('获取车站列表失败');
});
}
}
}
};