Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test_ls
This commit is contained in:
commit
d504639e15
@ -897,6 +897,12 @@ export const menuOperate = {
|
||||
operation: OperationEvent.RailCommand.railQueryRegister.menu.operation,
|
||||
cmdType: CMD.RAIL.CMD_RAIL_QUERY_REGISTER
|
||||
}
|
||||
},
|
||||
Conversation: {
|
||||
Chat: {
|
||||
operation: OperationEvent.Conversation.Chat.menu.operation,
|
||||
cmdType: CMD.Conversation.CMD_Conversation_Chat_Text
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
@ -128,7 +128,8 @@ export default {
|
||||
{ label: '列车', value: 'Train' },
|
||||
{ label: '方向杆', value: 'DirectionRod'},
|
||||
{ label: 'CTC', value: 'CTC' },
|
||||
{ label: '路票', value: 'RAIL' }
|
||||
{ label: '路票', value: 'RAIL' },
|
||||
{ label: '会话', value: 'Conversation' }
|
||||
],
|
||||
|
||||
simulationDeviceList:[
|
||||
|
@ -113,6 +113,10 @@ class CommandHandle {
|
||||
RAIL_FILL_IN_REGISTER: {
|
||||
operate: 'RAIL_FILL_IN_REGISTER',
|
||||
paramList: [{name: 'stationCode'}, {name: 'line'}]
|
||||
},
|
||||
Conversation_Chat_Text: {
|
||||
operate: 'Conversation_Chat_Text',
|
||||
paramList: [{name: 'content'}]
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -4168,6 +4168,14 @@ export const OperationEvent = {
|
||||
domId: '_Tips-Driver-parkingTrain'
|
||||
}
|
||||
}
|
||||
},
|
||||
Conversation: {
|
||||
Chat: {
|
||||
menu: {
|
||||
operation: '1401',
|
||||
domId: '_Tips-Conversation-Chat'
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
||||
</div>
|
||||
<div class="chat-box-footer">
|
||||
<el-input v-model="textContent" size="small" placeholder="请输入会话文字,点击T发送" style="flex: 1; margin-left: 5px;" :rows="1" />
|
||||
<el-button size="mini" class="chat-box-footer-create" :disabled="contentSend" @click="sendText">T</el-button>
|
||||
<el-button :id="sendTextId" size="mini" class="chat-box-footer-create" :disabled="contentSend" @click="sendText">T</el-button>
|
||||
<el-button v-if="!$route.query.record" class="chat-box-footer-create chat-box-footer-send" :class="{'active': recordSending}" :disabled="audioPlay" size="mini" type="primary" @click="startRecording()">
|
||||
<el-progress id="voice_progress_bar" type="circle" :show-text="false" :percentage="100/60*seconds" :width="40" :stroke-width="2" status="success" />
|
||||
<i v-if="recordSending" class="el-icon-close close_icon" @click.stop="cancleRecording()" />
|
||||
@ -52,6 +52,8 @@ import {sendChatAudioBase64, overSimulationConversition, getAllConversition, acc
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
import { getSimulationMemberList} from '@/api/simulation';
|
||||
import { getUserListCommon } from '@/api/rtSimulation';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
|
||||
export default {
|
||||
name: 'NewChatBox',
|
||||
components:{
|
||||
@ -144,6 +146,9 @@ export default {
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
sendTextId() {
|
||||
return OperationEvent.Conversation.Chat.menu.domId;
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
@ -761,8 +766,15 @@ export default {
|
||||
});
|
||||
},
|
||||
sendText() {
|
||||
sendChatText(this.group, {content: this.textContent}).then(resp => {
|
||||
this.textContent = '';
|
||||
// sendChatText(this.group, {content: this.textContent}).then(resp => {
|
||||
// this.textContent = '';
|
||||
// }).catch((error) => {
|
||||
// this.$message.error('发送会话文字失败:' + error.message);
|
||||
// });
|
||||
commitOperate(menuOperate.Conversation.Chat, {content: this.textContent}, 3).then(({valid})=>{
|
||||
if (valid) {
|
||||
this.textContent = '';
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.$message.error('发送会话文字失败:' + error.message);
|
||||
});
|
||||
|
@ -85,6 +85,23 @@ export default {
|
||||
this.$store.dispatch('training/setStopCountTime');
|
||||
this.$store.dispatch('training/setTrainingStart', false);
|
||||
EventBus.$emit('viewLoading', false);
|
||||
},
|
||||
'$store.state.socket.simulationRoleList':function(list) {
|
||||
if (list && list.length) {
|
||||
this.checkRoleChange(list);
|
||||
}
|
||||
},
|
||||
'$store.state.training.simulationUserList': function(val) {
|
||||
const userInfo = this.$store.state.training.simulationUserList.find(user => user.userId == this.$store.state.user.id );
|
||||
if (userInfo.type === 'STATION_SUPERVISOR') {
|
||||
this.$store.dispatch('map/setShowCentralizedStationCode', userInfo.deviceCode);
|
||||
const mapDevice = this.$store.state.map.mapDevice;
|
||||
const list = [];
|
||||
for (const key in mapDevice) {
|
||||
list.push(mapDevice[key]);
|
||||
}
|
||||
this.$jlmap.updateShowStation(list, userInfo.deviceCode);
|
||||
}
|
||||
}
|
||||
},
|
||||
// mounted() {
|
||||
@ -207,6 +224,19 @@ export default {
|
||||
if (!isSuccess) {
|
||||
this.$store.dispatch('map/mapClear');
|
||||
}
|
||||
},
|
||||
checkRoleChange(list) {
|
||||
list.forEach(item => {
|
||||
if (item.messageType === 'PLAY_CHANGE' && item.userId == this.$store.state.user.id && item.type === 'STATION_SUPERVISOR') {
|
||||
this.$store.dispatch('map/setShowCentralizedStationCode', item.deviceCode);
|
||||
const mapDevice = this.$store.state.map.mapDevice;
|
||||
const list = [];
|
||||
for (const key in mapDevice) {
|
||||
list.push(mapDevice[key]);
|
||||
}
|
||||
this.$jlmap.updateShowStation(list, item.deviceCode);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -139,6 +139,11 @@ export default {
|
||||
this.$jlmap.updateShowStation(list, userInfo.deviceCode);
|
||||
}
|
||||
},
|
||||
'$store.state.socket.simulationRoleList':function(list) {
|
||||
if (list && list.length) {
|
||||
this.checkRoleChange(list);
|
||||
}
|
||||
},
|
||||
async $route() {
|
||||
loadTrainingInSimulation(this.group, this.$route.query.trainingId).then(resp => {
|
||||
this.setTrainingData(resp);
|
||||
@ -331,6 +336,19 @@ export default {
|
||||
}
|
||||
});
|
||||
window.open(routeData.href, '_blank');
|
||||
},
|
||||
checkRoleChange(list) {
|
||||
list.forEach(item => {
|
||||
if (item.messageType === 'PLAY_CHANGE' && item.userId == this.$store.state.user.id && item.type === 'STATION_SUPERVISOR') {
|
||||
this.$store.dispatch('map/setShowCentralizedStationCode', item.deviceCode);
|
||||
const mapDevice = this.$store.state.map.mapDevice;
|
||||
const list = [];
|
||||
for (const key in mapDevice) {
|
||||
list.push(mapDevice[key]);
|
||||
}
|
||||
this.$jlmap.updateShowStation(list, item.deviceCode);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -125,6 +125,9 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-collapse-item>
|
||||
<el-collapse-item title="批量计算区段长度" name="8">
|
||||
<el-button class="sectionSetting" @click="calculateSectionLength" type="primary" size="small">设置</el-button>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
</div>
|
||||
</template>
|
||||
@ -424,6 +427,24 @@ export default {
|
||||
}
|
||||
models.push(deepAssign(section, { _type: 'Section' }));
|
||||
this.$emit('updateMapModel', models);
|
||||
},
|
||||
calculateSectionLength(){
|
||||
const precisionOf = num => num.toString().split('.').pop().length
|
||||
this.$confirm('确认设置所有区段的实际长度吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(()=>{
|
||||
this.sectionList.forEach(section => {
|
||||
const { kmMin, kmMax } = section
|
||||
if (typeof kmMin === 'number' && typeof kmMax === 'number') {
|
||||
const precision = Math.max(precisionOf(kmMin), precisionOf(kmMax))
|
||||
section.lengthFact = Number((kmMax - kmMin).toFixed(precision))
|
||||
}
|
||||
})
|
||||
this.$emit('updateMapModel', this.sectionList)
|
||||
this.$message.success('区段长度设置成功!')
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -17,15 +17,12 @@
|
||||
>
|
||||
<el-table-column label="条件关系">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="!scope.row.valuables[0]" class="nullDiv" @click.stop="editValue(scope.row, '0')">空</div>
|
||||
<div v-else>
|
||||
<ExpressionValue ref="ExpressionValue" :materials-list="materialsList" :get-device-list="getDeviceList" :value-obj="scope.row" :index-path="scope.$index + ''" :active-index-path="activeIndexPath" @editValue="editValue" />
|
||||
</div>
|
||||
<ExpressionValue ref="ExpressionValue" :materials-list="materialsList" :get-device-list="getDeviceList" :value-obj="scope.row" :index-path="scope.$index + ''" :active-index-path="activeIndexPath" @editValue="editValue" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="conditionBtn">
|
||||
<!-- <el-button size="small" @click="addExp">新增条件关系</el-button> -->
|
||||
<!-- <el-button size="small" @click="addExp()">新增条件关系</el-button> -->
|
||||
<el-button size="small" :disabled="deleteDisabled" @click="deleteExp">删除条件关系</el-button>
|
||||
<el-button size="small" :disabled="clearDisabled" @click="clearExp">清空条件关系</el-button>
|
||||
</div>
|
||||
@ -152,14 +149,14 @@ export default {
|
||||
},
|
||||
deleteDisabled() {
|
||||
let s = false;
|
||||
if (!this.tableData[0] || !this.tableData[0].valuables || !this.tableData[0].valuables[0] || !this.activeIndexPath) {
|
||||
if (!this.tableData[0] || !this.tableData[0].valuables || !this.activeIndexPath) {
|
||||
s = true;
|
||||
}
|
||||
return s;
|
||||
},
|
||||
clearDisabled() {
|
||||
let s = false;
|
||||
if (!this.tableData[0] || !this.tableData[0].valuables || !this.tableData[0].valuables[0]) {
|
||||
if (!this.tableData[0] || !this.tableData[0].valuables) {
|
||||
s = true;
|
||||
}
|
||||
return s;
|
||||
@ -172,11 +169,14 @@ export default {
|
||||
if (obj) {
|
||||
addData = obj;
|
||||
}
|
||||
const data = {
|
||||
let data = {
|
||||
t: 'E',
|
||||
operator: 'AND',
|
||||
valuables: [this.tableData[0], addData]
|
||||
};
|
||||
if (this.clearDisabled) {
|
||||
data = addData;
|
||||
}
|
||||
this.tableData.splice(0, 1, data);
|
||||
},
|
||||
deleteExp() {
|
||||
@ -201,12 +201,7 @@ export default {
|
||||
}
|
||||
},
|
||||
clearExp() {
|
||||
const data = {
|
||||
t: 'E',
|
||||
operator: 'EQ',
|
||||
valuables: []
|
||||
};
|
||||
this.tableData.splice(0, 1, data);
|
||||
this.tableData = [];
|
||||
},
|
||||
editValue(data, indexPath) {
|
||||
this.activeIndexPath = indexPath;
|
||||
@ -282,13 +277,7 @@ export default {
|
||||
if (data) {
|
||||
this.tableData = [data];
|
||||
} else {
|
||||
this.tableData = [
|
||||
{
|
||||
t: 'E',
|
||||
operator: 'EQ',
|
||||
valuables: []
|
||||
}
|
||||
];
|
||||
this.tableData = [];
|
||||
}
|
||||
this.rowIndex = rowIndex;
|
||||
this.conditionKey = conditionKey;
|
||||
@ -330,13 +319,13 @@ export default {
|
||||
// cursor: pointer;
|
||||
// top:-28px;
|
||||
// }
|
||||
.nullDiv {
|
||||
width: 100%;
|
||||
height: 28px;
|
||||
line-height: 28px;
|
||||
cursor: pointer;
|
||||
color: #ccc;
|
||||
}
|
||||
// .nullDiv {
|
||||
// width: 100%;
|
||||
// height: 28px;
|
||||
// line-height: 28px;
|
||||
// cursor: pointer;
|
||||
// color: #ccc;
|
||||
// }
|
||||
.conditionBtn {
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
|
Loading…
Reference in New Issue
Block a user