Merge branch 'test_dispaly' of https://git.code.tencent.com/lian-cbtc/jl-client into test_dispaly

This commit is contained in:
joylink_cuiweidong 2022-11-30 17:56:29 +08:00
commit fbf796b151
12 changed files with 78 additions and 91 deletions

View File

@ -552,3 +552,10 @@ export function getGroupByMapAndFunction(mapId, functionId) {
method: 'get'
});
}
/** 由系统管理员和教员销毁仿真 */
export function destroySimulationByAdmin(group) {
return request({
url: `/simulation/${group}/destroy`,
method: 'post'
});
}

View File

@ -122,11 +122,16 @@ const training = {
store.dispatch('training/setOperate', operate);
commit('setTrainingOperate', operate);
return new Promise((resolve, reject) => {
NewHandler.handle(operate).then(rtn => {
resolve(rtn);
}).catch(e => {
reject(e);
});
if (!store.state.training.roles) {
reject({message: '您目前无仿真成员角色!'});
} else {
NewHandler.handle(operate).then(rtn => {
resolve(rtn);
}).catch(e => {
reject(e);
});
}
});
},
setOperateErrMsg: ({ commit }, msg) => {

View File

@ -27,7 +27,7 @@
<span :id="data.id" slot-scope="{ data }" class="custom-tree-node">
<span>{{ data.labelName }}</span>
<span v-if="data.type">
<el-select :key="data.id" v-model="data.userId" placeholder="请选择" clearable size="mini" @change="nodeMemberChange($event, data)">
<el-select :key="data.id" v-model="data.userId" :disabled="singleMember && roles !== data.type" placeholder="请选择" clearable size="mini" @change="nodeMemberChange($event, data)">
<el-option
v-for="item in simulationUserList"
:key="item.userId"
@ -73,6 +73,7 @@ export default {
data() {
return {
show: false,
singleMember: false,
direction: 'ltr',
queryMember: '',
room: {
@ -163,6 +164,10 @@ export default {
},
username() {
return this.$store.state.user.nickname;
},
roles() {
console.log(this.$store.state.training.userRole, '-----------------');
return this.$store.state.training.roles;
}
},
watch: {
@ -358,6 +363,9 @@ export default {
if (list && list.length) { //
this.checkRoleChange(list);
}
},
'$store.state.training.domConfig': function(val) {
this.singleMember = val.singleMember;
}
},
methods: {

View File

@ -1,16 +1,22 @@
<template>
<div class="simulationControlAll" style="z-index: 2009;">
<el-button class="controlButton" type="info" style="background: #000;" :loading="pauseLoading" circle :class="simulationPaused?'el-icon-video-play':'el-icon-video-pause'" @click="startOrPause" />
<div>
<div class="simulationMenu" @click="showMenuSpeedList">{{ `x${speed}` }}</div>
<div v-show="isShowSpeedMenuList" class="simulationMenuList" style="right: 85px;">
<div v-for="(each, index) in speedList" :key="index">
<div class="eachSimulationMenu" :class="{'active' :speed === each.value}" @click="speedChange(each.value)">{{ each.label }}</div>
<div style="color: #fbfbfb;background: #0C161A;margin: 3px;padding: 3px;border-radius: 5px;">
<span style="font-size: 16px;">{{ time }}</span>
<span style="margin-left: 10px;font-size: 14px;">{{ dateString }}</span>
</div>
<div style="display: flex;">
<el-button class="controlButton" type="info" style="background: #000;" :loading="pauseLoading" circle :class="simulationPaused?'el-icon-video-play':'el-icon-video-pause'" @click="startOrPause" />
<div>
<div class="simulationMenu" @click="showMenuSpeedList">{{ `x${speed}` }}</div>
<div v-show="isShowSpeedMenuList" class="simulationMenuList" style="right: 85px;">
<div v-for="(each, index) in speedList" :key="index">
<div class="eachSimulationMenu" :class="{'active' :speed === each.value}" @click="speedChange(each.value)">{{ each.label }}</div>
</div>
</div>
</div>
</div>
<div>
<div class="simulationMenu" style="width: 70px;" :style="{background: nowMode === '正常操作' ? '#0fb20b' :'#efc007'}" @click="changeOperateMode">{{ nowMode }}</div>
<div>
<div class="simulationMenu" style="width: 70px;" :style="{background: nowMode === '正常操作' ? '#0fb20b' :'#efc007'}" @click="changeOperateMode">{{ nowMode }}</div>
</div>
</div>
</div>
</template>
@ -18,6 +24,7 @@
import { simulationPause, simulationStart, timesSpeedPlayback } from '@/api/rtSimulation';
import { OperateMode } from '@/scripts/ConstDic';
import { getSessionStorage } from '@/utils/auth';
import { timestampFormat } from '@/utils/date';
export default {
name:'SimulationControl',
data() {
@ -26,7 +33,9 @@ export default {
group:'',
speed: 1,
isShowSpeedMenuList: false,
isShowModeMenuList: false
isShowModeMenuList: false,
time: '',
dateString: ''
};
},
computed: {
@ -69,6 +78,11 @@ export default {
}
}
},
watch: {
'$store.state.socket.simulationTimeSync': function (time) { // 仿
this.initDate(time);
}
},
mounted() {
this.group = this.$route.query.group;
window.addEventListener('click', this.close, false);
@ -77,6 +91,10 @@ export default {
window.removeEventListener('click', this.close);
},
methods:{
initDate(date) {
this.time = timestampFormat('HH:mm:ss', date);
this.dateString = timestampFormat('YYYYMMDD', date);
},
changeOperateMode() {
let val = '';
if (this.nowMode === '正常操作') {
@ -132,11 +150,14 @@ export default {
position: absolute;
bottom: 9px;
right: 78px;
display: flex;
padding: 2px 5px;
border-radius: 5px;
align-items: center;
background: #ccc;
-webkit-user-select:none;
-moz-user-select:none;
-ms-user-select:none;
user-select:none;
}
.controlButton{
font-size: 22px;

View File

@ -47,8 +47,7 @@ export default {
},
methods: {
doShow() {
console.log(this.$store.state.training.initTime);
this.formModel.initTime = new Date(this.$store.state.training.initTime || null);
this.formModel.initTime = new Date(this.$store.state.socket.simulationTimeSync || null);
this.show = true;
},
doClose() {

View File

@ -112,7 +112,7 @@ export default {
return this.$store.state.training.roleDeviceCode;
},
menuShow() {
return !this.$route.query.singleClient;
return !this.$route.query.singleClient || !this.$store.state.training.roles;
}
},
watch: {
@ -134,6 +134,8 @@ export default {
this.setCentralizedStationList(map); //
if (this.$route.query.client) {
this.pictureChange(this.$route.query.client);
} else if (!this.$store.state.training.roles) {
this.pictureChange('dispatchWork');
}
}
} catch (error) {

View File

@ -185,8 +185,8 @@ export default {
if (trainingDetail && trainingDetail.client) {
this.changePictureShow(trainingDetail.client);
} else {
this.isFirst = false;
this.initPictureShow();
this.isFirst = false;
}
}
},

View File

@ -116,6 +116,7 @@ export default {
console.log(tipPosition, this.trainingType, '-------');
this.$emit('backDesignPane');
this.tagIndex = 0;
this.editMode = false;
},
covertString(data) {
if (data.userOperationType) {

View File

@ -890,6 +890,7 @@ export default {
this.getUserRole();
}
this.commonMessageList = messages.sort(this.sortByMessageTime);
this.messageList = [...this.commonMessageList];
this.initCommonMemberList();
});
},
@ -994,15 +995,15 @@ export default {
this.filterNode();
});
},
clearAllData() {
this.recordSending = false;
this.inter = null;
this.recorders = null;
this.microphone = null;
this.treeData = [];
this.conversitionMemberList = [];
this.messageList = [];
},
// clearAllData() {
// this.recordSending = false;
// this.inter = null;
// this.recorders = null;
// this.microphone = null;
// this.treeData = [];
// this.conversitionMemberList = [];
// this.messageList = [];
// },
//
resetCoversition() {
this.commonMessageList = [];

View File

@ -81,6 +81,7 @@ export default {
{
type: 'button',
title: this.$t('trainingManage.operate'),
hide: this.hasTeachingDataManage,
width: '150',
buttons: [
{

View File

@ -193,7 +193,6 @@ export default {
let series = [];
const stations = this.$store.state.runPlan.stations;
const planData = this.$store.state.runPlan.planData;
console.log(stations, planData, '-----------');
this.kmRangeMap = this.PlanParser.convertStationsToMap(stations);
if (this.$route.query.lineCode === '07') {
series = this.pushModels(series, [this.PlanParser.initializeAxisX(stations)]);

View File

@ -5,11 +5,9 @@
</div>
</template>
<script>
import ConstConfig from '@/scripts/ConstConfig';
import Cookies from 'js-cookie';
import ViewMember from './viewMember';
// import { getExistingSimulation, deleteExistingSimulation } from '@/api/simulation';
import { getExistSimulationList, destroySimulation } from '@/api/rtSimulation';
import { getExistSimulationList } from '@/api/rtSimulation';
import { destroySimulationByAdmin } from '@/api/simulation';
export default {
name: 'SimulationManage',
components: {
@ -35,16 +33,8 @@ export default {
userName: {
type: 'text',
label: this.$t('system.userName')
},
prdType: {
type: 'select',
label: this.$t('system.prdType'),
config: {
data: []
}
}
}
},
simulationTypeList: [{label: '仿真', value: 'SIMULATION'}, {label: '课程', value: 'LESSON'}, {label: '考试', value: 'EXAM'}, {label: '剧本编制', value: 'SCRIPT_MAKING'}],
queryList: {
@ -53,10 +43,6 @@ export default {
paginationHiden: true,
indexShow: true,
columns: [
// {
// title: this.$t('system.userName'),
// prop: 'creator.name'
// },
{
title: '仿真ID',
prop: 'id'
@ -76,14 +62,6 @@ export default {
title: '仿真倍速',
prop: 'speed'
},
// {
// title: '',
// prop: 'type',
// type: 'tag',
// columnValue: (row) => { return this.$convertField(row.type, this.simulationTypeList, ['value', 'label']); },
// tagType: (row) => { return ''; }
//
// },
{
title: this.$t('system.mapName'),
prop: 'map.name',
@ -95,20 +73,6 @@ export default {
return 'success';
}
},
{
title: this.$t('system.prdType'),
prop: 'prodType',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.prodType, this.prdTypeList, ['value', 'label']); },
tagType: (row) => { return ''; }
},
// {
// title: this.$t('system.simulationGroupId'),
// prop: 'userList',
// type: 'basicText',
// columnValue: (row) => { return this.listJoiningTogether(row.userList); }
// },
{
type: 'button',
title: this.$t('global.operate'),
@ -130,28 +94,7 @@ export default {
currentModel: {}
};
},
computed:{
prdTypeList() {
const productTypeList = ConstConfig.ConstSelect.prdType;
return Cookies.get('user_lang') == 'en'
? productTypeList.map(elem => { return { value: elem.value, label: elem.enlabel }; })
: productTypeList.map(elem => { return { value: elem.value, label: elem.label }; });
}
},
created() {
this.queryForm.queryObject.prdType.config.data = this.prdTypeList;
},
methods: {
// listJoiningTogether(sessionList) {
// let sessionId = '';
// if (sessionList && sessionList.length > 0) {
// sessionList.forEach((item) => {
// sessionId = sessionId + item.name + '(' + item.id + ')' + ',';
// });
// sessionId = sessionId.substring(0, sessionId.length - 1);
// }
// return sessionId;
// },
viewMember(index, row) {
this.$refs.viewMember.doShow(row.id);
},
@ -161,7 +104,7 @@ export default {
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
destroySimulation(row.id).then(response => {
destroySimulationByAdmin(row.id).then(response => {
this.$message.success(this.$t('system.deleteSuccess'));
this.reloadTable();
}).catch(() => {